Re: [PATCH] scsi: ufs: Make use of UFS_BIT macro wherever possible

2017-09-29 Thread Alim Akhtar
Hi Martin, On 09/26/2017 01:01 AM, Martin K. Petersen wrote: > > Alim, > >> Should I drop this patch and send another one which removes UFS_BIT() >> macro? > > I fail to see the point of UFS_BIT(). So yes. > > Please make sure to CC: Subhash on ufs changes. > Thanks for looking into this patc

[PATCH 1/3] scsi: ufs: Change HCI marco to actual bit position

2017-09-29 Thread Alim Akhtar
Currently UFS HCI uses UFS_BIT() macro to get various bit position for the hardware registers status bits. Which makes code longer instead of shorter. This macro does not improve code readability as well. Lets re-write these macro definition with the actual bit position. Suggested-by: Bart Van Ass

[PATCH 3/3] scsi: ufs: Remove unused UFS_BIT() macro

2017-09-29 Thread Alim Akhtar
Since we have coverted all the user of UFS_BIT() macro with the actual bit position, let remove unused UFS_BIT()macro. Signed-off-by: Alim Akhtar --- drivers/scsi/ufs/ufshci.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshci.h b/drivers/scsi/ufs/ufshci.h index 5a60a8f..

[PATCH 2/3] scsi: ufs-qcom: Remove uses of UFS_BIT() macro

2017-09-29 Thread Alim Akhtar
Use actaul bit position instead of UFS_BIT() macro. This patch also changes bit-17 to meaningful #define. This change is as per discussion here [1] [1] -> https://lkml.org/lkml/2017/8/28/786 Signed-off-by: Alim Akhtar Cc: Subhash Jadavani --- This patch is only complied tested, appreciate tes

[PATCH V7 1/6] blk-mq: only run hw queues for blk-mq

2017-09-29 Thread Ming Lei
This patch just makes it explicitely. Tested-by: Oleksandr Natalenko Tested-by: Martin Steigerwald Reviewed-by: Johannes Thumshirn Cc: Bart Van Assche Signed-off-by: Ming Lei --- block/blk-mq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-m

[PATCH V7 4/6] block: prepare for passing RQF_PREEMPT to request allocation

2017-09-29 Thread Ming Lei
REQF_PREEMPT is a bit special because the request is required to be dispatched to lld even when SCSI device is quiesced. So this patch introduces __blk_get_request() and allows users to pass RQF_PREEMPT flag in, then we can allow to allocate request of RQF_PREEMPT when queue is in mode of PREEMPT

[PATCH V7 6/6] SCSI: set block queue at preempt only when SCSI device is put into quiesce

2017-09-29 Thread Ming Lei
Simply quiesing SCSI device and waiting for completeion of IO dispatched to SCSI queue isn't safe, it is easy to use up request pool because all allocated requests before can't be dispatched when device is put in QIUESCE. Then no request can be allocated for RQF_PREEMPT, and system may hang somewhe

[PATCH V7 5/6] block: support PREEMPT_ONLY

2017-09-29 Thread Ming Lei
When queue is in PREEMPT_ONLY mode, only RQF_PREEMPT request can be allocated and dispatched, other requests won't be allowed to enter I/O path. This is useful for supporting safe SCSI quiesce. Part of this patch is from Bart's '[PATCH v4 4∕7] block: Add the QUEUE_FLAG_PREEMPT_ONLY request queue

[PATCH V7 2/6] block: tracking request allocation with q_usage_counter

2017-09-29 Thread Ming Lei
This usage is basically same with blk-mq, so that we can support to freeze legacy queue easily. Also 'wake_up_all(&q->mq_freeze_wq)' has to be moved into blk_set_queue_dying() since both legacy and blk-mq may wait on the wait queue of .mq_freeze_wq. Tested-by: Oleksandr Natalenko Tested-by: Mart

[PATCH V7 0/6] block/scsi: safe SCSI quiescing

2017-09-29 Thread Ming Lei
Hi Jens, Please consider this patchset for V4.15, and it fixes one kind of long-term I/O hang issue in either block legacy path or blk-mq. The current SCSI quiesce isn't safe and easy to trigger I/O deadlock. Once SCSI device is put into QUIESCE, no new request except for RQF_PREEMPT can be disp

[PATCH V7 3/6] block: pass flags to blk_queue_enter()

2017-09-29 Thread Ming Lei
We need to pass PREEMPT flags to blk_queue_enter() for allocating request with RQF_PREEMPT in the following patch. Tested-by: Oleksandr Natalenko Tested-by: Martin Steigerwald Cc: Bart Van Assche Signed-off-by: Ming Lei --- block/blk-core.c | 10 ++ block/blk-mq.c | 5 +

[PATCH v2 13/21] lpfc: Fix oops if nvmet_fc_register_targetport fails

2017-09-29 Thread James Smart
From: Dick Kennedy if nvmet targetport registration fails, the driver encounters a NULL pointer oops in lpfc_hb_timeout_handler. To fix: if registration fails, ensure nvmet_support is cleared on the port structure. Also enhanced the log message on failure. Cc: # 4.12+ Signed-off-by: Dick Kenn

[PATCH v2 12/21] lpfc: Revise NVME module parameter descriptions for better clarity

2017-09-29 Thread James Smart
From: Dick Kennedy The descriptions for lpfc_xri_split and lpfc_enable_fc4_type were poor. Revise for better understanding: lpfc_xri_split - Percentage of FCP XRI resources versus NVME lpfc_enable_fc4_type - Enable FC4 Protocol support - FCP / NVME Signed-off-by: Dick Kennedy Signed-off-by:

[PATCH v2 18/21] lpfc: Extend RDP support

2017-09-29 Thread James Smart
From: Dick Kennedy Support RDP and Multiple Frames If the remote Nport is not logged in, the driver would not populate all the descriptors in the RDP response payload. Doing so would create a payload length that requires multiple frames due to exceeding the default rx buffer size without an expl

[PATCH v2 19/21] lpfc: Fix oops of nvme host during driver unload.

2017-09-29 Thread James Smart
From: Dick Kennedy When running NVME io as a NVME host, if the driver is unloaded there would be oops in lpfc_sli4_issue_wqe. When unloading, controllers are torn down and the transport initiates set_property commands to reset the controller and issues aborts to terminate existing io. The drive

[PATCH v2 11/21] lpfc: Set missing abort context

2017-09-29 Thread James Smart
Always set ctxp->state to LPFC_NVMET_STE_ABORT if ABORT op gets called Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Johannes Thumshirn --- drivers/scsi/lpfc/lpfc_nvmet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpf

[PATCH v2 20/21] lpfc: correct nvme sg segment count check

2017-09-29 Thread James Smart
The internal cfg flag is actually smaller, by 1 (for a partial page sge), than the sg list maintained by the driver. Thus the check on sg segments errored out when it shouldn't have Ensure the check is +1 Note: having a value that is less than what it really is is bogus. Correcting it now would

[PATCH v2 14/21] lpfc: Disable NPIV support if NVME is enabled

2017-09-29 Thread James Smart
From: Dick Kennedy The initial implementation of NVME didn't merge with NPIV support. As such, there are several issues if NPIV is used with NVME. For now, ensure that if NVME is enabled then NPIV is not enabled. Support for NPIV with NVME will be added in the near future. Signed-off-by: Dick K

[PATCH v2 17/21] lpfc: Ensure io aborts interlocked with the target.

2017-09-29 Thread James Smart
From: Dick Kennedy Before releasing nvme io back to the io stack for possible retry on other paths, ensure the io termination is interlocked with the target device by ensuring the entire ABTS-LS protocol is complete. Additionally, FC-NVME ABTS-LS protocol does not use RRQ. Remove RRQ behavior fr

[PATCH v2 08/21] lpfc: Move CQ processing to a soft IRQ

2017-09-29 Thread James Smart
From: Dick Kennedy Under heavy target nvme load duration, the lpfc irq handler is encountering cpu lockup warnings. Convert the driver to a shortened ISR handler which identifies the interrupting condition then schedules a workq thread to process the completion queue the interrupt was for. This

[PATCH v2 21/21] lpfc: change version to 11.4.0.4

2017-09-29 Thread James Smart
From: Dick Kennedy Change version to 11.4.0.4 Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Johannes Thumshirn --- 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/l

[PATCH v2 16/21] lpfc: Fix secure firmware updates

2017-09-29 Thread James Smart
From: Dick Kennedy Firmware update fails with: status x17 add_status x56 on the final write If multiple DMA buffers are used for the download, some firmware revs have difficulty with signatures and crcs split across the dma buffer boundaries. Resolve by making all writes be a single 4k page in

[PATCH v2 04/21] lpfc: Fix lpfc nvme host rejecting IO with Not Ready message

2017-09-29 Thread James Smart
From: Dick Kennedy In a link bounce scenario, a condition can occur where the discovery engine swaps an ndlp structure (address changbe for an nport). While the swap was successfully executed by the discovery engine, the driver did not properly detect a change in the ndlp bound to the nvme rport.

[PATCH v2 10/21] lpfc: Reduce log spew on controller reconnects

2017-09-29 Thread James Smart
There are several log messages that report abnormal terminations that by default are marked warn. These are typically the result of failures due to invalid controller state or abort completions. They are all natural when a controller resets. Unfortunately, as they are logged by default, it makes t

[PATCH v2 05/21] lpfc: Fix warning messages when NVME_TARGET_FC not defined

2017-09-29 Thread James Smart
From: Dick Kennedy Warning messages when NVME_TARGET_FC not defined on ppc builds The lpfc_nvmet_replenish_context() function is only meaningful when NVME target mode enabled. Surround the function body with ifdefs for target mode enablement. Signed-off-by: Dick Kennedy Signed-off-by: James Sm

[PATCH v2 02/21] lpfc: fix pci hot plug crash in list_add call

2017-09-29 Thread James Smart
From: Dick Kennedy During pci hot plug, the kernel crashes in a list_add_call The lookup by tag function will return null if the IOCB is out of range or does not have the on txcmplq flag set. Fix: Check for null return from lookup by tag. Cc: # 4.12+ Signed-off-by: Dick Kennedy Signed-off-by

[PATCH v2 09/21] lpfc: Fix FCP hba_wqidx assignment

2017-09-29 Thread James Smart
From: Dick Kennedy The driver is encountering oops in lpfc_sli_calc_ring. The driver is setting hba_wqidx for FCP based on the policy in use for NVME. The two may not be the same. Change to set the wqidx based on the FCP policy. Cc: # 4.12+ Signed-off-by: Dick Kennedy Signed-off-by: James Sm

[PATCH v2 06/21] lpfc: PLOGI failures during NPIV testing

2017-09-29 Thread James Smart
From: Dick Kennedy Local Reject/Invalid RPI errors seen during discovery. Temporary RPI cleanup was occurring regardless of SLI rev. It's only necessary on SLI-4. Adjust the test for whether cleanup is necessary. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Johannes Th

[PATCH v2 15/21] lpfc: Fix crash in lpfc_nvme_fcp_io_submit during LIP

2017-09-29 Thread James Smart
From: Dick Kennedy The driver is seeing a NULL pointer in lpfc_nvme_fcp_io_submit. This was ultimately due to a transport AER being sent on a terminated controller, thus some of the values were not set. In case we're in a system without a corrected transport and in case a race condition occurs wh

[PATCH v2 01/21] lpfc: fix pci hot plug crash in timer management routines

2017-09-29 Thread James Smart
From: Dick Kennedy During pci hot plug, the kernel crashes in timer management code. The sli4 remove_one handler is not stoping the timers as it starts to remove the port so that it can be swapped. Fix: Stop the timers early in the handler routine. Note: Fix in SLI-4 only. SLI-3 already stoppe

[PATCH v2 00/21] lpfc updates for 11.4.0.4

2017-09-29 Thread James Smart
This patch set provides a number of bug fixes and additions to the driver. The patches were cut against the Martin's 4.14/scsi-queue tree. There are no outside dependencies. v2: Split patch 1 into separate patches Added stable cc's where requested "Fix oops of nvme host during driver unload

[PATCH v2 03/21] lpfc: Fix crash receiving ELS while detaching driver

2017-09-29 Thread James Smart
From: Dick Kennedy The driver crashes when attempting to use a freed ndpl pointer. The pci_remove_one handler runs on a separate kernel thread. The order of the removal is starting by freeing all of the ndlps and then disabling interrupts. In between these two events the driver can still receive

[PATCH v2 07/21] lpfc: Make ktime sampling more accurate

2017-09-29 Thread James Smart
From: Dick Kennedy Need to make ktime samples more accurate If ktime is turned on in the middle of an IO, the max calculation could be misleading. Base sampling on the start time of the IO as opposed to ktime_on. Make ISR ktime timestamps be from when CQE is read instead of EQE. Added additiona

Re: [Patch v2 1/2] libiscsi: Fix use-after-free race during iscsi_session_teardown

2017-09-29 Thread Khazhismel Kumykov
Noticed these don't seem to be in 4.14/scsi-queue On Tue, Aug 29, 2017 at 6:45 PM, Martin K. Petersen wrote: > > Chris, > >> Looks good to me, fixes up the code given that the comment there about >> calling iscsi_remove_session wasn't being followed. > > Applied these two to 4.14/scsi-queue. > >

Re: [PATCH V6 0/6] block/scsi: safe SCSI quiescing

2017-09-29 Thread Martin Steigerwald
Ming Lei - 27.09.17, 16:27: > On Wed, Sep 27, 2017 at 09:57:37AM +0200, Martin Steigerwald wrote: > > Hi Ming. > > > > Ming Lei - 27.09.17, 13:48: > > > Hi, > > > > > > The current SCSI quiesce isn't safe and easy to trigger I/O deadlock. > > > > > > Once SCSI device is put into QUIESCE, no new

Re: [PATCH] scsi: sd: Implement blacklist option for WRITE SAME w/ UNMAP

2017-09-29 Thread Laurence Oberman
On Fri, 2017-09-29 at 09:21 -0400, Martin K. Petersen wrote: > Laurence, > > > I am testing this but its not being picked up so I want to know if > > I > > have the kernel command line wrong here. > > > > scsi_dev_flags=LIO-ORG:thin2:0x8000 > > > > What am I doing wrong to pass the BLIST fla

RE: [PATCH] scsi: sd: Do not override max_sectors_kb sysfs setting

2017-09-29 Thread Don Brace
> -Original Message- > From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi- > ow...@vger.kernel.org] On Behalf Of Martin K. Petersen > Sent: Wednesday, September 27, 2017 8:39 PM > To: linux-scsi@vger.kernel.org > Cc: Martin K. Petersen > Subject: [PATCH] scsi: sd: Do not override ma

Re: [PATCH] scsi: fix the issue that iscsi_if_rx doesn't parse nlmsg properly

2017-09-29 Thread Ewan D. Milne
On Mon, 2017-09-25 at 15:28 -0400, Martin K. Petersen wrote: > Xin, > > > ChunYu found a kernel crash by syzkaller: > > [...] > > > It's caused by skb_shared_info at the end of sk_buff was overwritten by > > ISCSI_KEVENT_IF_ERROR when parsing nlmsg info from skb in iscsi_if_rx. > > > > During th

Re: [PATCH] scsi: sd: Implement blacklist option for WRITE SAME w/ UNMAP

2017-09-29 Thread Martin K. Petersen
Laurence, > I am testing this but its not being picked up so I want to know if I > have the kernel command line wrong here. > > scsi_dev_flags=LIO-ORG:thin2:0x8000 > > What am I doing wrong to pass the BLIST flags. This worked for me: [root@kvm ~]# echo "Linux:scsi_debug:0x8000" > /proc

Re: [PATCH] scsi: sd: Do not override max_sectors_kb sysfs setting

2017-09-29 Thread Martin Wilck
On Wed, 2017-09-27 at 21:38 -0400, Martin K. Petersen wrote: > A user may lower the max_sectors_kb setting in sysfs to accommodate > certain workloads. Previously we would always set the max I/O size to > either the block layer default or the optional preferred I/O size > reported by the device. >

Re: [PATCH 3/3] smartpqi: update driver version to 1.1.2-126

2017-09-29 Thread Tomas Henzl
On 27.9.2017 23:30, Don Brace wrote: > Reviewed-by: Gerry Morong > Reviewed-by: Scott Benesh > Reviewed-by: Scott Teel > Signed-off-by: Kevin Barnett > Signed-off-by: Don Brace Reviewed-by: Tomas Henzl

Re: [PATCH 2/3] smartpqi: cleanup raid map warning message

2017-09-29 Thread Tomas Henzl
On 27.9.2017 23:30, Don Brace wrote: > From: Kevin Barnett > > Fix a small cosmetic bug in a very rarely encountered > error message that can occur when a LD has a corrupted > raid map. > > Reviewed-by: Scott Benesh > Signed-off-by: Kevin Barnett > Signed-off-by: Don Brace Reviewed-by: Tomas H

Re: [PATCH 1/3] smartpqi: update controller ids

2017-09-29 Thread Tomas Henzl
On 27.9.2017 23:29, Don Brace wrote: > From: Kevin Barnett > > Update the driver’s PCI IDs > > Reviewed-by: Scott Benesh > Reviewed-by: Scott Teel > Signed-off-by: Kevin Barnett > Signed-off-by: Don Brace Reviewed-by: Tomas Henzl

Re: [PATCH] scsi: sd: Implement blacklist option for WRITE SAME w/ UNMAP

2017-09-29 Thread Laurence Oberman
On Wed, 2017-09-27 at 21:35 -0400, Martin K. Petersen wrote: > SBC-4 states: > >   "A MAXIMUM UNMAP LBA COUNT field set to a non-zero value indicates > the >    maximum number of LBAs that may be unmapped by an UNMAP command" > >   "A MAXIMUM WRITE SAME LENGTH field set to a non-zero value > indi