Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 22 Aug 2011 01:13:19 +0000 (18:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 22 Aug 2011 01:13:19 +0000 (18:13 -0700)
* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  firewire: core: handle ack_busy when fetching the Config ROM

1  2 
drivers/firewire/core-device.c

@@@ -38,7 -38,7 +38,7 @@@
  #include <linux/string.h>
  #include <linux/workqueue.h>
  
 -#include <asm/atomic.h>
 +#include <linux/atomic.h>
  #include <asm/byteorder.h>
  #include <asm/system.h>
  
@@@ -455,15 -455,20 +455,20 @@@ static struct device_attribute fw_devic
  static int read_rom(struct fw_device *device,
                    int generation, int index, u32 *data)
  {
-       int rcode;
+       u64 offset = (CSR_REGISTER_BASE | CSR_CONFIG_ROM) + index * 4;
+       int i, rcode;
  
        /* device->node_id, accessed below, must not be older than generation */
        smp_rmb();
  
-       rcode = fw_run_transaction(device->card, TCODE_READ_QUADLET_REQUEST,
-                       device->node_id, generation, device->max_speed,
-                       (CSR_REGISTER_BASE | CSR_CONFIG_ROM) + index * 4,
-                       data, 4);
+       for (i = 10; i < 100; i += 10) {
+               rcode = fw_run_transaction(device->card,
+                               TCODE_READ_QUADLET_REQUEST, device->node_id,
+                               generation, device->max_speed, offset, data, 4);
+               if (rcode != RCODE_BUSY)
+                       break;
+               msleep(i);
+       }
        be32_to_cpus(data);
  
        return rcode;