Re: [PATCH] scsi: remove useless variable assignment

2017-05-17 Thread James Bottomley
On Wed, 2017-05-17 at 19:30 -0500, Gustavo A. R. Silva wrote: > Remove this assignment once the value stored in variable _k_ is > overwritten after a few lines. > > Addresses-Coverity-ID: 1226927 > Signed-off-by: Gustavo A. R. Silva > --- > drivers/scsi/qlogicfas408.c |

[PATCH] scsi: remove useless variable assignment

2017-05-17 Thread Gustavo A. R. Silva
Remove both variable assignments once the value stored in variable _reqlen_ is overwritten at some point either by line 2321: reqlen = mptr - msg; or by line 2330: reqlen = 12; Addresses-Coverity-ID: 1226930 Addresses-Coverity-ID: 1226931 Signed-off-by: Gustavo A. R. Silva

[PATCH] scsi: remove useless variable assignment

2017-05-17 Thread Gustavo A. R. Silva
Remove this assignment once the value stored in variable _k_ is overwritten after a few lines. Addresses-Coverity-ID: 1226927 Signed-off-by: Gustavo A. R. Silva --- drivers/scsi/qlogicfas408.c | 1 - 1 file changed, 1 deletion(-) diff --git

Re: [PATCH] lpfc: fix build issue if NVME_FC_TARGET is not defined

2017-05-17 Thread Martin K. Petersen
James, > fix build issue if NVME_FC_TARGET is not defined. noop the code. > The code will never be invoked if target mode is not enabled. Applied to 4.12/scsi-fixes. Thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] lpfc: Fix NULL pointer dereference during PCI error recovery

2017-05-17 Thread Martin K. Petersen
Guilherme, > Recent commit on patchset "lpfc updates for 11.2.0.14" fixed an issue > about dereferencing a NULL pointer on port reset. The specific commit, > named "lpfc: Fix system crash when port is reset.", is missing a check > against NULL pointer on lpfc_els_flush_cmd() though. > > Since we

Re: [PATCH] ses: fix error message in ses_intf_add()

2017-05-17 Thread Martin K. Petersen
Ewan, > This looks OK but I think we should consider suppressing these > messages. There are a lot of devices that return page 0 instead of > the correct page, we should either say something like "enclosure > services not supported", or else work with what we get instead of > logging a message

Re: [PATCH] scsi: zero per-cmd driver data for each MQ I/O

2017-05-17 Thread Bart Van Assche
On Tue, 2017-05-16 at 17:31 +, Long Li wrote: > > -Original Message- > > From: Bart Van Assche [mailto:bart.vanass...@sandisk.com] > > Sent: Monday, May 15, 2017 5:01 PM > > To: j...@linux.vnet.ibm.com; linux-scsi@vger.kernel.org; linux- > > ker...@vger.kernel.org; Long Li

Re: [PATCH v2 02/15] lpfc: Fix system crash when port is reset.

2017-05-17 Thread Guilherme G. Piccoli
On 05/17/2017 03:49 PM, James Smart wrote: > Your patch is still needed. Can you repost your patch with a new > subject and add my signature: > > Signed-off-by: James Smart > > Sorry, I didn't see it to roll it into the set. No problem James, already sent it to

[PATCH] lpfc: Fix NULL pointer dereference during PCI error recovery

2017-05-17 Thread Guilherme G. Piccoli
Recent commit on patchset "lpfc updates for 11.2.0.14" fixed an issue about dereferencing a NULL pointer on port reset. The specific commit, named "lpfc: Fix system crash when port is reset.", is missing a check against NULL pointer on lpfc_els_flush_cmd() though. Since we destroy the queues on

[PATCH] scsi: libiscsi: use kvzalloc for iscsi_pool_init

2017-05-17 Thread Kyle Fortin
iscsiadm session login can fail with the following error: iscsiadm: Could not login to [iface: default, target: iqn.1986-03.com... iscsiadm: initiator reported error (9 - internal error) When /etc/iscsi/iscsid.conf sets node.session.cmds_max = 4096, it results in 64K-sized kmallocs per session.

Re: [PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based controller

2017-05-17 Thread Arnd Bergmann
On Wed, May 17, 2017 at 6:45 PM, John Garry wrote: > On 17/05/2017 15:13, Arnd Bergmann wrote: >> On Wed, May 17, 2017 at 3:37 PM, John Garry wrote: >>> On 17/05/2017 13:37, Arnd Bergmann wrote: >>> As for your suggestion, in theory it could be ok to

Re: [PATCH v2 02/15] lpfc: Fix system crash when port is reset.

2017-05-17 Thread James Smart
On 5/16/2017 5:26 AM, Guilherme G. Piccoli wrote: On 05/15/2017 07:20 PM, James Smart wrote: The driver panic when using the els_wq during port reset. Check for NULL els_wq before dereferencing. James/Dick, if possible please take a look on: https://marc.info/?l=linux-scsi=149487670315697

Re: [PREEMPT-RT] [REEEEPOST] bnx2i + bnx2fc: convert to generic workqueue (#3)

2017-05-17 Thread Sebastian Andrzej Siewior
On 2017-05-17 17:07:34 [+0200], To Chad Dupuis wrote: > > > Sebastian, can you add this change to your patch set? > > > > Are sure that you can reliably reproduce the issue and fix it with the > > patch above? Because this patch: > > oh. Okay. Now it clicked. It can fix the issue but it is still

Re: [PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based controller

2017-05-17 Thread John Garry
On 17/05/2017 15:13, Arnd Bergmann wrote: On Wed, May 17, 2017 at 3:37 PM, John Garry wrote: On 17/05/2017 13:37, Arnd Bergmann wrote: Since this uses the _DSD information that was introduced for compatibility between device tree and ACPI based data, why not write the

Re: [PREEMPT-RT] [REEEEPOST] bnx2i + bnx2fc: convert to generic workqueue (#3)

2017-05-17 Thread Sebastian Andrzej Siewior
On 2017-05-17 17:01:53 [+0200], To Chad Dupuis wrote: > On 2017-05-12 11:55:52 [-0400], Chad Dupuis wrote: > > Ok, I believe I've found the issue here. The machine that the test has > > performed on had many more possible CPUs than active CPUs. We calculate > > which CPU to the work time on in

Re: [REEEEPOST] bnx2i + bnx2fc: convert to generic workqueue (#3)

2017-05-17 Thread Chad Dupuis
On Wed, 17 May 2017, 11:01am, Sebastian Andrzej Siewior wrote: > On 2017-05-12 11:55:52 [-0400], Chad Dupuis wrote: > > Ok, I believe I've found the issue here. The machine that the test has > > performed on had many more possible CPUs than active CPUs. We calculate > > which CPU to the work

Re: [REEEEPOST] bnx2i + bnx2fc: convert to generic workqueue (#3)

2017-05-17 Thread Sebastian Andrzej Siewior
On 2017-05-12 11:55:52 [-0400], Chad Dupuis wrote: > Ok, I believe I've found the issue here. The machine that the test has > performed on had many more possible CPUs than active CPUs. We calculate > which CPU to the work time on in bnx2fc_process_new_cqes() like this: > > unsigned int cpu =

[PATCH] scsi: csiostor: add support for Chelsio T6 adapters

2017-05-17 Thread Varun Prakash
Signed-off-by: Varun Prakash --- drivers/scsi/csiostor/csio_hw.c | 79 ++-- drivers/scsi/csiostor/csio_hw_chip.h | 14 +++ drivers/scsi/csiostor/csio_hw_t5.c | 29 + drivers/scsi/csiostor/csio_init.c| 6 ++-

[PATCH] scsi: csiostor: fix use after free in csio_hw_use_fwconfig()

2017-05-17 Thread Varun Prakash
mbp pointer is passed to csio_hw_validate_caps() so call mempool_free() after calling csio_hw_validate_caps(). Signed-off-by: Varun Prakash --- drivers/scsi/csiostor/csio_hw.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

Re: [PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based controller

2017-05-17 Thread Arnd Bergmann
On Wed, May 17, 2017 at 3:37 PM, John Garry wrote: > On 17/05/2017 13:37, Arnd Bergmann wrote: >> Since this uses the _DSD information that was introduced for compatibility >> between device tree and ACPI based data, why not write the code so that >> it can work for both?

Re: [PATCH] ses: fix error message in ses_intf_add()

2017-05-17 Thread Ewan D. Milne
On Wed, 2017-05-17 at 15:00 +0200, Maurizio Lombardi wrote: > The "result" variable contains a negative error code and > should not be logged as an hex value. > This fixes the following error message: > > [ 250.068869] scsi 8:0:2:254: Wrong diagnostic page; asked for 2 got 0 > [ 250.068872]

Re: [PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based controller

2017-05-17 Thread John Garry
On 17/05/2017 13:37, Arnd Bergmann wrote: On Wed, May 17, 2017 at 12:49 PM, John Garry wrote: > For a pci-based controller, retrieve the SAS address from the > ACPI tables. > > The retrieval is based on the ACPI device node name. Sample is > as follows: > Scope(_SB) > {

Re: [PATCH 07/22] scsi: hisi_sas: add the initialisation for pci-based controller

2017-05-17 Thread John Garry
On 17/05/2017 13:33, Arnd Bergmann wrote: On Wed, May 17, 2017 at 12:49 PM, John Garry wrote: > Add the code to initialise controller which is based on pci device > in hisi_sas_pci_init.c > > The main functionality added is for probing and initialisation of > the

[PATCH] ses: fix error message in ses_intf_add()

2017-05-17 Thread Maurizio Lombardi
The "result" variable contains a negative error code and should not be logged as an hex value. This fixes the following error message: [ 250.068869] scsi 8:0:2:254: Wrong diagnostic page; asked for 2 got 0 [ 250.068872] scsi 8:0:2:254: Failed to get diagnostic page 0xffea Signed-off-by:

Re: [PATCH 20/22] scsi: hisi_sas: Add v3 code to support ECC and AXI bus fatal error

2017-05-17 Thread John Garry
On 17/05/2017 13:27, Arnd Bergmann wrote: On Wed, May 17, 2017 at 12:49 PM, John Garry wrote: > From: Xiang Chen > > For ECC 1bit error, logic can recover it, so we only print a warning. > For ECC multi-bit and AXI bus fatal error, we panic. >

Re: [PATCH 00/22] hisi_sas: hip08 support

2017-05-17 Thread Arnd Bergmann
On Wed, May 17, 2017 at 12:49 PM, John Garry wrote: > This patchset adds support for the HiSilicon SAS controller > in the hip08 chipset. > > The key difference compared to earlier chipsets is that the > controller is an integrated PCI endpoint in hip08. > As such, the

Re: [PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based controller

2017-05-17 Thread Arnd Bergmann
On Wed, May 17, 2017 at 12:49 PM, John Garry wrote: > For a pci-based controller, retrieve the SAS address from the > ACPI tables. > > The retrieval is based on the ACPI device node name. Sample is > as follows: > Scope(_SB) > { > Device(SAS0) { >

Re: [PATCH 07/22] scsi: hisi_sas: add the initialisation for pci-based controller

2017-05-17 Thread Arnd Bergmann
On Wed, May 17, 2017 at 12:49 PM, John Garry wrote: > Add the code to initialise controller which is based on pci device > in hisi_sas_pci_init.c > > The main functionality added is for probing and initialisation of > the controller based on pci device. > > The core

Re: [PATCH 20/22] scsi: hisi_sas: Add v3 code to support ECC and AXI bus fatal error

2017-05-17 Thread Arnd Bergmann
On Wed, May 17, 2017 at 12:49 PM, John Garry wrote: > From: Xiang Chen > > For ECC 1bit error, logic can recover it, so we only print a warning. > For ECC multi-bit and AXI bus fatal error, we panic. > > Signed-off-by: John Garry

[PATCH 02/22] scsi: hisi_sas: optimise the usage of hisi_hba.lock

2017-05-17 Thread John Garry
From: Xiang Chen Currently hisi_hba.lock is locked to deliver and receive a command to/from any hw queue. This causes much contention at high data-rates. To boost performance, lock on a per queue basis for sending and receiving commands to/from hw. Certain critical

[PATCH 10/22] scsi: hisi_sas: add v3 hw init

2017-05-17 Thread John Garry
From: Xiang Chen Add code to initialise v3 hardware. Signed-off-by: John Garry Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 275 + 1 file changed, 275

[PATCH 05/22] scsi: hisi_sas: relocate get_ncq_tag_v2_hw()

2017-05-17 Thread John Garry
From: Xiang Chen Relocate get_ncq_tag_v2_hw() to a common location, as future hw versions will require it. Also rename with "hisi_sas_" prefix for consistency. Signed-off-by: Xiang Chen Signed-off-by: John Garry ---

[PATCH 17/22] scsi: hisi_sas: add v3 code for itct setup and free

2017-05-17 Thread John Garry
From: Xiang Chen Add code for itct setup and free for v3 hw. Signed-off-by: John Garry Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 115 + 1 file changed,

[PATCH 11/22] scsi: hisi_sas: add v3 hw PHY init

2017-05-17 Thread John Garry
From: Xiang Chen Add code to configure PHYs for v3 hw. Signed-off-by: John Garry Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 126 + 1 file changed, 126

[PATCH 08/22] scsi: hisi_sas: add bare v3 hw driver

2017-05-17 Thread John Garry
Add new file hisi_sas_v3_hw.c for hip08 support. The controller design is quite similar to v2 hw in hip07. However key differences include: -All v2 hw bugs are fixed (hopefully), so workarounds are not required -support for device deregistration -some interrupt modifications -configurable max

[PATCH 15/22] scsi: hisi_sas: add v3 code to send SMP frame

2017-05-17 Thread John Garry
From: Xiang Chen Add code to prepare SMP frame. Signed-off-by: John Garry Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 74 ++ 1 file changed, 74

[PATCH 14/22] scsi: hisi_sas: add v3 code to send SSP frame

2017-05-17 Thread John Garry
From: Xiang Chen Add code to prepare SSP frame and deliver it to hardware. Signed-off-by: John Garry Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 209 + 1

[PATCH 12/22] scsi: hisi_sas: add phy up/down/bcast and channel ISR

2017-05-17 Thread John Garry
From: Xiang Chen Add code to initialise interrupts and add some interrupt handlers. Signed-off-by: John Garry Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 281

[PATCH 22/22] scsi: hisi_sas: modify internal abort dev flow for v3 hw

2017-05-17 Thread John Garry
From: Xiang Chen There is a change for abort dev for v3 hw: add registers to configure unaborted iptt for a device, and then inform this to logic. Signed-off-by: Xiang Chen Signed-off-by: John Garry ---

[PATCH 18/22] scsi: hisi_sas: add v3 code to send internal abort command

2017-05-17 Thread John Garry
From: Xiang Chen Add code to prepare internal abort command. Signed-off-by: John Garry Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 38 ++ 1 file changed, 38

[PATCH 21/22] scsi: hisi_sas: add v3 code to fill some more hw function pointers

2017-05-17 Thread John Garry
From: Xiang Chen Add code to fill the interface of phy_hard_reset, phy_get_max_linkrate, and phy enable/disable. Signed-off-by: John Garry Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 39

[PATCH 16/22] scsi: hisi_sas: add v3 code to send ATA frame

2017-05-17 Thread John Garry
From: Xiang Chen Add code to prepare ATA frame for v3 hw Signed-off-by: John Garry Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 106 + 1 file changed, 106

[PATCH 07/22] scsi: hisi_sas: add the initialisation for pci-based controller

2017-05-17 Thread John Garry
Add the code to initialise controller which is based on pci device in hisi_sas_pci_init.c The main functionality added is for probing and initialisation of the controller based on pci device. The core controller routines are still in hisi_sas_main.c; some common initialisation functions and

[PATCH 13/22] scsi: hisi_sas: add v3 cq interrupt handler

2017-05-17 Thread John Garry
From: Xiang Chen Add v3 cq interrupt handler. Signed-off-by: John Garry Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas.h | 1 + drivers/scsi/hisi_sas/hisi_sas_main.c | 32

[PATCH 04/22] scsi: hisi_sas: relocate sata_done_v2_hw()

2017-05-17 Thread John Garry
From: Xiang Chen Relocate get_ata_protocol() to a common location, as future hw versions will require it. Also rename with "hisi_sas_" prefix for consistency. Signed-off-by: Xiang Chen Signed-off-by: John Garry ---

[PATCH 19/22] scsi: hisi_sas: add get_wideport_bitmap_v3_hw()

2017-05-17 Thread John Garry
From: Xiang Chen Add code for interface get_wide_port_bitmap_v3_hw(). Signed-off-by: John Garry Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 13 + 1 file changed, 13

[PATCH 09/22] scsi: hisi_sas: retrieve SAS address for pci-based controller

2017-05-17 Thread John Garry
For a pci-based controller, retrieve the SAS address from the ACPI tables. The retrieval is based on the ACPI device node name. Sample is as follows: Scope(_SB) { Device(SAS0) { Name(_HID, "HISI0163") Name (_DSD, Package () {

[PATCH 20/22] scsi: hisi_sas: Add v3 code to support ECC and AXI bus fatal error

2017-05-17 Thread John Garry
From: Xiang Chen For ECC 1bit error, logic can recover it, so we only print a warning. For ECC multi-bit and AXI bus fatal error, we panic. Signed-off-by: John Garry Signed-off-by: Xiang Chen ---

[PATCH 03/22] scsi: hisi_sas: relocate get_ata_protocol()

2017-05-17 Thread John Garry
From: Xiang Chen Relocate get_ata_protocol() to a common location, as future hw versions will require it. Also rename with "hisi_sas_" prefix for consistency. Signed-off-by: Xiang Chen Signed-off-by: John Garry ---

[PATCH 01/22] scsi: hisi_sas: fix timeout check in hisi_sas_internal_task_abort()

2017-05-17 Thread John Garry
From: Xiang Chen We need to check for timeout before task status, or the task will be mistook as completed internal abort command. Also add protection for sas_task.task_state_flags in hisi_sas_tmf_timedout(). Signed-off-by: Xiang Chen

[PATCH 06/22] scsi: hisi_sas: add pci_dev in hisi_hba struct

2017-05-17 Thread John Garry
Since hip08 SAS controller is based on pci device, add hisi_hba.pci_dev for hip08 (will be v3), and also rename hisi_hba.pdev to .platform_dev for clarity. In addition, for common code which wants to reference the controller device struct, add hisi_hba.dev, and change the common code to use it.

[PATCH 00/22] hisi_sas: hip08 support

2017-05-17 Thread John Garry
This patchset adds support for the HiSilicon SAS controller in the hip08 chipset. The key difference compared to earlier chipsets is that the controller is an integrated PCI endpoint in hip08. As such, the controller is a pci device (not a platform device, like v2 hw in hip07). The driver is