Re: [PATCH v7 3/4] block: implement runtime pm strategy

2013-01-16 Thread Aaron Lu
On Wed, Jan 16, 2013 at 10:30:45AM -0500, Alan Stern wrote: > On Wed, 16 Jan 2013, Aaron Lu wrote: > > > From: Lin Ming > > > > When a request is added: > > If device is suspended or is suspending and the request is not a > > PM request, resume the device. > > > > When the last request

Re: [PATCH] cxgb4i: Remove the scsi host device when removing device

2013-01-16 Thread Mike Christie
On 01/11/2013 01:12 PM, Thadeu Lima de Souza Cascardo wrote: > When doing a hotplug remove of a cxgb4 device, there are still dandling > symlinks at /sys/class/scsi_host/hostX to the removed PCI device. The > upper layer device may also try to send data, which may crash the > system. > > The DETAC

Re: [PATCH v7 3/4] block: implement runtime pm strategy

2013-01-16 Thread Aaron Lu
On Wed, Jan 16, 2013 at 10:30:45AM -0500, Alan Stern wrote: > On Wed, 16 Jan 2013, Aaron Lu wrote: > > > From: Lin Ming > > > > When a request is added: > > If device is suspended or is suspending and the request is not a > > PM request, resume the device. > > > > When the last request

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-16 Thread Tejun Heo
On Wed, Jan 16, 2013 at 10:32:35AM +, James Bottomley wrote: > diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c > index 6b2fb87..ab88c5b 100644 > --- a/arch/arm/mm/dma-mapping.c > +++ b/arch/arm/mm/dma-mapping.c > @@ -809,7 +809,7 @@ static void dma_cache_maint_page(struct pag

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-16 Thread Russell King - ARM Linux
On Wed, Jan 16, 2013 at 10:32:35AM +, James Bottomley wrote: > On Wed, 2013-01-16 at 12:07 +0530, Subhash Jadavani wrote: > > > Now consider this call stack from MMC block driver (this is on the ARmv7 > > based board): > > [ 98.918174] [] (v7_dma_inv_range+0x30/0x48) from > > [] (dma_

Re: [PATCH v13 1/9] scsi: sr: support runtime pm

2013-01-16 Thread Alan Stern
On Wed, 16 Jan 2013, James Bottomley wrote: > On Tue, 2013-01-15 at 17:20 +0800, Aaron Lu wrote: > > This patch adds runtime pm support for sr. > > > > It did this by increasing the runtime usage_count of the device when: > > - its block device is opened; > > - the events checking is to run. > >

Re: [PATCH V5 3/4] [SCSI] ufs: Add Platform glue driver for ufshcd

2013-01-16 Thread vinayak holikatti
On Fri, Jan 11, 2013 at 6:00 PM, Subhash Jadavani wrote: > On 1/11/2013 4:11 PM, Sujit Reddy Thumma wrote: >> >> On 1/9/2013 5:41 PM, vinayak holikatti wrote: >>> >>> On Mon, Jan 7, 2013 at 1:11 PM, Sujit Reddy Thumma >>> wrote: Hi Vinayak, I have few comments below:

Re: [PATCH v13 1/9] scsi: sr: support runtime pm

2013-01-16 Thread James Bottomley
On Tue, 2013-01-15 at 17:20 +0800, Aaron Lu wrote: > This patch adds runtime pm support for sr. > > It did this by increasing the runtime usage_count of the device when: > - its block device is opened; > - the events checking is to run. > > And decreasing the runtime usage_count of the device whe

Re: [PATCH v7 3/4] block: implement runtime pm strategy

2013-01-16 Thread Alan Stern
On Wed, 16 Jan 2013, Aaron Lu wrote: > From: Lin Ming > > When a request is added: > If device is suspended or is suspending and the request is not a > PM request, resume the device. > > When the last request finishes: > Call pm_runtime_mark_last_busy(). > > When pick a request: >

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-16 Thread Subhash Jadavani
On 1/16/2013 4:02 PM, James Bottomley wrote: On Wed, 2013-01-16 at 12:07 +0530, Subhash Jadavani wrote: Now consider this call stack from MMC block driver (this is on the ARmv7 based board): [ 98.918174] [] (v7_dma_inv_range+0x30/0x48) from [] (dma_cache_maint_page+0x1c4/0x24c) [

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-16 Thread James Bottomley
On Wed, 2013-01-16 at 12:07 +0530, Subhash Jadavani wrote: > Now consider this call stack from MMC block driver (this is on the ARmv7 > based board): > [ 98.918174] [] (v7_dma_inv_range+0x30/0x48) from > [] (dma_cache_maint_page+0x1c4/0x24c) > [ 98.927819] [] (dma_cache_maint_page+

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-16 Thread James Bottomley
On Wed, 2013-01-16 at 12:07 +0530, Subhash Jadavani wrote: > On 1/15/2013 9:49 PM, James Bottomley wrote: > > On Tue, 2013-01-15 at 21:31 +0530, Subhash Jadavani wrote: > >> blk_rq_map_sg() function merges the physically contiguous pages to use same > >> scatter-gather node without checking if thei

[PATCH v7 0/4] block layer runtime pm

2013-01-16 Thread Aaron Lu
In August 2010, Jens and Alan discussed about "Runtime PM and the block layer". http://marc.info/?t=12825910841&r=1&w=2 And then Alan has given a detailed implementation guide: http://marc.info/?l=linux-scsi&m=133727953625963&w=2 To test: # ls -l /sys/block/sda /sys/devices/pci:00/:00:

[PATCH v7 2/4] block: add runtime pm helpers

2013-01-16 Thread Aaron Lu
From: Lin Ming Add runtime pm helper functions: void blk_pm_runtime_init(struct request_queue *q, struct device *dev) - Initialization function for drivers to call. int blk_pre_runtime_suspend(struct request_queue *q) - If any requests are in the queue, mark last busy and return -EBUSY.

[PATCH v7 1/4] block: add a flag to identify PM request

2013-01-16 Thread Aaron Lu
From: Lin Ming Add a flag REQ_PM to identify the request is PM related, such requests will not change the device request queue's runtime status. It is intended to be used in driver's runtime PM callback, so that driver can perform some IO to the device there with the queue's runtime status unaffe

[PATCH v7 4/4] sd: change to auto suspend mode

2013-01-16 Thread Aaron Lu
From: Lin Ming Uses block layer runtime pm helper functions in scsi_runtime_suspend/resume. Remove scsi_autopm_* from sd open/release path and check_events path. And remove the quiesce call in runtime suspend path, as we know there is no request to quiesce for the device. Signed-off-by: Lin Ming

[PATCH v7 3/4] block: implement runtime pm strategy

2013-01-16 Thread Aaron Lu
From: Lin Ming When a request is added: If device is suspended or is suspending and the request is not a PM request, resume the device. When the last request finishes: Call pm_runtime_mark_last_busy(). When pick a request: If device is resuming/suspending, then only PM request i