diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-05-12 05:57:09 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-05-12 05:57:09 -0400 |
commit | ddc4097b77bbb227851a44287acb2fb8a9896cc1 (patch) | |
tree | 319d098879bed7c45543d983de8becd509701b22 /drivers/s390/scsi/zfcp_sysfs.c | |
parent | bec4c99e8637b5b8bd4b0513eacb51da25885e3b (diff) | |
parent | ae31c1fbdbb18d917b0a1139497c2dbd35886989 (diff) |
Merge branch 'topic/drvdata-fix' into topic/asoc
Diffstat (limited to 'drivers/s390/scsi/zfcp_sysfs.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c index 9a3b8e261c0a..3e51e64d1108 100644 --- a/drivers/s390/scsi/zfcp_sysfs.c +++ b/drivers/s390/scsi/zfcp_sysfs.c | |||
@@ -254,12 +254,21 @@ static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev, | |||
254 | 254 | ||
255 | write_lock_irq(&zfcp_data.config_lock); | 255 | write_lock_irq(&zfcp_data.config_lock); |
256 | unit = zfcp_get_unit_by_lun(port, fcp_lun); | 256 | unit = zfcp_get_unit_by_lun(port, fcp_lun); |
257 | if (unit && (atomic_read(&unit->refcount) == 0)) { | 257 | if (unit) { |
258 | zfcp_unit_get(unit); | 258 | write_unlock_irq(&zfcp_data.config_lock); |
259 | atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &unit->status); | 259 | /* wait for possible timeout during SCSI probe */ |
260 | list_move(&unit->list, &unit_remove_lh); | 260 | flush_work(&unit->scsi_work); |
261 | } else | 261 | write_lock_irq(&zfcp_data.config_lock); |
262 | unit = NULL; | 262 | |
263 | if (atomic_read(&unit->refcount) == 0) { | ||
264 | zfcp_unit_get(unit); | ||
265 | atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, | ||
266 | &unit->status); | ||
267 | list_move(&unit->list, &unit_remove_lh); | ||
268 | } else { | ||
269 | unit = NULL; | ||
270 | } | ||
271 | } | ||
263 | 272 | ||
264 | write_unlock_irq(&zfcp_data.config_lock); | 273 | write_unlock_irq(&zfcp_data.config_lock); |
265 | 274 | ||