diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-01 09:34:23 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-01 09:34:23 -0800 |
commit | 6a1214113090905aca6a492fc8ef10d84c608a69 (patch) | |
tree | 83e0b825725ff23b3c8f15761f0ec9472ecc082c /drivers/ieee1394/sbp2.c | |
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
Diffstat (limited to 'drivers/ieee1394/sbp2.c')
-rw-r--r-- | drivers/ieee1394/sbp2.c | 14 |
1 files changed, 10 insertions, 4 deletions
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 { }, /* iPod mini */ { .firmware_revision = 0x0a2700, + .model_id = 0x000022, + .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, + }, + /* iPod mini */ { + .firmware_revision = 0x0a2700, .model_id = 0x000023, .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, }, @@ -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); } |