diff options
Diffstat (limited to 'drivers/firewire/ohci.c')
-rw-r--r-- | drivers/firewire/ohci.c | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 5d524254499e..94260aa76aa3 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -275,7 +275,7 @@ static void log_irqs(u32 evt) | |||
275 | !(evt & OHCI1394_busReset)) | 275 | !(evt & OHCI1394_busReset)) |
276 | return; | 276 | return; |
277 | 277 | ||
278 | fw_notify("IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt, | 278 | fw_notify("IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt, |
279 | evt & OHCI1394_selfIDComplete ? " selfID" : "", | 279 | evt & OHCI1394_selfIDComplete ? " selfID" : "", |
280 | evt & OHCI1394_RQPkt ? " AR_req" : "", | 280 | evt & OHCI1394_RQPkt ? " AR_req" : "", |
281 | evt & OHCI1394_RSPkt ? " AR_resp" : "", | 281 | evt & OHCI1394_RSPkt ? " AR_resp" : "", |
@@ -286,6 +286,7 @@ static void log_irqs(u32 evt) | |||
286 | evt & OHCI1394_postedWriteErr ? " postedWriteErr" : "", | 286 | evt & OHCI1394_postedWriteErr ? " postedWriteErr" : "", |
287 | evt & OHCI1394_cycleTooLong ? " cycleTooLong" : "", | 287 | evt & OHCI1394_cycleTooLong ? " cycleTooLong" : "", |
288 | evt & OHCI1394_cycle64Seconds ? " cycle64Seconds" : "", | 288 | evt & OHCI1394_cycle64Seconds ? " cycle64Seconds" : "", |
289 | evt & OHCI1394_cycleInconsistent ? " cycleInconsistent" : "", | ||
289 | evt & OHCI1394_regAccessFail ? " regAccessFail" : "", | 290 | evt & OHCI1394_regAccessFail ? " regAccessFail" : "", |
290 | evt & OHCI1394_busReset ? " busReset" : "", | 291 | evt & OHCI1394_busReset ? " busReset" : "", |
291 | evt & ~(OHCI1394_selfIDComplete | OHCI1394_RQPkt | | 292 | evt & ~(OHCI1394_selfIDComplete | OHCI1394_RQPkt | |
@@ -293,6 +294,7 @@ static void log_irqs(u32 evt) | |||
293 | OHCI1394_respTxComplete | OHCI1394_isochRx | | 294 | OHCI1394_respTxComplete | OHCI1394_isochRx | |
294 | OHCI1394_isochTx | OHCI1394_postedWriteErr | | 295 | OHCI1394_isochTx | OHCI1394_postedWriteErr | |
295 | OHCI1394_cycleTooLong | OHCI1394_cycle64Seconds | | 296 | OHCI1394_cycleTooLong | OHCI1394_cycle64Seconds | |
297 | OHCI1394_cycleInconsistent | | ||
296 | OHCI1394_regAccessFail | OHCI1394_busReset) | 298 | OHCI1394_regAccessFail | OHCI1394_busReset) |
297 | ? " ?" : ""); | 299 | ? " ?" : ""); |
298 | } | 300 | } |
@@ -1439,6 +1441,17 @@ static irqreturn_t irq_handler(int irq, void *data) | |||
1439 | OHCI1394_LinkControl_cycleMaster); | 1441 | OHCI1394_LinkControl_cycleMaster); |
1440 | } | 1442 | } |
1441 | 1443 | ||
1444 | if (unlikely(event & OHCI1394_cycleInconsistent)) { | ||
1445 | /* | ||
1446 | * We need to clear this event bit in order to make | ||
1447 | * cycleMatch isochronous I/O work. In theory we should | ||
1448 | * stop active cycleMatch iso contexts now and restart | ||
1449 | * them at least two cycles later. (FIXME?) | ||
1450 | */ | ||
1451 | if (printk_ratelimit()) | ||
1452 | fw_notify("isochronous cycle inconsistent\n"); | ||
1453 | } | ||
1454 | |||
1442 | if (event & OHCI1394_cycle64Seconds) { | 1455 | if (event & OHCI1394_cycle64Seconds) { |
1443 | cycle_time = reg_read(ohci, OHCI1394_IsochronousCycleTimer); | 1456 | cycle_time = reg_read(ohci, OHCI1394_IsochronousCycleTimer); |
1444 | if ((cycle_time & 0x80000000) == 0) | 1457 | if ((cycle_time & 0x80000000) == 0) |
@@ -1528,6 +1541,7 @@ static int ohci_enable(struct fw_card *card, u32 *config_rom, size_t length) | |||
1528 | OHCI1394_reqTxComplete | OHCI1394_respTxComplete | | 1541 | OHCI1394_reqTxComplete | OHCI1394_respTxComplete | |
1529 | OHCI1394_isochRx | OHCI1394_isochTx | | 1542 | OHCI1394_isochRx | OHCI1394_isochTx | |
1530 | OHCI1394_postedWriteErr | OHCI1394_cycleTooLong | | 1543 | OHCI1394_postedWriteErr | OHCI1394_cycleTooLong | |
1544 | OHCI1394_cycleInconsistent | | ||
1531 | OHCI1394_cycle64Seconds | OHCI1394_regAccessFail | | 1545 | OHCI1394_cycle64Seconds | OHCI1394_regAccessFail | |
1532 | OHCI1394_masterIntEnable); | 1546 | OHCI1394_masterIntEnable); |
1533 | if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS) | 1547 | if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS) |
@@ -1890,15 +1904,30 @@ static int handle_it_packet(struct context *context, | |||
1890 | { | 1904 | { |
1891 | struct iso_context *ctx = | 1905 | struct iso_context *ctx = |
1892 | container_of(context, struct iso_context, context); | 1906 | container_of(context, struct iso_context, context); |
1907 | int i; | ||
1908 | struct descriptor *pd; | ||
1893 | 1909 | ||
1894 | if (last->transfer_status == 0) | 1910 | for (pd = d; pd <= last; pd++) |
1895 | /* This descriptor isn't done yet, stop iteration. */ | 1911 | if (pd->transfer_status) |
1912 | break; | ||
1913 | if (pd > last) | ||
1914 | /* Descriptor(s) not done yet, stop iteration */ | ||
1896 | return 0; | 1915 | return 0; |
1897 | 1916 | ||
1898 | if (le16_to_cpu(last->control) & DESCRIPTOR_IRQ_ALWAYS) | 1917 | i = ctx->header_length; |
1918 | if (i + 4 < PAGE_SIZE) { | ||
1919 | /* Present this value as big-endian to match the receive code */ | ||
1920 | *(__be32 *)(ctx->header + i) = cpu_to_be32( | ||
1921 | ((u32)le16_to_cpu(pd->transfer_status) << 16) | | ||
1922 | le16_to_cpu(pd->res_count)); | ||
1923 | ctx->header_length += 4; | ||
1924 | } | ||
1925 | if (le16_to_cpu(last->control) & DESCRIPTOR_IRQ_ALWAYS) { | ||
1899 | ctx->base.callback(&ctx->base, le16_to_cpu(last->res_count), | 1926 | ctx->base.callback(&ctx->base, le16_to_cpu(last->res_count), |
1900 | 0, NULL, ctx->base.callback_data); | 1927 | ctx->header_length, ctx->header, |
1901 | 1928 | ctx->base.callback_data); | |
1929 | ctx->header_length = 0; | ||
1930 | } | ||
1902 | return 1; | 1931 | return 1; |
1903 | } | 1932 | } |
1904 | 1933 | ||