[scsi 2/2] scsi: ufs: fix few typos in the comments

2016-02-09 Thread Tomas Winkler
Signed-off-by: Tomas Winkler 
---
 drivers/scsi/ufs/ufshcd.c | 4 ++--
 drivers/scsi/ufs/ufshcd.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index a44153401aee..07f1fa438fec 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1476,7 +1476,7 @@ static int ufshcd_wait_for_dev_cmd(struct ufs_hba *hba,
if (!time_left) {
err = -ETIMEDOUT;
if (!ufshcd_clear_cmd(hba, lrbp->task_tag))
-   /* sucessfully cleared the command, retry if needed */
+   /* successfully cleared the command, retry if needed */
err = -EAGAIN;
}
 
@@ -2563,7 +2563,7 @@ out:
  * To bring UFS host controller to operational state,
  * 1. Enable required interrupts
  * 2. Configure interrupt aggregation
- * 3. Program UTRL and UTMRL base addres
+ * 3. Program UTRL and UTMRL base address
  * 4. Configure run-stop-registers
  *
  * Returns 0 on success, non-zero value on failure
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 2570d9477b37..18ed160b0ef1 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -177,7 +177,7 @@ struct ufshcd_lrb {
 };
 
 /**
- * struct ufs_query - holds relevent data structures for query request
+ * struct ufs_query - holds relevant data structures for query request
  * @request: request upiu and function
  * @descriptor: buffer for sending/receiving descriptor
  * @response: response upiu and response
-- 
2.4.3

--
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


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

2016-02-09 Thread Tomas Winkler
QUERY_DESC_GEOMETRY_MAZ_SIZE
QUERY_DESC_GEOMETRY_MAX_SIZE

Signed-off-by: Tomas Winkler 
---
 drivers/scsi/ufs/ufs.h| 2 +-
 drivers/scsi/ufs/ufshcd.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ufs/ufs.h b/drivers/scsi/ufs/ufs.h
index 42c459a9d3fe..54a16cef0367 100644
--- a/drivers/scsi/ufs/ufs.h
+++ b/drivers/scsi/ufs/ufs.h
@@ -170,7 +170,7 @@ enum ufs_desc_max_size {
 * of descriptor header.
 */
QUERY_DESC_STRING_MAX_SIZE  = 0xFE,
-   QUERY_DESC_GEOMETRY_MAZ_SIZE= 0x44,
+   QUERY_DESC_GEOMETRY_MAX_SIZE= 0x44,
QUERY_DESC_POWER_MAX_SIZE   = 0x62,
QUERY_DESC_RFU_MAX_SIZE = 0x00,
 };
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 85cd2564c157..a44153401aee 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -92,7 +92,7 @@ static u32 ufs_query_desc_max_size[] = {
QUERY_DESC_INTERCONNECT_MAX_SIZE,
QUERY_DESC_STRING_MAX_SIZE,
QUERY_DESC_RFU_MAX_SIZE,
-   QUERY_DESC_GEOMETRY_MAZ_SIZE,
+   QUERY_DESC_GEOMETRY_MAX_SIZE,
QUERY_DESC_POWER_MAX_SIZE,
QUERY_DESC_RFU_MAX_SIZE,
 };
-- 
2.4.3

--
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 2/2] add support for DWC UFS Host Controller

2016-02-09 Thread Akinobu Mita
Hi Joao,

2016-02-09 4:07 GMT+09:00 Joao Pinto :
> diff --git a/drivers/scsi/ufs/ufshcd-dwc.c b/drivers/scsi/ufs/ufshcd-dwc.c
> new file mode 100644
> index 000..b12b1a8
> --- /dev/null
> +++ b/drivers/scsi/ufs/ufshcd-dwc.c
> @@ -0,0 +1,768 @@
> +/*
> + * UFS Host driver for Synopsys Designware Core
> + *
> + * Copyright (C) 2015-2016 Synopsys, Inc. (www.synopsys.com)
> + *
> + * Authors: Joao Pinto 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include "ufshcd.h"
> +#include "unipro.h"
> +
> +#include "ufshcd-dwc.h"
> +#include "ufshci-dwc.h"
> +
> +/**
> + * ufshcd_dwc_program_clk_div()
> + * This function programs the clk divider value. This value is needed to
> + * provide 1 microsecond tick to unipro layer.
> + * @hba: Private Structure pointer
> + * @divider_val: clock divider value to be programmed
> + *
> + */
> +void ufshcd_dwc_program_clk_div(struct ufs_hba *hba, u32 divider_val)
> +{
> +   ufshcd_writel(hba, divider_val, DWC_UFS_REG_HCLKDIV);
> +}
> +EXPORT_SYMBOL(ufshcd_dwc_program_clk_div);
> +
> +/**
> + * ufshcd_dwc_link_is_up()
> + * Check if link is up
> + * @hba: private structure poitner
> + *
> + * Returns 0 on success, non-zero value on failure
> + */
> +int ufshcd_dwc_link_is_up(struct ufs_hba *hba)
> +{
> +   int dme_result = 0;
> +
> +   ufshcd_dme_get(hba, UIC_ARG_MIB(VS_POWERSTATE), &dme_result);
> +
> +   if (dme_result == UFSHCD_LINK_IS_UP) {
> +   ufshcd_set_link_active(hba);
> +   return 0;
> +   }
> +
> +   return 1;
> +}
> +EXPORT_SYMBOL(ufshcd_dwc_link_is_up);
> +
> +/**
> + * ufshcd_dwc_connection_setup()
> + * This function configures both the local side (host) and the peer side
> + * (device) unipro attributes to establish the connection to application/
> + * cport.
> + * This function is not required if the hardware is properly configured to
> + * have this connection setup on reset. But invoking this function does no
> + * harm and should be fine even working with any ufs device.
> + *
> + * @hba: pointer to drivers private data
> + *
> + * Returns 0 on success non-zero value on failure
> + */
> +int ufshcd_dwc_connection_setup(struct ufs_hba *hba)
> +{
> +   int ret = 0;
> +
> +   /* Local side Configuration */
> +   ret = ufshcd_dme_set(hba, UIC_ARG_MIB(T_CONNECTIONSTATE), 0);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_set(hba, UIC_ARG_MIB(N_DEVICEID), 0);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_set(hba, UIC_ARG_MIB(N_DEVICEID_VALID), 0);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_set(hba, UIC_ARG_MIB(T_PEERDEVICEID), 1);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_set(hba, UIC_ARG_MIB(T_PEERCPORTID), 0);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_set(hba, UIC_ARG_MIB(T_TRAFFICCLASS), 0);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_set(hba, UIC_ARG_MIB(T_CPORTFLAGS), 0x6);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_set(hba, UIC_ARG_MIB(T_CPORTMODE), 1);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_set(hba, UIC_ARG_MIB(T_CONNECTIONSTATE), 1);
> +   if (ret)
> +   goto out;
> +
> +
> +   /* Peer side Configuration */
> +   ret = ufshcd_dme_peer_set(hba, UIC_ARG_MIB(T_CONNECTIONSTATE), 0);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_peer_set(hba, UIC_ARG_MIB(N_DEVICEID), 1);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_peer_set(hba, UIC_ARG_MIB(N_DEVICEID_VALID), 1);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_peer_set(hba, UIC_ARG_MIB(T_PEERDEVICEID), 1);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_peer_set(hba, UIC_ARG_MIB(T_PEERCPORTID), 0);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_peer_set(hba, UIC_ARG_MIB(T_TRAFFICCLASS), 0);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_peer_set(hba, UIC_ARG_MIB(T_CPORTFLAGS), 0x6);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_peer_set(hba, UIC_ARG_MIB(T_CPORTMODE), 1);
> +   if (ret)
> +   goto out;
> +
> +   ret = ufshcd_dme_peer_set(hba, UIC_ARG_MIB(T_CONNECTIONSTATE), 1);
> +   if (ret)
> +   goto out;
> +
> +out:
> +   return ret;
> +}
> +
> +/**
> + * ufshcd_dwc_setup_20bit_rmmi_lane0()
> + * This function configures Synopsys MPHY 20-bit RMMI Lane 0
> + * @hba: Pointer to drivers structure
> + *
> + * Returns 0 on success or non-zero value on failure
> + */
> +int ufshcd_dwc_setup_20bit_rmmi_lane0(struct ufs_hba *hba)
> +{
> 

Re: complete boot failure in 4.5-rc1 caused by nvme: make SG_IO support optional

2016-02-09 Thread Christoph Hellwig
Jens,

do you want a 'default y' patch or just a better description?  I'd be
happy to send either one.
--
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 13/23] scsi_dh_alua: Use workqueue for RTPG

2016-02-09 Thread Christoph Hellwig
Looks fine,

Reviewed-by: Christoph Hellwig 
--
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-09 Thread Christoph Hellwig
On Mon, Feb 08, 2016 at 03:34:45PM +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 

Looks fine,

Reviewed-by: Christoph Hellwig 
--
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: complete boot failure in 4.5-rc1 caused by nvme: make SG_IO support optional

2016-02-09 Thread Jens Axboe
On Feb 9, 2016, at 5:50 AM, Christoph Hellwig  wrote:
> 
> Jens,
> 
> do you want a 'default y' patch or just a better description?  I'd be
> happy to send either one.

A better description  

-- 
Jens Axboe
--
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: T10 adds locally assigned UUID designation descriptor

2016-02-09 Thread Hannes Reinecke
On 02/08/2016 09:04 PM, Douglas Gilbert wrote:
> On 16-02-08 02:00 PM, James Bottomley wrote:
>> On Mon, 2016-02-08 at 12:33 -0500, Douglas Gilbert wrote:
>>> Recently, in draft spc5r08, T10 added a locally assigned RFC 4122
>>> UUID *** designation descriptor. That descriptor can now be
>>> returned for VPD page 0x83 (device identification) amongst others.
>>> It can be used anywhere SCSI needs a unique identifier expanding
>>> the previous set of preferred identifiers: EUI, NAA and SCSI_name
>>> (iSCSI).
>>>
>>> In the soon to be released sg3_utils version 1.42 the new UUID
>>> designation descriptor is decoded including Hannes' --export
>>> option found in sg_inq, for example:
>>>
>>> # sg_inq --export /dev/sg0
>>> ...
>>> SCSI_IDENT_LUN_UUID=11223344-5566-7788-aabb-ccddeeee
>>>
>>> Perhaps some udev work is needed to incorporate this new identifier.
>>
>> Hm, we're going to have to do this carefully.  With the move to GPT
>> partitions, both the UUID= designator in fstab and the /dev/disk/by
>> -uuid/ of udev means the GPT UUID.  In theory the design of the UUID
>> space is to allow random selection without clashing, so we could just
>> place the SCSI ones in here as well and perhaps there won't be a
>> problem, but I'd like us to think about the consequences first.
> 
> The UUID proposal (16-005r1 from Fred Knight and "Dr. Hannes Reinecke")
> was somewhat controversial with five T10 members voting against it. The
> minutes state: "The members voting no stated concern that this proposal
> may result in market confusion, and those members intend to develop
> proposals to mitigate any confusion."
> 
> Locally assigned identifiers are not new: there already is an 8 byte
> locally assigned NAA identifier (NAA=3). It is not much used, perhaps
> the new locally assigned UUID (which is 16 bytes long) will find
> more use. As for the 'sg_inq --export' naming, that seems to nail
> down the context of the new UUID pretty well:
>   SCSI_IDENT_[TARGET|PORT|LUN]_UUID
> with the identifier itself in canonical UUID format. So there should
> be no confusion there. And partitions are nested inside logical
> units and SCSI does not define those (apart from on tapes).
> 
Precisely.

These uuids will show up under /dev/disk/by-id
(as this is a hardware ID coming from the device).
So the existing UUID= or /dev/disk/by-uuid won't be influenced.
And UUID handling is confusing already (with basically every
subsystem providing one), so adding one more won't matter much :-)

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: complete boot failure in 4.5-rc1 caused by nvme: make SG_IO support optional

2016-02-09 Thread James Bottomley
On Tue, 2016-02-09 at 13:50 +0100, Christoph Hellwig wrote:
> Jens,
> 
> do you want a 'default y' patch or just a better description?  I'd be
> happy to send either one.

Since it only appears to be SUSE and they've now been told, better
description is fine.

James


--
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: [mpt3sas driver V1 6/10] mpt3sas: Added smp_affinity_enable module parameter.

2016-02-09 Thread Tomas Henzl
On 8.2.2016 17:43, Suganath prabu Subramani wrote:
> Module parameter to enable/disable configuring
> affinity hint for msix vector.
> SMP affinity feature can be enabled/disabled by setting
> module parameter "smp_affinity_enable" to 1/0.
> By default this feature is enabled. (smp_affinity_enable = 1 enabled).
>
> Signed-off-by: Suganath prabu Subramani 
> 
> Signed-off-by: Chaitra P B 
> ---
>  drivers/scsi/mpt3sas/mpt3sas_base.c | 37 
> ++---
>  1 file changed, 26 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
> b/drivers/scsi/mpt3sas/mpt3sas_base.c
> index 31838d9a..582ba4b 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_base.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
> @@ -83,6 +83,10 @@ static int msix_disable = -1;
>  module_param(msix_disable, int, 0);
>  MODULE_PARM_DESC(msix_disable, " disable msix routed interrupts 
> (default=0)");
>  
> +static int smp_affinity_enable = 1;
> +module_param(smp_affinity_enable, int, S_IRUGO);
> +MODULE_PARM_DESC(smp_affinity_enable, "SMP affinity feature enable/disbale 
> Default: enable(1)");
> +
>  static int max_msix_vectors = -1;
>  module_param(max_msix_vectors, int, 0);
>  MODULE_PARM_DESC(max_msix_vectors,
> @@ -1812,8 +1816,10 @@ _base_free_irq(struct MPT3SAS_ADAPTER *ioc)
>  
>   list_for_each_entry_safe(reply_q, next, &ioc->reply_queue_list, list) {
>   list_del(&reply_q->list);
> - irq_set_affinity_hint(reply_q->vector, NULL);
> - free_cpumask_var(reply_q->affinity_hint);
> + if (smp_affinity_enable) {
> + irq_set_affinity_hint(reply_q->vector, NULL);
> + free_cpumask_var(reply_q->affinity_hint);
> + }
>   synchronize_irq(reply_q->vector);
>   free_irq(reply_q->vector, reply_q);
>   kfree(reply_q);
> @@ -1844,9 +1850,13 @@ _base_request_irq(struct MPT3SAS_ADAPTER *ioc, u8 
> index, u32 vector)
>   reply_q->msix_index = index;
>   reply_q->vector = vector;
>  
> - if (!alloc_cpumask_var(&reply_q->affinity_hint, GFP_KERNEL))
> - return -ENOMEM;
> - cpumask_clear(reply_q->affinity_hint);
> + if (smp_affinity_enable) {
> + if (!zalloc_cpumask_var(&reply_q->affinity_hint, GFP_KERNEL)) {
> + kfree(reply_q);
> + return -ENOMEM;
> + }
> + cpumask_clear(reply_q->affinity_hint);

I think, that with zalloc_cpumask_var we no more need the cpumask_clear here
Please remove it in next patchset.

Reviewed-by: Tomas Henzl 

Tomas





--
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: NULL pointer dereference: IP: [] sr_runtime_suspend+0xc/0x20 [sr_mod]

2016-02-09 Thread Paul Menzel
Dear Debian and Linux folks,


Am Mittwoch, den 20.01.2016, 23:07 +0100 schrieb Alexandre Rossi:

> >> Could you please attach the debugging patch. Hopefully Alexandre, Erich,
> >> or I will have some spare time to build an image from it.
> >
> > Actually, this patch is an attempt at a fix.  After looking more
> > carefully at your log pictures, I realized what the problem must be.
> >
> > It's too bad nobody was able to capture a log where the error
> > occurred in sr_runtime_suspend, though -- all the logs in the bug
> > report show sd_runtime_resume.
> 
> I just tested the patch applied on top of 4.3.3 (4.3.3-6 in Debian).
> 
> It still crashes at boot, but the stacktrace is different : it happens
> in blk_post_runtime_resume . Maybe I'm bit by a different bug or maybe
> the I need to try with 4.4.
> 
> I'll post the captured log when I have access to a wired network. I'd
> be happy to provide the logs of a debugging patch.

I tried Linux 4.3.5-1 [1], which entered Debian Sid/unstable yesterday,
and I get the same null pointer dereference as Alexandre.

As this is Linux 4.3 and not 4.4, I guess this is a different problem
though. Alexandre, where you able to capture the stack trace? I’d submit
a new bug report with this.


Thanks,

Paul


[1] 
http://metadata.ftp-master.debian.org/changelogs/main/l/linux/linux_4.3.5-1_changelog
-- 
GPG-Schlüssel: 33623E9B
Fingerabdruck = 0EB1 649D 4361 D04F 3C70  6F71 4DD7 BF75 3362 3E9B

Giant Monkey Software Engineering GmbH

Brunnenstr. 7D
10119 Berlin Mitte

Geschäftsführer Adrian Fuhrmann, Lion Vollnhals und Paul Menzel

USt-IdNr.: DE281524720
HRB 139495 B Amtsgericht Charlottenburg


signature.asc
Description: This is a digitally signed message part


RE: [v4 05/14] scsi: ufs: separate device and host quirks

2016-02-09 Thread Winkler, Tomas
> Currently we use the host quirks mechanism in order to
> handle both device and host controller quirks.
> In order to support various of UFS devices we should separate
> handling the device quirks from the host controller's.
> 
> Reviewed-by: Gilad Broner 
> Signed-off-by: Raviv Shvili 
> Signed-off-by: Yaniv Gardi 



I would like to see this patch to be split into two
1. support for device descriptor read
2. support quirks
 

> 
> ---
>  drivers/scsi/ufs/Makefile |   2 +-
>  drivers/scsi/ufs/ufs.h|  32 +++
>  drivers/scsi/ufs/ufs_quirks.c | 100 ++
>  drivers/scsi/ufs/ufs_quirks.h | 124
> ++
>  drivers/scsi/ufs/ufshcd.c |  90 +-
>  drivers/scsi/ufs/ufshcd.h |  10 
>  6 files changed, 356 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/scsi/ufs/ufs_quirks.c
>  create mode 100644 drivers/scsi/ufs/ufs_quirks.h
> 
> diff --git a/drivers/scsi/ufs/Makefile b/drivers/scsi/ufs/Makefile
> index 8303bcc..8570d41 100644
> --- a/drivers/scsi/ufs/Makefile
> +++ b/drivers/scsi/ufs/Makefile
> @@ -1,5 +1,5 @@
>  # UFSHCD makefile
>  obj-$(CONFIG_SCSI_UFS_QCOM) += ufs-qcom.o
> -obj-$(CONFIG_SCSI_UFSHCD) += ufshcd.o
> +obj-$(CONFIG_SCSI_UFSHCD) += ufshcd.o ufs_quirks.o
>  obj-$(CONFIG_SCSI_UFSHCD_PCI) += ufshcd-pci.o
>  obj-$(CONFIG_SCSI_UFSHCD_PLATFORM) += ufshcd-pltfrm.o
> diff --git a/drivers/scsi/ufs/ufs.h b/drivers/scsi/ufs/ufs.h
> index 42c459a..8dd608b 100644
> --- a/drivers/scsi/ufs/ufs.h
> +++ b/drivers/scsi/ufs/ufs.h
> @@ -43,6 +43,7 @@
>  #define GENERAL_UPIU_REQUEST_SIZE 32
>  #define QUERY_DESC_MAX_SIZE   255
>  #define QUERY_DESC_MIN_SIZE   2
> +#define QUERY_DESC_HDR_SIZE   2
>  #define QUERY_OSF_SIZE(GENERAL_UPIU_REQUEST_SIZE - \
>   (sizeof(struct utp_upiu_header)))
> 
> @@ -195,6 +196,37 @@ enum unit_desc_param {
>   UNIT_DESC_PARAM_LARGE_UNIT_SIZE_M1  = 0x22,
>  };
> 
> +/* Device descriptor parameters offsets in bytes*/
> +enum device_desc_param {
> + DEVICE_DESC_PARAM_LEN   = 0x0,
> + DEVICE_DESC_PARAM_TYPE  = 0x1,
> + DEVICE_DESC_PARAM_DEVICE_TYPE   = 0x2,
> + DEVICE_DESC_PARAM_DEVICE_CLASS  = 0x3,
> + DEVICE_DESC_PARAM_DEVICE_SUB_CLASS  = 0x4,
> + DEVICE_DESC_PARAM_PRTCL = 0x5,
> + DEVICE_DESC_PARAM_NUM_LU= 0x6,
> + DEVICE_DESC_PARAM_NUM_WLU   = 0x7,
> + DEVICE_DESC_PARAM_BOOT_ENBL = 0x8,
> + DEVICE_DESC_PARAM_DESC_ACCSS_ENBL   = 0x9,
> + DEVICE_DESC_PARAM_INIT_PWR_MODE = 0xA,
> + DEVICE_DESC_PARAM_HIGH_PR_LUN   = 0xB,
> + DEVICE_DESC_PARAM_SEC_RMV_TYPE  = 0xC,
> + DEVICE_DESC_PARAM_SEC_LU= 0xD,
> + DEVICE_DESC_PARAM_BKOP_TERM_LT  = 0xE,
> + DEVICE_DESC_PARAM_ACTVE_ICC_LVL = 0xF,
> + DEVICE_DESC_PARAM_SPEC_VER  = 0x10,
> + DEVICE_DESC_PARAM_MANF_DATE = 0x12,
> + DEVICE_DESC_PARAM_MANF_NAME = 0x14,
> + DEVICE_DESC_PARAM_PRDCT_NAME= 0x15,
> + DEVICE_DESC_PARAM_SN= 0x16,
> + DEVICE_DESC_PARAM_OEM_ID= 0x17,
> + DEVICE_DESC_PARAM_MANF_ID   = 0x18,
> + DEVICE_DESC_PARAM_UD_OFFSET = 0x1A,
> + DEVICE_DESC_PARAM_UD_LEN= 0x1B,
> + DEVICE_DESC_PARAM_RTT_CAP   = 0x1C,
> + DEVICE_DESC_PARAM_FRQ_RTC   = 0x1D,
> +};
> +

This list is correct only for UFS 2.0, UFS 1.0 has different offsets. 

>  /*
>   * Logical Unit Write Protect
>   * 00h: LU not write protected
> diff --git a/drivers/scsi/ufs/ufs_quirks.c b/drivers/scsi/ufs/ufs_quirks.c
> new file mode 100644
> index 000..476ed01
> --- /dev/null
> +++ b/drivers/scsi/ufs/ufs_quirks.c
> @@ -0,0 +1,100 @@
> +/*
> + * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 and
> + * only version 2 as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include "ufshcd.h"
> +#include "ufs_quirks.h"
> +
> +static struct ufs_dev_fix ufs_fixups[] = {
> + /* UFS cards deviations table */
> + UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
> UFS_DEVICE_NO_VCCQ),
> + UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
> + UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS),
> + UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,
> + UFS_DEVICE_NO_FASTAUTO),
> + UFS_FIX(UFS_VENDOR_TOSHIBA, "THGLF2G9C8KBADG",

Re: complete boot failure in 4.5-rc1 caused by nvme: make SG_IO support optional

2016-02-09 Thread Christoph Hellwig
Does this looks reasonable?

---
>From 7843fae979df3fc14007735f54cc6bb2f6f66dc5 Mon Sep 17 00:00:00 2001
From: Christoph Hellwig 
Date: Tue, 9 Feb 2016 18:11:32 +0100
Subject: nvme: fix Kconfig description for BLK_DEV_NVME_SCSI

Signed-off-by: Christoph Hellwig 
---
 drivers/nvme/host/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/Kconfig b/drivers/nvme/host/Kconfig
index 59307f8..2e24156 100644
--- a/drivers/nvme/host/Kconfig
+++ b/drivers/nvme/host/Kconfig
@@ -17,8 +17,8 @@ config BLK_DEV_NVME_SCSI
  and block devices nodes, as well a a translation for a small
  number of selected SCSI commands to NVMe commands to the NVMe
  driver.  If you don't know what this means you probably want
- to say N here, and if you know what it means you probably
- want to say N as well.
+ to say N here, unless you run a distro that abuses this for
+ stable device names like some OpenSuSE and SLES versions.
 
 config NVME_FABRICS
tristate
-- 
2.1.4

--
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: [RFC PATCH v2] blk-mq: Introduce per sw queue time-slice

2016-02-09 Thread Andreas Herrmann
[CC-ing linux-block and linux-scsi and adding some comments]

On Mon, Feb 01, 2016 at 11:43:40PM +0100, Andreas Herrmann wrote:
> This introduces a new blk_mq hw attribute time_slice_us which allows
> to specify a time slice in usecs.
> 
> Default value is 0 and implies no modification to blk-mq behaviour.
> 
> A positive value changes blk-mq to service only one software queue
> within this time slice until it expires or the software queue is
> empty. Then the next software queue with pending requests is selected.
> 
> Signed-off-by: Andreas Herrmann 
> ---
>  block/blk-mq-sysfs.c   |  27 +++
>  block/blk-mq.c | 208 
> +
>  include/linux/blk-mq.h |   9 +++
>  3 files changed, 211 insertions(+), 33 deletions(-)
> 
> Hi,
> 
> This update is long overdue (sorry for the delay).
> 
> Change to v1:
> - time slice is now specified in usecs instead of msecs.
> - time slice is extended (up to 3 times the initial value) when there
>   was actually a request to be serviced for the software queue
> 
> Fio test results are sent in a separate mail to this.

See http://marc.info/?l=linux-kernel&m=145436682607949&w=2

In short it shows significant performance gains in some tests,
e.g. sequential read iops up by >40% with 8 jobs. But it's never on
par with CFQ when more than 1 job was used during the test.

> Results for fio improved to some extent with this patch. But in
> reality the picture is quite mixed. Performance is highly dependend on
> task scheduling. There is no guarantee that the requests originated
> from one CPU belong to the same process.
> 
> I think for rotary devices CFQ is by far the best choice. A simple
> illustration is:
> 
>   Copying two files (750MB in this case) in parallel on a rotary
>   device. The elapsed wall clock time (seconds) for this is
>meanstdev
>cfq, slice_idle=8   16.18   4.95
>cfq, slice_idle=0   23.74   2.82
>blk-mq, time_slice_usec=0   24.37   2.05
>blk-mq, time_slice_usec=250 25.58   3.16

This illustrates that although their was performance gain with fio
tests, the patch can cause higher variance and lower performance in
comparison to unmodified blk-mq with other tests. And it underscores
superiority of CFQ for rotary disks.

Meanwhile my opinion is that it's not really worth to look further
into introduction of I/O scheduling support in blk-mq. I don't see the
need for scheduling support (deadline or something else) for fast
storage devices. And rotary devices should really avoid usage of blk-mq
and stick to CFQ.

Thus I think that introducing some coexistence of blk-mq and the
legacy block with CFQ is the best option.

Recently Johannes sent a patch to enable scsi-mq per driver, see
http://marc.info/?l=linux-scsi&m=145347009631192&w=2

Probably that is a good solution (at least in the short term) to allow
users to switch to blk-mq for some host adapters (with fast storage
attached) but to stick to legacy stuff on other host adapters with
rotary devices.

What do others think?


Thanks,

Andreas


> Regards,
> 
> Andreas
> 
> diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c
> index 1cf1878..77c875c 100644
> --- a/block/blk-mq-sysfs.c
> +++ b/block/blk-mq-sysfs.c
> @@ -247,6 +247,26 @@ static ssize_t blk_mq_hw_sysfs_cpus_show(struct 
> blk_mq_hw_ctx *hctx, char *page)
>   return ret;
>  }
>  
> +static ssize_t blk_mq_hw_sysfs_tslice_show(struct blk_mq_hw_ctx *hctx,
> +   char *page)
> +{
> + return sprintf(page, "%u\n", hctx->tslice_us);
> +}
> +
> +static ssize_t blk_mq_hw_sysfs_tslice_store(struct blk_mq_hw_ctx *hctx,
> + const char *page, size_t length)
> +{
> + unsigned long long store;
> + int err;
> +
> + err = kstrtoull(page, 10, &store);
> + if (err)
> + return -EINVAL;
> +
> + hctx->tslice_us = (unsigned)store;
> + return length;
> +}
> +
>  static struct blk_mq_ctx_sysfs_entry blk_mq_sysfs_dispatched = {
>   .attr = {.name = "dispatched", .mode = S_IRUGO },
>   .show = blk_mq_sysfs_dispatched_show,
> @@ -305,6 +325,12 @@ static struct blk_mq_hw_ctx_sysfs_entry 
> blk_mq_hw_sysfs_poll = {
>   .show = blk_mq_hw_sysfs_poll_show,
>  };
>  
> +static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_tslice = {
> + .attr = {.name = "time_slice_us", .mode = S_IRUGO | S_IWUSR },
> + .show = blk_mq_hw_sysfs_tslice_show,
> + .store = blk_mq_hw_sysfs_tslice_store,
> +};
> +
>  static struct attribute *default_hw_ctx_attrs[] = {
>   &blk_mq_hw_sysfs_queued.attr,
>   &blk_mq_hw_sysfs_run.attr,
> @@ -314,6 +340,7 @@ static struct attribute *default_hw_ctx_attrs[] = {
>   &blk_mq_hw_sysfs_cpus.attr,
>   &blk_mq_hw_sysfs_active.attr,
>   &blk_mq_hw_sysfs_poll.attr,
> + &blk_mq_hw_sysfs_tslice.attr,
>   NULL,
>  };
>  
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 4c0622f..97d32

Re: complete boot failure in 4.5-rc1 caused by nvme: make SG_IO support optional

2016-02-09 Thread Jens Axboe

On 02/09/2016 10:12 AM, Christoph Hellwig wrote:

Does this looks reasonable?

---
 From 7843fae979df3fc14007735f54cc6bb2f6f66dc5 Mon Sep 17 00:00:00 2001
From: Christoph Hellwig 
Date: Tue, 9 Feb 2016 18:11:32 +0100
Subject: nvme: fix Kconfig description for BLK_DEV_NVME_SCSI

Signed-off-by: Christoph Hellwig 
---
  drivers/nvme/host/Kconfig | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/Kconfig b/drivers/nvme/host/Kconfig
index 59307f8..2e24156 100644
--- a/drivers/nvme/host/Kconfig
+++ b/drivers/nvme/host/Kconfig
@@ -17,8 +17,8 @@ config BLK_DEV_NVME_SCSI
  and block devices nodes, as well a a translation for a small
  number of selected SCSI commands to NVMe commands to the NVMe
  driver.  If you don't know what this means you probably want
- to say N here, and if you know what it means you probably
- want to say N as well.
+ to say N here, unless you run a distro that abuses this for
+ stable device names like some OpenSuSE and SLES versions.


Yep, that looks a lot more reasonable to me. Might be wort including 
that it impacts the mount-by-id on those distros.


--
Jens Axboe

--
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: complete boot failure in 4.5-rc1 caused by nvme: make SG_IO support optional

2016-02-09 Thread Christoph Hellwig
Updated version below:

---
>From d63251560cf2670badbc86c83502502f29c087e0 Mon Sep 17 00:00:00 2001
From: Christoph Hellwig 
Date: Tue, 9 Feb 2016 18:11:32 +0100
Subject: nvme: fix Kconfig description for BLK_DEV_NVME_SCSI

Signed-off-by: Christoph Hellwig 
---
 drivers/nvme/host/Kconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/Kconfig b/drivers/nvme/host/Kconfig
index 59307f8..68fa858 100644
--- a/drivers/nvme/host/Kconfig
+++ b/drivers/nvme/host/Kconfig
@@ -17,8 +17,9 @@ config BLK_DEV_NVME_SCSI
  and block devices nodes, as well a a translation for a small
  number of selected SCSI commands to NVMe commands to the NVMe
  driver.  If you don't know what this means you probably want
- to say N here, and if you know what it means you probably
- want to say N as well.
+ to say N here, unless you run a distro that abuses the SCSI
+ emulation to provide stable device names for mount by id like
+ some OpenSuSE and SLES versions.
 
 config NVME_FABRICS
tristate
-- 
2.1.4

--
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: complete boot failure in 4.5-rc1 caused by nvme: make SG_IO support optional

2016-02-09 Thread Jens Axboe

On 02/09/2016 10:19 AM, Christoph Hellwig wrote:

Updated version below:

---
 From d63251560cf2670badbc86c83502502f29c087e0 Mon Sep 17 00:00:00 2001
From: Christoph Hellwig 
Date: Tue, 9 Feb 2016 18:11:32 +0100
Subject: nvme: fix Kconfig description for BLK_DEV_NVME_SCSI

Signed-off-by: Christoph Hellwig 
---
  drivers/nvme/host/Kconfig | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/Kconfig b/drivers/nvme/host/Kconfig
index 59307f8..68fa858 100644
--- a/drivers/nvme/host/Kconfig
+++ b/drivers/nvme/host/Kconfig
@@ -17,8 +17,9 @@ config BLK_DEV_NVME_SCSI
  and block devices nodes, as well a a translation for a small
  number of selected SCSI commands to NVMe commands to the NVMe
  driver.  If you don't know what this means you probably want
- to say N here, and if you know what it means you probably
- want to say N as well.
+ to say N here, unless you run a distro that abuses the SCSI
+ emulation to provide stable device names for mount by id like
+ some OpenSuSE and SLES versions.


Thanks, looks good to me, I'll fold it in for the current series.

--
Jens Axboe

--
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


我的相片在

2016-02-09 Thread 我的相片在
你的老朋友邀你来Q群:343257759


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

2016-02-09 Thread Manoj Kumar

Yeah, I can see how that is confusing. Since, all three possible valid
crq message types have the first bit set I think this was originally a
cute hack to grab anything that was likely valid. Then in
ibmvscsi_handle_crq() we explicitly match the full header value in a
switch statement logging anything that turned out actually invalid.



If 'valid' will only have one of these four enums defined, would
this be better written as:

if (crq->valid != VIOSRP_CRQ_FREE)


This definitely would make the logic easier to read and follow. Also,
this would make sure any crq with an invalid header that doesn't have
its first bit set will also be logged by the ibmvscsi_handle_crq()
switch statement default block and not silently ignored.

-Tyrel


Sounds good, Tyrel. Does this mean I should expect a v2 of this patch
series?

- Manoj N. Kumar

--
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: [RFC PATCH v2] blk-mq: Introduce per sw queue time-slice

2016-02-09 Thread Markus Trippelsdorf
On 2016.02.09 at 18:12 +0100, Andreas Herrmann wrote:
> [CC-ing linux-block and linux-scsi and adding some comments]
> 
> On Mon, Feb 01, 2016 at 11:43:40PM +0100, Andreas Herrmann wrote:
> > This introduces a new blk_mq hw attribute time_slice_us which allows
> > to specify a time slice in usecs.
> > 
> > Fio test results are sent in a separate mail to this.
> 
> See http://marc.info/?l=linux-kernel&m=145436682607949&w=2
> 
> In short it shows significant performance gains in some tests,
> e.g. sequential read iops up by >40% with 8 jobs. But it's never on
> par with CFQ when more than 1 job was used during the test.
> 
> > Results for fio improved to some extent with this patch. But in
> > reality the picture is quite mixed. Performance is highly dependend on
> > task scheduling. There is no guarantee that the requests originated
> > from one CPU belong to the same process.
> > 
> > I think for rotary devices CFQ is by far the best choice. A simple
> > illustration is:
> > 
> >   Copying two files (750MB in this case) in parallel on a rotary
> >   device. The elapsed wall clock time (seconds) for this is
> >meanstdev
> >cfq, slice_idle=8   16.18   4.95
> >cfq, slice_idle=0   23.74   2.82
> >blk-mq, time_slice_usec=0   24.37   2.05
> >blk-mq, time_slice_usec=250 25.58   3.16
> 
> This illustrates that although their was performance gain with fio
> tests, the patch can cause higher variance and lower performance in
> comparison to unmodified blk-mq with other tests. And it underscores
> superiority of CFQ for rotary disks.
> 
> Meanwhile my opinion is that it's not really worth to look further
> into introduction of I/O scheduling support in blk-mq. I don't see the
> need for scheduling support (deadline or something else) for fast
> storage devices. And rotary devices should really avoid usage of blk-mq
> and stick to CFQ.
> 
> Thus I think that introducing some coexistence of blk-mq and the
> legacy block with CFQ is the best option.
> 
> Recently Johannes sent a patch to enable scsi-mq per driver, see
> http://marc.info/?l=linux-scsi&m=145347009631192&w=2
> 
> Probably that is a good solution (at least in the short term) to allow
> users to switch to blk-mq for some host adapters (with fast storage
> attached) but to stick to legacy stuff on other host adapters with
> rotary devices.

I don't think that Johannes' patch is a good solution.

The best solution for the user would be if blk-mq could be toggled per
drive (or even automatically enabled if queue/rotational == 0). Is there
a fundamental reason why this is not feasible?

Your solution is better than nothing, but it requires that the user
finds out the drive <=> host mapping by hand and then runs something
like: 
echo "250" > 
/sys/devices/pci:00/:00:11.0/ata2/host1/target1:0:0/1:0:0:0/block/sdb/mq/0/time_slice_us
during boot for spinning rust drives...

-- 
Markus
--
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 3/4] qla2xxx: Add DebugFS node for target sess list.

2016-02-09 Thread Himanshu Madhani


On 2/6/16, 9:00 PM, "Nicholas A. Bellinger"  wrote:

>On Sat, 2016-02-06 at 20:40 -0800, Nicholas A. Bellinger wrote:
>> Hi Himanshu & Quinn,
>> 
>> On Thu, 2016-02-04 at 11:45 -0500, Himanshu Madhani wrote:
>> > From: Quinn Tran 
>> > 
>> >  #cat  /sys/kernel/debug/qla2xxx/qla2xxx_31/tgt_sess
>> >  qla2xxx_31
>> >  Port ID   Port NameHandle
>> >  ff:fc:01  21:fd:00:05:33:c7:ec:16  0
>> >  01:0e:00  21:00:00:24:ff:7b:8a:e4  1
>> >  01:0f:00  21:00:00:24:ff:7b:8a:e5  2
>> >  
>> > 
>> > Signed-off-by: Quinn Tran 
>> > Signed-off-by: Himanshu Madhani 
>> > ---
>> >  drivers/scsi/qla2xxx/qla_def.h|1 +
>> >  drivers/scsi/qla2xxx/qla_dfs.c|   55
>>
>> >  drivers/scsi/qla2xxx/qla_target.c |   56
>>
>> >  3 files changed, 93 insertions(+), 19 deletions(-)
>> > 
>> 
>> So looking at this patch beyond the debugfs part, it does change where
>> ->check_initiator_node_acl() gets call during qlt_create_sess().
>> 
>> I assume this is related to new debugfs attribute, and these changes
>> (plus others in qlt_del_sess_work_fn) are not bug-fixes on their own,
>> correct..?
>> 
>> Aside from that, I don't have an objection to merge as v4.6 for-next
>> code if QLogic finds it useful for debugging.
>> 
>
>Btw, this patch has a conflict with target-pending/queue-next wrt to
>removal of be_sid + loopid from tgt_ops->check_initiator_node_acl(),
>which is part of the target_alloc_session() conversion for v4.6.
>
>Here's the updated version that's been applied to queue-next:
>
>https://git.kernel.org/cgit/linux/kernel/git/nab/target-pending.git/commit
>/?h=queue-next&id=cfd527d9db57ceac8a1e211b77c3357259df48cc
>
>Please verify that it looks + works as expected.
>

This Patch looks good. Tested successfully on my setup.

>

<>

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

2016-02-09 Thread Himanshu Madhani
Hi Nic, 


On 2/8/16, 9:25 PM, "Nicholas A. Bellinger"  wrote:

>Hi Himanshu,
>
>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.

Let me know if I can help in any way for testing/validating this series.

>
>Thank you,
>
>--nab
>

<>

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

2016-02-09 Thread Tyrel Datwyler
On 02/09/2016 09:41 AM, Manoj Kumar wrote:
>> Yeah, I can see how that is confusing. Since, all three possible valid
>> crq message types have the first bit set I think this was originally a
>> cute hack to grab anything that was likely valid. Then in
>> ibmvscsi_handle_crq() we explicitly match the full header value in a
>> switch statement logging anything that turned out actually invalid.
>>
>>>
>>> If 'valid' will only have one of these four enums defined, would
>>> this be better written as:
>>>
>>> if (crq->valid != VIOSRP_CRQ_FREE)
>>
>> This definitely would make the logic easier to read and follow. Also,
>> this would make sure any crq with an invalid header that doesn't have
>> its first bit set will also be logged by the ibmvscsi_handle_crq()
>> switch statement default block and not silently ignored.
>>
>> -Tyrel
> 
> Sounds good, Tyrel. Does this mean I should expect a v2 of this patch
> series?
> 
> - Manoj N. Kumar

Haven't had a chance to clean up and resubmit, but yes there will be a
v2 coming along soon.

-Tyrel

> 
> ___
> Linuxppc-dev mailing list
> linuxppc-...@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
> 

--
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] st: Fix MTMKPART to work with newer drives

2016-02-09 Thread Kai Makisara
Change the MTMKPART operation of the MTIOCTOP ioctl so that it works also with
current drives (LTO-5/6, etc.). Send a separate FORMAT MEDIUM command if the
partition mode page indicates that this is required. Use LOAD to position the
tape at the beginning of tape.

The operation is extended so that if the argument is negative, its absolute
value specifies the size of partition 0, which is the physically first
partition of the tape.

Signed-off-by: Kai Mäkisara 
Tested-by: Shane M Seymour 
Tested-by: Laurence Oberman 
Tested-by: Douglas Gilbert 
---
 Documentation/scsi/st.txt |   15 ++--
 drivers/scsi/st.c |  122 
 2 files changed, 121 insertions(+), 16 deletions(-)

--- a/drivers/scsi/st.c 2015-12-21 18:54:05.068882001 +0200
+++ b/drivers/scsi/st.c 2016-02-09 20:57:52.614816514 +0200
@@ -9,7 +9,7 @@
Steve Hirsch, Andreas Koppenh"ofer, Michael Leodolter, Eyal Lebedinsky,
Michael Schaefer, J"org Weule, and Eric Youngdale.
 
-   Copyright 1992 - 2010 Kai Makisara
+   Copyright 1992 - 2016 Kai Makisara
email kai.makis...@kolumbus.fi
 
Some small formal changes - aeb, 950809
@@ -17,7 +17,7 @@
Last modified: 18-JAN-1998 Richard Gooch  Devfs 
support
  */
 
-static const char *verstr = "20101219";
+static const char *verstr = "20160209";
 
 #include 
 
@@ -3296,7 +3296,10 @@ static int switch_partition(struct scsi_
 #define PP_OFF_RESERVED7
 
 #define PP_BIT_IDP 0x20
+#define PP_BIT_FDP 0x80
 #define PP_MSK_PSUM_MB 0x10
+#define PP_MSK_PSUM_UNITS  0x18
+#define PP_MSK_POFM0x04
 
 /* Get the number of partitions on the tape. As a side effect reads the
mode page into the tape buffer. */
@@ -3322,6 +3325,29 @@ static int nbr_partitions(struct scsi_ta
 }
 
 
+static int format_medium(struct scsi_tape *STp, int format)
+{
+   int result = 0;
+   int timeout = STp->long_timeout;
+   unsigned char scmd[MAX_COMMAND_SIZE];
+   struct st_request *SRpnt;
+
+   memset(scmd, 0, MAX_COMMAND_SIZE);
+   scmd[0] = FORMAT_UNIT;
+   scmd[2] = format;
+   if (STp->immediate) {
+   scmd[1] |= 1;   /* Don't wait for completion */
+   timeout = STp->device->request_queue->rq_timeout;
+   }
+   DEBC_printk(STp, "Sending FORMAT MEDIUM\n");
+   SRpnt = st_do_scsi(NULL, STp, scmd, 0, DMA_NONE,
+  timeout, MAX_RETRIES, 1);
+   if (!SRpnt)
+   result = STp->buffer->syscall_result;
+   return result;
+}
+
+
 /* Partition the tape into two partitions if size > 0 or one partition if
size == 0.
 
@@ -3340,11 +3366,16 @@ static int nbr_partitions(struct scsi_ta
and 10 when 1 partition is defined (information from Eric Lee Green). This 
is
is acceptable also to some other old drives and enforced if the first 
partition
size field is used for the first additional partition size.
+
+   For drives that advertize SCSI-3 or newer, use the SSC-3 methods.
  */
 static int partition_tape(struct scsi_tape *STp, int size)
 {
int result;
+   int target_partition;
+   bool scsi3 = STp->device->scsi_level >= SCSI_3, needs_format = false;
int pgo, psd_cnt, psdo;
+   int psum = PP_MSK_PSUM_MB, units = 0;
unsigned char *bp;
 
result = read_mode_page(STp, PART_PAGE, 0);
@@ -3352,6 +3383,12 @@ static int partition_tape(struct scsi_ta
DEBC_printk(STp, "Can't read partition mode page.\n");
return result;
}
+   target_partition = 1;
+   if (size < 0) {
+   target_partition = 0;
+   size = -size;
+   }
+
/* The mode page is in the buffer. Let's modify it and write it. */
bp = (STp->buffer)->b_data;
pgo = MODE_HEADER_LENGTH + bp[MH_OFF_BDESCS_LENGTH];
@@ -3359,9 +3396,52 @@ static int partition_tape(struct scsi_ta
bp[pgo + MP_OFF_PAGE_LENGTH] + 2);
 
psd_cnt = (bp[pgo + MP_OFF_PAGE_LENGTH] + 2 - PART_PAGE_FIXED_LENGTH) / 
2;
+
+   if (scsi3) {
+   needs_format = (bp[pgo + PP_OFF_FLAGS] & PP_MSK_POFM) != 0;
+   if (needs_format && size == 0) {
+   /* No need to write the mode page when clearing
+*  partitioning
+*/
+   DEBC_printk(STp, "Formatting tape with one 
partition.\n");
+   result = format_medium(STp, 0);
+   goto out;
+   }
+   if (needs_format)  /* Leave the old value for HP DATs claiming 
SCSI_3 */
+   psd_cnt = 2;
+   if ((bp[pgo + PP_OFF_FLAGS] & PP_MSK_PSUM_UNITS) == 
PP_MSK_PSUM_UNITS) {
+   /* Use units scaling for large partitions if the device
+

Re: NULL pointer dereference: IP: [] sr_runtime_suspend+0xc/0x20 [sr_mod]

2016-02-09 Thread Ben Hutchings
On Tue, 2016-02-09 at 20:56 +0100, Alexandre Rossi wrote:
> Hi,
> 
> netconsole does not seem to work so early in the boot process this time.
> 
> > As this is Linux 4.3 and not 4.4, I guess this is a different problem
> > though. Alexandre, where you able to capture the stack trace? I’d submit
> > a new bug report with this.
> 
> Here is a photo. Please ping me if you need to test some debugging patches.

I'm pretty sure this crash is fixed by commit 4fd41a8552af ("SCSI: Fix NULL
pointer dereference in runtime PM"), which I've now queued up for 4.3
(though it's already in 4.4 which I'll probably upload to unstable soon).

Ben.

-- 
Ben Hutchings
Design a system any fool can use, and only a fool will want to use it.

signature.asc
Description: This is a digitally signed message part


Re: [PATCH 3/4] qla2xxx: Add DebugFS node for target sess list.

2016-02-09 Thread Himanshu Madhani

On 2/8/16, 9:49 PM, "Nicholas A. Bellinger"  wrote:

>On Mon, 2016-02-08 at 17:43 +, Himanshu Madhani wrote:
>> >
>> >So looking at this patch beyond the debugfs part, it does change where
>> >->check_initiator_node_acl() gets call during qlt_create_sess().
>> >
>> >I assume this is related to new debugfs attribute, and these changes
>> >(plus others in qlt_del_sess_work_fn) are not bug-fixes on their own,
>> >correct..?
>> >
>> >Aside from that, I don't have an objection to merge as v4.6 for-next
>> >code if QLogic finds it useful for debugging.
>> 
>> Yes. The changes in this patch are strictly for making information
>> available via debugFS and not bug-fixes on their own.
>
>Thanks for clarifying.
>
>> This information has been requested by few customer who
>> finds this information useful for debugging and in addition they use
>>this
>> information in their configuration scripts as well.
>
>So I've got no particular objection to people adding debugfs
>informational attributes for whatever to aid debugging of their drivers.
>
>That said, the same information can too be exposed as a tcm_qla2xxx
>struct se_node_acl->acl_group configfs attribute, and for demo-mode
>sessions via a tcm_qla2xxx provided dynamic_sessions configfs attribute
>handler.
>
>I'd be happy to add expose this under tcm_qla2xxx configfs for v4.6 code
>if you'd like, otherwise I'm OK with the patch in queue-next as-is if
>you find it useful.
>

I really like your idea of exposing this information via configFS. Please
go ahead and make updates on exposing this information via
se_node_acl->acl_group
Configfs attribute. We can ask our customer to explore configfs to retrieve
information. However, We would also like to keep this information in
debugFS for now.

>

<>

[PATCH] scsi: fdomain: add missing CONFIG_ to PCMCIA

2016-02-09 Thread Yang Shi
There are some "#ifdef PCMCIA" in the driver code, but all of them missed
CONFIG_ prefix. Correct PCMCIA to CONFIG_PCMCIA.

Signed-off-by: Yang Shi 
---

I happened to find this problem when I was tracking down another problem,
however this driver looks very old, not sure if anybody cares about it or not.
Anyway, it is harmless to come up with a patch to get it corrected.

 drivers/scsi/fdomain.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c
index eefe14d..ffc9187 100644
--- a/drivers/scsi/fdomain.c
+++ b/drivers/scsi/fdomain.c
@@ -290,7 +290,7 @@
 #include 
 #include "fdomain.h"
 
-#ifndef PCMCIA
+#ifndef CONFIG_PCMCIA
 MODULE_AUTHOR("Rickard E. Faith");
 MODULE_DESCRIPTION("Future domain SCSI driver");
 MODULE_LICENSE("GPL");
@@ -414,7 +414,7 @@ static irqreturn_t   do_fdomain_16x0_intr( int irq, 
void *dev_id );
 static char * fdomain = NULL;
 module_param(fdomain, charp, 0);
 
-#ifndef PCMCIA
+#ifndef CONFIG_PCMCIA
 
 static unsigned long addresses[] = {
0xc8000,
@@ -432,7 +432,7 @@ static unsigned short ports[] = { 0x140, 0x150, 0x160, 
0x170 };
 
 static unsigned short ints[] = { 3, 5, 10, 11, 12, 14, 15, 0 };
 
-#endif /* !PCMCIA */
+#endif /* !CONFIG_PCMCIA */
 
 /*
 
@@ -466,7 +466,7 @@ static unsigned short ints[] = { 3, 5, 10, 11, 12, 14, 15, 
0 };
 
 */
 
-#ifndef PCMCIA
+#ifndef CONFIG_PCMCIA
 
 static struct signature {
const char *signature;
@@ -513,7 +513,7 @@ static struct signature {
 
 #define SIGNATURE_COUNT ARRAY_SIZE(signatures)
 
-#endif /* !PCMCIA */
+#endif /* !CONFIG_PCMCIA */
 
 static void print_banner( struct Scsi_Host *shpnt )
 {
@@ -645,7 +645,7 @@ static int fdomain_test_loopback( void )
return 0;
 }
 
-#ifndef PCMCIA
+#ifndef CONFIG_PCMCIA
 
 /* fdomain_get_irq assumes that we have a valid MCA ID for a
TMC-1660/TMC-1680 Future Domain board.  Now, check to be sure the
@@ -801,7 +801,7 @@ found:
return 1;   /* success */
 }
 
-#else /* PCMCIA */
+#else /* CONFIG_PCMCIA */
 
 static int fdomain_isa_detect( int *irq, int *iobase )
 {
@@ -812,7 +812,7 @@ static int fdomain_isa_detect( int *irq, int *iobase )
return 0;
 }
 
-#endif /* !PCMCIA */
+#endif /* !CONFIG_PCMCIA */
 
 
 /* PCI detection function: int fdomain_pci_bios_detect(int* irq, int*
@@ -1767,7 +1767,7 @@ struct scsi_host_template fdomain_driver_template = {
.use_clustering = DISABLE_CLUSTERING,
 };
 
-#ifndef PCMCIA
+#ifndef CONFIG_PCMCIA
 #ifdef CONFIG_PCI
 
 static struct pci_device_id fdomain_pci_tbl[] = {
-- 
2.0.2

--
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] scsi: fdomain: add missing CONFIG_ to PCMCIA

2016-02-09 Thread One Thousand Gnomes
On Tue,  9 Feb 2016 14:16:49 -0800
Yang Shi  wrote:

> There are some "#ifdef PCMCIA" in the driver code, but all of them missed
> CONFIG_ prefix. Correct PCMCIA to CONFIG_PCMCIA.
> 
> Signed-off-by: Yang Shi 

NAK. This breaks the driver completely


Read drivers/scsi/pcmcia/fdomain*

Alan
--
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] scsi: fdomain: add missing CONFIG_ to PCMCIA

2016-02-09 Thread Shi, Yang

On 2/9/2016 3:25 PM, One Thousand Gnomes wrote:

On Tue,  9 Feb 2016 14:16:49 -0800
Yang Shi  wrote:


There are some "#ifdef PCMCIA" in the driver code, but all of them missed
CONFIG_ prefix. Correct PCMCIA to CONFIG_PCMCIA.

Signed-off-by: Yang Shi 


NAK. This breaks the driver completely


Read drivers/scsi/pcmcia/fdomain*


Got it. Thanks for spotting out this. Sorry for the unthought change.

Yang



Alan



--
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 2/2] megaraid_sas: Fix SMAP issue

2016-02-09 Thread Martin K. Petersen
> "Sumit" == Sumit Saxena  writes:

Sumit> Inside compat IOCTL hook of driver, driver was using wrong
Sumit> address of ioc-> frame.raw which leads sense_ioc_ptr to be
Sumit> calculated wrongly and failing IOCTL.

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/2] megaraid_sas: Fix for IO failing post OCR in SRIOV environment

2016-02-09 Thread Martin K. Petersen
> "Sumit" == Sumit Saxena  writes:

Sumit> Driver assumes that VFs always have peers present whenever they
Sumit> have same LD IDs. But this is not the case.  This patch handles
Sumit> the above mentioned by explicitly checking for a peer before
Sumit> making HA/non-HA path decision.

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 0/2] scsi: Fix endless loop of ATA hard resets due to VPD reads

2016-02-09 Thread Martin K. Petersen
> "Todd" == Todd Fujinaka  writes:

Todd,

Todd> I've tried to read the code but I'm not sure where the strings are
Todd> getting parsed. I'm afraid I'm only familiar with the Ethernet
Todd> drivers. In any case, the patch didn't help and I had to add this
Todd> second Marvell line. I'm not sure if you can just wildcard the
Todd> second and third fields or not.

I tweaked your patch to match all revisions.

Applied to 4.5/scsi-fixes.

Thank you!

-- 
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] st: Fix MTMKPART to work with newer drives

2016-02-09 Thread Martin K. Petersen
> "Kai" == Kai Makisara  writes:

Kai> Change the MTMKPART operation of the MTIOCTOP ioctl so that it
Kai> works also with current drives (LTO-5/6, etc.). Send a separate
Kai> FORMAT MEDIUM command if the partition mode page indicates that
Kai> this is required. Use LOAD to position the tape at the beginning of
Kai> tape.

Kai> The operation is extended so that if the argument is negative, its
Kai> absolute value specifies the size of partition 0, which is the
Kai> physically first partition of the tape.

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


[Bug 112241] New: Under heavy load FC TARGET going to Oops

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

Bug ID: 112241
   Summary: Under heavy load FC TARGET going to Oops
   Product: SCSI Drivers
   Version: 2.5
Kernel Version: 4.3.3
  Hardware: Intel
OS: Linux
  Tree: Fedora
Status: NEW
  Severity: high
  Priority: P1
 Component: QLOGIC QLA2XXX
  Assignee: scsi_drivers-qla2...@kernel-bugs.osdl.org
  Reporter: anthony.blood...@gmail.com
Regression: No

Created attachment 203261
  --> https://bugzilla.kernel.org/attachment.cgi?id=203261&action=edit
Kernel stacktrace

Storage on Linux Fedora with QLogic Corp. ISP2532-based 8Gb Fibre Channel to
PCI Express HBA exporting Adaptec RAID6 with bcache on Intel SSD to VMWARE 5
On heavy load (for example VM migrating from storage) system going to Oops.


Stacktrace attached

-- 
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