Re: [PATCH] scsi: ioctl reset should wait for IOs to complete

2017-09-26 Thread Hannes Reinecke
On 09/26/2017 08:24 PM, Bart Van Assche wrote: > On Tue, 2017-09-26 at 10:22 -0700, Lee Duncan wrote: >> The SCSI ioctl reset path is smart enough to set the >> flag tmf_in_progress when a user-requested reset is >> processed, but it does not wait for IO that is in >> flight. This can result in los

Re: [PATCH 4/5] scsi/ufs: qcom: Set phy mode based on the controllers HS MODE

2017-09-26 Thread Vivek Gautam
On 09/27/2017 04:14 AM, Subhash Jadavani wrote: On 2017-08-03 23:48, Vivek Gautam wrote: Set the phy mode based on the UFS HS PA mode. This lets the controller let phy know the mode in which the PHY Adapter is running and set the phy rates accordingly. Signed-off-by: Vivek Gautam --- driver

Re: [PATCH 5/5] ufs/phy: qcom: Refactor to use phy_init call

2017-09-26 Thread Vivek Gautam
Hi Subhash, On Wed, Sep 27, 2017 at 4:43 AM, Subhash Jadavani wrote: > Hi Vivek, > > Please find one comment inline below, rest look good. > > Regards, > Subhash > > > On 2017-08-03 23:48, Vivek Gautam wrote: >> >> Refactor ufs_qcom_power_up_sequence() to get rid of ugly >> exported phy APIs and

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

2017-09-26 Thread Hannes Reinecke
On 09/27/2017 07:48 AM, Ming Lei wrote: > 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_

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

2017-09-26 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 V6 5/6] block: support PREEMPT_ONLY

2017-09-26 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 V6 2/6] block: tracking request allocation with q_usage_counter

2017-09-26 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. Signed-off-by: Ming Lei --- block/blk-core.c

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

2017-09-26 Thread Ming Lei
This patch just makes it explicitely. Reviewed-by: Johannes Thumshirn 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-mq.c index 98a18609755e..6fd9f86fc86d 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.

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

2017-09-26 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 V6 3/6] block: pass flags to blk_queue_enter()

2017-09-26 Thread Ming Lei
We need to pass PREEMPT flags to blk_queue_enter() for allocating request with RQF_PREEMPT in the following patch. Signed-off-by: Ming Lei --- block/blk-core.c | 10 ++ block/blk-mq.c | 5 +++-- block/blk-timeout.c| 2 +- fs/block_dev.c | 4 ++-- include/linu

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

2017-09-26 Thread Ming Lei
Hi, 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 dispatched to SCSI successfully, and scsi_device_quiesce() just simply waits for completion of I/Os dispatched to SCSI stack. It isn't enoug

Re: [PATCH] scsi: ufs: add ufs a command complete time stamp

2017-09-26 Thread Zang Leigang
Hi, Subhash I send a new patch, forget tag a "PATCH V2", pls check. On Tue, Sep 26, 2017 at 02:39:06PM -0700, Subhash Jadavani wrote: > On 2017-09-20 03:30, Zang Leigang wrote: > >Signed-off-by: Zang Leigang > > > >diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > >index 794a4

[PATCH] scsi: ufs: add ufs a command complete time stamp

2017-09-26 Thread Zang Leigang
Signed-off-by: Zang Leigang diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 794a460..7e8d583 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -385,6 +385,8 @@ void ufshcd_print_trs(struct ufs_hba *hba, unsigned long bitmap, bool pr_prdt)

Re: [PATCH 5/5] ufs/phy: qcom: Refactor to use phy_init call

2017-09-26 Thread Subhash Jadavani
Hi Vivek, Please find one comment inline below, rest look good. Regards, Subhash On 2017-08-03 23:48, Vivek Gautam wrote: Refactor ufs_qcom_power_up_sequence() to get rid of ugly exported phy APIs and use the phy_init() and phy_power_on() to do the phy initialization. Signed-off-by: Vivek Gau

Re: [PATCH 4/5] scsi/ufs: qcom: Set phy mode based on the controllers HS MODE

2017-09-26 Thread Subhash Jadavani
On 2017-08-03 23:48, Vivek Gautam wrote: Set the phy mode based on the UFS HS PA mode. This lets the controller let phy know the mode in which the PHY Adapter is running and set the phy rates accordingly. Signed-off-by: Vivek Gautam --- drivers/scsi/ufs/ufs-qcom.c | 3 +++ 1 file changed, 3 in

Re: [PATCH] scsi: libsas: remove unused variable sas_ha

2017-09-26 Thread John Garry
On 26/09/2017 20:17, Colin King wrote: From: Colin Ian King Remove unused variable sas_ha to clean up build warning "unused variable ‘sas_ha’ [-Wunused-variable]" Fixes: 042ebd293b86 ("scsi: libsas: kill useless ha_event and do some cleanup") Signed-off-by: Colin Ian King Acked-by: John Gar

Re: UFS maximum access unit is 8KB

2017-09-26 Thread Subhash Jadavani
On 2017-08-09 00:28, Bean Huo (beanhuo) wrote: Hi, I am now using one hikey960, and Linux kernel version is 4.4.77. And found that for UFS driver version, the maximum transformation is 8KB. Means that if I using 128KB chuck size to program in the user space, but, from ftrace/blktrace, It shows

Re: [PATCH] scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1

2017-09-26 Thread Subhash Jadavani
On 2017-09-06 02:58, kehuanlin wrote: Since the command type of UTRD in UFS 2.1 specification is the same with UFS 2.0. And it assumes the future UFS specification will follow the same definition. Signed-off-by: kehuanlin --- drivers/scsi/ufs/ufshcd.c | 14 -- 1 file changed, 8 i

Re: [PATCH] scsi: ufs: fix a pclint warning

2017-09-26 Thread Subhash Jadavani
On 2017-09-19 01:50, Zang Leigang wrote: Signed-off-by: Zang Leigang diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 794a4600e952..deb77535b8c9 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -3586,7 +3586,7 @@ static int ufshcd_uic_pwr_ctrl(st

Re: [PATCH] scsi: ufs: add ufs a command complete time stamp

2017-09-26 Thread Subhash Jadavani
On 2017-09-20 03:30, Zang Leigang wrote: Signed-off-by: Zang Leigang diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 794a4600e952..2984f33095be 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -385,6 +385,8 @@ void ufshcd_print_trs(struct ufs_hb

Re: qla2xxx UBSAN warning in 4.14-rc1

2017-09-26 Thread Madhani, Himanshu
> On Sep 18, 2017, at 3:49 AM, Meelis Roos wrote: > > Hello, I decided to widen the coverage of my kernel testbed and put some > FC cards into servers. This one is a PCI-X QLA2340 in HP Proliant DL 380 > G4 (first 64-bit generation of Proliants). I got a UBSAN warning from > qla2xxx before pr

Re: [PATCH] scsi: ufs: continue to boot even with Boot LUN is disabled

2017-09-26 Thread Subhash Jadavani
On 2017-09-22 03:31, Huanlin Ke wrote: Several configurable fields of the Device Descriptor and the Unit Descriptors determine the Boot LUN status. The bBootEnable field and the bBootLunEn attribute is set to zero by default, so the Boot LUN is disabled by default. At which point the scsi device

[PATCH] scsi: libsas: remove unused variable sas_ha

2017-09-26 Thread Colin King
From: Colin Ian King Remove unused variable sas_ha to clean up build warning "unused variable ‘sas_ha’ [-Wunused-variable]" Fixes: 042ebd293b86 ("scsi: libsas: kill useless ha_event and do some cleanup") Signed-off-by: Colin Ian King --- drivers/scsi/hisi_sas/hisi_sas_main.c | 1 - 1 file chan

Re: [PATCH] scsi: ioctl reset should wait for IOs to complete

2017-09-26 Thread James Bottomley
On Tue, 2017-09-26 at 10:22 -0700, Lee Duncan wrote: > The SCSI ioctl reset path is smart enough to set the > flag tmf_in_progress when a user-requested reset is > processed, but it does not wait for IO that is in > flight. This can result in lost IOs and hung > processes. We should wait for a reas

Re: [PATCH] scsi: ioctl reset should wait for IOs to complete

2017-09-26 Thread Bart Van Assche
On Tue, 2017-09-26 at 10:22 -0700, Lee Duncan wrote: > The SCSI ioctl reset path is smart enough to set the > flag tmf_in_progress when a user-requested reset is > processed, but it does not wait for IO that is in > flight. This can result in lost IOs and hung > processes. We should wait for a reas

Hello

2017-09-26 Thread Mr Neil Trotter
A Donation Of 1 Million British Pounds To You In Good Faith

[PATCH] scsi: ioctl reset should wait for IOs to complete

2017-09-26 Thread Lee Duncan
The SCSI ioctl reset path is smart enough to set the flag tmf_in_progress when a user-requested reset is processed, but it does not wait for IO that is in flight. This can result in lost IOs and hung processes. We should wait for a reasonable amount of time for either the IOs to complete or to fail

Re: [PATCHv5 2/5] scsi: Export blacklist flags to sysfs

2017-09-26 Thread Bart Van Assche
On Fri, 2017-09-22 at 08:04 +0200, Hannes Reinecke wrote: > +static ssize_t > +sdev_show_blacklist(struct device *dev, struct device_attribute *attr, > + char *buf) > +{ Please make this function accept the output buffer size as fourth argument. > + if (len) > +

Re: [PATCH v2 1/1] scsi: fc: check for rport presence in fc_block_scsi_eh

2017-09-26 Thread Steffen Maier
On 09/26/2017 08:58 AM, Johannes Thumshirn wrote: Coverity-scan recently found a possible NULL pointer dereference in fc_block_scsi_eh() as starget_to_rport() either returns the rport for the startget or NULL. While it is rather unlikely to have fc_block_scsi_eh() called without an rport associa

Re: [PATCH v2 1/1] scsi: fc: check for rport presence in fc_block_scsi_eh

2017-09-26 Thread Hannes Reinecke
On 09/26/2017 08:58 AM, Johannes Thumshirn wrote: > Coverity-scan recently found a possible NULL pointer dereference in > fc_block_scsi_eh() as starget_to_rport() either returns the rport for > the startget or NULL. > > While it is rather unlikely to have fc_block_scsi_eh() called without > an rpo