[PATCH RFC 2/3] scsi: ufs: Add ufs provisioning support

2018-05-21 Thread Sayali Lokhande
A new api ufshcd_do_config_device() is added in driver to suppoet UFS provisioning at runtime. Sysfs support is added to trigger provisioning. Device configuration descriptors or parameters are parsed from vendor specific provisioning data and passed via sysfs at runtime to provision ufs device.

[PATCH RFC 3/3] scsi: ufs: Add sysfs support for ufs provision

2018-05-21 Thread Sayali Lokhande
Add sysfs support to trigger ufs provisioning at runtime. Usage : echo > /sys/bus/platform/devices/1d84000.ufshcd/ufs_provision To check provisioning status: cat /sys/bus/platform/devices/1d84000.ufshc/ufs_provision 1 -> Success (Reboot device to check updated provisioning) Signed-off-by: Sayali

[PATCH RFC 1/3] scsi: ufs: set the device reference clock setting

2018-05-21 Thread Sayali Lokhande
From: Subhash Jadavani UFS host supplies the reference clock to UFS device and UFS device specification allows host to provide one of the 4 frequencies (19.2 MHz, 26 MHz, 38.4 MHz, 52 MHz) for reference clock. Host should set the device reference clock frequency setting

[PATCH RFC 0/3] Add ufs provisioning support in driver

2018-05-21 Thread Sayali Lokhande
This change adds a new API ufshcd_do_config_device() to write configuration descriptor with the provisioning data. Sysfs support is added in driver to trigger ufs provisioning at runtime. Provisioning data is parsed from vendor specific provisioning file. This parsed data is passed as a buffer via

[PATCH RFC 0/3] Add ufs provisioning support in driver

2018-05-21 Thread Sayali Lokhande
This change adds a new API ufshcd_do_config_device() to write configuration descriptor with the provisioning data. Sysfs support is added in driver to trigger ufs provisioning at runtime. Provisioning data is parsed from vendor specific provisioning file. This parsed data is passed as a buffer via

[GIT PULL] SCSI fixes for 4.17-rc6

2018-05-21 Thread James Bottomley
Two driver fixes (zfcp and target core), one information leak in sg and one build clean up. The patch is available here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes The short changelog is: Alexander Potapenko (1): scsi: sg: allocate with __GFP_ZERO in

Re: [PATCH 2/2] tests/scsi/0001: Regression test for SCSI device blacklisting

2018-05-21 Thread Omar Sandoval
On Wed, Dec 13, 2017 at 01:29:39AM -0800, Omar Sandoval wrote: > On Tue, Aug 15, 2017 at 11:00:49PM -0700, Omar Sandoval wrote: > > On Wed, Aug 09, 2017 at 12:50:06PM +0200, Hannes Reinecke wrote: > > > SCSI device blacklisting seems to be a tricky subject, with > > > lots of potential for messing

[PATCH v2] scsi_transport_srp: Fix shost to rport translation

2018-05-21 Thread Bart Van Assche
Since an SRP remote port is attached as a child to shost->shost_gendev and as the only child, the translation from the shost pointer into an rport pointer must happen by looking up the shost child that is an rport. This patch fixes the following KASAN complaint: BUG: KASAN: slab-out-of-bounds in

[PATCH 01/13] scsi: hisi_sas: Introduce hisi_sas_phy_set_linkrate()

2018-05-21 Thread John Garry
There is much common code and functionality between the HW versions to set the PHY linkrate. As such, this patch factors out the common code into a generic function hisi_sas_phy_set_linkrate(). Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 29

[PATCH 03/13] scsi: hisi_sas: Change common allocation mode of device id

2018-05-21 Thread John Garry
From: Xiang Chen To reduce possibility of hitting unknown SoC bugs and aid debugging and test, change allocation mode of device id from last used device id instead of lowest available index. Signed-off-by: Xiang Chen Signed-off-by: John

[PATCH 07/13] scsi: hisi_sas: Init disks after controller reset

2018-05-21 Thread John Garry
From: Xiaofei Tan After the controller is reset, it is possible that the disks attached still have outstanding IO to complete. Thus, when the PHYs come back up after controller reset, it is possible that these IOs complete at some unknown point later. We want to ensure

[PATCH 02/13] scsi: hisi_sas: change slot index allocation mode

2018-05-21 Thread John Garry
From: Xiang Chen Currently we find the lowest available empty bit in the IPTT bitmap to allocate the IPTT for a command. To reduce possibility of hitting unknown SoC bugs and also aid in the debugging of those same bugs, change the allocation mode. The next

[PATCH 05/13] scsi: hisi_sas: Reset disks when discovered

2018-05-21 Thread John Garry
From: Xiang Chen When a disk is discovered, it may be in an error state, or there may be residual commands remaining in the disk. To ensure any disk is in good state after discovery, reset via TMF (for SAS disk) or softreset (for a SATA disk). Signed-off-by: Xiang

[PATCH 08/13] scsi: hisi_sas: Try wait commands before before controller reset

2018-05-21 Thread John Garry
From: Xiaofei Tan We may reset the controller in many scenarios, such as SCSI EH and HW errors. There should be no IO which returns from target when SCSI EH is active. But for other scenarios, there may be. It is not necessary to make such IOs failure. This patch adds an

[PATCH 06/13] scsi: hisi_sas: Create a scsi_host_template per HW module

2018-05-21 Thread John Garry
From: Xiang Chen When a SCSI host is registered, the SCSI mid-layer takes a reference to a module in Scsi_host.hostt.module. In doing this, we are prevented from removing the driver module for the host in dangerous scenario, like when a disk is mounted. Currently

[PATCH 12/13] scsi: hisi_sas: Fix return value when get_free_slot() failed

2018-05-21 Thread John Garry
From: Xiaofei Tan It is an step of executing task to get free slot. If the step fails, we will cleanup LLDD resources and should return failure to upper layer or internal caller to abort task execution of this time. But in the current code, the caller of get_free_slot()

[PATCH 00/13] hisi_sas: Misc improvements, bugfixes, etc.

2018-05-21 Thread John Garry
This patchset introduces some misc improvements, bugfixes, and SoC workarounds for the driver, including: - workaround for v2 hw reset with SATA disks attached - LED SGPIO support for v3 hw - Fix for error path in task_prep function - change slot and disk allocation method to avoid unknown SoC

[PATCH 11/13] scsi: hisi_sas: Terminate STP reject quickly for v2 hw

2018-05-21 Thread John Garry
From: Xiaofei Tan For v2 hw, STP link from target is rejected after host reset because of a SoC bug. The STP reject will be terminated after we have sent IO from each PHY of a port. This is not an problem before, as we don't need to setup STP link from target immediately

[PATCH 09/13] scsi: hisi_sas: Include TMF elements in struct hisi_sas_slot

2018-05-21 Thread John Garry
From: Xiaofei Tan In future scenarios we will want to use the TMF struct for more task types than SSP. As such, we can add struct hisi_sas_tmf_task directly into struct hisi_sas_slot, and this will mean we can remove the TMF parameters from the task prep functions.

[PATCH 10/13] scsi: hisi_sas: Add v2 hw force PHY function for internal ATA command

2018-05-21 Thread John Garry
From: Xiaofei Tan This patch adds an force PHY function for internal ATA command for v2 hw. Because there is an SoC bug of v2 hw, and need send an IO through each PHY of a port to workaround a bug which occurs after a controller reset. This force PHY function will be

[PATCH 13/13] scsi: hisi_sas: Mark PHY as in reset for nexus reset

2018-05-21 Thread John Garry
From: Xiang Chen When issunig a nexus reset for directly attached device, we want to ignore the PHY down events so libsas will not deform and reform the port. In the case that the attached SAS changes for the reset, libsas will deform and form a port. For scenario

[PATCH 04/13] scsi: hisi_sas: Add LED feature for v3 hw

2018-05-21 Thread John Garry
From: Xiaofei Tan This patch implements LED feature of directly attached disk for v3 hw. In fact, this hw has created an SGPIO component for LED feature, and we can control LEDs just by internal registers. Signed-off-by: Xiaofei Tan Signed-off-by: