Re: [PATCH v2] qla2xxx: Fix for locking issue between driver ISR and mailbox routines

2013-04-24 Thread Saurav Kashyap
Acked-by: Saurav Kashyap saurav.kash...@qlogic.com Thanks, ~Saurav The driver uses ha-mbx_cmd_flags variable to pass information between its ISR and mailbox routines, however, it does so without the protection of any locks. Under certain conditions, this can lead to multiple mailbox command

sg_ses -j shows Transport protocol: Oxc not decoded

2013-04-24 Thread Chris Dunlop
Hi, I have 3 boxes, each with an LSI 9211-8i and a mix of LSI expanders (Supermicro SAS-846EL2, SAS-826EL2). For some of my expanders, 'sg_ses -j' (originally sg3_utils 1.33, now 1.35) is showing: Slot 24 [0,23] Element type: Array device slot ... Additional Element Status: Transport

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Ric Wheeler
Hi Rob, Comments inline below. On 04/24/2013 01:44 AM, Elliott, Robert (Server Storage) wrote: If the writeback cache is enabled (per the WCE bit in the Caching mode page), prudent software uses the FUA bit in WRITE commands when writing metadata and/or sends the SYNCHRONIZE CACHE command at

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Paolo Bonzini
Il 23/04/2013 22:07, James Bottomley ha scritto: On Tue, 2013-04-23 at 15:41 -0400, Ric Wheeler wrote: For many years, we have used WCE as an indication that a device has a volatile write cache (not just a write cache) and used this as a trigger to send down SYNCHRONIZE_CACHE commands as

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Hannes Reinecke
On 04/23/2013 10:07 PM, James Bottomley wrote: On Tue, 2013-04-23 at 15:41 -0400, Ric Wheeler wrote: For many years, we have used WCE as an indication that a device has a volatile write cache (not just a write cache) and used this as a trigger to send down SYNCHRONIZE_CACHE commands as

[PATCH][v3] scsi: Handle MLQUEUE busy response in scsi_send_eh_cmnd

2013-04-24 Thread Hannes Reinecke
scsi_send_eh_cmnd() is calling queuecommand() directly, so it needs to check the return value here. The only valid return codes for queuecommand() are 'busy' states, so we need to wait for a bit to allow the LLDD to recover. Based on an earlier patch from Wen Xiong. Cc: Wen Xiong

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Paolo Bonzini
Il 24/04/2013 14:07, Hannes Reinecke ha scritto: On 04/24/2013 01:17 PM, Paolo Bonzini wrote: Il 23/04/2013 22:07, James Bottomley ha scritto: On Tue, 2013-04-23 at 15:41 -0400, Ric Wheeler wrote: For many years, we have used WCE as an indication that a device has a volatile write cache

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Hannes Reinecke
On 04/24/2013 02:08 PM, Paolo Bonzini wrote: Il 24/04/2013 14:07, Hannes Reinecke ha scritto: On 04/24/2013 01:17 PM, Paolo Bonzini wrote: Il 23/04/2013 22:07, James Bottomley ha scritto: On Tue, 2013-04-23 at 15:41 -0400, Ric Wheeler wrote: For many years, we have used WCE as an indication

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Paolo Bonzini
Il 24/04/2013 14:12, Hannes Reinecke ha scritto: On 04/24/2013 02:08 PM, Paolo Bonzini wrote: Il 24/04/2013 14:07, Hannes Reinecke ha scritto: On 04/24/2013 01:17 PM, Paolo Bonzini wrote: Il 23/04/2013 22:07, James Bottomley ha scritto: On Tue, 2013-04-23 at 15:41 -0400, Ric Wheeler wrote:

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Ric Wheeler
On 04/24/2013 08:08 AM, Paolo Bonzini wrote: Il 24/04/2013 14:07, Hannes Reinecke ha scritto: On 04/24/2013 01:17 PM, Paolo Bonzini wrote: Il 23/04/2013 22:07, James Bottomley ha scritto: On Tue, 2013-04-23 at 15:41 -0400, Ric Wheeler wrote: For many years, we have used WCE as an indication

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Paolo Bonzini
Il 24/04/2013 14:27, Ric Wheeler ha scritto: The point is to _avoid_ hitting the disk. :) The point is to have a crash-proof version of the data acknowledged by the target device while letting data sit in volatile state as long as possible. To be even clearer, we would love to do this for a

[PATCH 1/1] scsi: ufs: Add support for sending NOP OUT UPIU

2013-04-24 Thread Sujit Reddy Thumma
As part of device initialization sequence, sending NOP OUT UPIU and waiting for NOP IN UPIU response is mandatory. This confirms that the device UFS Transport (UTP) layer is functional and the host can configure the device with further commands. Add support for sending NOP OUT UPIU to check the

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Jeremy Linton
On 4/24/2013 7:57 AM, Paolo Bonzini wrote: If the device can promise this, we don't care (and don't know) how it manages that promise. It can leave the data on battery backed DRAM, can archive it to flash or any other scheme that works. That's exactly the point of SYNC_NV=1. Well

Re: [PATCH][v3] scsi: Handle MLQUEUE busy response in scsi_send_eh_cmnd

2013-04-24 Thread James Bottomley
On Wed, 2013-04-24 at 13:32 +0200, Hannes Reinecke wrote: scsi_send_eh_cmnd() is calling queuecommand() directly, so it needs to check the return value here. The only valid return codes for queuecommand() are 'busy' states, so we need to wait for a bit to allow the LLDD to recover. Based

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Douglas Gilbert
On 13-04-23 03:41 PM, Ric Wheeler wrote: For many years, we have used WCE as an indication that a device has a volatile write cache (not just a write cache) and used this as a trigger to send down SYNCHRONIZE_CACHE commands as needed. Some arrays with non-volatile cache seem to have WCE set

[PATCH 1/5] scsi: ufs: move the ufshcd_hba_stop to ufshcd.c

2013-04-24 Thread Seungwon Jeon
Move the ufshcd_hba_stop from header file. Signed-off-by: Seungwon Jeon tgih@samsung.com --- drivers/scsi/ufs/ufshcd.c |9 + drivers/scsi/ufs/ufshcd.h |9 - 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c

[PATCH 3/5] scsi: ufs: amend interrupt configuration

2013-04-24 Thread Seungwon Jeon
It makes interrupt setting more flexible especially for disabling. And wrong bit mask is fixed for ver 1.0. [17:16] is added for mask. Signed-off-by: Seungwon Jeon tgih@samsung.com --- drivers/scsi/ufs/ufshcd.c | 86 - drivers/scsi/ufs/ufshcd.h |

[PATCH 2/5] scsi: ufs: wrap the i/o access operations

2013-04-24 Thread Seungwon Jeon
Simplify operations with hiding mmio_base. Signed-off-by: Seungwon Jeon tgih@samsung.com --- drivers/scsi/ufs/ufshcd.c | 106 +++-- drivers/scsi/ufs/ufshcd.h |5 ++ 2 files changed, 49 insertions(+), 62 deletions(-) diff --git

[PATCH 4/5] scsi: ufs: rework link start-up process

2013-04-24 Thread Seungwon Jeon
Link start-up requires long time with multiphase handshakes between UFS host and device. This affects driver's probe time. This patch let link start-up run asynchronously. And completion time of uic command is defined to avoid a permanent wait. Signed-off-by: Seungwon Jeon tgih@samsung.com

[PATCH 5/5] scsi: ufs: add dme operations

2013-04-24 Thread Seungwon Jeon
Add uic command operations including DME_XXX series. Signed-off-by: Seungwon Jeon tgih@samsung.com --- drivers/scsi/ufs/ufs-attrs.h | 129 drivers/scsi/ufs/ufshcd.c| 220 +- drivers/scsi/ufs/ufshcd.h| 55 +++

RE: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Black, David
Jeremy, It looks like, you, Paolo and Ric have hit the nail on the head here - this is a nice summary, IMHO: On 4/24/2013 7:57 AM, Paolo Bonzini wrote: If the device can promise this, we don't care (and don't know) how it manages that promise. It can leave the data on battery backed DRAM,

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Ric Wheeler
On 04/24/2013 02:20 PM, Black, David wrote: Jeremy, It looks like, you, Paolo and Ric have hit the nail on the head here - this is a nice summary, IMHO: On 4/24/2013 7:57 AM, Paolo Bonzini wrote: If the device can promise this, we don't care (and don't know) how it manages that promise. It

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread James Bottomley
On Wed, 2013-04-24 at 16:41 -0400, Ric Wheeler wrote: On 04/24/2013 02:20 PM, Black, David wrote: Jeremy, It looks like, you, Paolo and Ric have hit the nail on the head here - this is a nice summary, IMHO: On 4/24/2013 7:57 AM, Paolo Bonzini wrote: If the device can promise

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Paolo Bonzini
Il 24/04/2013 23:02, James Bottomley ha scritto: That just leaves us with random standards behaviour. Lets permit the deterministic thing instead for the distros. It kills two birds with one stone because we can set WCE for the stupid UAS devices that clear it wrongly as well. For those

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread James Bottomley
On Wed, 2013-04-24 at 23:54 +0200, Paolo Bonzini wrote: Il 24/04/2013 23:02, James Bottomley ha scritto: That just leaves us with random standards behaviour. Lets permit the deterministic thing instead for the distros. It kills two birds with one stone because we can set WCE for the

[PATCH 0/2] qla2xxx: Patches for scsi misc branch.

2013-04-24 Thread Saurav Kashyap
Hi James, This patchset fixes the sparse warnings. Please apply the following patches to the scsi tree at your earliest convenience for inclusion in the next mainline merge window. Thanks, ~Saurav Armen Baloyan (1): qla2xxx: fix sparse warning large integer implicitly truncated to

[PATCH 2/2] qla2xxx: qla2x00_sp_compl can be static.

2013-04-24 Thread Saurav Kashyap
From: Fengguang Wu fengguang...@intel.com Signed-off-by: Fengguang Wu fengguang...@intel.com Signed-off-by: Saurav Kashyap saurav.kash...@qlogic.com --- drivers/scsi/qla2xxx/qla_os.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c

[PATCH 1/2] qla2xxx: fix sparse warning large integer implicitly truncated to unsigned type

2013-04-24 Thread Saurav Kashyap
From: Armen Baloyan armen.balo...@qlogic.com Signed-off-by: Armen Baloyan armen.balo...@qlogic.com Signed-off-by: Saurav Kashyap saurav.kash...@qlogic.com --- drivers/scsi/qla2xxx/qla_mr.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mr.c

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Ric Wheeler
On 04/24/2013 06:09 PM, James Bottomley wrote: On Wed, 2013-04-24 at 23:54 +0200, Paolo Bonzini wrote: Il 24/04/2013 23:02, James Bottomley ha scritto: That just leaves us with random standards behaviour. Lets permit the deterministic thing instead for the distros. It kills two birds with

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread James Bottomley
On Wed, 2013-04-24 at 18:36 -0400, Ric Wheeler wrote: On 04/24/2013 06:09 PM, James Bottomley wrote: On Wed, 2013-04-24 at 23:54 +0200, Paolo Bonzini wrote: Il 24/04/2013 23:02, James Bottomley ha scritto: That just leaves us with random standards behaviour. Lets permit the deterministic

Re: [PATCH 0/6] scsi_debug: fix logical block provisioning support

2013-04-24 Thread Douglas Gilbert
On 13-04-16 09:11 AM, Akinobu Mita wrote: I tried testing the logical block provisioning support in scsi_debug, but it didn't work as I expected. For example, load scsi_debug module with UNMAP command supported and fill the storage with random data. # modprobe scsi_debug lbpu=1

Re: [PATCH 0/3] scsi_debug: fix data integrity support

2013-04-24 Thread Douglas Gilbert
On 13-04-21 05:17 AM, Akinobu Mita wrote: When I tried testing the data integrity support in scsi_debug on x86_32, I got CONFIG_DEBUG_HIGHMEM warnings and protection errors. This was triggered due to misused kmap_atomic/kunmap_atomic. And then, while I was testing the fix of the above issue

Re: [PATCH] [SCSI] sd: workaround invalid OPTIMAL TRANSFER LENGTH

2013-04-24 Thread Martin K. Petersen
Mike == Mike Snitzer snit...@redhat.com writes: Mike, Following up on our discussion at LSF/MM last week... Mike Workaround disk firmware that improperly sets OPTIMAL TRANSFER Mike LENGTH to 0x (aka UINT_MAX or 4294967295U) by assuming Mike this _optional_ BLOCK LIMITS VPD field was

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Martin K. Petersen
James == James Bottomley james.bottom...@hansenpartnership.com writes: James I'm fairly ambivalent, except not force. The default behaviour James is to do the mode select, so force seems to imply that as well, James except it won't. I don't see a difference between assume and James temporary.

Re: [PATCH 2/6] scsi_debug: prohibit scsi_debug_unmap_granularity == scsi_debug_unmap_alignment

2013-04-24 Thread Martin K. Petersen
Akinobu == Akinobu Mita akinobu.m...@gmail.com writes: Akinobu scsi_debug prohibits setting scsi_debug_unmap_alignment to be Akinobu greater than scsi_debug_unmap_granularity. But setting them to Akinobu be the same value is not prohibited. In this case, the only Akinobu difference with

Re: [PATCH 3/6] scsi_debug: clear correct memory region when LBPRZ is enabled

2013-04-24 Thread Martin K. Petersen
Akinobu == Akinobu Mita akinobu.m...@gmail.com writes: Akinobu The function unmap_region() clears memory region specified as Akinobu the logical block address and the number of logical blocks in Akinobu ramdisk storage (fake_storep) if lbpu and lbprz module Akinobu parameters are enabled.

Re: [PATCH 4/6] scsi_debug: add translation functions between LBA and index of provisioning map

2013-04-24 Thread Martin K. Petersen
Akinobu == Akinobu Mita akinobu.m...@gmail.com writes: Akinobu The translation from LBA to index of provisioning map Akinobu (map_storep) is used in various places (map_state(), Akinobu map_region(), and unmap_region()). But it is not correctly Akinobu calculated if scsi_debug_unmap_alignment

Re: [PATCH 5/6] scsi_debug: fix initialization of provisioning map

2013-04-24 Thread Martin K. Petersen
Akinobu == Akinobu Mita akinobu.m...@gmail.com writes: Akinobu provisioning map (map_storep) is a bitmap accessed by bitops. Akinobu So the allocation size should be a multiple of sizeof(unsigned Akinobu long) and also the bitmap should be cleared by using Akinobu bitmap_clear() instead of

Re: sd: workaround invalid OPTIMAL TRANSFER LENGTH

2013-04-24 Thread Mike Snitzer
On Wed, Apr 24 2013 at 9:19pm -0400, Martin K. Petersen martin.peter...@oracle.com wrote: Mike == Mike Snitzer snit...@redhat.com writes: Mike, Following up on our discussion at LSF/MM last week... Mike Workaround disk firmware that improperly sets OPTIMAL TRANSFER Mike LENGTH to

Re: [PATCH 6/6] scsi_debug: fix logical block provisioning support

2013-04-24 Thread Martin K. Petersen
Akinobu == Akinobu Mita akinobu.m...@gmail.com writes: Akinobu This problem is due to the wrong translation between LBA and Akinobu index of provisioning map. Fix it by using correct translation Akinobu functions added previously. Acked-by: Martin K. Petersen martin.peter...@oracle.com --

Re: [patch 1/1] sd_dif: problem with verify of type 1 protection information (PI)

2013-04-24 Thread Martin K. Petersen
Jeremy == Jeremy Higdon jer...@sgi.com writes: Jeremy It appears to me that there is a problem with handling of type 1 Jeremy protection information. It is considering a logical block Jeremy reference tag of 0x to be an error, but it is actually Jeremy valid any time ((lba 0x)

Re: [PATCH 1/6] scsi_debug: call map_region() and unmap_region() only when needed

2013-04-24 Thread Martin K. Petersen
Akinobu == Akinobu Mita akinobu.m...@gmail.com writes: Akinobu If the logical block provisioning is not enabled, map_region() Akinobu and unmap_region() have no effect and they don't need to be Akinobu called. Akinobu So this makes map_region() and unmap_region() to be called only Akinobu when

Re: [PATCH 1/3] scsi_debug: fix data integrity support on highmem machine

2013-04-24 Thread Martin K. Petersen
Akinobu == Akinobu Mita akinobu.m...@gmail.com writes: Akinobu kmap_atomic() is now using stack based implementation and Akinobu doesn't take the KM_type argument anymore. So nesting Akinobu kmap_atomic() calls must be properly stacked. Akinobu This fixes nesting kmap_atomic() calls for

Re: [PATCH 3/3] scsi_debug: simplify offset calculation for dif_storep

2013-04-24 Thread Martin K. Petersen
Akinobu == Akinobu Mita akinobu.m...@gmail.com writes: + sector += len / sizeof(*dif_storep); I'd rather see sizeof(struct scsi_dif_tuple) here. But that's just personal preference. Otherwise ok. -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this

Re: [PATCH 2/3] scsi_debug: fix NULL pointer dereference with parameters dif=0 dix=1

2013-04-24 Thread Martin K. Petersen
Akinobu == Akinobu Mita akinobu.m...@gmail.com writes: Akinobu The protection info dif_storep is allocated only when parameter Akinobu dif is not zero. But it will be accessed when reading or Akinobu writing to the storage installed with parameter dix is not Akinobu zero. Akinobu So kernel

Re: [PATCH 2/5] scsi: ufs: wrap the i/o access operations

2013-04-24 Thread Sujit Reddy Thumma
On 4/24/2013 9:36 PM, Seungwon Jeon wrote: Simplify operations with hiding mmio_base. Signed-off-by: Seungwon Jeon tgih@samsung.com --- drivers/scsi/ufs/ufshcd.c | 106 +++-- drivers/scsi/ufs/ufshcd.h |5 ++ 2 files changed, 49 insertions(+),

Re: [PATCH 4/5] scsi: ufs: rework link start-up process

2013-04-24 Thread Sujit Reddy Thumma
On 4/24/2013 9:36 PM, Seungwon Jeon wrote: Link start-up requires long time with multiphase handshakes between UFS host and device. This affects driver's probe time. This patch let link start-up run asynchronously. And completion time of uic command is defined to avoid a permanent wait. I have

Re: [PATCH][v3] scsi: Handle MLQUEUE busy response in scsi_send_eh_cmnd

2013-04-24 Thread Hannes Reinecke
On 04/24/2013 04:48 PM, James Bottomley wrote: On Wed, 2013-04-24 at 13:32 +0200, Hannes Reinecke wrote: scsi_send_eh_cmnd() is calling queuecommand() directly, so it needs to check the return value here. The only valid return codes for queuecommand() are 'busy' states, so we need to wait for

[PATCH 1/2] qla2xxx: fix sparse warning large integer implicitly truncated to unsigned type

2013-04-24 Thread Saurav Kashyap
From: Armen Baloyan armen.balo...@qlogic.com Signed-off-by: Armen Baloyan armen.balo...@qlogic.com Signed-off-by: Saurav Kashyap saurav.kash...@qlogic.com --- drivers/scsi/qla2xxx/qla_mr.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mr.c

[PATCH 0/2] qla2xxx: Patches for scsi misc branch.

2013-04-24 Thread Saurav Kashyap
Hi James, This patchset fixes the sparse warnings. Please apply the following patches to the scsi tree at your earliest convenience for inclusion in the next mainline merge window. Thanks, ~Saurav Armen Baloyan (1): qla2xxx: fix sparse warning large integer implicitly truncated to

[PATCH 2/2] qla2xxx: qla2x00_sp_compl can be static.

2013-04-24 Thread Saurav Kashyap
From: Fengguang Wu fengguang...@intel.com Signed-off-by: Fengguang Wu fengguang...@intel.com Signed-off-by: Saurav Kashyap saurav.kash...@qlogic.com --- drivers/scsi/qla2xxx/qla_os.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c