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

2013-02-05 Thread Aaron Lu
On 02/06/2013 12:51 AM, Alan Stern wrote: > On Tue, 5 Feb 2013, Aaron Lu wrote: > >> From: Lin Ming >> >> 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 pat

Re: [LSF/MM TOPIC] Thin provisioning SOFT_THRESHOLD error handling

2013-02-05 Thread Kent Overstreet
On Tue, Jan 29, 2013 at 12:14 AM, Hannes Reinecke wrote: > Hi all, > > Thin-provisioned devices have the ability to set a 'soft threshold', which > is triggered if the real free space for this device is beyond this mark. > > The intention behind this is to allow the system to induce some garbage >

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

2013-02-05 Thread Alan Stern
On Tue, 5 Feb 2013, Aaron Lu wrote: > From: Lin Ming > > 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. One thing is a little odd here... > --- a/dri

[PATCH V6 4/4] [SCSI] ufs: Correct the expected data transfersize

2013-02-05 Thread vinholikatti
From: Vinayak Holikatti This patch corrects the expected data transfer size of the command UPIU. The current implementation of cmd->transfersize is wrong as it probably equal to sector size. With this implementation the transfer size is updated correctly Reported-by: KOBAYASHI Yoshitake Reviewe

[PATCH V6 2/4] [SCSI] drivers/scsi/ufs: Separate PCI code into glue driver

2013-02-05 Thread vinholikatti
From: Vinayak Holikatti This patch separates PCI code from ufshcd.c and makes it as a core driver module and adds a new file ufshcd-pci.c as PCI glue driver. Reviewed-by: Arnd Bergmann Reviewed-by: Namjae Jeon Reviewed-by: Subhash Jadavani Signed-off-by: Vinayak Holikatti Signed-off-by: Sant

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

2013-02-05 Thread vinholikatti
From: Vinayak Holikatti This patch adds Platform glue driver for ufshcd. Reviewed-by: Arnd Bergmann Reviewed-by: Namjae Jeon Reviewed-by: Subhash Jadavani Reviewed-by: Sujit Reddy Thumma Signed-off-by: Vinayak Holikatti Signed-off-by: Santosh Yaraganavi --- drivers/scsi/ufs/Kconfig

[PATCH V6 1/4] [SCSI] drivers/scsi/ufs: Seggregate PCI Specific Code

2013-02-05 Thread vinholikatti
From: Vinayak Holikatti This patch seggregates the PCI specific code in ufshcd.c to make it ready for splitting into core ufs driver and PCI glue driver. Also copyright header modification to remove extra warranty disclaim. Reviewed-by: Arnd Bergmann Reviewed-by: Namjae Jeon Reviewed-by: Subha

[PATCH V6 0/4] [SCSI] ufs: Adds glue drivers to ufshcd

2013-02-05 Thread vinholikatti
From: Vinayak Holikatti This patch set adds following features - Seggregate PCI specific code in ufshcd.c and corrected copyright - Adds PCI glue driver ufshcd-pci.c and ufshcd.c become core module - Adds Platform glue driver ufshcd-pltfrm.c - Update correct transfer size in Command UPIU Vin

[PATCH v8 10/10] Save and restore host_scribble during error handling

2013-02-05 Thread Bart Van Assche
A SCSI LLD may overwrite host_scribble in its queuecommand() implementation. Several drivers need that field to process requests and aborts correctly. Hence this field must be saved by scsi_eh_prep_cmnd() and must be restored by scsi_eh_restore_cmnd(). Signed-off-by: Bart Van Assche Cc: James Bot

[PATCH v8 09/10] Avoid that scsi_device_set_state() triggers a race

2013-02-05 Thread Bart Van Assche
Signed-off-by: Bart Van Assche Acked-by: Hannes Reinecke Cc: James Bottomley Cc: Tejun Heo Cc: Mike Christie --- drivers/scsi/scsi_error.c |4 drivers/scsi/scsi_lib.c | 43 ++- drivers/scsi/scsi_scan.c | 15 --- drivers/scsi/

[PATCH v8 08/10] Make scsi_remove_host() wait until error handling finished

2013-02-05 Thread Bart Van Assche
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_* functions is in progress when scsi_remove_host() is invoked, wait until the eh_* function has

[PATCH v8 07/10] Make scsi_remove_host() wait for device removal

2013-02-05 Thread Bart Van Assche
If removal of a SCSI device has been triggered via sysfs that device may still be in state SDEV_CANCEL if scsi_remove_host() is invoked later on and after scsi_remove_host() returns. SCSI LLDs may start cleaning up host resources needed by their queuecommand() callback as soon as scsi_remove_host()

[PATCH v8 06/10] Avoid saving/restoring interrupt state inside scsi_remove_host()

2013-02-05 Thread Bart Van Assche
Since it is not allowed to invoke scsi_remove_host() with interrupts disabled, avoid saving and restoring the interrupt state inside scsi_remove_host(). This patch does not change the functionality of the function scsi_remove_host(). Signed-off-by: Bart Van Assche Acked-by: Tejun Heo Acked-by: H

[PATCH v8 05/10] Disallow changing the device state via sysfs into "deleted"

2013-02-05 Thread Bart Van Assche
Changing the state of a SCSI device via sysfs into "cancel" or "deleted" prevents removal of these devices by scsi_remove_host(). Hence do not allow this. Also, introduce the symbolic name INVALID_SDEV_STATE, representing a value different from any valid SCSI device state. Update scsi_device_set_st

[PATCH v8 04/10] Remove offline devices when removing a host

2013-02-05 Thread Bart Van Assche
__scsi_remove_device() incorrectly skips devices that are visible and offline. Such devices get skipped because scsi_device_set_state() refuses the transition from SDEV_OFFLINE into SDEV_CANCEL. Make sure that these devices get removed by changing their device state into SDEV_DEL at the start of __

[PATCH v8 03/10] Introduce scsi_device_being_removed()

2013-02-05 Thread Bart Van Assche
This patch does not change any functionality. Signed-off-by: Bart Van Assche Acked-by: Hannes Reinecke Cc: James Bottomley Cc: Mike Christie Cc: Tejun Heo --- drivers/scsi/device_handler/scsi_dh.c |7 ++- include/scsi/scsi_device.h| 15 +++ 2 files changed,

[PATCH v8 02/10] Remove get_device() / put_device() pair from scsi_request_fn()

2013-02-05 Thread Bart Van Assche
Now that all scsi_request_fn() callers hold a reference on the SCSI device that function is invoked for and since blk_cleanup_queue() waits until scsi_request_fn() has finished it is safe to remove the get_device() / put_device() pair from scsi_request_fn(). Signed-off-by: Bart Van Assche Acked-b

[PATCH v8 01/10] Fix race between starved list processing and device removal

2013-02-05 Thread Bart Van Assche
scsi_run_queue() examines all SCSI devices that are present on the starved list. Since scsi_run_queue() unlocks the SCSI host lock before running a queue a SCSI device can get removed after it has been removed from the starved list and before its queue is run. Protect against that race condition by

[PATCH v8 0/10] More device removal fixes

2013-02-05 Thread Bart Van Assche
Fix a few race conditions that can be triggered by removing a device: - Fix a race between starved list processing and device removal. - Avoid that a SCSI LLD callback can get invoked after scsi_remove_host() finished. - Speed up device removal by stopping error handling as soon as the SHOST_D

re: [SCSI] lpfc 8.3.37: Provide support for FCoE protocol dual-chute (ULP) operation

2013-02-05 Thread Dan Carpenter
Hello James Smart, The patch 962bc51b04b2: "[SCSI] lpfc 8.3.37: Provide support for FCoE protocol dual-chute (ULP) operation" from Jan 3, 2013, leads to the following warning: "drivers/scsi/lpfc/lpfc_sli.c:12818 lpfc_wq_create() warn: 0x800 is larger than 8 bits" [ This is from a not rea

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

2013-02-05 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 v9 3/4] block: implement runtime pm strategy

2013-02-05 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

[PATCH v9 0/4] block layer runtime pm

2013-02-05 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 v9 2/4] block: add runtime pm helpers

2013-02-05 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 v9 4/4] sd: change to auto suspend mode

2013-02-05 Thread Aaron Lu
From: Lin Ming 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 Signed-off-by: Aaron Lu --- drivers/scsi/scsi_pm.c | 79