Re: [PATCH 5/6] libata: Honor RQF_QUIET flag

2018-03-01 Thread Hannes Reinecke
On 03/01/2018 08:40 PM, Damien Le Moal wrote: > Currently, libata ignores requests RQF_QUIET flag and print error > messages for failed commands, regardless if this flag is set in the > command request. Fix this by introducing the ata_eh_quiet() function and > using this function in

Re: [PATCH 6/6] libata: Be quiet when asked to

2018-03-01 Thread Hannes Reinecke
On 03/01/2018 08:40 PM, Damien Le Moal wrote: > For a successful setting of the device transfer speed mode in > ata_dev_set_mode(), do not print the message > "ataX.XX: configured for xxx" if the EH context has the quiet flag set. > > Signed-off-by: Damien Le Moal > --- >

Re: [PATCH 4/6] libata: Fix ata_err_string()

2018-03-01 Thread Hannes Reinecke
On 03/01/2018 08:40 PM, Damien Le Moal wrote: > Add proper error string output for ATA_ERR_NCQ and ATA_ERR_NODEV_HINT > instead of returning "unknown error". > > Signed-off-by: Damien Le Moal > --- > drivers/ata/libata-eh.c | 4 > 1 file changed, 4 insertions(+) > >

Re: [PATCH 3/6] libata: Fix comment typo in ata_eh_analyze_tf()

2018-03-01 Thread Hannes Reinecke
On 03/01/2018 08:40 PM, Damien Le Moal wrote: > Signed-off-by: Damien Le Moal > --- > drivers/ata/libata-eh.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c > index 504272b18e75..d6264235c3d7

Re: [PATCH 1/6] scsi: Introduce scsi_zbc_noretry_cmd()

2018-03-01 Thread Hannes Reinecke
On 03/01/2018 08:40 PM, Damien Le Moal wrote: > For ZBC/ZAC devices, retrying a command with a condition known to lead > to a failure is useless. One example is an unaligned write past the > write pointer of a sequential zone. Retrying the same command will > result in an error again. > >

Re: [PATCH 2/6] libata: Use scsi_zbc_noretry_cmd() for ZAC devices

2018-03-01 Thread Hannes Reinecke
On 03/01/2018 08:40 PM, Damien Le Moal wrote: > Improve decisions regarding command retry worthiness by calling > the funtion scsi_zbc_noretry_cmd() in ata_eh_worth_retry() if the > command target is a ZAC device. > > Signed-off-by: Damien Le Moal > --- >

Re: [PATCH] scsi_lib: increase {host|target|device}_busy count after dispatch cmd

2018-03-01 Thread Bart Van Assche
On Fri, 2018-03-02 at 12:56 +0800, Ganesh Mahendran wrote: > 2018-03-02 7:11 GMT+08:00 Bart Van Assche : > > On Mon, 2017-06-05 at 17:37 +0800, Ganesh Mahendran wrote: > > > In android system, when there are lots of threads running. Thread A > > > holding *host_busy* count

Re: [PATCH] scsi_lib: increase {host|target|device}_busy count after dispatch cmd

2018-03-01 Thread Ganesh Mahendran
Hi, Bart: 2018-03-02 7:11 GMT+08:00 Bart Van Assche : > On Mon, 2017-06-05 at 17:37 +0800, Ganesh Mahendran wrote: >> In android system, when there are lots of threads running. Thread A >> holding *host_busy* count is easily to be preempted, and if at the >> same time,

[PATCH V3] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread Jianchao Wang
In scsi core, __scsi_queue_insert should just put request back on the queue and retry using the same command as before. However, for blk-mq, scsi_mq_requeue_cmd is employed here which will unprepare the request. To align with the semantics of __scsi_queue_insert, use blk_mq_requeue_request with

Re: [PATCH] scsi:Documentation: add sd-parameters.txt

2018-03-01 Thread Martin K. Petersen
Weiping, > this document include SCSI disk and SCSI device parameters, add > cache_type firstly, other parameters will be added later. Applied to 4.17/scsi-queue with a few tweaks. Thank you! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread jianchao.wang
Hi martin On 03/02/2018 09:44 AM, Martin K. Petersen wrote: >> In scsi core, __scsi_queue_insert should just put request back on the >> queue and retry using the same command as before. However, for blk-mq, >> scsi_mq_requeue_cmd is employed here which will unprepare the >> request. To align with

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread jianchao.wang
Hi martin Thanks for your kindly response. On 03/02/2018 09:43 AM, Martin K. Petersen wrote: > > Jianchao, > >> Yes, the block layer core guarantees that scsi_mq_get_budget() will be >> called before scsi_queue_rq(). I think the full picture is as follows: > >> * Before scsi_queue_rq() calls

Re: [PATCH V3 1/8] scsi: hpsa: fix selection of reply queue

2018-03-01 Thread Ming Lei
On Thu, Mar 01, 2018 at 04:19:34PM -0500, Laurence Oberman wrote: > On Thu, 2018-03-01 at 14:01 -0500, Laurence Oberman wrote: > > On Thu, 2018-03-01 at 16:18 +, Don Brace wrote: > > > > -Original Message- > > > > From: Ming Lei [mailto:ming@redhat.com] > > > > Sent: Tuesday,

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread jianchao.wang
Hi Bart Thanks for your precious time and detailed summary. On 03/02/2018 01:43 AM, Bart Van Assche wrote: > Yes, the block layer core guarantees that scsi_mq_get_budget() will be called > before scsi_queue_rq(). I think the full picture is as follows: > * Before scsi_queue_rq() calls

Re: [patch RESEND] atp870u: 64 bit bug in atp885_init()

2018-03-01 Thread Martin K. Petersen
Dan, > On 64 bit CPUs there is a memory corruption bug on probe(). It should > be a u32 pointer instead of an unsigned long pointer or we write past > the end of the setupdata[] array. Applied to 4.17/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] mvsas: fix wrong endianness of sgpio api

2018-03-01 Thread Martin K. Petersen
Wilfried, > This patch fixes the byte order of the SGPIO api and brings it back in > sync with ledmon v0.80 and above. The patch was missing your Signed-off-by: tag. I added it and applied patch to 4.17/scsi-queue. -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] sd_zbc: Fix sd_zbc_get_seq_zones() kernel-doc header

2018-03-01 Thread Martin K. Petersen
Bart, > Avoid that the kernel-doc tool complains about a mismatch between > the kernel-doc header and the function argument list. Applied to 4.17/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] ufs: Fix kernel-doc errors and warnings

2018-03-01 Thread Martin K. Petersen
Bart, > Avoid that the kernel-doc tool complains about mismatches between > kernel-doc headers and function definitions. Avoid that errors like > the following are reported when building the UFS driver with W=1: > > drivers/scsi/ufs/tc-dwc-g210-pci.c:60: error: Cannot parse struct or union! >

Re: [PATCH] sd_zbc: Fix potential memory leak

2018-03-01 Thread Martin K. Petersen
Damien, > Rework sd_zbc_check_zone_size() to avoid a memory leak due to an early > return if sd_zbc_report_zones() fails. Applied to 4.16/scsi-fixes. Thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] scsi: sd: Keep disk read-only when re-reading partition

2018-03-01 Thread Martin K. Petersen
Jeremy, Thanks for looking into this! > This commit reads the disk's old state and combines it with the device > disk-reported state rather than unconditionally marking it as RW. Applied to 4.16/scsi-fixes with a few minor tweaks. Thank you! -- Martin K. Petersen Oracle Linux

Re: [PATCH] scsi: mpt3sas: clarify mmio pointer types

2018-03-01 Thread Martin K. Petersen
Broadcom folks: Please review! > The newly added code mixes up phys_addr_t/resource_size_t with dma_addr_t > and void pointers, as seen from these compiler warning: > > drivers/scsi/mpt3sas/mpt3sas_base.c: In function '_base_get_chain_phys': > drivers/scsi/mpt3sas/mpt3sas_base.c:235:21: error:

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread Martin K. Petersen
Jianchao, > Yes, the block layer core guarantees that scsi_mq_get_budget() will be > called before scsi_queue_rq(). I think the full picture is as follows: > * Before scsi_queue_rq() calls .queuecommand(), get_device() is called for the > SCSI device and the device, target and host busy

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread Martin K. Petersen
Jianchao, > In scsi core, __scsi_queue_insert should just put request back on the > queue and retry using the same command as before. However, for blk-mq, > scsi_mq_requeue_cmd is employed here which will unprepare the > request. To align with the semantics of __scsi_queue_insert, use >

Re: [PATCH] mpt3sas: Do not mark fw_event workqueue as WQ_MEM_RECLAIM

2018-03-01 Thread Martin K. Petersen
Hannes, > The firmware event workqueue should not be marked as WQ_MEM_RECLAIM as > it's doesn't need to make forward progress under memory pressure. In > the current state it will result in a deadlock if the device had been > forcefully removed. Applied to 4.16/scsi-fixes. Thanks! -- Martin

Re: [PATCH] qla2xxx: Fix NULL pointer crash due to active timer for ABTS

2018-03-01 Thread Martin K. Petersen
James, >> Cc: #4.4+ Ugh. > Martin, can you fix this up with a rebase and I'll resync my tree? Done and pushed. -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH V3 1/8] scsi: hpsa: fix selection of reply queue

2018-03-01 Thread Ming Lei
Hi Don, Thanks for your test! On Thu, Mar 01, 2018 at 04:18:17PM +, Don Brace wrote: > > -Original Message- > > From: Ming Lei [mailto:ming@redhat.com] > > Sent: Tuesday, February 27, 2018 4:08 AM > > To: Jens Axboe ; linux-bl...@vger.kernel.org; Christoph > >

Re: [bug report] Don't enter SCSI error handler on kernel 4.16-rc1

2018-03-01 Thread Bart Van Assche
On Wed, 2018-02-28 at 14:17 +0800, chenxiang (M) wrote: > It seems the patch is for block mq, but the issue i encount is under > block legacy as CONFIG_SCSI_MQ_DEFAULT is not enabled. Since the call traces refer to the ATA code I hope that an ATA expert will have the time to help you further.

Re: [PATCH] scsi_lib: increase {host|target|device}_busy count after dispatch cmd

2018-03-01 Thread Bart Van Assche
On Mon, 2017-06-05 at 17:37 +0800, Ganesh Mahendran wrote: > In android system, when there are lots of threads running. Thread A > holding *host_busy* count is easily to be preempted, and if at the > same time, thread B set *host_blocked*, then all other threads will > be io blocked. Hello

[PATCH] sd_zbc: Fix sd_zbc_get_seq_zones() kernel-doc header

2018-03-01 Thread Bart Van Assche
Avoid that the kernel-doc tool complains about a mismatch between the kernel-doc header and the function argument list. Signed-off-by: Bart Van Assche Cc: Damien Le Moal Cc: Hannes Reinecke --- drivers/scsi/sd_zbc.c | 3 ++- 1 file

[PATCH] ufs: Fix kernel-doc errors and warnings

2018-03-01 Thread Bart Van Assche
Avoid that the kernel-doc tool complains about mismatches between kernel-doc headers and function definitions. Avoid that errors like the following are reported when building the UFS driver with W=1: drivers/scsi/ufs/tc-dwc-g210-pci.c:60: error: Cannot parse struct or union!

Re: [PATCH] sd_zbc: Fix potential memory leak

2018-03-01 Thread Bart Van Assche
On 03/01/18 14:19, Damien Le Moal wrote: Rework sd_zbc_check_zone_size() to avoid a memory leak due to an early return if sd_zbc_report_zones() fails. Reviewed-by: Bart Van Assche

[PATCH] sd_zbc: Fix potential memory leak

2018-03-01 Thread Damien Le Moal
Rework sd_zbc_check_zone_size() to avoid a memory leak due to an early return if sd_zbc_report_zones() fails. Reported-by: David.butterfield Signed-off-by: Damien Le Moal Cc: sta...@vger.kernel.org --- drivers/scsi/sd_zbc.c | 35

Re: [PATCH] scsi: ata: don't reset three times if device is offline for SAS host

2018-03-01 Thread Tejun Heo
Hello, On Wed, Feb 28, 2018 at 03:18:39PM +0800, chenxiang (M) wrote: > If we can introduce a port flags such as ATA_LFLAG_DISABLED or > ATA_EHI_NO_RECOVERY before ata_eh_recover, > it will skip recovery. But we only get device status NODEV from > ata_do_reset which is after ata_eh_recover, i

Re: [PATCH v2] ata: do not schedule hot plug if it is a sas host

2018-03-01 Thread Tejun Heo
On Wed, Feb 28, 2018 at 09:11:10AM +0800, Jason Yan wrote: > We've got a kernel panic when using sata disk with sas controller: > > [115946.152283] Unable to handle kernel NULL pointer dereference at virtual > address 07d8 > [115946.223963] CPU: 0 PID: 22175 Comm: kworker/0:1 Tainted: G W

Re: [PATCH V3 0/8] blk-mq & scsi: fix reply queue selection and improve host wide tagset

2018-03-01 Thread Laurence Oberman
On Tue, 2018-02-27 at 18:07 +0800, Ming Lei wrote: > Hi All, > > The 1st two patches fixes reply queue selection, and this issue has > been > reported and can cause IO hang during booting, please consider the > two > for V4.16. > > The following 6 patches try to improve hostwide tagset on hpsa

Re: [PATCH 1/8] dt-bindings: scsi: hisi_sas: add an property of signal attenuation

2018-03-01 Thread Rob Herring
On Tue, Feb 20, 2018 at 03:13:24AM +0800, John Garry wrote: > From: Xiaofei Tan > > For some new boards with hip07 chipset we are required to > set PHY config registers differently. The hw property which > determines how to set these registers is in the PHY signal >

Re: [PATCH V3 1/8] scsi: hpsa: fix selection of reply queue

2018-03-01 Thread Laurence Oberman
On Thu, 2018-03-01 at 14:01 -0500, Laurence Oberman wrote: > On Thu, 2018-03-01 at 16:18 +, Don Brace wrote: > > > -Original Message- > > > From: Ming Lei [mailto:ming@redhat.com] > > > Sent: Tuesday, February 27, 2018 4:08 AM > > > To: Jens Axboe ;

[PATCH 2/6] libata: Use scsi_zbc_noretry_cmd() for ZAC devices

2018-03-01 Thread Damien Le Moal
Improve decisions regarding command retry worthiness by calling the funtion scsi_zbc_noretry_cmd() in ata_eh_worth_retry() if the command target is a ZAC device. Signed-off-by: Damien Le Moal --- drivers/ata/libata-eh.c | 4 1 file changed, 4 insertions(+) diff

[PATCH 1/6] scsi: Introduce scsi_zbc_noretry_cmd()

2018-03-01 Thread Damien Le Moal
For ZBC/ZAC devices, retrying a command with a condition known to lead to a failure is useless. One example is an unaligned write past the write pointer of a sequential zone. Retrying the same command will result in an error again. Currently, these iknown error condition cases are handled in

[PATCH 4/6] libata: Fix ata_err_string()

2018-03-01 Thread Damien Le Moal
Add proper error string output for ATA_ERR_NCQ and ATA_ERR_NODEV_HINT instead of returning "unknown error". Signed-off-by: Damien Le Moal --- drivers/ata/libata-eh.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c

[PATCH 3/6] libata: Fix comment typo in ata_eh_analyze_tf()

2018-03-01 Thread Damien Le Moal
Signed-off-by: Damien Le Moal --- drivers/ata/libata-eh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 504272b18e75..d6264235c3d7 100644 --- a/drivers/ata/libata-eh.c +++

[PATCH 6/6] libata: Be quiet when asked to

2018-03-01 Thread Damien Le Moal
For a successful setting of the device transfer speed mode in ata_dev_set_mode(), do not print the message "ataX.XX: configured for xxx" if the EH context has the quiet flag set. Signed-off-by: Damien Le Moal --- drivers/ata/libata-core.c | 7 --- 1 file changed, 4

[PATCH 5/6] libata: Honor RQF_QUIET flag

2018-03-01 Thread Damien Le Moal
Currently, libata ignores requests RQF_QUIET flag and print error messages for failed commands, regardless if this flag is set in the command request. Fix this by introducing the ata_eh_quiet() function and using this function in ata_eh_link_autopsy() to determine if the EH context should be

[PATCH] Improve ZBC/ZAC error handling

2018-03-01 Thread Damien Le Moal
This series introduces changes to scsi and libata error handling for ZBC and ZAC devices. The first patch moves ZBC specific error handling in sd_zbc_complete() to a generic scsi error function that can be used also in libata (second patch). The goal of this change is to limit retries for

Re: [PATCH] qla2xxx: Fix NULL pointer crash due to active timer for ABTS

2018-03-01 Thread James Bottomley
On Mon, 2018-02-12 at 10:28 -0800, Himanshu Madhani wrote: [...] > Cc: #4.4+ This is the wrong stable tag, which would lead to stable not picking up the patch automatically.  The correct stable address is Cc: #4.4+                  ^^

Re: [PATCH V3 1/8] scsi: hpsa: fix selection of reply queue

2018-03-01 Thread Laurence Oberman
On Thu, 2018-03-01 at 16:18 +, Don Brace wrote: > > -Original Message- > > From: Ming Lei [mailto:ming@redhat.com] > > Sent: Tuesday, February 27, 2018 4:08 AM > > To: Jens Axboe ; linux-bl...@vger.kernel.org; > > Christoph > > Hellwig ; Mike

Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert

2018-03-01 Thread Bart Van Assche
On Thu, 2018-03-01 at 09:57 +0800, jianchao.wang wrote: > On 03/01/2018 01:52 AM, Bart Van Assche wrote: > > On Wed, 2018-02-28 at 16:55 +0800, Jianchao Wang wrote: > > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > > > index a86df9c..6fa7b0c 100644 > > > ---

RE: [PATCH V3 1/8] scsi: hpsa: fix selection of reply queue

2018-03-01 Thread Don Brace
> -Original Message- > From: Ming Lei [mailto:ming@redhat.com] > Sent: Tuesday, February 27, 2018 4:08 AM > To: Jens Axboe ; linux-bl...@vger.kernel.org; Christoph > Hellwig ; Mike Snitzer > Cc: linux-scsi@vger.kernel.org;

Re: [PATCH] scsi: sd: Keep disk read-only when re-reading partition

2018-03-01 Thread Andy Shevchenko
On Thu, Mar 1, 2018 at 4:08 PM, Jeremy Cline wrote: > If the read-only flag is true on a SCSI disk, re-reading the partition > table sets the flag back to false. > > To observe this bug, you can run: > > 1. blockdev --setro /dev/sda > 2. blockdev --rereadpt /dev/sda > 3.

[PATCH] scsi: sd: Keep disk read-only when re-reading partition

2018-03-01 Thread Jeremy Cline
If the read-only flag is true on a SCSI disk, re-reading the partition table sets the flag back to false. To observe this bug, you can run: 1. blockdev --setro /dev/sda 2. blockdev --rereadpt /dev/sda 3. blockdev --getro /dev/sda This commit reads the disk's old state and combines it with the

[PATCH] scsi: mpt3sas: clarify mmio pointer types

2018-03-01 Thread Arnd Bergmann
The newly added code mixes up phys_addr_t/resource_size_t with dma_addr_t and void pointers, as seen from these compiler warning: drivers/scsi/mpt3sas/mpt3sas_base.c: In function '_base_get_chain_phys': drivers/scsi/mpt3sas/mpt3sas_base.c:235:21: error: cast to pointer from integer of different

[PATCH] scsi: ufs: sysfs: reworking of the rpm_lvl and spm_lvl entries

2018-03-01 Thread Stanislav Nijnikov
The functions related to the rpm_lvl and spm_lvl sysfs entries were moved to a separate file as part of UFS device management patchset. During the review phase I was pointed that these entries implementaion could be improved. The each file output was split to three parts: rmp_lvl - rpm_lvl,

[PATCH] scsi: ufs: sysfs: reworking of the rpm_lvl and spm_lvl entries

2018-03-01 Thread Stanislav Nijnikov
Read from these files will return the integed value of the chosen power management level now. Separate entries were added to show the target UFS device and UIC link states. The description of the possible power managements levels was added to the ABI file. The on-write behaviour of these entries