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

2013-03-15 Thread Aaron Lu
From: Lin Ming ming.m@intel.com 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

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

2013-03-15 Thread Aaron Lu
From: Lin Ming ming.m@intel.com Uses block layer runtime pm helper functions in scsi_runtime_suspend/resume for devices that take advantage of it. Remove scsi_autopm_* from sd open/release path and check_events path. Signed-off-by: Lin Ming ming.m@intel.com Signed-off-by: Aaron Lu

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

2013-03-15 Thread Aaron Lu
From: Lin Ming ming.m@intel.com 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,

[PATCH RESEND v11 0/4] block layer runtime pm

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

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

2013-03-15 Thread Aaron Lu
From: Lin Ming ming.m@intel.com 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

Re: [PATCH v2] st: Take additional queue ref in st_probe

2013-03-15 Thread Jan Vesely
On 05/03/13 16:57, Joe Lawrence wrote: Changes from v1: Corrected error paths as noted by Ewan Milne and Jan Vesely. thanks, Acked-by: Jan Vesely jves...@redhat.com These changes were applied to scsi.git, branch misc. This patch fixes a reference count bug in the SCSI tape driver

[PATCH -next] target: fix possible memory leak in core_tpg_register()

2013-03-15 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn 'se_tpg-tpg_lun_list' is malloced in core_tpg_register() and should be freed before leaving from the error handling cases, otherwise it will cause memory leak. 'se_tpg' is malloced out of this function, and will be freed if we return error, so

[PATCH][RFC] scsi: Use W_LUN for scanning

2013-03-15 Thread Hannes Reinecke
SAM advertises the use of a Well-known LUN (W_LUN) for scanning. As this avoids exposing LUN 0 (which might be a valid LUN) for all initiators it is the preferred method for LUN scanning on some arrays. So we should be using W_LUN for scanning, too. If the W_LUN is not supported we'll fall back to

[PATCH -next] [SCSI] csiostor: remove unused variable in csio_process_fwevtq_entry()

2013-03-15 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn The variable 'data' is initialized but never used otherwise, so remove the unused variable. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/scsi/csiostor/csio_hw.c | 5 - 1 file changed, 5 deletions(-) diff --git

Re: [PATCH -next] [SCSI] csiostor: fix error return code in csio_hw_init()

2013-03-15 Thread Naresh Kumar Inna
On 3/15/2013 2:55 PM, Wei Yongjun wrote: From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn ---

Re: [PATCH -next] [SCSI] csiostor: remove unused variable in csio_process_fwevtq_entry()

2013-03-15 Thread Naresh Kumar Inna
On 3/15/2013 3:31 PM, Wei Yongjun wrote: From: Wei Yongjun yongjun_...@trendmicro.com.cn The variable 'data' is initialized but never used otherwise, so remove the unused variable. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/scsi/csiostor/csio_hw.c | 5 - 1

Re: [PATCH] scsi_transport_fc: Make 'port_state' writeable

2013-03-15 Thread Hannes Reinecke
On 03/14/2013 07:09 PM, Steffen Maier wrote: Just for my understanding: So this is a bit like writing 0 into the failed attribute of a zfcp_port in sysfs (zfcp_sysfs_port_failed_store()) which forces a port reopen recovery including a sequence of fc_remote_port_delete and fc_remote_port_add?

Re: [PATCH] scsi_transport_fc: Make 'port_state' writeable

2013-03-15 Thread Bryn M. Reeves
On 03/15/2013 11:55 AM, Hannes Reinecke wrote: Rationale for this patch is a weird test case with brocade switches; there you can actually disable a _target_ port. So the port isn't reachable anymore but no RSCN is send. I think it's more than a pure test-case; using the rscnsupr feature on

Re: [PATCH] scsi_transport_fc: Make 'port_state' writeable

2013-03-15 Thread Bart Van Assche
On 03/15/13 12:55, Hannes Reinecke wrote: And the LLDD is forced into error recovery which'll take _ages_ as each and every command send during error recovery will time out. Hello Hannes, I'm analyzing a related but not identical issue with SRP. It would help if you could tell with which

Re: [PATCH] scsi_transport_fc: Make 'port_state' writeable

2013-03-15 Thread Bryn M. Reeves
On 03/15/2013 12:24 PM, Bart Van Assche wrote: On 03/15/13 12:55, Hannes Reinecke wrote: And the LLDD is forced into error recovery which'll take _ages_ as each and every command send during error recovery will time out. Hello Hannes, I'm analyzing a related but not identical issue with SRP.

Re: [PATCH] scsi_transport_fc: Make 'port_state' writeable

2013-03-15 Thread Bart Van Assche
On 03/15/13 13:37, Bryn M. Reeves wrote: On 03/15/2013 12:24 PM, Bart Van Assche wrote: On 03/15/13 12:55, Hannes Reinecke wrote: And the LLDD is forced into error recovery which'll take _ages_ as each and every command send during error recovery will time out. Hello Hannes, I'm analyzing a

Re: [PATCH v2] st: Take additional queue ref in st_probe

2013-03-15 Thread Ewan Milne
On Tue, 2013-03-05 at 10:57 -0500, Joe Lawrence wrote: Changes from v1: Corrected error paths as noted by Ewan Milne and Jan Vesely. Acked-by: Ewan D. Milne emi...@redhat.com These changes were applied to scsi.git, branch misc. This patch fixes a reference count bug in the SCSI tape

Re: [PATCH] scsi_transport_fc: Make 'port_state' writeable

2013-03-15 Thread Bryn M. Reeves
On 03/15/2013 12:46 PM, Bart Van Assche wrote: The SCSI EH keeps trying until all outstanding request have been finished. Does lpfc_host_reset_handler() invoke scsi_done() for I don't think so (ends up calling lpfc_sli_cancel_iocbs() via lpfc_hba_down_post() after shutting down the mailbox)

Re: [PATCH] scsi_transport_fc: Make 'port_state' writeable

2013-03-15 Thread Bart Van Assche
On 03/15/13 14:28, Bryn M. Reeves wrote: On 03/15/2013 12:46 PM, Bart Van Assche wrote: The SCSI EH keeps trying until all outstanding request have been finished. Does lpfc_host_reset_handler() invoke scsi_done() for I don't think so (ends up calling lpfc_sli_cancel_iocbs() via

Re: [PATCH][RFC] scsi: Use W_LUN for scanning

2013-03-15 Thread Steffen Maier
While we're at it: I recently figured that there are targets responding to inquiry with PQ=1 PDT=31 for LUN0 if LUN0 has no backing device (e.g. no disk mapped for the initiator host). While this is likely to work with in-kernel lun scanning, the kernel does not even allocate an sg dev in

Re: [PATCH] scsi_transport_fc: Make 'port_state' writeable

2013-03-15 Thread Mike Christie
On 03/15/2013 08:41 AM, Bart Van Assche wrote: On 03/15/13 14:28, Bryn M. Reeves wrote: On 03/15/2013 12:46 PM, Bart Van Assche wrote: The SCSI EH keeps trying until all outstanding request have been finished. Does lpfc_host_reset_handler() invoke scsi_done() for It does not really matter at

Re: [PATCH] scsi_transport_fc: Make 'port_state' writeable

2013-03-15 Thread Bart Van Assche
On 03/15/13 19:51, Mike Christie wrote: On 03/15/2013 08:41 AM, Bart Van Assche wrote: How about using the value of scsi_cmnd.jiffies_at_alloc to finish only those SCSI commands in the host reset handler that exceeded a certain processing time ? We basically do this now. When a scsi command

Using sg_ses to change cooling element rpm speed

2013-03-15 Thread Jeff Johnson
Greetings, I'm beating my head against the desk trying to use sg_ses to change the cooling control element requested speed code for a fan connected to an LSI SAS2X36 SAS expander. I have tried the raw-edit-raw method and tried the --data/--index/--control method and neither seems to work.

Re: [PATCH] scsi_transport_fc: Make 'port_state' writeable

2013-03-15 Thread Mike Christie
On 03/15/2013 02:13 PM, Bart Van Assche wrote: On 03/15/13 19:51, Mike Christie wrote: On 03/15/2013 08:41 AM, Bart Van Assche wrote: How about using the value of scsi_cmnd.jiffies_at_alloc to finish only those SCSI commands in the host reset handler that exceeded a certain processing time ?

Re: [PATCH][RFC] scsi: Use W_LUN for scanning

2013-03-15 Thread Douglas Gilbert
On 13-03-15 05:46 AM, Hannes Reinecke wrote: SAM advertises the use of a Well-known LUN (W_LUN) for scanning. As this avoids exposing LUN 0 (which might be a valid LUN) for all initiators it is the preferred method for LUN scanning on some arrays. So we should be using W_LUN for scanning, too.