Changeset fcc525d in mainline


Ignore:
Timestamp:
2011-03-17T13:49:20Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0fd82c9, 3036735
Parents:
87037c48
Message:

Limit the number of hw retries

Location:
uspace/drv/uhci-hcd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/uhci_hc.c

    r87037c48 rfcc525d  
    9797
    9898        instance->hw_interrupts = interrupts;
     99        instance->hw_failures = 0;
     100
    99101        /* Setup UHCI function. */
    100102        instance->ddf_instance = fun;
     
    360362        /* bits 4 and 5 indicate hc error */
    361363        if (status & 0x18) {
     364                usb_log_error("UHCI hardware failure!.\n");
     365                ++instance->hw_failures;
    362366                transfer_list_abort_all(&instance->transfers_interrupt);
    363367                transfer_list_abort_all(&instance->transfers_control_slow);
    364368                transfer_list_abort_all(&instance->transfers_control_full);
    365369                transfer_list_abort_all(&instance->transfers_bulk_full);
    366                 /* reinitialize hw, this triggers virtual disconnect*/
    367                 uhci_hc_init_hw(instance);
     370
     371                if (instance->hw_failures < UHCI_ALLOWED_HW_FAIL) {
     372                        /* reinitialize hw, this triggers virtual disconnect*/
     373                        uhci_hc_init_hw(instance);
     374                } else {
     375                        usb_log_fatal("Too many UHCI hardware failures!.\n");
     376                        uhci_hc_fini(instance);
     377                }
    368378        }
    369379}
  • uspace/drv/uhci-hcd/uhci_hc.h

    r87037c48 rfcc525d  
    8080#define UHCI_CLEANER_TIMEOUT 10000
    8181#define UHCI_DEBUGER_TIMEOUT 5000000
     82#define UHCI_ALLOWED_HW_FAIL 5
    8283
    8384typedef struct uhci_hc {
     
    100101        fid_t debug_checker;
    101102        bool hw_interrupts;
     103        unsigned hw_failures;
    102104
    103105        ddf_fun_t *ddf_instance;
Note: See TracChangeset for help on using the changeset viewer.