Re: [PATCH] SG_SCSI_RESET ioctl: add no_escalate values

2013-02-15 Thread Michael Christie
On Feb 15, 2013, at 11:45 PM, Michael Christie wrote: >>> Some drivers rely on more invasive eh callbacks to be called if they >>> return FAILED in a eh callbacks. > If userspace sends a command that performs the non-escalting *reset to some > drivers, it is going to leave them in a state wher

Re: [PATCH] SG_SCSI_RESET ioctl: add no_escalate values

2013-02-15 Thread Michael Christie
On Feb 15, 2013, at 5:32 PM, Douglas Gilbert wrote: > On 13-02-15 04:48 PM, Mike Christie wrote: >> On 02/15/2013 01:39 PM, Douglas Gilbert wrote: >>> Further to the thread titled: "[PATCH] SG_SCSI_RESET ioctl should >>> only perform requested operation" by Jeremy Linton a patch >>> is presented

Re: [PATCH] SG_SCSI_RESET ioctl: add no_escalate values

2013-02-15 Thread Douglas Gilbert
On 13-02-15 04:48 PM, Mike Christie wrote: On 02/15/2013 01:39 PM, Douglas Gilbert wrote: Further to the thread titled: "[PATCH] SG_SCSI_RESET ioctl should only perform requested operation" by Jeremy Linton a patch is presented that adds "no_escalate" versions to the existing ioctl. This should

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

2013-02-15 Thread merez
Tested-by: Maya Erez > Hi James, > > look like these patches are fine. Can you please integrate these > patches in your tree. > > > On Tue, Feb 5, 2013 at 10:17 PM, wrote: >> From: Vinayak Holikatti >> >> This patch set adds following features >> - Seggregate PCI specific code in ufshcd.c and

Re: [PATCH v9 9/9] Avoid reenabling I/O after the transport became offline

2013-02-15 Thread Mike Christie
On 02/15/2013 06:10 AM, Bart Van Assche wrote: > Disallow the SDEV_TRANSPORT_OFFLINE to SDEV_CANCEL transition such > that no I/O is sent to devices for which the transport is offline. > Notes: > - Functions like sd_shutdown() use scsi_execute_req() and hence > set the REQ_PREEMPT flag. Such requ

Re: [PATCH] SG_SCSI_RESET ioctl: add no_escalate values

2013-02-15 Thread Mike Christie
On 02/15/2013 01:39 PM, Douglas Gilbert wrote: > Further to the thread titled: "[PATCH] SG_SCSI_RESET ioctl should > only perform requested operation" by Jeremy Linton a patch > is presented that adds "no_escalate" versions to the existing > ioctl. This should not break any existing code. > > This

Re: [PATCH] SG_SCSI_RESET ioctl: add no_escalate values

2013-02-15 Thread Jeremy Linton
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2/15/2013 1:39 PM, Douglas Gilbert wrote: > Further to the thread titled: "[PATCH] SG_SCSI_RESET ioctl should only > perform requested operation" by Jeremy Linton a patch is presented that > adds "no_escalate" versions to the existing ioctl. This sh

[PATCH] SG_SCSI_RESET ioctl: add no_escalate values

2013-02-15 Thread Douglas Gilbert
Further to the thread titled: "[PATCH] SG_SCSI_RESET ioctl should only perform requested operation" by Jeremy Linton a patch is presented that adds "no_escalate" versions to the existing ioctl. This should not break any existing code. This patches applies to lk 3.7.7 and lk 3.8.0-rc7 . I will ext

Re: [PATCH v2] [SCSI] scsi_debug: Do not respond to certain commands with CHECK CONDITION when sense pending

2013-02-15 Thread Douglas Gilbert
On 13-02-15 12:52 PM, Ewan D. Milne wrote: From: "Ewan D. Milne" According to SPC, certain commands are not supposed to respond with a CHECK CONDITION due to a pending UNIT ATTENTION. This was causing failures when re-scanning a scsi_debug target. The commands in this category are INQUIRY and

[PATCH v2] [SCSI] scsi_debug: Do not respond to certain commands with CHECK CONDITION when sense pending

2013-02-15 Thread Ewan D. Milne
From: "Ewan D. Milne" According to SPC, certain commands are not supposed to respond with a CHECK CONDITION due to a pending UNIT ATTENTION. This was causing failures when re-scanning a scsi_debug target. The commands in this category are INQUIRY and REPORT LUNS. Signed-off-by: Ewan D. Milne

Re: [PATCH] scsi: Allow 64-bit LUNs during report lun scan

2013-02-15 Thread Jeremy Linton
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2/13/2013 9:37 PM, James Bottomley wrote: > What advantage does this have over setting max_lun to ~0? Actually, after having all those other discussions. I've come to see the elegance in this suggestion. -BEGIN PGP SIGNATURE- Ver

Re: [PATCH] [SCSI] aacraid: Fix invalid bit shifts of DMA address

2013-02-15 Thread Ben Collins
On Feb 15, 2013, at 9:50 AM, Ben Hutchings wrote: > Commit b5f1758f221e ('[SCSI] aacraid: Fix endian issues in core and > SRC portions of driver') changed the type of the address variable in > aac_src_deliver_message() from u64 to dma_addr_t. In configurations > with 32-bit dma_addr_t, this resu

Re: [PATCH] Use a more selective error recovery strategy based on device capabilities

2013-02-15 Thread Jeremy Linton
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2/14/2013 5:42 PM, Elliott, Robert (Server Storage) wrote: > Each logical unit is independent and is allowed to be different. I was actually just thinking about the target reset and IT reset flags. Two flags which affect the I_T not the I_

Re: [PATCH] [SCSI] scsi_debug: Do not respond to INQUIRY commands with CHECK CONDITION when sense pending

2013-02-15 Thread Ewan Milne
On Thu, 2013-02-14 at 16:46 -0500, Douglas Gilbert wrote: > On 13-02-14 11:36 AM, Ewan D. Milne wrote: > > From: "Ewan D. Milne" > > > > According to SPC, INQUIRY commands are not supposed to respond > > with a CHECK CONDITION due to a pending UNIT ATTENTION. This > > was causing failures when re

[PATCH] [SCSI] aacraid: Fix invalid bit shifts of DMA address

2013-02-15 Thread Ben Hutchings
Commit b5f1758f221e ('[SCSI] aacraid: Fix endian issues in core and SRC portions of driver') changed the type of the address variable in aac_src_deliver_message() from u64 to dma_addr_t. In configurations with 32-bit dma_addr_t, this results in: drivers/scsi/aacraid/src.c: In function 'aac_src_de

[PATCH] scsi_debug: Fix endianess in partition table

2013-02-15 Thread Martin Peschke
James, could you pick up this fix, please? Btw., it looks like others where bitten by this one: https://nazar.karan.org/blob/distro! parted.git/8780c767126938173f49dfbcd4360813932f7756/SOURCES! disable-t9020.patch Thanks, Martin Both start_sect and nr_sects in struct partition are __le32 and

[PATCH v9 9/9] Avoid reenabling I/O after the transport became offline

2013-02-15 Thread Bart Van Assche
Disallow the SDEV_TRANSPORT_OFFLINE to SDEV_CANCEL transition such that no I/O is sent to devices for which the transport is offline. Notes: - Functions like sd_shutdown() use scsi_execute_req() and hence set the REQ_PREEMPT flag. Such requests are passed to the LLD queuecommand callback in the

[PATCH v9 8/9] Save and restore host_scribble during error handling

2013-02-15 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 v9 7/9] Avoid that scsi_device_set_state() triggers a race

2013-02-15 Thread Bart Van Assche
Make concurrent invocations of scsi_device_set_state() safe. 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 ++- d

[PATCH v9 6/9] Make scsi_remove_host() wait until error handling finished

2013-02-15 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 v9 5/9] Avoid saving/restoring interrupt state inside scsi_remove_host()

2013-02-15 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 v9 4/9] Disallow changing the device state via sysfs into "deleted"

2013-02-15 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 v9 3/9] Avoid calling __scsi_remove_device() twice

2013-02-15 Thread Bart Van Assche
SCSI devices are added to the shost->__devices list from inside scsi_alloc_sdev(). If something goes wrong during LUN scanning, e.g. a transport layer failure occurs, then __scsi_remove_device() can get invoked by the LUN scanning code for a SCSI device in state SDEV_CREATED_BLOCK or SDEV_BLOCKED.

[PATCH v9 2/9] Remove get_device() / put_device() pair from scsi_request_fn()

2013-02-15 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 v9 1/9] Fix race between starved list processing and device removal

2013-02-15 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 v9 0/9] More device removal fixes

2013-02-15 Thread Bart Van Assche
Fix a few issues 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_DEL or SHO