SCSI fixes for 2.6.27-rc6
Subsystems (3)
James Bottomley
maintainerPATCH 1/1 SCSI fixes for 2.6.27-rc6
This is a large bunch of fixes for the s390 fibre driver plus a DIF entanglement issue (permit DIF to be disabled) A WLUN scanning problem (prevents disk detection on S390) and a couple of scsi_dh fixes that prevent the device handler from wrongly failing to retry.
The fixes are available here:
master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git
The short changelog is:
Christof Schmitt (3):
zfcp: Simplify ccw notify handler
zfcp: Correctly query end flag in gpn_ft response
zfcp: Fix request queue locking
Hirofumi Nakagawa (1):
zfcp: Remove duplicated unlikely() macros.
James Bottomley (1):
fix check of PQ and PDT bits for WLUNs
Mike Anderson (2):
make scsi_check_sense HARDWARE_ERROR return ADD_TO_MLQUEUE on retry
scsi_dh: make check_sense return ADD_TO_MLQUEUE
Stefan Richter (1):
sd: select CRC_T10DIF only when necessary
Swen Schillig (2):
zfcp: channel cannot be detached due to refcount imbalance
zfcp: Fix reference counter for remote ports
The diffstat:
drivers/s390/scsi/zfcp_ccw.c | 6 - drivers/s390/scsi/zfcp_fc.c | 33 +++------- drivers/s390/scsi/zfcp_fsf.c | 88 ++++++++++++++--------------- drivers/s390/scsi/zfcp_qdio.c | 4 - drivers/scsi/Kconfig | 2 drivers/scsi/device_handler/scsi_dh_alua.c | 12 +-- drivers/scsi/device_handler/scsi_dh_emc.c | 4 - drivers/scsi/device_handler/scsi_dh_rdac.c | 4 - drivers/scsi/scsi_error.c | 2 drivers/scsi/scsi_scan.c | 3 include/scsi/scsi.h | 14 ++++ 11 files changed, 87 insertions(+), 85 deletions(-)
The full diff is appended below.
James
---
drivers/s390/scsi/zfcp_ccw.c +1 -5
@@ -152,10 +152,8 @@ static int zfcp_ccw_set_offline(struct ccw_device *ccw_device)*/ static int zfcp_ccw_notify (struct ccw_device *ccw_device,int event) { -struct zfcp_adapter *adapter; +struct zfcp_adapter *adapter =dev_get_drvdata (&ccw_device->dev); -down (&zfcp_data.config_sema); - adapter =dev_get_drvdata (&ccw_device->dev);switch (event) {case CIO_GONE :dev_warn (&adapter->ccw_device->dev,"device gone\n" );
@@ -174,8 +172,6 @@ static int zfcp_ccw_notify(struct ccw_device *ccw_device, int event) 89, NULL);break ; } -zfcp_erp_wait (adapter); -up (&zfcp_data.config_sema);return 1 ; }
drivers/s390/scsi/zfcp_fc.c +12 -21
@@ -39,18 +39,6 @@ struct zfcp_gpn_ft {struct scatterlist sg_resp[ZFCP_GPN_FT_BUFFERS ]; }; -static struct zfcp_port *zfcp_get_port_by_did (struct zfcp_adapter *adapter, -u32 d_id) -{ -struct zfcp_port *port; - -list_for_each_entry (port, &adapter->port_list_head, list) -if ((port->d_id == d_id) && - !atomic_test_mask (ZFCP_STATUS_COMMON_REMOVE , &port->status)) -return port; -return NULL ; -} -static void _zfcp_fc_incoming_rscn (struct zfcp_fsf_req *fsf_req,u32 range,struct fcp_rscn_element *elem) {
@@ -341,12 +329,13 @@ void zfcp_test_link(struct zfcp_port *port)zfcp_port_get (port); retval =zfcp_fc_adisc (port); -if (retval ==0 || retval == -EBUSY ) +if (retval ==0 )return ;/* send of ADISC was not possible */ zfcp_port_put (port); -zfcp_erp_port_forced_reopen (port,0 ,65 ,NULL ); +if (retval != -EBUSY ) +zfcp_erp_port_forced_reopen (port,0 ,65 ,NULL ); }static int zfcp_scan_get_nameserver (struct zfcp_adapter *adapter)
@@ -363,7 +352,6 @@ static int zfcp_scan_get_nameserver(struct zfcp_adapter *adapter)if (ret)return ret;zfcp_erp_wait (adapter); -zfcp_port_put (adapter->nameserver_port); }return !atomic_test_mask (ZFCP_STATUS_COMMON_UNBLOCKED , &adapter->nameserver_port->status);
@@ -475,7 +463,7 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft)struct zfcp_adapter *adapter = ct->port->adapter;struct zfcp_port *port, *tmp;u32 d_id; -int ret =0 , x; +int ret =0 , x, last =0 ;if (ct->status)return -EIO ;
@@ -492,19 +480,24 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft)down (&zfcp_data.config_sema);/* first entry is the header */ -for (x =1 ; x <ZFCP_GPN_FT_MAX_ENTRIES ; x++) { +for (x =1 ; x <ZFCP_GPN_FT_MAX_ENTRIES && !last; x++) {if (x % (ZFCP_GPN_FT_ENTRIES +1 )) acc++;else acc =sg_virt (++sg); + last = acc->control &0x80 ; d_id = acc->port_id[0 ] <<16 | acc->port_id[1 ] <<8 | acc->port_id[2 ];/* skip the adapter's port and known remote ports */ -if (acc->wwpn ==fc_host_port_name (adapter->scsi_host) || -zfcp_get_port_by_did (adapter, d_id)) +if (acc->wwpn ==fc_host_port_name (adapter->scsi_host)) +continue ; + port =zfcp_get_port_by_wwpn (adapter, acc->wwpn); +if (port) { +zfcp_port_get (port);continue ; + } port = zfcp_port_enqueue(adapter, acc->wwpn, ZFCP_STATUS_PORT_DID_DID |
@@ -513,8 +506,6 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft) ret =PTR_ERR (port); else zfcp_erp_port_reopen(port, 0, 149, NULL); -if (acc->control &0x80 )/* last entry */ -break ; }zfcp_erp_wait (adapter);
drivers/s390/scsi/zfcp_fsf.c +44 -44
340 lines not on this page · raw message
drivers/s390/scsi/zfcp_qdio.c +2 -2
@@ -423,9 +423,9 @@ void zfcp_qdio_close(struct zfcp_adapter *adapter)/* clear QDIOUP flag, thus do_QDIO is not called during qdio_shutdown */ req_q = &adapter->req_q; -spin_lock (&req_q->lock); +spin_lock_bh (&req_q->lock);atomic_clear_mask (ZFCP_STATUS_ADAPTER_QDIOUP , &adapter->status); -spin_unlock (&req_q->lock); +spin_unlock_bh (&req_q->lock);qdio_shutdown (adapter->ccw_device,QDIO_FLAG_CLEANUP_USING_CLEAR );
drivers/scsi/Kconfig +1 -1
@@ -63,7 +63,7 @@ comment "SCSI support type (disk, tape, CD-ROM)" config BLK_DEV_SD tristate "SCSI disk support" depends on SCSI - select CRC_T10DIF + select CRC_T10DIF if BLK_DEV_INTEGRITY ---help--- If you want to use SCSI hard disks, Fibre Channel disks, Serial ATA (SATA) or Parallel ATA (PATA) hard disks,
drivers/scsi/device_handler/scsi_dh_alua.c +6 -6
@@ -425,7 +425,7 @@ static int alua_check_sense(struct scsi_device *sdev,/* * LUN Not Accessible - ALUA state transition */ -return NEEDS_RETRY ; +return ADD_TO_MLQUEUE ;if (sense_hdr->asc ==0x04 && sense_hdr->ascq ==0x0b )/* * LUN Not Accessible -- Target port in standby state
@@ -447,18 +447,18 @@ static int alua_check_sense(struct scsi_device *sdev,/* * Power On, Reset, or Bus Device Reset, just retry. */ -return NEEDS_RETRY ; +return ADD_TO_MLQUEUE ;if (sense_hdr->asc ==0x2a && sense_hdr->ascq ==0x06 ) {/* * ALUA state changed */ -return NEEDS_RETRY ; +return ADD_TO_MLQUEUE ; }if (sense_hdr->asc ==0x2a && sense_hdr->ascq ==0x07 ) {/* * Implicit ALUA state transition failed */ -return NEEDS_RETRY ; +return ADD_TO_MLQUEUE ; }break ; }
@@ -490,7 +490,7 @@ static int alua_stpg(struct scsi_device *sdev, int state,if (!err)return SCSI_DH_IO ; err =alua_check_sense (sdev, &sense_hdr); -if (retry >0 && err ==NEEDS_RETRY ) { +if (retry >0 && err ==ADD_TO_MLQUEUE ) { retry--; goto retry; }
@@ -535,7 +535,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_dh_data *h)return SCSI_DH_IO ; err =alua_check_sense (sdev, &sense_hdr); -if (err ==NEEDS_RETRY ) +if (err ==ADD_TO_MLQUEUE ) goto retry; sdev_printk(KERN_INFO, sdev, "%s: rtpg sense code %02x/%02x/%02x\n",
drivers/scsi/device_handler/scsi_dh_emc.c +2 -2
@@ -439,7 +439,7 @@ static int clariion_check_sense(struct scsi_device *sdev,* Unit Attention Code. This is the first IO * to the new path, so just retry. */ -return NEEDS_RETRY ; +return ADD_TO_MLQUEUE ;break ; }
@@ -514,7 +514,7 @@ retry:return SCSI_DH_IO ; err =clariion_check_sense (sdev, &sshdr); -if (retry >0 && err ==NEEDS_RETRY ) { +if (retry >0 && err ==ADD_TO_MLQUEUE ) { retry--; goto retry; }
drivers/scsi/device_handler/scsi_dh_rdac.c +2 -2
@@ -551,7 +551,7 @@ static int rdac_check_sense(struct scsi_device *sdev,* * Just retry and wait. */ -return NEEDS_RETRY ; +return ADD_TO_MLQUEUE ;break ;case ILLEGAL_REQUEST :if (sense_hdr->asc ==0x94 && sense_hdr->ascq ==0x01 ) {
@@ -568,7 +568,7 @@ static int rdac_check_sense(struct scsi_device *sdev,/* * Power On, Reset, or Bus Device Reset, just retry. */ -return NEEDS_RETRY ; +return ADD_TO_MLQUEUE ;break ; }/* success just means we do not care what scsi-ml does */
drivers/scsi/scsi_error.c +1 -1
@@ -391,7 +391,7 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)case HARDWARE_ERROR :if (scmd->device->retry_hwerror) -return NEEDS_RETRY ; +return ADD_TO_MLQUEUE ;else return SUCCESS ;
drivers/scsi/scsi_scan.c +2 -1
@@ -1080,7 +1080,8 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,* PDT=1Fh none (no FDD connected to the requested logical unit) */ if (((result[0 ] >>5 ) ==1 || starget->pdt_1f_for_no_lun) && - (result[0 ] &0x1f ) ==0x1f ) { + (result[0 ] &0x1f ) ==0x1f && + !scsi_is_wlun (lun)) {SCSI_LOG_SCAN_BUS (3 ,printk (KERN_INFO "scsi scan: peripheral device type" " of 31, no device added\n" ));
include/scsi/scsi.h +14 -0
@@ -309,6 +309,20 @@ struct scsi_lun { };/* +* The Well Known LUNS (SAM-3) in our int representation of a LUN +*/ +#define SCSI_W_LUN_BASE 0xc100 +#define SCSI_W_LUN_REPORT_LUNS (SCSI_W_LUN_BASE + 1) +#define SCSI_W_LUN_ACCESS_CONTROL (SCSI_W_LUN_BASE + 2) +#define SCSI_W_LUN_TARGET_LOG_PAGE (SCSI_W_LUN_BASE + 3) + +static inline int scsi_is_wlun (unsigned int lun) +{ +return (lun &0xff00 ) ==SCSI_W_LUN_BASE ; +} + + +/* * MESSAGE CODES */