+10
-5
drivers/firewire/core-device.c
+10
-5
drivers/firewire/core-device.c
···
455
455
static int read_rom(struct fw_device *device,
456
456
int generation, int index, u32 *data)
457
457
{
458
-
int rcode;
458
+
u64 offset = (CSR_REGISTER_BASE | CSR_CONFIG_ROM) + index * 4;
459
+
int i, rcode;
459
460
460
461
/* device->node_id, accessed below, must not be older than generation */
461
462
smp_rmb();
462
463
463
-
rcode = fw_run_transaction(device->card, TCODE_READ_QUADLET_REQUEST,
464
-
device->node_id, generation, device->max_speed,
465
-
(CSR_REGISTER_BASE | CSR_CONFIG_ROM) + index * 4,
466
-
data, 4);
464
+
for (i = 10; i < 100; i += 10) {
465
+
rcode = fw_run_transaction(device->card,
466
+
TCODE_READ_QUADLET_REQUEST, device->node_id,
467
+
generation, device->max_speed, offset, data, 4);
468
+
if (rcode != RCODE_BUSY)
469
+
break;
470
+
msleep(i);
471
+
}
467
472
be32_to_cpus(data);
468
473
469
474
return rcode;