Re: [PATCH 3/5] scsi: Add 'access_state' attribute

2015-07-09 Thread Christoph Hellwig
On Wed, Jul 08, 2015 at 01:09:46PM +0200, Hannes Reinecke wrote: > Add an 'access_state' attribute to display the LUN access state. Should we just reuse the ALUA values here as they part of the spec and map the legacy implemetation values to it? I'd also really love to store the access_state vari

Re: [PATCH] SCSI-aic7...: Delete unnecessary checks before the function call "kfree"

2015-07-09 Thread SF Markus Elfring
Am 05.02.2015 um 22:27 schrieb SF Markus Elfring: > From: Markus Elfring > Date: Thu, 5 Feb 2015 22:23:48 +0100 > > The kfree() function tests whether its argument is NULL and then > returns immediately. Thus the test around the call is not needed. > > This issue was detected by using the Coccin

Re: [PATCH 10/10] scsi_dh: move 'dh_state' sysfs attribute to generic code

2015-07-09 Thread Christoph Hellwig
On Wed, Jul 08, 2015 at 11:07:05AM +0200, Hannes Reinecke wrote: > As scsi_dh.c is now always compiled in we should be moving > the 'dh_state' attribute to the generic code. > > Signed-off-by: Hannes Reinecke Looks fine, but a few coding style nitpicks: > + if (!sdev->handler) { > +

Re: [PATCH] SCSI-libcxgbi: Deletion of an unnecessary check before the function call "dst_release"

2015-07-09 Thread SF Markus Elfring
> From: Markus Elfring > Date: Fri, 21 Nov 2014 09:15:10 +0100 > > The dst_release() function tests whether its argument is NULL and then > returns immediately. Thus the test around the call is not needed. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus E

Re: [PATCH 3/5] scsi: Add 'access_state' attribute

2015-07-09 Thread Hannes Reinecke
On 07/09/2015 10:22 AM, Christoph Hellwig wrote: > On Wed, Jul 08, 2015 at 01:09:46PM +0200, Hannes Reinecke wrote: >> Add an 'access_state' attribute to display the LUN access state. > > Should we just reuse the ALUA values here as they part of the spec > and map the legacy implemetation values t

Re: [PATCH 10/10] scsi_dh: move 'dh_state' sysfs attribute to generic code

2015-07-09 Thread Hannes Reinecke
On 07/09/2015 10:24 AM, Christoph Hellwig wrote: > On Wed, Jul 08, 2015 at 11:07:05AM +0200, Hannes Reinecke wrote: >> As scsi_dh.c is now always compiled in we should be moving >> the 'dh_state' attribute to the generic code. >> >> Signed-off-by: Hannes Reinecke > > Looks fine, but a few coding

Re: [PATCH v1] libiscsi: Fix iscsi_check_transport_timeouts possible infinite loop

2015-07-09 Thread Sagi Grimberg
Ping? From: Ariel Nahum Connection last_ping is not being updated when iscsi_send_nopout fails. Not updating the last_ping will cause firing a timer to a past time (last_ping + ping_tmo < current_time) which triggers an infinite loop of iscsi_check_transport_timeouts() and hogs the cpu. Fix

Re: [PATCH] scsi: Use module_pci_driver

2015-07-09 Thread Finn Thain
On Wed, 8 Jul 2015, Vaishali Thakkar wrote: > Use module_pci_driver for drivers whose init and exit functions > only register and unregister, respectively. > > A simplified version of the Coccinelle semantic patch that performs > this transformation is as follows: > > @a@ > identifier f, x; > @

[PATCH v3 0/10] qla2xxx: Fix various warnings reported by static source code analysis tools

2015-07-09 Thread Bart Van Assche
This patch series addresses several warnings reported by static source code analysis tools for the qla2xxx driver (gcc (W=1), sparse (C=2) and smatch (C=2 CHECK="smatch -p=kernel")). The patches in this series are: 0001-qla2xxx-Report-both-rsp_info-and-rsp_info_len.patch 0002-qla2xxx-Declare-loca

[PATCH v3 02/10] qla2xxx: Declare local functions static

2015-07-09 Thread Bart Van Assche
Signed-off-by: Bart Van Assche Acked-by: Himanshu Madhani Cc: Quinn Tran Cc: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_bsg.c | 2 +- drivers/scsi/qla2xxx/qla_iocb.c | 4 ++-- drivers/scsi/qla2xxx/qla_nx.c | 2 +- drivers/scsi/qla2xxx/qla_nx2.c | 4 ++-- 4 files changed, 6 insertions(+),

[PATCH v3 03/10] qla2xxx: Remove set-but-not-used variables

2015-07-09 Thread Bart Van Assche
Detected these variables by building with W=1. Signed-off-by: Bart Van Assche Acked-by: Himanshu Madhani Cc: Quinn Tran Cc: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_attr.c | 2 -- drivers/scsi/qla2xxx/qla_bsg.c| 5 - drivers/scsi/qla2xxx/qla_dbg.c| 24 ++

[PATCH v3 01/10] qla2xxx: Report both rsp_info and rsp_info_len

2015-07-09 Thread Bart Van Assche
Let the debug statement in qlafx00_tm_iocb_entry() report both rsp_info and rsp_info_len instead of reporting rsp_info_len twice. Signed-off-by: Bart Van Assche Acked-by: Himanshu Madhani Cc: Quinn Tran Cc: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_mr.c | 4 ++-- 1 file changed, 2 insertion

[PATCH v3 04/10] qla2xxx: Replace two macros with an inline function

2015-07-09 Thread Bart Van Assche
Replace the QLA82XX_ADDR_IN_RANGE() and QLA8044_ADDR_IN_RANGE() macros with the inline function addr_in_range(). This avoids that the compiler reports the following warning when building with W=1: comparison of unsigned expression >= 0 is always true. Signed-off-by: Bart Van Assche Acked-by: Hima

[PATCH v3 06/10] qla2xxx: Avoid that sparse complains about duplicate [noderef] attributes

2015-07-09 Thread Bart Van Assche
Signed-off-by: Bart Van Assche Acked-by: Himanshu Madhani Cc: Quinn Tran Cc: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_dbg.c | 2 +- drivers/scsi/qla2xxx/qla_init.c | 2 +- drivers/scsi/qla2xxx/qla_iocb.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/

[PATCH v3 09/10] qla2xxx: Remove dead code

2015-07-09 Thread Bart Van Assche
The "return QLA_SUCCESS" statement just above the "fw_load_failed" label cannot be reached, hence remove it. Additionally remove the "else" keyword since the code block below the if-statement ends with a return statement. Signed-off-by: Bart Van Assche Acked-by: Himanshu Madhani Cc: Quinn Tran

[PATCH v3 10/10] qla2xxx: Avoid that sparse complains about context imbalances

2015-07-09 Thread Bart Van Assche
Surround conditional locking statements with "#ifndef __CHECKER__" / "#endif" to hide these for the sparse static source code analysis tool. Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_dbg.c| 36 drivers/scsi/qla2xxx/qla_nx.c | 8

[PATCH v3 08/10] qla2xxx: Remove a superfluous test

2015-07-09 Thread Bart Van Assche
Avoid that smatch reports the following warning: drivers/scsi/qla2xxx/qla_attr.c:1081: qla2x00_model_desc_show() warn: this array is probably non-NULL. 'vha->hw->model_desc' Signed-off-by: Bart Van Assche Acked-by: Himanshu Madhani Cc: Quinn Tran Cc: Saurav Kashyap --- drivers/scsi/qla2xxx/

[PATCH v3 07/10] qla2xxx: Fix sparse annotations

2015-07-09 Thread Bart Van Assche
This patch removes 21 casts between an __iomem pointer type and another data type but also introduces five new casts (see also the casts with "__force"). Although this patch does not change any functionality, IMHO the code with __force casts needs further review. Signed-off-by: Bart Van Assche Ac

[PATCH v3 05/10] qla2xxx: Remove __constant_ prefix

2015-07-09 Thread Bart Van Assche
Whether htonl() or __constant_htonl() is used, if the argument is a constant the conversion happens at compile time. Hence leave out the __constant_ prefix for this and other endianness conversion functions. This improves source code readability. Signed-off-by: Bart Van Assche Acked-by: Himanshu

Re: [PATCH] scsi: Fix sense information setting in fixed sized format

2015-07-09 Thread Bart Van Assche
On 07/08/15 08:00, Sagi Grimberg wrote: In fixed size sense format the information field is a four byte field. Signed-off-by: Sagi Grimberg --- drivers/scsi/scsi_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common

Re: [PATCH v4 1/5] target: Inline transport_get_sense_codes()

2015-07-09 Thread Martin K. Petersen
> "Sagi" == Sagi Grimberg writes: Sagi> From: Bart Van Assche Inline this Sagi> function in its call site since it performs a trivial task and Sagi> since it is only called once. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from th

Re: [PATCH v4 2/5] target: Split transport_send_check_condition_and_sense()

2015-07-09 Thread Martin K. Petersen
> "Sagi" == Sagi Grimberg writes: Sagi> From: Bart Van Assche Move the code Sagi> for translating a sense_reason_t code into a SCSI status ASC and Sagi> ASCQ codes from transport_send_check_condition_and_sense() into Sagi> the new function translate_sense_reason(). Convert the switch Sagi> s

Re: [PATCH v4 3/5] scsi: Move sense handling routines to scsi_common

2015-07-09 Thread Martin K. Petersen
> "Sagi" == Sagi Grimberg writes: Sagi> Sense data handling is also done in the target stack. Hence, move Sagi> sense handling routines to scsi_common so the target will be able Sagi> to use them as well. I'm OK with addressing the buffer size in a separate patch. Reviewed-by: Martin K. Pe

Re: [PATCH v4 4/5] target: Use scsi helpers to build the sense data correctly

2015-07-09 Thread Martin K. Petersen
> "Sagi" == Sagi Grimberg writes: Sagi> Instead of open coding the sense buffer construction, use scsi Sagi> scsi_build_sense_buffer() and scsi_set_sense_information() helpers Sagi> which moved to scsi_common. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Enginee

Re: [PATCH v4 5/5] target: Return ABORTED_COMMAND sense key for PI errors

2015-07-09 Thread Martin K. Petersen
> "Sagi" == Sagi Grimberg writes: Sagi> PI errors were reported with ILLEGAL_REQUEST sense key but there Sagi> was actually no problem with the request. Target detected PI Sagi> errors should be reported with aborted command sense key. For legacy reasons we use ILLEGAL REQUEST with the same

Re: [PATCH] scsi: Fix sense information setting in fixed sized format

2015-07-09 Thread Martin K. Petersen
> "Sagi" == Sagi Grimberg writes: Sagi> In fixed size sense format the information field is a four byte Sagi> field. Correct. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in th

Re: [PATCH 00/11] qla2xxx: Updates for Target Mode driver

2015-07-09 Thread Himanshu Madhani
Hi Nic, On 7/6/15, 6:16 PM, "Nicholas A. Bellinger" wrote: >Hi Himanshu & Co, > >(Adding target-devel for the qla_target.c bits, please include this > list for future target patches :-) Will do that for future submissions. > >On Thu, 2015-06-25 at 12:33 -0400, Himanshu Madhani wrote: >> Hi J

Re: [PATCH 09/11] qla2xxx: Added interface to send ELS commands from driver.

2015-07-09 Thread Himanshu Madhani
Hi James, Christoph, On 7/7/15, 1:26 AM, "James Bottomley" wrote: >On Fri, 2015-07-03 at 09:14 -0700, Christoph Hellwig wrote: >> Why is this a binary attribute? Needs an interface specific in >> Documentation/ABI/ to start with, and a Ccto stable seems very >> aggressive. > >Right, adding an

[PATCH] arcmsr: Fix a potential data corruption issue

2015-07-09 Thread Christophe JAILLET
Resetting rqbuffer or wqbuffer must be done within a critial section in order to avoir potential data corruption. Signed-off-by: Christophe JAILLET --- This change is *untested* because I don't have the corresponding hardware. However, it should'nt have any evil side effect (just a few lines of c

Re: [PATCH][SCSI] hptiop: Support HighPoint RR36xx HBAs and Support SAS tape and SAS media changer

2015-07-09 Thread linux
Hi, We found that the updated hptiop driver (version v1.10.0) was not embedded into kernel 4.2 RC1, is there something wrong with the submitted patch or when would the patch be accepted? If there is any question, please do not hesitate to let us know. Best Regards, HighPoint Linux Team

Re: [PATCH v4 3/5] scsi: Move sense handling routines to scsi_common

2015-07-09 Thread Hannes Reinecke
On 07/08/2015 05:23 PM, Sagi Grimberg wrote: > On 7/8/2015 6:06 PM, Hannes Reinecke wrote: > >> We're adding extra fields here, so we need to make sure to not >> overflow the buffer. You probably have to pass in the buffersize >> to avoid an overflow ... >> Yeah, I know, it's theoretical at the mo

Re: [PATCH] lpfc: Destroy lpfc_hba_index IDR on module exit

2015-07-09 Thread Hannes Reinecke
On 07/08/2015 05:19 PM, Johannes Thumshirn wrote: > Destroy lpfc_hba_index IDR on module exit, reclaiming the allocated memory. > > This was detected by the following semantic patch (written by Luis Rodriguez > ) > > @ defines_module_init @ > declarer name module_init, module_exit; > declarer nam

Re: [PATCH] st: Destroy st_index_idr on module exit

2015-07-09 Thread Hannes Reinecke
On 07/08/2015 05:24 PM, Johannes Thumshirn wrote: > Destroy st_index_idr on module exit, reclaiming the allocated memory. > > This was detected by the following semantic patch (written by Luis Rodriguez > ) > > @ defines_module_init @ > declarer name module_init, module_exit; > declarer name DEFI