Re: [PATCH] ibmvfc: byteswap scsi_id, wwpn, and node_name prior to logging

2016-02-12 Thread Johannes Thumshirn
On Thu, Feb 11, 2016 at 04:24:35PM -0600, Tyrel Datwyler wrote: > When logging async events the scsi_id, wwpn, and node_name values > are used directly from the CRQ struct which are of type __be64. This > can be confusing to someone looking through the log on a LE system. > Instead byteswap these v

[PATCHv6 03/23] scsi_dh_alua: Make stpg synchronous

2016-02-12 Thread Hannes Reinecke
The 'activate_complete' function needs to be executed after stpg has finished, so we can as well execute stpg synchronously and call the function directly. Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 156 ++--

[PATCHv6 09/23] scsi_dh_alua: simplify alua_initialize()

2016-02-12 Thread Hannes Reinecke
Rework alua_check_vpd() to use scsi_vpd_get_tpg() and move the port group selection into the function, too. With that we can simplify alua_initialize() to just call alua_check_tpgs() and alua_check_vpd(); Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/device_hand

[PATCHv6 05/23] scsi_dh_alua: switch to scsi_execute_req_flags()

2016-02-12 Thread Hannes Reinecke
All commands are issued synchronously, so no need to open-code scsi_execute_req_flags() anymore. And we can get rid of the static sense code structure element. scsi_execute_req_flags() will be setting REQ_QUIET and REQ_PREEMPT, but that is perfectly fine as we're evaluating and logging any errors o

[PATCHv6 00/23] ALUA device handler update, part II

2016-02-12 Thread Hannes Reinecke
as promised here is now the second part of my ALUA device handler update. This contains a major rework of the ALUA device handler as execution is moved onto a workqueue. This has the advantage that we avoid having to do multiple calls to the same LUN (as happens frequently when failing over a LUN w

[PATCHv6 17/23] scsi_dh_alua: update all port states

2016-02-12 Thread Hannes Reinecke
When we read in the target port group state we should be updating all affected port groups, otherwise we risk running out of sync. Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 35 ++ 1 file changed, 26

[PATCHv6 11/23] scsi_dh_alua: move optimize_stpg evaluation

2016-02-12 Thread Hannes Reinecke
When the optimize_stpg module option is set we should just set it once during port_group allocation. Doing so allows us to override it later with device specific settings. Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 13 ++---

[PATCHv6 02/23] scsi_dh_alua: separate out alua_stpg()

2016-02-12 Thread Hannes Reinecke
Separate out SET TARGET PORT GROUP functionality into a separate function alua_stpg(). Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 95 +++--- 1 file changed, 61 insertions(+), 34 deletions(-) diff --git

[PATCHv6 18/23] scsi_dh_alua: Send TEST UNIT READY to poll for transitioning

2016-02-12 Thread Hannes Reinecke
Sending a 'REPORT TARGET PORT GROUP' command is a costly operation, as the array has to gather information about all ports. So instead of using RTPG to poll for a status update when a port is in transitioning we should be sending a TEST UNIT READY, and wait for the sense code to report success. Si

[PATCHv6 15/23] scsi_dh_alua: Add new blacklist flag 'BLIST_SYNC_ALUA'

2016-02-12 Thread Hannes Reinecke
Add a new blacklist flag BLIST_SYNC_ALUA to instruct the alua device handler to use synchronous command submission for ALUA commands. Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 2 ++ drivers/scsi/scsi_devinfo.c|

[PATCHv6 23/23] scsi_dh_alua: Update version to 2.0

2016-02-12 Thread Hannes Reinecke
Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index cbbd957..e6cb225 100644

[PATCHv6 21/23] scsi_dh_alua: use common definitions for ALUA state

2016-02-12 Thread Hannes Reinecke
scsi_proto.h now contains definitions for the ALUA state, so we don't have to carry them in the device handler. Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 58 +- 1 file changed, 25 insertions(+), 33

[PATCHv6 01/23] scsi_dh_alua: Pass buffer as function argument

2016-02-12 Thread Hannes Reinecke
Pass in the buffer as a function argument for submit_rtpg(). Reviewed-by: Martin K. Petersen Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletio

[PATCHv6 06/23] scsi_dh_alua: allocate RTPG buffer separately

2016-02-12 Thread Hannes Reinecke
The RTPG buffer will only evaluated within alua_rtpg(), so we can allocate it locally there and avoid having to put it into the global structure. Reviewed-by: Ewan Milne Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 57 ++

[PATCHv6 13/23] scsi_dh_alua: Use workqueue for RTPG

2016-02-12 Thread Hannes Reinecke
The current ALUA device_handler has two drawbacks: - We're sending a 'SET TARGET PORT GROUP' command to every LUN, disregarding the fact that several LUNs might be in a port group and will be automatically switched whenever _any_ LUN within that port group receives the command. - Whenever a L

[PATCHv6 16/23] scsi_dh_alua: Recheck state on unit attention

2016-02-12 Thread Hannes Reinecke
When we receive a unit attention code of 'ALUA state changed' we should recheck the state, as it might be due to an implicit ALUA state transition. This allows us to return NEEDS_RETRY instead of ADD_TO_MLQUEUE, allowing to terminate the retries after a certain time. At the same time a workqueue it

[PATCHv6 12/23] scsi_dh_alua: remove 'rel_port' from alua_dh_data structure

2016-02-12 Thread Hannes Reinecke
The 'relative port' field is not used, and might get stale when the port group changes. So remove the field altogether. Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff -

[PATCHv6 07/23] scsi_dh_alua: Use separate alua_port_group structure

2016-02-12 Thread Hannes Reinecke
The port group needs to be a separate structure as several LUNs might belong to the same group. Reviewed-by: Christoph Hellwig Reviewed-by: Ewan Milne Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 181 - include/scsi/scsi_dh.h

[PATCHv6 20/23] scsi: Add 'access_state' attribute

2016-02-12 Thread Hannes Reinecke
Add an 'access_state' attribute to struct scsi_device to display the asymmetric LUN access state. Reviewed-by: Ewan Milne Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_scan.c | 1 + drivers/scsi/scsi_sysfs.c | 49 +++

[PATCHv6 10/23] revert commit a8e5a2d593cb ("[SCSI] scsi_dh_alua: ALUA handler attach should succeed while TPG is transitioning")

2016-02-12 Thread Hannes Reinecke
This reverts commit a8e5a2d593cbfccf530c3382c2c328d2edaa7b66 Obsoleted by the next patch. Reviewed-by: Christoph Hellwig Reviewed-by: Ewan Milne Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 31 -- 1 file changed, 12 insertions(+),

[PATCHv6 19/23] scsi_dh: add 'rescan' callback

2016-02-12 Thread Hannes Reinecke
If a device needs to be rescanned the device_handler might need to be rechecked, too. So add a 'rescan' callback to the device handler and call it upon scsi_rescan_device(). The rescan callback will be invoked from the Unit Attention handling of ASC/ASCQ 3F 03 (INQUIRY DATA HAS CHANGED). Reviewed-

[PATCHv6 14/23] scsi_dh_alua: Allow workqueue to run synchronously

2016-02-12 Thread Hannes Reinecke
Some arrays may only capable of handling one STPG at a time, so this patch adds a singlethreaded workqueue for STPGs to be submitted synchronously. Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 21 ++--- 1 file cha

[PATCHv6 08/23] scsi_dh_alua: use unique device id

2016-02-12 Thread Hannes Reinecke
Use scsi_vpd_lun_id() to assign a unique device identification to the alua port group structure. Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 55 +++--- 1 file changed, 50 insertions(+), 5 deletions(-) di

[PATCHv6 04/23] scsi_dh_alua: call alua_rtpg() if stpg fails

2016-02-12 Thread Hannes Reinecke
If the call to SET TARGET PORT GROUPS fails we have no idea what state the array is left in, so we need to issue a call to REPORT TARGET PORT GROUPS in these cases. Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 2 ++ 1 file change

[PATCHv6 22/23] scsi_dh_alua: update 'access_state' field

2016-02-12 Thread Hannes Reinecke
Track attached SCSI devices and update the 'access_state' field whenever an ALUA state change has been detected. Reviewed-by: Ewan Milne Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 48 -- 1 file chan

[PATCH] bio: return EINTR if copying to user space got interrupted

2016-02-12 Thread Hannes Reinecke
Commit 35dc248383bbab0a7203fca4d722875bc81ef091 introduced a check for current->mm to see if we have a user space context and only copies data if we do. Now if an IO gets interrupted by a signal data isn't copied into user space any more (as we don't have a user space context) but user space isn't

Re: [PATCH-v4 0/5] Fix LUN_RESET active I/O + TMR handling

2016-02-12 Thread Nicholas A. Bellinger
On Fri, 2016-02-12 at 05:30 +, Himanshu Madhani wrote: > Hi Nic, > > > > On 2/11/16, 3:47 PM, "Nicholas A. Bellinger" wrote: > > >On Wed, 2016-02-10 at 22:53 -0800, Nicholas A. Bellinger wrote: > >> On Tue, 2016-02-09 at 18:03 +, Himanshu Madhani wrote: > >> > On 2/8/16, 9:25 PM, "Nic

RE: megaraid_sas: Task management support

2016-02-12 Thread Sumit Saxena
> -Original Message- > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > Sent: Monday, February 08, 2016 11:52 PM > To: sumit.sax...@avagotech.com > Cc: megaraidlinux@avagotech.com; linux-scsi@vger.kernel.org > Subject: re: megaraid_sas: Task management support > > Hello Sumit Sax

Re: [PATCH v2 2/7] ibmvscsi: Add and use enums for valid CRQ header values

2016-02-12 Thread Manoj Kumar
Tyrel: Thanks for incorporating the suggestions. Reviewed-by: Manoj Kumar --- Manoj Kumar On 2/10/2016 7:32 PM, Tyrel Datwyler wrote: The PAPR defines four valid header values for the first byte of a CRQ message. Namely, an unused/empty message (0x00), a valid command/response entry (0x80),

Re: [PATCH v2 1/7] ibmvscsi: Correct values for several viosrp_crq_format enums

2016-02-12 Thread Manoj Kumar
Reviewed-by: Manoj Kumar --- Manoj Kumar On 2/10/2016 7:32 PM, Tyrel Datwyler wrote: The enum values for VIOSRP_LINUX_FORMAT and VIOSRP_INLINE_FORMAT are off by one. They are currently defined as 0x06 and 0x07 respetively. These values are defined in PAPR correctly as 0x05 and 0x06. This inco

Re: [PATCH] bio: return EINTR if copying to user space got interrupted

2016-02-12 Thread Jens Axboe
On 02/12/2016 01:39 AM, Hannes Reinecke wrote: Commit 35dc248383bbab0a7203fca4d722875bc81ef091 introduced a check for current->mm to see if we have a user space context and only copies data if we do. Now if an IO gets interrupted by a signal data isn't copied into user space any more (as we don't

Re: [PATCH] bio: return EINTR if copying to user space got interrupted

2016-02-12 Thread Hannes Reinecke
On 02/12/2016 05:05 PM, Douglas Gilbert wrote: On 16-02-12 03:39 AM, Hannes Reinecke wrote: Commit 35dc248383bbab0a7203fca4d722875bc81ef091 introduced a check for current->mm to see if we have a user space context and only copies data if we do. Now if an IO gets interrupted by a signal data isn'

Re: [PATCH] bio: return EINTR if copying to user space got interrupted

2016-02-12 Thread Ewan Milne
On Fri, 2016-02-12 at 09:39 +0100, Hannes Reinecke wrote: > Commit 35dc248383bbab0a7203fca4d722875bc81ef091 introduced a check for > current->mm to see if we have a user space context and only copies data > if we do. Now if an IO gets interrupted by a signal data isn't copied > into user space any

Re: [PATCH] bio: return EINTR if copying to user space got interrupted

2016-02-12 Thread Douglas Gilbert
On 16-02-12 03:39 AM, Hannes Reinecke wrote: Commit 35dc248383bbab0a7203fca4d722875bc81ef091 introduced a check for current->mm to see if we have a user space context and only copies data if we do. Now if an IO gets interrupted by a signal data isn't copied into user space any more (as we don't h

Re: [PATCH v7 3/3] add support for DWC UFS Host Controller

2016-02-12 Thread Rob Herring
On Thu, Feb 11, 2016 at 12:13:06PM +, Joao Pinto wrote: > This patch has the goal to add support for DesignWare UFS Controller > specific operations and to add specific platform and pci drivers. > > Signed-off-by: Joao Pinto > --- > Changes v6->v7 (Arnd Bergmann): > - Changed DT node name (to

Re: [PATCH v2 3/7] ibmvscsi: Replace magic values in set_adpater_info() with defines

2016-02-12 Thread James Bottomley
On Wed, 2016-02-10 at 19:32 -0600, Tyrel Datwyler wrote: > Add defines for mad version and mad os_type, and replace the magic > numbers in set_adapter_info() accordingly. > > Signed-off-by: Tyrel Datwyler > --- Is there some reason you didn't carry the review tag over from this: http://mid.gman

Re: [PATCH v2 3/7] ibmvscsi: Replace magic values in set_adpater_info() with defines

2016-02-12 Thread Tyrel Datwyler
On 02/12/2016 08:43 AM, James Bottomley wrote: > On Wed, 2016-02-10 at 19:32 -0600, Tyrel Datwyler wrote: >> Add defines for mad version and mad os_type, and replace the magic >> numbers in set_adapter_info() accordingly. >> >> Signed-off-by: Tyrel Datwyler >> --- > > Is there some reason you did

Re: [PATCH v2 3/7] ibmvscsi: Replace magic values in set_adpater_info() with defines

2016-02-12 Thread James Bottomley
On Fri, 2016-02-12 at 08:51 -0800, Tyrel Datwyler wrote: > On 02/12/2016 08:43 AM, James Bottomley wrote: > > On Wed, 2016-02-10 at 19:32 -0600, Tyrel Datwyler wrote: > > > Add defines for mad version and mad os_type, and replace the > > > magic > > > numbers in set_adapter_info() accordingly. > >

Re: [PATCH v2 0/7] ibmvscsi code cleanup

2016-02-12 Thread Martin K. Petersen
> "Tyrel" == Tyrel Datwyler writes: Tyrel> Fixed up a couple spots that were out of line with the PAPR in Tyrel> regards to its defined VSCSI protocol. Did away with some magic Tyrel> numbers directly in the code. Fixed a minor endian issue. Applied to 4.6/scsi-queue. (And added the missing

Re: [PATCH v2 3/7] ibmvscsi: Replace magic values in set_adpater_info() with defines

2016-02-12 Thread Martin K. Petersen
> "James" == James Bottomley writes: James> OK we need a re-review then ... I'll hold off pushing for now. -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More

Re: megaraid_sas: Task management support

2016-02-12 Thread Martin K. Petersen
> "Sumit" == Sumit Saxena writes: Sumit, >> It looks like the code is correct but the patch just deleted a tab Sumit> Yes code is correct, tab got deleted accidentally. Please submit a patch to correct the formatting. -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe

[PATCH] Use ida_simple for SCSI iSCSI transport session id

2016-02-12 Thread Lee Duncan
The scsi_transport_iscsi module already uses the ida_simple routines for managing the target ID, if requested to do so. This change replaces an ever-increasing atomic integer that tracks the session ID itself with the ida_simple family of routines. This means that the session ID will be reclaimed a

Re: [PATCH v7 3/3] add support for DWC UFS Host Controller

2016-02-12 Thread Joao Pinto
Hi Rob, On 2/12/2016 4:36 PM, Rob Herring wrote: > On Thu, Feb 11, 2016 at 12:13:06PM +, Joao Pinto wrote: >> +Required properties: >> +- compatible: compatible string ("snps,ufshcd-1.0", >> "snps,ufshcd-1.1" >> + or "snps,ufshcd-2.0") > > History has taught us this needs to have a

Re: [PATCH] Use ida_simple for SCSI iSCSI transport session id

2016-02-12 Thread James Bottomley
On Fri, 2016-02-12 at 09:38 -0800, Lee Duncan wrote: > The scsi_transport_iscsi module already uses the ida_simple > routines for managing the target ID, if requested to do > so. This change replaces an ever-increasing atomic integer > that tracks the session ID itself with the ida_simple > family

Re: [PATCHv6 00/23] ALUA device handler update, part II

2016-02-12 Thread Bart Van Assche
On 02/12/2016 12:25 AM, Hannes Reinecke wrote: > as promised here is now the second part of my ALUA device handler update. Hello Hannes, Thanks for the quick respin. The first lockdep warning I noticed with the previous version is gone. But I saw the following with this patch series: ---

Re: [PATCH v7 3/3] add support for DWC UFS Host Controller

2016-02-12 Thread Rob Herring
On Fri, Feb 12, 2016 at 11:52 AM, Joao Pinto wrote: > Hi Rob, > > On 2/12/2016 4:36 PM, Rob Herring wrote: >> On Thu, Feb 11, 2016 at 12:13:06PM +, Joao Pinto wrote: >>> +Required properties: >>> +- compatible: compatible string ("snps,ufshcd-1.0", >>> "snps,ufshcd-1.1" >>> + or "snp

Re: [PATCH v2 3/7] ibmvscsi: Replace magic values in set_adpater_info() with defines

2016-02-12 Thread Manoj Kumar
Reviewed-by: Manoj Kumar --- Manoj Kumar On 2/10/2016 7:32 PM, Tyrel Datwyler wrote: Add defines for mad version and mad os_type, and replace the magic numbers in set_adapter_info() accordingly. Signed-off-by: Tyrel Datwyler --- drivers/scsi/ibmvscsi/ibmvscsi.c | 8 drivers/scsi

Re: [PATCH] Use ida_simple for SCSI iSCSI transport session id

2016-02-12 Thread Mike Christie
On 02/12/2016 11:54 AM, James Bottomley wrote: > On Fri, 2016-02-12 at 09:38 -0800, Lee Duncan wrote: >> The scsi_transport_iscsi module already uses the ida_simple >> routines for managing the target ID, if requested to do >> so. This change replaces an ever-increasing atomic integer >> that track

aicasm: fix kbuild for separated build directories

2016-02-12 Thread James Bottomley
I've recently been experimenting with building in emulated architecture containers which allow me to build natively on my laptop a kernel for any architecture which qemu will emulate. To do this, I've been building into build/$(uname -m) and this caused the aicasm stuff to fail to build (using CON

Re: [PATCH-v4 0/5] Fix LUN_RESET active I/O + TMR handling

2016-02-12 Thread Nicholas A. Bellinger
Hi Himanshu & Co, On Fri, 2016-02-12 at 00:48 -0800, Nicholas A. Bellinger wrote: > On Fri, 2016-02-12 at 05:30 +, Himanshu Madhani wrote: > Thanks for the crash dump output. > > So it's a t_state = TRANSPORT_WRITE_PENDING descriptor with > SAM_STAT_CHECK_CONDITION + cmd_kref.refcount = 0: