diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-01 12:34:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-01 12:34:23 -0500 |
commit | 6a1214113090905aca6a492fc8ef10d84c608a69 (patch) | |
tree | 83e0b825725ff23b3c8f15761f0ec9472ecc082c | |
parent | c07f62e5f18123103459ff74e86af1518a5b8af5 (diff) | |
parent | 2642b11295ebcc94843045933061bfbb263fce7f (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* '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
-rw-r--r-- | drivers/firewire/fw-sbp2.c | 5 | ||||
-rw-r--r-- | drivers/ieee1394/highlevel.c | 25 | ||||
-rw-r--r-- | drivers/ieee1394/hosts.h | 4 | ||||
-rw-r--r-- | drivers/ieee1394/sbp2.c | 14 |
4 files changed, 31 insertions, 17 deletions
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c index 97df6dac3a82..e54403ee59e7 100644 --- a/drivers/firewire/fw-sbp2.c +++ b/drivers/firewire/fw-sbp2.c | |||
@@ -372,6 +372,11 @@ static const struct { | |||
372 | }, | 372 | }, |
373 | /* iPod mini */ { | 373 | /* iPod mini */ { |
374 | .firmware_revision = 0x0a2700, | 374 | .firmware_revision = 0x0a2700, |
375 | .model = 0x000022, | ||
376 | .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, | ||
377 | }, | ||
378 | /* iPod mini */ { | ||
379 | .firmware_revision = 0x0a2700, | ||
375 | .model = 0x000023, | 380 | .model = 0x000023, |
376 | .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, | 381 | .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, |
377 | }, | 382 | }, |
diff --git a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c index 918ffc4fc8ac..272543a42a43 100644 --- a/drivers/ieee1394/highlevel.c +++ b/drivers/ieee1394/highlevel.c | |||
@@ -46,10 +46,6 @@ static DEFINE_RWLOCK(hl_irqs_lock); | |||
46 | 46 | ||
47 | static DEFINE_RWLOCK(addr_space_lock); | 47 | static DEFINE_RWLOCK(addr_space_lock); |
48 | 48 | ||
49 | /* addr_space list will have zero and max already included as bounds */ | ||
50 | static struct hpsb_address_ops dummy_ops = { NULL, NULL, NULL, NULL }; | ||
51 | static struct hpsb_address_serve dummy_zero_addr, dummy_max_addr; | ||
52 | |||
53 | 49 | ||
54 | static struct hl_host_info *hl_get_hostinfo(struct hpsb_highlevel *hl, | 50 | static struct hl_host_info *hl_get_hostinfo(struct hpsb_highlevel *hl, |
55 | struct hpsb_host *host) | 51 | struct hpsb_host *host) |
@@ -481,20 +477,23 @@ int hpsb_unregister_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host, | |||
481 | return retval; | 477 | return retval; |
482 | } | 478 | } |
483 | 479 | ||
480 | static struct hpsb_address_ops dummy_ops; | ||
481 | |||
482 | /* dummy address spaces as lower and upper bounds of the host's a.s. list */ | ||
484 | static void init_hpsb_highlevel(struct hpsb_host *host) | 483 | static void init_hpsb_highlevel(struct hpsb_host *host) |
485 | { | 484 | { |
486 | INIT_LIST_HEAD(&dummy_zero_addr.host_list); | 485 | INIT_LIST_HEAD(&host->dummy_zero_addr.host_list); |
487 | INIT_LIST_HEAD(&dummy_zero_addr.hl_list); | 486 | INIT_LIST_HEAD(&host->dummy_zero_addr.hl_list); |
488 | INIT_LIST_HEAD(&dummy_max_addr.host_list); | 487 | INIT_LIST_HEAD(&host->dummy_max_addr.host_list); |
489 | INIT_LIST_HEAD(&dummy_max_addr.hl_list); | 488 | INIT_LIST_HEAD(&host->dummy_max_addr.hl_list); |
490 | 489 | ||
491 | dummy_zero_addr.op = dummy_max_addr.op = &dummy_ops; | 490 | host->dummy_zero_addr.op = host->dummy_max_addr.op = &dummy_ops; |
492 | 491 | ||
493 | dummy_zero_addr.start = dummy_zero_addr.end = 0; | 492 | host->dummy_zero_addr.start = host->dummy_zero_addr.end = 0; |
494 | dummy_max_addr.start = dummy_max_addr.end = ((u64) 1) << 48; | 493 | host->dummy_max_addr.start = host->dummy_max_addr.end = ((u64) 1) << 48; |
495 | 494 | ||
496 | list_add_tail(&dummy_zero_addr.host_list, &host->addr_space); | 495 | list_add_tail(&host->dummy_zero_addr.host_list, &host->addr_space); |
497 | list_add_tail(&dummy_max_addr.host_list, &host->addr_space); | 496 | list_add_tail(&host->dummy_max_addr.host_list, &host->addr_space); |
498 | } | 497 | } |
499 | 498 | ||
500 | void highlevel_add_host(struct hpsb_host *host) | 499 | void highlevel_add_host(struct hpsb_host *host) |
diff --git a/drivers/ieee1394/hosts.h b/drivers/ieee1394/hosts.h index e4e8aeb4d778..dd229950acca 100644 --- a/drivers/ieee1394/hosts.h +++ b/drivers/ieee1394/hosts.h | |||
@@ -13,6 +13,7 @@ struct module; | |||
13 | 13 | ||
14 | #include "ieee1394_types.h" | 14 | #include "ieee1394_types.h" |
15 | #include "csr.h" | 15 | #include "csr.h" |
16 | #include "highlevel.h" | ||
16 | 17 | ||
17 | struct hpsb_packet; | 18 | struct hpsb_packet; |
18 | struct hpsb_iso; | 19 | struct hpsb_iso; |
@@ -72,6 +73,9 @@ struct hpsb_host { | |||
72 | struct { DECLARE_BITMAP(map, 64); } tl_pool[ALL_NODES]; | 73 | struct { DECLARE_BITMAP(map, 64); } tl_pool[ALL_NODES]; |
73 | 74 | ||
74 | struct csr_control csr; | 75 | struct csr_control csr; |
76 | |||
77 | struct hpsb_address_serve dummy_zero_addr; | ||
78 | struct hpsb_address_serve dummy_max_addr; | ||
75 | }; | 79 | }; |
76 | 80 | ||
77 | enum devctl_cmd { | 81 | enum devctl_cmd { |
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index c52f6e6e8af2..a373c18cf7b8 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c | |||
@@ -402,6 +402,11 @@ static const struct { | |||
402 | }, | 402 | }, |
403 | /* iPod mini */ { | 403 | /* iPod mini */ { |
404 | .firmware_revision = 0x0a2700, | 404 | .firmware_revision = 0x0a2700, |
405 | .model_id = 0x000022, | ||
406 | .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, | ||
407 | }, | ||
408 | /* iPod mini */ { | ||
409 | .firmware_revision = 0x0a2700, | ||
405 | .model_id = 0x000023, | 410 | .model_id = 0x000023, |
406 | .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, | 411 | .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, |
407 | }, | 412 | }, |
@@ -890,12 +895,13 @@ static void sbp2_host_reset(struct hpsb_host *host) | |||
890 | return; | 895 | return; |
891 | 896 | ||
892 | read_lock_irqsave(&sbp2_hi_logical_units_lock, flags); | 897 | read_lock_irqsave(&sbp2_hi_logical_units_lock, flags); |
898 | |||
893 | list_for_each_entry(lu, &hi->logical_units, lu_list) | 899 | list_for_each_entry(lu, &hi->logical_units, lu_list) |
894 | if (likely(atomic_read(&lu->state) != | 900 | if (atomic_cmpxchg(&lu->state, |
895 | SBP2LU_STATE_IN_SHUTDOWN)) { | 901 | SBP2LU_STATE_RUNNING, SBP2LU_STATE_IN_RESET) |
896 | atomic_set(&lu->state, SBP2LU_STATE_IN_RESET); | 902 | == SBP2LU_STATE_RUNNING) |
897 | scsi_block_requests(lu->shost); | 903 | scsi_block_requests(lu->shost); |
898 | } | 904 | |
899 | read_unlock_irqrestore(&sbp2_hi_logical_units_lock, flags); | 905 | read_unlock_irqrestore(&sbp2_hi_logical_units_lock, flags); |
900 | } | 906 | } |
901 | 907 | ||