Re: [PATCH 2/2] Avoid that SCSI device removal through sysfs triggers a deadlock

2018-08-01 Thread Tejun Heo
at attribute because widely used user space software depends on it, > namely the rescan-scsi-bus.sh script. Hence this patch that avoids > that writing into that attribute triggers a deadlock. See also commit > 7973cbd9fbd9 ("[PATCH] add sysfs attributes to scan and delete > scsi_de

Re: [PATCH 1/2] sysfs: Introduce sysfs_{un,}break_active_protection()

2018-08-01 Thread Tejun Heo
On Mon, Jul 30, 2018 at 11:40:51AM -0700, Bart Van Assche wrote: > Introduce these two functions and export them such that the next patch > can add calls to these functions from the SCSI core. > > Signed-off-by: Bart Van Assche > Cc: Greg Kroah-Hartman > Cc: Tejun Heo >

Re: [PATCH, RESEND] Avoid that SCSI device removal through sysfs triggers a deadlock

2018-07-26 Thread Tejun Heo
Hello, ISTR giving the same feedback before. On Wed, Jul 25, 2018 at 10:38:28AM -0700, Bart Van Assche wrote: > +struct remove_dev_work { > + struct callback_headhead; > + struct scsi_device *sdev; > +}; > + > +static void delete_sdev(struct callback_head *head) > +{ > +

Re: [PATCH V2 0/2] ZBC_OUT command translation fixes

2018-07-02 Thread Tejun Heo
On Tue, Jun 26, 2018 at 08:56:53PM +0900, Damien Le Moal wrote: > Tejun, > > These two patches fix problems with the checks of the ZBC_OUT command fields > prior to its translation to ZAC MANAGEMENT OUT. > > The first patch fixes an incorrect out-of-range check and changes the returned >

Re: [PATCH 15/25] workqueue,zfcp: set description for port work items with their WWPN as context

2018-05-18 Thread Tejun Heo
gt; WARN, BUG, panic, or magic-sysrq [show-task-states(t)]. Acked-by: Tejun Heo <t...@kernel.org> Thanks. -- tejun

Re: [PATCH-next] scsi: libsas: dynamically allocate and free ata host

2018-05-10 Thread Tejun Heo
good to me. Acked-by: Tejun Heo <t...@kernel.org> Thanks. -- tejun

Re: [PATCH] scsi: libsas: add transport class for ATA devices

2018-03-26 Thread Tejun Heo
; No functional change of the device scanning and io path. The ata > transport class was deleted when destroying the sas devices. > > Signed-off-by: Jason Yan <yanai...@huawei.com> > CC: Dan Williams <dan.j.willi...@intel.com> > CC: Tejun Heo <t...@kernel.org> Looks good to me on the ata side. Acked-by: Tejun Heo <t...@kernel.org> Thanks. -- tejun

Re: [PATCH] Change synchronize_rcu() in scsi_device_quiesce() into synchronize_sched()

2018-03-19 Thread Tejun Heo
On Fri, Mar 16, 2018 at 10:35:16AM -0700, Bart Van Assche wrote: > Since blk_queue_enter() uses rcu_read_lock_sched() scsi_device_quiesce() > must use synchronize_sched(). Is there a reason to use sched-RCU here instead of the regular one? If not, it'd be better to switch to regular RCU than the

Re: [PATCH] Improve ZBC/ZAC error handling

2018-03-04 Thread Tejun Heo
On Fri, Mar 02, 2018 at 04:40:18AM +0900, Damien Le Moal wrote: > 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

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

2018-03-04 Thread Tejun Heo
Hello, On Fri, Mar 02, 2018 at 04:40:24AM +0900, 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] 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] ata: do not schedule hot plug if it is a sas host

2018-02-27 Thread Tejun Heo
On Tue, Feb 27, 2018 at 03:08:01PM +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

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

2018-02-27 Thread Tejun Heo
Hello, On Mon, Feb 26, 2018 at 07:45:37PM +0800, chenxiang (M) wrote: > >So, if there are real consequences, we can definitely add a way to > >short-circuit the recovery logic but let's do that by adding proper > >signaling rathr than testing for driver type. > > I am not familiar with ata

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

2018-02-13 Thread Tejun Heo
Hello, On Tue, Feb 13, 2018 at 09:44:53AM +0800, chenxiang (M) wrote: > For those drivers using libsas, i think they have the same issue. > It takes about 1 minute to > recover but actually device is gone, so this recover is useless for > this scenario (when enter EH, > all normal IOs are

Re: [PATCH] libata: don't try to pass through NCQ commands to non-NCQ devices

2018-02-12 Thread Tejun Heo
On Sat, Feb 03, 2018 at 08:33:51PM -0800, Eric Biggers wrote: > From: Eric Biggers > > syzkaller hit a WARN() in ata_bmdma_qc_issue() when writing to /dev/sg0. > This happened because it issued an ATA pass-through command (ATA_16) > where the protocol field indicated that

Re: [PATCH] libata: remove WARN() for DMA or PIO command without data

2018-02-12 Thread Tejun Heo
On Sat, Feb 03, 2018 at 08:33:27PM -0800, Eric Biggers wrote: > From: Eric Biggers > > syzkaller hit a WARN() in ata_qc_issue() when writing to /dev/sg0. This > happened because it issued a READ_6 command with no data buffer. > > Just remove the WARN(), as it doesn't

Re: [PATCH] libata: fix length validation of ATAPI-relayed SCSI commands

2018-02-12 Thread Tejun Heo
On Sat, Feb 03, 2018 at 08:30:56PM -0800, Eric Biggers wrote: > From: Eric Biggers > > syzkaller reported a crash in ata_bmdma_fill_sg() when writing to > /dev/sg1. The immediate cause was that the ATA command's scatterlist > was not DMA-mapped, which causes 'pi - 1' to

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

2018-02-12 Thread Tejun Heo
Hello, On Wed, Jan 24, 2018 at 09:20:25PM +0800, chenxiang wrote: > In ata_eh_reset, it will reset three times at most for sata disk. For > some drivers through libsas, it calls sas_ata_hard_reset at last. When > device is gone, function sas_ata_hard_reset will return -ENODEV. But > it will still

Re: [PATCH 1/2] ata: enhance the definition of SET MAX feature field value

2018-01-08 Thread Tejun Heo
On Mon, Jan 08, 2018 at 10:16:55PM -0500, Martin K. Petersen wrote: > > Tejun, > > Are you OK with me pulling this change through the SCSI tree? Sure, yeah, please go ahead. Thanks. -- tejun

Re: [ata_scsi_offline_dev] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:238

2017-11-06 Thread Tejun Heo
Hello, On Mon, Nov 06, 2017 at 03:12:31PM -0800, Linus Torvalds wrote: > But it does seem to be a new regression in 4.14, caused by commit > 8a97712e5314 ("scsi: make 'state' device attribute pollable"), because > that's what added the sysfs_notify() call to scsi_device_set_state(), > which made

Re: [PATCH v2] ata: fixes kernel crash while tracing ata_eh_link_autopsy event

2017-11-03 Thread Tejun Heo
On Thu, Nov 02, 2017 at 04:31:07PM +0530, Rameshwar Prasad Sahu wrote: > When tracing ata link error event, the kernel crashes when the disk is > removed due to NULL pointer access by trace_ata_eh_link_autopsy API. > This occurs as the dev is NULL when the disk disappeared. This patch > fixes this

Re: [PATCH] ata: fixes kernel crash while tracing ata_eh_link_autopsy event

2017-11-01 Thread Tejun Heo
Hello, On Tue, Oct 31, 2017 at 08:52:44PM +0530, Rameshwar Sahu wrote: > > probably should take both link and dev and use dev iff it's not NULL. > > > > Instead of this would it be better to call trace_ata_eh_link_autopsy() if > dev is not NULL from ata error handler ?? Oh yeah, that'd work too

Re: [PATCH] ata: fixes kernel crash while tracing ata_eh_link_autopsy event

2017-10-25 Thread Tejun Heo
Hello, On Wed, Oct 25, 2017 at 03:52:56PM +0530, Rameshwar Prasad Sahu wrote: > @@ -288,8 +289,8 @@ > ), > > TP_fast_assign( > - __entry->ata_port = dev->link->ap->print_id; > - __entry->ata_dev= dev->link->pmp + dev->devno; > +

Re: [PATCH V2] scsi: storvsc: Allow only one remove lun work item to be issued per lun

2017-10-21 Thread Tejun Heo
Hello, On Thu, Oct 19, 2017 at 08:35:10AM -0700, Christoph Hellwig wrote: > On Tue, Oct 17, 2017 at 01:35:21PM -0400, Cathy Avery wrote: > > + /* > > +* Set the error handler work queue. > > +*/ > > + snprintf(host_dev->work_q_name, sizeof(host_dev->work_q_name), > > +

Re: [PATCH V8 5/5] libata: Align DMA buffer to dma_get_cache_alignment()

2017-10-18 Thread Tejun Heo
On Tue, Oct 17, 2017 at 04:05:42PM +0800, Huacai Chen wrote: > In non-coherent DMA mode, kernel uses cache flushing operations to > maintain I/O coherency, so in ata_do_dev_read_id() the DMA buffer > should be aligned to ARCH_DMA_MINALIGN. Otherwise, If a DMA buffer > and a kernel structure share

Re: [PATCH V8 5/8] percpu-refcount: introduce __percpu_ref_tryget_live

2017-10-03 Thread Tejun Heo
Hello, On Wed, Oct 04, 2017 at 03:20:40AM +0800, Ming Lei wrote: > On Tue, Oct 03, 2017 at 07:14:59AM -0700, Tejun Heo wrote: > > Hello, > > > > On Tue, Oct 03, 2017 at 10:04:03PM +0800, Ming Lei wrote: > > > Block layer need to call this function after holding >

Re: [PATCH V8 5/8] percpu-refcount: introduce __percpu_ref_tryget_live

2017-10-03 Thread Tejun Heo
Hello, On Tue, Oct 03, 2017 at 10:04:03PM +0800, Ming Lei wrote: > Block layer need to call this function after holding > rcu lock in a real hot path, so introduce this helper. The patch description is too anemic. It doesn't even describe what changes are being made, let alone justifying them.

Re: [PATCH 1/9] percpu-refcount: introduce percpu_ref_is_dead()

2017-09-01 Thread Tejun Heo
Hello, Ming. > +/** > + * percpu_ref_is_dead - test whether a percpu refcount is killed > + * @ref: percpu_ref to test > + * > + * Returns %true if @ref is dead > + * > + * This function is safe to call as long as @ref is between init and exit. > + */ > +static inline bool

Re: No I/O errors reported after SATA link hard reset

2017-08-17 Thread Tejun Heo
Hello, On Thu, Aug 17, 2017 at 04:15:35PM +0200, Gionatan Danti wrote: > Ok, so *this* is the root cause of the problem: libata not > identifying spurious link renegotiations vs brief powerloss/powerup > events. Out of curiosity: is this a SATA-specific problem (ie: in > the SATA specification),

Re: No I/O errors reported after SATA link hard reset

2017-08-17 Thread Tejun Heo
Hello, On Thu, Aug 17, 2017 at 03:18:06PM +0200, Bernd Schubert wrote: > So for Gionatan the root cause was an instable power supply, but in my > case there wasn't any power loss, there were just failed sata commands. > I'm not sure if this was a port or cable issue - once I changed port and >

Re: No I/O errors reported after SATA link hard reset

2017-08-17 Thread Tejun Heo
Hello, On Thu, Aug 17, 2017 at 11:24:22AM +0200, Bernd Schubert wrote: > > More concerning is the fact that these undetected errors can make their > > way even when the higher application consistently calls sync() and/or > > fsync. In other words, it seems than even acknowledged writes can fail >

Re: Spurious DISK_EVENT_MEDIA_CHANGE on USB DVD hotplug?

2017-08-14 Thread Tejun Heo
Hello, Joe. On Thu, Aug 10, 2017 at 10:45:54AM -0400, Joe Lawrence wrote: > In the case of my USB DVD -> laptop example, there is no media in my > device, however I still see the DISK_EVENT_MEDIA_CHANGE event. This is > a bit confusing, and I was wondering if there was an explanation for > the

Re: [PATCH] sd: add support for TCG OPAL self encrypting disks

2017-06-28 Thread Tejun Heo
On Mon, Jun 19, 2017 at 02:26:46PM +0200, Christoph Hellwig wrote: > Just wire up the generic TCG OPAL infrastructure to the SCSI disk driver > and the Security In/Out commands. > > Note that I don't know of any actual SCSI disks that do support TCG OPAL, > but this is required to support ATA

Re: [PATCH] libata: Support for an ATA PASS-THROUGH(32) command.

2017-06-27 Thread Tejun Heo
On Sat, Jun 24, 2017 at 03:41:10AM +0900, Minwoo Im wrote: > SAT-4(SCSI/ATA Translation) supports for an ata pass-thru(32). > This patch will allow to translate an ata pass-thru(32) SCSI cmd > to an ATA cmd. > > Signed-off-by: Minwoo Im > Reviewed-by: Bart Van Assche

Re: [PATCH 02/11] dma-mapping: replace dmam_alloc_noncoherent with dmam_alloc_attrs

2017-06-26 Thread Tejun Heo
On Mon, Jun 26, 2017 at 12:07:30AM -0700, Christoph Hellwig wrote: > Tejun, does this look ok to you? Acked-by: Tejun Heo <t...@kernel.org> Thanks. -- tejun

Re: [PATCH 01/11] dma-mapping: remove dmam_free_noncoherent

2017-06-26 Thread Tejun Heo
On Mon, Jun 26, 2017 at 12:07:15AM -0700, Christoph Hellwig wrote: > Tejun, does this look ok to you? Sure, Acked-by: Tejun Heo <t...@kernel.org> Thanks. -- tejun

Re: [PATCH] sd: add support for TCG OPAL self encrypting disks

2017-06-26 Thread Tejun Heo
On Mon, Jun 26, 2017 at 12:43:27PM -0400, Martin K. Petersen wrote: > > Christoph, > > > ping? > > Looks good to me. I'll queue it up for 4.13 as soon as Linus has pulled > in the ata bits. I can route it through libata tree w/ your ack if that's more convenient. Thanks. -- tejun

Re: TCG Opal support for libata

2017-06-05 Thread Tejun Heo
On Sun, Jun 04, 2017 at 02:42:19PM +0200, Christoph Hellwig wrote: > Hi all, > > this series adds support for using our new generic TCG OPAL code with > SATA disks, and as side effect for SCSI disks (although so far it doesn't > seem like none of those actually exist). Applied 1-5 to

Re: [PATCH 09/31] block: Avoid that blk_exit_rl() triggers a use-after-free

2017-05-24 Thread Tejun Heo
ruct request") > Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> > Cc: Jens Axboe <ax...@fb.com> > Cc: Christoph Hellwig <h...@lst.de> > Cc: Tejun Heo <t...@kernel.org> > Cc: Jan Kara <j...@suse.cz> > Cc: Hannes Reinecke <h...@suse.com> > Cc: <sta...@vger.kernel.org> # v4.11+ Acked-by: Tejun Heo <t...@kernel.org> Thanks. -- tejun

Re: Race to power off harming SATA SSDs

2017-05-08 Thread Tejun Heo
Hello, On Mon, May 08, 2017 at 08:56:15PM +0200, Pavel Machek wrote: > Well... the SMART counter tells us that the device was not shut down > correctly. Do we have reason to believe that it is _not_ telling us > truth? It is more than one device. It also finished power off command successfully.

Re: Race to power off harming SATA SSDs

2017-05-08 Thread Tejun Heo
Hello, On Mon, May 08, 2017 at 06:43:22PM +0200, Pavel Machek wrote: > What I was trying to point out was that storage people try to treat > SSDs as HDDs... and SSDs are very different. Harddrives mostly survive > powerfails (with emergency parking), while it is very, very difficult > to make SSD

Re: Race to power off harming SATA SSDs

2017-04-10 Thread Tejun Heo
Hello, On Mon, Apr 10, 2017 at 08:21:19PM -0300, Henrique de Moraes Holschuh wrote: ... > Per spec (and device manuals), SCSI, SATA and ATA-attached SSDs must be > informed of an imminent poweroff to checkpoing background tasks, flush > RAM caches and close logs. For SCSI SSDs, you must tissue a

Re: [PATCH 0/2] Fix sysfs recursive removal splats in isci

2017-03-29 Thread Tejun Heo
Hello, On Wed, Mar 29, 2017 at 11:41:07AM +0200, Johannes Thumshirn wrote: > This series fixes a sysfs warning caused by isci not being able to cope with > recursive sysfs path removals which are in place since commit bcdde7e > ("sysfs: make __sysfs_remove_dir() recursive"). Thanks for fixing

Re: [PATCH v2] libsas: fix "sysfs group not found" warnings at port teardown time

2017-03-28 Thread Tejun Heo
Hello, On Fri, Mar 24, 2017 at 05:53:54PM +0100, Johannes Thumshirn wrote: > [ +Cc Tejun ] > > On Fri, Mar 24, 2017 at 11:44:55AM +, John Garry wrote: > > To be clear, was this the same test with isci which you initially reported? > > Yes, just echo into the PCI device's sysfs remove file

Re: support ranges TRIM for libata

2017-03-23 Thread Tejun Heo
Hello, Christoph. On Thu, Mar 23, 2017 at 03:43:30PM +0100, Christoph Hellwig wrote: > > That's up to you ... from the point of view of code documenting itself, > > forming the ATA_16 TRIM in sd and not doing any satl transformation is > > easier for others to follow, but if it's going to cause

Re: support ranges TRIM for libata

2017-03-21 Thread Tejun Heo
Hello, On Mon, Mar 20, 2017 at 04:43:12PM -0400, Christoph Hellwig wrote: > This series implements rangeѕ discard for ATA SSDs. Compared to the > initial NVMe support there are two things that complicate the ATA > support: > > - ATA only suports 16-bit long ranges > - the whole mess of

Re: [PATCH] libata: make ata_sg_clean static over again

2017-03-13 Thread Tejun Heo
On Fri, Mar 10, 2017 at 10:05:40AM +0800, Jason Yan wrote: > Fixes the following sparse warning: > > drivers/ata/libata-core.c:4913:6: warning: symbol 'ata_sg_clean' was not > declared. Should it be static? > > Signed-off-by: Jason Yan Applied to libata/for-4.12. Thanks.

Re: [PATCH 1/4] block: Allow bdi re-registration

2017-03-09 Thread Tejun Heo
Tested-by: Omar Sandoval <osan...@fb.com> > Signed-off-by: Jan Kara <j...@suse.cz> Acked-by: Tejun Heo <t...@kernel.org> Thanks! -- tejun

Re: [PATCH 1/4] block: Allow bdi re-registration

2017-03-08 Thread Tejun Heo
Hello, On Wed, Mar 08, 2017 at 05:48:31PM +0100, Jan Kara wrote: > @@ -710,6 +710,11 @@ static void cgwb_bdi_destroy(struct backing_dev_info > *bdi) >*/ > atomic_dec(>usage_cnt); > wait_event(cgwb_release_wait, !atomic_read(>usage_cnt)); > + /* > + * Grab back our

Re: [PATCH 3/4] block: Make del_gendisk() safer for disks without queues

2017-03-08 Thread Tejun Heo
blk_unregister_queue() warns in that case, this change will make it oops > instead. Return to the old more robust behavior of just warning when > del_gendisk() gets called for gendisk with disk->queue being NULL. > > Reported-by: Dan Carpenter <dan.carpen...@oracle.com> > Signed-

Re: [PATCH 2/4] bdi: Fix use-after-free in wb_congested_put()

2017-03-08 Thread Tejun Heo
i regardless whether it ever got registered > or not. > > Fixes: 165a5e22fafb127ecb5914e12e8c32a1f0d3f820 > Signed-off-by: Jan Kara <j...@suse.cz> Acked-by: Tejun Heo <t...@kernel.org> Thanks. -- tejun

Re: [PATCH v2] ata: xgene: Enable NCQ support for APM X-Gene SATA controller hardware v1.1

2017-01-18 Thread Tejun Heo
Hello, On Tue, Jan 17, 2017 at 08:25:21PM +0530, Rameshwar Sahu wrote: > Hi Tejun, > > On Fri, Nov 18, 2016 at 3:15 PM, Rameshwar Prasad Sahu wrote: > > This patch enables NCQ support for APM X-Gene SATA controller hardware v1.1 > > that was broken with hardware v1.0. Second

Re: [PATCH] ata: xgene: Enable NCQ support for APM X-Gene SATA controller hardware v1.1

2016-11-15 Thread Tejun Heo
Hello, Rameshwar. On Fri, Nov 11, 2016 at 01:36:28PM +0530, Rameshwar Sahu wrote: > Hi Tejun, > > On Wed, Nov 9, 2016 at 10:15 PM, Tejun Heo <t...@kernel.org> wrote: > > Hello, > > > > On Wed, Sep 14, 2016 at 04:15:00PM +0530, Rameshwar Sahu wrote: >

Re: [PATCH] ata: xgene: Enable NCQ support for APM X-Gene SATA controller hardware v1.1

2016-11-09 Thread Tejun Heo
Hello, On Wed, Sep 14, 2016 at 04:15:00PM +0530, Rameshwar Sahu wrote: > > @@ -821,8 +823,6 @@ static int xgene_ahci_probe(struct platform_device > > *pdev) > > dev_warn(>dev, "%s: Error reading > > device info. Assume version1\n", > >

Re: [PATCH] mvsas: fix error return code in mvs_task_prep()

2016-11-01 Thread Tejun Heo
On Mon, Oct 31, 2016 at 10:29:26AM -0600, Tejun Heo wrote: > On Mon, Oct 31, 2016 at 03:04:10PM +, Wei Yongjun wrote: > > From: Wei Yongjun <weiyongj...@huawei.com> > > > > Fix to return error code -ENOMEM from the error handling > > case instead of 0, a

Re: [PATCH] mvsas: fix error return code in mvs_task_prep()

2016-10-31 Thread Tejun Heo
On Mon, Oct 31, 2016 at 03:04:10PM +, Wei Yongjun wrote: > From: Wei Yongjun > > Fix to return error code -ENOMEM from the error handling > case instead of 0, as done elsewhere in this function. > > Signed-off-by: Wei Yongjun Applied to

Re: [PATCH v6 3/3] ata: ATA Command Priority Disabled By Default

2016-10-19 Thread Tejun Heo
this feature is turned off. This patch depends on ata: Enabling ATA Command Priorities tj: Renamed ncq_prio_on to ncq_prio_enable and removed trivial ata_ncq_prio_on() and open-coded the test. Signed-off-by: Adam Manzanares <adam.manzana...@hgst.com> Signed-off-by: Tejun Heo <t...@kernel.

Re: [PATCH v6 0/3] Enabling ATA Command Priorities

2016-10-19 Thread Tejun Heo
On Mon, Oct 17, 2016 at 11:27:27AM -0700, Adam Manzanares wrote: > This patch builds ATA commands with high priority if the iocontext of a > process > is set to real time. The goal of the patch is to improve tail latencies of > workloads that use higher queue depths. This requires setting the

Re: [PATCH v6 2/3] ata: Enabling ATA Command Priorities

2016-10-19 Thread Tejun Heo
with a high priority command. This is done to improve the tail latency of commands that are high priority by passing priority to the device. tj: Removed trivial ata_ncq_prio_enabled() and open-coded the test. Signed-off-by: Adam Manzanares <adam.manzana...@hgst.com> Signed-off-by: Tejun He

Re: [PATCH v6 3/3] ata: ATA Command Priority Disabled By Default

2016-10-19 Thread Tejun Heo
On Mon, Oct 17, 2016 at 11:27:30AM -0700, Adam Manzanares wrote: > Add a sysfs entry to turn on priority information being passed > to a ATA device. By default this feature is turned off. > > This patch depends on ata: Enabling ATA Command Priorities > > Signed-off-by: Adam Manzanares

Re: [PATCH v6 1/3] block: Add iocontext priority to request

2016-10-19 Thread Tejun Heo
Hello, On Mon, Oct 17, 2016 at 11:27:28AM -0700, Adam Manzanares wrote: > Patch adds an association between iocontext ioprio and the ioprio of a > request. This is done to enable request based drivers the ability to > act on priority information stored in the request. An example being > ATA

Re: [PATCH v5 3/4] ata: Enabling ATA Command Priorities

2016-10-13 Thread Tejun Heo
Hello, On Thu, Oct 13, 2016 at 04:00:30PM -0700, Adam Manzanares wrote: > This patch checks to see if an ATA device supports NCQ command priorities. > If so and the user has specified an iocontext that indicates > IO_PRIO_CLASS_RT then we build a tf with a high priority command. > > This is done

Re: [PATCH] Some drives failing on SCT Write Same

2016-09-09 Thread Tejun Heo
On Fri, Sep 09, 2016 at 11:44:19AM -0500, Shaun Tancheff wrote: > Restrict support SCT Write Same to devices which also support ZAC where > support is required. > > Reported-by: Mike Krinkin > Signed-off-by: Shaun Tancheff Applied to

Re: patch "libata: Add support for SCT Write Same" breaks system

2016-09-09 Thread Tejun Heo
Hello, Shaun. On Fri, Sep 09, 2016 at 10:26:44AM -0500, Shaun Tancheff wrote: > I'm looking into it now. Let me see if I can reproduce this on any of my > hardware. > > If not there are a couple of options ... one is to only enable for ZBC > devices > where this explicitly required by the spec.

Re: patch "libata: Add support for SCT Write Same" breaks system

2016-09-09 Thread Tejun Heo
Hello, On Thu, Sep 08, 2016 at 10:27:37PM +0300, Mike Krinkin wrote: > Hi, > > i tried recent linux-next on my laptop, and after boot system is > almost unusable because most of apps just crash with segfaults and > in dmesg output there are a lot of errors like this: ... > git bisect points at

Re: [PATCH 2/2] fusion: mptbase: Remove deprecated create_singlethread_workqueue

2016-08-31 Thread Tejun Heo
f work items, explicit concurrency > limit is unnecessary here. > > Signed-off-by: Bhaktipriya Shridhar <bhaktipriy...@gmail.com> Acked-by: Tejun Heo <t...@kernel.org> Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a

Re: [PATCH 1/2] fusion/mptfc: Remove deprecated create_singlethread_workqueue

2016-08-31 Thread Tejun Heo
dicated workqueue has been used. > > WQ_MEM_RECLAIM has been set since the workqueue is belongs to a storage > driver which is being used on a memory reclaim path and hence, requires > forward progress under memory pressure. > > Signed-off-by: Bhaktipriya Shridhar <bhaktipriy...@gmail

Re: Time to make dynamically allocated devt the default for scsi disks?

2016-08-13 Thread Tejun Heo
Hello, Dan. On Fri, Aug 12, 2016 at 02:29:30PM -0700, Dan Williams wrote: > Before spending effort trying to flush the destruction of old bdi > instances before new ones are registered, is it rather time to > complete the conversion of sd to only use dynamically allocated devt? I think that

Re: [PATCH v2 2/2] libata-core: do not set dev->max_sectors for LBA48 devices

2016-08-10 Thread Tejun Heo
Hello, Tom. On Wed, Aug 10, 2016 at 04:32:39PM +0800, Tom Yan wrote: > I have to admit that libata may not be the right place to deal with my > concern over the current BLK_DEF_MAX_SECTORS, which seems non-sensical > to me. In the original commit message: > > (d2be537c3ba3, "block: bump

Re: Regarding AHCI_MAX_SG and (ATA_HORKAGE_MAX_SEC_1024)

2016-08-10 Thread Tejun Heo
Hello, Tom. On Wed, Aug 10, 2016 at 06:04:10PM +0800, Tom Yan wrote: > On 10 August 2016 at 11:26, Tejun Heo <t...@kernel.org> wrote: > > Hmmm.. why not? The hardware limit is 64k and the driver is using a > > Is that referring to the maximum number of entries allowed in

Re: [PATCH v2 2/2] libata-core: do not set dev->max_sectors for LBA48 devices

2016-08-09 Thread Tejun Heo
Hello, On Tue, Aug 09, 2016 at 10:45:47PM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > Currently block layer limit max_hw_sectors is set to > ATA_MAX_SECTORS_LBA48 (65535), for devices with LBA48 support. > > However, block layer limit max_sectors (which is the

Re: Regarding AHCI_MAX_SG and (ATA_HORKAGE_MAX_SEC_1024)

2016-08-09 Thread Tejun Heo
Hello, Tom. On Sun, Aug 07, 2016 at 10:10:17PM +0800, Tom Yan wrote: > So the (not so) recent bump of BLK_DEF_MAX_SECTORS from 1024 to 2560 > (commit d2be537c3ba3) seemed to have caused trouble to some of the ATA > devices, which were then worked around with ATA_HORKAGE_MAX_SEC_1024. > >

Re: [PATCH resend 5/5] libata-scsi: fix MODE SELECT translation for Control mode page

2016-08-09 Thread Tejun Heo
On Fri, Jul 22, 2016 at 02:41:54AM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > scsi_done() was called repeatedly and apparently because of that, > the kernel would call trace when we touch the Control mode page: > > Call Trace: > [] dump_stack+0x63/0x81 > []

Re: [PATCH resend v3 3/5] libata-scsi: use u8 array to store mode page copy

2016-08-09 Thread Tejun Heo
On Sat, Jul 23, 2016 at 02:34:08AM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > ata_mselect_*() would initialize a char array for storing a copy of > the current mode page. However, char could be signed char. In that > case, bytes larger than 127 would be converted to

Re: [PATCH resend 5/5] libata-scsi: fix MODE SELECT translation for Control mode page

2016-07-25 Thread Tejun Heo
On Fri, Jul 22, 2016 at 05:50:18AM +0800, Tom Yan wrote: > As I've mentioned in the comment/message, there is no ATA command > needed to be sent to the device, since it only toggles a bit in > dev->flags. See that there is no ata_taskfile constructed in > ata_mselect_control(). But

Re: [PATCH resend 3/5] libata-scsi: fix overflow in mode page copy

2016-07-21 Thread Tejun Heo
On Fri, Jul 22, 2016 at 05:39:27AM +0800, Tom Yan wrote: > Let me know how I should polish the description for this. The above is because the signed ones are getting sign-extended making them different from the unsigned ones which don't get padded in the high bits. Converting to u8 is the right

Re: [PATCH resend 5/5] libata-scsi: fix MODE SELECT translation for Control mode page

2016-07-21 Thread Tejun Heo
On Fri, Jul 22, 2016 at 02:41:54AM +0800, tom.t...@gmail.com wrote: > @@ -3854,6 +3852,8 @@ static unsigned int ata_scsi_mode_select_xlat(struct > ata_queued_cmd *qc) > if (ata_mselect_control(qc, p, pg_len, ) < 0) { > fp += hdr_len + bd_len; >

Re: [PATCH resend 3/5] libata-scsi: fix overflow in mode page copy

2016-07-21 Thread Tejun Heo
Hello, On Fri, Jul 22, 2016 at 02:41:52AM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > ata_mselect_*() would initialize a char array for storing a copy of > the current mode page. However, if char was actually signed char, > overflow could occur. Do you mean sign

Re: [PATCH v2] libata-scsi: fix read-only bits checking in ata_mselect_*()

2016-07-20 Thread Tejun Heo
So, just reverted this patch. On Wed, Jul 20, 2016 at 06:59:23AM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > Commit 7780081c1f04 ("libata-scsi: Set information sense field for > invalid parameter") changed how ata_mselect_*() make sure read-only > bits are not

Re: [PATCH v2] libata-scsi: fix read-only bits checking in ata_mselect_*()

2016-07-20 Thread Tejun Heo
On Wed, Jul 20, 2016 at 06:59:23AM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > Commit 7780081c1f04 ("libata-scsi: Set information sense field for > invalid parameter") changed how ata_mselect_*() make sure read-only > bits are not modified. The new implementation

Re: [PATCH v4] libata-scsi: better style in ata_msense_*()

2016-07-20 Thread Tejun Heo
On Wed, Jul 20, 2016 at 04:39:28AM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > `changeable` is the "version" of mode page requested by the user. > It will be less confusing/misleading if we do not check it > "together" with the setting bits of the drive. > > Not to

Re: [PATCH v4] libata-scsi: minor cleanup in ata_mselect_*()

2016-07-20 Thread Tejun Heo
On Wed, Jul 20, 2016 at 05:11:50AM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > 1. Removed a repeated bit masking in ata_mselect_control() > 2. Moved `wce`/`d_sense` assignment below the page validity checks > 3. Added/Removed empty lines where appropriate > >

Re: Fluctuating "acceptance" on requested data length in SATA/AHCI

2016-07-14 Thread Tejun Heo
On Fri, Jul 15, 2016 at 03:10:40AM +0800, Tom Yan wrote: > I hadn't been able to "locate" a sensible and/or solid point where the > fluctuation start, but I did notice that the chance of "failure" would > rise with the requested length. Also, if I boot with > `libata.force=noncq`, the failure

Re: [RFC 1/3] ata: bump ATA_MAX_SECTORS_LBA48 to 65536

2016-07-14 Thread Tejun Heo
On Fri, Jul 15, 2016 at 02:22:52AM +0800, Tom Yan wrote: > On 14 July 2016 at 01:03, Tejun Heo <t...@kernel.org> wrote: > > > > It's used to device max_sectors. > > > > Not really. "max_sectors" of ATA drives have been set to > BLK

Re: [RFC 1/3] ata: bump ATA_MAX_SECTORS_LBA48 to 65536

2016-07-13 Thread Tejun Heo
Hello, On Wed, Jul 13, 2016 at 12:47:06PM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > ATA_MAX_SECTORS_LBA48 is only used for setting the queue limit > "max_hw_sectors", which only serves as the cap for "max_sectors", > which is in turn the actual limit being used.

Re: [RFC 3/3] libata-scsi: add optimal transfer length to block limits VPD

2016-07-13 Thread Tejun Heo
On Wed, Jul 13, 2016 at 12:47:08PM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > As of commit 6b7e9cde4969 ("sd: Fix rw_max for devices that report > an optimal xfer size"), the scsi disk driver (correctly) derive both > of the queue limits "io_opt" and "max_sectors"

Re: [PATCH v6 2/2] libata-scsi: avoid repeated calculation of number of TRIM ranges

2016-07-12 Thread Tejun Heo
On Wed, Jul 13, 2016 at 04:31:23AM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > Currently libata statically allows only 1-block (512-byte) payload > for each TRIM command. Each payload can carry 64 TRIM ranges since > each range requires 8 bytes. > > It is silly to

Re: [PATCH v5 1/2] libata-scsi: reject WRITE SAME (16) with n_block that exceeds limit

2016-07-12 Thread Tejun Heo
On Thu, Jul 07, 2016 at 01:19:05AM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > Currently if a WRITE SAME (16) command is issued to the SATL with > "number of blocks" that is larger than the "Maximum write same length" > (which is the maximum number of blocks per TRIM

Re: [PATCH v5 2/2] libata-scsi: avoid repeated calculation of number of TRIM ranges

2016-07-12 Thread Tejun Heo
Hello, On Thu, Jul 07, 2016 at 01:19:06AM +0800, tom.t...@gmail.com wrote: > @@ -1071,7 +1072,7 @@ static inline unsigned ata_set_lba_range_entries(void > *_buffer, > __le64 *buffer = _buffer; > unsigned i = 0, used_bytes; > > - while (i < buf_size / 8 ) { /* 6-byte LBA +

Re: [PATCH v2 2/2] libata-scsi: rename ata_msense_ctl_mode() to ata_msense_control()

2016-07-12 Thread Tejun Heo
On Wed, Jul 13, 2016 at 02:54:12AM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > To make it consistent with the recently added ata_mselect_control(). > We probably shouldn't have the word "mode" in its name anyway, since > that's not the case for other ata_msense_*() /

Re: [PATCH 1/2] libata-scsi: do not return designator for serial number

2016-07-12 Thread Tejun Heo
On Thu, Jul 07, 2016 at 06:12:12AM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > SAT (as of sat4r05f.pdf) does not require this vendor specific > designator. Besides, we already have the Unit Serial Number VPD. > > Signed-off-by: Tom Yan > > diff

Re: [PATCH v3 2/2] libata-scsi: better style in ata_msense_caching()

2016-07-12 Thread Tejun Heo
On Wed, Jul 13, 2016 at 12:20:40AM +0800, Tom Yan wrote: > First of all "changeable" is the "version" of mode page requested by > the user, while ata_id_*_enabled(id) are the value of setting reported > by the device. I think it's ugly and confusing to check values of > totally different nature

Re: [PATCH resend 2/2] libata-scsi: correct SPC version descriptor

2016-07-12 Thread Tejun Heo
On Tue, Jul 12, 2016 at 09:29:35PM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > The comment suggests we should be having an SPC-3 version descriptor > but the 0260h is the code for "SPC-2 (no version claimed)". Correct > it to 0300h so that it has the "SPC-3 (no

Re: [PATCH v2 2/2] libata-scsi: better style in ata_msense_caching()

2016-07-12 Thread Tejun Heo
On Tue, Jul 12, 2016 at 09:28:23PM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > Signed-off-by: Tom Yan > > diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c > index bfec66f..6f7c626 100644 > --- a/drivers/ata/libata-scsi.c > +++

Re: [PATCH v3 1/2] libata-scsi: fix SET FEATURES "filtering" for ata_msense_caching()

2016-07-12 Thread Tejun Heo
On Tue, Jul 12, 2016 at 09:37:02PM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > Without this fix, the DRA bit of the caching mode page would not > be updated when the read look-ahead feature is toggled (e.g. with > `smartctl --set`), but will only be until, for

Re: [PATCH v3 2/2] libata-scsi: better style in ata_msense_caching()

2016-07-12 Thread Tejun Heo
On Tue, Jul 12, 2016 at 09:37:03PM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > Signed-off-by: Tom Yan > > diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c > index bfec66f..48ea887 100644 > --- a/drivers/ata/libata-scsi.c > +++

Re: [PATCH v2] libata-scsi: set correct VERSION field for ZAC devices

2016-07-12 Thread Tejun Heo
On Tue, Jul 12, 2016 at 10:12:01PM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > Commit 856c46639309 ("libata: support device-managed ZAC devices") > had the line that "bumps" the VERSION field in standard INQUIRY data > removed. Add it back and claim SPC-5 version

Re: [PATCH resend 1/2] libata-scsi: do not respond with "invalid field" for FORMAT UNIT

2016-07-06 Thread Tejun Heo
On Thu, Jul 07, 2016 at 01:13:08AM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > It does not make sense and is confusing to respond with "Invalid > field in CDB" while we have no support at all implemented for > FORMAT UNIT. It is decent to let it go to the default,

Re: [PATCH resend 2/2] libata-scsi: correct cbd to CDB in comment

2016-07-06 Thread Tejun Heo
On Thu, Jul 07, 2016 at 01:13:09AM +0800, tom.t...@gmail.com wrote: > From: Tom Yan > > It's Command Descriptor Block. Also capitalized it. > > Signed-off-by: Tom Yan Applied to libata/for-4.8. Thanks. -- tejun -- To unsubscribe from this list: send

  1   2   3   4   5   6   7   >