diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-02-18 19:24:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-02-18 19:24:48 -0500 |
commit | dd8fc10e606127e2dffdb6704e7ec203c86a214d (patch) | |
tree | 72f58ab97c144c95af2623de884745fdb4e9cc68 | |
parent | 2850713576e81e3b887cd92a9965fba0dd1717c0 (diff) | |
parent | 2a8d9cdcfee67469dc2a993f59a47467a5eb4adf (diff) |
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley:
"Two simple fixes.
One prevents a soft lockup on some target removal scenarios and the
other prevents us trying to probe the marvell console device, which
causes it to time out and need the bus resetting"
* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: fix soft lockup in scsi_remove_target() on module removal
SCSI: Add Marvell configuration device to VPD blacklist
-rw-r--r-- | drivers/scsi/scsi_devinfo.c | 1 | ||||
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c index da2e068ee47d..bbfbfd9e5aa3 100644 --- a/drivers/scsi/scsi_devinfo.c +++ b/drivers/scsi/scsi_devinfo.c | |||
@@ -206,6 +206,7 @@ static struct { | |||
206 | {"iRiver", "iFP Mass Driver", NULL, BLIST_NOT_LOCKABLE | BLIST_INQUIRY_36}, | 206 | {"iRiver", "iFP Mass Driver", NULL, BLIST_NOT_LOCKABLE | BLIST_INQUIRY_36}, |
207 | {"LASOUND", "CDX7405", "3.10", BLIST_MAX5LUN | BLIST_SINGLELUN}, | 207 | {"LASOUND", "CDX7405", "3.10", BLIST_MAX5LUN | BLIST_SINGLELUN}, |
208 | {"Marvell", "Console", NULL, BLIST_SKIP_VPD_PAGES}, | 208 | {"Marvell", "Console", NULL, BLIST_SKIP_VPD_PAGES}, |
209 | {"Marvell", "91xx Config", "1.01", BLIST_SKIP_VPD_PAGES}, | ||
209 | {"MATSHITA", "PD-1", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, | 210 | {"MATSHITA", "PD-1", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, |
210 | {"MATSHITA", "DMC-LC5", NULL, BLIST_NOT_LOCKABLE | BLIST_INQUIRY_36}, | 211 | {"MATSHITA", "DMC-LC5", NULL, BLIST_NOT_LOCKABLE | BLIST_INQUIRY_36}, |
211 | {"MATSHITA", "DMC-LC40", NULL, BLIST_NOT_LOCKABLE | BLIST_INQUIRY_36}, | 212 | {"MATSHITA", "DMC-LC40", NULL, BLIST_NOT_LOCKABLE | BLIST_INQUIRY_36}, |
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 4f18a851e2c7..00bc7218a7f8 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -1272,16 +1272,18 @@ static void __scsi_remove_target(struct scsi_target *starget) | |||
1272 | void scsi_remove_target(struct device *dev) | 1272 | void scsi_remove_target(struct device *dev) |
1273 | { | 1273 | { |
1274 | struct Scsi_Host *shost = dev_to_shost(dev->parent); | 1274 | struct Scsi_Host *shost = dev_to_shost(dev->parent); |
1275 | struct scsi_target *starget; | 1275 | struct scsi_target *starget, *last_target = NULL; |
1276 | unsigned long flags; | 1276 | unsigned long flags; |
1277 | 1277 | ||
1278 | restart: | 1278 | restart: |
1279 | spin_lock_irqsave(shost->host_lock, flags); | 1279 | spin_lock_irqsave(shost->host_lock, flags); |
1280 | list_for_each_entry(starget, &shost->__targets, siblings) { | 1280 | list_for_each_entry(starget, &shost->__targets, siblings) { |
1281 | if (starget->state == STARGET_DEL) | 1281 | if (starget->state == STARGET_DEL || |
1282 | starget == last_target) | ||
1282 | continue; | 1283 | continue; |
1283 | if (starget->dev.parent == dev || &starget->dev == dev) { | 1284 | if (starget->dev.parent == dev || &starget->dev == dev) { |
1284 | kref_get(&starget->reap_ref); | 1285 | kref_get(&starget->reap_ref); |
1286 | last_target = starget; | ||
1285 | spin_unlock_irqrestore(shost->host_lock, flags); | 1287 | spin_unlock_irqrestore(shost->host_lock, flags); |
1286 | __scsi_remove_target(starget); | 1288 | __scsi_remove_target(starget); |
1287 | scsi_target_reap(starget); | 1289 | scsi_target_reap(starget); |