]> Git Repo - linux.git/log
linux.git
3 years agoscsi: mpi3mr: Add support for PCIe device event handling
Kashyap Desai [Thu, 20 May 2021 15:25:28 +0000 (20:55 +0530)]
scsi: mpi3mr: Add support for PCIe device event handling

Implement support for the following PCIe-related MPI events:

 - MPI3_EVENT_PCIE_TOPOLOGY_CHANGE_LIST
 - MPI3_EVENT_PCIE_ENUMERATION

Link: https://lore.kernel.org/r/[email protected]
Cc: [email protected]
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Himanshu Madhani <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: mpi3mr: Add support for device add/remove event handling
Kashyap Desai [Thu, 20 May 2021 15:25:27 +0000 (20:55 +0530)]
scsi: mpi3mr: Add support for device add/remove event handling

Firmware can report various MPI Events. Enable support for processing the
following events related to device addition/removal to the driver:

 - MPI3_EVENT_DEVICE_ADDED
 - MPI3_EVENT_DEVICE_INFO_CHANGED
 - MPI3_EVENT_DEVICE_STATUS_CHANGE
 - MPI3_EVENT_ENCL_DEVICE_STATUS_CHANGE
 - MPI3_EVENT_SAS_TOPOLOGY_CHANGE_LIST
 - MPI3_EVENT_SAS_DISCOVERY
 - MPI3_EVENT_SAS_DEVICE_DISCOVERY_ERROR

Link: https://lore.kernel.org/r/[email protected]
Cc: [email protected]
Reported-by: kernel test robot <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Himanshu Madhani <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: mpi3mr: Add support for internal watchdog thread
Kashyap Desai [Thu, 20 May 2021 15:25:26 +0000 (20:55 +0530)]
scsi: mpi3mr: Add support for internal watchdog thread

The watchdog thread is the driver's internal thread which does a few things
such as detecting firmware faults, resetting the controller, performing
timestamp sync, etc.

Link: https://lore.kernel.org/r/[email protected]
Cc: [email protected]
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Himanshu Madhani <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: mpi3mr: Add support for queue command processing
Kashyap Desai [Thu, 20 May 2021 15:25:25 +0000 (20:55 +0530)]
scsi: mpi3mr: Add support for queue command processing

Send Port Enable Request to FW for Device Discovery.  As part of port
enable completion driver calls scan_start and scan_finished hooks.  SCSI
layer references like sdev, starget, etc. are added but actual device
discovery will be supported once driver adds complete event process
handling.

Link: https://lore.kernel.org/r/[email protected]
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Himanshu Madhani <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: mpi3mr: Create operational request and reply queue pair
Kashyap Desai [Thu, 20 May 2021 15:25:24 +0000 (20:55 +0530)]
scsi: mpi3mr: Create operational request and reply queue pair

Create operational request and reply queue pair.

The MPI3 transport interface consists of an Administrative Request Queue,
an Administrative Reply Queue, and Operational Messaging Queues.  The
Operational Messaging Queues are the primary communication mechanism
between the host and the I/O Controller (IOC).  Request messages, allocated
in host memory, identify I/O operations to be performed by the IOC. These
operations are queued on an Operational Request Queue by the host driver.
Reply descriptors track I/O operations as they complete.  The IOC queues
these completions in an Operational Reply Queue.

To fulfil large contiguous memory requirement, driver creates multiple
segments and provide the list of segments. Each segment size should be 4K
which is a hardware requirement. An element array is contiguous or
segmented.  A contiguous element array is located in contiguous physical
memory.  A contiguous element array must be aligned on an element size
boundary.  An element's physical address within the array may be directly
calculated from the base address, the Producer/Consumer index, and the
element size.

Expected phased identifier bit is used to find out valid entry on reply
queue. Driver sets <ephase> bit and IOC inverts the value of this bit on
each pass.

Link: https://lore.kernel.org/r/[email protected]
Cc: [email protected]
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Himanshu Madhani <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: mpi3mr: Base driver code
Kashyap Desai [Thu, 20 May 2021 15:25:23 +0000 (20:55 +0530)]
scsi: mpi3mr: Base driver code

Implement basic pci device driver requirements: Device probing, memory
allocation, mapping system registers, allocate irq lines, etc.

Source is managed in mainly three different files:

 - mpi3mr_fw.c:  Common code which interacts with underlying fw/hw.

 - mpi3mr_os.c:  Common code which interacts with SCSI midlayer.

 - mpi3mr_app.c: Common code which interacts with application/ioctl.
 This is currently work in progress.

Link: https://lore.kernel.org/r/[email protected]
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Himanshu Madhani <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: mpi3mr: Add mpi30 Rev-R headers and Kconfig
Kashyap Desai [Thu, 20 May 2021 15:25:22 +0000 (20:55 +0530)]
scsi: mpi3mr: Add mpi30 Rev-R headers and Kconfig

This adds the Kconfig and mpi30 headers.

Link: https://lore.kernel.org/r/[email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Himanshu Madhani <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: ufs: Fix a kernel-doc related formatting issue
Bean Huo [Mon, 31 May 2021 16:31:22 +0000 (18:31 +0200)]
scsi: ufs: Fix a kernel-doc related formatting issue

Fix the following W=1 kernel build warning:

drivers/scsi/ufs/ufshcd.c:9773: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

[mkp: upcase abbreviations]

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Alim Akhtar <[email protected]>
Signed-off-by: Bean Huo <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: isci: Use correctly sized target buffer for memcpy()
Kees Cook [Fri, 28 May 2021 18:13:37 +0000 (11:13 -0700)]
scsi: isci: Use correctly sized target buffer for memcpy()

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), avoid intentionally writing across
neighboring array fields.

Switch from rsp_ui to resp_buf, since resp_ui isn't SSP_RESP_IU_MAX_SIZE
bytes in length. This avoids future compile-time warnings.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: esas2r: Switch to flexible array member
Kees Cook [Fri, 28 May 2021 18:13:36 +0000 (11:13 -0700)]
scsi: esas2r: Switch to flexible array member

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), avoid intentionally writing across
neighboring array fields.

Remove old-style 1-byte array in favor of a flexible array[1] to avoid
future false-positive cross-field memcpy() warning in:

esas2r_vda.c:
memcpy(vi->cmd.gsv.version_info, esas2r_vdaioctl_versions, ...)

The change in struct size doesn't change other structure sizes (it is
already maxed out to 256 bytes, for example here:

        union {
                struct atto_ioctl_vda_scsi_cmd scsi;
                struct atto_ioctl_vda_flash_cmd flash;
                struct atto_ioctl_vda_diag_cmd diag;
                struct atto_ioctl_vda_cli_cmd cli;
                struct atto_ioctl_vda_smp_cmd smp;
                struct atto_ioctl_vda_cfg_cmd cfg;
                struct atto_ioctl_vda_mgt_cmd mgt;
                struct atto_ioctl_vda_gsv_cmd gsv;
                u8 cmd_info[256];
        } cmd;

No sizes are calculated using the enclosing structure, so no other
updates are needed.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: FlashPoint: Rename si_flags field
Randy Dunlap [Sat, 29 May 2021 23:48:57 +0000 (16:48 -0700)]
scsi: FlashPoint: Rename si_flags field

The BusLogic driver has build errors on ia64 due to a name collision (in
the #included FlashPoint.c file). Rename the struct field in struct
sccb_mgr_info from si_flags to si_mflags (manager flags) to mend the build.

This is the first problem. There are 50+ others after this one:

In file included from ../include/uapi/linux/signal.h:6,
                 from ../include/linux/signal_types.h:10,
                 from ../include/linux/sched.h:29,
                 from ../include/linux/hardirq.h:9,
                 from ../include/linux/interrupt.h:11,
                 from ../drivers/scsi/BusLogic.c:27:
../arch/ia64/include/uapi/asm/siginfo.h:15:27: error: expected ':', ',', ';', '}' or '__attribute__' before '.' token
   15 | #define si_flags _sifields._sigfault._flags
      |                           ^
../drivers/scsi/FlashPoint.c:43:6: note: in expansion of macro 'si_flags'
   43 |  u16 si_flags;
      |      ^~~~~~~~
In file included from ../drivers/scsi/BusLogic.c:51:
../drivers/scsi/FlashPoint.c: In function 'FlashPoint_ProbeHostAdapter':
../drivers/scsi/FlashPoint.c:1076:11: error: 'struct sccb_mgr_info' has no member named '_sifields'
 1076 |  pCardInfo->si_flags = 0x0000;
      |           ^~
../drivers/scsi/FlashPoint.c:1079:12: error: 'struct sccb_mgr_info' has no member named '_sifields'

Link: https://lore.kernel.org/r/[email protected]
Fixes: 391e2f25601e ("[SCSI] BusLogic: Port driver to 64-bit.")
Cc: "James E.J. Bottomley" <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Cc: Khalid Aziz <[email protected]>
Cc: Khalid Aziz <[email protected]>
Reported-by: kernel test robot <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Randy Dunlap <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: mpt3sas: Fix fall-through warnings for Clang
Gustavo A. R. Silva [Fri, 28 May 2021 20:08:28 +0000 (15:08 -0500)]
scsi: mpt3sas: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple
of warnings by explicitly adding break statements instead of just letting
the code fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Link: https://lore.kernel.org/r/20210528200828.GA39349@embeddedor
Reviewed-by: Kees Cook <[email protected]>
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: qla2xxx: Log PCI address in qla_nvme_unregister_remote_port()
Daniel Wagner [Mon, 31 May 2021 12:24:44 +0000 (14:24 +0200)]
scsi: qla2xxx: Log PCI address in qla_nvme_unregister_remote_port()

Pass in fcport->vha to ql_log() in order to add the PCI address to the log.

Currently NULL is passed in which gives this confusing log entry:

> qla2xxx [0000:00:00.0]-2112: : qla_nvme_unregister_remote_port: unregister remoteport on 0000000009d6a2e9 50000973981648c7

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Himanshu Madhani <[email protected]>
Signed-off-by: Daniel Wagner <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: ufs: ufs-mediatek: Disable HCI before HW reset
Alice.Chao [Fri, 28 May 2021 03:36:22 +0000 (11:36 +0800)]
scsi: ufs: ufs-mediatek: Disable HCI before HW reset

MediaTek ufshci needs to be disabled before HW reset to avoid potential
issues.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Stanley Chu <[email protected]>
Signed-off-by: Alice.Chao <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: ufs: core: Export ufshcd_hba_stop()
Alice.Chao [Fri, 28 May 2021 03:36:21 +0000 (11:36 +0800)]
scsi: ufs: core: Export ufshcd_hba_stop()

Export ufshcd_hba_stop() to allow vendors to disable HCI in variant ops.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Stanley Chu <[email protected]>
Signed-off-by: Alice.Chao <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Drop obsolete Linux-specific SCSI status codes
Hannes Reinecke [Tue, 27 Apr 2021 08:30:46 +0000 (10:30 +0200)]
scsi: core: Drop obsolete Linux-specific SCSI status codes

Originally the SCSI subsystem has been using 'special' SCSI status codes,
which were the SAM-specified ones but shifted by 1.  As most drivers have
now been modified to use the SAM-specified ones, having two nearly
identical sets of definitions only causes confusion.

The Linux-specifed SCSI status codes have been marked obsolete for several
years so drop them and use the SAM-specified status codes throughout.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Douglas Gilbert <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: pcmcia: nsp_cs: Use SAM_STAT_CHECK_CONDITION
Hannes Reinecke [Thu, 27 May 2021 07:22:17 +0000 (09:22 +0200)]
scsi: pcmcia: nsp_cs: Use SAM_STAT_CHECK_CONDITION

The nsp_cs driver stores the SAM status values in SCp.Status, so we need to
use the non-shifted version SAM_STAT_CHECK_CONDITION.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: target: Use standard SAM status types
Hannes Reinecke [Tue, 27 Apr 2021 08:30:45 +0000 (10:30 +0200)]
scsi: target: Use standard SAM status types

target_complete_cmd() and friends requires a SAM status type, so passing
GOOD here is actually wrong.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Kill message byte
Hannes Reinecke [Tue, 27 Apr 2021 08:30:44 +0000 (10:30 +0200)]
scsi: core: Kill message byte

Remove last vestiges of SCSI status message bytes.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Drop message byte helper
Hannes Reinecke [Tue, 27 Apr 2021 08:30:43 +0000 (10:30 +0200)]
scsi: core: Drop message byte helper

The message byte is now unused, so we can drop the helper to set the
message byte and the check for message bytes during error recovery.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: fdomain: Translate message to host byte status
Hannes Reinecke [Tue, 27 Apr 2021 08:30:42 +0000 (10:30 +0200)]
scsi: fdomain: Translate message to host byte status

Instead of setting the message byte translate it to the appropriate host
byte. As error recovery would return DID_ERROR for any non-zero message
byte the translation doesn't change the error handling.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: fdomain: Drop last argument to fdomain_finish_cmd()
Hannes Reinecke [Tue, 27 Apr 2021 08:30:41 +0000 (10:30 +0200)]
scsi: fdomain: Drop last argument to fdomain_finish_cmd()

Set the SCSI host status before calling fdomain_finish_cmd() and drop the
last argument to that function.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: FlashPoint: Use standard SCSI definitions
Hannes Reinecke [Tue, 27 Apr 2021 08:30:40 +0000 (10:30 +0200)]
scsi: FlashPoint: Use standard SCSI definitions

No point in having the driver providing its own definitions.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: fas216: Use get_status_byte() to avoid using Linux-specific status codes
Hannes Reinecke [Tue, 27 Apr 2021 08:30:39 +0000 (10:30 +0200)]
scsi: fas216: Use get_status_byte() to avoid using Linux-specific status codes

The driver should be using the standard SAM_STAT_ values, and not the
Linux-specific ones.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: fas216: Translate message to host byte status
Hannes Reinecke [Tue, 27 Apr 2021 08:30:38 +0000 (10:30 +0200)]
scsi: fas216: Translate message to host byte status

Instead of setting the message byte translate it to the appropriate host
byte. As error recovery would return DID_ERROR for any non-zero message
byte the translation doesn't change the error handling.

[mkp: zeroday bug report: s/SCpnt->result/SCpnt/]

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: advansys: Do not set message byte in SCSI status
Hannes Reinecke [Tue, 27 Apr 2021 08:30:37 +0000 (10:30 +0200)]
scsi: advansys: Do not set message byte in SCSI status

The host byte in the SCSI status takes precedence during error recovery, so
there is no point in setting the message byte in addition to a host byte
which is not DID_OK.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: aha152x: Do not set message byte when calling scsi_done()
Hannes Reinecke [Tue, 27 Apr 2021 08:30:36 +0000 (10:30 +0200)]
scsi: aha152x: Do not set message byte when calling scsi_done()

The done() function is called with a host_byte indicating the actual error
when the message byte is set. As the host byte takes precedence during
error recovery we can drop setting the message byte if the host byte is
set, too.  The only other case is when the host byte is DID_OK, but in that
case the message byte is always COMMAND_COMPLETE (i.e. 0), so we can drop
it there, too.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: aha152x: Modify done() to use separate status bytes
Hannes Reinecke [Tue, 27 Apr 2021 08:30:35 +0000 (10:30 +0200)]
scsi: aha152x: Modify done() to use separate status bytes

Instead of passing in the combined SCSI result values, split them off into
separate status, message, and host byte values.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: acornscsi: Translate message byte to host byte
Hannes Reinecke [Tue, 27 Apr 2021 08:30:34 +0000 (10:30 +0200)]
scsi: acornscsi: Translate message byte to host byte

Instead of setting the message byte translate it to the appropriate host
byte. As error recovery would return DID_ERROR for any non-zero message
byte the translation doesn't change the error handling.  And use SCSI
result accessors while we're at it.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: acornscsi: Remove acornscsi_reportstatus()
Hannes Reinecke [Tue, 27 Apr 2021 08:30:33 +0000 (10:30 +0200)]
scsi: acornscsi: Remove acornscsi_reportstatus()

Unused.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: mesh: Translate message to host byte status
Hannes Reinecke [Tue, 27 Apr 2021 08:30:32 +0000 (10:30 +0200)]
scsi: mesh: Translate message to host byte status

Instead of setting the message byte translate it to a host byte status. As
the error recovery would map it to DID_ERROR anyway the translation doesn't
change the SCSI error handling.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: wd33c93: Translate message byte to host byte
Hannes Reinecke [Tue, 27 Apr 2021 08:30:31 +0000 (10:30 +0200)]
scsi: wd33c93: Translate message byte to host byte

Instead of setting the message byte translate it to the appropriate host
byte. As error recovery would return DID_ERROR for any non-zero message
byte the translation doesn't change the error handling.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: nsp32: Do not set message byte
Hannes Reinecke [Tue, 27 Apr 2021 08:30:30 +0000 (10:30 +0200)]
scsi: nsp32: Do not set message byte

The message byte always devolves to COMMAND_COMPLETE, so there is no point
in setting it.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: nsp32: Whitespace cleanup
Hannes Reinecke [Tue, 27 Apr 2021 08:30:29 +0000 (10:30 +0200)]
scsi: nsp32: Whitespace cleanup

[mkp: fix kernel test robot warning]

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: qlogicfas408: Whitespace cleanup
Hannes Reinecke [Tue, 27 Apr 2021 08:30:27 +0000 (10:30 +0200)]
scsi: qlogicfas408: Whitespace cleanup

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: qlogicfas408: make ql_pcmd() a void function
Hannes Reinecke [Tue, 27 Apr 2021 08:30:26 +0000 (10:30 +0200)]
scsi: qlogicfas408: make ql_pcmd() a void function

Make ql_pcmd() a void function and set the SCSI result directly.

[mkp: fix zeroday 'result' warning]

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
fix

3 years agoscsi: dc395: Translate message bytes
Hannes Reinecke [Tue, 27 Apr 2021 08:30:25 +0000 (10:30 +0200)]
scsi: dc395: Translate message bytes

Drop message byte setting if the host byte is already set, and translate
message bytes into the related host bytes when evaluating an overrun or
underrun.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: dc395: Use standard macros to set SCSI result
Hannes Reinecke [Tue, 27 Apr 2021 08:30:24 +0000 (10:30 +0200)]
scsi: dc395: Use standard macros to set SCSI result

Use standard macros to set the SCSI result and drop the internal ones.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Add scsi_msg_to_host_byte()
Hannes Reinecke [Tue, 27 Apr 2021 08:30:23 +0000 (10:30 +0200)]
scsi: core: Add scsi_msg_to_host_byte()

Add helper to convert message byte into a host byte code.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Add get_{status,host}_byte() accessor functions
Hannes Reinecke [Tue, 27 Apr 2021 08:30:22 +0000 (10:30 +0200)]
scsi: core: Add get_{status,host}_byte() accessor functions

Add accessor functions for the host and status byte.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: NCR5380: Fold SCSI message ABORT onto DID_ABORT
Hannes Reinecke [Tue, 27 Apr 2021 08:30:21 +0000 (10:30 +0200)]
scsi: NCR5380: Fold SCSI message ABORT onto DID_ABORT

The message byte can take only two values, COMMAND_COMPLETE and ABORT.  So
we can easily map ABORT to DID_ABORT and not set the message byte.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Drop the now obsolete driver_byte definitions
Hannes Reinecke [Tue, 27 Apr 2021 08:30:20 +0000 (10:30 +0200)]
scsi: core: Drop the now obsolete driver_byte definitions

The driver_byte field in the result is now unused, so we can drop the
definitions.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: xen-scsifront: Compability status handling
Hannes Reinecke [Tue, 27 Apr 2021 08:30:19 +0000 (10:30 +0200)]
scsi: xen-scsifront: Compability status handling

The Xen guest might run against arbitrary backends, so the driver might
receive a status with driver_byte set. Map these errors to DID_ERROR to be
consistent with recent changes.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: xen-scsiback: Use DID_ERROR instead of DRIVER_ERROR
Hannes Reinecke [Tue, 27 Apr 2021 08:30:18 +0000 (10:30 +0200)]
scsi: xen-scsiback: Use DID_ERROR instead of DRIVER_ERROR

DRIVER_ERROR was supposed to signal an error generated by the driver, which
xen-scsiback arguably isn't. Also the driver bytes don't have a detailed
error recovery, so we should rather return DID_ERROR instead of
DRIVER_ERROR.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Use DID_TIME_OUT instead of DRIVER_TIMEOUT
Hannes Reinecke [Tue, 27 Apr 2021 08:30:17 +0000 (10:30 +0200)]
scsi: core: Use DID_TIME_OUT instead of DRIVER_TIMEOUT

Set DID_TIME_OUT instead of DRIVER_TIMEOUT when a command
is finally marked as failed after error recovery.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Do not use DRIVER_INVALID
Hannes Reinecke [Tue, 27 Apr 2021 08:30:16 +0000 (10:30 +0200)]
scsi: core: Do not use DRIVER_INVALID

There is no point in returning DID_ABORT together with DRIVER_INVALID, as
the caller couldn't care less where the abort originated.  So drop the use
of DRIVER_INVALID.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Kill DRIVER_SENSE
Hannes Reinecke [Tue, 27 Apr 2021 08:30:15 +0000 (10:30 +0200)]
scsi: core: Kill DRIVER_SENSE

Replace the check for DRIVER_SENSE with a check for
scsi_status_is_check_condition().

Audit all callsites to ensure the SAM status is set correctly. For
backwards compability move the DRIVER_SENSE definition to sg.h, and update
sg, bsg, and scsi_ioctl to set the DRIVER_SENSE driver_status whenever
SAM_STAT_CHECK_CONDITION is present.

[mkp: fix zeroday srp warning]

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
fix

3 years agoscsi: core: Introduce scsi_status_is_check_condition()
Hannes Reinecke [Tue, 27 Apr 2021 08:30:14 +0000 (10:30 +0200)]
scsi: core: Introduce scsi_status_is_check_condition()

Add a helper function scsi_status_is_check_condition() to encapsulate the
frequent checks for SAM_STAT_CHECK_CONDITION.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Introduce scsi_build_sense()
Hannes Reinecke [Tue, 27 Apr 2021 08:30:13 +0000 (10:30 +0200)]
scsi: core: Introduce scsi_build_sense()

Introduce scsi_build_sense() as a wrapper around scsi_build_sense_buffer()
to format the buffer and set the correct SCSI status.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Stop using DRIVER_ERROR
Hannes Reinecke [Tue, 27 Apr 2021 08:30:12 +0000 (10:30 +0200)]
scsi: core: Stop using DRIVER_ERROR

Return the actual error code in __scsi_execute() (which, according to the
documentation, should have happened anyway).  And audit all callers to cope
with negative return values from __scsi_execute() and friends.

[mkp: resolve conflict and return bool]

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: scsi_dh_alua: Check for negative result value
Hannes Reinecke [Tue, 27 Apr 2021 08:30:11 +0000 (10:30 +0200)]
scsi: scsi_dh_alua: Check for negative result value

scsi_execute() will now return a negative error if there was an error prior
to command submission; evaluate that instead if checking for DRIVER_ERROR.

[mkp: build fix]

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Reshuffle response handling in scsi_mode_sense()
Hannes Reinecke [Tue, 27 Apr 2021 08:30:10 +0000 (10:30 +0200)]
scsi: core: Reshuffle response handling in scsi_mode_sense()

Reshuffle response handling in scsi_mode_sense() to make the code easier to
follow.

[mkp: fix build]

Link: https://lore.kernel.org/r/[email protected]
Suggested-by: Christoph Hellwig <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: ufs: Suppress false positive unhandled interrupt messages
Bart Van Assche [Wed, 19 May 2021 20:20:57 +0000 (13:20 -0700)]
scsi: ufs: Suppress false positive unhandled interrupt messages

From ufshcd_transfer_req_compl():

    Resetting interrupt aggregation counters first and reading the
    DOOR_BELL afterward allows us to handle all the completed requests.  In
    order to prevent other interrupts starvation the DB is read once after
    reset. The down side of this solution is the possibility of false
    interrupt if device completes another request after resetting
    aggregation and before reading the DB.

Prevent that ufshcd_intr() reports a false positive "Unhandled interrupt"
message if the above scenario is triggered.

Link: https://lore.kernel.org/r/[email protected]
Cc: Stanley Chu <[email protected]>
Cc: Can Guo <[email protected]>
Cc: Bean Huo <[email protected]>
Cc: Jaegeuk Kim <[email protected]>
Cc: Asutosh Das <[email protected]>
Suggested-by: Jaegeuk Kim <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Fixup calling convention for scsi_mode_sense()
Hannes Reinecke [Tue, 27 Apr 2021 08:30:09 +0000 (10:30 +0200)]
scsi: core: Fixup calling convention for scsi_mode_sense()

The description for scsi_mode_sense() claims to return the number of valid
bytes on success, which is not what the code does.  Additionally there is
no gain in returning the SCSI status, as everything the callers do is to
check against scsi_result_is_good(), which is what scsi_mode_sense() does
already.  So change the calling convention to return a standard error code
on failure, and 0 on success, and adapt the description and all callers.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: mpt3sas: Handle firmware faults during second half of IOC init
Suganath Prabu S [Tue, 18 May 2021 05:16:25 +0000 (10:46 +0530)]
scsi: mpt3sas: Handle firmware faults during second half of IOC init

If a firmware fault occurs while scanning the devices during IOC
initialization then the driver issues the hard reset operation to recover
the IOC. However, the driver is not issuing a Port enable request
message as part of hard reset operation during IOC initialization.  Due to
this, the driver will not receive get any device discovery-related events
and hence devices will not be accessible.

Teach the driver to gracefully handle firmware faults while scanning for
target devices during IOC initialization. Make the driver issue a port
enable request message as part of hard reset operation. This permits
receiving device discovery-related events from the firmware after the hard
reset operation completes.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Suganath Prabu S <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: scsi_ioctl: Return error code when blk_rq_map_kern() fails
Hannes Reinecke [Tue, 27 Apr 2021 08:30:08 +0000 (10:30 +0200)]
scsi: scsi_ioctl: Return error code when blk_rq_map_kern() fails

The callers of sg_scsi_ioctl() already check for negative return values, so
we can drop the usage of DRIVER_ERROR and return the error from
blk_rq_map_kern() instead.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: mpt3sas: Handle firmware faults during first half of IOC init
Suganath Prabu S [Tue, 18 May 2021 05:16:24 +0000 (10:46 +0530)]
scsi: mpt3sas: Handle firmware faults during first half of IOC init

During first half of IOC initialization (i.e.  before going for device
scanning), if any firmware fault occurs then driver is aborting the IOC
initialization operation.

Modify the driver to issue a diag reset operation to recover IOC from fault
state and reinitialize the IOC.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Suganath Prabu S <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: st: Return error code in st_scsi_execute()
Hannes Reinecke [Tue, 27 Apr 2021 08:30:07 +0000 (10:30 +0200)]
scsi: st: Return error code in st_scsi_execute()

The callers to st_scsi_execute() already check for negative return values,
so we can drop the use of DRIVER_ERROR and return the actual error code.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Acked-by: Kai Mäkisara <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: mpt3sas: Fix deadlock while cancelling the running firmware event
Suganath Prabu S [Tue, 18 May 2021 05:16:23 +0000 (10:46 +0530)]
scsi: mpt3sas: Fix deadlock while cancelling the running firmware event

Do not cancel current running firmware event work if the event type is
different from MPT3SAS_REMOVE_UNRESPONDING_DEVICES.  Otherwise a deadlock
can be observed while cancelling the current firmware event work if a hard
reset operation is called as part of processing the current event.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Suganath Prabu S <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Cap scsi_host cmd_per_lun at can_queue
John Garry [Wed, 19 May 2021 14:31:02 +0000 (22:31 +0800)]
scsi: core: Cap scsi_host cmd_per_lun at can_queue

The sysfs handling function sdev_store_queue_depth() enforces that the sdev
queue depth cannot exceed shost can_queue. The initial sdev queue depth
comes from shost cmd_per_lun. However, the LLDD may manually set
cmd_per_lun to be larger than can_queue, which leads to an initial sdev
queue depth greater than can_queue.

Such an issue was reported in [0], which caused a hang. That has since been
fixed in commit fc09acb7de31 ("scsi: scsi_debug: Fix cmd_per_lun, set to
max_queue").

Stop this possibly happening for other drivers by capping shost cmd_per_lun
at shost can_queue.

[0] https://lore.kernel.org/linux-scsi/YHaez6iN2HHYxYOh@T590/

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ming Lei <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: lpfc: Update lpfc version to 12.8.0.10
James Smart [Fri, 14 May 2021 19:55:59 +0000 (12:55 -0700)]
scsi: lpfc: Update lpfc version to 12.8.0.10

Update lpfc version to 12.8.0.10

Link: https://lore.kernel.org/r/[email protected]
Co-developed-by: Justin Tee <[email protected]>
Signed-off-by: Justin Tee <[email protected]>
Signed-off-by: James Smart <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: lpfc: Reregister FPIN types if ELS_RDF is received from fabric controller
James Smart [Fri, 14 May 2021 19:55:58 +0000 (12:55 -0700)]
scsi: lpfc: Reregister FPIN types if ELS_RDF is received from fabric controller

FC-LS-5 specifies that a received RDF implies a possible change to fabric
supported diagnostic functions. Endpoints are to re-perform the RDF
exchange with the fabric to enable possible new features or adapt to
changes in values.

This patch adds the logic to RDF receive to re-perform the RDF exchange
with the switch.

Link: https://lore.kernel.org/r/[email protected]
Co-developed-by: Justin Tee <[email protected]>
Signed-off-by: Justin Tee <[email protected]>
Signed-off-by: James Smart <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: lpfc: Add a option to enable interlocked ABTS before job completion
James Smart [Fri, 14 May 2021 19:55:57 +0000 (12:55 -0700)]
scsi: lpfc: Add a option to enable interlocked ABTS before job completion

Default behavior for the driver, when aborting an I/O, is to terminate the
I/O with the adapter. The adapter will initiate an ABTS to terminate the
exchange on the link and mark the exchange is terminated so that no further
use of the sgl or any traffic for the exchange is worked on. Completion on
the Abort is then posted to the driver, which as the I/O is terminated can
complete the I/O to the OS. This completion may occur prior to the ABTS
handshake completing on the wire. The ABTS handshake can take a long time
to complete with timeouts and retries reaching 60+ seconds. Note: if
retries fail, LOGO occurs.

Some devices want to ensure that the ABTS handshake fully completes (this
device has fully ack'd it) before the I/O completion is posted back to the
OS, where a failed I/O may be retried via a different path.

To support this behavior, an option was added to the driver to change I/O
completion from the Abort cmd completion to the Exchange termination (aka
ABTS) completion.

Link: https://lore.kernel.org/r/[email protected]
Co-developed-by: Justin Tee <[email protected]>
Signed-off-by: Justin Tee <[email protected]>
Signed-off-by: James Smart <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: lpfc: Fix crash when lpfc_sli4_hba_setup() fails to initialize the SGLs
James Smart [Fri, 14 May 2021 19:55:56 +0000 (12:55 -0700)]
scsi: lpfc: Fix crash when lpfc_sli4_hba_setup() fails to initialize the SGLs

The driver is encountering a crash in lpfc_free_iocb_list() while
performing initial attachment.

Code review found this to be an errant failure path that was taken, jumping
to a tag that then referenced structures that were uninitialized.

Fix the failure path.

Link: https://lore.kernel.org/r/[email protected]
Co-developed-by: Justin Tee <[email protected]>
Signed-off-by: Justin Tee <[email protected]>
Signed-off-by: James Smart <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: lpfc: Ignore GID-FT response that may be received after a link flip
James Smart [Fri, 14 May 2021 19:55:55 +0000 (12:55 -0700)]
scsi: lpfc: Ignore GID-FT response that may be received after a link flip

When a link bounce happens, there is a possibility that responses to
requests posted prior to the link bounce could be received. This is
problematic as the counter to track reglogin completion after link up can
become out of sync with the real state.

As there is no reason to process a request made in a prior link up context,
eliminate all the disturbance by tagging the request with the event_tag
maintained by the SLI Port for the link. The event_tag will change on every
link state transition.  As long as the tag matches the current event_tag,
the response can be processed. If it doesn't match, just discard the
response.

Link: https://lore.kernel.org/r/[email protected]
Co-developed-by: Justin Tee <[email protected]>
Signed-off-by: Justin Tee <[email protected]>
Signed-off-by: James Smart <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: lpfc: Fix node handling for Fabric Controller and Domain Controller
James Smart [Fri, 14 May 2021 19:55:54 +0000 (12:55 -0700)]
scsi: lpfc: Fix node handling for Fabric Controller and Domain Controller

During link bounce testing, RPI counts were seen to differ from the number
of nodes. For fabric and domain controllers, a temporary RPI is assigned,
but the code isn't registering it. If the nodes do go away, such as on link
down, the temporary RPI isn't being released.

Change the way these two fabric services are managed, make them behave like
any other remote port. Register the RPI and register with the transport.
Never leave the nodes in a NPR or UNUSED state where their RPI is in limbo.
This allows them to follow normal dev_loss_tmo handling, RPI refcounting,
and normal removal rules. It also allows fabric I/Os to use the RPI for
traffic requests.

Note: There is some logic that still has a couple of exceptions when the
Domain controller (0xfffcXX). There are cases where the fabric won't have a
valid login but will send RDP. Other times, it will it send a LOGO then an
RDP. It makes for ad-hoc behavior to manage the node. Exceptions are
documented in the code.

Link: https://lore.kernel.org/r/[email protected]
Co-developed-by: Justin Tee <[email protected]>
Signed-off-by: Justin Tee <[email protected]>
Signed-off-by: James Smart <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: lpfc: Fix Node recovery when driver is handling simultaneous PLOGIs
James Smart [Fri, 14 May 2021 19:55:53 +0000 (12:55 -0700)]
scsi: lpfc: Fix Node recovery when driver is handling simultaneous PLOGIs

When lpfc is handling a solicited and unsolicited PLOGI with another
initiator, the remote initiator is never recovered. The node for the
initiator is erroneouosly removed and all resources released.

In lpfc_cmpl_els_plogi(), when lpfc_els_retry() returns a failure code, the
driver is calling the state machine with a device remove event because the
remote port is not currently registered with the SCSI or NVMe
transports. The issue is that on a PLOGI "collision" the driver correctly
aborts the solicited PLOGI and allows the unsolicited PLOGI to complete the
process, but this process is interrupted with a device_rm event.

Introduce logic in the PLOGI completion to capture the PLOGI collision
event and jump out of the routine.  This will avoid removal of the node.
If there is no collision, the normal node removal will occur.

Fixes: 52edb2caf675 ("scsi: lpfc: Remove ndlp when a PLOGI/ADISC/PRLI/REG_RPI ultimately fails")
Cc: <[email protected]> # v5.11+
Link: https://lore.kernel.org/r/[email protected]
Co-developed-by: Justin Tee <[email protected]>
Signed-off-by: Justin Tee <[email protected]>
Signed-off-by: James Smart <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: lpfc: Add ndlp kref accounting for resume RPI path
James Smart [Fri, 14 May 2021 19:55:52 +0000 (12:55 -0700)]
scsi: lpfc: Add ndlp kref accounting for resume RPI path

The driver is crashing due to a bad pointer during driver load due in an
adisc acc receive routine. The driver is missing node get/put in the
mbx_resume_rpi paths.

Fix by adding the proper gets and puts into the resume_rpi path.

Link: https://lore.kernel.org/r/[email protected]
Co-developed-by: Justin Tee <[email protected]>
Signed-off-by: Justin Tee <[email protected]>
Signed-off-by: James Smart <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: lpfc: Fix "Unexpected timeout" error in direct attach topology
James Smart [Fri, 14 May 2021 19:55:51 +0000 (12:55 -0700)]
scsi: lpfc: Fix "Unexpected timeout" error in direct attach topology

An 'unexpected timeout' message may be seen in a point-2-point topology.
The message occurs when a PLOGI is received before the driver is notified
of FLOGI completion. The FLOGI completion failure causes discovery to be
triggered for a second time. The discovery timer is restarted but no new
discovery activity is initiated, thus the timeout message eventually
appears.

In point-2-point, when discovery has progressed before the FLOGI completion
is processed, it is not a failure. Add code to FLOGI completion to detect
that discovery has progressed and exit the FLOGI handling (noop'ing it).

Link: https://lore.kernel.org/r/[email protected]
Co-developed-by: Justin Tee <[email protected]>
Signed-off-by: Justin Tee <[email protected]>
Signed-off-by: James Smart <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: lpfc: Fix non-optimized ERSP handling
James Smart [Fri, 14 May 2021 19:55:50 +0000 (12:55 -0700)]
scsi: lpfc: Fix non-optimized ERSP handling

When processing an NVMe ERSP IU which didn't match the optimized CQE-only
path, the status was being left to the WQE status. WQE status is non-zero
as it is indicating a non-optimized completion that needs to be handled by
the driver.

Fix by clearing the status field when falling into the non-optimized
case. Log message added to track optimized vs non-optimized debug.

Link: https://lore.kernel.org/r/[email protected]
Co-developed-by: Justin Tee <[email protected]>
Signed-off-by: Justin Tee <[email protected]>
Signed-off-by: James Smart <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: lpfc: Fix unreleased RPIs when NPIV ports are created
James Smart [Fri, 14 May 2021 19:55:49 +0000 (12:55 -0700)]
scsi: lpfc: Fix unreleased RPIs when NPIV ports are created

While testing NPIV and watching logins and used RPI levels, it was seen the
used RPI count was much higher than the number of remote ports discovered.

Code inspection showed that remote port removals on any NPIV instance are
releasing the RPI, but not performing an UNREG_RPI with the adapter thus
the reference counting never fully drops and the RPI is never fully
released. This was happening on NPIV nodes due to a log of fabric ELS's to
fabric addresses. This lack of UNREG_RPI was introduced by a prior node
rework patch that performed the UNREG_RPI as part of node cleanup.

To resolve the issue, do the following:

 - Restore the RPI release code, but move the location to so that it is in
   line with the new node cleanup design.

 - NPIV ports now release the RPI and drop the node when the caller sets
   the NLP_RELEASE_RPI flag.

 - Set the NLP_RELEASE_RPI flag in node cleanup which will trigger a
   release of RPI to free pool.

 - Ensure there's an UNREG_RPI at LOGO completion so that RPI release is
   completed.

 - Stop offline_prep from skipping nodes that are UNUSED. The RPI may
   not have been released.

 - Stop the default RPI handling in lpfc_cmpl_els_rsp() for SLI4.

 - Fixed up debugfs RPI displays for better debugging.

Fixes: a70e63eee1c1 ("scsi: lpfc: Fix NPIV Fabric Node reference counting")
Link: https://lore.kernel.org/r/[email protected]
Cc: <[email protected]> # v5.11+
Co-developed-by: Justin Tee <[email protected]>
Signed-off-by: Justin Tee <[email protected]>
Signed-off-by: James Smart <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: scsi_dh_alua: Retry RTPG on a different path after failure
Martin Wilck [Fri, 14 May 2021 15:32:14 +0000 (17:32 +0200)]
scsi: scsi_dh_alua: Retry RTPG on a different path after failure

If an RTPG fails, we can't infer anything wrt. the state of the ports in
the port group except that we were unable to reach the one port on which
the RTPG had failed. "offline" is just a secondary port state, which means
that we can't infer the state of any port in the PG from the failure (in
fact, even the failed port might still be in "active/optimized" primary
port access state).

Therefore, when we encounter an RTPG failure, we should retry the RTPG on a
different port. This avoids falsely setting port states to offline for
unreachable ports. To do this, ports on which an RTPG has failed are
temporarily set to "disabled" to avoid repeating the failed I/O on the same
target port. Once the RTPG has either succeeded on one port or failed on
all ports of the PG, the ports are enabled again.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin Wilck <[email protected]>
Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: qla2xxx: Remove redundant assignment to rval
Jiapeng Chong [Mon, 10 May 2021 10:40:06 +0000 (18:40 +0800)]
scsi: qla2xxx: Remove redundant assignment to rval

Variable rval is set to QLA_SUCCESS but this value is never read as it is
overwritten later on. Hence it is a redundant assignment and can be
removed.

Clean up the following clang-analyzer warning:

drivers/scsi/qla2xxx/qla_init.c:4359:2: warning: Value stored to 'rval'
is never read [clang-analyzer-deadcode.DeadStores].

Link: https://lore.kernel.org/r/1620643206-127930-1-git-send-email-jiapeng.chong@linux.alibaba.com
Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Jiapeng Chong <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: ufs: ufs-exynos: Make a const array static, makes object smaller
Colin Ian King [Wed, 5 May 2021 19:01:04 +0000 (20:01 +0100)]
scsi: ufs: ufs-exynos: Make a const array static, makes object smaller

Don't populate the const array granularity_tbl on the stack but instead
make it static. Makes the object code smaller by 190 bytes:

Before:
   text    data     bss     dec     hex filename
  25563    6908       0   32471    7ed7 ./drivers/scsi/ufs/ufs-exynos.o

After:
   text    data     bss     dec     hex filename
  25213    7068       0   32281    7e19 ./drivers/scsi/ufs/ufs-exynos.o

(gcc version 10.3.0)

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: fas216: Use fallthrough pseudo-keyword
Wei Ming Chen [Tue, 18 May 2021 13:18:23 +0000 (21:18 +0800)]
scsi: fas216: Use fallthrough pseudo-keyword

Replace /*FALLTHROUGH*/ comment with pseudo-keyword macro 'fallthrough'.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Wei Ming Chen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: ufs: core: Clean up whitespace
Keoseong Park [Tue, 18 May 2021 12:12:17 +0000 (21:12 +0900)]
scsi: ufs: core: Clean up whitespace

checkpatch reports the following errors:

ERROR: space prohibited before that ',' (ctx:WxW)
#945: FILE: drivers/scsi/ufs/ufshcd.h:945:
+int ufshcd_init(struct ufs_hba * , void __iomem * , unsigned int);
                                  ^

ERROR: space prohibited before that ',' (ctx:WxW)
#945: FILE: drivers/scsi/ufs/ufshcd.h:945:
+int ufshcd_init(struct ufs_hba * , void __iomem * , unsigned int);
                                                   ^
Remove unnecessary whitespace in ufshcd.h.

Link: https://lore.kernel.org/r/2038148563.21621340102306.JavaMail.epsvc@epcpadp3
Signed-off-by: Keoseong Park <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: Fix spelling mistakes in header files
Zhen Lei [Mon, 17 May 2021 09:59:45 +0000 (17:59 +0800)]
scsi: Fix spelling mistakes in header files

Fix some spelling mistakes in comments:

  pathes ==> paths
  Resouce ==> Resource
  retreived ==> retrieved
  recevied ==> received
  interruped ==> interrupted

[mkp: kept 'keep-alives' and 'busses']

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Zhen Lei <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: core: Remove leading spaces in Kconfig
Juerg Haefliger [Mon, 17 May 2021 09:58:35 +0000 (11:58 +0200)]
scsi: core: Remove leading spaces in Kconfig

Remove leading spaces before tabs in Kconfig file(s) by running the
following command:

  $ find drivers/scsi -name 'Kconfig*' | xargs sed -r -i 's/^[ ]+\t/\t/'

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Juerg Haefliger <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: target: tcmu: Fix boolreturn.cocci warnings
kernel test robot [Sat, 15 May 2021 23:03:58 +0000 (07:03 +0800)]
scsi: target: tcmu: Fix boolreturn.cocci warnings

drivers/target/target_core_user.c:1424:9-10: WARNING: return of 0/1 in function 'tcmu_handle_completions' with return type bool

 Return statements in functions returning bool should use
 true/false instead of 1/0.

Generated by: scripts/coccinelle/misc/boolreturn.cocci

Link: https://lore.kernel.org/r/20210515230358.GA97544@60d1edce16e0
Fixes: 9814b55cde05 ("scsi: target: tcmu: Return from tcmu_handle_completions() if cmd_id not found")
CC: Bodo Stroesser <[email protected]>
Reported-by: kernel test robot <[email protected]>
Acked-by: Bodo Stroesser <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: ufs: Use designated initializers in ufs_pm_lvl_states[]
Bart Van Assche [Wed, 19 May 2021 20:20:58 +0000 (13:20 -0700)]
scsi: ufs: Use designated initializers in ufs_pm_lvl_states[]

The comments in the enum ufs_pm_level definition are redundant. Remove the
comments from the ufs_pm_level enum and use designated initializers in the
ufs_pm_lvl_states[] definition instead.

Link: https://lore.kernel.org/r/[email protected]
Cc: Stanley Chu <[email protected]>
Cc: Can Guo <[email protected]>
Cc: Bean Huo <[email protected]>
Cc: Jaegeuk Kim <[email protected]>
Cc: Asutosh Das <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: hisi_sas: Propagate errors in interrupt_init_v1_hw()
Sergey Shtylyov [Wed, 19 May 2021 19:20:15 +0000 (22:20 +0300)]
scsi: hisi_sas: Propagate errors in interrupt_init_v1_hw()

After commit 6c11dc060427 ("scsi: hisi_sas: Fix IRQ checks") we have the
error codes returned by platform_get_irq() ready for the propagation
upsream in interrupt_init_v1_hw() -- that will fix still broken deferred
probing. Let's propagate the error codes from devm_request_irq() as well
since I don't see the reason to override them with -ENOENT...

Link: https://lore.kernel.org/r/[email protected]
Acked-by: John Garry <[email protected]>
Signed-off-by: Sergey Shtylyov <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: bfa: Fix inconsistent indenting
Jiapeng Chong [Fri, 21 May 2021 09:46:08 +0000 (17:46 +0800)]
scsi: bfa: Fix inconsistent indenting

Eliminate the follow smatch warning:

drivers/scsi/bfa/bfa_svc.c:3176 bfa_fcport_send_enable() warn:
inconsistent indenting.

Link: https://lore.kernel.org/r/1621590368-72041-1-git-send-email-jiapeng.chong@linux.alibaba.com
Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Jiapeng Chong <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: bfa: Fix typo
zuoqilin [Fri, 21 May 2021 09:21:53 +0000 (17:21 +0800)]
scsi: bfa: Fix typo

Change 'chnage' to 'change'.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: zuoqilin <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: pmcraid: Fix typos
zuoqilin [Fri, 21 May 2021 08:28:08 +0000 (16:28 +0800)]
scsi: pmcraid: Fix typos

Change "avaibale" and "avaible" to "available".

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: zuoqilin <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: scsi_transport_fc: Remove double FC_FPORT_DELETED in mask creation
Daniel Wagner [Thu, 20 May 2021 07:31:27 +0000 (09:31 +0200)]
scsi: scsi_transport_fc: Remove double FC_FPORT_DELETED in mask creation

Remove the double listed FC_FPORT_DELETING from the mask creation.

Commit 260f4aeddb48 ("scsi: scsi_transport_fc: return -EBUSY for deleted
vport") added VC_VPORT_DELETING to the flag masks. This is not necessary as
FC_FPORT_DEL is defined as VC_FPORT_DELETED | FC_FPORT_DELETING.

Link: https://lore.kernel.org/r/[email protected]
Cc: Hannes Reinecke <[email protected]>
Signed-off-by: Daniel Wagner <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: arcmsr: Update driver version to v1.50.00.05-20210429
ching Huang [Thu, 20 May 2021 07:13:49 +0000 (15:13 +0800)]
scsi: arcmsr: Update driver version to v1.50.00.05-20210429

Update driver version to v1.50.00.05-20210429.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: ching Huang <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: arcmsr: Fix doorbell status being updated late on ARC-1886
ching Huang [Thu, 20 May 2021 06:55:15 +0000 (14:55 +0800)]
scsi: arcmsr: Fix doorbell status being updated late on ARC-1886

It is possible for the IOP to be delayed in updating the doorbell
status. The doorbell status should not be 0 so loop until the value
changes.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: ching Huang <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: qedf: Use vzalloc() instead of vmalloc()/memset(0)
Yang Yingliang [Tue, 18 May 2021 13:20:18 +0000 (21:20 +0800)]
scsi: qedf: Use vzalloc() instead of vmalloc()/memset(0)

Use vzalloc() instead of vmalloc() and memset(0) to simpify the code.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Himanshu Madhani <[email protected]>
Signed-off-by: Yang Yingliang <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: ufs: ufs-exynos: Move definitions from .h to .c
Bart Van Assche [Sun, 9 May 2021 21:38:17 +0000 (14:38 -0700)]
scsi: ufs: ufs-exynos: Move definitions from .h to .c

In the Linux kernel definitions of data structures should occur in .c
files. Hence move the exynos7_uic_attr definition from a .h into a .c
file. Additionally, declare exynos_ufs_drvs static. This patch fixes the
following two sparse warnings:

drivers/scsi/ufs/ufs-exynos.h:248:28: warning: symbol 'exynos_ufs_drvs' was not declared. Should it be static?
drivers/scsi/ufs/ufs-exynos.h:250:28: warning: symbol 'exynos7_uic_attr' was not declared. Should it be static?

Link: https://lore.kernel.org/r/[email protected]
Cc: Alim Akhtar <[email protected]>
Cc: Kiwoong Kim <[email protected]>
Reviewed-by: Alim Akhtar <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: 3w-9xxx: Fix endianness issues in command packets
Samuel Holland [Tue, 27 Apr 2021 23:59:15 +0000 (18:59 -0500)]
scsi: 3w-9xxx: Fix endianness issues in command packets

The controller expects all data it sends/receives to be little-endian.
Therefore, the packet struct definitions should use the __le16/32/64
types. Once those are correct, sparse reports several issues with the
driver code, which are fixed here as well.

The main issue observed was at the call to scsi_set_resid(), where the
byteswapped parameter would eventually trigger the alignment check at
drivers/scsi/sd.c:2009. At that point, the kernel would continuously
complain about an "Unaligned partial completion", and no further I/O could
occur.

This gets the controller working on big endian powerpc64.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Samuel Holland <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: 3w-9xxx: Reduce scope of structure packing
Samuel Holland [Tue, 27 Apr 2021 23:59:14 +0000 (18:59 -0500)]
scsi: 3w-9xxx: Reduce scope of structure packing

Currently, all command packet structs used by this driver are packed.
However, only one (TW_SG_Entry) actually needs to be packed, because it
uses 64-bit addresses at 32-bit alignment. To improve the quality of
generated code, stop packing all of the other command packet structs.  This
requires adjusting the type of one misaligned "reserved" member.

After this change, pahole reports that only one type had its layout change:
the tw_compat_info member of TW_Device_Extension is now naturally aligned.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Samuel Holland <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: 3w-9xxx: Use flexible array members to avoid struct padding
Samuel Holland [Tue, 27 Apr 2021 23:59:13 +0000 (18:59 -0500)]
scsi: 3w-9xxx: Use flexible array members to avoid struct padding

In preparation for removing the "#pragma pack(1)" from the driver, fix all
instances where a trailing array member could be replaced by a flexible
array member. Since a flexible array member has zero size, it introduces no
padding, whether or not the struct is packed.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Samuel Holland <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: be2iscsi: Remove redundant initialization
Nigel Christian [Thu, 13 May 2021 22:20:32 +0000 (17:20 -0500)]
scsi: be2iscsi: Remove redundant initialization

The nested for loop variables i and j in beiscsi_free_mem() are initialized
twice. The values outside of the loops are redundant and can be removed.

Addresses-Coverity: ("Unused value")
Link: https://lore.kernel.org/r/YJ2mMHNqAgTNVVj+@fedora
Signed-off-by: Nigel Christian <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: ufs: core: Remove redundant parenthesis
Keoseong Park [Thu, 13 May 2021 08:53:20 +0000 (17:53 +0900)]
scsi: ufs: core: Remove redundant parenthesis

Remove unnecessary parenthesis in ufshcd_is_wb_flags() and
ufshcd_is_wbattrs().

Link: https://lore.kernel.org/r/1891546521.01620896402035.JavaMail.epsvc@epcpadp3
Signed-off-by: Keoseong Park <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: ufs: core: Remove usfhcd_is_*_pm() macros
Bart Van Assche [Thu, 13 May 2021 17:12:29 +0000 (10:12 -0700)]
scsi: ufs: core: Remove usfhcd_is_*_pm() macros

Remove these macros to make the UFS driver source code easier to read.
These macros were introduced by commit 57d104c153d3 ("ufs: add UFS power
management support").

Link: https://lore.kernel.org/r/[email protected]
Cc: Can Guo <[email protected]>
Cc: Alim Akhtar <[email protected]>
Cc: Avri Altman <[email protected]>
Cc: Stanley Chu <[email protected]>
Cc: Bean Huo <[email protected]>
Cc: Adrian Hunter <[email protected]>
Acked-by: Avri Altman <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: bfa: Remove some unused variables
Christophe JAILLET [Tue, 20 Apr 2021 18:48:41 +0000 (20:48 +0200)]
scsi: bfa: Remove some unused variables

'lp' is unused, it is just declared and zeroed

Remove it.

Link: https://lore.kernel.org/r/d10ccee35e35bf33d651f2e0163034d7c451520b.1618944442.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: target: core: Add the VERSION DESCRIPTOR fields to the INQUIRY data
Konstantin Shelekhin [Thu, 13 May 2021 19:28:04 +0000 (22:28 +0300)]
scsi: target: core: Add the VERSION DESCRIPTOR fields to the INQUIRY data

Extend the standard INQUIRY data to 96 bytes and fill in the VERSION
DESCRIPTOR fields.

The layout follows SPC-4:

 - SCSI architecture standard
 - SCSI transport protocol standard
 - SCSI primary command set standard
 - SCSI device type command set standard

All version descriptor values are defined as "no version claimed" because
some initiators fail to recognize anything else.

[mkp: whitespace]

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Roman Bolshakov <[email protected]>
Signed-off-by: Konstantin Shelekhin <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: target: core: Bump INQUIRY VERSION to SPC-4
Konstantin Shelekhin [Thu, 13 May 2021 19:28:03 +0000 (22:28 +0300)]
scsi: target: core: Bump INQUIRY VERSION to SPC-4

Bump the SCSI primary command set standard to SPC-4. The upcoming version
descriptors will report newer SCSI standards (like SBC-3) that are not
defined in SPC-3.

Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Roman Bolshakov <[email protected]>
Signed-off-by: Konstantin Shelekhin <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: target: core: Add configurable IEEE Company ID attribute
Sergey Samoylenko [Tue, 20 Apr 2021 18:59:20 +0000 (21:59 +0300)]
scsi: target: core: Add configurable IEEE Company ID attribute

Implement an attribute which provides a way to set a company specific WWN
in configfs via:

  target/core/$backstore/$name/wwn/company_id

The Open Fabrics Alliance ID 001405h remains the default.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sergey Samoylenko <[email protected]>
Signed-off-by: Roman Bolshakov <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
3 years agoscsi: target: core: Unify NAA identifier generation
Sergey Samoylenko [Tue, 20 Apr 2021 18:59:19 +0000 (21:59 +0300)]
scsi: target: core: Unify NAA identifier generation

Both the INQUIRY handling and the XCOPY implementation provide functions to
generate an NAA designator. In addition, these functions are poorly named:

 - spc_parse_naa_6h_vendor_specific()
 - target_xcopy_gen_naa_ieee()

Introduce a common NAA 6 designator generation function,
spc_gen_naa_6h_vendor_specific().

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sergey Samoylenko <[email protected]>
Signed-off-by: Roman Bolshakov <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
This page took 0.112618 seconds and 4 git commands to generate.