[PATCH 0/2] Migrate SCSI drivers to use dev_pm_ops

2012-10-10 Thread Aaron Lu
The 2 patches will migrate SCSI drivers to use the pm callbacks defined in dev_pm_ops as pm_message is deprecated and should not be used by driver. Bus level callback is changed to use callbacks defined in dev_pm_ops when needed and sd's pm callback is updated to use what are defined in

[PATCH 1/2] [SCSI] pm: use callbacks from dev_pm_ops for scsi devices

2012-10-10 Thread Aaron Lu
Use of pm_message_t is deprecated and device driver is not supposed to use that. This patch tries to migrate the SCSI bus level pm callbacks to call device's pm callbacks defined in its driver's dev_pm_ops. NO logic changes in scsi_pm.c, a new function called run_dev_callback is added, which will

[PATCH 2/2] [SCSI] sd: update sd to use the new pm callbacks

2012-10-10 Thread Aaron Lu
Update sd driver to use the callbacks defined in dev_pm_ops. sd_freeze is NULL, the bus level callback has taken care of quiescing the device so there should be nothing needs to be done here. Consequently, sd_thaw is not needed here either. Both suspend and poweroff shares the same routine

[PATCH] sd: Reshuffle init_sd to avoid crash

2012-10-10 Thread Hannes Reinecke
scsi_register_driver will register a prep_fn() function, which in turn migh need to use the sd_cdp_pool for DIF. Which hasn't been initialised at this point, leading to a crash. So reshuffle the init_sd() and exit_sd() paths to have the driver registered last. Signed-off-by: Joel D. Diaz

Re: [PATCH] sd: Reshuffle init_sd to avoid crash

2012-10-10 Thread James Bottomley
On Wed, 2012-10-10 at 10:36 +0200, Hannes Reinecke wrote: scsi_register_driver will register a prep_fn() function, which in turn migh need to use the sd_cdp_pool for DIF. Which hasn't been initialised at this point, leading to a crash. So reshuffle the init_sd() and exit_sd() paths to have

Re: [PATCH] sd: Reshuffle init_sd to avoid crash

2012-10-10 Thread Hannes Reinecke
On 10/10/2012 11:55 AM, James Bottomley wrote: On Wed, 2012-10-10 at 10:36 +0200, Hannes Reinecke wrote: scsi_register_driver will register a prep_fn() function, which in turn migh need to use the sd_cdp_pool for DIF. Which hasn't been initialised at this point, leading to a crash. So reshuffle

[PATCH 0/7] qla4xxx: Updates for scsi misc branch

2012-10-10 Thread vikas . chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com James, Please apply the following patches to the scsi tree at your earliest convenience. Thanks, Vikas. Adheer Chandravanshi (1): qla4xxx: Added new BSG command QLISCSI_VND_ABOUT_FIRMWARE Harish Zunjarrao (3): qla4xxx: Allow reset

[PATCH 1/7] qla4xxx: Allow reset in link down case

2012-10-10 Thread vikas . chaudhary
From: Harish Zunjarrao harish.zunjar...@qlogic.com Signed-off-by: Harish Zunjarrao harish.zunjar...@qlogic.com Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com --- drivers/scsi/qla4xxx/ql4_os.c |8 1 files changed, 0 insertions(+), 8 deletions(-) diff --git

[PATCH 6/7] qla4xxx: Add get DDB support using BSG.

2012-10-10 Thread vikas . chaudhary
From: Manish Rangankar manish.rangan...@qlogic.com Signed-off-by: Manish Rangankar manish.rangan...@qlogic.com Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com --- drivers/scsi/qla4xxx/ql4_bsg.c | 84 +++ drivers/scsi/qla4xxx/ql4_bsg.h |1 +

[PATCH 3/7] qla4xxx: Invoke Set Address Control Block using BSG

2012-10-10 Thread vikas . chaudhary
From: Harish Zunjarrao harish.zunjar...@qlogic.com Signed-off-by: Harish Zunjarrao harish.zunjar...@qlogic.com Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com --- drivers/scsi/qla4xxx/ql4_bsg.c | 77 drivers/scsi/qla4xxx/ql4_bsg.h |1 + 2

[PATCH 5/7] qla4xxx: Add get default DDB support using BSG.

2012-10-10 Thread vikas . chaudhary
From: Manish Rangankar manish.rangan...@qlogic.com Signed-off-by: Manish Rangankar manish.rangan...@qlogic.com Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com --- drivers/scsi/qla4xxx/ql4_bsg.c | 79 +++ drivers/scsi/qla4xxx/ql4_bsg.h |1 +

[PATCH 7/7] qla4xxx: Update driver version to 5.03.00-k2

2012-10-10 Thread vikas . chaudhary
From: Vikas Chaudhary vikas.chaudh...@qlogic.com Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com --- drivers/scsi/qla4xxx/ql4_version.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_version.h b/drivers/scsi/qla4xxx/ql4_version.h

Re: [PATCH] sd: Reshuffle init_sd to avoid crash

2012-10-10 Thread James Bottomley
On Wed, 2012-10-10 at 12:01 +0200, Hannes Reinecke wrote: On 10/10/2012 11:55 AM, James Bottomley wrote: On Wed, 2012-10-10 at 10:36 +0200, Hannes Reinecke wrote: scsi_register_driver will register a prep_fn() function, which in turn migh need to use the sd_cdp_pool for DIF. Which hasn't

Re: [SCSI] hpsa: dial down lockup detection during firmware flash

2012-10-10 Thread scameron
Yes, I think so. Thanks. -- steve On Wed, Oct 10, 2012 at 04:47:38AM +0100, Ben Hutchings wrote: Should this fix for hpsa be included in stable updates? It looks like it would be needed in 3.2.y and 3.4.y, as lockup detection was introduced in 3.2 and the fix went into 3.5. commit

[PATCH 0/4 v4] More device removal fixes

2012-10-10 Thread Bart Van Assche
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. - Fix a race between starved list processing and device removal. These patches have

[PATCH 1/4] block: Rename queue dead flag

2012-10-10 Thread Bart Van Assche
QUEUE_FLAG_DEAD is used to indicate that queuing new requests must stop. After this flag has been set queue draining starts. However, during the queue draining phase it is still safe to invoke the queue's request_fn, so QUEUE_FLAG_DYING is a better name for this flag. This patch is the result of

[PATCH 2/4] block: Avoid that request_fn is invoked on a dead queue

2012-10-10 Thread Bart Van Assche
A block driver may start cleaning up resources needed by its request_fn as soon as blk_cleanup_queue() finished, so request_fn must not be invoked after draining finished. Cc: James Bottomley jbottom...@parallels.com Cc: Mike Christie micha...@cs.wisc.edu Cc: Jens Axboe ax...@kernel.dk Cc: Tejun

[PATCH 3/4] Make blk_cleanup_queue() wait until request_fn finished

2012-10-10 Thread Bart Van Assche
Some request_fn implementations, e.g. scsi_request_fn(), unlock the queue lock. Make sure that blk_cleanup_queue() waits until all active request_fn invocations have finished. This fixes a potential use-after-free at the end of scsi_request_fn(). Also, change the type of the 'drain' variable from

[PATCH 4/4] Fix race between starved list processing and device removal

2012-10-10 Thread Bart Van Assche
Avoid that the sdev reference count can drop to zero before the queue is run by scsi_run_queue(). Also avoid that the sdev reference count can drop to zero in the same function by invoking __blk_run_queue(). Reported-and-tested-by: Chanho Min chanho@lge.com Reference:

Re: [PATCH 0/7] qla4xxx: Updates for scsi misc branch

2012-10-10 Thread Michael Christie
On Oct 10, 2012, at 6:24 AM, vikas.chaudh...@qlogic.com wrote: From: Vikas Chaudhary vikas.chaudh...@qlogic.com James, Please apply the following patches to the scsi tree at your earliest convenience. Thanks, Vikas. I think some of these should be common operations instead of

Re: [Open-FCoE] [RFC PATCH v4 0/5] Add new fcoe_sysfs based control interfaces to libfcoe, bnx2fc and fcoe

2012-10-10 Thread Neil Horman
On Tue, Oct 09, 2012 at 03:18:50PM -0700, Robert Love wrote: v4: @Neil: Policy is now: 'mode' attribute: input: Fabric VN2VN (case insensitive) output: Fabric VN2VN 'enabled' attribute: input: 1 0 output: 1 0

Re: [PATCH 1/2] [SCSI] pm: use callbacks from dev_pm_ops for scsi devices

2012-10-10 Thread Alan Stern
On Wed, 10 Oct 2012, Aaron Lu wrote: Use of pm_message_t is deprecated and device driver is not supposed to use that. This patch tries to migrate the SCSI bus level pm callbacks to call device's pm callbacks defined in its driver's dev_pm_ops. NO logic changes in scsi_pm.c, a new function

Re: [PATCH 2/2] [SCSI] sd: update sd to use the new pm callbacks

2012-10-10 Thread Alan Stern
On Wed, 10 Oct 2012, Aaron Lu wrote: Update sd driver to use the callbacks defined in dev_pm_ops. sd_freeze is NULL, the bus level callback has taken care of quiescing the device so there should be nothing needs to be done here. Consequently, sd_thaw is not needed here either. Both

[PATCH 3.6.0- 0/6] SCSI: use module_platform_driver macro

2012-10-10 Thread Srinivas KANDAGATLA
From: Srinivas Kandagatla srinivas.kandaga...@st.com Running below Coccinelle lookup pattern like below on the latest kernel showed about 52 hits. This patch series is a subset of those 52 patches, so that it will be easy for maintainers to review. Hopefully these patches will get rid of some

[PATCH 3.6.0- 2/6] scsi/mac_esp: use module_platform_driver macro

2012-10-10 Thread Srinivas KANDAGATLA
From: Srinivas Kandagatla srinivas.kandaga...@st.com This patch removes some code duplication by using module_platform_driver. Signed-off-by: Srinivas Kandagatla srinivas.kandaga...@st.com --- drivers/scsi/mac_esp.c | 14 +- 1 files changed, 1 insertions(+), 13 deletions(-) diff

[PATCH 3.6.0- 1/6] scsi/jazz_esp: use module_platform_driver macro

2012-10-10 Thread Srinivas KANDAGATLA
From: Srinivas Kandagatla srinivas.kandaga...@st.com This patch removes some code duplication by using module_platform_driver. Signed-off-by: Srinivas Kandagatla srinivas.kandaga...@st.com --- drivers/scsi/jazz_esp.c | 14 +- 1 files changed, 1 insertions(+), 13 deletions(-) diff

[PATCH 3.6.0- 3/6] scsi/qlogicpti: use module_platform_driver macro

2012-10-10 Thread Srinivas KANDAGATLA
From: Srinivas Kandagatla srinivas.kandaga...@st.com This patch removes some code duplication by using module_platform_driver. Signed-off-by: Srinivas Kandagatla srinivas.kandaga...@st.com --- drivers/scsi/qlogicpti.c | 14 +- 1 files changed, 1 insertions(+), 13 deletions(-)

[PATCH 3.6.0- 4/6] scsi/sni_53c710: use module_platform_driver macro

2012-10-10 Thread Srinivas KANDAGATLA
From: Srinivas Kandagatla srinivas.kandaga...@st.com This patch removes some code duplication by using module_platform_driver. Signed-off-by: Srinivas Kandagatla srinivas.kandaga...@st.com --- drivers/scsi/sni_53c710.c | 14 +- 1 files changed, 1 insertions(+), 13 deletions(-)

[PATCH 3.6.0- 5/6] scsi/sun3x_esp: use module_platform_driver macro

2012-10-10 Thread Srinivas KANDAGATLA
From: Srinivas Kandagatla srinivas.kandaga...@st.com This patch removes some code duplication by using module_platform_driver. Signed-off-by: Srinivas Kandagatla srinivas.kandaga...@st.com --- drivers/scsi/sun3x_esp.c | 14 +- 1 files changed, 1 insertions(+), 13 deletions(-)

[PATCH 3.6.0- 6/6] scsi/sun_esp: use module_platform_driver macro

2012-10-10 Thread Srinivas KANDAGATLA
From: Srinivas Kandagatla srinivas.kandaga...@st.com This patch removes some code duplication by using module_platform_driver. Signed-off-by: Srinivas Kandagatla srinivas.kandaga...@st.com --- drivers/scsi/sun_esp.c | 14 +- 1 files changed, 1 insertions(+), 13 deletions(-) diff

[PATCH v2 0/5] Migrate SCSI drivers to use dev_pm_ops

2012-10-10 Thread Aaron Lu
v2: Change the runtime suspend behaviour of sd driver by putting the device into stopped power state. Revert 2 patches which are no longer needed as pointed out by Alan Stern. Find out device callbacks in bus callbacks as suggested by Alan Stern. Due to these changes, patch number grows from 2 -

[PATCH v2 1/5] sd: put to stopped power state when runtime suspend

2012-10-10 Thread Aaron Lu
When device is runtime suspended, put it to stopped power state to save some power. This will also make the behaviour consistent with what the scsi_pm.c thinks about sd as the comment says: sd treats runtime suspend, system suspend and system hibernate identical. With this patch, it is now

[PATCH v2 2/5] Revert [SCSI] scsi_pm: set device runtime state before parent suspended

2012-10-10 Thread Aaron Lu
This reverts commit 33a2285d96b5e7b9500612ec623bf4313397bb53. With commit 88d26136a256576e444db312179e17af6dd0ea87 (PM: Prevent runtime suspend during system resume), this patch is no longer needed. Signed-off-by: Aaron Lu aaron...@intel.com --- drivers/scsi/scsi_pm.c | 23

[PATCH v2 3/5] Revert [SCSI] runtime resume parent for child's system-resume

2012-10-10 Thread Aaron Lu
This reverts commit 28fd00d42cca178638f51c08efa986a777c24a4b. With commit 88d26136a256576e444db312179e17af6dd0ea87 (PM: Prevent runtime suspend during system resume), this patch is no longer needed. Signed-off-by: Aaron Lu aaron...@intel.com --- drivers/scsi/scsi_pm.c | 11 +-- 1 file

[PATCH v2 4/5] pm: use callbacks from dev_pm_ops for scsi devices

2012-10-10 Thread Aaron Lu
Use of pm_message_t is deprecated and device driver is not supposed to use that. This patch tries to migrate the SCSI bus level pm callbacks to call device's pm callbacks defined in its driver's dev_pm_ops. This is achieved by finding out which device pm callback should be used in bus callback

[PATCH v2 5/5] sd: update sd to use the new pm callbacks

2012-10-10 Thread Aaron Lu
Update sd driver to use the callbacks defined in dev_pm_ops. sd_freeze is NULL, the bus level callback has taken care of quiescing the device so there should be nothing needs to be done here. Consequently, sd_thaw is not needed here either. suspend, poweroff and runtime suspend share the same