aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/firewire/ohci.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 448598876278..4f6d72f87f6f 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -253,7 +253,6 @@ static inline struct fw_ohci *fw_ohci(struct fw_card *card)
253#define OHCI1394_MAX_PHYS_RESP_RETRIES 0x8 253#define OHCI1394_MAX_PHYS_RESP_RETRIES 0x8
254 254
255#define OHCI1394_REGISTER_SIZE 0x800 255#define OHCI1394_REGISTER_SIZE 0x800
256#define OHCI_LOOP_COUNT 500
257#define OHCI1394_PCI_HCI_Control 0x40 256#define OHCI1394_PCI_HCI_Control 0x40
258#define SELF_ID_BUF_SIZE 0x800 257#define SELF_ID_BUF_SIZE 0x800
259#define OHCI_TCODE_PHY_PACKET 0x0e 258#define OHCI_TCODE_PHY_PACKET 0x0e
@@ -1967,14 +1966,18 @@ static irqreturn_t irq_handler(int irq, void *data)
1967 1966
1968static int software_reset(struct fw_ohci *ohci) 1967static int software_reset(struct fw_ohci *ohci)
1969{ 1968{
1969 u32 val;
1970 int i; 1970 int i;
1971 1971
1972 reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_softReset); 1972 reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_softReset);
1973 for (i = 0; i < 500; i++) {
1974 val = reg_read(ohci, OHCI1394_HCControlSet);
1975 if (!~val)
1976 return -ENODEV; /* Card was ejected. */
1973 1977
1974 for (i = 0; i < OHCI_LOOP_COUNT; i++) { 1978 if (!(val & OHCI1394_HCControl_softReset))
1975 if ((reg_read(ohci, OHCI1394_HCControlSet) &
1976 OHCI1394_HCControl_softReset) == 0)
1977 return 0; 1979 return 0;
1980
1978 msleep(1); 1981 msleep(1);
1979 } 1982 }
1980 1983