diff options
Diffstat (limited to 'drivers/firewire/ohci.c')
-rw-r--r-- | drivers/firewire/ohci.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index c3eb471d22f7..f8a71397cf6e 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include <linux/spinlock.h> | 38 | #include <linux/spinlock.h> |
39 | #include <linux/string.h> | 39 | #include <linux/string.h> |
40 | 40 | ||
41 | #include <asm/atomic.h> | ||
42 | #include <asm/byteorder.h> | 41 | #include <asm/byteorder.h> |
43 | #include <asm/page.h> | 42 | #include <asm/page.h> |
44 | #include <asm/system.h> | 43 | #include <asm/system.h> |
@@ -187,7 +186,6 @@ struct fw_ohci { | |||
187 | int node_id; | 186 | int node_id; |
188 | int generation; | 187 | int generation; |
189 | int request_generation; /* for timestamping incoming requests */ | 188 | int request_generation; /* for timestamping incoming requests */ |
190 | atomic_t bus_seconds; | ||
191 | 189 | ||
192 | bool use_dualbuffer; | 190 | bool use_dualbuffer; |
193 | bool old_uninorth; | 191 | bool old_uninorth; |
@@ -276,7 +274,7 @@ static void log_irqs(u32 evt) | |||
276 | !(evt & OHCI1394_busReset)) | 274 | !(evt & OHCI1394_busReset)) |
277 | return; | 275 | return; |
278 | 276 | ||
279 | fw_notify("IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt, | 277 | fw_notify("IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt, |
280 | evt & OHCI1394_selfIDComplete ? " selfID" : "", | 278 | evt & OHCI1394_selfIDComplete ? " selfID" : "", |
281 | evt & OHCI1394_RQPkt ? " AR_req" : "", | 279 | evt & OHCI1394_RQPkt ? " AR_req" : "", |
282 | evt & OHCI1394_RSPkt ? " AR_resp" : "", | 280 | evt & OHCI1394_RSPkt ? " AR_resp" : "", |
@@ -286,7 +284,6 @@ static void log_irqs(u32 evt) | |||
286 | evt & OHCI1394_isochTx ? " IT" : "", | 284 | evt & OHCI1394_isochTx ? " IT" : "", |
287 | evt & OHCI1394_postedWriteErr ? " postedWriteErr" : "", | 285 | evt & OHCI1394_postedWriteErr ? " postedWriteErr" : "", |
288 | evt & OHCI1394_cycleTooLong ? " cycleTooLong" : "", | 286 | evt & OHCI1394_cycleTooLong ? " cycleTooLong" : "", |
289 | evt & OHCI1394_cycle64Seconds ? " cycle64Seconds" : "", | ||
290 | evt & OHCI1394_cycleInconsistent ? " cycleInconsistent" : "", | 287 | evt & OHCI1394_cycleInconsistent ? " cycleInconsistent" : "", |
291 | evt & OHCI1394_regAccessFail ? " regAccessFail" : "", | 288 | evt & OHCI1394_regAccessFail ? " regAccessFail" : "", |
292 | evt & OHCI1394_busReset ? " busReset" : "", | 289 | evt & OHCI1394_busReset ? " busReset" : "", |
@@ -294,8 +291,7 @@ static void log_irqs(u32 evt) | |||
294 | OHCI1394_RSPkt | OHCI1394_reqTxComplete | | 291 | OHCI1394_RSPkt | OHCI1394_reqTxComplete | |
295 | OHCI1394_respTxComplete | OHCI1394_isochRx | | 292 | OHCI1394_respTxComplete | OHCI1394_isochRx | |
296 | OHCI1394_isochTx | OHCI1394_postedWriteErr | | 293 | OHCI1394_isochTx | OHCI1394_postedWriteErr | |
297 | OHCI1394_cycleTooLong | OHCI1394_cycle64Seconds | | 294 | OHCI1394_cycleTooLong | OHCI1394_cycleInconsistent | |
298 | OHCI1394_cycleInconsistent | | ||
299 | OHCI1394_regAccessFail | OHCI1394_busReset) | 295 | OHCI1394_regAccessFail | OHCI1394_busReset) |
300 | ? " ?" : ""); | 296 | ? " ?" : ""); |
301 | } | 297 | } |
@@ -1385,7 +1381,7 @@ static void bus_reset_tasklet(unsigned long data) | |||
1385 | static irqreturn_t irq_handler(int irq, void *data) | 1381 | static irqreturn_t irq_handler(int irq, void *data) |
1386 | { | 1382 | { |
1387 | struct fw_ohci *ohci = data; | 1383 | struct fw_ohci *ohci = data; |
1388 | u32 event, iso_event, cycle_time; | 1384 | u32 event, iso_event; |
1389 | int i; | 1385 | int i; |
1390 | 1386 | ||
1391 | event = reg_read(ohci, OHCI1394_IntEventClear); | 1387 | event = reg_read(ohci, OHCI1394_IntEventClear); |
@@ -1455,12 +1451,6 @@ static irqreturn_t irq_handler(int irq, void *data) | |||
1455 | fw_notify("isochronous cycle inconsistent\n"); | 1451 | fw_notify("isochronous cycle inconsistent\n"); |
1456 | } | 1452 | } |
1457 | 1453 | ||
1458 | if (event & OHCI1394_cycle64Seconds) { | ||
1459 | cycle_time = reg_read(ohci, OHCI1394_IsochronousCycleTimer); | ||
1460 | if ((cycle_time & 0x80000000) == 0) | ||
1461 | atomic_inc(&ohci->bus_seconds); | ||
1462 | } | ||
1463 | |||
1464 | return IRQ_HANDLED; | 1454 | return IRQ_HANDLED; |
1465 | } | 1455 | } |
1466 | 1456 | ||
@@ -1554,8 +1544,7 @@ static int ohci_enable(struct fw_card *card, | |||
1554 | OHCI1394_reqTxComplete | OHCI1394_respTxComplete | | 1544 | OHCI1394_reqTxComplete | OHCI1394_respTxComplete | |
1555 | OHCI1394_isochRx | OHCI1394_isochTx | | 1545 | OHCI1394_isochRx | OHCI1394_isochTx | |
1556 | OHCI1394_postedWriteErr | OHCI1394_cycleTooLong | | 1546 | OHCI1394_postedWriteErr | OHCI1394_cycleTooLong | |
1557 | OHCI1394_cycleInconsistent | | 1547 | OHCI1394_cycleInconsistent | OHCI1394_regAccessFail | |
1558 | OHCI1394_cycle64Seconds | OHCI1394_regAccessFail | | ||
1559 | OHCI1394_masterIntEnable); | 1548 | OHCI1394_masterIntEnable); |
1560 | if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS) | 1549 | if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS) |
1561 | reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset); | 1550 | reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset); |
@@ -1821,7 +1810,7 @@ static u32 cycle_timer_ticks(u32 cycle_timer) | |||
1821 | * error. (A PCI read should take at least 20 ticks of the 24.576 MHz timer to | 1810 | * error. (A PCI read should take at least 20 ticks of the 24.576 MHz timer to |
1822 | * execute, so we have enough precision to compute the ratio of the differences.) | 1811 | * execute, so we have enough precision to compute the ratio of the differences.) |
1823 | */ | 1812 | */ |
1824 | static u64 ohci_get_bus_time(struct fw_card *card) | 1813 | static u32 ohci_get_cycle_time(struct fw_card *card) |
1825 | { | 1814 | { |
1826 | struct fw_ohci *ohci = fw_ohci(card); | 1815 | struct fw_ohci *ohci = fw_ohci(card); |
1827 | u32 c0, c1, c2; | 1816 | u32 c0, c1, c2; |
@@ -1849,7 +1838,7 @@ static u64 ohci_get_bus_time(struct fw_card *card) | |||
1849 | && i++ < 20); | 1838 | && i++ < 20); |
1850 | } | 1839 | } |
1851 | 1840 | ||
1852 | return ((u64)atomic_read(&ohci->bus_seconds) << 32) | c2; | 1841 | return c2; |
1853 | } | 1842 | } |
1854 | 1843 | ||
1855 | static void copy_iso_headers(struct iso_context *ctx, void *p) | 1844 | static void copy_iso_headers(struct iso_context *ctx, void *p) |
@@ -2426,7 +2415,7 @@ static const struct fw_card_driver ohci_driver = { | |||
2426 | .send_response = ohci_send_response, | 2415 | .send_response = ohci_send_response, |
2427 | .cancel_packet = ohci_cancel_packet, | 2416 | .cancel_packet = ohci_cancel_packet, |
2428 | .enable_phys_dma = ohci_enable_phys_dma, | 2417 | .enable_phys_dma = ohci_enable_phys_dma, |
2429 | .get_bus_time = ohci_get_bus_time, | 2418 | .get_cycle_time = ohci_get_cycle_time, |
2430 | 2419 | ||
2431 | .allocate_iso_context = ohci_allocate_iso_context, | 2420 | .allocate_iso_context = ohci_allocate_iso_context, |
2432 | .free_iso_context = ohci_free_iso_context, | 2421 | .free_iso_context = ohci_free_iso_context, |