Re: [PATCH v2 1/2] scsi: fix race between simultaneous decrements of ->host_failed

2016-05-31 Thread Tejun Heo
On Tue, May 31, 2016 at 04:38:17PM +0800, Wei Fang wrote: > sas_ata_strategy_handler() adds the works of the ata error handler > to system_unbound_wq. This workqueue asynchronously runs work items, Are there more than one error handling work items per host? Thanks. -- tejun -- To unsubscribe fr

Re: [PATCH] scsi: device_handler: Remove create_workqueue

2016-06-02 Thread Tejun Heo
Ditto with other patches. Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] Hard disk S3 resume time optimization

2013-05-16 Thread Tejun Heo
Hello, First of all, if at all possible, please try to fill the message to 80 columns, preferably a bit narrower than that. Most email clients can do it without you knowing. > [The Problem] > The vast majority of time spent in S3 resume is consumed by the ATA > subsystem as it resumes the comput

Re: [PATCH] Hard disk S3 resume time optimization

2013-05-16 Thread Tejun Heo
On Thu, May 16, 2013 at 03:44:41PM -0700, Tejun Heo wrote: > So, while I agree about the problem and the solution seems to be > headed the right way of making SCSI suspend/resume asynchronous, > what's going on with patch splitting, submission format and comments? > Please

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Tejun Heo
On Wed, May 22, 2013 at 08:35:54AM +0200, Paolo Bonzini wrote: > I'm not sure what is more ridiculous, whether the seven pings or the > lack of review... So, ummm, I don't know what Jens is thinking but at this point I'm basically waiting for someone else to pick it up as review to return ratio is

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Tejun Heo
On Wed, May 22, 2013 at 11:53:30AM +0200, Paolo Bonzini wrote: > Il 22/05/2013 11:32, Tejun Heo ha scritto: > > On Wed, May 22, 2013 at 08:35:54AM +0200, Paolo Bonzini wrote: > >> I'm not sure what is more ridiculous, whether the seven pings or the > >> lack of revi

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Tejun Heo
On Wed, May 22, 2013 at 12:23:56PM +0200, Paolo Bonzini wrote: > Yes, because I have no idea what _your_ point is. Isolate the actual fixes and just submit them as it seems impossible for you to provide proper justifications for the things you want to add. -- tejun -- To unsubscribe from this li

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Tejun Heo
On Wed, May 22, 2013 at 04:12:04PM +0200, Paolo Bonzini wrote: > Il 22/05/2013 15:41, Tejun Heo ha scritto: > > On Wed, May 22, 2013 at 12:23:56PM +0200, Paolo Bonzini wrote: > >> Yes, because I have no idea what _your_ point is. > > > > Isolate the actual fixes an

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Tejun Heo
On Wed, May 22, 2013 at 05:00:52PM +0200, Paolo Bonzini wrote: > Il 22/05/2013 16:30, Tejun Heo ha scritto: > > * Separate fixes from additions. Transform existing code so that the > > visible behavior doesn't change but the required fix can be > > implemented on to

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Tejun Heo
Hey, On Wed, May 22, 2013 at 05:53:34PM +0200, Paolo Bonzini wrote: > I do listen to review feedback, but I also expect the other side to > listen to me, ask me what is not clear, and possess some knowledge of > the domain that he's reviewing patches for. All of which, quite > frankly, I have not

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Tejun Heo
On Wed, May 22, 2013 at 11:18:05PM +0200, Paolo Bonzini wrote: > Ok, so I can split it in 10 patches one per command, but at some point I > wonder if it is overkill. For example, for disks: > > - WRITE AND VERIFY(16) is needed to support >2TB disks, and the > corresponding 12-byte CDB is whitelis

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Tejun Heo
On Thu, May 23, 2013 at 07:17:37AM +0900, Tejun Heo wrote: > > No, it doesn't. You can use SCM_RIGHTS, and pass a file descriptor for > > the device node to an unprivileged program. You can choose the > > users/groups that are allowed to access the device. In either c

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-23 Thread Tejun Heo
On Thu, May 23, 2013 at 09:45:42AM +0200, Paolo Bonzini wrote: > Il 23/05/2013 00:17, Tejun Heo ha scritto: > > Then let's make it fit the use case better. I really can't see much > > point in crafting the cdb filter when you basically have to entrust > > the de

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-23 Thread Tejun Heo
On Thu, May 23, 2013 at 11:47:25AM +0200, Paolo Bonzini wrote: > > No no, I'm not talking about it not working for the users - it's just > > passing the commands, it of course works. I'm doubting about it being > > a worthy security isolation layer. cdb filtering (of any form really) > > has alwa

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-24 Thread Tejun Heo
On Fri, May 24, 2013 at 4:13 PM, Paolo Bonzini wrote: >> The same filtering table being applied to different classes of >> hardware is a software bug, but my point is that the practive >> essentially entrusts non-insignificant part of security enforcement to >> the hardware itself. The variety of

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-24 Thread Tejun Heo
On Fri, May 24, 2013 at 5:31 PM, Paolo Bonzini wrote: > I agree intuition may not count, and it's perfectly possible that > firmware writers forgot a "break;" or put the wrong location in a jump > table, so that unimplemented commands give interesting results. It's not just unimplemented commands

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-24 Thread Tejun Heo
On Fri, May 24, 2013 at 11:45:33AM +0200, Paolo Bonzini wrote: > > It's not just unimplemented commands. Exposing any new command exposes > > its borderline problems together with it. > > For commands that are used by Linux already, the right way to fix the > problems is not obscuring the commands

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-25 Thread Tejun Heo
Hey, James. On Fri, May 24, 2013 at 09:35:02PM -0700, James Bottomley wrote: > > Well, I'd actually much prefer disabling CDB whitelisting for all !MMC > > devices if at all possible. > > I'll go along with this. I'm also wondering what the problem would be Don't think we can. It'd be a behavi

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-25 Thread Tejun Heo
On Sat, May 25, 2013 at 01:14:37PM +0200, Paolo Bonzini wrote: > > Don't think we can. It'd be a behavior change clearly visible to > > userland at this point. > > We can (and even for MMC) if it is a build-time configuration knob. It > would satisfy those people who want the CVE fixed, as long

Re: [PATCH] ipr: qc_fill_rtf() method should not store alternate status register

2013-06-02 Thread Tejun Heo
On Sat, Jun 01, 2013 at 02:37:00AM +0400, Sergei Shtylyov wrote: > Hello. > > On 05/31/2013 04:46 PM, Brian King wrote: > > > > >>The 'ctl' field of the 'struct ata_taskfile' is not really dual purpose, > >>i.e. > >>it is not intended for storing the alternate status register (which is > >>ma

Re: [PATCH 1/3] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-06 Thread Tejun Heo
Hello, On Thu, Jun 06, 2013 at 09:52:56PM +0900, Akinobu Mita wrote: > +static bool sg_miter_get_next_page(struct sg_mapping_iter *miter) > +{ > + if (!miter->__remaining) { > + struct scatterlist *sg; > + unsigned long pgoffset; > + > + if (!__sg_page_iter_

Re: [PATCH v2 1/4] lib/scatterlist: factor out sg_miter_get_next_page() from sg_miter_next()

2013-06-18 Thread Tejun Heo
On Tue, Jun 18, 2013 at 10:31:31PM +0900, Akinobu Mita wrote: > This function is used to proceed page iterator to the next page if > necessary, and will be used to implement the variants of > sg_copy_{from,to}_buffer() later. > > Signed-off-by: Akinobu Mita > Cc: Tejun Heo >

Re: [PATCH v2 2/4] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-18 Thread Tejun Heo
On Tue, Jun 18, 2013 at 10:31:32PM +0900, Akinobu Mita wrote: > /** > + * sg_miter_seek - reposition mapping iterator > + * @miter: sg mapping iter to be seeked > + * @offset: number of bytes to plus the current location > + * > + * Description: > + * Sets the offset of @miter to its current loc

Re: [PATCH v3 2/4] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-24 Thread Tejun Heo
ta > Cc: Tejun Heo > Cc: Imre Deak > Cc: Herbert Xu > Cc: "David S. Miller" > Cc: linux-cry...@vger.kernel.org > Cc: "James E.J. Bottomley" > Cc: Douglas Gilbert > Cc: linux-scsi@vger.kernel.org Acked-by: Tejun Heo Thanks. -- tejun -- To unsubs

Re: [RFC PATCH 1/2] ata: acpi: remove dead code for ata_acpi_(un)bind

2013-07-25 Thread Tejun Heo
On Thu, Jul 25, 2013 at 01:47:02PM +0800, Aaron Lu wrote: > Commit 7381fe737 "libata-acpi: remove redundent code for power resource > handling" removed ata_acpi_(un)bind but left their prototypes in libata.h, > so remove them. > > Signed-off-by: Aaron Lu Applied to libata/for-3.12. Thanks. --

Re: [RFC PATCH 2/2] ata: acpi: rework the ata acpi bind support

2013-07-25 Thread Tejun Heo
On Thu, Jul 25, 2013 at 01:47:03PM +0800, Aaron Lu wrote: > Binding ACPI handle to SCSI device has several drawbacks, namely: > 1 During ATA device initialization time, ACPI handle will be needed > while SCSI devices are not created yet. So each time ACPI handle is > needed, instead of retrievi

Re: [PATCH RESEND 0/1] AHCI: Optimize interrupt processing

2013-07-29 Thread Tejun Heo
Hello, On Fri, Jul 26, 2013 at 02:14:36PM -0700, Nicholas A. Bellinger wrote: > So I don't think (completely) getting rid of ata_port->qcmds[] will be > possible, and just converting the ata_scsi_queuecmd() path to use the > extra SHT->cmd_size pre-allocation for *ata_queued_cmd might end up > bei

Re: [PATCH RESEND 0/1] AHCI: Optimize interrupt processing

2013-07-29 Thread Tejun Heo
Yo, On Fri, Jul 26, 2013 at 05:43:13PM -0700, Nicholas A. Bellinger wrote: > Considering there can be more than a single ata_device hanging off each > ata_port, the '*sdev = ap->link.device[0].sdev' in __ata_qc_from_tag() > is definitely bogus, but I'm not sure how else to correlate > blk-mq/scsi-

Re: [PATCH RESEND 0/1] AHCI: Optimize interrupt processing

2013-07-31 Thread Tejun Heo
Hello, On Tue, Jul 30, 2013 at 09:16:02PM -0700, Marc C wrote: > >> One thing which would probably be worthwhile tho is getting rid of the > >> bitmap based qc tag allocator in libata. That one is just borderline > >> stupid to keep around on any setup which is supposed to be scalable. > > Your b

Re: [PATCH RESEND 0/1] AHCI: Optimize interrupt processing

2013-08-09 Thread Tejun Heo
On Fri, Aug 09, 2013 at 10:23:35AM +0200, Alexander Gordeev wrote: > On Mon, Jul 29, 2013 at 07:46:53AM -0400, Tejun Heo wrote: > > One thing which would probably be worthwhile tho is getting rid of the > > bitmap based qc tag allocator in libata. That one is just borderline >

Re: [RFC PATCH 2/2] ata: acpi: rework the ata acpi bind support

2013-08-14 Thread Tejun Heo
Hello, Aaron. On Thu, Aug 15, 2013 at 09:33:28AM +0800, Aaron Lu wrote: > This has been quiet for some time, may I know your opinion on this? Ooh, I like it. I was waiting for proper patch series w/o RFC tag and hopefully some test results. Thanks. -- tejun -- To unsubscribe from this list: s

Re: [RFC PATCH 2/2] ata: acpi: rework the ata acpi bind support

2013-08-22 Thread Tejun Heo
Hello, Aaron. On Thu, Aug 22, 2013 at 03:15:16PM +0800, Aaron Lu wrote: > The patch series has two patches and the first has been taken, shall I > send the 2nd one again without the RFC tag in the patch subject? There > should be no other changes at the moment. Yes, that was a request for you to

Re: [PATCH 2/2] ata: acpi: rework the ata acpi bind support

2013-08-23 Thread Tejun Heo
Hello, On Fri, Aug 23, 2013 at 10:17:54AM +0800, Aaron Lu wrote: > From: Aaron Lu > Subject: [PATCH 2/2] ata: acpi: rework the ata acpi bind support Applied to libata/for-3.12 w/ Dirk's tested-by added. Thanks! -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-scsi"

Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-20 Thread Tejun Heo
> > Convert all direct write accesses to using the correct API. > > Signed-off-by: Russell King Acked-by: Tejun Heo The patch is pretty widely spread. I don't mind how it gets routed but what's the plan? Thanks. -- tejun -- To unsubscribe from this list: send the li

Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-20 Thread Tejun Heo
On Fri, Sep 20, 2013 at 07:16:52AM -0500, Tejun Heo wrote: > On Fri, Sep 20, 2013 at 12:11:38AM +0100, Russell King wrote: > > The correct way for a driver to specify the coherent DMA mask is > > not to directly access the field in the struct device, but to use > > dma_set_c

Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-20 Thread Tejun Heo
Hey, On Fri, Sep 20, 2013 at 03:00:18PM +0100, Russell King - ARM Linux wrote: > Another would be if subsystem maintainers are happy that I carry them, > I can add the acks, and then later on towards the end of the cycle, > provide a branch subsystem maintainers could pull. > > Or... if you can t

Re: Use-after-free in ata_qc_issue

2013-09-22 Thread Tejun Heo
(cc'ing SCSI people) On Wed, Sep 18, 2013 at 11:45:22AM -0700, Dmitry Vyukov wrote: > Hi! > > I am working on AddressSanitizer -- a tool that detects use-after-free > and out-of-bounds bugs > (https://code.google.com/p/address-sanitizer/wiki/AddressSanitizerForKernel). > Below is one of the bug r

Re: Use-after-free in ata_qc_issue

2013-09-22 Thread Tejun Heo
Hello, On Sun, Sep 22, 2013 at 11:59:53AM -0700, Dmitry Vyukov wrote: > I've noticed that free happens in scsi_error_handler thread, so maybe > a timeout or some other error condition is involved here. > It is possible that timeout happens while the request is still being > in process of submittin

Re: Use-after-free in ata_qc_issue

2013-09-23 Thread Tejun Heo
Hello, On Sun, Sep 22, 2013 at 02:51:51PM -0700, Dmitry Vyukov wrote: > > Yeah, could be. IIRC, there's still race condition in block / scsi > > timeout handling. Hmmm... > > Is there an open bug for this? Not that I know of. ISTR a couple threads about it. My memory is quite hazy as usual b

Re: Race condition between "read CFQ stats" and "block device shutdown"

2013-09-26 Thread Tejun Heo
Hello, (cc'ing linux-scsi) On Wed, Sep 25, 2013 at 01:37:51PM -0700, Anatol Pomozov wrote: > Hi > > On Wed, Sep 4, 2013 at 9:07 AM, Tejun Heo wrote: > > Hello, > > > > On Wed, Sep 04, 2013 at 08:45:33AM -0700, Anatol Pomozov wrote: > >> I am not

Re: Race condition between "read CFQ stats" and "block device shutdown"

2013-09-26 Thread Tejun Heo
Hey, Hannes. On Thu, Sep 26, 2013 at 04:18:34PM +0200, Hannes Reinecke wrote: > However, none of the modern devices should be using this lock > switching, so I would just ignore it. > EG SCSI most definitely doesn't use it. The kernel is crashing from it, so I don't think ignoring is an acceptabl

Re: Race condition between "read CFQ stats" and "block device shutdown"

2013-09-26 Thread Tejun Heo
Hello, On Thu, Sep 26, 2013 at 09:23:19AM -0700, Anatol Pomozov wrote: > We use modified version of "sbull" block device driver from GKH book. > We use it for testing block device startup/shutdown path + CFQ > manipulation. > > The sbull driver uses function > blk_init_queue(..., &dev->qlock); >

Re: sysfs methods can race with ->remove

2015-01-15 Thread Tejun Heo
Hello, Alan. On Thu, Jan 15, 2015 at 01:22:03PM -0500, Alan Stern wrote: > > It has a reference to keep it from beeing freed, but so far I can't find > > anything that prevents ->remove from beeing called while we are in or > > just before a method call. > > There are two types of methods to thin

Re: [PATCH v4 00/11] scsi: fix module reference mismatch for scsi host

2015-01-19 Thread Tejun Heo
On Mon, Jan 19, 2015 at 12:05:58AM +0900, Akinobu Mita wrote: > While accessing a scsi_device, the use count of the underlying LLDD > module is incremented. The module reference is retrieved through > .module field of struct scsi_host_template. > > This mapping between scsi_device and underlying

Re: [PATCH v4 00/11] scsi: fix module reference mismatch for scsi host

2015-01-20 Thread Tejun Heo
Hello, Akinobu. On Tue, Jan 20, 2015 at 11:57:37PM +0900, Akinobu Mita wrote: > The reason I didn't move sht from the core driver to the LLDDs for > fixing ufs and ums-* in the first place is to avoid exporting many > symbols for callbacks in sht. But I realized that we can do it > without that m

[PATCH 23/32] scsi: use %*pb[l] to print bitmaps including cpumasks and nodemasks

2015-01-24 Thread Tejun Heo
s() Please wait till the forementioned patches are merged to mainline before applying to subsystem trees. Signed-off-by: Tejun Heo Cc: Andrew Morton Cc: "James E.J. Bottomley" Cc: linux-scsi@vger.kernel.org --- drivers/scsi/scsi_debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3

Re: [PATCH 1/2] ata: ahci_platform: fix owner module reference mismatch for scsi host

2015-01-27 Thread Tejun Heo
Hello, On Tue, Jan 27, 2015 at 08:34:58AM +0900, Akinobu Mita wrote: > The owner module reference of the ahci platform's scsi_host is > initialized to libahci_platform's one, because these drivers use a > scsi_host_template defined in libahci_platform. So these drivers can > be unloaded even if t

Re: [PATCH] ahci_xgene: Fix the dma state machine lockup for the ATA_CMD_SMART PIO mode command.

2015-01-27 Thread Tejun Heo
On Tue, Jan 27, 2015 at 11:26:11PM +0530, Suman Tripathi wrote: > This patch addresses the issue with ATA_CMD_SMART pio mode > command for enumeration and device detection with ATA devices.It is the > same issue as in patch > > www.spinics.net/lists/linux-ide/msg49092.html The link is broken. Ca

Re: [PATCH v2 2/2] ata: pata_platform: fix owner module reference mismatch for scsi host

2015-01-28 Thread Tejun Heo
an be unloaded even if the scsi device is being accessed. > > This fixes it by propagating the scsi_host_template to pata_of_platform > driver. The scsi_host_template is passed through a new > argument of __pata_platform_probe(). > > Signed-off-by: Akinobu Mita > Cc: Hans

Re: [PATCH v3] ahci_xgene: Fix the dma state machine lockup for the ATA_CMD_SMART PIO mode command.

2015-02-03 Thread Tejun Heo
On Mon, Feb 02, 2015 at 11:37:19PM +0530, Suman Tripathi wrote: > This patch addresses the issue with ATA_CMD_SMART pio mode > command for enumeration and device detection with ATA devices. > The X-Gene AHCI controller has an errata in which it cannot clear > the BSY bit after the PIO setup FIS. Th

Re: [PATCH] hpsa: correct compiler warnings introduced by hpsa-add-local-workqueue patch

2015-02-10 Thread Tejun Heo
On Tue, Feb 10, 2015 at 08:56:30AM -0800, James Bottomley wrote: > > + wq = alloc_ordered_workqueue("%s_%d_hpsa", 0, name, h->ctlr); > > It's not an objection to your patch, but what idiot did this? There's > an extra variable there between the format and the arguments. That > makes the patter

Re: [PATCH v1] ata: ahci_xgene: Add AHCI Support for second generation of APM X-Gene SoC

2015-04-01 Thread Tejun Heo
On Wed, Apr 01, 2015 at 08:18:02PM +0530, Suman Tripathi wrote: > This patch enables full AHCI feature support for APM X-Gene SoC SATA host host > controller. The following errata's are removed: > > 1. 2a0bdff6b95 ("ahci-xgene: fix the dma state machine lockup for the > IDENTIFY D

Re: [PATCH v1] ata: ahci_xgene: Add AHCI Support for second generation of APM X-Gene SoC

2015-04-01 Thread Tejun Heo
On Wed, Apr 01, 2015 at 12:13:36PM -0400, Tejun Heo wrote: > > Signed-off-by : Suman Tripathi > > Applied to libata/for-4.1 w/ minor edit. Reverted due to build failure from missing asm/cputype.h. Suman, you're the develper and familiar with how the prerequisite patches

Re: [PATCH v1] ata: ahci_xgene: Add AHCI Support for second generation of APM X-Gene SoC

2015-04-01 Thread Tejun Heo
On Wed, Apr 01, 2015 at 05:39:56PM +0100, Russell King - ARM Linux wrote: > On Wed, Apr 01, 2015 at 12:31:16PM -0400, Tejun Heo wrote: > > On Wed, Apr 01, 2015 at 12:13:36PM -0400, Tejun Heo wrote: > > > > Signed-off-by : Suman Tripathi > > > > > >

Re: ahci Port to Host interrupt as edge trigger

2015-04-17 Thread Tejun Heo
On Fri, Apr 17, 2015 at 04:22:17PM +0530, Suman Tripathi wrote: > Hi , > > I need some suggestion . > > From the below interrupt handler in libahci.c it explains that the > interrupt from port to Host is level triggered. Do we have any > existing implementation that handles the port to Host as E

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-11-27 Thread Tejun Heo
Hey, Rafael. On Wed, Nov 28, 2012 at 01:51:00AM +0100, Rafael J. Wysocki wrote: > Having considered that a bit more I'm now thinking that in fact the power > state > the device is in at the moment doesn't really matter, so the polling code need > not really know what PM is doing. What it needs t

Re: [PATCH v6 03/13] block: Avoid that request_fn is invoked on a dead queue

2012-12-02 Thread Tejun Heo
chance to run the queue. > > Signed-off-by: Bart Van Assche > Cc: James Bottomley > Cc: Mike Christie > Cc: Jens Axboe > Cc: Tejun Heo > Cc: Chanho Min Acked-by: Tejun Heo > +inline void __blk_run_queue_uncond(struct request_queue *q) Does this inline actually

Re: [PATCH v6 04/13] block: Avoid scheduling delayed work on a dead queue

2012-12-02 Thread Tejun Heo
test in queue_unplugged() since it is now > superfluous: __blk_run_queue() already tests whether or not the > queue is dead. > > Signed-off-by: Bart Van Assche > Cc: Tejun Heo > Cc: Mike Christie > Cc: Jens Axboe Acked-by: Tejun Heo But, some nits. > @@ -219

Re: [PATCH v6 05/13] block: Make blk_cleanup_queue() wait until request_fn finished

2012-12-02 Thread Tejun Heo
l outstanding request_fn > invocations to finish. > > Signed-off-by: Bart Van Assche > Reported-by: Chanho Min > Cc: James Bottomley > Cc: Mike Christie > Cc: Jens Axboe > Cc: Tejun Heo Acked-by: Tejun Heo Thanks. -- tejun -- To unsubscribe from this list: send th

Re: [PATCH v6 06/13] bsg: Remove unused function bsg_goose_queue()

2012-12-02 Thread Tejun Heo
On Wed, Nov 28, 2012 at 01:47:36PM +0100, Bart Van Assche wrote: > The function bsg_goose_queue() does not have any in-tree callers, > so let's remove it. > > Signed-off-by: Bart Van Assche > Cc: Jens Axboe > Cc: Tejun Heo Acked-by: Tejun Heo -- tejun -- To unsubscri

Re: [PATCH v6 07/13] Fix race between starved list processing and device removal

2012-12-02 Thread Tejun Heo
Hello, Bart. On Wed, Nov 28, 2012 at 01:48:24PM +0100, Bart Van Assche wrote: > @@ -452,11 +452,13 @@ static void scsi_run_queue(struct request_queue *q) > continue; > } > > - spin_unlock(shost->host_lock); > - spin_lock(sdev->request_q

Re: [PATCH v6 08/13] Remove get_device() / put_device() pair from scsi_request_fn()

2012-12-02 Thread Tejun Heo
e get_device() / put_device() pair from > scsi_request_fn(). > > Signed-off-by: Bart Van Assche > Acked-by: Tejun Heo > Cc: James Bottomley > Cc: Mike Christie > Cc: Jens Axboe Acked-by: Tejun Heo with one nit. > @@ -1643,11 +1641,7 @@ out_delay

Re: [PATCH v6 09/13] Avoid saving/restoring interrupt state inside scsi_remove_host()

2012-12-02 Thread Tejun Heo
omley > Cc: Tejun Heo > Cc: Mike Christie > Cc: Hannes Reinecke Acked-by: Tejun Heo It would be nice to note that this doesn't make any functional difference in the commit message. Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-scs

Re: [PATCH v6 10/13] Make scsi_remove_host() wait for device removal

2012-12-02 Thread Tejun Heo
all devices associated with the host has finished. That avoids > that queuecommand() gets invoked after scsi_remove_host() > finished. Also, avoid adding new SCSI devices after > scsi_remove_host() started. > > Signed-off-by: Bart Van Assche > Cc: Tejun Heo > Cc: James Bottomley

Re: [PATCH v6 10/13] Make scsi_remove_host() wait for device removal

2012-12-02 Thread Tejun Heo
Hey, again. On Sun, Dec 02, 2012 at 05:45:15AM -0800, Tejun Heo wrote: > > +/* Return true if and only if scsi_remove_host() is allowed to finish. */ > > +static bool __scsi_remove_host_done(struct Scsi_Host *shost) > > +{ > > + lockdep_assert_held(shost->host_

Re: [PATCH v6 11/13] Make scsi_remove_host() wait until error handling finished

2012-12-02 Thread Tejun Heo
Hello, Bart. On Wed, Nov 28, 2012 at 01:52:51PM +0100, Bart Van Assche wrote: > A SCSI LLD may start cleaning up host resources as soon as > scsi_remove_host() returns. These host resources may be needed by > the LLD in an implementation of one of the eh_* functions. So if > one of the eh_* functi

Re: [PATCH v6 12/13] Avoid that scsi_device_set_state() triggers a race

2012-12-02 Thread Tejun Heo
On Wed, Nov 28, 2012 at 01:53:24PM +0100, Bart Van Assche wrote: > Make concurrent invocations of scsi_device_set_state() safe. > > Signed-off-by: Bart Van Assche > Cc: James Bottomley > Cc: Tejun Heo > Cc: Hannes Reinecke > Cc: Mike Christie Acked-by: Tejun Heo Yea

Re: [PATCH v6 13/13] Do not queue new I/O after scsi_remove_host() started

2012-12-02 Thread Tejun Heo
Hello, On Wed, Nov 28, 2012 at 01:53:58PM +0100, Bart Van Assche wrote: > The function scsi_remove_host() may get invoked concurrently with > scsi_request_fn(). Kill those I/O requests for which processing > starts after scsi_remove_host() has been invoked. This makes > device removal a little qui

Re: [PATCH v6 04/13] block: Avoid scheduling delayed work on a dead queue

2012-12-02 Thread Tejun Heo
Hello, Bart. On Sun, Dec 02, 2012 at 02:41:20PM +0100, Bart Van Assche wrote: > I agree. There is a reason though I have not yet added a > lockdep_assert_held() statement in these functions: there are still > unprotected calls of blk_run_queue_async() in drivers/md/dm.c and > drivers/scsi/scsi_tra

Re: [PATCH 0/13 v6] More device removal fixes

2012-12-02 Thread Tejun Heo
Hello, Bart. On Wed, Nov 28, 2012 at 01:39:53PM +0100, Bart Van Assche wrote: > Fix a few race conditions that can be triggered by removing a device: > - Avoid that request_fn() can be invoked on a dead queue. > - Avoid that blk_cleanup_queue() can finish while request_fn is still > running. > -

Re: [PATCH v6 10/13] Make scsi_remove_host() wait for device removal

2012-12-03 Thread Tejun Heo
Hello, Bart. On Mon, Dec 03, 2012 at 09:23:59AM +0100, Bart Van Assche wrote: > On 12/02/12 14:45, Tejun Heo wrote: > >On Wed, Nov 28, 2012 at 01:51:13PM +0100, Bart Van Assche wrote: > >>+/* Test whether scsi_remove_host() may finish, and if so, wake i

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-03 Thread Tejun Heo
Hello, James. On Mon, Dec 03, 2012 at 08:25:43AM +, James Bottomley wrote: > > diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h > > index e65c62e..1756151 100644 > > --- a/include/scsi/scsi_device.h > > +++ b/include/scsi/scsi_device.h > > @@ -160,6 +160,7 @@ struct scsi_de

Re: [PATCH v6 10/13] Make scsi_remove_host() wait for device removal

2012-12-03 Thread Tejun Heo
Hello, Bart. On Mon, Dec 03, 2012 at 05:38:52PM +0100, Bart Van Assche wrote: > It is indeed possible to invoke complete() only if the device list > became empty with the host state equal to SHOST_CANCEL, > SHOST_CANCEL_RECOVERY, SHOST_DEL or SHOST_DEL_RECOVERY and in We can test this with !scsi_

Re: [PATCH] megaraid: fix use of delayed work

2012-12-04 Thread Tejun Heo
memories > allocated > by others. > > With commit 8852aac, schedule_delayed_work() will check dwork->timer before > queue_work, this will cause megaraid code to hit the BUG_ON in workqueue code. > Change megaraid code to use delayed work. > > Signed-off-by: Xiaotian Feng >

[PATCH 1/2] megaraid: fix BUG_ON() from incorrect use of delayed work

2012-12-04 Thread Tejun Heo
ode to hit the BUG_ON() in workqueue code. Change megaraid code to use delayed work. Signed-off-by: Xiaotian Feng Signed-off-by: Tejun Heo Cc: Neela Syam Kolli Cc: "James E.J. Bottomley" Cc: linux-scsi@vger.kernel.org --- drivers/scsi/megaraid/megaraid_sas.h | 2 +- drivers/sc

[PATCH 2/2] workqueue: convert BUG_ON()s in __queue_delayed_work() to WARN_ON_ONCE()s

2012-12-04 Thread Tejun Heo
>From 87aa1e796ff6d491b5ed4e5663e5a4e449ac513b Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Tue, 4 Dec 2012 07:40:39 -0800 8852aac25e ("workqueue: mod_delayed_work_on() shouldn't queue timer on 0 delay") unexpectedly uncovered a very nasty abuse of delayed_work in megar

Re: [PATCH] megaraid: fix use of delayed work

2012-12-04 Thread Tejun Heo
Hello, again, Xiaotian. On Tue, Dec 04, 2012 at 07:39:39AM -0800, Tejun Heo wrote: > Urgh... what the Didn't see that one coming. I'm gonna push this > to Linus through the workqueue tree. > > Thanks for the fix. It seems like megaraid doesn't have any reason

[GIT PULL] workqueue fixes for 3.7-rc8

2012-12-04 Thread Tejun Heo
t/tj/wq.git for-3.7-fixes -------- Tejun Heo (1): workqueue: convert BUG_ON()s in __queue_delayed_work() to WARN_ON_ONCE()s Xiaotian Feng (1): megaraid: fix BUG_ON() from incorrect use of delayed work drivers/scsi/megaraid/megaraid_sas.h | 2 +- drivers/scsi/meg

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-10 Thread Tejun Heo
Hello, guys. On Mon, Dec 10, 2012 at 11:26:07AM +0800, Aaron Lu wrote: > >>> The problem here is there's no easy to reach genhd from libata (or the > >>> other way around) without going through sr. I think we're gonna have > >>> to have something in sr one way or the other. > >> > >> Can't we do

Re: [PATCH] megaraid: convert to work_struct

2012-12-18 Thread Tejun Heo
On Thu, Dec 13, 2012 at 04:53:18PM +0800, Xiaotian Feng wrote: > There's no need to use delayed work, convert to use work_struct and > cancel_work_sync(). > > Requested-by: Tejun Heo > Signed-off-by: Xiaotian Feng > Cc: Neela Syam Kolli > Cc: "James E.

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-25 Thread Tejun Heo
Hello, Aaron. On Thu, Dec 20, 2012 at 02:07:25PM +0800, Aaron Lu wrote: > +static int is_gendisk_part0(struct device *dev, void *data) > +{ > + struct device **child = data; > + > + if (dev->class == &block_class && dev->type == &disk_type) { > + *child = dev; > + r

Re: [PATCH v9 06/10] ata: zpodd: check zero power ready status

2012-12-28 Thread Tejun Heo
Hello, On Wed, Dec 26, 2012 at 09:42:14AM +0800, Aaron Lu wrote: > > This is really a round-about way to find out the matching device and > > it wouldn't work if the disk device nests deeper. Doesn't really look > > like a good idea to me. > > I don't quite understand the 'disk device nests deep

Re: [PATCH v11 2/9] libata: Add CONFIG_SATA_ZPODD

2013-01-07 Thread Tejun Heo
On Sun, Jan 06, 2013 at 10:48:22AM +0800, Aaron Lu wrote: > Added a new config CONFIG_SATA_ZPODD, which is used to support > SATA based zero power ODD(ZPODD), and depends on ATA_ACPI. > > Signed-off-by: Aaron Lu Maybe just fold this into the next patch? It's rather unconventional to introduce t

Re: [PATCH v11 3/9] libata: identify and init ZPODD devices

2013-01-07 Thread Tejun Heo
On Sun, Jan 06, 2013 at 10:48:23AM +0800, Aaron Lu wrote: > diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c > index ef01ac0..5aa7322 100644 > --- a/drivers/ata/libata-acpi.c > +++ b/drivers/ata/libata-acpi.c > @@ -1063,6 +1063,8 @@ void ata_acpi_bind(struct ata_device *dev) > >

Re: [PATCH v11 4/9] libata: move acpi notification code to zpodd

2013-01-07 Thread Tejun Heo
On Sun, Jan 06, 2013 at 10:48:24AM +0800, Aaron Lu wrote: > @@ -7,6 +9,9 @@ struct zpodd { > bool slot:1; > bool drawer:1; > > + /* The following bits are synchronized by PM core */ > + bool from_notify:1; /* resumed as a result of acpi notification */ > + > struct ata_d

Re: [PATCH v11 5/9] libata: check zero power ready status for ZPODD

2013-01-07 Thread Tejun Heo
Hello, Aaron. On Sun, Jan 06, 2013 at 10:48:25AM +0800, Aaron Lu wrote: > +/* Check zero power ready status */ > +void zpodd_on_suspend(struct ata_device *dev) > +{ > + struct zpodd *zpodd = dev->zpodd; > + unsigned long expires; > + > + if (!zpready(dev)) { > + zpodd->zp_r

Re: [PATCH v11 7/9] libata: expose pm qos flags for ata device

2013-01-07 Thread Tejun Heo
On Sun, Jan 06, 2013 at 10:48:27AM +0800, Aaron Lu wrote: > Expose pm qos flags to user space so that user has a chance to disable > pm features like power off, if he/she has a broken platform or devices > or simply does not like this pm feature. > > This flag is exposed to user space only for ata

Re: [PATCH v11 8/9] libata: no poll when ODD is powered off

2013-01-07 Thread Tejun Heo
On Sun, Jan 06, 2013 at 10:48:28AM +0800, Aaron Lu wrote: > When the ODD is powered off, any action the user did to the ODD that > would generate a media event will trigger an ACPI interrupt, so the > poll for media event is no longer necessary. And the poll will also > cause a runtime status chang

Re: [PATCH v11 6/9] libata: handle power transition of ODD

2013-01-07 Thread Tejun Heo
On Sun, Jan 06, 2013 at 10:48:26AM +0800, Aaron Lu wrote: > +bool zpodd_zpready(struct ata_device *dev) > +{ > + struct zpodd *zpodd = dev->zpodd; > + return zpodd->zp_ready; > +} > + > +void zpodd_pre_poweroff(struct ata_device *dev) > +{ > + struct zpodd *zpodd = dev->zpodd; > + > +

Re: [PATCH v11 0/9] ZPODD Patches

2013-01-07 Thread Tejun Heo
Hello, Aaron. On Sun, Jan 06, 2013 at 10:48:20AM +0800, Aaron Lu wrote: > v11: > Introduce event_driven flag in scsi_device to silence the media event > poll after ODD is powered off; > Removed ata layer PM QOS control, instead, simply limit ACPI state to > D3_HOT when choosing state; > Make the p

Re: [PATCH v11 3/9] libata: identify and init ZPODD devices

2013-01-08 Thread Tejun Heo
Hello, Aaron. On Tue, Jan 08, 2013 at 05:07:46PM +0800, Aaron Lu wrote: > >> +struct zpodd { > >> + bool slot:1; > >> + bool drawer:1; > >> + > >> + struct ata_device *dev; > >> +}; > > > > Field names are usually indented. It would be nice to have a comment > > checkscript.sh doesn't seem l

Re: [PATCH v12 2/9] libata: identify and init ZPODD devices

2013-01-10 Thread Tejun Heo
ly build ZPODD code. > > Signed-off-by: Aaron Lu Acked-by: Tejun Heo Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v12 3/9] libata: move acpi notification code to zpodd

2013-01-10 Thread Tejun Heo
check if the acpi_device for the handle exists or not as the > odd_can_poweroff function already checked that. > > Signed-off-by: Aaron Lu Acked-by: Tejun Heo Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to maj

Re: [PATCH v12 4/9] libata: check zero power ready status for ZPODD

2013-01-10 Thread Tejun Heo
Hello, Aaron. On Thu, Jan 10, 2013 at 05:24:25PM +0800, Aaron Lu wrote: > +/* > + * Update the zpodd->zp_ready field. This field will only be set > + * if the ODD has stayed in ZP ready state for zpodd_poweroff_delay > + * time, and will be used to decide if power off is allowed. If it > + * is se

Re: [PATCH v12 5/9] libata: handle power transition of ODD

2013-01-10 Thread Tejun Heo
> > Signed-off-by: Aaron Lu Acked-by: Tejun Heo -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v12 6/9] libata: expose pm qos flags for ata device

2013-01-10 Thread Tejun Heo
r ZPODD devices. > > Signed-off-by: Aaron Lu Acked-by: Tejun Heo Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v12 7/9] libata: scsi: no poll when ODD is powered off

2013-01-10 Thread Tejun Heo
On Thu, Jan 10, 2013 at 05:24:28PM +0800, Aaron Lu wrote: > @@ -182,6 +182,13 @@ void zpodd_enable_run_wake(struct ata_device *dev) > { > struct zpodd *zpodd = dev->zpodd; > > + /* > + * Silence the media change poll, as we will be notified when > + * user wants to use the OD

Re: [PATCH v12 8/9] libata: do not suspend port if normal ODD is attached

2013-01-10 Thread Tejun Heo
very little while the ODD may > malfunction after constantly being reset. So the idle callback > here will not proceed to suspend if a non-ZPODD capable ODD is > attached to the port. > > Signed-off-by: Aaron Lu Acked-by: Tejun Heo Thanks. -- tejun -- To unsubscribe fr

Re: [PATCH v12 7/9] libata: scsi: no poll when ODD is powered off

2013-01-10 Thread Tejun Heo
Hello, Aaron. On Fri, Jan 11, 2013 at 10:11:10AM +0800, Aaron Lu wrote: > > What's the synchronization rule for this field? > > I documented the rule in include/scsi/scsi_device.h. > > This field is modified in the ata port's runtime suspend and resume > callback, and is read accessed in the che

Re: [PATCH v12 7/9] libata: scsi: no poll when ODD is powered off

2013-01-11 Thread Tejun Heo
Hello, On Fri, Jan 11, 2013 at 11:16:26AM +0800, Aaron Lu wrote: > OK, will make it atomic in next version, thanks for the advice. > > Perhaps I can add two scsi helper functions in scsi_lib.c like: > > void sdev_disable_disk_events(struct scsi_device *sdev) > { > atomic_inc(&sdev->disk_ev

<    1   2   3   4   5   6   7   8   >