[PATCH] scsi: mpt3sas: fix a missing-check bug

2018-05-04 Thread Wenwen Wang
In _ctl_ioctl_main(), 'ioctl_header' is first copied from the userspace pointer 'arg'. 'ioctl_header.ioc_number' is then verified by _ctl_verify_adapter(). If the verification is failed, an error code -ENODEV is returned. Otherwise, the verification result, i.e., the MPT3SAS adapter that matches wi

[PATCH 01/10] lpfc: Change IO submit return to EBUSY if remote port is recovering

2018-05-04 Thread James Smart
I/O submission paths in the lpfc nvme path are rejecting the io with an error code that reflects back to the callee as a hard io failure. Many of these conditions are transient and would likely resolve if retried. Correct by returning -EBUSY, which the FC transport triggers off of to return busy s

[PATCH 04/10] lpfc: Handle new link fault code returned by adapter firmware.

2018-05-04 Thread James Smart
The driver encounters a link event ACQE with a fault code it doesn't recognize, it logs an "Invalid" fault type and futher treats the unknown value as a mailbox command failure. First off, there is no "invalid" value, only values that are unknown. Secondly, the fault code doesn't indicate status -

[PATCH 06/10] lpfc: Check if SCSI scanning is complete, before allowing I/O commands

2018-05-04 Thread James Smart
A race condition is being seen. I/O is being issued to scsi targets simultaneous to a short connectivity loss. The rport block/unblock is occurring, but the unblock is allowing pending I/O commands to intermix with the commands being used to scan the scsi bus. Thus the target device is getting a re

[PATCH 08/10] lpfc: Enhance log messages when reporting CQE errors

2018-05-04 Thread James Smart
Enhance log messages for CQEs as they were not reporting certain fields. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/sc

[PATCH 09/10] lpfc: update driver version to 12.0.0.3

2018-05-04 Thread James Smart
Update the driver version to 12.0.0.3 Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index 0cd474bb0bdd..666ffa179

[PATCH 05/10] lpfc: Driver NVME load fails when CPU cnt > WQ resource cnt

2018-05-04 Thread James Smart
If the cpu count is larger than the number of WQ resources available, adapter attachment eventually failes due to a WQ_CREATE failure. Calculate the number of WQs desired (which initializes to cpu count) after accounting for the number of queues the adapter supports and the number allocated to SCS

[PATCH 10/10] lpfc: Comment cleanup regarding Broadcom copyright header

2018-05-04 Thread James Smart
Fix small formatting and wording nits in Broadcom copyright header Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_attr.c| 2 +- drivers/scsi/lpfc/lpfc_debugfs.c | 2 +- drivers/scsi/lpfc/lpfc_hw4.h | 2 +- drivers/scsi/lpfc/lpfc_init.c| 2 +- drive

[PATCH 07/10] lpfc: Fix up log messages and stats counters in IO submit code path

2018-05-04 Thread James Smart
Fix up log messages and add an fcp error stat counter in the IO submit code path to make diagnosing problems easier Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_attr.c| 3 ++- drivers/scsi/lpfc/lpfc_debugfs.c | 3 ++- drivers/scsi/lpfc/lpfc_nvme.c|

[PATCH 00/10] lpfc updates for 12.0.0.3

2018-05-04 Thread James Smart
This patch contains lpfc bug fixes and a few message updates and cleanups. The patches were cut against the Martin's 4.17/scsi-queue tree James Smart (10): lpfc: Change IO submit return to EBUSY if remote port is recovering lpfc: enhance LE data structure copies to hardware lpfc: Correct f

[PATCH 02/10] lpfc: enhance LE data structure copies to hardware

2018-05-04 Thread James Smart
The driver builds the control structures in host memory using definitions that are based on 32-bit words. After building the structure it is then written to the adapter. This patch slightly optimizes LE hosts by copying the structures via 64-bit copies. This is doable as the adapter interface is

[PATCH 03/10] lpfc: Correct fw download error message

2018-05-04 Thread James Smart
In situations when the firmware image in inappropriate for the chip type, initial validation checks were light, allowing the checks to pass, thus allowing the firmware to be downloaded. Eventually, after the download, the chip rejects the firmware but it is logged as a generic firmware download err

[PATCH 1/2] scsi: mpt3sas: remove obsolete path "drivers/scsi/mpt2sas/" from MAINTAINERS

2018-05-04 Thread Tomohiro Kusumi
drivers/scsi/mpt2sas/ no longer exists after c84b06a48c ("mpt3sas: Single driver module which supports both SAS 2.0 & SAS 3.0 HBAs") merged/removed it. Signed-off-by: Tomohiro Kusumi --- MAINTAINERS | 1 - 1 file changed, 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index dc59769564c6..

[PATCH 2/2] scsi: mpt3sas: fix header path in ioctl documentation

2018-05-04 Thread Tomohiro Kusumi
MPT2_MAGIC_NUMBER as well as drivers/scsi/mpt2sas/mpt2sas_ctl.h were removed to reuse mpt3sas code since 09ec55ed74 ("mpt2sas: Remove .c and .h files from mpt2sas driver"). Signed-off-by: Tomohiro Kusumi --- Documentation/ioctl/ioctl-number.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(

[PATCH v2 1/2] scsi: ufs: Extract devfreq registration

2018-05-04 Thread Bjorn Andersson
Failing to register with devfreq leaves hba->devfreq assigned, which causes the error path to dereference the ERR_PTR(). Rather than bolting on more conditionals, move the call of devm_devfreq_add_device() into it's own function and only update hba->devfreq once it's successfully registered. The s

[PATCH v2 0/2] Fix UFS and devfreq interaction

2018-05-04 Thread Bjorn Andersson
With the introduction of f1d981eaecf8 ("PM / devfreq: Use the available min/max frequency") the UFS host controller driver (UFSHCD) stopped probing for platforms that supports frequency scaling, e.g. all modern Qualcomm platforms. The cause of this was UFSHCD's reliance of not registering any freq

[PATCH v2 2/2] scsi: ufs: Use freq table with devfreq

2018-05-04 Thread Bjorn Andersson
devfreq requires that the client operates on actual frequencies, not only 0 and UMAX_INT and as such UFS brok with the introduction of f1d981eaecf8 ("PM / devfreq: Use the available min/max frequency"). This patch registers the frequencies of the first clock as opp levels and use these to determin

Re: [PATCH v5 0/6] firmware_loader: cleanups for v4.18

2018-05-04 Thread Luis R. Rodriguez
On Fri, May 04, 2018 at 09:17:08PM +0200, Krzysztof Halasa wrote: > "Luis R. Rodriguez" writes: > > > * CONFIG_WANXL --> CONFIG_WANXL_BUILD_FIRMWARE > > * CONFIG_SCSI_AIC79XX --> CONFIG_AIC79XX_BUILD_FIRMWARE > > > > To this day both of these drivers are building driver *firmwares* when > > t

Re: [PATCH v5 0/6] firmware_loader: cleanups for v4.18

2018-05-04 Thread Krzysztof Halasa
"Luis R. Rodriguez" writes: > * CONFIG_WANXL --> CONFIG_WANXL_BUILD_FIRMWARE > * CONFIG_SCSI_AIC79XX --> CONFIG_AIC79XX_BUILD_FIRMWARE > > To this day both of these drivers are building driver *firmwares* when > the option CONFIG_PREVENT_FIRMWARE_BUILD is disabled, and they don't > even make

[PATCH v5 0/6] firmware_loader: cleanups for v4.18

2018-05-04 Thread Luis R. Rodriguez
d random folks of firmware reviewer folks. These patches are based on top of linux-next next-20180504, they are also available in a respective git branch, both for linux-next [1] and linux [2]. Question, and specially rants are greatly appreciated, and of course... may the 4th be with you. [0] ht

[PATCH v5 1/6] firmware: wrap FW_OPT_* into an enum

2018-05-04 Thread Luis R. Rodriguez
From: Andres Rodriguez This should let us associate enum kdoc to these values. While at it, kdocify the fw_opt. Signed-off-by: Andres Rodriguez Acked-by: Luis R. Rodriguez [mcgrof: coding style fixes, merge kdoc with enum move] Signed-off-by: Luis R. Rodriguez --- drivers/base/firmware_loade

[PATCH v5 2/6] firmware: use () to terminate kernel-doc function names

2018-05-04 Thread Luis R. Rodriguez
From: Andres Rodriguez The kernel-doc spec dictates a function name ends in (). Signed-off-by: Andres Rodriguez Acked-by: Randy Dunlap Acked-by: Luis R. Rodriguez Signed-off-by: Luis R. Rodriguez --- drivers/base/firmware_loader/fallback.c | 8 drivers/base/firmware_loader/main.c

[PATCH v5 3/6] firmware: rename fw_sysfs_fallback to firmware_fallback_sysfs()

2018-05-04 Thread Luis R. Rodriguez
From: Andres Rodriguez This is done since this call is now exposed through kernel-doc, and since this also paves the way for different future types of fallback mechanims. Signed-off-by: Andres Rodriguez Acked-by: Luis R. Rodriguez [mcgrof: small coding style changes] Signed-off-by: Luis R. Rod

[PATCH v5 4/6] firmware_loader: document firmware_sysfs_fallback()

2018-05-04 Thread Luis R. Rodriguez
This also sets the expecations for future fallback interfaces, even if they are not exported. Signed-off-by: Luis R. Rodriguez --- drivers/base/firmware_loader/fallback.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers/base/firmware_loader/fallback.c b/drivers/

[PATCH v5 5/6] firmware_loader: enhance Kconfig documentation over FW_LOADER

2018-05-04 Thread Luis R. Rodriguez
If you try to read FW_LOADER today it speaks of old riddles and unless you have been following development closely you will loose track of what is what. Even the documentation for PREVENT_FIRMWARE_BUILD is a bit fuzzy and how it fits into this big picture. Give the FW_LOADER kconfig documentation

[PATCH v5 6/6] firmware_loader: move kconfig FW_LOADER entries to its own file

2018-05-04 Thread Luis R. Rodriguez
This will make it easier to track and easier to understand what components and features are part of the FW_LOADER. There are some components related to firmware which have *nothing* to do with the FW_LOADER, souch as PREVENT_FIRMWARE_BUILD. Signed-off-by: Luis R. Rodriguez --- drivers/base/Kconf

[PATCH 2/2] qla2xxx: remove irq save in qla2x00_poll()

2018-05-04 Thread Sebastian Andrzej Siewior
In commit d2ba5675d899 ("[SCSI] qla2xxx: Disable local-interrupts while polling for RISC status.") added a local_irq_disable() before invoking the ->intr_handler callback. The function, which was used in this callback, did not disable interrupts while acquiring the spin_lock so a deadlock was possi

[PATCH 1/2] libsas: remove irq save in sas_ata_qc_issue()

2018-05-04 Thread Sebastian Andrzej Siewior
Since commit 312d3e56119a ("[SCSI] libsas: remove ata_port.lock management duties from lldds") the sas_ata_qc_issue() function unlocks the ata_port.lock and disables interrupts before doing so. That lock is always taken with disabled interrupts so at this point, the interrupts are already disabled.

[PATCH] qlogic_stub: Fixup NULL argument to host_reset()

2018-05-04 Thread Hannes Reinecke
The PCMCIA stub calls host_reset() with a NULL argument, which is always wrong. So build a dummy scsi command to restore functionality. Fixes: 4a56c1c166b6: "scsi: qlogicfas: move bus_reset to host_reset" Reported-by: Dan Carpenter Signed-off-by: Hannes Reinecke --- drivers/scsi/pcmcia/qlogic_s