diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-09 08:19:19 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-09 08:19:19 +0300 |
commit | f3f62a38ceda4e4d34a1dc3ebbc0f8d426c9e8d9 (patch) | |
tree | 4f912f41c84017559376435c313987bdf8630b2c /drivers/s390/scsi/zfcp_ccw.c | |
parent | 140dfc9299c33bbfc9350fa061f5ab65cb83df13 (diff) | |
parent | 096cbc35eaecf5865a3274f21eae26955b32861b (diff) | |
download | linux-f3f62a38ceda4e4d34a1dc3ebbc0f8d426c9e8d9.tar.xz |
Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley:
"This patch is the usual mix of driver updates (srp, ipr, scsi_debug,
NCR5380, fnic, 53c974, ses, wd719x, hpsa, megaraid_sas).
Of those, wd7a9x is new and 53c974 is a rewrite of the old tmscsim
driver and the extensive work by Finn Thain rewrites all the NCR5380
based drivers.
There's also extensive infrastructure updates: a new logging
infrastructure for sense information and a rewrite of the tagged
command queue API and an assortment of minor updates"
* tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (183 commits)
scsi: set fmt to NULL scsi_extd_sense_format() by default
libsas: remove task_collector mode
wd719x: remove dma_cache_sync call
scsi_debug: add Report supported opcodes+tmfs; Compare and write
scsi_debug: change SCSI command parser to table driven
scsi_debug: add Capacity Changed Unit Attention
scsi_debug: append inject error flags onto scsi_cmnd object
scsi_debug: pinpoint invalid field in sense data
wd719x: Add firmware documentation
wd719x: Introduce Western Digital WD7193/7197/7296 PCI SCSI card driver
eeprom-93cx6: Add (read-only) support for 8-bit mode
esas2r: fix an oversight in setting return value
esas2r: fix an error path in esas2r_ioctl_handler
esas2r: fir error handling in do_fm_api
scsi: add SPC-3 command definitions
scsi: rename SERVICE_ACTION_IN to SERVICE_ACTION_IN_16
scsi: remove scsi_driver owner field
scsi: move scsi_dispatch_cmd to scsi_lib.c
scsi: stop passing a gfp_mask argument down the command setup path
scsi: remove scsi_next_command
...
Diffstat (limited to 'drivers/s390/scsi/zfcp_ccw.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_ccw.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index f9879d400d0e..54c7b48fdb46 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c @@ -56,8 +56,22 @@ static int zfcp_ccw_activate(struct ccw_device *cdev, int clear, char *tag) zfcp_erp_set_adapter_status(adapter, ZFCP_STATUS_COMMON_RUNNING); zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, tag); + + /* + * We want to scan ports here, with some random backoff and without + * rate limit. Recovery has already scheduled a port scan for us, + * but with both random delay and rate limit. Nevertheless we get + * what we want here by flushing the scheduled work after sleeping + * an equivalent random time. + * Let the port scan random delay elapse first. If recovery finishes + * up to that point in time, that would be perfect for both recovery + * and port scan. If not, i.e. recovery takes ages, there was no + * point in waiting a random delay on top of the time consumed by + * recovery. + */ + msleep(zfcp_fc_port_scan_backoff()); zfcp_erp_wait(adapter); - flush_work(&adapter->scan_work); /* ok to call even if nothing queued */ + flush_delayed_work(&adapter->scan_work); zfcp_ccw_adapter_put(adapter); @@ -162,11 +176,19 @@ static int zfcp_ccw_set_online(struct ccw_device *cdev) adapter->req_no = 0; zfcp_ccw_activate(cdev, 0, "ccsonl1"); - /* scan for remote ports - either at the end of any successful adapter recovery - or only after the adapter recovery for setting a device online */ + + /* + * We want to scan ports here, always, with some random delay and + * without rate limit - basically what zfcp_ccw_activate() has + * achieved for us. Not quite! That port scan depended on + * !no_auto_port_rescan. So let's cover the no_auto_port_rescan + * case here to make sure a port scan is done unconditionally. + * Since zfcp_ccw_activate() has waited the desired random time, + * we can immediately schedule and flush a port scan for the + * remaining cases. + */ zfcp_fc_inverse_conditional_port_scan(adapter); - flush_work(&adapter->scan_work); /* ok to call even if nothing queued */ + flush_delayed_work(&adapter->scan_work); zfcp_ccw_adapter_put(adapter); return 0; } |