projects/linux·commit cae8da04

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

cae8da04 · Linus Torvalds <[email protected]> · 2016-03-16 17:16:22 -07:00

Pull SCSI updates from James Bottomley:
 "This pull includes driver updates from the usual suspects (stex, hpsa,
  ncr5380, scsi_dh, qla2xxx, be2iscsi, hisi_sas, cxlflash, aacraid,
  mp3sas, megaraid_sas, ibmvscsi, ufs) plus an assortment of
  miscellaneous fixes.

  The major user visible change of this pull is that we've moved from
  monotonically increasing host number to an ida allocated one (meaning
  the numbers get re-used) because someone managed to wrap the count in
  an iscsi system.  We don't believe there will be any adverse
  consequences of this"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (230 commits)
  MAINTAINERS: use new email address for James Bottomley
  mpt3sas: Remove unnecessary synchronize_irq() before free_irq()
  sg: fix dxferp in from_to case
  cxlflash: Increase cmd_per_lun for better throughput
  cxlflash: Fix to avoid unnecessary scan with internal LUNs
  cxlflash: Reorder user context initialization
  cxlflash: Simplify attach path error cleanup
  cxlflash: Split out context initialization
  cxlflash: Unmap problem state area before detaching master context
  cxlflash: Simplify PCI registration
  scsi: storvsc: fix SRB_STATUS_ABORTED handling
  be2iscsi: set the boot_kset pointer to NULL in case of failure
  sd: Fix discard granularity when LBPRZ=1
  be2iscsi: Remove unnecessary synchronize_irq() before free_irq()
  scsi_sysfs: call 'device_add' after attaching device handler
  scsi_dh_emc: update 'access_state' field
  scsi_dh_rdac: update 'access_state' field
  scsi_dh_alua: update 'access_state' field
  scsi_dh_alua: use common definitions for ALUA state
  scsi: Add 'access_state' and 'preferred_path' attribute
  ...
Commit
cae8da047b165aaf334fd87020c2ea7ee020c41c
Parents
7bb7a748 · a7dee8f4

Merge commit. Changes below are compared with the first parent: 7bb7a748.

Changes

120 files changed · +9171 −3159

FileStatusAddDelContent
Documentation/devicetree/bindings/scsi/hisilicon-sas.txtmodified+20−1View file
Documentation/scsi/st.txtmodified+10−5View file
MAINTAINERSmodified+8−9View file
drivers/message/fusion/mptbase.cmodified+35−7View file
drivers/scsi/Kconfigmodified+1−0View file
drivers/scsi/NCR5380.cmodified+59−74View file
drivers/scsi/aacraid/aachba.cmodified+12−15View file
drivers/scsi/aacraid/aacraid.hmodified+13−1View file
drivers/scsi/aacraid/commctrl.cmodified+12−1View file
drivers/scsi/aacraid/comminit.cmodified+4−2View file
drivers/scsi/aacraid/commsup.cmodified+63−6View file
drivers/scsi/aacraid/dpcsup.cmodified+0−2View file
drivers/scsi/aacraid/linit.cmodified+179−20View file
drivers/scsi/aacraid/src.cmodified+7−23View file
drivers/scsi/aha1542.cmodified+3−0View file
drivers/scsi/aic7xxx/aic7xxx_osm.cmodified+1−0View file
drivers/scsi/arm/acornscsi.cmodified+2−1View file
drivers/scsi/arm/fas216.cmodified+2−0View file
drivers/scsi/atari_NCR5380.cmodified+59−74View file
drivers/scsi/be2iscsi/be.hmodified+12−8View file
drivers/scsi/be2iscsi/be_cmds.cmodified+412−455View file
drivers/scsi/be2iscsi/be_cmds.hmodified+79−69View file
drivers/scsi/be2iscsi/be_iscsi.cmodified+23−39View file
drivers/scsi/be2iscsi/be_main.cmodified+164−149View file
drivers/scsi/be2iscsi/be_main.hmodified+17−8View file
drivers/scsi/be2iscsi/be_mgmt.cmodified+319−254View file
drivers/scsi/be2iscsi/be_mgmt.hmodified+2−0View file
drivers/scsi/bfa/bfa_core.cmodified+19−0View file
drivers/scsi/bfa/bfa_cs.hmodified+4−37View file
drivers/scsi/bfa/bfa_ioc.cmodified+1−1View file
drivers/scsi/bnx2fc/bnx2fc_fcoe.cmodified+9−0View file
drivers/scsi/bnx2fc/bnx2fc_io.cmodified+2−3View file
drivers/scsi/cxlflash/common.hmodified+5−3View file
drivers/scsi/cxlflash/main.cmodified+15−57View file
drivers/scsi/cxlflash/superpipe.cmodified+110−85View file
drivers/scsi/cxlflash/superpipe.hmodified+1−0View file
drivers/scsi/device_handler/Kconfigmodified+4−4View file
drivers/scsi/device_handler/scsi_dh_alua.cmodified+673−306View file
drivers/scsi/device_handler/scsi_dh_emc.cmodified+6−1View file
drivers/scsi/device_handler/scsi_dh_rdac.cmodified+31−7View file
drivers/scsi/dpt_i2o.cmodified+3−0View file
drivers/scsi/esas2r/esas2r_ioctl.cmodified+3−2View file
drivers/scsi/fcoe/fcoe_ctlr.cmodified+2−1View file
drivers/scsi/fdomain.cmodified+1−1View file
drivers/scsi/gdth.cmodified+2−5View file
drivers/scsi/gdth_proc.cmodified+8−3View file
drivers/scsi/hisi_sas/Makefilemodified+1−1View file
drivers/scsi/hisi_sas/hisi_sas.hmodified+17−26View file
drivers/scsi/hisi_sas/hisi_sas_main.cmodified+98−38View file
drivers/scsi/hisi_sas/hisi_sas_v1_hw.cmodified+74−26View file
drivers/scsi/hisi_sas/hisi_sas_v2_hw.cadded+2214−0View file
drivers/scsi/hosts.cmodified+14−8View file
drivers/scsi/hpsa.cmodified+28−24View file
drivers/scsi/hpsa.hmodified+2−1View file
drivers/scsi/hpsa_cmd.hmodified+3−2View file
drivers/scsi/ibmvscsi/ibmvfc.cmodified+2−1View file
drivers/scsi/ibmvscsi/ibmvscsi.cmodified+29−93View file
drivers/scsi/ibmvscsi/viosrp.hmodified+17−9View file
drivers/scsi/imm.cmodified+4−3View file
drivers/scsi/lpfc/lpfc_debugfs.cmodified+2−2View file
drivers/scsi/lpfc/lpfc_hbadisc.cmodified+5−0View file
drivers/scsi/lpfc/lpfc_scsi.cmodified+0−17View file
drivers/scsi/lpfc/lpfc_sli.cmodified+43−0View file
drivers/scsi/megaraid/megaraid_sas.hmodified+339−12View file
drivers/scsi/megaraid/megaraid_sas_base.cmodified+669−395View file
drivers/scsi/megaraid/megaraid_sas_fp.cmodified+2−0View file
drivers/scsi/megaraid/megaraid_sas_fusion.cmodified+942−345View file
drivers/scsi/megaraid/megaraid_sas_fusion.hmodified+127−9View file
drivers/scsi/mpt3sas/mpi/mpi2.hmodified+73−9View file
drivers/scsi/mpt3sas/mpi/mpi2_cnfg.hmodified+116−11View file
drivers/scsi/mpt3sas/mpi/mpi2_init.hmodified+16−6View file
drivers/scsi/mpt3sas/mpi/mpi2_ioc.hmodified+109−8View file
drivers/scsi/mpt3sas/mpi/mpi2_raid.hmodified+3−2View file
drivers/scsi/mpt3sas/mpi/mpi2_sas.hmodified+8−2View file
drivers/scsi/mpt3sas/mpi/mpi2_tool.hmodified+3−2View file
drivers/scsi/mpt3sas/mpi/mpi2_type.hmodified+3−2View file
drivers/scsi/mpt3sas/mpt3sas_base.cmodified+115−38View file
drivers/scsi/mpt3sas/mpt3sas_base.hmodified+42−5View file
drivers/scsi/mpt3sas/mpt3sas_ctl.cmodified+28−9View file
drivers/scsi/mpt3sas/mpt3sas_scsih.cmodified+251−21View file
drivers/scsi/mpt3sas/mpt3sas_transport.cmodified+5−20View file
drivers/scsi/mvumi.cmodified+2−2View file
drivers/scsi/osd/osd_initiator.cmodified+1−2View file
drivers/scsi/ppa.cmodified+40−6View file
drivers/scsi/qla2xxx/qla_attr.cmodified+16−6View file
drivers/scsi/qla2xxx/qla_bsg.cmodified+201−0View file
drivers/scsi/qla2xxx/qla_bsg.hmodified+34−0View file
drivers/scsi/qla2xxx/qla_dbg.cmodified+78−68View file
drivers/scsi/qla2xxx/qla_def.hmodified+54−2View file
drivers/scsi/qla2xxx/qla_fw.hmodified+13−1View file
drivers/scsi/qla2xxx/qla_gbl.hmodified+2−0View file
drivers/scsi/qla2xxx/qla_init.cmodified+110−9View file
drivers/scsi/qla2xxx/qla_inline.hmodified+2−2View file
drivers/scsi/qla2xxx/qla_isr.cmodified+0−4View file
drivers/scsi/qla2xxx/qla_mbx.cmodified+18−9View file
drivers/scsi/qla2xxx/qla_os.cmodified+10−0View file
drivers/scsi/qla2xxx/qla_sup.cmodified+55−15View file
drivers/scsi/qla2xxx/qla_version.hmodified+1−1View file
drivers/scsi/qla4xxx/ql4_83xx.cmodified+4−2View file
drivers/scsi/qlogicpti.cmodified+2−2View file
drivers/scsi/scsi_devinfo.cmodified+2−0View file
drivers/scsi/scsi_lib.cmodified+1−0View file
drivers/scsi/scsi_scan.cmodified+17−6View file
drivers/scsi/scsi_sysfs.cmodified+99−7View file
drivers/scsi/scsi_transport_iscsi.cmodified+2−0View file
drivers/scsi/sd.cmodified+1−1View file
drivers/scsi/sg.cmodified+2−1View file
drivers/scsi/sim710.cmodified+1−2View file
drivers/scsi/snic/snic_ctl.cmodified+1−1View file
drivers/scsi/st.cmodified+111−11View file
drivers/scsi/stex.cmodified+125−28View file
drivers/scsi/storvsc_drv.cmodified+3−2View file
drivers/scsi/ufs/ufs.hmodified+1−1View file
drivers/scsi/ufs/ufshcd.cmodified+316−81View file
drivers/scsi/ufs/ufshcd.hmodified+5−1View file
include/scsi/iscsi_if.hmodified+2−0View file
include/scsi/scsi_device.hmodified+3−0View file
include/scsi/scsi_devinfo.hmodified+1−0View file
include/scsi/scsi_dh.hmodified+2−0View file
include/scsi/scsi_proto.hmodified+12−0View file

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

Documentation/devicetree/bindings/scsi/hisilicon-sas.txt

View file
diff --git a/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt b/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
index f67e761..bf2411f 100644
--- a/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
+++ b/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
@@ -5,6 +5,7 @@ The HiSilicon SAS controller supports SAS/SATA.
Main node required properties:
- compatible : value should be as follows:
(a) "hisilicon,hip05-sas-v1" for v1 hw in hip05 chipset
+ (b) "hisilicon,hip06-sas-v2" for v2 hw in hip06 chipset
- sas-addr : array of 8 bytes for host SAS address
- reg : Address and length of the SAS register
- hisilicon,sas-syscon: phandle of syscon used for sas control
@@ -13,7 +14,7 @@ Main node required properties:
- ctrl-clock-ena-reg : offset to controller clock enable register in ctrl reg
- queue-count : number of delivery and completion queues in the controller
- phy-count : number of phys accessible by the controller
- - interrupts : Interrupts for phys, completion queues, and fatal
+ - interrupts : For v1 hw: Interrupts for phys, completion queues, and fatal
sources; the interrupts are ordered in 3 groups, as follows:
- Phy interrupts
- Completion queue interrupts
@@ -30,6 +31,24 @@ Main node required properties:
Fatal interrupts : the fatal interrupts are ordered as follows:
- ECC
- AXI bus
+ For v2 hw: Interrupts for phys, Sata, and completion queues;
+ the interrupts are ordered in 3 groups, as follows:
+ - Phy interrupts
+ - Sata interrupts
+ - Completion queue interrupts
+ Phy interrupts : Each controller has 2 phy interrupts:
+ - phy up/down
+ - channel interrupt
+ Sata interrupts : Each phy on the controller has 1 Sata
+ interrupt. The interrupts are ordered in increasing
+ order.
+ Completion queue interrupts : each completion queue has 1
+ interrupt source. The interrupts are ordered in
+ increasing order.
+
+Optional main node properties:
+ - hip06-sas-v2-quirk-amt : when set, indicates that the v2 controller has the
+ "am-max-transmissions" limitation.
Example:
sas0: sas@c1000000 {

Documentation/scsi/st.txt

View file
diff --git a/Documentation/scsi/st.txt b/Documentation/scsi/st.txt
index b3211af..ec0acf6 100644
--- a/Documentation/scsi/st.txt
+++ b/Documentation/scsi/st.txt
@@ -2,7 +2,7 @@ This file contains brief information about the SCSI tape driver.
The driver is currently maintained by Kai Mäkisara (email
-Last modified: Sun Aug 29 18:25:47 2010 by kai.makisara
+Last modified: Tue Feb 9 21:54:16 2016 by kai.makisara
BASICS
@@ -408,10 +408,15 @@ MTSETPART Moves the tape to the partition given by the argument at the
specified by MTSEEK. MTSETPART is inactive unless
MT_ST_CAN_PARTITIONS set.
MTMKPART Formats the tape with one partition (argument zero) or two
- partitions (the argument gives in megabytes the size of
- partition 1 that is physically the first partition of the
- tape). The drive has to support partitions with size specified
- by the initiator. Inactive unless MT_ST_CAN_PARTITIONS set.
+ partitions (argument non-zero). If the argument is positive,
+ it specifies the size of partition 1 in megabytes. For DDS
+ drives and several early drives this is the physically first
+ partition of the tape. If the argument is negative, its absolute
+ value specifies the size of partition 0 in megabytes. This is
+ the physically first partition of many later drives, like the
+ LTO drives from LTO-5 upwards. The drive has to support partitions
+ with size specified by the initiator. Inactive unless
+ MT_ST_CAN_PARTITIONS set.
MTSETDRVBUFFER
Is used for several purposes. The command is obtained from count
with mask MT_SET_OPTIONS, the low order bits are used as argument.

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 25d7cd7..cb2789a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5007,9 +5007,9 @@ F: Documentation/blockdev/cpqarray.txt
F: drivers/block/cpqarray.*
HEWLETT-PACKARD SMART ARRAY RAID DRIVER (hpsa)
-M: Don Brace <[email protected]>
+M: Don Brace <[email protected]>
S: Supported
F: Documentation/scsi/hpsa.txt
@@ -6682,13 +6682,12 @@ S: Maintained
F: arch/arm/mach-lpc32xx/
LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)
-M: Nagalakshmi Nandigama <[email protected]>
-M: Praveen Krishnamoorthy <[email protected]>
-M: Sreekanth Reddy <[email protected]>
-M: Abhijit Mahajan <[email protected]>
+M: Sathya Prakash <[email protected]>
+M: Chaitra P B <[email protected]>
+M: Suganath Prabu Subramani <[email protected]>
-W: http://www.lsilogic.com/support
+W: http://www.avagotech.com/support/
S: Supported
F: drivers/message/fusion/
F: drivers/scsi/mpt2sas/
@@ -9691,7 +9690,7 @@ F: drivers/scsi/sg.c
F: include/scsi/sg.h
SCSI SUBSYSTEM
-M: "James E.J. Bottomley" <[email protected]>
+M: "James E.J. Bottomley" <[email protected]>
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
M: "Martin K. Petersen" <[email protected]>
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git

drivers/message/fusion/mptbase.c

View file
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 5dcc031..5537f8d 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1801,8 +1801,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
ioc->pcidev = pdev;
if (mpt_mapresources(ioc)) {
- kfree(ioc);
- return r;
+ goto out_free_ioc;
}
/*
@@ -1871,9 +1870,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
if (!ioc->reset_work_q) {
printk(MYIOC_s_ERR_FMT "Insufficient memory to add adapter!\n",
ioc->name);
- pci_release_selected_regions(pdev, ioc->bars);
- kfree(ioc);
- return -ENOMEM;
+ r = -ENOMEM;
+ goto out_unmap_resources;
}
dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "facts @ %p, pfacts[0] @ %p\n",
@@ -1995,16 +1993,27 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
spin_lock_init(&ioc->fw_event_lock);
snprintf(ioc->fw_event_q_name, MPT_KOBJ_NAME_LEN, "mpt/%d", ioc->id);
ioc->fw_event_q = create_singlethread_workqueue(ioc->fw_event_q_name);
+ if (!ioc->fw_event_q) {
+ printk(MYIOC_s_ERR_FMT "Insufficient memory to add adapter!\n",
+ ioc->name);
+ r = -ENOMEM;
+ goto out_remove_ioc;
+ }
if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP,
CAN_SLEEP)) != 0){
printk(MYIOC_s_ERR_FMT "didn't initialize properly! (%d)\n",
ioc->name, r);
+ destroy_workqueue(ioc->fw_event_q);
+ ioc->fw_event_q = NULL;
+
list_del(&ioc->list);
if (ioc->alt_ioc)
ioc->alt_ioc->alt_ioc = NULL;
iounmap(ioc->memmap);
+ if (pci_is_enabled(pdev))
+ pci_disable_device(pdev);
if (r != -5)
pci_release_selected_regions(pdev, ioc->bars);
@@ -2012,7 +2021,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
ioc->reset_work_q = NULL;
kfree(ioc);
- pci_set_drvdata(pdev, NULL);
return r;
}
@@ -2040,6 +2048,24 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
msecs_to_jiffies(MPT_POLLING_INTERVAL));
return 0;
+
+out_remove_ioc:
+ list_del(&ioc->list);
+ if (ioc->alt_ioc)
+ ioc->alt_ioc->alt_ioc = NULL;
+
+ destroy_workqueue(ioc->reset_work_q);
+ ioc->reset_work_q = NULL;
+
+out_unmap_resources:
+ iounmap(ioc->memmap);
+ pci_disable_device(pdev);
+ pci_release_selected_regions(pdev, ioc->bars);
+
+out_free_ioc:
+ kfree(ioc);
+
+ return r;
}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -6229,7 +6255,7 @@ mpt_get_manufacturing_pg_0(MPT_ADAPTER *ioc)
memcpy(ioc->board_assembly, pbuf->BoardAssembly, sizeof(ioc->board_assembly));
memcpy(ioc->board_tracer, pbuf->BoardTracerNumber, sizeof(ioc->board_tracer));
- out:
+out:
if (pbuf)
pci_free_consistent(ioc->pcidev, hdr.PageLength * 4, pbuf, buf_dma);
@@ -6848,6 +6874,7 @@ mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buffer, int *size, int len, int sh
*size = y;
}
+#ifdef CONFIG_PROC_FS
static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, struct seq_file *m, int showlan)
{
char expVer[32];
@@ -6879,6 +6906,7 @@ static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, struct seq_file *m, int
seq_putc(m, '\n');
}
+#endif
/**
* mpt_set_taskmgmt_in_progress_flag - set flags associated with task management

drivers/scsi/Kconfig

View file
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index e2f31c9..e80768f 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -596,6 +596,7 @@ config XEN_SCSI_FRONTEND
config HYPERV_STORAGE
tristate "Microsoft Hyper-V virtual storage driver"
depends on SCSI && HYPERV
+ depends on m || SCSI_FC_ATTRS != m
default HYPERV
help
Select this option to enable the Hyper-V virtual storage driver.

drivers/scsi/NCR5380.c

View file
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index d728672..3eff2a6 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -760,7 +760,7 @@ static struct scsi_cmnd *dequeue_next_cmd(struct Scsi_Host *instance)
struct NCR5380_cmd *ncmd;
struct scsi_cmnd *cmd;
- if (list_empty(&hostdata->autosense)) {
+ if (hostdata->sensing || list_empty(&hostdata->autosense)) {
list_for_each_entry(ncmd, &hostdata->unissued, list) {
cmd = NCR5380_to_scmd(ncmd);
dsprintk(NDEBUG_QUEUES, instance, "dequeue: cmd=%p target=%d busy=0x%02x lun=%llu\n",
@@ -793,7 +793,7 @@ static void requeue_cmd(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
struct NCR5380_hostdata *hostdata = shost_priv(instance);
struct NCR5380_cmd *ncmd = scsi_cmd_priv(cmd);
- if (hostdata->sensing) {
+ if (hostdata->sensing == cmd) {
scsi_eh_restore_cmnd(cmd, &hostdata->ses);
list_add(&ncmd->list, &hostdata->autosense);
hostdata->sensing = NULL;
@@ -815,15 +815,17 @@ static void NCR5380_main(struct work_struct *work)
struct NCR5380_hostdata *hostdata =
container_of(work, struct NCR5380_hostdata, main_task);
struct Scsi_Host *instance = hostdata->host;
- struct scsi_cmnd *cmd;
int done;
do {
done = 1;
spin_lock_irq(&hostdata->lock);
- while (!hostdata->connected &&
- (cmd = dequeue_next_cmd(instance))) {
+ while (!hostdata->connected && !hostdata->selecting) {
+ struct scsi_cmnd *cmd = dequeue_next_cmd(instance);
+
+ if (!cmd)
+ break;
dsprintk(NDEBUG_MAIN, instance, "main: dequeued %p\n", cmd);
@@ -840,8 +842,7 @@ static void NCR5380_main(struct work_struct *work)
* entire unit.
*/
- cmd = NCR5380_select(instance, cmd);
- if (!cmd) {
+ if (!NCR5380_select(instance, cmd)) {
dsprintk(NDEBUG_MAIN, instance, "main: select complete\n");
} else {
dsprintk(NDEBUG_MAIN | NDEBUG_QUEUES, instance,
@@ -1056,6 +1057,11 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance,
/* Reselection interrupt */
goto out;
}
+ if (!hostdata->selecting) {
+ /* Command was aborted */
+ NCR5380_write(MODE_REG, MR_BASE);
+ goto out;
+ }
if (err < 0) {
NCR5380_write(MODE_REG, MR_BASE);
shost_printk(KERN_ERR, instance,
@@ -1759,9 +1765,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
unsigned char msgout = NOP;
int sink = 0;
int len;
-#if defined(PSEUDO_DMA) || defined(REAL_DMA_POLL)
int transfersize;
-#endif
unsigned char *data;
unsigned char phase, tmp, extended_msg[10], old_phase = 0xff;
struct scsi_cmnd *cmd;
@@ -1798,6 +1802,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
do_abort(instance);
cmd->result = DID_ERROR << 16;
complete_cmd(instance, cmd);
+ hostdata->connected = NULL;
return;
#endif
case PHASE_DATAIN:
@@ -1847,20 +1852,23 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
sink = 1;
do_abort(instance);
cmd->result = DID_ERROR << 16;
- complete_cmd(instance, cmd);
/* XXX - need to source or sink data here, as appropriate */
} else
cmd->SCp.this_residual -= transfersize - len;
} else
#endif /* defined(PSEUDO_DMA) || defined(REAL_DMA_POLL) */
{
- spin_unlock_irq(&hostdata->lock);
- NCR5380_transfer_pio(instance, &phase,
- (int *)&cmd->SCp.this_residual,
+ /* Break up transfer into 3 ms chunks,
+ * presuming 6 accesses per handshake.
+ */
+ transfersize = min((unsigned long)cmd->SCp.this_residual,
+ hostdata->accesses_per_ms / 2);
+ len = transfersize;
+ NCR5380_transfer_pio(instance, &phase, &len,
(unsigned char **)&cmd->SCp.ptr);
- spin_lock_irq(&hostdata->lock);
+ cmd->SCp.this_residual -= transfersize - len;
}
- break;
+ return;
case PHASE_MSGIN:
len = 1;
data = &tmp;
@@ -2292,14 +2300,17 @@ static bool list_del_cmd(struct list_head *haystack,
* [disconnected -> connected ->]...
* [autosense -> connected ->] done
*
- * If cmd is unissued then just remove it.
- * If cmd is disconnected, try to select the target.
- * If cmd is connected, try to send an abort message.
- * If cmd is waiting for autosense, give it a chance to complete but check
- * that it isn't left connected.
* If cmd was not found at all then presumably it has already been completed,
* in which case return SUCCESS to try to avoid further EH measures.
+ *
* If the command has not completed yet, we must not fail to find it.
+ * We have no option but to forget the aborted command (even if it still
+ * lacks sense data). The mid-layer may re-issue a command that is in error
+ * recovery (see scsi_send_eh_cmnd), but the logic and data structures in
+ * this driver are such that a command can appear on one queue only.
+ *
+ * The lock protects driver data structures, but EH handlers also use it
+ * to serialize their own execution and prevent their own re-entry.
*/
static int NCR5380_abort(struct scsi_cmnd *cmd)
@@ -2322,6 +2333,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd)
"abort: removed %p from issue queue\n", cmd);
cmd->result = DID_ABORT << 16;
cmd->scsi_done(cmd); /* No tag or busy flag to worry about */
+ goto out;
}
if (hostdata->selecting == cmd) {
@@ -2336,58 +2348,21 @@ static int NCR5380_abort(struct scsi_cmnd *cmd)
if (list_del_cmd(&hostdata->disconnected, cmd)) {
dsprintk(NDEBUG_ABORT, instance,
"abort: removed %p from disconnected list\n", cmd);
- cmd->result = DID_ERROR << 16;
- if (!hostdata->connected)
- NCR5380_select(instance, cmd);
- if (hostdata->connected != cmd) {
- complete_cmd(instance, cmd);
- result = FAILED;
- goto out;
- }
+ /* Can't call NCR5380_select() and send ABORT because that
+ * means releasing the lock. Need a bus reset.
+ */
+ set_host_byte(cmd, DID_ERROR);
+ complete_cmd(instance, cmd);
+ result = FAILED;
+ goto out;
}
if (hostdata->connected == cmd) {
dsprintk(NDEBUG_ABORT, instance, "abort: cmd %p is connected\n", cmd);
hostdata->connected = NULL;
- if (do_abort(instance)) {
- set_host_byte(cmd, DID_ERROR);
- complete_cmd(instance, cmd);
- result = FAILED;
- goto out;
- }
- set_host_byte(cmd, DID_ABORT);
#ifdef REAL_DMA
hostdata->dma_len = 0;
#endif
- if (cmd->cmnd[0] == REQUEST_SENSE)
- complete_cmd(instance, cmd);
- else {
- struct NCR5380_cmd *ncmd = scsi_cmd_priv(cmd);
-
- /* Perform autosense for this command */
- list_add(&ncmd->list, &hostdata->autosense);
- }
- }
-
- if (list_find_cmd(&hostdata->autosense, cmd)) {
- dsprintk(NDEBUG_ABORT, instance,
- "abort: found %p on sense queue\n", cmd);
- spin_unlock_irqrestore(&hostdata->lock, flags);
- queue_work(hostdata->work_q, &hostdata->main_task);
- msleep(1000);
- spin_lock_irqsave(&hostdata->lock, flags);
- if (list_del_cmd(&hostdata->autosense, cmd)) {
- dsprintk(NDEBUG_ABORT, instance,
- "abort: removed %p from sense queue\n", cmd);
- set_host_byte(cmd, DID_ABORT);
- complete_cmd(instance, cmd);
- goto out;
- }
- }
-
- if (hostdata->connected == cmd) {
- dsprintk(NDEBUG_ABORT, instance, "abort: cmd %p is connected\n", cmd);
- hostdata->connected = NULL;
if (do_abort(instance)) {
set_host_byte(cmd, DID_ERROR);
complete_cmd(instance, cmd);
@@ -2395,9 +2370,14 @@ static int NCR5380_abort(struct scsi_cmnd *cmd)
goto out;
}
set_host_byte(cmd, DID_ABORT);
-#ifdef REAL_DMA
- hostdata->dma_len = 0;
-#endif
+ complete_cmd(instance, cmd);
+ goto out;
+ }
+
+ if (list_del_cmd(&hostdata->autosense, cmd)) {
+ dsprintk(NDEBUG_ABORT, instance,
+ "abort: removed %p from sense queue\n", cmd);
+ set_host_byte(cmd, DID_ERROR);
complete_cmd(instance, cmd);
}
@@ -2450,7 +2430,16 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd)
* commands!
*/
- hostdata->selecting = NULL;
+ if (list_del_cmd(&hostdata->unissued, cmd)) {
+ cmd->result = DID_RESET << 16;
+ cmd->scsi_done(cmd);
+ }
+
+ if (hostdata->selecting) {
+ hostdata->selecting->result = DID_RESET << 16;
+ complete_cmd(instance, hostdata->selecting);
+ hostdata->selecting = NULL;
+ }
list_for_each_entry(ncmd, &hostdata->disconnected, list) {
struct scsi_cmnd *cmd = NCR5380_to_scmd(ncmd);
@@ -2458,6 +2447,7 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd)
set_host_byte(cmd, DID_RESET);
cmd->scsi_done(cmd);
}
+ INIT_LIST_HEAD(&hostdata->disconnected);
list_for_each_entry(ncmd, &hostdata->autosense, list) {
struct scsi_cmnd *cmd = NCR5380_to_scmd(ncmd);
@@ -2465,6 +2455,7 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd)
set_host_byte(cmd, DID_RESET);
cmd->scsi_done(cmd);
}
+ INIT_LIST_HEAD(&hostdata->autosense);
if (hostdata->connected) {
set_host_byte(hostdata->connected, DID_RESET);
@@ -2472,12 +2463,6 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd)
hostdata->connected = NULL;
}
- if (hostdata->sensing) {
- set_host_byte(hostdata->connected, DID_RESET);
- complete_cmd(instance, hostdata->sensing);
- hostdata->sensing = NULL;
- }
-
for (i = 0; i < 8; ++i)
hostdata->busy[i] = 0;
#ifdef REAL_DMA

drivers/scsi/aacraid/aachba.c

View file
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index e4c2437..7dfd0fa 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -323,7 +323,6 @@ static inline int aac_valid_context(struct scsi_cmnd *scsicmd,
if (unlikely(!scsicmd || !scsicmd->scsi_done)) {
dprintk((KERN_WARNING "aac_valid_context: scsi command corrupt\n"));
aac_fib_complete(fibptr);
- aac_fib_free(fibptr);
return 0;
}
scsicmd->SCp.phase = AAC_OWNER_MIDLEVEL;
@@ -331,7 +330,6 @@ static inline int aac_valid_context(struct scsi_cmnd *scsicmd,
if (unlikely(!device || !scsi_device_online(device))) {
dprintk((KERN_WARNING "aac_valid_context: scsi device corrupt\n"));
aac_fib_complete(fibptr);
- aac_fib_free(fibptr);
return 0;
}
return 1;
@@ -541,7 +539,6 @@ static void get_container_name_callback(void *context, struct fib * fibptr)
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
aac_fib_complete(fibptr);
- aac_fib_free(fibptr);
scsicmd->scsi_done(scsicmd);
}
@@ -557,7 +554,8 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd)
dev = (struct aac_dev *)scsicmd->device->host->hostdata;
- if (!(cmd_fibcontext = aac_fib_alloc(dev)))
+ cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
+ if (!cmd_fibcontext)
return -ENOMEM;
aac_fib_init(cmd_fibcontext);
@@ -586,7 +584,6 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd)
printk(KERN_WARNING "aac_get_container_name: aac_fib_send failed with status: %d.\n", status);
aac_fib_complete(cmd_fibcontext);
- aac_fib_free(cmd_fibcontext);
return -1;
}
@@ -1024,7 +1021,6 @@ static void get_container_serial_callback(void *context, struct fib * fibptr)
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
aac_fib_complete(fibptr);
- aac_fib_free(fibptr);
scsicmd->scsi_done(scsicmd);
}
@@ -1040,7 +1036,8 @@ static int aac_get_container_serial(struct scsi_cmnd * scsicmd)
dev = (struct aac_dev *)scsicmd->device->host->hostdata;
- if (!(cmd_fibcontext = aac_fib_alloc(dev)))
+ cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
+ if (!cmd_fibcontext)
return -ENOMEM;
aac_fib_init(cmd_fibcontext);
@@ -1068,7 +1065,6 @@ static int aac_get_container_serial(struct scsi_cmnd * scsicmd)
printk(KERN_WARNING "aac_get_container_serial: aac_fib_send failed with status: %d.\n", status);
aac_fib_complete(cmd_fibcontext);
- aac_fib_free(cmd_fibcontext);
return -1;
}
@@ -1869,7 +1865,6 @@ static void io_callback(void *context, struct fib * fibptr)
break;
}
aac_fib_complete(fibptr);
- aac_fib_free(fibptr);

This diff is incomplete. Download the complete patch.

drivers/scsi/aacraid/aacraid.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/aacraid/commctrl.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/aacraid/comminit.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/aacraid/commsup.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/aacraid/dpcsup.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/aacraid/linit.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/aacraid/src.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/aha1542.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/aic7xxx/aic7xxx_osm.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/arm/acornscsi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/arm/fas216.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/atari_NCR5380.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/be2iscsi/be.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/be2iscsi/be_cmds.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/be2iscsi/be_cmds.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/be2iscsi/be_iscsi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/be2iscsi/be_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/be2iscsi/be_main.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/be2iscsi/be_mgmt.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/be2iscsi/be_mgmt.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/bfa/bfa_core.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/bfa/bfa_cs.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/bfa/bfa_ioc.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/bnx2fc/bnx2fc_fcoe.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/cxlflash/common.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/cxlflash/main.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/cxlflash/superpipe.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/cxlflash/superpipe.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/device_handler/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/device_handler/scsi_dh_alua.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/device_handler/scsi_dh_emc.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/dpt_i2o.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/fcoe/fcoe_ctlr.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/fdomain.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/gdth.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/gdth_proc.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/hisi_sas/Makefile

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_v1_hw.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/hisi_sas/hisi_sas_v2_hw.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/hosts.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/hpsa.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/hpsa.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/hpsa_cmd.h

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/ibmvscsi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/ibmvscsi/viosrp.h

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/lpfc/lpfc_debugfs.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_scsi.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/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_fp.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/megaraid/megaraid_sas_fusion.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/mpt3sas/mpi/mpi2.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/mpt3sas/mpi/mpi2_init.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/mpt3sas/mpi/mpi2_ioc.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/mpt3sas/mpi/mpi2_raid.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/mpt3sas/mpi/mpi2_sas.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/mpt3sas/mpi/mpi2_tool.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/mpt3sas/mpi/mpi2_type.h

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/mpt3sas/mpt3sas_base.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/mpt3sas/mpt3sas_ctl.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/mpt3sas/mpt3sas_scsih.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/mpt3sas/mpt3sas_transport.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/mvumi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/osd/osd_initiator.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/ppa.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla2xxx/qla_attr.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla2xxx/qla_bsg.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla2xxx/qla_bsg.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla2xxx/qla_dbg.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla2xxx/qla_def.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla2xxx/qla_fw.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla2xxx/qla_gbl.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla2xxx/qla_init.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla2xxx/qla_inline.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla2xxx/qla_isr.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla2xxx/qla_mbx.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/qla_sup.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla2xxx/qla_version.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qla4xxx/ql4_83xx.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/qlogicpti.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/scsi_devinfo.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_scan.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/scsi_sysfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/scsi_transport_iscsi.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/sg.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/sim710.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/snic/snic_ctl.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/st.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/stex.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/storvsc_drv.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/ufs/ufs.h

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/ufs/ufshcd.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/ufs/ufshcd.h

View file

This diff is incomplete. Download the complete patch.

include/scsi/iscsi_if.h

View file

This diff is incomplete. Download the complete patch.

include/scsi/scsi_device.h

View file

This diff is incomplete. Download the complete patch.

include/scsi/scsi_devinfo.h

View file

This diff is incomplete. Download the complete patch.

include/scsi/scsi_dh.h

View file

This diff is incomplete. Download the complete patch.

include/scsi/scsi_proto.h

View file

This diff is incomplete. Download the complete patch.