diff options
Diffstat (limited to 'drivers/firewire/ohci.c')
-rw-r--r-- | drivers/firewire/ohci.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 0cf4d7f562c5..94b16e0340ae 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -1158,7 +1158,7 @@ static void handle_local_lock(struct fw_ohci *ohci, | |||
1158 | struct fw_packet *packet, u32 csr) | 1158 | struct fw_packet *packet, u32 csr) |
1159 | { | 1159 | { |
1160 | struct fw_packet response; | 1160 | struct fw_packet response; |
1161 | int tcode, length, ext_tcode, sel; | 1161 | int tcode, length, ext_tcode, sel, try; |
1162 | __be32 *payload, lock_old; | 1162 | __be32 *payload, lock_old; |
1163 | u32 lock_arg, lock_data; | 1163 | u32 lock_arg, lock_data; |
1164 | 1164 | ||
@@ -1185,21 +1185,26 @@ static void handle_local_lock(struct fw_ohci *ohci, | |||
1185 | reg_write(ohci, OHCI1394_CSRCompareData, lock_arg); | 1185 | reg_write(ohci, OHCI1394_CSRCompareData, lock_arg); |
1186 | reg_write(ohci, OHCI1394_CSRControl, sel); | 1186 | reg_write(ohci, OHCI1394_CSRControl, sel); |
1187 | 1187 | ||
1188 | if (reg_read(ohci, OHCI1394_CSRControl) & 0x80000000) | 1188 | for (try = 0; try < 20; try++) |
1189 | lock_old = cpu_to_be32(reg_read(ohci, OHCI1394_CSRData)); | 1189 | if (reg_read(ohci, OHCI1394_CSRControl) & 0x80000000) { |
1190 | else | 1190 | lock_old = cpu_to_be32(reg_read(ohci, |
1191 | fw_notify("swap not done yet\n"); | 1191 | OHCI1394_CSRData)); |
1192 | fw_fill_response(&response, packet->header, | ||
1193 | RCODE_COMPLETE, | ||
1194 | &lock_old, sizeof(lock_old)); | ||
1195 | goto out; | ||
1196 | } | ||
1197 | |||
1198 | fw_error("swap not done (CSR lock timeout)\n"); | ||
1199 | fw_fill_response(&response, packet->header, RCODE_BUSY, NULL, 0); | ||
1192 | 1200 | ||
1193 | fw_fill_response(&response, packet->header, | ||
1194 | RCODE_COMPLETE, &lock_old, sizeof(lock_old)); | ||
1195 | out: | 1201 | out: |
1196 | fw_core_handle_response(&ohci->card, &response); | 1202 | fw_core_handle_response(&ohci->card, &response); |
1197 | } | 1203 | } |
1198 | 1204 | ||
1199 | static void handle_local_request(struct context *ctx, struct fw_packet *packet) | 1205 | static void handle_local_request(struct context *ctx, struct fw_packet *packet) |
1200 | { | 1206 | { |
1201 | u64 offset; | 1207 | u64 offset, csr; |
1202 | u32 csr; | ||
1203 | 1208 | ||
1204 | if (ctx == &ctx->ohci->at_request_ctx) { | 1209 | if (ctx == &ctx->ohci->at_request_ctx) { |
1205 | packet->ack = ACK_PENDING; | 1210 | packet->ack = ACK_PENDING; |