]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 1 Dec 2008 17:34:23 +0000 (09:34 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 1 Dec 2008 17:34:23 +0000 (09:34 -0800)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  ieee1394: sbp2: fix race condition in state change
  ieee1394: fix list corruption (reported at module removal)
  firewire: fw-sbp2: another iPod mini quirk entry
  ieee1394: sbp2: another iPod mini quirk entry

drivers/firewire/fw-sbp2.c
drivers/ieee1394/highlevel.c
drivers/ieee1394/hosts.h
drivers/ieee1394/sbp2.c

index 97df6dac3a821c250dbf068e0e11b33d13affb6f..e54403ee59e7f3f715f587f804d68d7cad21a5c6 100644 (file)
@@ -370,6 +370,11 @@ static const struct {
                .model                  = 0x000021,
                .workarounds            = SBP2_WORKAROUND_FIX_CAPACITY,
        },
+       /* iPod mini */ {
+               .firmware_revision      = 0x0a2700,
+               .model                  = 0x000022,
+               .workarounds            = SBP2_WORKAROUND_FIX_CAPACITY,
+       },
        /* iPod mini */ {
                .firmware_revision      = 0x0a2700,
                .model                  = 0x000023,
index 918ffc4fc8ace2923f660d452d6f389a488c8b25..272543a42a43b0478caf4879c3664782790bafc2 100644 (file)
@@ -46,10 +46,6 @@ static DEFINE_RWLOCK(hl_irqs_lock);
 
 static DEFINE_RWLOCK(addr_space_lock);
 
-/* addr_space list will have zero and max already included as bounds */
-static struct hpsb_address_ops dummy_ops = { NULL, NULL, NULL, NULL };
-static struct hpsb_address_serve dummy_zero_addr, dummy_max_addr;
-
 
 static struct hl_host_info *hl_get_hostinfo(struct hpsb_highlevel *hl,
                                            struct hpsb_host *host)
@@ -481,20 +477,23 @@ int hpsb_unregister_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host,
        return retval;
 }
 
+static struct hpsb_address_ops dummy_ops;
+
+/* dummy address spaces as lower and upper bounds of the host's a.s. list */
 static void init_hpsb_highlevel(struct hpsb_host *host)
 {
-       INIT_LIST_HEAD(&dummy_zero_addr.host_list);
-       INIT_LIST_HEAD(&dummy_zero_addr.hl_list);
-       INIT_LIST_HEAD(&dummy_max_addr.host_list);
-       INIT_LIST_HEAD(&dummy_max_addr.hl_list);
+       INIT_LIST_HEAD(&host->dummy_zero_addr.host_list);
+       INIT_LIST_HEAD(&host->dummy_zero_addr.hl_list);
+       INIT_LIST_HEAD(&host->dummy_max_addr.host_list);
+       INIT_LIST_HEAD(&host->dummy_max_addr.hl_list);
 
-       dummy_zero_addr.op = dummy_max_addr.op = &dummy_ops;
+       host->dummy_zero_addr.op = host->dummy_max_addr.op = &dummy_ops;
 
-       dummy_zero_addr.start = dummy_zero_addr.end = 0;
-       dummy_max_addr.start = dummy_max_addr.end = ((u64) 1) << 48;
+       host->dummy_zero_addr.start = host->dummy_zero_addr.end = 0;
+       host->dummy_max_addr.start = host->dummy_max_addr.end = ((u64) 1) << 48;
 
-       list_add_tail(&dummy_zero_addr.host_list, &host->addr_space);
-       list_add_tail(&dummy_max_addr.host_list, &host->addr_space);
+       list_add_tail(&host->dummy_zero_addr.host_list, &host->addr_space);
+       list_add_tail(&host->dummy_max_addr.host_list, &host->addr_space);
 }
 
 void highlevel_add_host(struct hpsb_host *host)
index e4e8aeb4d7788d2caf2ef7d5821dbf77a038c27d..dd229950acca4633b3f1d2952d8d40fed2e3ebd5 100644 (file)
@@ -13,6 +13,7 @@ struct module;
 
 #include "ieee1394_types.h"
 #include "csr.h"
+#include "highlevel.h"
 
 struct hpsb_packet;
 struct hpsb_iso;
@@ -72,6 +73,9 @@ struct hpsb_host {
        struct { DECLARE_BITMAP(map, 64); } tl_pool[ALL_NODES];
 
        struct csr_control csr;
+
+       struct hpsb_address_serve dummy_zero_addr;
+       struct hpsb_address_serve dummy_max_addr;
 };
 
 enum devctl_cmd {
index c52f6e6e8af2a8bacac026e4f9974652ee794661..a373c18cf7b8fe8bd077c47b0808abea743e573f 100644 (file)
@@ -400,6 +400,11 @@ static const struct {
                .model_id               = 0x000021,
                .workarounds            = SBP2_WORKAROUND_FIX_CAPACITY,
        },
+       /* iPod mini */ {
+               .firmware_revision      = 0x0a2700,
+               .model_id               = 0x000022,
+               .workarounds            = SBP2_WORKAROUND_FIX_CAPACITY,
+       },
        /* iPod mini */ {
                .firmware_revision      = 0x0a2700,
                .model_id               = 0x000023,
@@ -890,12 +895,13 @@ static void sbp2_host_reset(struct hpsb_host *host)
                return;
 
        read_lock_irqsave(&sbp2_hi_logical_units_lock, flags);
+
        list_for_each_entry(lu, &hi->logical_units, lu_list)
-               if (likely(atomic_read(&lu->state) !=
-                          SBP2LU_STATE_IN_SHUTDOWN)) {
-                       atomic_set(&lu->state, SBP2LU_STATE_IN_RESET);
+               if (atomic_cmpxchg(&lu->state,
+                                  SBP2LU_STATE_RUNNING, SBP2LU_STATE_IN_RESET)
+                   == SBP2LU_STATE_RUNNING)
                        scsi_block_requests(lu->shost);
-               }
+
        read_unlock_irqrestore(&sbp2_hi_logical_units_lock, flags);
 }