[PATCH -next] scsi: megaraid: remove set but not used variables

2018-09-26 Thread YueHaibing
Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/megaraid/megaraid_mbox.c: In function 'megaraid_mbox_sync_scb': drivers/scsi/megaraid/megaraid_mbox.c:2193:14: warning: variable 'ccb' set but not used [-Wunused-but-set-variable] drivers/scsi/megaraid/megaraid_mbox.c: In function 'mega

RE: [PATCH] scsi: megaraid: fix spelling mistake "maibox" -> "mailbox"

2018-09-26 Thread Sumit Saxena
> -Original Message- > From: Colin King [mailto:colin.k...@canonical.com] > Sent: Monday, September 24, 2018 3:56 AM > To: Kashyap Desai ; Sumit Saxena > ; Shivasharan S > ; James E . J . Bottomley > ; Martin K . Petersen > ; megaraidlinux@broadcom.com; linux- > s...@vger.kernel.org > C

[PATCH -next] advansys: use correct srb_tag in adv_isr_callback

2018-09-26 Thread YueHaibing
'srb_tag' should be used in the scsi_host_find_tag, rather than 'scsiqp->srb_tag'. Fixes: 9c17c62aedb0 ("advansys: use shared host tag map for command lookup") Signed-off-by: YueHaibing --- drivers/scsi/advansys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/a

[PATCH] scsi: qla4xxx: remove redundant check on drvr_wait

2018-09-26 Thread Colin King
From: Colin Ian King The check for a non-zero drvr_wait is redundant as the same check is performed earlier in the outer while loop, the inner check will always be true if we reached this point inside the while loop. Remove the redundant if check. Detected by cppcheck: (warning) Identical inner

Re: [PATCH v4] scsi: ufs: Make sysfs attributes writable

2018-09-26 Thread Evan Green
On Tue, Sep 25, 2018 at 6:46 PM Doug Anderson wrote: > > Martin, > > On Tue, Sep 25, 2018 at 6:08 PM Martin K. Petersen > wrote: > > > > Doug, > > > > > I came across this patch and Evan's other one and noticed that they > > > haven't been applied though a batch of other SCSI patches for 4.20 > >

Re: [PATCH v4 1/6] mpt3sas: Introduce mpt3sas_base_pci_device_is_available

2018-09-26 Thread Bjorn Helgaas
[+cc LKML] On Wed, Sep 26, 2018 at 09:52:34AM +0530, Suganath Prabu S wrote: > * Driver uses "pci_device_is_present" to check whether > If Hot unplugged: > the outstanding IOs with 'DID_NO_CONNECT' before removing the drives > attached to the HBA. This sentence needs a verb. > "DID_NO_CONNECT" s

[PATCH] scsi: isci: Use proper enumerated type in atapi_d2h_reg_frame_handler

2018-09-26 Thread Nathan Chancellor
Clang warns when one enumerated type is implicitly converted to another. drivers/scsi/isci/request.c:1629:13: warning: implicit conversion from enumeration type 'enum sci_io_status' to different enumeration type 'enum sci_status' [-Wenum-conversion] status = SCI_IO_FAILURE_

[PATCH] scsi: isci: Change sci_controller_start_task's return type to sci_status

2018-09-26 Thread Nathan Chancellor
Clang warns when an enumerated type is implicitly converted to another. drivers/scsi/isci/request.c:3476:13: warning: implicit conversion from enumeration type 'enum sci_task_status' to different enumeration type 'enum sci_status' [-Wenum-conversion] status = sci_controller

[PATCH 04/10] NCR5380: Withhold disconnect privilege for REQUEST SENSE

2018-09-26 Thread Finn Thain
This is mostly needed because an AztecMonster II target has been observed disconnecting REQUEST SENSE commands and then failing to reselect properly. Suggested-by: Michael Schmitz Tested-by: Michael Schmitz Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 4 +++- 1 file changed, 3 insert

[PATCH 01/10] NCR5380: Clear all unissued commands on host reset

2018-09-26 Thread Finn Thain
From: Hannes Reinecke When doing a host reset we should be clearing all outstanding commands, not just the command triggering the reset. Signed-off-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Cc: Ondrey Zary Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 7 +-- 1 file ch

[PATCH 06/10] NCR5380: Check for invalid reselection target

2018-09-26 Thread Finn Thain
The X3T9.2 specification (draft) says, under "6.1.4.1 RESELECTION", that "the initiator shall not respond to a RESELECTION phase if other than two SCSI ID bits are on the DATA BUS." This issue (too many bits set) has been observed in the wild, so add a check. Tested-by: Michael Schmitz Signed-off

[PATCH 02/10] NCR5380: Reduce goto statements in NCR5380_select()

2018-09-26 Thread Finn Thain
Replace a 'goto' statement with a simple 'return' where possible. This improves readability. No functional change. Tested-by: Michael Schmitz Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/s

[PATCH 09/10] NCR5380: Handle BUS FREE during reselection

2018-09-26 Thread Finn Thain
The X3T9.2 specification (draft) says, under "6.1.4.2 RESELECTION time-out procedure", that a target may assert RST or go to BUS FREE phase if the initiator does not respond within 200 us. Something like this has been observed with AztecMonster II target. When it happens, all we can do is wait for

[PATCH 08/10] NCR5380: Don't call dsprintk() following reselection interrupt

2018-09-26 Thread Finn Thain
The X3T9.2 specification (draft) says, under "6.1.4.1 RESELECTION", ... The reselected initiator shall then assert the BSY signal within a selection abort time of its most recent detection of being reselected; this is required for correct operation of the time-out procedure. The s

[PATCH 10/10] NCR5380: Check for bus reset

2018-09-26 Thread Finn Thain
The SR_RST bit isn't latched. Hence, detecting a bus reset isn't reliable. When it is detected, the right thing to do is to drop all connected and disconnected commands. The code for that is already present so refactor it and call it when SR_RST is set. Tested-by: Michael Schmitz Signed-off-by: F

[PATCH 07/10] NCR5380: Don't clear busy flag when abort fails

2018-09-26 Thread Finn Thain
When NCR5380_abort() returns FAILED, the driver forgets that the target is still busy. Hence, further commands may be sent to the target, which may fail during selection and produce the error message, "reselection after won arbitration?". Prevent this by leaving the busy flag set when NCR5380_abort

[PATCH 00/10] NCR5380: Various improvements

2018-09-26 Thread Finn Thain
[This patch series is being re-sent unchanged due to email problems.] This series addresses issues which became apparent when Michael Schmitz tried to use an AztecMonster II SATA/SCSI adapter with a 5380 host. That target seems to have some bugs which thoroughly exercise driver error paths and EH

[PATCH 03/10] NCR5380: Have NCR5380_select() return a bool

2018-09-26 Thread Finn Thain
The return value is taken to mean "retry" or "don't retry". Change it to bool to improve readability. Fix related comments. No functional change. Tested-by: Michael Schmitz Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 46 +- drivers/scsi/NCR

[PATCH 05/10] NCR5380: Use DRIVER_SENSE to indicate valid sense data

2018-09-26 Thread Finn Thain
When sense data is valid, call set_driver_byte(cmd, DRIVER_SENSE). Otherwise some callers of scsi_execute() will ignore sense data. Don't set DID_ERROR or DID_RESET just because sense data is missing. Tested-by: Michael Schmitz Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 9 -

RE: [PATCH v4] scsi: ufs: Make sysfs attributes writable

2018-09-26 Thread Avri Altman
> > > > > > I have simply been awaiting some sort of consensus on the various > > > competing approaches. Lots of patches posted with tiny incremental fixes > > > but very little discussion about the merits of one over the other. > > > > Ah, perfect information! Thank you! I was just confused be

Re: [PATCH v2 0/5] qla2xxx: Add FC-NVMe Target support

2018-09-26 Thread Christoph Hellwig
Please send this to linux-nvme and CC the nvme-fc maintainer. Without an ACK from the latter, I'll have to NACK it with my nvme maintainer hat on.

Re: [PATCH v6 3/7] scsi: ufs: Add ufs-bsg module

2018-09-26 Thread Christoph Hellwig
Hi Avri, this looks generally good to me, but I'd suggest two small tweaks: - please split out a new prep patch that creates include/uapi/scsi/scsi_bsg_ufs.h with the structures move there - pleae keep the copyrights from drivers/scsi/ufs/ufs.h in this new file

Re: [PATCH v6 4/7] scsi: ufs: Use data structure size in pointer arithmetic

2018-09-26 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v6 5/7] scsi: ufs: Add API to execute raw upiu commands

2018-09-26 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v6 5/7] scsi: ufs: Add API to execute raw upiu commands

2018-09-26 Thread Christoph Hellwig
On Fri, Sep 21, 2018 at 12:44:22PM +0300, Avri Altman wrote: > The UFS host software uses a combination of a host register set, > and Transfer Request Descriptors in system memory to communicate > with host controller hardware. In its mmio space, a separate places > are assigned to UTP Transfer Req

Re: [PATCH v2 0/5] qla2xxx: Add FC-NVMe Target support

2018-09-26 Thread Madhani, Himanshu
> On Sep 26, 2018, at 7:34 AM, Christoph Hellwig wrote: > > External Email > > Please send this to linux-nvme and CC the nvme-fc maintainer. > > Without an ACK from the latter, I'll have to NACK it with my nvme > maintainer hat on. Sure. will send series to the requested maintainers. Thank

Re: [PATCH] scsi: qla2xxx: don't allow negative thresholds

2018-09-26 Thread Madhani, Himanshu
> On Sep 20, 2018, at 3:02 AM, Dan Carpenter wrote: > > External Email > > We shouldn't allow negative thresholds. I don't know what it would do > but it can't be good. > > Fixes: 8b4673ba3a1b ("scsi: qla2xxx: Add support for ZIO6 interrupt > threshold") > Signed-off-by: Dan Carpenter > >

[PATCH v2 3/5] qla2xxx_nvmet: Add FC-NVMe Target handling

2018-09-26 Thread Himanshu Madhani
From: Anil Gurumurthy This patch Adds following code in the driver to support FC-NVMe Target - Updated ql2xenablenvme to allow FC-NVMe Target operation - Added Link Serviccce Request handling for NVMe Target - Added passthru IOCB for LS4 request - Added CTIO for sending response to FW - Added FC

[PATCH v2 0/5] qla2xxx: Add FC-NVMe Target support

2018-09-26 Thread Himanshu Madhani
Hi Martin, This series adds support for FC-NVMe Target. Patch #1 addes new qla_nvmet files for FC-NVMe Target support. Patch #2 adds Kconfig and Makefile changes to prepare code compile. Patch #3, #4 has bulk of changes to handle FC-NVMe Target LS4 processing via Purex pass through pat

[PATCH v2 4/5] qla2xxx_nvmet: Add SysFS node for FC-NVMe Target

2018-09-26 Thread Himanshu Madhani
From: Anil Gurumurthy This patch adds SysFS node for NVMe Target configuration Signed-off-by: Anil Gurumurthy Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_attr.c | 33 + drivers/scsi/qla2xxx/qla_gs.c| 2 +- drivers/scsi/qla2xxx/qla_init.c

[PATCH v2 5/5] qla2xxx: Update driver version to 11.00.00.00-k

2018-09-26 Thread Himanshu Madhani
Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 12bafff71a1a..0d58aa629c08 100644 --- a/drivers/scsi/qla2xxx/qla_version.h

[PATCH v2 2/5] qla2xxx_nvmet: Add FC-NVMe Target Link Service request handling

2018-09-26 Thread Himanshu Madhani
From: Anil Gurumurthy This patch provides link service pass through feature handling in the driver. This feature is implemented mainly by the firmware and the same implementation is handled in the driver via an IOCB interface. Signed-off-by: Anil Gurumurthy Signed-off-by: Giridhar Malavali Sig

[PATCH v2 1/5] qla2xxx_nvmet: Add files for FC-NVMe Target support

2018-09-26 Thread Himanshu Madhani
From: Anil Gurumurthy This patch adds initial files to enable NVMe Target Support Signed-off-by: Anil Gurumurthy Signed-off-by: Giridhar Malavali Signed-off-by: Darren Trapp Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/Makefile| 3 +- drivers/scsi/qla2xxx/qla_nvmet.c | 798

Re: [PATCH v6 3/7] scsi: ufs: Add ufs-bsg module

2018-09-26 Thread Martin K. Petersen
Avri, > this looks generally good to me, but I'd suggest two small tweaks: > > - please split out a new prep patch that creates >include/uapi/scsi/scsi_bsg_ufs.h with the structures move there > - pleae keep the copyrights from drivers/scsi/ufs/ufs.h in this >new file Also, when you r

Re: [PATCH v2 1/5] qla2xxx_nvmet: Add files for FC-NVMe Target support

2018-09-26 Thread kbuild test robot
Hi Anil, I love your patch! Yet something to improve: [auto build test ERROR on mkp-scsi/for-next] [also build test ERROR on v4.19-rc5 next-20180926] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux

Re: [PATCH v2 1/5] qla2xxx_nvmet: Add files for FC-NVMe Target support

2018-09-26 Thread kbuild test robot
Hi Anil, I love your patch! Yet something to improve: [auto build test ERROR on mkp-scsi/for-next] [also build test ERROR on v4.19-rc5 next-20180926] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux

Re: [PATCH v4 2/6] mpt3sas: Separate out mpt3sas_wait_for_ioc_to_operational

2018-09-26 Thread Bjorn Helgaas
On Wed, Sep 26, 2018 at 09:52:35AM +0530, Suganath Prabu S wrote: > Introduce mpt3sas_wait_for_ioc_to_operational. > > This section of code "wait for IOC to be operational" > is used in many places across the driver, > and hence moved this section of code in to the function > "mpt3sas_wait_for_ioc

Re: [PATCH v4 3/6] mpt3sas: Introdude _scsih_get_shost_and_ioc.

2018-09-26 Thread Bjorn Helgaas
On Wed, Sep 26, 2018 at 09:52:36AM +0530, Suganath Prabu S wrote: > The code for getting shost and IOC is redundant so > moved that to function "scsih_get_shost_and_ioc". > Also checks for NULL are added to IOC and shost. > > Signed-off-by: Suganath Prabu S > --- > drivers/scsi/mpt3sas/mpt3sas_s

Re: [PATCH v4 3/6] mpt3sas: Introdude _scsih_get_shost_and_ioc.

2018-09-26 Thread Bjorn Helgaas
Trivial nits/questions. In subject: s/Introdude/Introduce/ s/ / / (remove double space) s/\.//(remove trailing period, also appears in patches 4, 5, 6) On Wed, Sep 26, 2018 at 09:52:36AM +0530, Suganath Prabu S wrote: > The code for getting shost and IOC is redundant so > moved that

[PATCH 6/8] qla2xxx: Fix recursive mailbox timeout

2018-09-26 Thread Himanshu Madhani
From: Quinn Tran This patch prevents user space mailbox request from doing chip reset if the mailbox timed out. The chip reset is only reserved for the DPC thread to ensure all mailbox requests are flushed properly. The DPC thread is responsible for the flushing all MBs and chip reset. Fixes: b2

[PATCH 5/8] qla2xxx: Fix driver hang when FC-NVMe LUNs are configured

2018-09-26 Thread Himanshu Madhani
This patch fixes multiple call for qla_nvme_unregister_remote_port() as part of qlt_schedule_session_for_deletion(), Do not call it again during qla_nvme_delete() Fixes: e473b3074104 ("scsi: qla2xxx: Add FC-NVMe abort processing") Cc: Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla

[PATCH 3/8] qla2xxx: Fix duplicate switch database entries

2018-09-26 Thread Himanshu Madhani
From: Quinn Tran The response data buffer used in switch scan is reused 4 times. (For example, for commands GPN_FT, GNN_FT for FCP and FC-NVME) Before driver reuses this buffer, clear it to prevent duplicate entries in our database. Fixes: a4239945b8ad1 ("scsi: qla2xxx: Add switch command to si

[PATCH 2/8] qla2xxx: Fix NVMe Target discovery

2018-09-26 Thread Himanshu Madhani
From: Quinn Tran This patch fixes issue when remoteport registers itself as both FCP and FC-NVMe with the switch, driver will pick FC-NVMe personality as default when scanning for targets. Driver was using comaprative operator instead of bitwise operator to check for fc4_type for both FCP and FC

[PATCH 8/8] qla2xxx: Move log messages before issuing command to firmware

2018-09-26 Thread Himanshu Madhani
From: Giridhar Malavali There is a probability that the SRB structure might have been released by the time the debug log message dereferences it. This patch moved the log messages before the command is issued to the firmware to prevent unknown behavior and kernel crash Fixes: 726b85487067 ("qla2

[PATCH 7/8] qla2xxx: Fix for double free of SRB structure used in Async switch query commands

2018-09-26 Thread Himanshu Madhani
From: Giridhar Malavali This patch fixes issue during switch command query where driver was freeing SRB resources multiple times Following stack trace will be seen [ 853.436234] BUG: unable to handle kernel NULL pointer dereference at 0001 [ 853.436348] IP: [] kmem_cache_alloc+0x74

[PATCH 1/8] qla2xxx: fix nvme session hang on unload

2018-09-26 Thread Himanshu Madhani
From: Quinn Tran Send aborts only when chip is active. Fixes: 623ee824e579 ("scsi: qla2xxx: Fix FC-NVMe IO abort during driver reset") Cc: # 4.14 Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

[PATCH 0/8] qla2xxx: Bug fixes for the driver

2018-09-26 Thread Himanshu Madhani
Hi Martin, This series fixes issues found during out last test cycle. Patch 1,2 and 5 fixes misc NVMe discovery and unload hang in the driver. Patch 3 fixes issue discovered during BFS test setup resulting into installation failure and hand because driver could not discover BFS Luns. Patch 4

[PATCH 4/8] qla2xxx: Fix re-using LoopID when handle is in use

2018-09-26 Thread Himanshu Madhani
From: Quinn Tran This patch fixes issue where driver clears Nport ID map instead of marking handle in use. Once driver clears NPort ID from the database, it can reuse same NPort ID resulting in a PLOGI failure. Fixes: a084fd68e1d2 ("scsi: qla2xxx: Fix re-login for Nport Handle in use") Cc: Sign

RE: [PATCH v6 3/7] scsi: ufs: Add ufs-bsg module

2018-09-26 Thread Avri Altman
> Hi Avri, > > this looks generally good to me, but I'd suggest two small tweaks: > > - please split out a new prep patch that creates >include/uapi/scsi/scsi_bsg_ufs.h with the structures move there > - pleae keep the copyrights from drivers/scsi/ufs/ufs.h in this >new file Done. Th

RE: [PATCH v6 5/7] scsi: ufs: Add API to execute raw upiu commands

2018-09-26 Thread Avri Altman
> > + > > +/** > > + * ufshcd_exec_raw_upiu_cmd - API function for sending raw upiu > commands > > + * @hba: per-adapter instance > > + * @req_upiu: upiu request > > + * @rsp_upiu: upiu reply - only 8 DW as we do not support scsi > commands > > + * @msgcode: message code, one of U

RE: [PATCH v6 3/7] scsi: ufs: Add ufs-bsg module

2018-09-26 Thread Avri Altman
> > Avri, > > > this looks generally good to me, but I'd suggest two small tweaks: > > > > - please split out a new prep patch that creates > >include/uapi/scsi/scsi_bsg_ufs.h with the structures move there > > - pleae keep the copyrights from drivers/scsi/ufs/ufs.h in this > >new file

RE: [PATCH v6 3/7] scsi: ufs: Add ufs-bsg module

2018-09-26 Thread Avri Altman
Bart/Christoph, > + */ > +int ufs_bsg_probe(struct ufs_hba *hba) > +{ > + struct device *bsg_dev = &hba->bsg_dev; > + struct Scsi_Host *shost = hba->host; > + struct device *parent = &shost->shost_gendev; > + struct request_queue *q; > + int ret; > + > + device_initialize(b