projects/linux·commit 6ed92e55

Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

6ed92e55 · Linus Torvalds <[email protected]> · 2023-11-02 15:13:50 -10:00

Pull SCSI updates from James Bottomley:
 "Updates to the usual drivers (ufs, megaraid_sas, lpfc, target, ibmvfc,
  scsi_debug) plus the usual assorted minor fixes and updates.

  The major change this time around is a prep patch for rethreading of
  the driver reset handler API not to take a scsi_cmd structure which
  starts to reduce various drivers' dependence on scsi_cmd in error
  handling"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (132 commits)
  scsi: ufs: core: Leave space for '\0' in utf8 desc string
  scsi: ufs: core: Conversion to bool not necessary
  scsi: ufs: core: Fix race between force complete and ISR
  scsi: megaraid: Fix up debug message in megaraid_abort_and_reset()
  scsi: aic79xx: Fix up NULL command in ahd_done()
  scsi: message: fusion: Initialize return value in mptfc_bus_reset()
  scsi: mpt3sas: Fix loop logic
  scsi: snic: Remove useless code in snic_dr_clean_pending_req()
  scsi: core: Add comment to target_destroy in scsi_host_template
  scsi: core: Clean up scsi_dev_queue_ready()
  scsi: pmcraid: Add missing scsi_device_put() in pmcraid_eh_target_reset_handler()
  scsi: target: core: Fix kernel-doc comment
  scsi: pmcraid: Fix kernel-doc comment
  scsi: core: Handle depopulation and restoration in progress
  scsi: ufs: core: Add support for parsing OPP
  scsi: ufs: core: Add OPP support for scaling clocks and regulators
  scsi: ufs: dt-bindings: common: Add OPP table
  scsi: scsi_debug: Add param to control sdev's allow_restart
  scsi: scsi_debug: Add debugfs interface to fail target reset
  scsi: scsi_debug: Add new error injection type: Reset LUN failed
  ...
Commit
6ed92e559a2ea572ae2bac5cbeddd1dc8cb667b6
Parents
90a300dc · a75a16c6

Merge commit. Changes below are compared with the first parent: 90a300dc.

Changes

103 files changed · +2747 −1362

FileStatusAddDelContent
Documentation/devicetree/bindings/ufs/ufs-common.yamlmodified+32−3View file
MAINTAINERSmodified+1−2View file
drivers/infiniband/ulp/srpt/ib_srpt.cmodified+3−0View file
drivers/message/fusion/mptctl.cmodified+9−10View file
drivers/message/fusion/mptfc.cmodified+65−29View file
drivers/message/fusion/mptsas.cmodified+8−8View file
drivers/message/fusion/mptscsih.cmodified+54−1View file
drivers/message/fusion/mptscsih.hmodified+1−0View file
drivers/scsi/Kconfigmodified+0−15View file
drivers/scsi/aic7xxx/aic79xx_osm.cmodified+26−12View file
drivers/scsi/aic7xxx/aic7xxx_osm.cmodified+70−57View file
drivers/scsi/bnx2fc/bnx2fc.hmodified+1−0View file
drivers/scsi/bnx2fc/bnx2fc_hwi.cmodified+9−5View file
drivers/scsi/bnx2fc/bnx2fc_io.cmodified+47−47View file
drivers/scsi/cxgbi/libcxgbi.cmodified+1−1View file
drivers/scsi/device_handler/scsi_dh_hp_sw.cmodified+40−39View file
drivers/scsi/device_handler/scsi_dh_rdac.cmodified+12−9View file
drivers/scsi/elx/efct/efct_lio.cmodified+5−0View file
drivers/scsi/esas2r/esas2r_ioctl.cmodified+6−10View file
drivers/scsi/fnic/fnic_fcs.cmodified+6−5View file
drivers/scsi/hisi_sas/hisi_sas.hmodified+1−2View file
drivers/scsi/hisi_sas/hisi_sas_main.cmodified+5−2View file
drivers/scsi/hisi_sas/hisi_sas_v3_hw.cmodified+53−63View file
drivers/scsi/ibmvscsi/ibmvfc.cmodified+349−140View file
drivers/scsi/ibmvscsi/ibmvfc.hmodified+34−16View file
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.cmodified+3−0View file
drivers/scsi/imm.cmodified+37−33View file
drivers/scsi/imm.hmodified+0−4View file
drivers/scsi/ips.cmodified+0−18View file
drivers/scsi/libfc/fc_lport.cmodified+6−0View file
drivers/scsi/libsas/sas_discover.cmodified+1−1View file
drivers/scsi/libsas/sas_init.cmodified+2−2View file
drivers/scsi/libsas/sas_internal.hmodified+12−0View file
drivers/scsi/lpfc/lpfc_els.cmodified+23−0View file
drivers/scsi/lpfc/lpfc_hbadisc.cmodified+4−4View file
drivers/scsi/lpfc/lpfc_logmsg.hmodified+1−1View file
drivers/scsi/lpfc/lpfc_nportdisc.cmodified+14−4View file
drivers/scsi/lpfc/lpfc_nvme.cmodified+4−2View file
drivers/scsi/lpfc/lpfc_sli.cmodified+1−3View file
drivers/scsi/lpfc/lpfc_version.hmodified+1−1View file
drivers/scsi/megaraid.cmodified+23−30View file
drivers/scsi/megaraid/megaraid_sas.hmodified+2−2View file
drivers/scsi/megaraid/megaraid_sas_base.cmodified+2−2View file
drivers/scsi/megaraid/megaraid_sas_fusion.cmodified+3−0View file
drivers/scsi/mpi3mr/mpi3mr_os.cmodified+37−20View file
drivers/scsi/mpt3sas/mpt3sas_base.cmodified+2−2View file
drivers/scsi/pm8001/pm8001_hwi.cmodified+16−73View file
drivers/scsi/pm8001/pm8001_init.cmodified+153−132View file
drivers/scsi/pm8001/pm8001_sas.hmodified+3−8View file
drivers/scsi/pm8001/pm80xx_hwi.cmodified+19−40View file
drivers/scsi/pmcraid.cmodified+57−12View file
drivers/scsi/qedf/qedf.hmodified+3−2View file
drivers/scsi/qedf/qedf_io.cmodified+20−55View file
drivers/scsi/qedf/qedf_main.cmodified+10−9View file
drivers/scsi/qla1280.cmodified+22−20View file
drivers/scsi/qla2xxx/qla_os.cmodified+3−2View file
drivers/scsi/qla2xxx/tcm_qla2xxx.cmodified+6−0View file
drivers/scsi/scsi.cmodified+1−1View file
drivers/scsi/scsi_debug.cmodified+570−5View file
drivers/scsi/scsi_lib.cmodified+18−19View file
drivers/scsi/scsi_transport_spi.cmodified+2−2View file
drivers/scsi/sd.cmodified+27−21View file
drivers/scsi/snic/snic_scsi.cmodified+4−10View file
drivers/scsi/sr.cmodified+2−1View file
drivers/scsi/sym53c8xx_2/sym_glue.cmodified+121−68View file
drivers/target/iscsi/Kconfigmodified+6−3View file
drivers/target/iscsi/iscsi_target.cmodified+0−6View file
drivers/target/iscsi/iscsi_target_configfs.cmodified+4−1View file
drivers/target/iscsi/iscsi_target_erl1.cmodified+1−1View file
drivers/target/iscsi/iscsi_target_tmr.cmodified+1−1View file
drivers/target/loopback/tcm_loop.cmodified+3−1View file
drivers/target/sbp/sbp_target.cmodified+3−0View file
drivers/target/target_core_alua.cmodified+0−1View file
drivers/target/target_core_configfs.cmodified+22−0View file
drivers/target/target_core_device.cmodified+1−0View file
drivers/target/target_core_fabric_configfs.cmodified+24−0View file
drivers/target/target_core_transport.cmodified+59−57View file
drivers/target/target_core_user.cmodified+1−1View file
drivers/target/tcm_fc/tfc_conf.cmodified+3−0View file
drivers/ufs/core/ufshcd.cmodified+193−75View file
drivers/ufs/host/cdns-pltfrm.cmodified+2−3View file
drivers/ufs/host/tc-dwc-g210-pltfrm.cmodified+2−4View file
drivers/ufs/host/ti-j721e-ufs.cmodified+2−4View file
drivers/ufs/host/ufs-exynos.cmodified+9−6View file
drivers/ufs/host/ufs-hisi.cmodified+2−3View file
drivers/ufs/host/ufs-mediatek.cmodified+3−4View file
drivers/ufs/host/ufs-qcom.cmodified+166−50View file
drivers/ufs/host/ufs-qcom.hmodified+17−3View file
drivers/ufs/host/ufs-renesas.cmodified+2−4View file
drivers/ufs/host/ufs-sprd.cmodified+2−3View file
drivers/ufs/host/ufshcd-pci.cmodified+3−2View file
drivers/ufs/host/ufshcd-pltfrm.cmodified+88−5View file
drivers/ufs/host/ufshcd-pltfrm.hmodified+1−1View file
drivers/usb/gadget/function/f_tcm.cmodified+3−0View file
drivers/vhost/scsi.cmodified+4−1View file
drivers/xen/xen-scsiback.cmodified+3−0View file
include/scsi/libsas.hmodified+0−17View file
include/scsi/scsi_host.hmodified+3−0View file
include/target/target_core_base.hmodified+10−0View file
include/target/target_core_fabric.hmodified+12−7View file
include/trace/events/ufs.hmodified+8−7View file
include/ufs/ufs.hmodified+2−1View file
include/ufs/ufshcd.hmodified+9−5View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/devicetree/bindings/ufs/ufs-common.yaml

View file
diff --git a/Documentation/devicetree/bindings/ufs/ufs-common.yaml b/Documentation/devicetree/bindings/ufs/ufs-common.yaml
index bbaee4f..985ea8f 100644
--- a/Documentation/devicetree/bindings/ufs/ufs-common.yaml
+++ b/Documentation/devicetree/bindings/ufs/ufs-common.yaml
@@ -20,11 +20,25 @@ properties:
items:
- description: Minimum frequency for given clock in Hz
- description: Maximum frequency for given clock in Hz
+ deprecated: true
description: |
+ Preferred is operating-points-v2.
+
Array of <min max> operating frequencies in Hz stored in the same order
- as the clocks property. If this property is not defined or a value in the
- array is "0" then it is assumed that the frequency is set by the parent
- clock or a fixed rate clock source.
+ as the clocks property. If either this property or operating-points-v2 is
+ not defined or a value in the array is "0" then it is assumed that the
+ frequency is set by the parent clock or a fixed rate clock source.
+
+ operating-points-v2:
+ description:
+ Preferred over freq-table-hz.
+ If present, each OPP must contain array of frequencies stored in the same
+ order for each clock. If clock frequency in the array is "0" then it is
+ assumed that the frequency is set by the parent clock or a fixed rate
+ clock source.
+
+ opp-table:
+ type: object
interrupts:
maxItems: 1
@@ -75,8 +89,23 @@ properties:
dependencies:
freq-table-hz: [ clocks ]
+ operating-points-v2: [ clocks, clock-names ]
required:
- interrupts
+allOf:
+ - if:
+ required:
+ - freq-table-hz
+ then:
+ properties:
+ operating-points-v2: false
+ - if:
+ required:
+ - operating-points-v2
+ then:
+ properties:
+ freq-table-hz: false
+
additionalProperties: true

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 434fd16..d6e8511 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11221,7 +11221,6 @@ M: Sagi Grimberg <[email protected]>
S: Supported
-W: http://www.linux-iscsi.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master
F: drivers/infiniband/ulp/isert
@@ -13623,6 +13622,7 @@ MEGARAID SCSI/SAS DRIVERS
M: Kashyap Desai <[email protected]>
M: Sumit Saxena <[email protected]>
M: Shivasharan S <[email protected]>
+M: Chandrakanth patil <[email protected]>
S: Maintained
@@ -19275,7 +19275,6 @@ M: "Martin K. Petersen" <[email protected]>
S: Supported
-W: http://www.linux-iscsi.org
Q: https://patchwork.kernel.org/project/target-devel/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
F: Documentation/target/

drivers/infiniband/ulp/srpt/ib_srpt.c

View file
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index c12005e..58f70cf 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -3867,6 +3867,9 @@ static const struct target_core_fabric_ops srpt_template = {
.tfc_discovery_attrs = srpt_da_attrs,
.tfc_wwn_attrs = srpt_wwn_attrs,
.tfc_tpg_attrib_attrs = srpt_tpg_attrib_attrs,
+
+ .default_submit_type = TARGET_DIRECT_SUBMIT,
+ .direct_submit_supp = 1,
};
/**

drivers/message/fusion/mptctl.c

View file
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
index dd028df..9f39997 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -1328,8 +1328,8 @@ mptctl_getiocinfo (MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size)
/* Set the Version Strings.
*/
- strncpy (karg->driverVersion, MPT_LINUX_PACKAGE_NAME, MPT_IOCTL_VERSION_LENGTH);
- karg->driverVersion[MPT_IOCTL_VERSION_LENGTH-1]='\0';
+ strscpy_pad(karg->driverVersion, MPT_LINUX_PACKAGE_NAME,
+ sizeof(karg->driverVersion));
karg->busChangeEvent = 0;
karg->hostId = ioc->pfacts[port].PortSCSIID;
@@ -1493,10 +1493,8 @@ mptctl_readtest (MPT_ADAPTER *ioc, unsigned long arg)
#else
karg.chip_type = ioc->pcidev->device;
#endif
- strncpy (karg.name, ioc->name, MPT_MAX_NAME);
- karg.name[MPT_MAX_NAME-1]='\0';
- strncpy (karg.product, ioc->prod_name, MPT_PRODUCT_LENGTH);
- karg.product[MPT_PRODUCT_LENGTH-1]='\0';
+ strscpy_pad(karg.name, ioc->name, sizeof(karg.name));
+ strscpy_pad(karg.product, ioc->prod_name, sizeof(karg.product));
/* Copy the data from kernel memory to user memory
*/
@@ -2394,7 +2392,7 @@ mptctl_hp_hostinfo(MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size)
cfg.dir = 0; /* read */
cfg.timeout = 10;
- strncpy(karg.serial_number, " ", 24);
+ strscpy_pad(karg.serial_number, " ", sizeof(karg.serial_number));
if (mpt_config(ioc, &cfg) == 0) {
if (cfg.cfghdr.hdr->PageLength > 0) {
/* Issue the second config page request */
@@ -2408,8 +2406,9 @@ mptctl_hp_hostinfo(MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size)
if (mpt_config(ioc, &cfg) == 0) {
ManufacturingPage0_t *pdata = (ManufacturingPage0_t *) pbuf;
if (strlen(pdata->BoardTracerNumber) > 1) {
- strscpy(karg.serial_number,
- pdata->BoardTracerNumber, 24);
+ strscpy_pad(karg.serial_number,
+ pdata->BoardTracerNumber,
+ sizeof(karg.serial_number));
}
}
dma_free_coherent(&ioc->pcidev->dev,
@@ -2456,7 +2455,7 @@ mptctl_hp_hostinfo(MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size)
}
}
- /*
+ /*
* Gather ISTWI(Industry Standard Two Wire Interface) Data
*/
if ((mf = mpt_get_msg_frame(mptctl_id, ioc)) == NULL) {

drivers/message/fusion/mptfc.c

View file
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index 22e7779..0581f85 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -183,73 +183,109 @@ static struct fc_function_template mptfc_transport_functions = {
};
static int
-mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
- int (*func)(struct scsi_cmnd *SCpnt),
- const char *caller)
+mptfc_block_error_handler(struct fc_rport *rport)
{
MPT_SCSI_HOST *hd;
- struct scsi_device *sdev = SCpnt->device;
- struct Scsi_Host *shost = sdev->host;
- struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
+ struct Scsi_Host *shost = rport_to_shost(rport);
unsigned long flags;
int ready;
- MPT_ADAPTER *ioc;
+ MPT_ADAPTER *ioc;
int loops = 40; /* seconds */
- hd = shost_priv(SCpnt->device->host);
+ hd = shost_priv(shost);
ioc = hd->ioc;
spin_lock_irqsave(shost->host_lock, flags);
while ((ready = fc_remote_port_chkready(rport) >> 16) == DID_IMM_RETRY
|| (loops > 0 && ioc->active == 0)) {
spin_unlock_irqrestore(shost->host_lock, flags);
dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
- "mptfc_block_error_handler.%d: %d:%llu, port status is "
- "%x, active flag %d, deferring %s recovery.\n",
+ "mptfc_block_error_handler.%d: %s, port status is "
+ "%x, active flag %d, deferring recovery.\n",
ioc->name, ioc->sh->host_no,
- SCpnt->device->id, SCpnt->device->lun,
- ready, ioc->active, caller));
+ dev_name(&rport->dev), ready, ioc->active));
msleep(1000);
spin_lock_irqsave(shost->host_lock, flags);
loops --;
}
spin_unlock_irqrestore(shost->host_lock, flags);
- if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata
- || ioc->active == 0) {
+ if (ready == DID_NO_CONNECT || ioc->active == 0) {
dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
- "%s.%d: %d:%llu, failing recovery, "
- "port state %x, active %d, vdevice %p.\n", caller,
+ "mpt_block_error_handler.%d: %s, failing recovery, "
+ "port state %x, active %d.\n",
ioc->name, ioc->sh->host_no,
- SCpnt->device->id, SCpnt->device->lun, ready,
- ioc->active, SCpnt->device->hostdata));
+ dev_name(&rport->dev), ready, ioc->active));
return FAILED;
}
- dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
- "%s.%d: %d:%llu, executing recovery.\n", caller,
- ioc->name, ioc->sh->host_no,
- SCpnt->device->id, SCpnt->device->lun));
- return (*func)(SCpnt);
+ return SUCCESS;
}
static int
mptfc_abort(struct scsi_cmnd *SCpnt)
{
- return
- mptfc_block_error_handler(SCpnt, mptscsih_abort, __func__);
+ struct Scsi_Host *shost = SCpnt->device->host;
+ struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device));
+ MPT_SCSI_HOST __maybe_unused *hd = shost_priv(shost);
+ int rtn;
+
+ rtn = mptfc_block_error_handler(rport);
+ if (rtn == SUCCESS) {
+ dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT
+ "%s.%d: %d:%llu, executing recovery.\n", __func__,
+ hd->ioc->name, shost->host_no,
+ SCpnt->device->id, SCpnt->device->lun));
+ rtn = mptscsih_abort(SCpnt);
+ }
+ return rtn;
}
static int
mptfc_dev_reset(struct scsi_cmnd *SCpnt)
{
- return
- mptfc_block_error_handler(SCpnt, mptscsih_dev_reset, __func__);
+ struct Scsi_Host *shost = SCpnt->device->host;
+ struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device));
+ MPT_SCSI_HOST __maybe_unused *hd = shost_priv(shost);
+ int rtn;
+
+ rtn = mptfc_block_error_handler(rport);
+ if (rtn == SUCCESS) {
+ dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT
+ "%s.%d: %d:%llu, executing recovery.\n", __func__,
+ hd->ioc->name, shost->host_no,
+ SCpnt->device->id, SCpnt->device->lun));
+ rtn = mptscsih_dev_reset(SCpnt);
+ }
+ return rtn;
}
static int
mptfc_bus_reset(struct scsi_cmnd *SCpnt)
{
- return
- mptfc_block_error_handler(SCpnt, mptscsih_bus_reset, __func__);
+ struct Scsi_Host *shost = SCpnt->device->host;
+ MPT_SCSI_HOST __maybe_unused *hd = shost_priv(shost);
+ int channel = SCpnt->device->channel;
+ struct mptfc_rport_info *ri;
+ int rtn = FAILED;
+
+ list_for_each_entry(ri, &hd->ioc->fc_rports, list) {
+ if (ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED) {
+ VirtTarget *vtarget = ri->starget->hostdata;
+
+ if (!vtarget || vtarget->channel != channel)
+ continue;
+ rtn = fc_block_rport(ri->rport);
+ if (rtn != 0)
+ break;
+ }
+ }
+ if (rtn == 0) {
+ dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT
+ "%s.%d: %d:%llu, executing recovery.\n", __func__,
+ hd->ioc->name, shost->host_no,
+ SCpnt->device->id, SCpnt->device->lun));
+ rtn = mptscsih_bus_reset(SCpnt);
+ }
+ return rtn;
}
static void

drivers/message/fusion/mptsas.c

View file
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 86f16f3..300f8e9 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -2964,17 +2964,17 @@ mptsas_exp_repmanufacture_info(MPT_ADAPTER *ioc,
goto out_free;
manufacture_reply = data_out + sizeof(struct rep_manu_request);
- strncpy(edev->vendor_id, manufacture_reply->vendor_id,
- SAS_EXPANDER_VENDOR_ID_LEN);
- strncpy(edev->product_id, manufacture_reply->product_id,
- SAS_EXPANDER_PRODUCT_ID_LEN);
- strncpy(edev->product_rev, manufacture_reply->product_rev,
- SAS_EXPANDER_PRODUCT_REV_LEN);
+ strscpy(edev->vendor_id, manufacture_reply->vendor_id,
+ sizeof(edev->vendor_id));
+ strscpy(edev->product_id, manufacture_reply->product_id,
+ sizeof(edev->product_id));
+ strscpy(edev->product_rev, manufacture_reply->product_rev,
+ sizeof(edev->product_rev));
edev->level = manufacture_reply->sas_format;
if (manufacture_reply->sas_format) {
- strncpy(edev->component_vendor_id,
+ strscpy(edev->component_vendor_id,
manufacture_reply->component_vendor_id,
- SAS_EXPANDER_COMPONENT_VENDOR_ID_LEN);
+ sizeof(edev->component_vendor_id));
tmp = (u8 *)&manufacture_reply->component_id;
edev->component_id = tmp[0] << 8 | tmp[1];
edev->component_revision_id =

drivers/message/fusion/mptscsih.c

View file
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 2bc1708..9080a73 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -1793,7 +1793,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/**
- * mptscsih_dev_reset - Perform a SCSI TARGET_RESET! new_eh variant
+ * mptscsih_dev_reset - Perform a SCSI LOGICAL_UNIT_RESET!
* @SCpnt: Pointer to scsi_cmnd structure, IO which reset is due to
*
* (linux scsi_host_template.eh_dev_reset_handler routine)
@@ -1811,6 +1811,58 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt)
/* If we can't locate our host adapter structure, return FAILED status.
*/
if ((hd = shost_priv(SCpnt->device->host)) == NULL){
+ printk(KERN_ERR MYNAM ": lun reset: "
+ "Can't locate host! (sc=%p)\n", SCpnt);
+ return FAILED;
+ }
+
+ ioc = hd->ioc;
+ printk(MYIOC_s_INFO_FMT "attempting lun reset! (sc=%p)\n",
+ ioc->name, SCpnt);
+ scsi_print_command(SCpnt);
+
+ vdevice = SCpnt->device->hostdata;
+ if (!vdevice || !vdevice->vtarget) {
+ retval = 0;
+ goto out;
+ }
+
+ retval = mptscsih_IssueTaskMgmt(hd,
+ MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET,
+ vdevice->vtarget->channel,
+ vdevice->vtarget->id, vdevice->lun, 0,
+ mptscsih_get_tm_timeout(ioc));
+
+ out:
+ printk (MYIOC_s_INFO_FMT "lun reset: %s (sc=%p)\n",
+ ioc->name, ((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt);
+
+ if (retval == 0)
+ return SUCCESS;
+ else
+ return FAILED;
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/**
+ * mptscsih_target_reset - Perform a SCSI TARGET_RESET!
+ * @SCpnt: Pointer to scsi_cmnd structure, IO which reset is due to
+ *
+ * (linux scsi_host_template.eh_target_reset_handler routine)
+ *
+ * Returns SUCCESS or FAILED.
+ **/
+int
+mptscsih_target_reset(struct scsi_cmnd * SCpnt)
+{
+ MPT_SCSI_HOST *hd;
+ int retval;
+ VirtDevice *vdevice;
+ MPT_ADAPTER *ioc;
+
+ /* If we can't locate our host adapter structure, return FAILED status.
+ */
+ if ((hd = shost_priv(SCpnt->device->host)) == NULL){
printk(KERN_ERR MYNAM ": target reset: "
"Can't locate host! (sc=%p)\n", SCpnt);
return FAILED;
@@ -3256,6 +3308,7 @@ EXPORT_SYMBOL(mptscsih_slave_destroy);
EXPORT_SYMBOL(mptscsih_slave_configure);
EXPORT_SYMBOL(mptscsih_abort);
EXPORT_SYMBOL(mptscsih_dev_reset);
+EXPORT_SYMBOL(mptscsih_target_reset);
EXPORT_SYMBOL(mptscsih_bus_reset);
EXPORT_SYMBOL(mptscsih_host_reset);
EXPORT_SYMBOL(mptscsih_bios_param);

drivers/message/fusion/mptscsih.h

View file
diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h
index a22c5ea..e3d92c3 100644
--- a/drivers/message/fusion/mptscsih.h
+++ b/drivers/message/fusion/mptscsih.h
@@ -120,6 +120,7 @@ extern void mptscsih_slave_destroy(struct scsi_device *device);
extern int mptscsih_slave_configure(struct scsi_device *device);
extern int mptscsih_abort(struct scsi_cmnd * SCpnt);
extern int mptscsih_dev_reset(struct scsi_cmnd * SCpnt);
+extern int mptscsih_target_reset(struct scsi_cmnd * SCpnt);
extern int mptscsih_bus_reset(struct scsi_cmnd * SCpnt);
extern int mptscsih_host_reset(struct scsi_cmnd *SCpnt);
extern int mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev, sector_t capacity, int geom[]);

drivers/scsi/Kconfig

View file
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 695a57d..addac7f 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -834,21 +834,6 @@ config SCSI_IMM
To compile this driver as a module, choose M here: the
module will be called imm.
-config SCSI_IZIP_EPP16
- bool "ppa/imm option - Use slow (but safe) EPP-16"
- depends on SCSI_IMM
- help
- EPP (Enhanced Parallel Port) is a standard for parallel ports which
- allows them to act as expansion buses that can handle up to 64
- peripheral devices.
-
- Some parallel port chipsets are slower than their motherboard, and
- so we have to control the state of the chipset's FIFO queue every
- now and then to avoid data loss. This will be done if you say Y
- here.
-
- Generally, saying Y is the safe option and slows things down a bit.
-
config SCSI_IZIP_SLOW_CTR
bool "ppa/imm option - Assume slow parport control register"
depends on SCSI_PPA || SCSI_IMM

drivers/scsi/aic7xxx/aic79xx_osm.c

View file
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index f2f3405..4202059 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -536,13 +536,18 @@ ahd_linux_unmap_scb(struct ahd_softc *ahd, struct scb *scb)
struct scsi_cmnd *cmd;
cmd = scb->io_ctx;
- ahd_sync_sglist(ahd, scb, BUS_DMASYNC_POSTWRITE);
- scsi_dma_unmap(cmd);
+ if (cmd) {
+ ahd_sync_sglist(ahd, scb, BUS_DMASYNC_POSTWRITE);
+ scsi_dma_unmap(cmd);
+ }
}
/******************************** Macros **************************************/
-#define BUILD_SCSIID(ahd, cmd) \
- (((scmd_id(cmd) << TID_SHIFT) & TID) | (ahd)->our_id)
+static inline unsigned int ahd_build_scsiid(struct ahd_softc *ahd,
+ struct scsi_device *sdev)
+{
+ return ((sdev_id(sdev) << TID_SHIFT) & TID) | (ahd)->our_id;
+}
/*
* Return a string describing the driver.
@@ -811,14 +816,14 @@ ahd_linux_dev_reset(struct scsi_cmnd *cmd)
tinfo = ahd_fetch_transinfo(ahd, 'A', ahd->our_id,
cmd->device->id, &tstate);
- reset_scb->io_ctx = cmd;
+ reset_scb->io_ctx = NULL;
reset_scb->platform_data->dev = dev;
reset_scb->sg_count = 0;
ahd_set_residual(reset_scb, 0);
ahd_set_sense_residual(reset_scb, 0);
reset_scb->platform_data->xfer_len = 0;
reset_scb->hscb->control = 0;
- reset_scb->hscb->scsiid = BUILD_SCSIID(ahd,cmd);
+ reset_scb->hscb->scsiid = ahd_build_scsiid(ahd, cmd->device);
reset_scb->hscb->lun = cmd->device->lun;
reset_scb->hscb->cdb_len = 0;
reset_scb->hscb->task_management = SIU_TASKMGMT_LUN_RESET;
@@ -1577,7 +1582,7 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
* Fill out basics of the HSCB.
*/
hscb->control = 0;
- hscb->scsiid = BUILD_SCSIID(ahd, cmd);
+ hscb->scsiid = ahd_build_scsiid(ahd, cmd->device);
hscb->lun = cmd->device->lun;
scb->hscb->task_management = 0;
mask = SCB_GET_TARGET_MASK(ahd, scb);
@@ -1766,9 +1771,16 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb)
dev = scb->platform_data->dev;
dev->active--;
dev->openings++;
- if ((cmd->result & (CAM_DEV_QFRZN << 16)) != 0) {
- cmd->result &= ~(CAM_DEV_QFRZN << 16);
- dev->qfrozen--;
+ if (cmd) {
+ if ((cmd->result & (CAM_DEV_QFRZN << 16)) != 0) {
+ cmd->result &= ~(CAM_DEV_QFRZN << 16);
+ dev->qfrozen--;
+ }
+ } else if (scb->flags & SCB_DEVICE_RESET) {
+ if (ahd->platform_data->eh_done)
+ complete(ahd->platform_data->eh_done);
+ ahd_free_scb(ahd, scb);
+ return;
}
ahd_linux_unmap_scb(ahd, scb);
@@ -1822,7 +1834,8 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb)
} else {
ahd_set_transaction_status(scb, CAM_REQ_CMP);
}
- } else if (ahd_get_transaction_status(scb) == CAM_SCSI_STATUS_ERROR) {
+ } else if (cmd &&
+ ahd_get_transaction_status(scb) == CAM_SCSI_STATUS_ERROR) {
ahd_linux_handle_scsi_status(ahd, cmd->device, scb);
}
@@ -1856,7 +1869,8 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb)
}
ahd_free_scb(ahd, scb);
- ahd_linux_queue_cmd_complete(ahd, cmd);
+ if (cmd)
+ ahd_linux_queue_cmd_complete(ahd, cmd);
}
static void

drivers/scsi/aic7xxx/aic7xxx_osm.c

View file
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index d3b1082..4ae0a1c 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -366,7 +366,8 @@ static void ahc_linux_queue_cmd_complete(struct ahc_softc *ahc,
struct scsi_cmnd *cmd);
static void ahc_linux_freeze_simq(struct ahc_softc *ahc);
static void ahc_linux_release_simq(struct ahc_softc *ahc);
-static int ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag);
+static int ahc_linux_queue_recovery_cmd(struct scsi_device *sdev,
+ struct scsi_cmnd *cmd);
static void ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc);
static u_int ahc_linux_user_tagdepth(struct ahc_softc *ahc,
struct ahc_devinfo *devinfo);
@@ -728,7 +729,7 @@ ahc_linux_abort(struct scsi_cmnd *cmd)
{
int error;
- error = ahc_linux_queue_recovery_cmd(cmd, SCB_ABORT);
+ error = ahc_linux_queue_recovery_cmd(cmd->device, cmd);
if (error != SUCCESS)
printk("aic7xxx_abort returns 0x%x\n", error);
return (error);
@@ -742,7 +743,7 @@ ahc_linux_dev_reset(struct scsi_cmnd *cmd)
{
int error;
- error = ahc_linux_queue_recovery_cmd(cmd, SCB_DEVICE_RESET);
+ error = ahc_linux_queue_recovery_cmd(cmd->device, NULL);
if (error != SUCCESS)
printk("aic7xxx_dev_reset returns 0x%x\n", error);
return (error);
@@ -798,11 +799,18 @@ struct scsi_host_template aic7xxx_driver_template = {
/**************************** Tasklet Handler *********************************/
-/******************************** Macros **************************************/
-#define BUILD_SCSIID(ahc, cmd) \
- ((((cmd)->device->id << TID_SHIFT) & TID) \
- | (((cmd)->device->channel == 0) ? (ahc)->our_id : (ahc)->our_id_b) \
- | (((cmd)->device->channel == 0) ? 0 : TWIN_CHNLB))
+
+static inline unsigned int ahc_build_scsiid(struct ahc_softc *ahc,
+ struct scsi_device *sdev)
+{
+ unsigned int scsiid = (sdev->id << TID_SHIFT) & TID;
+
+ if (sdev->channel == 0)
+ scsiid |= ahc->our_id;
+ else
+ scsiid |= ahc->our_id_b | TWIN_CHNLB;
+ return scsiid;
+}
/******************************** Bus DMA *************************************/
int
@@ -1457,7 +1465,7 @@ ahc_linux_run_command(struct ahc_softc *ahc, struct ahc_linux_device *dev,
* Fill out basics of the HSCB.
*/

This diff is incomplete. Download the complete patch.

drivers/scsi/bnx2fc/bnx2fc.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/bnx2fc/bnx2fc_hwi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/bnx2fc/bnx2fc_io.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/cxgbi/libcxgbi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/device_handler/scsi_dh_hp_sw.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/device_handler/scsi_dh_rdac.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/elx/efct/efct_lio.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/esas2r/esas2r_ioctl.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/fnic/fnic_fcs.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/hisi_sas/hisi_sas.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/hisi_sas/hisi_sas_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/ibmvscsi/ibmvfc.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/ibmvscsi/ibmvfc.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/imm.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/imm.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/ips.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/libfc/fc_lport.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/libsas/sas_discover.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/libsas/sas_init.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/libsas/sas_internal.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/lpfc/lpfc_els.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/lpfc/lpfc_hbadisc.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/lpfc/lpfc_logmsg.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/lpfc/lpfc_nportdisc.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/lpfc/lpfc_nvme.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/lpfc/lpfc_sli.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/lpfc/lpfc_version.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/megaraid.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/megaraid/megaraid_sas.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/megaraid/megaraid_sas_base.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/megaraid/megaraid_sas_fusion.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/mpi3mr/mpi3mr_os.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/mpt3sas/mpt3sas_base.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/pm8001/pm8001_hwi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/pm8001/pm8001_init.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/pm8001/pm8001_sas.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/pm8001/pm80xx_hwi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/pmcraid.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qedf/qedf.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qedf/qedf_io.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qedf/qedf_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla1280.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla2xxx/qla_os.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla2xxx/tcm_qla2xxx.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/scsi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/scsi_debug.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/scsi_lib.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/scsi_transport_spi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/sd.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/snic/snic_scsi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/sr.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/sym53c8xx_2/sym_glue.c

View file

This diff is incomplete. Download the complete patch.

drivers/target/iscsi/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/target/iscsi/iscsi_target.c

View file

This diff is incomplete. Download the complete patch.

drivers/target/iscsi/iscsi_target_configfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/target/iscsi/iscsi_target_erl1.c

View file

This diff is incomplete. Download the complete patch.

drivers/target/iscsi/iscsi_target_tmr.c

View file

This diff is incomplete. Download the complete patch.

drivers/target/loopback/tcm_loop.c

View file

This diff is incomplete. Download the complete patch.

drivers/target/sbp/sbp_target.c

View file

This diff is incomplete. Download the complete patch.

drivers/target/target_core_alua.c

View file

This diff is incomplete. Download the complete patch.

drivers/target/target_core_configfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/target/target_core_device.c

View file

This diff is incomplete. Download the complete patch.

drivers/target/target_core_fabric_configfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/target/target_core_transport.c

View file

This diff is incomplete. Download the complete patch.

drivers/target/target_core_user.c

View file

This diff is incomplete. Download the complete patch.

drivers/target/tcm_fc/tfc_conf.c

View file

This diff is incomplete. Download the complete patch.

drivers/ufs/core/ufshcd.c

View file

This diff is incomplete. Download the complete patch.

drivers/ufs/host/cdns-pltfrm.c

View file

This diff is incomplete. Download the complete patch.

drivers/ufs/host/tc-dwc-g210-pltfrm.c

View file

This diff is incomplete. Download the complete patch.

drivers/ufs/host/ti-j721e-ufs.c

View file

This diff is incomplete. Download the complete patch.

drivers/ufs/host/ufs-exynos.c

View file

This diff is incomplete. Download the complete patch.

drivers/ufs/host/ufs-hisi.c

View file

This diff is incomplete. Download the complete patch.

drivers/ufs/host/ufs-mediatek.c

View file

This diff is incomplete. Download the complete patch.

drivers/ufs/host/ufs-qcom.c

View file

This diff is incomplete. Download the complete patch.

drivers/ufs/host/ufs-qcom.h

View file

This diff is incomplete. Download the complete patch.

drivers/ufs/host/ufs-renesas.c

View file

This diff is incomplete. Download the complete patch.

drivers/ufs/host/ufs-sprd.c

View file

This diff is incomplete. Download the complete patch.

drivers/ufs/host/ufshcd-pci.c

View file

This diff is incomplete. Download the complete patch.

drivers/ufs/host/ufshcd-pltfrm.c

View file

This diff is incomplete. Download the complete patch.

drivers/ufs/host/ufshcd-pltfrm.h

View file

This diff is incomplete. Download the complete patch.

drivers/usb/gadget/function/f_tcm.c

View file

This diff is incomplete. Download the complete patch.

drivers/vhost/scsi.c

View file

This diff is incomplete. Download the complete patch.

drivers/xen/xen-scsiback.c

View file

This diff is incomplete. Download the complete patch.

include/scsi/libsas.h

View file

This diff is incomplete. Download the complete patch.

include/scsi/scsi_host.h

View file

This diff is incomplete. Download the complete patch.

include/target/target_core_base.h

View file

This diff is incomplete. Download the complete patch.

include/target/target_core_fabric.h

View file

This diff is incomplete. Download the complete patch.

include/trace/events/ufs.h

View file

This diff is incomplete. Download the complete patch.

include/ufs/ufs.h

View file

This diff is incomplete. Download the complete patch.

include/ufs/ufshcd.h

View file

This diff is incomplete. Download the complete patch.