Re: [PATCH RESEND] scsi: ppa: use new parport device model

2016-02-11 Thread Johannes Thumshirn
On Thu, Feb 11, 2016 at 10:42:49AM +0530, Sudip Mukherjee wrote:
> Modify ppa driver to use the new parallel port device model.
> 
> Signed-off-by: Sudip Mukherjee 
Reviewed-by: Johannes Thumshirn 

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 5/7] ibmvscsi: Remove unsupported host config MAD

2016-02-11 Thread Johannes Thumshirn
On Wed, Feb 10, 2016 at 07:32:26PM -0600, Tyrel Datwyler wrote:
> A VIOSRP_HOST_CONFIG_TYPE management datagram (MAD) has existed in
> the code for some time. From what information I've gathered from
> Brian King this was likely implemented on the host side in a SLES 9
> based VIOS, which is no longer supported anywhere. Further, it is
> not defined in PAPR or supported by any AIX based VIOS.
> 
> Treating as bit rot and removing the associated host config code.
> The config attribute and its show function are left as not to break
> userspace. The behavior remains the same returning nothing.
> 
> Signed-off-by: Tyrel Datwyler 

Reviewed-by: Johannes Thumshirn 

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 7/7] ibmvscsi: use H_CLOSED instead of magic number

2016-02-11 Thread Johannes Thumshirn
On Wed, Feb 10, 2016 at 07:32:28PM -0600, Tyrel Datwyler wrote:
> In a couple places the magic value of 2 is used to check the return
> code of hypercalls. This translates to H_CLOSED.
> 
> Signed-off-by: Tyrel Datwyler 

Reviewed-by: Johannes Thumshirn 

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RESEND] scsi: sim710: fix build warning

2016-02-11 Thread Johannes Thumshirn
On Thu, Feb 11, 2016 at 10:29:03AM +0530, Sudip Mukherjee wrote:
> We are getting build warning about:
>  "Section mismatch in reference from the variable sim710_eisa_driver to
>  the function .init.text:sim710_eisa_probe()
>  The variable sim710_eisa_driver references the function __init
>  sim710_eisa_probe()"
> 
> sim710_eisa_probe() was having __init but that was being referenced from
> sim710_eisa_driver.
> 
> Signed-off-by: Sudip Mukherjee 

Reviewed-by: Johannes Thumshirn 

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH RESEND] bfa: deinline __bfa_trc() and __bfa_trc32()

2016-02-11 Thread Anil Gurumurthy
You could remove the __bfa_trc32() routine

Thanks,
Acked-by: Anil Gurumurthy 

-Original Message-
From: Martin K. Petersen [mailto:martin.peter...@oracle.com] 
Sent: 10 February 2016 22:59
To: Denys Vlasenko 
Cc: James Bottomley ; Fabian Frederick 
; Anil Gurumurthy ; Christoph 
Hellwig ; Guenter Roeck ; Ben Hutchings 
; linux-kernel ; linux-scsi 

Subject: Re: [PATCH RESEND] bfa: deinline __bfa_trc() and __bfa_trc32()

> "Denys" == Denys Vlasenko  writes:

Denys> __bfa_trc32() is very similar, so it is uninlined too.  However, 
Denys> it appears to be unused, therefore this patch ifdefs it out.

Why don't we just drop it?

-- 
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 majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/1] mpt3sas: Fix - Remove cpumask_clear for zalloc_cpumask_var and dont free free_cpu_mask_var before reply_q

2016-02-11 Thread Suganath prabu Subramani
From: Suganath prabu Subramani 

Removed cpumask_clear as it is not required for zalloc_cpumask_var and
free free_cpumask_var before freeing reply_q.

Signed-off-by: Suganath prabu Subramani 
Signed-off-by: Chaitra P B 
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index c0a9d97..afdb13a 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -1855,7 +1855,6 @@ _base_request_irq(struct MPT3SAS_ADAPTER *ioc, u8 index, 
u32 vector)
kfree(reply_q);
return -ENOMEM;
}
-   cpumask_clear(reply_q->affinity_hint);
}
 
atomic_set(_q->busy, 0);
@@ -1870,8 +1869,8 @@ _base_request_irq(struct MPT3SAS_ADAPTER *ioc, u8 index, 
u32 vector)
if (r) {
pr_err(MPT3SAS_FMT "unable to allocate interrupt %d!\n",
reply_q->name, vector);
-   kfree(reply_q);
free_cpumask_var(reply_q->affinity_hint);
+   kfree(reply_q);
return -EBUSY;
}
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2016-02-11 Thread Johannes Thumshirn
On Wed, Feb 10, 2016 at 07:32:23PM -0600, 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), a valid initialization entry (0xC0),
> and a valid transport event (0xFF). Further, initialization responses
> have two formats namely initialize (0x01) and initialize complete
> (0x02). Define these values as enums and use them in the code in
> place of their magic number equivalents.
> 
> Signed-off-by: Tyrel Datwyler 

Reviewed-by: Johannes Thumshirn 

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2016-02-11 Thread Himanshu Madhani
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, "Nicholas A. Bellinger" 
>>wrote:
>> > >On Mon, 2016-02-08 at 23:27 +, Himanshu Madhani wrote:
>> > >> 
>> > >> I am testing this series with with 4.5.0-rc2+ kernel and I am
>>seeing
>> > >>issue
>> > >> where trying to trigger
>> > >> sg_reset with option of host/device/bus in loop at 120second
>>interval
>> > >> causes call stack. At this point
>> > >> removing configuration hangs indefinitely. See attached dmesg
>>output
>> > >>from
>> > >> my setup. 
>> > >> 
>> > >
>> > >Thanks alot for testing this.
>> > >
>> > >So It looks like we're still hitting a indefinite schedule() on
>> > >se_cmd->cmd_wait_comp once tcm_qla2xxx session disconnect/reconnect
>> > >occurs, after repeated explicit active I/O remote-port sg_resets.
>> > >
>> > >Does this trigger on the first tcm_qla2xxx session reconnect after
>> > >explicit remote-port sg_reset..?  Are session reconnects actively
>>being
>> > >triggered during the test..?
>> > >
>> > >To verify the latter for iscsi-target, I've been using a small patch
>>to
>> > >trigger session reset from TMR kthread context in order to simulate
>>the
>> > >I_T disconnects.  Something like that would be useful for verifying
>>with
>> > >tcm_qla2xxx too.
>> > >
>> > >That said, I'll be reproducing with tcm_qla2xxx ports this week, and
>> > >will enable various debug in a WIP branch for testing.
>> 
>> Following up here..
>> 
>> So far using my test setup with ISP2532 ports in P2P + RAMDISK_MCP and
>> v4.5-rc1, repeated remote-port active I/O LUN_RESET (sg_reset -d) has
>> been functioning as expected with a blocksize_range=4k-256k + iodepth=32
>> fio write-verify style workload.
>> 
>> No ->cmd_kref -1 OOPsen or qla2xxx initiator generated ABORT_TASKs from
>> outstanding target TAS responses, nor fio write-verify failures to
>> report after 800x remote-port active I/O LUN_RESETS.
>> 
>> Next step will be to verify explicit tcm_qla2xxx port + module shutdown
>> after 1K test iterations, and then IBLOCK async completions <-> NVMe
>> backends with the same case.
>> 
>
>After letting this test run over-night up to 7k active I/O remote-port
>LUN_RESETs, things are still functioning as expected.
>
>Also, /etc/init.d/target stop was able to successfully shutdown all
>active sessions and unload tcm_qla2xxx after the test run.
>
>So AFAICT, the active I/O remote-port LUN_RESET changes are stable with
>tcm_qla2xxx ports, separate from concurrent session disconnect hung task
>you reported earlier.
>
>That said, I'll likely push this series as-is for -rc4, given that Dan
>has also been able to verify the non conncurrent session disconnect case
>on his setup generating constant ABORT_TASKs, and it's still surviving
>both cases for iscsi-target ports.
>
>Please give the debug patch from last night a shot, and see if we can
>determine the se_cmd states when you hit the hung task.

I¹ll give your latest debug patch try in a little while

>From the testing that I have done, what is seen is that active IO has
already been completed and qla2xxx driver is waiting for commands to be
Completed and it¹s waiting indefinitely for cmd_wait_comp.
So it looks like there is a missing complete call from target_core. I¹ve
attached our analysis from crash debug on a live system after the issues
happens.


I can recreate this issue at will within 5 minute of triggering sg_reset
with following steps

1. Export 4 RAM disk LUNs on each of 2 port adapter. Initiator will see 8
RAM disk targets
2. Start IO with 4K block size and 8 threads with 80% write 20% read and
100% dandom. 
(I am using vdbench for generating IO. I can provide setup/config script
if needed)
3. Start sg_reset for each LUNs with first device, bus and host with 120s
delay. (I¹ve attached
My script that I am using for triggering sg_reset)

>
>Thank you,
>
>-nab
>

<>

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

2016-02-11 Thread Hannes Reinecke
On 02/11/2016 09:25 PM, Ewan Milne wrote:
> On Mon, 2016-02-08 at 15:34 +0100, Hannes Reinecke wrote:
>> 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.
> 
> Note that we may need to add a timeout on this somehow, I have
> recently seen a bug report where an array stayed in the ALUA
> transitioning state for an extremely long period of time.
> 
> That problem would occur with either the current or this new
> ALUA code, the question is whether we want to handle it better.
> 
There already is provisioning in the code to set the port to STANDBY
if the transitioning time is exceeded.
Not that this code path is well tested, but it's there :-)

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 19/23] scsi_dh: add 'rescan' callback

2016-02-11 Thread Hannes Reinecke
On 02/11/2016 09:27 PM, Ewan Milne wrote:
> On Mon, 2016-02-08 at 15:34 +0100, Hannes Reinecke wrote:
>> 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().
> 
> This comment should mention that you have also changed the Unit
> Attention handling of ASC/ASCQ 3F 03 INQUIRY DATA HAS CHANGED
> to automatically rescan the device (prior to the uevent).
> 
True. I will be updating the comment if I need to resend the patchset.

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 20/23] scsi: Add 'access_state' attribute

2016-02-11 Thread Hannes Reinecke
On 02/11/2016 09:33 PM, Ewan Milne wrote:
> On Mon, 2016-02-08 at 15:34 +0100, Hannes Reinecke wrote:
>> Add an 'access_state' attribute to struct scsi_device to
>> display the asymmetric LUN access state.
>>
>> Reviewed-by: Christoph Hellwig 
>> Signed-off-by: Hannes Reinecke 
>> ---
>>  drivers/scsi/scsi_scan.c   |  1 +
>>  drivers/scsi/scsi_sysfs.c  | 49 
>> ++
>>  include/scsi/scsi_device.h |  1 +
>>  include/scsi/scsi_proto.h  | 13 
>>  4 files changed, 64 insertions(+)
>>
>> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
>> index 97074c9..5bf3945 100644
>> --- a/drivers/scsi/scsi_scan.c
>> +++ b/drivers/scsi/scsi_scan.c
>> @@ -231,6 +231,7 @@ static struct scsi_device *scsi_alloc_sdev(struct 
>> scsi_target *starget,
>>  sdev->lun = lun;
>>  sdev->channel = starget->channel;
>>  sdev->sdev_state = SDEV_CREATED;
>> +sdev->access_state = SCSI_ACCESS_STATE_UNKNOWN;
>>  INIT_LIST_HEAD(>siblings);
>>  INIT_LIST_HEAD(>same_target_siblings);
>>  INIT_LIST_HEAD(>cmd_list);
>> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
>> index 4f18a85..8d154ed 100644
>> --- a/drivers/scsi/scsi_sysfs.c
>> +++ b/drivers/scsi/scsi_sysfs.c
>> @@ -81,6 +81,34 @@ const char *scsi_host_state_name(enum scsi_host_state 
>> state)
>>  return name;
>>  }
>>  
>> +static const struct {
>> +enum scsi_access_state  value;
>> +char*name;
>> +} sdev_access_states[] = {
>> +{ SCSI_ACCESS_STATE_OPTIMAL, "active/optimized" },
>> +{ SCSI_ACCESS_STATE_ACTIVE, "active/non-optimized" },
>> +{ SCSI_ACCESS_STATE_STANDBY, "standby" },
>> +{ SCSI_ACCESS_STATE_UNAVAILABLE, "unavailable" },
>> +{ SCSI_ACCESS_STATE_LBA, "lba-dependent" },
>> +{ SCSI_ACCESS_STATE_OFFLINE, "offline" },
>> +{ SCSI_ACCESS_STATE_TRANSITIONING, "transitioning" },
>> +{ SCSI_ACCESS_STATE_UNKNOWN, "unknown" },
>> +};
>> +
>> +const char *scsi_access_state_name(enum scsi_access_state state)
>> +{
>> +int i;
>> +char *name = NULL;
>> +
>> +for (i = 0; i < ARRAY_SIZE(sdev_access_states); i++) {
>> +if (sdev_access_states[i].value == state) {
>> +name = sdev_access_states[i].name;
>> +break;
>> +}
>> +}
>> +return name;
>> +}
>> +
>>  static int check_set(unsigned long long *val, char *src)
>>  {
>>  char *last;
>> @@ -973,6 +1001,26 @@ sdev_store_dh_state(struct device *dev, struct 
>> device_attribute *attr,
>>  
>>  static DEVICE_ATTR(dh_state, S_IRUGO | S_IWUSR, sdev_show_dh_state,
>> sdev_store_dh_state);
>> +
>> +static ssize_t
>> +sdev_show_access_state(struct device *dev,
>> +   struct device_attribute *attr,
>> +   char *buf)
>> +{
>> +struct scsi_device *sdev = to_scsi_device(dev);
>> +enum scsi_access_state access_state;
>> +bool pref = false;
>> +
>> +if (sdev->access_state & SCSI_ACCESS_STATE_PREFERRED)
>> +pref = true;
>> +
>> +access_state = (sdev->access_state & SCSI_ACCESS_STATE_MASK);
> 
> I personally think it is a mistake to stick an extra bit in the
> top of a variable declared as an enum like this.  It opens up
> the possibility of subtle bugs if someone changes the code in
> the future and does not take care to preserve your extra bit.
> 
But I felt even more stupid adding yet another bit to the
scsi_device structure ...

>> +
>> +return snprintf(buf, 32, "%s%s\n",
>> +scsi_access_state_name(access_state),
>> +pref ? " preferred" : "");
>> +}
>> +static DEVICE_ATTR(access_state, S_IRUGO, sdev_show_access_state, NULL);
>>  #endif
>>  
>>  static ssize_t
>> @@ -1047,6 +1095,7 @@ static struct attribute *scsi_sdev_attrs[] = {
>>  _attr_wwid.attr,
>>  #ifdef CONFIG_SCSI_DH
>>  _attr_dh_state.attr,
>> +_attr_access_state.attr,
>>  #endif
>>  _attr_queue_ramp_up_period.attr,
>>  REF_EVT(media_change),
>> diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
>> index 4af2b24..af16a0d 100644
>> --- a/include/scsi/scsi_device.h
>> +++ b/include/scsi/scsi_device.h
>> @@ -201,6 +201,7 @@ struct scsi_device {
>>  struct scsi_device_handler *handler;
>>  void*handler_data;
>>  
>> +enum scsi_access_state  access_state;
>>  enum scsi_device_state sdev_state;
>>  unsigned long   sdev_data[0];
>>  } __attribute__((aligned(sizeof(unsigned long;
>> diff --git a/include/scsi/scsi_proto.h b/include/scsi/scsi_proto.h
>> index a9fbf1b..80e85e7 100644
>> --- a/include/scsi/scsi_proto.h
>> +++ b/include/scsi/scsi_proto.h
>> @@ -277,5 +277,18 @@ struct scsi_lun {
>>  __u8 scsi_lun[8];
>>  };
>>  
>> +/* SPC asymmetric access states */
>> +enum scsi_access_state {
>> +SCSI_ACCESS_STATE_OPTIMAL = 0,
>> +SCSI_ACCESS_STATE_ACTIVE,
>> +SCSI_ACCESS_STATE_STANDBY,
>> + 

Re: [PATCH 22/23] scsi_dh_alua: update 'access_state' field

2016-02-11 Thread Hannes Reinecke
On 02/11/2016 09:37 PM, Ewan Milne wrote:
> On Mon, 2016-02-08 at 15:34 +0100, Hannes Reinecke wrote:
>> Track attached SCSI devices and update the 'access_state' field
>> whenever an ALUA state change has been detected.
>>
>> Signed-off-by: Hannes Reinecke 
>> ---
>>  drivers/scsi/device_handler/scsi_dh_alua.c | 45 
>> --
>>  1 file changed, 43 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c 
>> b/drivers/scsi/device_handler/scsi_dh_alua.c
>> index 51126b78..7bcc075 100644
>> --- a/drivers/scsi/device_handler/scsi_dh_alua.c
>> +++ b/drivers/scsi/device_handler/scsi_dh_alua.c
>> @@ -24,6 +24,7 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>>  #include 
>>  #include 
>>  #include 
>> @@ -75,6 +76,7 @@ struct alua_port_group {
>>  struct kref kref;
>>  struct rcu_head rcu;
>>  struct list_headnode;
>> +struct list_headdh_list;
>>  unsigned char   device_id_str[256];
>>  int device_id_len;
>>  int group_id;
>> @@ -92,6 +94,7 @@ struct alua_port_group {
>>  };
>>  
>>  struct alua_dh_data {
>> +struct list_headnode;
>>  struct alua_port_group  *pg;
>>  int group_id;
>>  spinlock_t  pg_lock;
>> @@ -247,6 +250,7 @@ struct alua_port_group *alua_alloc_pg(struct scsi_device 
>> *sdev,
>>  INIT_DELAYED_WORK(>rtpg_work, alua_rtpg_work);
>>  INIT_LIST_HEAD(>rtpg_list);
>>  INIT_LIST_HEAD(>node);
>> +INIT_LIST_HEAD(>dh_list);
>>  spin_lock_init(>lock);
>>  
>>  spin_lock(_group_lock);
>> @@ -328,6 +332,8 @@ static int alua_check_vpd(struct scsi_device *sdev, 
>> struct alua_dh_data *h,
>>  {
>>  int rel_port = -1, group_id;
>>  struct alua_port_group *pg, *old_pg = NULL;
>> +bool pg_updated;
>> +unsigned long flags;
>>  
>>  group_id = scsi_vpd_tpg_id(sdev, _port);
>>  if (group_id < 0) {
>> @@ -357,13 +363,25 @@ static int alua_check_vpd(struct scsi_device *sdev, 
>> struct alua_dh_data *h,
>>  old_pg = h->pg;
>>  if (old_pg != pg) {
>>  /* port group has changed. Update to new port group */
>> +if (h->pg) {
>> +spin_lock_irqsave(_pg->lock, flags);
>> +list_del_rcu(>node);
>> +spin_unlock_irqrestore(_pg->lock, flags);
>> +}
>>  rcu_assign_pointer(h->pg, pg);
>> +pg_updated = true;
>>  }
>>  if (sdev->synchronous_alua)
>>  pg->flags |= ALUA_SYNC_STPG;
>>  alua_rtpg_queue(h->pg, sdev, NULL, true);
>>  spin_unlock(>pg_lock);
>>  
>> +if (pg_updated) {
>> +spin_lock_irqsave(>lock, flags);
>> +list_add_rcu(>node, >dh_list);
>> +spin_unlock_irqrestore(>lock, flags);
>> +}
>> +
>>  if (old_pg)
>>  kref_put(_pg->kref, release_port_group);
>>  
>> @@ -613,8 +631,18 @@ static int alua_rtpg(struct scsi_device *sdev, struct 
>> alua_port_group *pg)
>>  if (spin_trylock_irqsave(_pg->lock, flags)) {
>>  if ((tmp_pg == pg) ||
>>  !(tmp_pg->flags & ALUA_PG_RUNNING)) {
>> +struct alua_dh_data *h;
>> +
>>  tmp_pg->state = desc[0] & 0x0f;
>>  tmp_pg->pref = desc[0] >> 7;
>> +rcu_read_lock();
>> +list_for_each_entry_rcu(h,
>> +_pg->dh_list, node) {
>> +/* h->sdev should always be 
>> valid */
>> +BUG_ON(!h->sdev);
>> +h->sdev->access_state = desc[0];
> 
> Here you did not mask desc[0] with 0x0f like you did in other places in the 
> code.
> 
Because the access_state field is a 1:1 copy of the 'desc[0]' field,
containing both the value and the pref bit.

>> +}
>> +rcu_read_unlock();
>>  }
>>  if (tmp_pg == pg)
>>  valid_states = desc[1];
>> @@ -646,10 +674,19 @@ static int alua_rtpg(struct scsi_device *sdev, struct 
>> alua_port_group *pg)
>>  pg->interval = 2;
>>  err = SCSI_DH_RETRY;
>>  } else {
>> +struct alua_dh_data *h;
>> +
>>  /* Transitioning time exceeded, set port to standby */
>>  err = SCSI_DH_IO;
>>  pg->state = SCSI_ACCESS_STATE_STANDBY;
>>  pg->expiry = 0;
>> +rcu_read_lock();
>> +list_for_each_entry_rcu(h, >dh_list, node) {

[GIT PULL] SCSI fixes for 4.5-rc3

2016-02-11 Thread James Bottomley
A set of seven fixes.  Two regressions in the new hisi_sas arm driver,
a blacklist entry for the marvell console which was causing a reset
cascade without it, a race fix in the WRITE_SAME/DISCARD routines, a
retry fix for the rdac driver, without which, it would prematurely
return EIO and a couple of fixes for the hyper-v storvsc driver.

The patch is available here:

git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes

The short changelog is:

Hannes Reinecke (1):
  scsi_dh_rdac: always retry MODE SELECT on command lock violation

John Garry (2):
  hisi_sas: fix v1 hw check for slot error
  hisi_sas: add dependency for HAS_IOMEM

K. Y. Srinivasan (2):
  storvsc: Use the specified target ID in device lookup
  storvsc: Install the storvsc specific timeout handler for FC devices

Martin K. Petersen (1):
  block/sd: Return -EREMOTEIO when WRITE SAME and DISCARD are disabled

Mika Westerberg (1):
  SCSI: Add Marvell Console to VPD blacklist

and the diffstat:

 block/blk-core.c   |  6 --
 drivers/scsi/device_handler/scsi_dh_rdac.c |  4 +++-
 drivers/scsi/hisi_sas/Kconfig  |  2 +-
 drivers/scsi/hisi_sas/hisi_sas_v1_hw.c |  9 +++--
 drivers/scsi/scsi_devinfo.c|  1 +
 drivers/scsi/sd.c  |  4 ++--
 drivers/scsi/storvsc_drv.c | 16 +++-
 include/linux/blkdev.h |  9 ++---
 8 files changed, 31 insertions(+), 20 deletions(-)

With the full diff below.

James

---

diff --git a/block/blk-core.c b/block/blk-core.c
index ab51685..b83d297 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2455,14 +2455,16 @@ struct request *blk_peek_request(struct request_queue 
*q)
 
rq = NULL;
break;
-   } else if (ret == BLKPREP_KILL) {
+   } else if (ret == BLKPREP_KILL || ret == BLKPREP_INVALID) {
+   int err = (ret == BLKPREP_INVALID) ? -EREMOTEIO : -EIO;
+
rq->cmd_flags |= REQ_QUIET;
/*
 * Mark this request as started so we don't trigger
 * any debug logic in the end I/O path.
 */
blk_start_request(rq);
-   __blk_end_request_all(rq, -EIO);
+   __blk_end_request_all(rq, err);
} else {
printk(KERN_ERR "%s: bad return=%d\n", __func__, ret);
break;
diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c 
b/drivers/scsi/device_handler/scsi_dh_rdac.c
index 3613581..93880ed 100644
--- a/drivers/scsi/device_handler/scsi_dh_rdac.c
+++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
@@ -562,7 +562,7 @@ static int mode_select_handle_sense(struct scsi_device 
*sdev,
/*
 * Command Lock contention
 */
-   err = SCSI_DH_RETRY;
+   err = SCSI_DH_IMM_RETRY;
break;
default:
break;
@@ -612,6 +612,8 @@ retry:
err = mode_select_handle_sense(sdev, h->sense);
if (err == SCSI_DH_RETRY && retry_cnt--)
goto retry;
+   if (err == SCSI_DH_IMM_RETRY)
+   goto retry;
}
if (err == SCSI_DH_OK) {
h->state = RDAC_STATE_ACTIVE;
diff --git a/drivers/scsi/hisi_sas/Kconfig b/drivers/scsi/hisi_sas/Kconfig
index b676618..d1dd161 100644
--- a/drivers/scsi/hisi_sas/Kconfig
+++ b/drivers/scsi/hisi_sas/Kconfig
@@ -1,6 +1,6 @@
 config SCSI_HISI_SAS
tristate "HiSilicon SAS"
-   depends on HAS_DMA
+   depends on HAS_DMA && HAS_IOMEM
depends on ARM64 || COMPILE_TEST
select SCSI_SAS_LIBSAS
select BLK_DEV_INTEGRITY
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c 
b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
index 057fdeb..eea24d7 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
@@ -1289,13 +1289,10 @@ static int slot_complete_v1_hw(struct hisi_hba 
*hisi_hba,
goto out;
}
 
-   if (cmplt_hdr_data & CMPLT_HDR_ERR_RCRD_XFRD_MSK) {
-   if (!(cmplt_hdr_data & CMPLT_HDR_CMD_CMPLT_MSK) ||
-   !(cmplt_hdr_data & CMPLT_HDR_RSPNS_XFRD_MSK))
-   ts->stat = SAS_DATA_OVERRUN;
-   else
-   slot_err_v1_hw(hisi_hba, task, slot);
+   if (cmplt_hdr_data & CMPLT_HDR_ERR_RCRD_XFRD_MSK &&
+   !(cmplt_hdr_data & CMPLT_HDR_RSPNS_XFRD_MSK)) {
 
+   slot_err_v1_hw(hisi_hba, task, slot);
goto out;
}
 
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index 47b9d13..da2e068 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -205,6 

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

2016-02-11 Thread Joao Pinto
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 ufs only) and the memory address (to 0xd00)
- Removed CONFIG_PM from the PCI glue driver (pm.h already does this)
- No other changes are necessary in ufshcd.c because of the link up notify
 function usage (it is simpler now)
- Removed the PHY mentioning since the Test Chip is not a real PHY for real
 world usage, since it is a test chip for prototyping with a very specific
 usage
- Added again the Test Chip 20-bit option
Changes v5->v6:
- Patch bad format fixed
Changes v4->v5 (Akinobu Mita):
- All functions used only locally in ufshcd-dwc are now declared as static
- ufshcd_dwc_configuration() was removed in ufshcd-dwc and a notify
 function (ufshcd_dwc_link_startup_notify) was created to deal with the
 DWC specific init routines
- 20-bit RMMI option was removed from Kconfig. Now if MPHY TC is selected
 and 40-bit is not then it assumes a 20-bit config
Changes v3->v4 (Arnd Bergmann and Mark Rutland):
- SCSI_UFS_DWC_HOOKS is now silent and selected by the SCSI_UFS_DWC_PLAT
 or SCSI_UFS_DWC_PCI
- Compatibility string has the ufs core version for info purposes since
 the driver is capable of getting the controller version from its 
 registers
- Created ufs-dwc-pci glue driver with specific DWC data
- MPHY configuration remains in the ufshcd-dwc since it is unipro
 attribute writting only not following the a linux phy framework logic
Changes v2->v3 (Julian Calaby):
- Implement a common DWC code to be used by the platform and pci glue
 drivers
- Synopsys ID & Class added to the existing pci driver and specific DWC
 was also added to the pci driver
Changes v1->v2 (Akinobu Mita):
- Implement a platform driver that uses the existing UFS core driver
- Add DWC specific code to the existing UFS core driver

 Documentation/devicetree/bindings/ufs/ufs-dwc.txt |  17 +
 MAINTAINERS   |   6 +
 drivers/scsi/ufs/Kconfig  |  51 ++
 drivers/scsi/ufs/Makefile |   3 +
 drivers/scsi/ufs/ufs-dwc-pci.c| 172 +
 drivers/scsi/ufs/ufs-dwc.c| 102 +++
 drivers/scsi/ufs/ufshcd-dwc.c | 739 ++
 drivers/scsi/ufs/ufshcd-dwc.h |  18 +
 drivers/scsi/ufs/ufshci-dwc.h |  42 ++
 drivers/scsi/ufs/unipro.h |  39 ++
 10 files changed, 1189 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ufs/ufs-dwc.txt
 create mode 100644 drivers/scsi/ufs/ufs-dwc-pci.c
 create mode 100644 drivers/scsi/ufs/ufs-dwc.c
 create mode 100644 drivers/scsi/ufs/ufshcd-dwc.c
 create mode 100644 drivers/scsi/ufs/ufshcd-dwc.h
 create mode 100644 drivers/scsi/ufs/ufshci-dwc.h

diff --git a/Documentation/devicetree/bindings/ufs/ufs-dwc.txt 
b/Documentation/devicetree/bindings/ufs/ufs-dwc.txt
new file mode 100644
index 000..3cbfd77
--- /dev/null
+++ b/Documentation/devicetree/bindings/ufs/ufs-dwc.txt
@@ -0,0 +1,17 @@
+* Universal Flash Storage (UFS) DesignWare Host Controller
+
+DWC_UFSHC nodes are defined to describe on-chip UFS host controllers.
+Each UFS controller instance should have its own node.
+
+Required properties:
+- compatible: compatible string ("snps,ufshcd-1.0", "snps,ufshcd-1.1"
+  or "snps,ufshcd-2.0")
+- reg   : 
+- interrupts: 
+
+Example:
+   ufs@0xd000 {
+   compatible = "snps,ufshcd-2.0";
+   reg = < 0xd000 0x1 >;
+   interrupts = < 24 >;
+   };
diff --git a/MAINTAINERS b/MAINTAINERS
index d2f94e2..3db3c4c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11006,6 +11006,12 @@ S: Supported
 F: Documentation/scsi/ufs.txt
 F: drivers/scsi/ufs/
 
+UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER DWC HOOKS
+M: Joao Pinto 
+L: linux-scsi@vger.kernel.org
+S: Supported
+F: drivers/scsi/ufs/*dwc*
+
 UNSORTED BLOCK IMAGES (UBI)
 M: Artem Bityutskiy 
 M: Richard Weinberger 
diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig
index 5f45307..35e9ddf 100644
--- a/drivers/scsi/ufs/Kconfig
+++ b/drivers/scsi/ufs/Kconfig
@@ -83,3 +83,54 @@ config SCSI_UFS_QCOM
 
  Select this if you have UFS controller on QCOM chipset.
  If unsure, say N.
+
+config SCSI_UFS_DWC_HOOKS
+   bool
+
+config SCSI_UFS_DWC_PLAT
+   tristate "DesignWare UFS controller platform glue driver"
+   depends on SCSI_UFSHCD_PLATFORM
+   select SCSI_UFS_DWC_HOOKS
+   help
+ This selects the DesignWare UFS host controller platform glue driver.
+
+ Select this if you have a DesignWare UFS controller on Platform bus.
+ If unsure, say N.
+
+config SCSI_UFS_DWC_PCI
+  

[PATCH v7 1/3] fixed typo in ufshcd-pltfrm

2016-02-11 Thread Joao Pinto
Fixed typo in ufshcd-pltfrm.

Signed-off-by: Joao Pinto 
---
Changes v0->v7:
- Nothing changed (just to keep up with patch set version).

 drivers/scsi/ufs/ufshcd-pltfrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c
index d2a7b12..0522891 100644
--- a/drivers/scsi/ufs/ufshcd-pltfrm.c
+++ b/drivers/scsi/ufs/ufshcd-pltfrm.c
@@ -353,6 +353,6 @@ EXPORT_SYMBOL_GPL(ufshcd_pltfrm_init);
 
 MODULE_AUTHOR("Santosh Yaragnavi ");
 MODULE_AUTHOR("Vinayak Holikatti ");
-MODULE_DESCRIPTION("UFS host controller Pltform bus based glue driver");
+MODULE_DESCRIPTION("UFS host controller Platform bus based glue driver");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(UFSHCD_DRIVER_VERSION);
-- 
1.8.1.5

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v7 2/3] added UFS 2.0 capabilities

2016-02-11 Thread Joao Pinto
Adding UFS 2.0 support to the UFS core driver.

Signed-off-by: Joao Pinto 
---
Changes v0->v7:
- Nothing changed (just to keep up with patch set version).

 drivers/scsi/ufs/ufshcd.c | 29 +
 drivers/scsi/ufs/ufshci.h |  1 +
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 85cd256..2b5f2bf 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1223,6 +1223,7 @@ static int ufshcd_compose_upiu(struct ufs_hba *hba, 
struct ufshcd_lrb *lrbp)
ret = -EINVAL;
}
break;
+   case UTP_CMD_TYPE_UFS_STORAGE:
case UTP_CMD_TYPE_DEV_MANAGE:
ufshcd_prepare_req_desc_hdr(lrbp, _flags, DMA_NONE);
if (hba->dev_cmd.type == DEV_CMD_TYPE_QUERY)
@@ -1287,6 +1288,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, 
struct scsi_cmnd *cmd)
struct ufshcd_lrb *lrbp;
struct ufs_hba *hba;
unsigned long flags;
+   u32 upiu_flags;
int tag;
int err = 0;
 
@@ -1343,10 +1345,23 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, 
struct scsi_cmnd *cmd)
lrbp->task_tag = tag;
lrbp->lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun);
lrbp->intr_cmd = !ufshcd_is_intr_aggr_allowed(hba) ? true : false;
-   lrbp->command_type = UTP_CMD_TYPE_SCSI;
+
+   if (hba->ufs_version == UFSHCI_VERSION_20)
+   lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
+   else
+   lrbp->command_type = UTP_CMD_TYPE_SCSI;
 
/* form UPIU before issuing the command */
-   ufshcd_compose_upiu(hba, lrbp);
+   if (hba->ufs_version == UFSHCI_VERSION_20) {
+   if (likely(lrbp->cmd)) {
+   ufshcd_prepare_req_desc_hdr(lrbp, _flags,
+   lrbp->cmd->sc_data_direction);
+   ufshcd_prepare_utp_scsi_cmd_upiu(lrbp, upiu_flags);
+   } else
+   err = -EINVAL;
+   } else
+   ufshcd_compose_upiu(hba, lrbp);
+
err = ufshcd_map_sg(lrbp);
if (err) {
lrbp->cmd = NULL;
@@ -1371,7 +1386,12 @@ static int ufshcd_compose_dev_cmd(struct ufs_hba *hba,
lrbp->sense_buffer = NULL;
lrbp->task_tag = tag;
lrbp->lun = 0; /* device management cmd is not specific to any LUN */
-   lrbp->command_type = UTP_CMD_TYPE_DEV_MANAGE;
+
+   if (hba->ufs_version == UFSHCI_VERSION_20)
+   lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
+   else
+   lrbp->command_type = UTP_CMD_TYPE_DEV_MANAGE;
+
lrbp->intr_cmd = true; /* No interrupt aggregation */
hba->dev_cmd.type = cmd_type;
 
@@ -3187,7 +3207,8 @@ static void ufshcd_transfer_req_compl(struct ufs_hba *hba)
/* Do not touch lrbp after scsi done */
cmd->scsi_done(cmd);
__ufshcd_release(hba);
-   } else if (lrbp->command_type == UTP_CMD_TYPE_DEV_MANAGE) {
+   } else if (lrbp->command_type == UTP_CMD_TYPE_DEV_MANAGE ||
+   lrbp->command_type == UTP_CMD_TYPE_UFS_STORAGE) {
if (hba->dev_cmd.complete)
complete(hba->dev_cmd.complete);
}
diff --git a/drivers/scsi/ufs/ufshci.h b/drivers/scsi/ufs/ufshci.h
index 0ae0967..8dba0e7 100644
--- a/drivers/scsi/ufs/ufshci.h
+++ b/drivers/scsi/ufs/ufshci.h
@@ -273,6 +273,7 @@ enum {
UTP_CMD_TYPE_SCSI   = 0x0,
UTP_CMD_TYPE_UFS= 0x1,
UTP_CMD_TYPE_DEV_MANAGE = 0x2,
+   UTP_CMD_TYPE_UFS_STORAGE= 0x11,
 };
 
 enum {
-- 
1.8.1.5

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v7 0/3] add support for DWC UFS Controller

2016-02-11 Thread Joao Pinto
The work consisted of:
- Fixed typo in ufshcd-pltfrm.c
- Tweak ufshcd.c for UFS 2.0 support
- Implement ufshcd-dwc which contains all DWC HW specific code
- Unipro attributes were added and new registers were added to the driver
- Implement a ufs-dwc glue platform driver
- Implement a ufs-dwc-pci glue pci driver

Joao Pinto (3):
  fixed typo in ufshcd-pltfrm
  added UFS 2.0 capabilities
  add support for DWC UFS Host Controller

 Documentation/devicetree/bindings/ufs/ufs-dwc.txt |  17 +
 MAINTAINERS   |   6 +
 drivers/scsi/ufs/Kconfig  |  51 ++
 drivers/scsi/ufs/Makefile |   3 +
 drivers/scsi/ufs/ufs-dwc-pci.c| 172 +
 drivers/scsi/ufs/ufs-dwc.c| 102 +++
 drivers/scsi/ufs/ufshcd-dwc.c | 739 ++
 drivers/scsi/ufs/ufshcd-dwc.h |  18 +
 drivers/scsi/ufs/ufshcd-pltfrm.c  |   2 +-
 drivers/scsi/ufs/ufshcd.c |  29 +-
 drivers/scsi/ufs/ufshci-dwc.h |  42 ++
 drivers/scsi/ufs/ufshci.h |   1 +
 drivers/scsi/ufs/unipro.h |  39 ++
 13 files changed, 1216 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/ufs/ufs-dwc.txt
 create mode 100644 drivers/scsi/ufs/ufs-dwc-pci.c
 create mode 100644 drivers/scsi/ufs/ufs-dwc.c
 create mode 100644 drivers/scsi/ufs/ufshcd-dwc.c
 create mode 100644 drivers/scsi/ufs/ufshcd-dwc.h
 create mode 100644 drivers/scsi/ufs/ufshci-dwc.h

-- 
1.8.1.5

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RESEND] scsi: ppa: use new parport device model

2016-02-11 Thread Martin K. Petersen
> "Sudip" == Sudip Mukherjee  writes:

Sudip> Modify ppa driver to use the new parallel port device model.
Sudip> Signed-off-by: Sudip Mukherjee  ---

Sudip> Resending as there was no review or ACK for this change.  This
Sudip> has exactly same changes as done in scsi/imm.c which has already
Sudip> been accepted.

Applied to 4.6/scsi-queue.

Thanks!

-- 
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 majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: lpfc: Modularize and cleanup FDMI code in driver

2016-02-11 Thread Martin K. Petersen
> "Dan" == Dan Carpenter  writes:

Dick,

Please look into this...

---8<---

The patch 4258e98ee386: "lpfc: Modularize and cleanup FDMI code in
driver" from Dec 16, 2015, leads to the following static checker
warning:

drivers/scsi/lpfc/lpfc_ct.c:2547 lpfc_fdmi_cmd()
error: __memcpy() '>rpl.pe' too small (4 vs 8)

drivers/scsi/lpfc/lpfc_ct.c
  2534  /* Next fill in the specific FDMI cmd information */
  2535  switch (cmdcode) {
  2536  case SLI_MGMT_RHAT:
  2537  case SLI_MGMT_RHBA:
  2538  rh = (struct lpfc_fdmi_reg_hba *)>un.PortID;
  2539  /* HBA Identifier */
  2540  memcpy(>hi.PortName, 
>pport->fc_sparam.portName,
  2541 sizeof(struct lpfc_name));
  2542  
  2543  if (cmdcode == SLI_MGMT_RHBA) {
  2544  /* Registered Port List */
  2545  /* One entry (port) per adapter */
  2546  rh->rpl.EntryCnt = cpu_to_be32(1);
  2547  memcpy(>rpl.pe, 
>pport->fc_sparam.portName,
   ^^^
.pe is a u32.

  2548 sizeof(struct lpfc_name));
   
lpfc_name is an 8 byte union.

  2549  

regards,
dan carpenter

---8<---

-- 
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 majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: megaraid_sas: Task management support

2016-02-11 Thread Martin K. Petersen

Sumit,

Please comment.

Thanks!

---8<---

Hello Sumit Saxena,

The patch 31796fa184ee: "megaraid_sas: Task management support" from
Jan 28, 2016, leads to the following static checker warning:

drivers/scsi/megaraid/megaraid_sas_base.c:1788 
megasas_update_sdev_properties()
warn: if statement not indented

drivers/scsi/megaraid/megaraid_sas_base.c
  1781  } else {
  1782  device_id = ((sdev->channel % 2) * 
MEGASAS_MAX_DEV_PER_CHANNEL)
  1783  + sdev->id;
  1784  local_map_ptr = fusion->ld_drv_map[(instance->map_id & 
1)];
  1785  ld = MR_TargetIdToLdGet(device_id, local_map_ptr);
  1786  raid = MR_LdRaidGet(ld, local_map_ptr);
  1787  
  1788  if (raid->capability.ldPiMode == 
MR_PROT_INFO_TYPE_CONTROLLER)
  1789  blk_queue_update_dma_alignment(sdev->request_queue, 
0x7);

It looks like the code is correct but the patch just deleted a tab
accidentally.

  1790  mr_device_priv_data->is_tm_capable =
  1791  raid->capability.tmCapable;
  1792  }


---8<---

-- 
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 majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RESEND] bfa: deinline __bfa_trc() and __bfa_trc32()

2016-02-11 Thread Martin K. Petersen
> "Denys" == Denys Vlasenko  writes:

Denys> __bfa_trc() compiles to 115 bytes of machine code.  With this
Denys> .config: http://busybox.net/~vda/kernel_config there are 1494
Denys> calls of __bfa_trc().

Applied to 4.6/scsi-queue.

-- 
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 majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] be2iscsi: Fix memory leak in beiscsi_alloc_mem()

2016-02-11 Thread Martin K. Petersen
> "Jitendra" == Jitendra Bhivare  writes:

Jitendra> In case of error, the memory allocated for phwi_ctrlr was not
Jitendra> freed.

Applied to 4.6/scsi-queue.

-- 
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 majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] mpt3sas: Fix - Remove cpumask_clear for zalloc_cpumask_var and dont free free_cpu_mask_var before reply_q

2016-02-11 Thread Martin K. Petersen
> "Suganath" == Suganath prabu Subramani 
>  writes:

Suganath> Removed cpumask_clear as it is not required for
Suganath> zalloc_cpumask_var and free free_cpumask_var before freeing
Suganath> reply_q.

Applied to 4.6/scsi-queue.

However, next time please submit two patches, one for each issue.

-- 
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 majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 20/23] scsi: Add 'access_state' attribute

2016-02-11 Thread Ewan Milne
On Mon, 2016-02-08 at 15:34 +0100, Hannes Reinecke wrote:
> Add an 'access_state' attribute to struct scsi_device to
> display the asymmetric LUN access state.
> 
> Reviewed-by: Christoph Hellwig 
> Signed-off-by: Hannes Reinecke 
> ---
>  drivers/scsi/scsi_scan.c   |  1 +
>  drivers/scsi/scsi_sysfs.c  | 49 
> ++
>  include/scsi/scsi_device.h |  1 +
>  include/scsi/scsi_proto.h  | 13 
>  4 files changed, 64 insertions(+)
> 
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index 97074c9..5bf3945 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -231,6 +231,7 @@ static struct scsi_device *scsi_alloc_sdev(struct 
> scsi_target *starget,
>   sdev->lun = lun;
>   sdev->channel = starget->channel;
>   sdev->sdev_state = SDEV_CREATED;
> + sdev->access_state = SCSI_ACCESS_STATE_UNKNOWN;
>   INIT_LIST_HEAD(>siblings);
>   INIT_LIST_HEAD(>same_target_siblings);
>   INIT_LIST_HEAD(>cmd_list);
> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> index 4f18a85..8d154ed 100644
> --- a/drivers/scsi/scsi_sysfs.c
> +++ b/drivers/scsi/scsi_sysfs.c
> @@ -81,6 +81,34 @@ const char *scsi_host_state_name(enum scsi_host_state 
> state)
>   return name;
>  }
>  
> +static const struct {
> + enum scsi_access_state  value;
> + char*name;
> +} sdev_access_states[] = {
> + { SCSI_ACCESS_STATE_OPTIMAL, "active/optimized" },
> + { SCSI_ACCESS_STATE_ACTIVE, "active/non-optimized" },
> + { SCSI_ACCESS_STATE_STANDBY, "standby" },
> + { SCSI_ACCESS_STATE_UNAVAILABLE, "unavailable" },
> + { SCSI_ACCESS_STATE_LBA, "lba-dependent" },
> + { SCSI_ACCESS_STATE_OFFLINE, "offline" },
> + { SCSI_ACCESS_STATE_TRANSITIONING, "transitioning" },
> + { SCSI_ACCESS_STATE_UNKNOWN, "unknown" },
> +};
> +
> +const char *scsi_access_state_name(enum scsi_access_state state)
> +{
> + int i;
> + char *name = NULL;
> +
> + for (i = 0; i < ARRAY_SIZE(sdev_access_states); i++) {
> + if (sdev_access_states[i].value == state) {
> + name = sdev_access_states[i].name;
> + break;
> + }
> + }
> + return name;
> +}
> +
>  static int check_set(unsigned long long *val, char *src)
>  {
>   char *last;
> @@ -973,6 +1001,26 @@ sdev_store_dh_state(struct device *dev, struct 
> device_attribute *attr,
>  
>  static DEVICE_ATTR(dh_state, S_IRUGO | S_IWUSR, sdev_show_dh_state,
>  sdev_store_dh_state);
> +
> +static ssize_t
> +sdev_show_access_state(struct device *dev,
> +struct device_attribute *attr,
> +char *buf)
> +{
> + struct scsi_device *sdev = to_scsi_device(dev);
> + enum scsi_access_state access_state;
> + bool pref = false;
> +
> + if (sdev->access_state & SCSI_ACCESS_STATE_PREFERRED)
> + pref = true;
> +
> + access_state = (sdev->access_state & SCSI_ACCESS_STATE_MASK);

I personally think it is a mistake to stick an extra bit in the
top of a variable declared as an enum like this.  It opens up
the possibility of subtle bugs if someone changes the code in
the future and does not take care to preserve your extra bit.

> +
> + return snprintf(buf, 32, "%s%s\n",
> + scsi_access_state_name(access_state),
> + pref ? " preferred" : "");
> +}
> +static DEVICE_ATTR(access_state, S_IRUGO, sdev_show_access_state, NULL);
>  #endif
>  
>  static ssize_t
> @@ -1047,6 +1095,7 @@ static struct attribute *scsi_sdev_attrs[] = {
>   _attr_wwid.attr,
>  #ifdef CONFIG_SCSI_DH
>   _attr_dh_state.attr,
> + _attr_access_state.attr,
>  #endif
>   _attr_queue_ramp_up_period.attr,
>   REF_EVT(media_change),
> diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
> index 4af2b24..af16a0d 100644
> --- a/include/scsi/scsi_device.h
> +++ b/include/scsi/scsi_device.h
> @@ -201,6 +201,7 @@ struct scsi_device {
>   struct scsi_device_handler *handler;
>   void*handler_data;
>  
> + enum scsi_access_state  access_state;
>   enum scsi_device_state sdev_state;
>   unsigned long   sdev_data[0];
>  } __attribute__((aligned(sizeof(unsigned long;
> diff --git a/include/scsi/scsi_proto.h b/include/scsi/scsi_proto.h
> index a9fbf1b..80e85e7 100644
> --- a/include/scsi/scsi_proto.h
> +++ b/include/scsi/scsi_proto.h
> @@ -277,5 +277,18 @@ struct scsi_lun {
>   __u8 scsi_lun[8];
>  };
>  
> +/* SPC asymmetric access states */
> +enum scsi_access_state {
> + SCSI_ACCESS_STATE_OPTIMAL = 0,
> + SCSI_ACCESS_STATE_ACTIVE,
> + SCSI_ACCESS_STATE_STANDBY,
> + SCSI_ACCESS_STATE_UNAVAILABLE,
> + SCSI_ACCESS_STATE_LBA,
> + SCSI_ACCESS_STATE_OFFLINE = 0xe,
> + SCSI_ACCESS_STATE_TRANSITIONING = 0xf,
> + SCSI_ACCESS_STATE_UNKNOWN = 0x70,
> +};

Given 

Re: [PATCH 19/23] scsi_dh: add 'rescan' callback

2016-02-11 Thread Ewan Milne
On Mon, 2016-02-08 at 15:34 +0100, Hannes Reinecke wrote:
> 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().

This comment should mention that you have also changed the Unit
Attention handling of ASC/ASCQ 3F 03 INQUIRY DATA HAS CHANGED
to automatically rescan the device (prior to the uevent).

-Ewan

> Reviewed-by: Christoph Hellwig 
> Signed-off-by: Hannes Reinecke 
> ---
>  drivers/scsi/device_handler/scsi_dh_alua.c | 8 
>  drivers/scsi/scsi_lib.c| 1 +
>  drivers/scsi/scsi_scan.c   | 8 +++-
>  include/scsi/scsi_dh.h | 1 +
>  4 files changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c 
> b/drivers/scsi/device_handler/scsi_dh_alua.c
> index a1db82f..56f8d21 100644
> --- a/drivers/scsi/device_handler/scsi_dh_alua.c
> +++ b/drivers/scsi/device_handler/scsi_dh_alua.c
> @@ -1038,6 +1038,13 @@ static int alua_prep_fn(struct scsi_device *sdev, 
> struct request *req)
>  
>  }
>  
> +static void alua_rescan(struct scsi_device *sdev)
> +{
> + struct alua_dh_data *h = sdev->handler_data;
> +
> + alua_initialize(sdev, h);
> +}
> +
>  /*
>   * alua_bus_attach - Attach device handler
>   * @sdev: device to be attached to
> @@ -1098,6 +1105,7 @@ static struct scsi_device_handler alua_dh = {
>   .prep_fn = alua_prep_fn,
>   .check_sense = alua_check_sense,
>   .activate = alua_activate,
> + .rescan = alua_rescan,
>   .set_params = alua_set_params,
>  };
>  
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index fa6b2c4..d46193a 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -2699,6 +2699,7 @@ static void scsi_evt_emit(struct scsi_device *sdev, 
> struct scsi_event *evt)
>   envp[idx++] = "SDEV_MEDIA_CHANGE=1";
>   break;
>   case SDEV_EVT_INQUIRY_CHANGE_REPORTED:
> + scsi_rescan_device(>sdev_gendev);
>   envp[idx++] = "SDEV_UA=INQUIRY_DATA_HAS_CHANGED";
>   break;
>   case SDEV_EVT_CAPACITY_CHANGE_REPORTED:
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index 420239c..97074c9 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -43,6 +43,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  
>  #include "scsi_priv.h"
> @@ -1524,9 +1525,14 @@ EXPORT_SYMBOL(scsi_add_device);
>  
>  void scsi_rescan_device(struct device *dev)
>  {
> + struct scsi_device *sdev = to_scsi_device(dev);
> +
>   device_lock(dev);
>  
> - scsi_attach_vpd(to_scsi_device(dev));
> + scsi_attach_vpd(sdev);
> +
> + if (sdev->handler && sdev->handler->rescan)
> + sdev->handler->rescan(sdev);
>  
>   if (dev->driver && try_module_get(dev->driver->owner)) {
>   struct scsi_driver *drv = to_scsi_driver(dev->driver);
> diff --git a/include/scsi/scsi_dh.h b/include/scsi/scsi_dh.h
> index 7e184c6..c7bba2b 100644
> --- a/include/scsi/scsi_dh.h
> +++ b/include/scsi/scsi_dh.h
> @@ -71,6 +71,7 @@ struct scsi_device_handler {
>   int (*activate)(struct scsi_device *, activate_complete, void *);
>   int (*prep_fn)(struct scsi_device *, struct request *);
>   int (*set_params)(struct scsi_device *, const char *);
> + void (*rescan)(struct scsi_device *);
>  };
>  
>  #ifdef CONFIG_SCSI_DH


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2016-02-11 Thread Ewan Milne
On Mon, 2016-02-08 at 15:34 +0100, Hannes Reinecke wrote:
> 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.

Note that we may need to add a timeout on this somehow, I have
recently seen a bug report where an array stayed in the ALUA
transitioning state for an extremely long period of time.

That problem would occur with either the current or this new
ALUA code, the question is whether we want to handle it better.

-Ewan

> 
> Signed-off-by: Hannes Reinecke 
> Reviewed-by: Ewan Milne 
> Reviewed-by: Christoph Hellwig 
> ---
>  drivers/scsi/device_handler/scsi_dh_alua.c | 38 
> ++
>  1 file changed, 38 insertions(+)
> 
> diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c 
> b/drivers/scsi/device_handler/scsi_dh_alua.c
> index de8e79e..a1db82f 100644
> --- a/drivers/scsi/device_handler/scsi_dh_alua.c
> +++ b/drivers/scsi/device_handler/scsi_dh_alua.c
> @@ -466,6 +466,30 @@ static int alua_check_sense(struct scsi_device *sdev,
>  }
>  
>  /*
> + * alua_tur - Send a TEST UNIT READY
> + * @sdev: device to which the TEST UNIT READY command should be send
> + *
> + * Send a TEST UNIT READY to @sdev to figure out the device state
> + * Returns SCSI_DH_RETRY if the sense code is NOT READY/ALUA TRANSITIONING,
> + * SCSI_DH_OK if no error occurred, and SCSI_DH_IO otherwise.
> + */
> +static int alua_tur(struct scsi_device *sdev)
> +{
> + struct scsi_sense_hdr sense_hdr;
> + int retval;
> +
> + retval = scsi_test_unit_ready(sdev, ALUA_FAILOVER_TIMEOUT * HZ,
> +   ALUA_FAILOVER_RETRIES, _hdr);
> + if (sense_hdr.sense_key == NOT_READY &&
> + sense_hdr.asc == 0x04 && sense_hdr.ascq == 0x0a)
> + return SCSI_DH_RETRY;
> + else if (retval)
> + return SCSI_DH_IO;
> + else
> + return SCSI_DH_OK;
> +}
> +
> +/*
>   * alua_rtpg - Evaluate REPORT TARGET GROUP STATES
>   * @sdev: the device to be evaluated.
>   *
> @@ -735,8 +759,22 @@ static void alua_rtpg_work(struct work_struct *work)
>   alua_wq = kaluad_sync_wq;
>   pg->flags |= ALUA_PG_RUNNING;
>   if (pg->flags & ALUA_PG_RUN_RTPG) {
> + int state = pg->state;
> +
>   pg->flags &= ~ALUA_PG_RUN_RTPG;
>   spin_unlock_irqrestore(>lock, flags);
> + if (state == TPGS_STATE_TRANSITIONING) {
> + if (alua_tur(sdev) == SCSI_DH_RETRY) {
> + spin_lock_irqsave(>lock, flags);
> + pg->flags &= ~ALUA_PG_RUNNING;
> + pg->flags |= ALUA_PG_RUN_RTPG;
> + spin_unlock_irqrestore(>lock, flags);
> + queue_delayed_work(alua_wq, >rtpg_work,
> +pg->interval * HZ);
> + return;
> + }
> + /* Send RTPG on failure or if TUR indicates SUCCESS */
> + }
>   err = alua_rtpg(sdev, pg);
>   spin_lock_irqsave(>lock, flags);
>   if (err == SCSI_DH_RETRY || pg->flags & ALUA_PG_RUN_RTPG) {


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 2/2] add support for DWC UFS Host Controller

2016-02-11 Thread Joao Pinto
On 2/10/2016 8:50 PM, Arnd Bergmann wrote:
> On Wednesday 10 February 2016 16:06:13 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 
>>  Documentation/devicetree/bindings/ufs/ufs-dwc.txt |  17 +
>>  MAINTAINERS   |   6 +
>>  drivers/scsi/ufs/Kconfig  |  41 ++
>>  drivers/scsi/ufs/Makefile |   3 +
>>  drivers/scsi/ufs/ufs-dwc-pci.c| 180 ++
>>  drivers/scsi/ufs/ufs-dwc.c| 102 +++
>>  drivers/scsi/ufs/ufshcd-dwc.c | 736 
>> ++
>>  drivers/scsi/ufs/ufshcd-dwc.h |  18 +
>>  drivers/scsi/ufs/ufshcd.c |  50 +-
>>  drivers/scsi/ufs/ufshcd.h |  13 +
>>  drivers/scsi/ufs/ufshci-dwc.h |  42 ++
>>  drivers/scsi/ufs/ufshci.h |   1 +
>>  drivers/scsi/ufs/unipro.h |  39 ++
> 
> Can you split this into separate patches for changes to the common code,
> the addition of the PCI driver and the addition of the platform driver?

I can split it in these parts:
- Fix typo
- Add UFS 2.0 support to core driver
- Changes to core driver + dwc platform driver + dwc pci driver

The last one cannot be split because the glue drivers depends on the changes of
common code, including the creation of ufshcd-dwc.

> 
>> diff --git a/Documentation/devicetree/bindings/ufs/ufs-dwc.txt 
>> b/Documentation/devicetree/bindings/ufs/ufs-dwc.txt
>> new file mode 100644
>> index 000..f38a3f5
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/ufs/ufs-dwc.txt
>> @@ -0,0 +1,17 @@
>> +* Universal Flash Storage (UFS) DesignWare Host Controller
>> +
>> +DWC_UFSHC nodes are defined to describe on-chip UFS host controllers.
>> +Each UFS controller instance should have its own node.
>> +
>> +Required properties:
>> +- compatible: compatible string ("snps,ufshcd-1.0", 
>> "snps,ufshcd-1.1"
>> +  or "snps,ufshcd-2.0")
>> +- reg   : 
>> +- interrupts: 
>> +
>> +Example:
>> +dwc_ufshcd@0xD000 {
> 
> Please fix the node name and address in the example. I think you want 
> "ufs@d000".

Sure.

> 
>> +config SCSI_UFS_DWC_MPHY_TC
>> +bool "Support for the Synopsys MPHY Test Chip"
>> +depends on SCSI_UFS_DWC_HOOKS && (SCSI_UFSHCD_PCI || SCSI_UFS_DWC_PLAT)
>> +---help---
>> +  This selects the support for the Synopsys MPHY Test Chip.
>> +
>> +  Select this if you have a Synopsys MPHY Test Chip.
>> +  If unsure, say N.
>> +
>> +config SCSI_UFS_DWC_40BIT_RMMI
>> +bool "40-bit RMMI MPHY"
>> +depends on SCSI_UFS_DWC_MPHY_TC
>> +---help---
>> +  This specifies that the Synopsys MPHY supports 40-bit RMMI operations.
>> +
>> +  Select this if you are using a 40-bit RMMI Synopsys MPHY.
> 
> I don't think I understood you explanation why this has to be here,
> rather than using a proper PHY driver. Please try again.

This initialization is for Synopsys Test Chip which needs only some Unipro
attribute configuration, which needs to be close to the UFS core since it uses
its dme set/get functions. Qcom phy driver is differente, because you are really
managing the phy itself, here in the Synopsys Test Chip you only set some Unipro
attributes to put controller+Test Chip working together as one.

> 
>> +
>> +#ifdef CONFIG_PM
>> +/**
>> + * ufs_dw_pci_suspend - suspend power management function
>> + * @pdev: pointer to PCI device handle
>> + * @state: power state
>> + *
>> + * Returns 0 if successful
>> + * Returns non-zero otherwise
>> + */
>> +static int ufs_dw_pci_suspend(struct device *dev)
>> +{
>> +return ufshcd_system_suspend(dev_get_drvdata(dev));
>> +}
> 
> Please remove the #ifdef here.


> 
>> +
>> +static const struct dev_pm_ops ufs_dw_pci_pm_ops = {
>> +.suspend= ufs_dw_pci_suspend,
>> +.resume = ufs_dw_pci_resume,
>> +.runtime_suspend = ufs_dw_pci_runtime_suspend,
>> +.runtime_resume  = ufs_dw_pci_runtime_resume,
>> +.runtime_idle= ufs_dw_pci_runtime_idle,
>> +};
> 
> Instead, use the macros from include/linux/pm.h


> 
>> +#ifdef CONFIG_SCSI_UFS_DWC_40BIT_RMMI
>> +/**
>> + * ufshcd_dwc_setup_40bit_rmmi()
>> + * This function configures Synopsys MPHY specific atributes (40-bit RMMI)
>> + * @hba: Pointer to drivers structure
>> + *
>> + * Returns 0 on success or non-zero value on failure
>> + */
>> +static int ufshcd_dwc_setup_40bit_rmmi(struct ufs_hba *hba)
>> +{
>> +int ret = 0;
> 
> This looks like it should go into the external driver

This is common init code for platform glue driver and pci glue driver, so it
should remain in a common spot and in my option ufshcd-dwc is the right spot.

> 
>> +
>> +#ifdef CONFIG_SCSI_UFS_DWC_40BIT_RMMI
>> +dev_info(hba->dev, 

Re: [PATCH] target: Fix incorrect unmap_zeroes_data_store return

2016-02-11 Thread Sagi Grimberg

Looks good,

Reviewed-by: Sagi Grimberg 
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] lpfc: Remove redundant code block in lpfc_scsi_cmd_iocb_cmpl

2016-02-11 Thread Johannes Thumshirn
On Wed, Feb 10, 2016 at 01:32:50PM -0500, Dick Kennedy wrote:
> Martin, 
> the FCP_RING_POLLING feature is an old driver option that we would like to
> remove from the driver. It was put in in 2006 as a feature request.
> What we don't know is if any customers still use it? or ever used it. 
> 
> The patch looks fine. 
> ACK

Dick, is there any chance you could Ack my lockdep assertion patch as well?
Bart seemed to like it and I think our support people will do as well as it
screams pretty loud when something isn't golden there.

TIA,
Johannes

> 
> On Wed, Feb 10, 2016 at 12:37 PM, Martin K. Petersen <
> martin.peter...@oracle.com> wrote:
> 
> > "Johannes" == Johannes Thumshirn  writes:
> 
> Johannes> This removes a redundant code block that will either be
> Johannes> executed if the ENABLE_FCP_RING_POLLING flag is set in
> Johannes> phba->cfg_poll or not. The code is just duplicated in both
> Johannes> cases, hence we unify it again.
> 
> James and Dick: Ping!
> 
> https://patchwork.kernel.org/patch/8072451/
>
> --
> Martin K. Petersen      Oracle Linux Engineering
> 
> 

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 2/2] add support for DWC UFS Host Controller

2016-02-11 Thread Joao Pinto
On 2/10/2016 8:50 PM, Arnd Bergmann wrote:
> On Wednesday 10 February 2016 16:06:13 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 
>>  Documentation/devicetree/bindings/ufs/ufs-dwc.txt |  17 +
>>  MAINTAINERS   |   6 +
>>  drivers/scsi/ufs/Kconfig  |  41 ++
>>  drivers/scsi/ufs/Makefile |   3 +
>>  drivers/scsi/ufs/ufs-dwc-pci.c| 180 ++
>>  drivers/scsi/ufs/ufs-dwc.c| 102 +++
>>  drivers/scsi/ufs/ufshcd-dwc.c | 736 
>> ++
>>  drivers/scsi/ufs/ufshcd-dwc.h |  18 +
>>  drivers/scsi/ufs/ufshcd.c |  50 +-
>>  drivers/scsi/ufs/ufshcd.h |  13 +
>>  drivers/scsi/ufs/ufshci-dwc.h |  42 ++
>>  drivers/scsi/ufs/ufshci.h |   1 +
>>  drivers/scsi/ufs/unipro.h |  39 ++
> 
> Can you split this into separate patches for changes to the common code,
> the addition of the PCI driver and the addition of the platform driver?

I can split it in these parts:
- Fix typo
- Add UFS 2.0 support to core driver
- Changes to core driver + dwc platform driver + dwc pci driver

The last one cannot be split because the glue drivers depends on the changes of
common code, including the creation of ufshcd-dwc.

> 
>> diff --git a/Documentation/devicetree/bindings/ufs/ufs-dwc.txt 
>> b/Documentation/devicetree/bindings/ufs/ufs-dwc.txt
>> new file mode 100644
>> index 000..f38a3f5
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/ufs/ufs-dwc.txt
>> @@ -0,0 +1,17 @@
>> +* Universal Flash Storage (UFS) DesignWare Host Controller
>> +
>> +DWC_UFSHC nodes are defined to describe on-chip UFS host controllers.
>> +Each UFS controller instance should have its own node.
>> +
>> +Required properties:
>> +- compatible: compatible string ("snps,ufshcd-1.0", 
>> "snps,ufshcd-1.1"
>> +  or "snps,ufshcd-2.0")
>> +- reg   : 
>> +- interrupts: 
>> +
>> +Example:
>> +dwc_ufshcd@0xD000 {
> 
> Please fix the node name and address in the example. I think you want 
> "ufs@d000".

Sure.

> 
>> +config SCSI_UFS_DWC_MPHY_TC
>> +bool "Support for the Synopsys MPHY Test Chip"
>> +depends on SCSI_UFS_DWC_HOOKS && (SCSI_UFSHCD_PCI || SCSI_UFS_DWC_PLAT)
>> +---help---
>> +  This selects the support for the Synopsys MPHY Test Chip.
>> +
>> +  Select this if you have a Synopsys MPHY Test Chip.
>> +  If unsure, say N.
>> +
>> +config SCSI_UFS_DWC_40BIT_RMMI
>> +bool "40-bit RMMI MPHY"
>> +depends on SCSI_UFS_DWC_MPHY_TC
>> +---help---
>> +  This specifies that the Synopsys MPHY supports 40-bit RMMI operations.
>> +
>> +  Select this if you are using a 40-bit RMMI Synopsys MPHY.
> 
> I don't think I understood you explanation why this has to be here,
> rather than using a proper PHY driver. Please try again.

This initialization is for Synopsys Test Chip which needs only some Unipro
attribute configuration, which needs to be close to the UFS core since it uses
its dme set/get functions. Qcom phy driver is differente, because you are really
managing the phy itself, here in the Synopsys Test Chip you only set some Unipro
attributes to put controller+Test Chip working together as one.

> 
>> +
>> +#ifdef CONFIG_PM
>> +/**
>> + * ufs_dw_pci_suspend - suspend power management function
>> + * @pdev: pointer to PCI device handle
>> + * @state: power state
>> + *
>> + * Returns 0 if successful
>> + * Returns non-zero otherwise
>> + */
>> +static int ufs_dw_pci_suspend(struct device *dev)
>> +{
>> +return ufshcd_system_suspend(dev_get_drvdata(dev));
>> +}
> 
> Please remove the #ifdef here.

I'll check it out.

> 
>> +
>> +static const struct dev_pm_ops ufs_dw_pci_pm_ops = {
>> +.suspend= ufs_dw_pci_suspend,
>> +.resume = ufs_dw_pci_resume,
>> +.runtime_suspend = ufs_dw_pci_runtime_suspend,
>> +.runtime_resume  = ufs_dw_pci_runtime_resume,
>> +.runtime_idle= ufs_dw_pci_runtime_idle,
>> +};
> 
> Instead, use the macros from include/linux/pm.h

I'll check it out.

> 
>> +#ifdef CONFIG_SCSI_UFS_DWC_40BIT_RMMI
>> +/**
>> + * ufshcd_dwc_setup_40bit_rmmi()
>> + * This function configures Synopsys MPHY specific atributes (40-bit RMMI)
>> + * @hba: Pointer to drivers structure
>> + *
>> + * Returns 0 on success or non-zero value on failure
>> + */
>> +static int ufshcd_dwc_setup_40bit_rmmi(struct ufs_hba *hba)
>> +{
>> +int ret = 0;
> 
> This looks like it should go into the external driver

This is common init code for platform glue driver and pci glue driver, so it
should remain in a common spot and in my option ufshcd-dwc is the right spot.

> 
>> +
>> +#ifdef 

RE: [PATCH] be2iscsi: Fix memory leak in beiscsi_alloc_mem()

2016-02-11 Thread Jitendra Bhivare
In case of error, the memory allocated for phwi_ctrlr was not freed.

Signed-off-by: Maurizio Lombardi 
---
 drivers/scsi/be2iscsi/be_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 7a6dbfb..360aa88 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -2706,8 +2706,10 @@ static int beiscsi_alloc_mem(struct beiscsi_hba *phba)
phwi_ctrlr->wrb_context = kzalloc(sizeof(struct hwi_wrb_context) *
  phba->params.cxns_per_ctrl,
  GFP_KERNEL);
-   if (!phwi_ctrlr->wrb_context)
+   if (!phwi_ctrlr->wrb_context) {
+   kfree(phba->phwi_ctrlr);
return -ENOMEM;
+   }

phba->init_mem = kcalloc(SE_MEM_MAX, sizeof(*mem_descr),
 GFP_KERNEL);
--
Maurizio Lombardi

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reviewed-by: Jitendra Bhivare 

Thanks,

JB


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [scsi 1/2] ufs: fix typo: MAZ to MAX

2016-02-11 Thread Martin K. Petersen
> "Tomas" == Tomas Winkler  writes:

Tomas> QUERY_DESC_GEOMETRY_MAZ_SIZE QUERY_DESC_GEOMETRY_MAX_SIZE

Applied to 4.6/scsi-queue.

-- 
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 majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 22/23] scsi_dh_alua: update 'access_state' field

2016-02-11 Thread Ewan Milne
On Mon, 2016-02-08 at 15:34 +0100, Hannes Reinecke wrote:
> Track attached SCSI devices and update the 'access_state' field
> whenever an ALUA state change has been detected.
> 
> Signed-off-by: Hannes Reinecke 
> ---
>  drivers/scsi/device_handler/scsi_dh_alua.c | 45 
> --
>  1 file changed, 43 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c 
> b/drivers/scsi/device_handler/scsi_dh_alua.c
> index 51126b78..7bcc075 100644
> --- a/drivers/scsi/device_handler/scsi_dh_alua.c
> +++ b/drivers/scsi/device_handler/scsi_dh_alua.c
> @@ -24,6 +24,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -75,6 +76,7 @@ struct alua_port_group {
>   struct kref kref;
>   struct rcu_head rcu;
>   struct list_headnode;
> + struct list_headdh_list;
>   unsigned char   device_id_str[256];
>   int device_id_len;
>   int group_id;
> @@ -92,6 +94,7 @@ struct alua_port_group {
>  };
>  
>  struct alua_dh_data {
> + struct list_headnode;
>   struct alua_port_group  *pg;
>   int group_id;
>   spinlock_t  pg_lock;
> @@ -247,6 +250,7 @@ struct alua_port_group *alua_alloc_pg(struct scsi_device 
> *sdev,
>   INIT_DELAYED_WORK(>rtpg_work, alua_rtpg_work);
>   INIT_LIST_HEAD(>rtpg_list);
>   INIT_LIST_HEAD(>node);
> + INIT_LIST_HEAD(>dh_list);
>   spin_lock_init(>lock);
>  
>   spin_lock(_group_lock);
> @@ -328,6 +332,8 @@ static int alua_check_vpd(struct scsi_device *sdev, 
> struct alua_dh_data *h,
>  {
>   int rel_port = -1, group_id;
>   struct alua_port_group *pg, *old_pg = NULL;
> + bool pg_updated;
> + unsigned long flags;
>  
>   group_id = scsi_vpd_tpg_id(sdev, _port);
>   if (group_id < 0) {
> @@ -357,13 +363,25 @@ static int alua_check_vpd(struct scsi_device *sdev, 
> struct alua_dh_data *h,
>   old_pg = h->pg;
>   if (old_pg != pg) {
>   /* port group has changed. Update to new port group */
> + if (h->pg) {
> + spin_lock_irqsave(_pg->lock, flags);
> + list_del_rcu(>node);
> + spin_unlock_irqrestore(_pg->lock, flags);
> + }
>   rcu_assign_pointer(h->pg, pg);
> + pg_updated = true;
>   }
>   if (sdev->synchronous_alua)
>   pg->flags |= ALUA_SYNC_STPG;
>   alua_rtpg_queue(h->pg, sdev, NULL, true);
>   spin_unlock(>pg_lock);
>  
> + if (pg_updated) {
> + spin_lock_irqsave(>lock, flags);
> + list_add_rcu(>node, >dh_list);
> + spin_unlock_irqrestore(>lock, flags);
> + }
> +
>   if (old_pg)
>   kref_put(_pg->kref, release_port_group);
>  
> @@ -613,8 +631,18 @@ static int alua_rtpg(struct scsi_device *sdev, struct 
> alua_port_group *pg)
>   if (spin_trylock_irqsave(_pg->lock, flags)) {
>   if ((tmp_pg == pg) ||
>   !(tmp_pg->flags & ALUA_PG_RUNNING)) {
> + struct alua_dh_data *h;
> +
>   tmp_pg->state = desc[0] & 0x0f;
>   tmp_pg->pref = desc[0] >> 7;
> + rcu_read_lock();
> + list_for_each_entry_rcu(h,
> + _pg->dh_list, node) {
> + /* h->sdev should always be 
> valid */
> + BUG_ON(!h->sdev);
> + h->sdev->access_state = desc[0];

Here you did not mask desc[0] with 0x0f like you did in other places in the 
code.

> + }
> + rcu_read_unlock();
>   }
>   if (tmp_pg == pg)
>   valid_states = desc[1];
> @@ -646,10 +674,19 @@ static int alua_rtpg(struct scsi_device *sdev, struct 
> alua_port_group *pg)
>   pg->interval = 2;
>   err = SCSI_DH_RETRY;
>   } else {
> + struct alua_dh_data *h;
> +
>   /* Transitioning time exceeded, set port to standby */
>   err = SCSI_DH_IO;
>   pg->state = SCSI_ACCESS_STATE_STANDBY;
>   pg->expiry = 0;
> + rcu_read_lock();
> + list_for_each_entry_rcu(h, >dh_list, node) {
> + BUG_ON(!h->sdev);
> + h->sdev->access_state = (pg->state & 0x0f) |
> + (pg->pref << 7);

Since 

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

2016-02-11 Thread Bart Van Assche

On 02/08/2016 06:34 AM, Hannes Reinecke wrote:

+ * alua_stpg - Issue a SET TARGET GROUP STATES command
+ *
+ * Issue a SET TARGET GROUP STATES command and evaluate the


Hello Hannes,

Please change the two references to STPG into "SET TARGET PORT GROUP" 
such that the description matches SPC-4 and also the description of this 
patch.


Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2016-02-11 Thread Nicholas A. Bellinger
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, "Nicholas A. Bellinger"  wrote:
> > >On Mon, 2016-02-08 at 23:27 +, Himanshu Madhani wrote:
> > >> 
> > >> I am testing this series with with 4.5.0-rc2+ kernel and I am seeing
> > >>issue
> > >> where trying to trigger
> > >> sg_reset with option of host/device/bus in loop at 120second interval
> > >> causes call stack. At this point
> > >> removing configuration hangs indefinitely. See attached dmesg output
> > >>from
> > >> my setup. 
> > >> 
> > >
> > >Thanks alot for testing this.
> > >
> > >So It looks like we're still hitting a indefinite schedule() on
> > >se_cmd->cmd_wait_comp once tcm_qla2xxx session disconnect/reconnect
> > >occurs, after repeated explicit active I/O remote-port sg_resets.
> > >
> > >Does this trigger on the first tcm_qla2xxx session reconnect after
> > >explicit remote-port sg_reset..?  Are session reconnects actively being
> > >triggered during the test..?
> > >
> > >To verify the latter for iscsi-target, I've been using a small patch to
> > >trigger session reset from TMR kthread context in order to simulate the
> > >I_T disconnects.  Something like that would be useful for verifying with
> > >tcm_qla2xxx too.
> > >
> > >That said, I'll be reproducing with tcm_qla2xxx ports this week, and
> > >will enable various debug in a WIP branch for testing.
> 
> Following up here..
> 
> So far using my test setup with ISP2532 ports in P2P + RAMDISK_MCP and
> v4.5-rc1, repeated remote-port active I/O LUN_RESET (sg_reset -d) has
> been functioning as expected with a blocksize_range=4k-256k + iodepth=32
> fio write-verify style workload.
> 
> No ->cmd_kref -1 OOPsen or qla2xxx initiator generated ABORT_TASKs from
> outstanding target TAS responses, nor fio write-verify failures to
> report after 800x remote-port active I/O LUN_RESETS.
> 
> Next step will be to verify explicit tcm_qla2xxx port + module shutdown
> after 1K test iterations, and then IBLOCK async completions <-> NVMe
> backends with the same case.
> 

After letting this test run over-night up to 7k active I/O remote-port
LUN_RESETs, things are still functioning as expected.

Also, /etc/init.d/target stop was able to successfully shutdown all
active sessions and unload tcm_qla2xxx after the test run.

So AFAICT, the active I/O remote-port LUN_RESET changes are stable with
tcm_qla2xxx ports, separate from concurrent session disconnect hung task
you reported earlier.

That said, I'll likely push this series as-is for -rc4, given that Dan
has also been able to verify the non conncurrent session disconnect case
on his setup generating constant ABORT_TASKs, and it's still surviving
both cases for iscsi-target ports.

Please give the debug patch from last night a shot, and see if we can
determine the se_cmd states when you hit the hung task.

Thank you,

-nab

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2016-02-11 Thread Tyrel Datwyler
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 values to host endian prior to logging.

Signed-off-by: Tyrel Datwyler 
---
 drivers/scsi/ibmvscsi/ibmvfc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 6aa317c..fc523c3 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -2636,7 +2636,8 @@ static void ibmvfc_handle_async(struct ibmvfc_async_crq 
*crq,
struct ibmvfc_target *tgt;
 
ibmvfc_log(vhost, desc->log_level, "%s event received. scsi_id: %llx, 
wwpn: %llx,"
-  " node_name: %llx%s\n", desc->desc, crq->scsi_id, crq->wwpn, 
crq->node_name,
+  " node_name: %llx%s\n", desc->desc, 
be64_to_cpu(crq->scsi_id),
+  be64_to_cpu(crq->wwpn), be64_to_cpu(crq->node_name),
   ibmvfc_get_link_state(crq->link_state));
 
switch (be64_to_cpu(crq->event)) {
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2016-02-11 Thread Bart Van Assche
On 02/08/2016 06:34 AM, Hannes Reinecke wrote:
> as promised here is now the second part of my ALUA device handler update.

Hello Hannes,

Please test this patch series with lockdep enabled and fix the
resulting complaints. This is what was reported on my test setup
shortly after multipathd was started:


=
[ BUG: bad unlock balance detected! ]
4.5.0-rc3+ #6 Tainted: GE  
-
kworker/3:1/141 is trying to release lock (port_group_lock) at:
[] alua_rtpg+0x329/0x890 [scsi_dh_alua]
but there are no more locks to release!

other info that might help us debug this:
2 locks held by kworker/3:1/141:
 #0:  ("kaluad"){.+.+.+}, at: [] process_one_work+0x16a/0x480
 #1:  ((&(>rtpg_work)->work)){+.+.+.}, at: [] 
process_one_work+0x16a/0x480

stack backtrace:
CPU: 3 PID: 141 Comm: kworker/3:1 Tainted: GE   4.5.0-rc3+ #6
Hardware name: Dell Inc. PowerEdge R430/03XKDV, BIOS 1.0.2 11/17/2014
Workqueue: kaluad alua_rtpg_work [scsi_dh_alua]
  880456807978 81263ba7 0007
 0006 880456ff9f80 a041be19 8804568079a8
 810a29a9 8803f61b7bb8 880456ff9f80 a041d878
Call Trace:
 [] dump_stack+0x6b/0xa4
 [] ? alua_rtpg+0x329/0x890 [scsi_dh_alua]
 [] print_unlock_imbalance_bug+0xf9/0x100
 [] ? alua_rtpg+0x329/0x890 [scsi_dh_alua]
 [] __lock_release+0x25f/0x3a0
 [] ? __lock_release+0xc4/0x3a0
 [] ? alua_rtpg+0x329/0x890 [scsi_dh_alua]
 [] lock_release+0x39/0x60
 [] _raw_spin_unlock_irqrestore+0x29/0x60
 [] alua_rtpg+0x329/0x890 [scsi_dh_alua]
 [] ? alua_rtpg+0x3d5/0x890 [scsi_dh_alua]
 [] ? __lock_release+0xc4/0x3a0
 [] ? check_usage_forwards+0x100/0x100
 [] ? mark_held_locks+0x71/0x90
 [] ? _raw_spin_unlock_irqrestore+0x3b/0x60
 [] ? trace_hardirqs_on_caller+0xfc/0x1c0
 [] alua_rtpg_work+0x1be/0x370 [scsi_dh_alua]
 [] process_one_work+0x1da/0x480
 [] ? process_one_work+0x16a/0x480
 [] ? __lock_release+0xc4/0x3a0
 [] worker_thread+0x169/0x520
 [] ? complete+0x48/0x60
 [] ? _raw_spin_unlock_irqrestore+0x3b/0x60
 [] ? maybe_create_worker+0x110/0x110
 [] ? maybe_create_worker+0x110/0x110
 [] ? schedule+0x42/0xb0
 [] ? maybe_create_worker+0x110/0x110
 [] kthread+0xe4/0x100
 [] ? trace_hardirqs_on+0xd/0x10
 [] ? schedule_tail+0x19/0xd0
 [] ? __init_kthread_worker+0x70/0x70
 [] ret_from_fork+0x3f/0x70
 [] ? __init_kthread_worker+0x70/0x70
sd 13:0:0:1: alua: port group 101 state A preferred supports tOlUSNA
BUG: workqueue leaked lock or atomic: kworker/3:1/0x7ffe/141
 last function: alua_rtpg_work [scsi_dh_alua]
INFO: lockdep is turned off.
CPU: 3 PID: 141 Comm: kworker/3:1 Tainted: GE   4.5.0-rc3+ #6
Hardware name: Dell Inc. PowerEdge R430/03XKDV, BIOS 1.0.2 11/17/2014
Workqueue: kaluad alua_rtpg_work [scsi_dh_alua]
  880456807c38 81263ba7 0001
  880457355960 880456ff9f80 880456807d28
 81072472 8107225a 810a6714 e8fffec71f05
Call Trace:
 [] dump_stack+0x6b/0xa4
 [] process_one_work+0x382/0x480
 [] ? process_one_work+0x16a/0x480
 [] ? __lock_release+0xc4/0x3a0
 [] worker_thread+0x169/0x520
 [] ? complete+0x48/0x60
 [] ? _raw_spin_unlock_irqrestore+0x3b/0x60
 [] ? maybe_create_worker+0x110/0x110
 [] ? maybe_create_worker+0x110/0x110
 [] ? schedule+0x42/0xb0
 [] ? maybe_create_worker+0x110/0x110
 [] kthread+0xe4/0x100
 [] ? trace_hardirqs_on+0xd/0x10
 [] ? schedule_tail+0x19/0xd0
 [] ? __init_kthread_worker+0x70/0x70
 [] ret_from_fork+0x3f/0x70
 [] ? __init_kthread_worker+0x70/0x70
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Bug 111731] mpt2sas doesn't get built

2016-02-11 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=111731

bios...@yahoo.com changed:

   What|Removed |Added

 CC||bios...@yahoo.com

--- Comment #1 from bios...@yahoo.com ---
This related OpenSUSE bugzilla has a patch that resolves the issue. 
https://bugzilla.opensuse.org/show_bug.cgi?id=962694

Per that BZ patch has been sent upstream, so hopefully it will make it into
distributions soon but you can probably solve it manually with that patch to
dracut until dracut itself receives an official update with the patch.

The patch as listed for OpenSUSE doesn't match the line numbers for me on
CentOS7, but searching for the proceeding lines I was able to find where to
patch it manually and it worked, I now have mpt3sas built into my 4.4 initrd
(whereas previously I didn't have either mpt3sas or mpt2sas because my 3.10
only had mpt2sas).

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2016-02-11 Thread Bart Van Assche

On 02/10/2016 05:37 PM, Martin K. Petersen wrote:

"Bart" == Bart Van Assche  writes:

Bart> I will try to free up some time to help with reviewing and testing
Bart> this patch series. But before I can do that the v4.5-rc multipath
Bart> code needs to be stabilized first. See also
Bart> https://www.redhat.com/archives/dm-devel/2016-February/msg00066.html.


Hello Martin,

I will start today with testing and reviewing this patch series.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html