RE: [PATCH] storvsc: use small sg_tablesize on x86

2016-01-27 Thread KY Srinivasan


> -Original Message-
> From: Olaf Hering [mailto:o...@aepfle.de]
> Sent: Monday, January 25, 2016 12:35 AM
> To: James Bottomley 
> Cc: KY Srinivasan ; Haiyang Zhang
> ; linux-ker...@vger.kernel.org; linux-
> s...@vger.kernel.org
> Subject: Re: [PATCH] storvsc: use small sg_tablesize on x86
> 
> On Fri, Oct 02, Olaf Hering wrote:
> 
> > On Thu, Oct 01, James Bottomley wrote:
> >
> > > On Thu, 2015-10-01 at 20:30 +, KY Srinivasan wrote:
> >
> > > > > +#if defined(CONFIG_X86_32)
> >
> > > Um, this is a bit architecture specific (I know Azure is x86, but
> > > still).  Can you make the define check CONFIG_32BIT rather than
> > > CONFIG_X86_32?
> >
> > According to arch/x86/Kconfig there is no such thing.
> 
> What is the status of this change? Looks like there is nothing more to
> do on my side.

Olaf,

We do have the config option: CONFIG_X86_64. Perhaps we could use this.
Could you resubmit the patch with this change.

Regards,

K. Y

 
> 
> Olaf


[Bug 111381] mvsas 0.8.16 on Marvell 88SE9485 reports timeouts on load

2016-01-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=111381

--- Comment #2 from Gabriel A. Devenyi  ---
After a check and reseat of all cables, now getting this in dmesg:
[ 4386.920825] sd 3:0:4:0: [sdn] tag#0 FAILED Result: hostbyte=DID_OK
driverbyte=DRIVER_SENSE
[ 4386.920834] sd 3:0:4:0: [sdn] tag#0 Sense Key : Aborted Command [current] [
4386.920841] sd 3:0:4:0: [sdn] tag#0 ASC=0x4b ASCQ=0x20
[ 4386.920847] sd 3:0:4:0: [sdn] tag#0 CDB: Read(10) 28 00 33 03 4f bf 00 00 25
00
[ 4386.920852] blk_update_request: I/O error, dev sdn, sector 855855039

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


[PATCH V2 2/2] scsi: storvsc: Use the specified target ID in device lookup

2016-01-27 Thread K. Y. Srinivasan
The current code assumes that there is only one target in device lookup.
Fix this bug. This will alow us to correctly handle hot reomoval of LUNs.

Signed-off-by: K. Y. Srinivasan 
Reviewed-by: Alex Ng 
Tested-by: Vivek Yadav 
---
V2: Made lun and target_id unsigned 8 bit entities - Hannes Reinecke 


 drivers/scsi/storvsc_drv.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 622f64a..132b168 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -478,19 +478,18 @@ struct hv_host_device {
 struct storvsc_scan_work {
struct work_struct work;
struct Scsi_Host *host;
-   uint lun;
+   u8 lun;
+   u8 tgt_id;
 };
 
 static void storvsc_device_scan(struct work_struct *work)
 {
struct storvsc_scan_work *wrk;
-   uint lun;
struct scsi_device *sdev;
 
wrk = container_of(work, struct storvsc_scan_work, work);
-   lun = wrk->lun;
 
-   sdev = scsi_device_lookup(wrk->host, 0, 0, lun);
+   sdev = scsi_device_lookup(wrk->host, 0, wrk->tgt_id, wrk->lun);
if (!sdev)
goto done;
scsi_rescan_device(>sdev_gendev);
@@ -541,7 +540,7 @@ static void storvsc_remove_lun(struct work_struct *work)
if (!scsi_host_get(wrk->host))
goto done;
 
-   sdev = scsi_device_lookup(wrk->host, 0, 0, wrk->lun);
+   sdev = scsi_device_lookup(wrk->host, 0, wrk->tgt_id, wrk->lun);
 
if (sdev) {
scsi_remove_device(sdev);
@@ -941,6 +940,7 @@ static void storvsc_handle_error(struct vmscsi_request 
*vm_srb,
 
wrk->host = host;
wrk->lun = vm_srb->lun;
+   wrk->tgt_id = vm_srb->target_id;
INIT_WORK(>work, process_err_fn);
schedule_work(>work);
 }
-- 
1.7.4.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


[PATCH V2 1/2] scsi: storvsc: Install the storvsc specific timeout handler for FC devices

2016-01-27 Thread K. Y. Srinivasan
The default timeout routine used for FC transport is not
suitable for FC devices managed by storvsc since FC devices
managed by storvsc driver do not have an rport associated
with them. Use the time out handler used for SCSI devices
for FC devices as well.

Signed-off-by: K. Y. Srinivasan 
Reviewed-by: Alex Ng 
Tested-by: Vivek Yadav 
---
 drivers/scsi/storvsc_drv.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 41c115c..622f64a 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /*
  * All wire protocol details (storage protocol between the guest and the host)
@@ -1770,6 +1771,11 @@ static int __init storvsc_drv_init(void)
fc_transport_template = fc_attach_transport(_transport_functions);
if (!fc_transport_template)
return -ENODEV;
+
+   /*
+* Install Hyper-V specific timeout handler.
+*/
+   fc_transport_template->eh_timed_out = storvsc_eh_timed_out;
 #endif
 
ret = vmbus_driver_register(_drv);
-- 
1.7.4.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: [Bug 111381] mvsas 0.8.16 on Marvell 88SE9485 reports timeouts on load

2016-01-27 Thread James Bottomley
On Thu, 2016-01-28 at 00:37 +, bugzilla-dae...@bugzilla.kernel.org
wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=111381
> 
> --- Comment #2 from Gabriel A. Devenyi  ---
> After a check and reseat of all cables, now getting this in dmesg:
> [ 4386.920825] sd 3:0:4:0: [sdn] tag#0 FAILED Result: hostbyte=DID_OK
> driverbyte=DRIVER_SENSE
> [ 4386.920834] sd 3:0:4:0: [sdn] tag#0 Sense Key : Aborted Command
> [current] [
> 4386.920841] sd 3:0:4:0: [sdn] tag#0 ASC=0x4b ASCQ=0x20
> [ 4386.920847] sd 3:0:4:0: [sdn] tag#0 CDB: Read(10) 28 00 33 03 4f
> bf 00 00 25
> 00
> [ 4386.920852] blk_update_request: I/O error, dev sdn, sector 
> 855855039

No idea what the error code is: 0x4b/0x20 isn't defined in my current
standards.  However ASC 0x4b is usually for some type of transmission
error; the Ack/Nak timeout is 0x4b/0x03, so presumably it's still a
cable or transciever problem.

Just reseating the cables might not be enough ... it might take a
replacement if the cable was marginal in the first place and now has
wear.

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


[PATCH V2 0/2] scsi: storvsc: Miscellaneous fixes

2016-01-27 Thread K. Y. Srinivasan
Some miscellaneous fixes.

V2: addressed comments from Hannes Reinecke 

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

 drivers/scsi/storvsc_drv.c |   16 +++-
 1 files changed, 11 insertions(+), 5 deletions(-)

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


[Bug 111381] mvsas 0.8.16 on Marvell 88SE9485 reports timeouts on load

2016-01-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=111381

--- Comment #1 from Gabriel A. Devenyi  ---
Okay, I'll move around the cables and see if the problems move with them.

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


[PATCH V1] scsi update

2016-01-27 Thread Don Brace
This patch is based on Linus's tree

The change is:
 - export sanitize_inquiry_string

Changes from initial upload:
 - Added prototype to scsi_device.h

---

Don Brace (1):
  scsi: export function scsi_scan.c:sanitize_inquiry_string


 drivers/scsi/scsi_scan.c   |   12 +++-
 include/scsi/scsi_device.h |1 +
 2 files changed, 8 insertions(+), 5 deletions(-)

--
Signature
--
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 V1] scsi: export function scsi_scan.c:sanitize_inquiry_string

2016-01-27 Thread Don Brace
The hpsa driver uses this function to cleanup inquiry
data. Our new pqi driver will also use this
function. This function was copied into both drivers.

This patch exports sanitize_inquiry_string so the hpsa
and the pqi drivers can use this function directly.

Hannes recommended the change in review:
https://www.marc.info/?l=linux-scsi=144619249003064=2
that using the existing function in scsi_scan would be
preferrable.

Matthew R. Ochs also recommended the change in review:
https://www.marc.info/?l=linux-scsi=144613827316617=2

Changes from initial upload:
 - Added prototype for sanitize_inquiry_string to scsi_device.h

Suggested-by: Hannes Reinecke 
Suggested-by: Matthew R. Ochs mro...@linux.vnet.ibm.com
Reviewed-by: Kevin Barnett 
Reviewed-by: Justin Lindley 
Reviewed-by: Scott Teel 
Reviewed-by: Hannes Reinecke 
Signed-off-by: Don Brace 
---
 drivers/scsi/scsi_scan.c   |   12 +++-
 include/scsi/scsi_device.h |1 +
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 6a82066..1f02e84 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -518,7 +518,8 @@ void scsi_target_reap(struct scsi_target *starget)
 }
 
 /**
- * sanitize_inquiry_string - remove non-graphical chars from an INQUIRY result 
string
+ * scsi_sanitize_inquiry_string - remove non-graphical chars from an
+ *INQUIRY result string
  * @s: INQUIRY result string to sanitize
  * @len: length of the string
  *
@@ -531,7 +532,7 @@ void scsi_target_reap(struct scsi_target *starget)
  * string terminator, so all the following characters are set to
  * spaces.
  **/
-static void sanitize_inquiry_string(unsigned char *s, int len)
+void scsi_sanitize_inquiry_string(unsigned char *s, int len)
 {
int terminated = 0;
 
@@ -542,6 +543,7 @@ static void sanitize_inquiry_string(unsigned char *s, int 
len)
*s = ' ';
}
 }
+EXPORT_SYMBOL(scsi_sanitize_inquiry_string);
 
 /**
  * scsi_probe_lun - probe a single LUN using a SCSI INQUIRY
@@ -627,9 +629,9 @@ static int scsi_probe_lun(struct scsi_device *sdev, 
unsigned char *inq_result,
}
 
if (result == 0) {
-   sanitize_inquiry_string(_result[8], 8);
-   sanitize_inquiry_string(_result[16], 16);
-   sanitize_inquiry_string(_result[32], 4);
+   scsi_sanitize_inquiry_string(_result[8], 8);
+   scsi_sanitize_inquiry_string(_result[16], 16);
+   scsi_sanitize_inquiry_string(_result[32], 4);
 
response_len = inq_result[4] + 5;
if (response_len > 255)
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index f63a167..9173ab5a 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -397,6 +397,7 @@ extern void scsi_remove_target(struct device *);
 extern const char *scsi_device_state_name(enum scsi_device_state);
 extern int scsi_is_sdev_device(const struct device *);
 extern int scsi_is_target_device(const struct device *);
+extern void scsi_sanitize_inquiry_string(unsigned char *s, int len);
 extern int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
int data_direction, void *buffer, unsigned bufflen,
unsigned char *sense, int timeout, int retries,

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


[mpt3sas driver 05/10] mpt3sas: Make use of additional HighPriority credit message frames for sending SCSI IO's

2016-01-27 Thread Suganath prabu Subaramani
From: Suganath prabu Subramani 

Driver assumes HighPriority credit as part of Global credit. But,
Firmware treats HighPriority credit value and global cedits as two
different values. Changed host queue algorithm to treat global credits and
highPriority credits as two different values.

Signed-off-by: Suganath prabu Subramani 
Signed-off-by: Chaitra P B 
---
 drivers/scsi/mpt3sas/mpt3sas_base.c  |  63 +++---
 drivers/scsi/mpt3sas/mpt3sas_base.h  |  27 ++
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 154 ++-
 3 files changed, 228 insertions(+), 16 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index f59495b..31838d9a 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -775,7 +775,7 @@ mpt3sas_base_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 
msix_index,
 
mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply);
if (mpi_reply && mpi_reply->Function == MPI2_FUNCTION_EVENT_ACK)
-   return 1;
+   return mpt3sas_check_for_pending_internal_cmds(ioc, smid);
 
if (ioc->base_cmds.status == MPT3_CMD_NOT_USED)
return 1;
@@ -806,6 +806,7 @@ _base_async_event(struct MPT3SAS_ADAPTER *ioc, u8 
msix_index, u32 reply)
Mpi2EventNotificationReply_t *mpi_reply;
Mpi2EventAckRequest_t *ack_request;
u16 smid;
+   struct _event_ack_list *delayed_event_ack;
 
mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply);
if (!mpi_reply)
@@ -819,8 +820,18 @@ _base_async_event(struct MPT3SAS_ADAPTER *ioc, u8 
msix_index, u32 reply)
goto out;
smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx);
if (!smid) {
-   pr_err(MPT3SAS_FMT "%s: failed obtaining a smid\n",
-   ioc->name, __func__);
+   delayed_event_ack = kzalloc(sizeof(*delayed_event_ack),
+   GFP_ATOMIC);
+   if (!delayed_event_ack)
+   goto out;
+   INIT_LIST_HEAD(_event_ack->list);
+   delayed_event_ack->Event = mpi_reply->Event;
+   delayed_event_ack->EventContext = mpi_reply->EventContext;
+   list_add_tail(_event_ack->list,
+   >delayed_event_ack_list);
+   dewtprintk(ioc, pr_info(MPT3SAS_FMT
+   "DELAYED: EVENT ACK: event (0x%04x)\n",
+   ioc->name, le16_to_cpu(mpi_reply->Event)));
goto out;
}
 
@@ -3189,20 +3200,35 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER 
*ioc,  int sleep_flag)
}
ioc->shost->sg_tablesize = sg_tablesize;
 
-   ioc->hi_priority_depth = facts->HighPriorityCredit;
-   ioc->internal_depth = ioc->hi_priority_depth + (5);
+   ioc->internal_depth = min_t(int, (facts->HighPriorityCredit + (5)),
+   (facts->RequestCredit / 4));
+   if (ioc->internal_depth < INTERNAL_CMDS_COUNT) {
+   if (facts->RequestCredit <= (INTERNAL_CMDS_COUNT +
+   INTERNAL_SCSIIO_CMDS_COUNT)) {
+   pr_err(MPT3SAS_FMT "IOC doesn't have enough Request \
+   Credits, it has just %d number of credits\n",
+   ioc->name, facts->RequestCredit);
+   return -ENOMEM;
+   }
+   ioc->internal_depth = 10;
+   }
+
+   ioc->hi_priority_depth = ioc->internal_depth - (5);
/* command line tunables  for max controller queue depth */
if (max_queue_depth != -1 && max_queue_depth != 0) {
max_request_credit = min_t(u16, max_queue_depth +
-   ioc->hi_priority_depth + ioc->internal_depth,
-   facts->RequestCredit);
+   ioc->internal_depth, facts->RequestCredit);
if (max_request_credit > MAX_HBA_QUEUE_DEPTH)
max_request_credit =  MAX_HBA_QUEUE_DEPTH;
} else
max_request_credit = min_t(u16, facts->RequestCredit,
MAX_HBA_QUEUE_DEPTH);
 
-   ioc->hba_queue_depth = max_request_credit;
+   /* Firmware maintains additional facts->HighPriorityCredit number of
+* credits for HiPriprity Request messages, so hba queue depth will be
+* sum of max_request_credit and high priority queue depth.
+*/
+   ioc->hba_queue_depth = max_request_credit + ioc->hi_priority_depth;
 
/* request frame size */
ioc->request_sz = facts->IOCRequestFrameSize * 4;
@@ -3249,7 +3275,6 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc,  
int sleep_flag)
ioc->reply_post_queue_depth += 16 -
(ioc->reply_post_queue_depth % 16);
 
-
  

[mpt3sas driver 03/10] mpt3sas: Fix static analyzer(coverity) tool identified defects

2016-01-27 Thread Suganath prabu Subaramani
From: Suganath prabu Subramani 

1.Wrong size of argument is being passed
 The size of struct being passed as an argument to memset func and area of
 memory being pointed by an instance of struct in memset func should be of
 same structure type.
2.Dereference null return value
3.Array compared against '0'
 Check whether value pointed by particular index of an array is null or not
 in "if" statement.

Signed-off-by: Suganath prabu Subramani 
Signed-off-by: Chaitra P B 
---
 drivers/scsi/mpt3sas/mpt3sas_ctl.c   | 3 ++-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 ++--
 drivers/scsi/mpt3sas/mpt3sas_transport.c | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c 
b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
index ef9971e..d872587 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
@@ -401,7 +401,8 @@ mpt3sas_ctl_event_callback(struct MPT3SAS_ADAPTER *ioc, u8 
msix_index,
Mpi2EventNotificationReply_t *mpi_reply;
 
mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply);
-   mpt3sas_ctl_add_to_event_log(ioc, mpi_reply);
+   if (mpi_reply)
+   mpt3sas_ctl_add_to_event_log(ioc, mpi_reply);
return 1;
 }
 
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 0fb4ccd..686a46a 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -2399,7 +2399,7 @@ _scsih_tm_display_info(struct MPT3SAS_ADAPTER *ioc, 
struct scsi_cmnd *scmd)
 (unsigned long long)
 sas_device->enclosure_logical_id,
 sas_device->slot);
-   if (sas_device->connector_name)
+   if (sas_device->connector_name[0] != '\0')
starget_printk(KERN_INFO, starget,
"enclosure level(0x%04x),connector name(%s)\n",
 sas_device->enclosure_level,
@@ -3134,7 +3134,7 @@ _scsih_tm_tr_send(struct MPT3SAS_ADAPTER *ioc, u16 handle)
 " slot(%d)\n", ioc->name, (unsigned long long)
  sas_device->enclosure_logical_id,
  sas_device->slot));
-   if (sas_device->connector_name)
+   if (sas_device->connector_name[0] != '\0')
dewtprintk(ioc, pr_info(MPT3SAS_FMT
 "setting delete flag: enclosure level(0x%04x),"
 " connector name( %s)\n", ioc->name,
diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c 
b/drivers/scsi/mpt3sas/mpt3sas_transport.c
index df08aeb..6a84b82 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_transport.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c
@@ -1600,7 +1600,7 @@ _transport_phy_reset(struct sas_phy *phy, int hard_reset)
SMP_PHY_CONTROL_LINK_RESET);
 
/* handle hba phys */
-   memset(_request, 0, sizeof(Mpi2SasIoUnitControlReply_t));
+   memset(_request, 0, sizeof(Mpi2SasIoUnitControlRequest_t));
mpi_request.Function = MPI2_FUNCTION_SAS_IO_UNIT_CONTROL;
mpi_request.Operation = hard_reset ?
MPI2_SAS_OP_PHY_HARD_RESET : MPI2_SAS_OP_PHY_LINK_RESET;
-- 
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


[mpt3sas driver 09/10] mpt3sas: Fix for Asynchronous completion of timedout IO and task abort of timedout IO.

2016-01-27 Thread Suganath prabu Subaramani
From: Suganath prabu Subramani 

Track msix of each IO and use the same msix for issuing
abort to timed out IO. With this driver will process IO's
reply first followed by TM.

Signed-off-by: Suganath prabu Subramani 
Signed-off-by: Chaitra P B 
---
 drivers/scsi/mpt3sas/mpt3sas_base.c  | 20 +++-
 drivers/scsi/mpt3sas/mpt3sas_base.h  |  5 -
 drivers/scsi/mpt3sas/mpt3sas_ctl.c   |  2 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 12 +---
 4 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 0f623fb..9307269 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -2258,6 +2258,12 @@ mpt3sas_base_get_reply_virt_addr(struct MPT3SAS_ADAPTER 
*ioc, u32 phys_addr)
return ioc->reply + (phys_addr - (u32)ioc->reply_dma);
 }
 
+static inline u8
+_base_get_msix_index(struct MPT3SAS_ADAPTER *ioc)
+{
+   return ioc->cpu_msix_table[raw_smp_processor_id()];
+}
+
 /**
  * mpt3sas_base_get_smid - obtain a free smid from internal queue
  * @ioc: per adapter object
@@ -2318,6 +2324,7 @@ mpt3sas_base_get_smid_scsiio(struct MPT3SAS_ADAPTER *ioc, 
u8 cb_idx,
request->scmd = scmd;
request->cb_idx = cb_idx;
smid = request->smid;
+   request->msix_io = _base_get_msix_index(ioc);
list_del(>tracker_list);
spin_unlock_irqrestore(>scsi_lookup_lock, flags);
return smid;
@@ -2440,12 +2447,6 @@ _base_writeq(__u64 b, volatile void __iomem *addr, 
spinlock_t *writeq_lock)
 }
 #endif
 
-static inline u8
-_base_get_msix_index(struct MPT3SAS_ADAPTER *ioc)
-{
-   return ioc->cpu_msix_table[raw_smp_processor_id()];
-}
-
 /**
  * mpt3sas_base_put_smid_scsi_io - send SCSI_IO request to firmware
  * @ioc: per adapter object
@@ -2499,18 +2500,19 @@ mpt3sas_base_put_smid_fast_path(struct MPT3SAS_ADAPTER 
*ioc, u16 smid,
  * mpt3sas_base_put_smid_hi_priority - send Task Managment request to firmware
  * @ioc: per adapter object
  * @smid: system request message index
- *
+ * @msix_task: msix_task will be same as msix of IO incase of task abort else 
0.
  * Return nothing.
  */
 void
-mpt3sas_base_put_smid_hi_priority(struct MPT3SAS_ADAPTER *ioc, u16 smid)
+mpt3sas_base_put_smid_hi_priority(struct MPT3SAS_ADAPTER *ioc, u16 smid,
+   u16 msix_task)
 {
Mpi2RequestDescriptorUnion_t descriptor;
u64 *request = (u64 *)
 
descriptor.HighPriority.RequestFlags =
MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
-   descriptor.HighPriority.MSIxIndex =  0;
+   descriptor.HighPriority.MSIxIndex =  msix_task;
descriptor.HighPriority.SMID = cpu_to_le16(smid);
descriptor.HighPriority.LMID = 0;
descriptor.HighPriority.Reserved1 = 0;
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h 
b/drivers/scsi/mpt3sas/mpt3sas_base.h
index d1fee34..24bd19a 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -649,6 +649,7 @@ struct chain_tracker {
  * @cb_idx: callback index
  * @direct_io: To indicate whether I/O is direct (WARPDRIVE)
  * @tracker_list: list of free request (ioc->free_list)
+ * @msix_io: IO's msix
  */
 struct scsiio_tracker {
u16 smid;
@@ -657,6 +658,7 @@ struct scsiio_tracker {
u8  direct_io;
struct list_head chain_list;
struct list_head tracker_list;
+   u16 msix_io;
 };
 
 /**
@@ -1245,7 +1247,8 @@ void mpt3sas_base_put_smid_scsi_io(struct MPT3SAS_ADAPTER 
*ioc, u16 smid,
u16 handle);
 void mpt3sas_base_put_smid_fast_path(struct MPT3SAS_ADAPTER *ioc, u16 smid,
u16 handle);
-void mpt3sas_base_put_smid_hi_priority(struct MPT3SAS_ADAPTER *ioc, u16 smid);
+void mpt3sas_base_put_smid_hi_priority(struct MPT3SAS_ADAPTER *ioc,
+   u16 smid, u16 msix_task);
 void mpt3sas_base_put_smid_default(struct MPT3SAS_ADAPTER *ioc, u16 smid);
 void mpt3sas_base_initialize_callback_handler(void);
 u8 mpt3sas_base_register_callback_handler(MPT_CALLBACK cb_func);
diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c 
b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
index d872587..7d00f09 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
@@ -832,7 +832,7 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct 
mpt3_ioctl_command karg,
tm_request->DevHandle));
ioc->build_sg_mpi(ioc, psge, data_out_dma, data_out_sz,
data_in_dma, data_in_sz);
-   mpt3sas_base_put_smid_hi_priority(ioc, smid);
+   mpt3sas_base_put_smid_hi_priority(ioc, smid, 0);
break;
}
case MPI2_FUNCTION_SMP_PASSTHROUGH:
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index b12cada..e0e4920 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ 

[mpt3sas driver 01/10] mpt3sas: Added support for high port count HBA variants.

2016-01-27 Thread Suganath prabu Subaramani
From: Suganath prabu Subramani 

Updated hardware description headers with MPI v2.6 and mpt3sas_pci_table[]
with vendor_ids,device_ids of Cutlass and Intruder HBA which has support
for 4 ports

Signed-off-by: Suganath prabu Subramani 
Signed-off-by: Chaitra P B 
---
 drivers/scsi/mpt3sas/mpi/mpi2.h  |  78 +++---
 drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h | 124 +++
 drivers/scsi/mpt3sas/mpi/mpi2_init.h |  21 --
 drivers/scsi/mpt3sas/mpi/mpi2_ioc.h  | 117 ++---
 drivers/scsi/mpt3sas/mpi/mpi2_raid.h |   5 +-
 drivers/scsi/mpt3sas/mpi/mpi2_sas.h  |  10 ++-
 drivers/scsi/mpt3sas/mpi/mpi2_tool.h |   5 +-
 drivers/scsi/mpt3sas/mpi/mpi2_type.h |   5 +-
 drivers/scsi/mpt3sas/mpt3sas_base.c  |   5 ++
 drivers/scsi/mpt3sas/mpt3sas_ctl.c   |  32 +++--
 drivers/scsi/mpt3sas/mpt3sas_scsih.c |  80 ++
 11 files changed, 423 insertions(+), 59 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpi/mpi2.h b/drivers/scsi/mpt3sas/mpi/mpi2.h
index ec27ad2..367e6ac 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2014 LSI Corporation.
+ * Copyright 2000-2015 Avago Technologies.  All rights reserved.
  *
  *
  *  Name:  mpi2.h
@@ -8,7 +8,7 @@
  * scatter/gather formats.
  * Creation Date:  June 21, 2006
  *
- * mpi2.h Version:  02.00.35
+ * mpi2.h Version:  02.00.37
  *
  * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
  *   prefix are for use only on MPI v2.5 products, and must not be used
@@ -92,6 +92,12 @@
  * 12-05-13  02.00.33  Bumped MPI2_HEADER_VERSION_UNIT.
  * 01-08-14  02.00.34  Bumped MPI2_HEADER_VERSION_UNIT
  * 06-13-14  02.00.35  Bumped MPI2_HEADER_VERSION_UNIT.
+ * 11-18-14  02.00.36  Updated copyright information.
+ * Bumped MPI2_HEADER_VERSION_UNIT.
+ * 03-xx-15  02.00.37  Bumped MPI2_HEADER_VERSION_UNIT.
+ * Added Scratchpad registers to
+ * MPI2_SYSTEM_INTERFACE_REGS.
+ * Added MPI2_DIAG_SBR_RELOAD.
  * --
  */
 
@@ -124,6 +130,12 @@
MPI25_VERSION_MINOR)
 #define MPI2_VERSION_02_05  (0x0205)
 
+/*minor version for MPI v2.6 compatible products */
+#define MPI26_VERSION_MINOR(0x06)
+#define MPI26_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) | \
+   MPI26_VERSION_MINOR)
+#define MPI2_VERSION_02_06 (0x0206)
+
 /*Unit and Dev versioning for this MPI header set */
 #define MPI2_HEADER_VERSION_UNIT(0x23)
 #define MPI2_HEADER_VERSION_DEV (0x00)
@@ -179,10 +191,12 @@ typedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS {
U32 HCBSize;/*0x74 */
U32 HCBAddressLow;  /*0x78 */
U32 HCBAddressHigh; /*0x7C */
-   U32 Reserved6[16];  /*0x80 */
+   U32 Reserved6[12];  /*0x80 */
+   U32 Scratchpad[4];  /*0xB0 */
U32 RequestDescriptorPostLow;   /*0xC0 */
U32 RequestDescriptorPostHigh;  /*0xC4 */
-   U32 Reserved7[14];  /*0xC8 */
+   U32 AtomicRequestDescriptorPost;/*0xC8 */
+   U32 Reserved7[13];  /*0xCC */
 } MPI2_SYSTEM_INTERFACE_REGS,
*PTR_MPI2_SYSTEM_INTERFACE_REGS,
Mpi2SystemInterfaceRegs_t,
@@ -224,6 +238,8 @@ typedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS {
  */
 #define MPI2_HOST_DIAGNOSTIC_OFFSET (0x0008)
 
+#define MPI2_DIAG_SBR_RELOAD(0x2000)
+
 #define MPI2_DIAG_BOOT_DEVICE_SELECT_MASK   (0x1800)
 #define MPI2_DIAG_BOOT_DEVICE_SELECT_DEFAULT(0x)
 #define MPI2_DIAG_BOOT_DEVICE_SELECT_HCDW   (0x0800)
@@ -298,10 +314,19 @@ typedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS {
 #define MPI2_HCB_ADDRESS_HIGH_OFFSET(0x007C)
 
 /*
- *Offsets for the Request Queue
+ *Offsets for the Scratchpad registers
+ */
+#define MPI26_SCRATCHPAD0_OFFSET(0x00B0)
+#define MPI26_SCRATCHPAD1_OFFSET(0x00B4)
+#define MPI26_SCRATCHPAD2_OFFSET(0x00B8)
+#define MPI26_SCRATCHPAD3_OFFSET(0x00BC)
+
+/*
+ *Offsets for the Request Descriptor Post Queue
  */
 #define MPI2_REQUEST_DESCRIPTOR_POST_LOW_OFFSET (0x00C0)
 #define MPI2_REQUEST_DESCRIPTOR_POST_HIGH_OFFSET(0x00C4)
+#define MPI26_ATOMIC_REQUEST_DESCRIPTOR_POST_OFFSET (0x00C8)
 
 /*Hard Reset delay timings */
 #define MPI2_HARD_RESET_PCIE_FIRST_READ_DELAY_MICRO_SEC (5)
@@ -329,7 +354,8 @@ typedef struct _MPI2_DEFAULT_REQUEST_DESCRIPTOR {
*pMpi2DefaultRequestDescriptor_t;
 
 /*defines for the RequestFlags field */
-#define 

[mpt3sas driver 04/10] mpt3sas: Never block the Enclosure device

2016-01-27 Thread Suganath prabu Subaramani
From: Suganath prabu Subramani 

Never block the SEP device (i.e. Never invoke the
scsi_internal_device_block() API for SEP device) even for the delay not
responding events. Blocking the SEP device will create a deadlock while
adding any device to the OS.

Signed-off-by: Suganath prabu Subramani 
Signed-off-by: Chaitra P B 
---
 drivers/scsi/mpt3sas/mpt3sas_base.h  |  1 +
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 22 +-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h 
b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 5ad271e..2786222 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -398,6 +398,7 @@ struct MPT3SAS_DEVICE {
u8  configured_lun;
u8  block;
u8  tlr_snoop_check;
+   u8  ignore_delay_remove;
 };
 
 #define MPT3_CMD_NOT_USED  0x8000  /* free */
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 686a46a..dcb4c18 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -1953,7 +1953,15 @@ scsih_slave_configure(struct scsi_device *sdev)
if (sas_device->device_info & MPI2_SAS_DEVICE_INFO_SSP_TARGET) {
qdepth = MPT3SAS_SAS_QUEUE_DEPTH;
ssp_target = 1;
-   ds = "SSP";
+   if (sas_device->device_info &
+   MPI2_SAS_DEVICE_INFO_SEP) {
+   sdev_printk(KERN_WARNING, sdev,
+   "set ignore_delay_remove for handle(0x%04x)\n",
+   sas_device_priv_data->sas_target->handle);
+   sas_device_priv_data->ignore_delay_remove = 1;
+   ds = "SES";
+   } else
+   ds = "SSP";
} else {
qdepth = MPT3SAS_SATA_QUEUE_DEPTH;
if (sas_device->device_info & MPI2_SAS_DEVICE_INFO_STP_TARGET)
@@ -2943,6 +2951,12 @@ _scsih_block_io_all_device(struct MPT3SAS_ADAPTER *ioc)
continue;
if (sas_device_priv_data->block)
continue;
+   if (sas_device_priv_data->ignore_delay_remove) {
+   sdev_printk(KERN_INFO, sdev,
+   "%s skip device_block for SES handle(0x%04x)\n",
+   __func__, sas_device_priv_data->sas_target->handle);
+   continue;
+   }
_scsih_internal_device_block(sdev, sas_device_priv_data);
}
 }
@@ -2975,6 +2989,12 @@ _scsih_block_io_device(struct MPT3SAS_ADAPTER *ioc, u16 
handle)
continue;
if (sas_device->pend_sas_rphy_add)
continue;
+   if (sas_device_priv_data->ignore_delay_remove) {
+   sdev_printk(KERN_INFO, sdev,
+   "%s skip device_block for SES handle(0x%04x)\n",
+   __func__, sas_device_priv_data->sas_target->handle);
+   continue;
+   }
_scsih_internal_device_block(sdev, sas_device_priv_data);
}
 
-- 
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


[mpt3sas driver 02/10] mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP Passthrough request message.

2016-01-27 Thread Suganath prabu Subaramani
From: Suganath prabu Subramani 

As driver was using MPI SGL while framing the SMP Passthrough request
message due to which firmware unable to post the Reply Data in the host
memory and timeout is observed for this SMP Passthrough request message
and so unable to perform phy disable operation.

Signed-off-by: Suganath prabu Subramani 
Signed-off-by: Chaitra P B 
---
 drivers/scsi/mpt3sas/mpt3sas_transport.c | 23 ---
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c 
b/drivers/scsi/mpt3sas/mpt3sas_transport.c
index ca36d7e..df08aeb 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_transport.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c
@@ -1418,7 +1418,6 @@ _transport_expander_phy_control(struct MPT3SAS_ADAPTER 
*ioc,
u32 ioc_state;
unsigned long timeleft;
void *psge;
-   u32 sgl_flags;
u8 issue_reset = 0;
void *data_out = NULL;
dma_addr_t data_out_dma;
@@ -1507,24 +1506,10 @@ _transport_expander_phy_control(struct MPT3SAS_ADAPTER 
*ioc,
cpu_to_le16(sizeof(struct phy_error_log_request));
psge = _request->SGL;
 
-   /* WRITE sgel first */
-   sgl_flags = (MPI2_SGE_FLAGS_SIMPLE_ELEMENT |
-   MPI2_SGE_FLAGS_END_OF_BUFFER | MPI2_SGE_FLAGS_HOST_TO_IOC);
-   sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT;
-   ioc->base_add_sg_single(psge, sgl_flags |
-   sizeof(struct phy_control_request), data_out_dma);
-
-   /* incr sgel */
-   psge += ioc->sge_size;
-
-   /* READ sgel last */
-   sgl_flags = (MPI2_SGE_FLAGS_SIMPLE_ELEMENT |
-   MPI2_SGE_FLAGS_LAST_ELEMENT | MPI2_SGE_FLAGS_END_OF_BUFFER |
-   MPI2_SGE_FLAGS_END_OF_LIST);
-   sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT;
-   ioc->base_add_sg_single(psge, sgl_flags |
-   sizeof(struct phy_control_reply), data_out_dma +
-   sizeof(struct phy_control_request));
+   ioc->build_sg(ioc, psge, data_out_dma,
+   sizeof(struct phy_control_request),
+   data_out_dma + sizeof(struct phy_control_request),
+   sizeof(struct phy_control_reply));
 
dtransportprintk(ioc, pr_info(MPT3SAS_FMT
"phy_control - send to sas_addr(0x%016llx), phy(%d), 
opcode(%d)\n",
-- 
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] storvsc: use small sg_tablesize on x86

2016-01-27 Thread James Bottomley
On Wed, 2016-01-27 at 23:09 +, KY Srinivasan wrote:
> 
> > -Original Message-
> > From: Olaf Hering [mailto:o...@aepfle.de]
> > Sent: Monday, January 25, 2016 12:35 AM
> > To: James Bottomley 
> > Cc: KY Srinivasan ; Haiyang Zhang
> > ; linux-ker...@vger.kernel.org; linux-
> > s...@vger.kernel.org
> > Subject: Re: [PATCH] storvsc: use small sg_tablesize on x86
> > 
> > On Fri, Oct 02, Olaf Hering wrote:
> > 
> > > On Thu, Oct 01, James Bottomley wrote:
> > > 
> > > > On Thu, 2015-10-01 at 20:30 +, KY Srinivasan wrote:
> > > 
> > > > > > +#if defined(CONFIG_X86_32)
> > > 
> > > > Um, this is a bit architecture specific (I know Azure is x86,
> > > > but
> > > > still).  Can you make the define check CONFIG_32BIT rather than
> > > > CONFIG_X86_32?
> > > 
> > > According to arch/x86/Kconfig there is no such thing.
> > 
> > What is the status of this change? Looks like there is nothing more 
> > to do on my side.
> 
> Olaf,
> 
> We do have the config option: CONFIG_X86_64. Perhaps we could use 
> this. Could you resubmit the patch with this change.

It's not really architecture independent, is it?  Just use the bit
width config.

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: [PATCH 1/1] scsi: storvsc: Fix a build issue reported by kbuild test robot

2016-01-27 Thread James Bottomley
On Wed, 2016-01-27 at 23:29 -0800, K. Y. Srinivasan wrote:
> tree:   https://na01.safelinks.protection.outlook.com/?url=https%3a%2
> f%2fgit.kernel.org%2fpub%2fscm%2flinux%2fkernel%2fgit%2ftorvalds%2fli
> nux.git=01%7c01%7ckys%40microsoft.com%7ce2e0622715844b79ad7108d3
> 2796ec3c%7c72f988bf86f141af91ab2d7cd011db47%7c1=ubr4GbBaNS%2ftO
> z%2buJBk0CL9N0UNG9x2TidLgy6Yovg4%3d master
> head:   03c21cb775a313f1ff19be59c5d02df3e3526471
> commit: dac582417bc449b1f7f572d3f1dd9d23eec15cc9 storvsc: Properly
> support Fibre Channel devices
> date:   3 weeks ago
> config: x86_64-randconfig-s3-01281016 (attached as .config)
> reproduce:
> git checkout dac582417bc449b1f7f572d3f1dd9d23eec15cc9
> # save the attached .config to linux build tree
> make ARCH=x86_64
> 
> All errors (new ones prefixed by >>):
> 
>drivers/built-in.o: In function `storvsc_remove':
> > > storvsc_drv.c:(.text+0x213af7): undefined reference to
> > > `fc_remove_host'
>drivers/built-in.o: In function `storvsc_drv_init':
> > > storvsc_drv.c:(.init.text+0xcbcc): undefined reference to
> > > `fc_attach_transport'
> > > storvsc_drv.c:(.init.text+0xcc06): undefined reference to
> > > `fc_release_transport'
>drivers/built-in.o: In function `storvsc_drv_exit':
> > > storvsc_drv.c:(.exit.text+0x123c): undefined reference to
> > > `fc_release_transport'
> 
> With this commit, the storvsc driver depends on FC atttributes. Make
> this
> dependency explicit.
> 
> Signed-off-by: K. Y. Srinivasan 
> Reported-by: Fengguang Wu 
> ---
>  drivers/scsi/Kconfig |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
> index 64eed87..24365c3 100644
> --- a/drivers/scsi/Kconfig
> +++ b/drivers/scsi/Kconfig
> @@ -594,6 +594,7 @@ config XEN_SCSI_FRONTEND
>  config HYPERV_STORAGE
>   tristate "Microsoft Hyper-V virtual storage driver"
>   depends on SCSI && HYPERV
> + depends on SCSI_FC_ATTRS
>   default HYPERV
>   help
> Select this option to enable the Hyper-V virtual storage
> driver.

OK, so I thought Hannes requested that you not make the hyperv driver
depend on the FC attrs and you said you would ... has this changed?

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


[mpt3sas driver 10/10] mpt3sas: Updating mpt3sas driver version to 12.100.00.00

2016-01-27 Thread Suganath prabu Subaramani
From: Suganath prabu Subramani 

Bump mpt3sas driver version from 09.102.00.00 to 12.100.00.00

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

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h 
b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 24bd19a..32580b5 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -73,9 +73,9 @@
 #define MPT3SAS_DRIVER_NAME"mpt3sas"
 #define MPT3SAS_AUTHOR "Avago Technologies "
 #define MPT3SAS_DESCRIPTION"LSI MPT Fusion SAS 3.0 Device Driver"
-#define MPT3SAS_DRIVER_VERSION "09.102.00.00"
-#define MPT3SAS_MAJOR_VERSION  9
-#define MPT3SAS_MINOR_VERSION  102
+#define MPT3SAS_DRIVER_VERSION "12.100.00.00"
+#define MPT3SAS_MAJOR_VERSION  12
+#define MPT3SAS_MINOR_VERSION  100
 #define MPT3SAS_BUILD_VERSION  0
 #define MPT3SAS_RELEASE_VERSION00
 
-- 
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


[mpt3sas driver 08/10] mpt3sas: Updated MPI Header to 2.00.42

2016-01-27 Thread Suganath prabu Subaramani
From: Suganath prabu Subramani 

Updated MPI version and MPI header files.

Signed-off-by: Suganath prabu Subramani 
Signed-off-by: Chaitra P B 
---
 drivers/scsi/mpt3sas/mpi/mpi2.h  | 8 +---
 drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h | 7 +--
 drivers/scsi/mpt3sas/mpi/mpi2_init.h | 3 ++-
 drivers/scsi/mpt3sas/mpi/mpi2_ioc.h  | 2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_sas.h  | 2 +-
 5 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpi/mpi2.h b/drivers/scsi/mpt3sas/mpi/mpi2.h
index 367e6ac..dfad5b8 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2.h
@@ -8,7 +8,7 @@
  * scatter/gather formats.
  * Creation Date:  June 21, 2006
  *
- * mpi2.h Version:  02.00.37
+ * mpi2.h Version:  02.00.39
  *
  * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
  *   prefix are for use only on MPI v2.5 products, and must not be used
@@ -94,10 +94,12 @@
  * 06-13-14  02.00.35  Bumped MPI2_HEADER_VERSION_UNIT.
  * 11-18-14  02.00.36  Updated copyright information.
  * Bumped MPI2_HEADER_VERSION_UNIT.
- * 03-xx-15  02.00.37  Bumped MPI2_HEADER_VERSION_UNIT.
+ * 03-16-15  02.00.37  Bumped MPI2_HEADER_VERSION_UNIT.
  * Added Scratchpad registers to
  * MPI2_SYSTEM_INTERFACE_REGS.
  * Added MPI2_DIAG_SBR_RELOAD.
+ * 03-19-15  02.00.38  Bumped MPI2_HEADER_VERSION_UNIT.
+ * 05-25-15  02.00.39  Bumped MPI2_HEADER_VERSION_UNIT.
  * --
  */
 
@@ -137,7 +139,7 @@
 #define MPI2_VERSION_02_06 (0x0206)
 
 /*Unit and Dev versioning for this MPI header set */
-#define MPI2_HEADER_VERSION_UNIT(0x23)
+#define MPI2_HEADER_VERSION_UNIT(0x27)
 #define MPI2_HEADER_VERSION_DEV (0x00)
 #define MPI2_HEADER_VERSION_UNIT_MASK   (0xFF00)
 #define MPI2_HEADER_VERSION_UNIT_SHIFT  (8)
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
index 43a6fe9..9cf09bf 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
@@ -6,7 +6,7 @@
  * Title:  MPI Configuration messages and pages
  * Creation Date:  November 10, 2006
  *
- *   mpi2_cnfg.h Version:  02.00.31
+ *   mpi2_cnfg.h Version:  02.00.33
  *
  * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
  *   prefix are for use only on MPI v2.5 products, and must not be used
@@ -182,8 +182,10 @@
  * 11-18-14  02.00.30  Updated copyright information.
  * Added MPI2_BIOSPAGE1_OPTIONS_ADVANCED_CONFIG.
  * Added AdapterOrderAux fields to BIOS Page 3.
- * 03-xx-15  02.00.31  Updated for MPI v2.6.
+ * 03-16-15  02.00.31  Updated for MPI v2.6.
  * Added new SAS Phy Event codes
+ * 05-25-15  02.00.33  Added more defines for the BiosOptions field of
+ * MPI2_CONFIG_PAGE_BIOS_1.
  * --
  */
 
@@ -1412,6 +1414,7 @@ typedef struct _MPI2_CONFIG_PAGE_BIOS_1 {
 #define MPI2_BIOSPAGE1_PAGEVERSION  (0x07)
 
 /*values for BIOS Page 1 BiosOptions field */
+#define MPI2_BIOSPAGE1_OPTIONS_BOOT_LIST_ADD_ALT_BOOT_DEVICE(0x8000)
 #define MPI2_BIOSPAGE1_OPTIONS_ADVANCED_CONFIG  (0x4000)
 
 #define MPI2_BIOSPAGE1_OPTIONS_PNS_MASK (0x3800)
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_init.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_init.h
index 4916699..c38f624 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_init.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_init.h
@@ -47,7 +47,8 @@
  * 04-09-13  02.00.15  Added SCSIStatusQualifier field to MPI2_SCSI_IO_REPLY,
  * replacing the Reserved4 field.
  * 11-18-14  02.00.16  Updated copyright information.
- * 03-xx-15  02.00.17  Updated for MPI v2.6.
+ * 03-16-15  02.00.17  Updated for MPI v2.6.
+ * Added MPI26_SCSIIO_IOFLAGS_ESCAPE_PASSTHROUGH.
  * Added MPI2_SEP_REQ_SLOTSTATUS_DEV_OFF and
  * MPI2_SEP_REPLY_SLOTSTATUS_DEV_OFF.
  * --
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
index 26e1ba4..cf510ed 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
@@ -134,7 +134,7 @@
  * Added Encrypted Hash Extended Image.
  * 12-05-13  02.00.24  Added MPI25_HASH_IMAGE_TYPE_BIOS.
  * 11-18-14  02.00.25  Updated copyright information.
- * 03-xx-15  02.00.26  Added MPI26_FW_HEADER_PID_FAMILY_3324_SAS and
+ * 03-16-15  02.00.26  Added MPI26_FW_HEADER_PID_FAMILY_3324_SAS and
  * 

[mpt3sas driver 06/10] mpt3sas: Added smp_affinity_enable module parameter.

2016-01-27 Thread Suganath prabu Subaramani
From: Suganath prabu Subramani 

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 | 34 +++---
 1 file changed, 23 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 31838d9a..a1a3b39 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, >reply_queue_list, list) {
list_del(_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,11 @@ _base_request_irq(struct MPT3SAS_ADAPTER *ioc, u8 index, 
u32 vector)
reply_q->msix_index = index;
reply_q->vector = vector;
 
-   if (!alloc_cpumask_var(_q->affinity_hint, GFP_KERNEL))
-   return -ENOMEM;
-   cpumask_clear(reply_q->affinity_hint);
+   if (smp_affinity_enable) {
+   if (!alloc_cpumask_var(_q->affinity_hint, GFP_KERNEL))
+   return -ENOMEM;
+   cpumask_clear(reply_q->affinity_hint);
+   }
 
atomic_set(_q->busy, 0);
if (ioc->msix_enable)
@@ -1909,16 +1917,17 @@ _base_assign_reply_queues(struct MPT3SAS_ADAPTER *ioc)
 
for (i = 0 ; i < group ; i++) {
ioc->cpu_msix_table[cpu] = index;
-   cpumask_or(reply_q->affinity_hint,
+   if (smp_affinity_enable)
+   cpumask_or(reply_q->affinity_hint,
   reply_q->affinity_hint, get_cpu_mask(cpu));
cpu = cpumask_next(cpu, cpu_online_mask);
}
-
-   if (irq_set_affinity_hint(reply_q->vector,
+   if (smp_affinity_enable)
+   if (irq_set_affinity_hint(reply_q->vector,
   reply_q->affinity_hint))
-   dinitprintk(ioc, pr_info(MPT3SAS_FMT
-   "error setting affinity hint for irq vector %d\n",
-   ioc->name, reply_q->vector));
+   dinitprintk(ioc, pr_info(MPT3SAS_FMT
+"Err setting affinity hint to irq vector %d\n",
+ioc->name, reply_q->vector));
index++;
}
 }
@@ -1976,6 +1985,9 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
} else if (max_msix_vectors == 0)
goto try_ioapic;
 
+   if (ioc->msix_vector_count < ioc->cpu_count)
+   smp_affinity_enable = 0;
+
entries = kcalloc(ioc->reply_queue_count, sizeof(struct msix_entry),
GFP_KERNEL);
if (!entries) {
-- 
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: [LSF/MM TOPIC] LIO/SCST Merger

2016-01-27 Thread Nicholas A. Bellinger
On Wed, 2016-01-27 at 09:54 -0800, Bart Van Assche wrote:
> Last year, during the 2015 LSF/MM summit, it has been decided that the 
> LIO/SCST merger project should proceed by sending the functionality 
> upstream that is present in SCST but not yet in LIO. This will help to 
> reduce the workload of target driver maintainers that maintain a version 
> of their target driver for both LIO and SCST (QLogic FC and FCoE target 
> drivers, Emulex FC and FCoE target drivers, RDMA iSER target driver, 
> RDMA SRP target driver, ...). My proposal is to organize a session 
> during which the following is discussed:
> * Which patches are already upstream in the context of the LIO/SCST 
> merger project.
> * About which patches there is agreement but that are not yet upstream.
> * To discuss how to proceed from here and what to address first.

No, just no.  If you've not been able to articulate the specifics of
what you're talking about to the list by now, it's never going to
happen.

You'll recall last year how things unfolded at LSF.  You started
comparing data structure TMR member names of no consequence to a larger
LSF audience, and quickly tried to pivot into a discussion about adding
hooks to LIO fabric drivers for your own out-of-tree nastiness.

I really fail to see how that helps LIO or upstream.  To repeat.  I'll
not allow SCST's out-of-tree legacy requirements to limit LIO's future
in upstream, and if you or your employer is still trying to get
enterprise distros to listen to that nonsense behind the scenes, then
please stop wasting everybody's time.

Bart, I really want to believe you and your employer have good
intentions for LIO.  However, being one of it's largest detractors in
the past means that you have to really put your best foot forward on
your interaction with the LIO community.

However, your inability to ask questions before acting, refusing to
answer to all feedback on reviews for changes of substance, and not
following the expected patch review progress without repeatably leading
yourself and others down the wrong path really makes me start to
question your intentions, or at least your abilities as a kernel
contributor.

Also, you've not managed to merge any of the outstanding ib_srpt fixes
from the last year, which brings us to a grad total of 6 small patches
since the original merge of ib_srpt in Oct 2011.

# git log --author=Bart --oneline -- drivers/infiniband/ulp/srpt/
19f5729 IB/srpt: Fix the RDMA completion handlers
ba92999 target: Minimize SCSI header #include directives
2fe6e72 ib_srpt: Remove set-but-not-used variables
649ee05 target: Move task tag into struct se_cmd + support 64-bit tags
afc1660 target: Remove first argument of target_{get,put}_sess_cmd()
ab477c1 srp-target: Retry when QP creation fails with ENOMEM

That's really a terrible record.

So until you're able to demonstrate publicly to me and the LIO community
that you do have good intentions, and not trying to rehash the same
tired old nonsense and willful ignorance, please stop throwing out these
generic topics as a branding exercise.

There are much more interesting and important topics at LSF to discuss.

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


[mpt3sas driver patches 00/10] mpt3sas driver enhancements and

2016-01-27 Thread Suganath prabu Subaramani
From: Suganath prabu Subramani 

Here is the change list:
Posting 10 patches for mpt3sas driver enhancements and few fixes.
  * Updated hardware description headers with MPI v2.6 and
mpt3sas_pci_table[] with vendor_ids,device_ids of Cutlass and
Intruder HBA which has support for 4 ports.
  * Static analyzer(coverity) tool identified defects.
  * Never block the SEP device even for the delay not
responding events. Blocking the SEP device will create a deadlock while
adding any device to the OS.
  * Modified host queue algorithm to treat global credits and
highPriority credits as two different values.
  * Module parameter to enable/disable configuring
affinity hint for msix vector.
  * Added support for configurable Chain Frame Size for
SAS 3.0 HBA'S.
  * Updated MPI version and MPI header files.
  * Fix for Asynchronous completion of timedout IO and task abort
of timedout IO.
  * Updated driver version to 12.100.00.00

Suganath prabu Subramani (10):
  mpt3sas: Added support for high port count HBA variants.
  mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP
Passthrough request message.
  mpt3sas: Fix static analyzer(coverity) tool identified defects
  mpt3sas: Never block the Enclosure device
  mpt3sas: Make use of additional HighPriority credit message frames for
sending SCSI IO's
  mpt3sas: Added smp_affinity_enable module parameter.
  mpt3sas: Add support for configurable Chain Frame Size
  mpt3sas: Updated MPI Header to 2.00.42
  mpt3sas: Fix for Asynchronous completion of timedout IO and task abort
of timedout IO.
  mpt3sas: Updating mpt3sas driver version to 12.100.00.00

 drivers/scsi/mpt3sas/mpi/mpi2.h  |  82 +-
 drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h | 127 +--
 drivers/scsi/mpt3sas/mpi/mpi2_init.h |  22 ++-
 drivers/scsi/mpt3sas/mpi/mpi2_ioc.h  | 117 -
 drivers/scsi/mpt3sas/mpi/mpi2_raid.h |   5 +-
 drivers/scsi/mpt3sas/mpi/mpi2_sas.h  |  10 +-
 drivers/scsi/mpt3sas/mpi/mpi2_tool.h |   5 +-
 drivers/scsi/mpt3sas/mpi/mpi2_type.h |   5 +-
 drivers/scsi/mpt3sas/mpt3sas_base.c  | 149 -
 drivers/scsi/mpt3sas/mpt3sas_base.h  |  47 +-
 drivers/scsi/mpt3sas/mpt3sas_ctl.c   |  37 -
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 272 ---
 drivers/scsi/mpt3sas/mpt3sas_transport.c |  25 +--
 13 files changed, 769 insertions(+), 134 deletions(-)

Thanks,
Suganath prabu S
-- 
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 01/11] qla2xxx: Remove unneeded link offline message.

2016-01-27 Thread Hannes Reinecke
On 01/26/2016 06:10 PM, Himanshu Madhani wrote:
> From: Chad Dupuis 
> 
> Signed-off-by: Chad Dupuis 
> Signed-off-by: Himanshu Madhani 
> ---
>  drivers/scsi/qla2xxx/qla_dbg.c |1 +
>  drivers/scsi/qla2xxx/qla_isr.c |4 
>  2 files changed, 1 insertions(+), 4 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

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 02/11] qla2xxx: Seed init-cb login timeout from nvram exclusively.

2016-01-27 Thread Hannes Reinecke
On 01/26/2016 06:10 PM, Himanshu Madhani wrote:
> From: Joe Carnuccio 
> 
> Signed-off-by: Joe Carnuccio 
> Signed-off-by: Himanshu Madhani 
> ---
>  drivers/scsi/qla2xxx/qla_init.c |3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

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 v4 00/17] be2iscsi: driver update 11.0.0.0

2016-01-27 Thread Jitendra Bhivare
> -Original Message-
> From: Martin K. Petersen [mailto:martin.peter...@oracle.com]
> Sent: Wednesday, January 27, 2016 7:15 AM
> To: Jitendra Bhivare
> Cc: linux-scsi@vger.kernel.org; micha...@cs.wisc.edu
> Subject: Re: [PATCH v4 00/17] be2iscsi: driver update 11.0.0.0
>
> > "Jitendra" == Jitendra Bhivare 
writes:
>
> Applied to 4.6/scsi-queue.
>
> PATCH 12/17: "be2iscsi: Fix IOPOLL implementation" conflicted with
Christoph's
> irq_poll changes. I fixed it up but please verify:
>
>
http://git.kernel.org/cgit/linux/kernel/git/mkp/scsi.git/commit/?h=4.6/scs
i-
> queue=fa512e1a3156
>
> --
> Martin K. PetersenOracle Linux Engineering
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: [PATCH 04/11] qla2xxx: Add support for online flash update for ISP27XX.

2016-01-27 Thread Hannes Reinecke
On 01/26/2016 06:10 PM, Himanshu Madhani wrote:
> From: Sawan Chandak 
> 
> Signed-off-by: Sawan Chandak 
> Signed-off-by: Himanshu Madhani 
> ---
>  drivers/scsi/qla2xxx/qla_attr.c |   12 -
>  drivers/scsi/qla2xxx/qla_bsg.c  |   80 ++
>  drivers/scsi/qla2xxx/qla_bsg.h  |7 +++
>  drivers/scsi/qla2xxx/qla_dbg.c  |2 +-
>  drivers/scsi/qla2xxx/qla_def.h  |   22 +
>  drivers/scsi/qla2xxx/qla_fw.h   |   10 
>  drivers/scsi/qla2xxx/qla_gbl.h  |1 +
>  drivers/scsi/qla2xxx/qla_init.c |   91 
> +++
>  drivers/scsi/qla2xxx/qla_sup.c  |   47 +++-
>  9 files changed, 266 insertions(+), 6 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

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 03/11] qla2xxx: Allow fw to hold status before sending ABTS response.

2016-01-27 Thread Hannes Reinecke
On 01/26/2016 06:10 PM, Himanshu Madhani wrote:
> Set bit 12 of additional firmware options 3 to let firmware
> hold status IOCB until ABTS response is received from Target.
> 
> Signed-off-by: Himanshu Madhani 
> Signed-off-by: Giridhar Malavali 
> ---
>  drivers/scsi/qla2xxx/qla_gbl.h  |1 +
>  drivers/scsi/qla2xxx/qla_init.c |   11 ++-
>  drivers/scsi/qla2xxx/qla_os.c   |7 +++
>  3 files changed, 18 insertions(+), 1 deletions(-)
> 
:-)
We would have needed that earlier...

Begs the question what happens if you do _not_ receive an ABTS
response; will the iocb freed eventually?

Other than that:

Reviewed-by: Hannes Reinecke 

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


[PATCH 6/7] scsi: aha1542: avoid uninitialized variable warnings

2016-01-27 Thread Arnd Bergmann
Gcc incorrectly detects that two variables in aha1542_queuecommand might
be used without an initialization:

scsi/aha1542.c: In function 'aha1542_queuecommand':
scsi/aha1542.c:382:16: error: 'cptr' may be used uninitialized in this function 
[-Werror=maybe-uninitialized]
scsi/aha1542.c:379:11: error: 'sg_count' may be used uninitialized in this 
function [-Werror=maybe-uninitialized]

The only user of these is doing the same check that the assigment
has, so it is actually guaranteed to work. Adding an "else" clause
with a fake initialization shuts up the warning.

Signed-off-by: Arnd Bergmann 
---
 drivers/scsi/aha1542.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 5b8b2937a3fe..7db448ec8beb 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -403,6 +403,9 @@ static int aha1542_queuecommand(struct Scsi_Host *sh, 
struct scsi_cmnd *cmd)
cptr = kmalloc(sizeof(*cptr) * sg_count, GFP_KERNEL | GFP_DMA);
if (!cptr)
return SCSI_MLQUEUE_HOST_BUSY;
+   } else {
+   sg_count = 0;
+   cptr = NULL;
}
 
/* Use the outgoing mailboxes in a round-robin fashion, because this
-- 
2.7.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


[PATCH 2/7] mptfusion: hide unused seq_mpt_print_ioc_summary function

2016-01-27 Thread Arnd Bergmann
The seq_mpt_print_ioc_summary function is used for the /proc/mpt/iocN/summary
implementation and never gets called when CONFIG_PROC_FS is disabled:

drivers/message/fusion/mptbase.c:6851:13: warning: 'seq_mpt_print_ioc_summary' 
defined but not used [-Wunused-function]
 static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, struct seq_file *m, 
int showlan)

This adds an #ifdef to hide the function definition in that case
and avoid the warning.

Signed-off-by: Arnd Bergmann 
---
 drivers/message/fusion/mptbase.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 5dcc0313c38a..207370d68c17 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -6848,6 +6848,7 @@ mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buffer, int 
*size, int len, int sh
*size = y;
 }
 
+#ifdef CONFIG_PROC_FS
 static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, struct seq_file *m, 
int showlan)
 {
char expVer[32];
@@ -6879,6 +6880,7 @@ static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, 
struct seq_file *m, int
 
seq_putc(m, '\n');
 }
+#endif
 
 /**
  * mpt_set_taskmgmt_in_progress_flag - set flags associated with task 
management
-- 
2.7.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 v3] mptlan: add checks for dma mapping errors

2016-01-27 Thread James Bottomley
On Wed, 2016-01-27 at 17:14 +0100, Tomas Henzl wrote:
> On 27.1.2016 06:44, Sathya Prakash wrote:
> > There is no fusion based network card and resources exists today in
> > Avago(LSI) to test this patch so we prefer to leave it as is. We
> > would
> > like to prevent any new changes on MPT (FC/SCSI/SAS/LAN) drivers as
> > we
> > don't have support for those cards anymore,  is there a way we
> > could
> > remove those drivers from newer kernels or mark them as
> > unmaintained?.
> 
> There still are users of some of those drivers (mptsas for example)
> in certain distributions, so even if in fact they aren't
> directly maintained, we should keep them in mainline.

Agreed: the last gen PA-RISC has a mptspi controller ... they'd get a
bit annoyed if we remove it because they wouldn't be able to update
their build machines to newer kernels.

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


[PATCH 3/7] scsi: acornscsi: mark calc_sync_xfer as __maybe_unused

2016-01-27 Thread Arnd Bergmann
The calc_sync_xfer function is only used if CONFIG_SCSI_ACORNSCSI_SYNC
is set, otherwise we get a compiler warning:

scsi/arm/acornscsi.c:680:15: warning: 'calc_sync_xfer' defined but not used 
[-Wunused-function]
 unsigned char calc_sync_xfer(unsigned int period, unsigned int offset)

This marks the function as __maybe_unused to shut up the
warning and silently drop the function in the object code
when there is no caller.

Signed-off-by: Arnd Bergmann 
---
 drivers/scsi/arm/acornscsi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c
index deaaf84989cd..12b88294d667 100644
--- a/drivers/scsi/arm/acornscsi.c
+++ b/drivers/scsi/arm/acornscsi.c
@@ -677,7 +677,8 @@ int round_period(unsigned int period)
  * Copyright: Copyright (c) 1996 John Shifflett, GeoLog Consulting
  */
 static
-unsigned char calc_sync_xfer(unsigned int period, unsigned int offset)
+unsigned char __maybe_unused calc_sync_xfer(unsigned int period,
+   unsigned int offset)
 {
 return sync_xfer_table[round_period(period)].reg_value |
((offset < SDTR_SIZE) ? offset : SDTR_SIZE);
-- 
2.7.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


[PATCH 5/7] scsi: qla4xxx: shut up warning for rd_reg_indirect

2016-01-27 Thread Arnd Bergmann
The qla4_83xx_rd_reg_indirect() function can fail when it is unable
to read a register, but not all callers check its return value before
using the register data, and gcc correctly warns about this:

qla4xxx/ql4_83xx.c: In function 'qla4_83xx_process_reset_template':
qla4xxx/ql4_83xx.c:1073:36: warning: 'value' may be used uninitialized in this 
function
 ha->reset_tmplt.array[index++] = value;
^
qla4xxx/ql4_83xx.c:1050:11: note: 'value' was declared here
  uint32_t value;
   ^
qla4xxx/ql4_83xx.c:902:8: warning: 'value' may be used uninitialized in this 
function
  value &= p_rmw_hdr->test_mask;
^
qla4xxx/ql4_83xx.c:895:11: note: 'value' was declared here
  uint32_t value;
   ^
In file included from ../include/linux/io.h:25:0,
 from ../include/linux/pci.h:31,
 from ../drivers/scsi/qla4xxx/ql4_def.h:16,
 from ../drivers/scsi/qla4xxx/ql4_83xx.c:10:
asm/io.h:101:2: warning: 'value' may be used uninitialized in this function
  asm volatile("str %1, %0"
  ^
qla4xxx/ql4_83xx.c:874:11: note: 'value' was declared here
  uint32_t value;
   ^

Unfortunately, I don't see any helpful way to add proper error handling
for this case, and the failure scenario for rd_reg seems rather obscure,
so this bails out and makes the rd_reg accessor set the result to 0x
so we at least get a predictable value.

Signed-off-by: Arnd Bergmann 
---
 drivers/scsi/qla4xxx/ql4_83xx.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_83xx.c b/drivers/scsi/qla4xxx/ql4_83xx.c
index 5d4f8e67fb25..638f72c5ab05 100644
--- a/drivers/scsi/qla4xxx/ql4_83xx.c
+++ b/drivers/scsi/qla4xxx/ql4_83xx.c
@@ -46,11 +46,13 @@ int qla4_83xx_rd_reg_indirect(struct scsi_qla_host *ha, 
uint32_t addr,
 
ret_val = qla4_83xx_set_win_base(ha, addr);
 
-   if (ret_val == QLA_SUCCESS)
+   if (ret_val == QLA_SUCCESS) {
*data = qla4_83xx_rd_reg(ha, QLA83XX_WILDCARD);
-   else
+   } else {
+   *data = 0x;
ql4_printk(KERN_ERR, ha, "%s: failed read of addr 0x%x!\n",
   __func__, addr);
+   }
 
return ret_val;
 }
-- 
2.7.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


[PATCH 4/7] scsi: fas216: avoid fas216_log_setup for loadable module

2016-01-27 Thread Arnd Bergmann
We get a warning for the fas216 driver when it is compiled as
a loadable module, as the __setup() functions are never called
then:

scsi/arm/fas216.c:101:19: warning: 'fas216_log_setup' defined but not used 
[-Wunused-function]
 static int __init fas216_log_setup(char *str)

This adds an #ifndef MODULE around the definition to shut up
the warning and clarify for the reader when it is used or not.

Signed-off-by: Arnd Bergmann 
---
 drivers/scsi/arm/fas216.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
index decdc71b6b86..24388795ee9a 100644
--- a/drivers/scsi/arm/fas216.c
+++ b/drivers/scsi/arm/fas216.c
@@ -98,6 +98,7 @@ static int level_mask = LOG_ERROR;
 
 module_param(level_mask, int, 0644);
 
+#ifndef MODULE
 static int __init fas216_log_setup(char *str)
 {
char *s;
@@ -138,6 +139,7 @@ static int __init fas216_log_setup(char *str)
 }
 
 __setup("fas216_logging=", fas216_log_setup);
+#endif
 
 static inline unsigned char fas216_readb(FAS216_Info *info, unsigned int reg)
 {
-- 
2.7.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


[PATCH 0/7] SCSI bug fixes for 4.6

2016-01-27 Thread Arnd Bergmann
Here are a bunch of fixes for harmless bugs I found during ARM
randconfig testing. It would be nice to get them mered in 4.6,
but there is no need to have them in 4.5 as no incorrect behavior
results from the current code, and the warnings are all hard
to trigger.

Arnd Bergmann (7):
  scsi: fdomain: drop fdomain_pci_tbl when built-in
  mptfusion: hide unused seq_mpt_print_ioc_summary function
  scsi: acornscsi: mark calc_sync_xfer as __maybe_unused
  scsi: fas216: avoid fas216_log_setup for loadable module
  scsi: qla4xxx: shut up warning for rd_reg_indirect
  scsi: aha1542: avoid uninitialized variable warnings
  scsi_dh: force modular build if SCSI is a module

 drivers/message/fusion/mptbase.c| 2 ++
 drivers/scsi/aha1542.c  | 3 +++
 drivers/scsi/arm/acornscsi.c| 3 ++-
 drivers/scsi/arm/fas216.c   | 2 ++
 drivers/scsi/device_handler/Kconfig | 8 
 drivers/scsi/fdomain.c  | 2 +-
 drivers/scsi/qla4xxx/ql4_83xx.c | 6 --
 7 files changed, 18 insertions(+), 8 deletions(-)

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


[PATCH 1/7] scsi: fdomain: drop fdomain_pci_tbl when built-in

2016-01-27 Thread Arnd Bergmann
The fdomain SCSI host driver is one of the last remaining
drivers that manually search the PCI bus using pci_get_device
rather than registering a pci_driver instance.

This means the module device table is unused when the driver is
built-in, and we get a warning about it:

drivers/scsi/fdomain.c:1773:29: warning: 'fdomain_pci_tbl' defined but not used 
[-Wunused-variable]

To avoid the warning, this adds another #ifdef around the table
definition.

Signed-off-by: Arnd Bergmann 
---
 drivers/scsi/fdomain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c
index eefe14d453db..b87ab38a4530 100644
--- a/drivers/scsi/fdomain.c
+++ b/drivers/scsi/fdomain.c
@@ -1768,7 +1768,7 @@ struct scsi_host_template fdomain_driver_template = {
 };
 
 #ifndef PCMCIA
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) && defined(MODULE)
 
 static struct pci_device_id fdomain_pci_tbl[] = {
{ PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70,
-- 
2.7.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


[PATCH 7/7] scsi_dh: force modular build if SCSI is a module

2016-01-27 Thread Arnd Bergmann
When the scsi_dh core was moved into the scsi core module,
CONFIG_SCSI_DH became a 'bool' option, and now anything depending
on it can be built-in even when CONFIG_SCSI=m. This of course
cannot link successfully:

drivers/scsi/built-in.o: In function `rdac_init':
scsi_dh_alua.c:(.init.text+0x14): undefined reference to 
`scsi_register_device_handler'
scsi_dh_alua.c:(.init.text+0x64): undefined reference to 
`scsi_unregister_device_handler'
drivers/scsi/built-in.o: In function `alua_init':
scsi_dh_alua.c:(.init.text+0xb0): undefined reference to 
`scsi_register_device_handler'

As a workaround, this adds an extra dependency on CONFIG_SCSI,
so Kconfig can figure out whether built-in is allowed or not.

Signed-off-by: Arnd Bergmann 
Fixes: 086b91d052eb ("scsi_dh: integrate into the core SCSI code")
---
 drivers/scsi/device_handler/Kconfig | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/device_handler/Kconfig 
b/drivers/scsi/device_handler/Kconfig
index e5647d59224f..0b331c9c0a8f 100644
--- a/drivers/scsi/device_handler/Kconfig
+++ b/drivers/scsi/device_handler/Kconfig
@@ -13,13 +13,13 @@ menuconfig SCSI_DH
 
 config SCSI_DH_RDAC
tristate "LSI RDAC Device Handler"
-   depends on SCSI_DH
+   depends on SCSI_DH && SCSI
help
If you have a LSI RDAC select y. Otherwise, say N.
 
 config SCSI_DH_HP_SW
tristate "HP/COMPAQ MSA Device Handler"
-   depends on SCSI_DH
+   depends on SCSI_DH && SCSI
help
If you have a HP/COMPAQ MSA device that requires START_STOP to
be sent to start it and cannot upgrade the firmware then select y.
@@ -27,13 +27,13 @@ config SCSI_DH_HP_SW
 
 config SCSI_DH_EMC
tristate "EMC CLARiiON Device Handler"
-   depends on SCSI_DH
+   depends on SCSI_DH && SCSI
help
If you have a EMC CLARiiON select y. Otherwise, say N.
 
 config SCSI_DH_ALUA
tristate "SPC-3 ALUA Device Handler"
-   depends on SCSI_DH
+   depends on SCSI_DH && SCSI
help
  SCSI Device handler for generic SPC-3 Asymmetric Logical Unit
  Access (ALUA).
-- 
2.7.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 v3] mptlan: add checks for dma mapping errors

2016-01-27 Thread Tomas Henzl
On 27.1.2016 06:44, Sathya Prakash wrote:
> There is no fusion based network card and resources exists today in
> Avago(LSI) to test this patch so we prefer to leave it as is. We would
> like to prevent any new changes on MPT (FC/SCSI/SAS/LAN) drivers as we
> don't have support for those cards anymore,  is there a way we could
> remove those drivers from newer kernels or mark them as unmaintained?.

There still are users of some of those drivers (mptsas for example)
in certain distributions, so even if in fact they aren't
directly maintained, we should keep them in mainline.

Thanks,
Tomas

>
> Thanks
> Sathya
>
> -Original Message-
> From: mpt-fusionlinux@avagotech.com
> [mailto:mpt-fusionlinux@avagotech.com] On Behalf Of Martin K. Petersen
> Sent: Tuesday, January 26, 2016 7:23 PM
> To: Tomas Henzl
> Cc: Alexey Khoroshilov; Sreekanth Reddy;
> mpt-fusionlinux@avagotech.com; linux-scsi@vger.kernel.org;
> linux-ker...@vger.kernel.org; ldv-proj...@linuxtesting.org
> Subject: Re: [PATCH v3] mptlan: add checks for dma mapping errors
>
>> "Tomas" == Tomas Henzl  writes:
> Tomas> Other than that - previous patch for this driver came in in 2010
> Tomas> - six years ago and the driver seems unmaintained now.  I'm not
> Tomas> sure if we should fix hw we can't test and when there is not an
> Tomas> user bug report. This example nicely shows how easy it is to add
> Tomas> new bugs even when a fix looks trivial.
>
> Yeah, I'm inclined to leave it as is.
>
> If somebody provides a Tested-by: I'll reconsider.
>

--
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 10/15] megaraid_sas: IO throttling support

2016-01-27 Thread Sumit Saxena
> -Original Message-
> From: Tomas Henzl [mailto:the...@redhat.com]
> Sent: Tuesday, January 19, 2016 7:08 PM
> To: Sumit Saxena; jbottom...@parallels.com; h...@infradead.org;
> martin.peter...@oracle.com
> Cc: linux-scsi@vger.kernel.org; kashyap.de...@avagotech.com
> Subject: Re: [PATCH 10/15] megaraid_sas: IO throttling support
>
> On 18.12.2015 14:27, Sumit Saxena wrote:
> > This patch will add capability in driver to tell firmware that it can
> > throttle IOs in case Controller's Queue depth is downgraded post OFU
(Online
> firmware upgrade). This feature will ensure firmware can be downgraded
from
> higher queue depth to lower queue depth without needing system reboot.
> > Added throttling code in IO path of driver, in case OS tries to send
more IOs
> than post OFU firmware's queue depth.
> >
> > Signed-off-by: Sumit Saxena 
> > Signed-off-by: Kashyap Desai 
> > ---
> >  drivers/scsi/megaraid/megaraid_sas.h|6 --
> >  drivers/scsi/megaraid/megaraid_sas_fusion.c |7 +++
> >  2 files changed, 11 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/scsi/megaraid/megaraid_sas.h
> > b/drivers/scsi/megaraid/megaraid_sas.h
> > index 4595ef4..9d2b3da 100644
> > --- a/drivers/scsi/megaraid/megaraid_sas.h
> > +++ b/drivers/scsi/megaraid/megaraid_sas.h
> > @@ -1537,7 +1537,8 @@ union megasas_sgl_frame {  typedef union
> > _MFI_CAPABILITIES {
> > struct {
> >  #if   defined(__BIG_ENDIAN_BITFIELD)
> > -   u32 reserved:21;
> > +   u32 reserved:20;
> > +   u32 support_qd_throttling:1;
> > u32 support_fp_rlbypass:1;
> > u32 support_vfid_in_ioframe:1;
> > u32 support_ext_io_size:1;
> > @@ -1561,7 +1562,8 @@ typedef union _MFI_CAPABILITIES {
> > u32 support_ext_io_size:1;
> > u32 support_vfid_in_ioframe:1;
> > u32 support_fp_rlbypass:1;
> > -   u32 reserved:21;
> > +   u32 support_qd_throttling:1;
> > +   u32 reserved:20;
> >  #endif
> > } mfi_capabilities;
> > __le32  reg;
> > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c
> > b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> > index 7cc7806..1248c7a 100644
> > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
> > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> > @@ -801,6 +801,7 @@ megasas_ioc_init_fusion(struct megasas_instance
> *instance)
> > if (!dual_qdepth_disable)
> > drv_ops->mfi_capabilities.support_ext_queue_depth = 1;
> >
> > +   drv_ops->mfi_capabilities.support_qd_throttling = 1;
> > /* Convert capability to LE32 */
> > cpu_to_le32s((u32
> > *)_frame->driver_operations.mfi_capabilities);
> >
> > @@ -2182,6 +2183,12 @@ megasas_build_and_issue_cmd_fusion(struct
> megasas_instance *instance,
> > atomic_inc(>ldio_outstanding);
> > }
> >
> > +   if (atomic_read(>fw_outstanding) >=
> > +   instance->host->can_queue) {
> > +   dev_err(>pdev->dev, "Throttle IOs beyond
Controller
> queue depth\n");
> > +   return SCSI_MLQUEUE_HOST_BUSY;
> > +   }
>
> Same as in the previous patch, this this test above won't you protect
when
> several processes read the same value in parallel. In addition to that,
when the
> scsi layer knows the new smaller can_queue value it will not queue new
> commands above the limit.

Agree that SCSI mid layer itself will not send IOs beyond can_queue value
and we can remove this code. This code was just extra check for older
kernels- if IOs returned to SCSI mid layer by driver with DID_RESET status
does not check updated can_queue value(not sure if it was always taken
care of so added this code).
>
> > +
> > cmd = megasas_get_cmd_fusion(instance, scmd->request->tag);
> >
> > index = cmd->index;
--
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] storvsc: use small sg_tablesize on x86

2016-01-27 Thread Olaf Hering
On Wed, Jan 27, James Bottomley wrote:

> It's not really architecture independent, is it?  Just use the bit
> width config.

Again: which one? This driver is not for mips|powerpc|score|sh.

Olaf
--
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: What partition should the MTMKPART argument specify? Was: Re: st driver doesn't seem to grok LTO partitioning

2016-01-27 Thread Seymour, Shane M
Hi Kai,

With the changes the I get a failure partitioning a HP DAT72 drive (DDS-5):

# ./mt -f /dev/st1 stsetoption debug
# ./mt -f /dev/st1 stsetoption can-partitions
# ./mt -f /dev/st1 mkpartition 1000
/dev/st1: Input/output error

[ 3944.387190] st: Unloaded.
[ 3949.420128] st: Version 20160124, fixed bufsize 32768, s/g segs 256
[ 3949.421167] st 5:0:1:0: Attached scsi tape st0
[ 3949.421169] st 5:0:1:0: st0: try direct i/o: yes (alignment 512 B)
[ 3949.422108] st 6:0:3:0: Attached scsi tape st1
[ 3949.422112] st 6:0:3:0: st1: try direct i/o: yes (alignment 512 B)
[ 3955.866684] st 6:0:3:0: [st1] Block limits 1 - 16777215 bytes.
[ 3955.866992] st 6:0:3:0: [st1] Mode 0 options: buffer writes: 1, async 
writes: 1, read ahead: 1
[ 3955.866996] st 6:0:3:0: [st1] can bsr: 1, two FMs: 0, fast mteom: 0, 
auto lock: 0,
[ 3955.866999] st 6:0:3:0: [st1] defs for wr: 0, no block limits: 0, 
partitions: 0, s2 log: 0
[ 3955.867002] st 6:0:3:0: [st1] sysv: 0 nowait: 0 sili: 0 nowait_filemark:0
[ 3955.867005] st 6:0:3:0: [st1] debugging: 1
[ 3955.867010] st 6:0:3:0: [st1] Rewinding tape.
[ 3961.330913] st 6:0:3:0: [st1] Block limits 1 - 16777215 bytes.
[ 3961.331366] st 6:0:3:0: [st1] Mode sense. Length 11, medium 0, WBS 10, BLL 8
[ 3961.331370] st 6:0:3:0: [st1] Density 47, tape length: 0, drv buffer: 1
[ 3961.331372] st 6:0:3:0: [st1] Block size: 0, buffer size: 4096 (1 blocks).
[ 3961.331384] st 6:0:3:0: [st1] Mode 0 options: buffer writes: 1, async 
writes: 1, read ahead: 1
[ 3961.331386] st 6:0:3:0: [st1] can bsr: 1, two FMs: 0, fast mteom: 0, 
auto lock: 0,
[ 3961.331388] st 6:0:3:0: [st1] defs for wr: 0, no block limits: 0, 
partitions: 1, s2 log: 0
[ 3961.331389] st 6:0:3:0: [st1] sysv: 0 nowait: 0 sili: 0 nowait_filemark: 0
[ 3961.331391] st 6:0:3:0: [st1] debugging: 1
[ 3961.331393] st 6:0:3:0: [st1] Rewinding tape.
[ 3976.387354] st 6:0:3:0: [st1] Block limits 1 - 16777215 bytes.
[ 3976.387651] st 6:0:3:0: [st1] Mode sense. Length 11, medium 0, WBS 10, BLL 8
[ 3976.387653] st 6:0:3:0: [st1] Density 47, tape length: 0, drv buffer: 1
[ 3976.387655] st 6:0:3:0: [st1] Block size: 0, buffer size: 4096 (1 blocks).
[ 3976.387656] st 6:0:3:0: [st1] Updating partition number in status.
[ 3976.388001] st 6:0:3:0: [st1] Got tape pos. blk 0 part 0.
[ 3976.388013] st 6:0:3:0: [st1] Loading tape.
[ 3976.388909] st 6:0:3:0: [st1] Block limits 1 - 16777215 bytes.
[ 3976.389261] st 6:0:3:0: [st1] Mode sense. Length 11, medium 0, WBS 10, BLL 8
[ 3976.389265] st 6:0:3:0: [st1] Density 47, tape length: 0, drv buffer: 1
[ 3976.389269] st 6:0:3:0: [st1] Block size: 0, buffer size: 4096 (1 blocks).
[ 3976.389605] st 6:0:3:0: [st1] Partition page length is 10 bytes.
[ 3976.389610] st 6:0:3:0: [st1] PP: max 1, add 0, xdp 0, psum 02, pofmetc 0, 
rec 03, units 00, sizes: 0 65535
[ 3976.389614] st 6:0:3:0: [st1] MP: 11 08 01 00 10 03 00 00 00 00 ff ff
[ 3976.389618] st 6:0:3:0: [st1] psd_cnt 2, max.parts 1, nbr_parts 0
[ 3976.389620] st 6:0:3:0: [st1] Formatting tape with two partitions (1 = 1000 
MB).
[ 3976.389623] st 6:0:3:0: [st1] Sent partition page length is 12 bytes. 
needs_format: 0
[ 3976.389627] st 6:0:3:0: [st1] PP: max 1, add 1, xdp 1, psum 02, pofmetc 0, 
rec 03, units 00, sizes: 65535 1000
[ 3976.389631] st 6:0:3:0: [st1] MP: 11 0a 01 01 30 03 00 00 ff ff 03 e8
[ 3976.390727] st 6:0:3:0: [st1] Error: 802, cmd: 15 10 0 0 18 0
[ 3976.390731] st 6:0:3:0: [st1] Sense Key : Illegal Request [current]
[ 3976.390734] st 6:0:3:0: [st1] Add. Sense: Invalid field in parameter list
[ 3976.390735] st 6:0:3:0: [st1] Partitioning of tape failed.
[ 3976.390806] st 6:0:3:0: [st1] Rewinding tape.

Using a slightly older kernel to partition the DAT72 drive works (same 3 
commands as above):

[  339.578950] st 6:0:3:0: [st1] Block limits 1 - 16777215 bytes.
[  339.579263] st 6:0:3:0: [st1] Mode 0 options: buffer writes: 1, async 
writes: 1, read ahead: 1
[  339.579266] st 6:0:3:0: [st1] can bsr: 1, two FMs: 0, fast mteom: 0, 
auto lock: 0,
[  339.579268] st 6:0:3:0: [st1] defs for wr: 0, no block limits: 0, 
partitions: 0, s2 log: 0
[  339.579269] st 6:0:3:0: [st1] sysv: 0 nowait: 0 sili: 0 nowait_filemark: 0
[  339.579271] st 6:0:3:0: [st1] debugging: 1
[  339.579275] st 6:0:3:0: [st1] Rewinding tape.
[  345.335252] st 6:0:3:0: [st1] Block limits 1 - 16777215 bytes.
[  345.335556] st 6:0:3:0: [st1] Mode sense. Length 11, medium 0, WBS 10, BLL 8
[  345.335559] st 6:0:3:0: [st1] Density 47, tape length: 0, drv buffer: 1
[  345.335562] st 6:0:3:0: [st1] Block size: 0, buffer size: 4096 (1 blocks).
[  345.335573] st 6:0:3:0: [st1] Mode 0 options: buffer writes: 1, async 
writes: 1, read ahead: 1
[  345.335575] st 6:0:3:0: [st1] can bsr: 1, two FMs: 0, fast mteom: 0, 
auto lock: 0,
[  345.335577] st 6:0:3:0: [st1] defs for wr: 0, no block limits: 0, 
partitions: 1, s2 log: 0
[  345.335579] st 6:0:3:0: [st1] sysv: 0 nowait: 0 sili: 0 nowait_filemark: 0
[  345.335581] st 6:0:3:0: 

Re: [PATCH] add driver for DesignWare UFS Host Controller

2016-01-27 Thread Joao Pinto
Hi!
I am currently working in the implementation of DesignWare Quirks in the
existing UFS core and implementing a glue platform driver.
The project status is the following:

- Synopsys MPHY Test Chip is well configured
- Link is up in Host & Device (validated through the 0xd083 register)
- Additional connection setup are made successfully
- HBA is operational
- NOP_OUT is failing with OCS = 0x7

The OCS value is calculated in ufshcd_get_tr_ocs() in ufshcd.c.
I made a dump of the UTRD pointer where we can check the status = 7 ([2]).

UTRD at: 7007c3e0
@ [0]:2100
@0004 [1]:93936a6a
@0008 [2]:0007
@000c [3]:93936a6a
@0010 [4]:9f317400
@0014 [5]:
@0018 [6]:00800080
@001c [7]:01006a6a

Did anyone have the same problem? Any hints to overcome this issue?

Thank you very much for your help!

Joao

On 1/14/2016 9:58 AM, Joao Pinto wrote:
> Hi,
> 
> On 1/14/2016 2:54 AM, Akinobu Mita wrote:
>> 2016-01-14 3:41 GMT+09:00 Joao Pinto :
>>> I am planning to make some tests with the ufs kernel existing core driver 
>>> in our
>>> setup, but I noticed that despite the scsi/ufs driver package contains a
>>> platform driver, this is not the typical platform driver (glue driver) 
>>> which can
>>> be addressed from device tree. The only one available is the qcom's.
>>> Would I need to submit a designware platform glue driver also as done by 
>>> QCom?
>>
>> Yes.  ufs-pltfrm.c only contains APIs for UFS platform driver since
>> commit 47555a5c8a11a423e6767f942941c745766c99a2 ("scsi: ufs: make the
>> UFS variant a platform device").  Just as you said, you need to add
>> ufs-abc.c as a real platform driver.
> 
> I am going to test the platform I already have and if everything is ok then I
> will submit the patch.
> 
>>
>>> We also need a pci glue driver, but you already have one. In your opinion 
>>> the
>>> best approach is to add synopsys device id to the pci device list in the 
>>> driver
>>> and add quirks or add a new designware pci glue driver?
>>
>> I think you can just add a new device id with vops like this
>>
>> {
>> PCI_DEVICE(PCI_VENDOR_ID_SNPS, PCI_DEVICE_ID_SNPS_HAPS_UFS),
>> .driver_data = (void *)_hba_dwc_vops,
>> },
>>
>> then bind to hba->vops in ufshcd_pci_probe().If there is remaining
>> host controller specific initialization stuff, let vops->init() do that
>> by ufshcd_init().
>>
> 
> Ok, that's what I thought.
> 
> Thanks for the help!
> 
> Joao
> 

--
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 v2 07/11] qla2xxx: Avoid side effects when using endianizer macros.

2016-01-27 Thread Himanshu Madhani
From: Joe Carnuccio 

Signed-off-by: Joe Carnuccio 
Signed-off-by: Himanshu Madhani 
---
 drivers/scsi/qla2xxx/qla_attr.c   |4 +-
 drivers/scsi/qla2xxx/qla_dbg.c|  141 -
 drivers/scsi/qla2xxx/qla_init.c   |   16 ++--
 drivers/scsi/qla2xxx/qla_inline.h |4 +-
 drivers/scsi/qla2xxx/qla_mbx.c|   16 ++--
 drivers/scsi/qla2xxx/qla_sup.c|   23 +++---
 6 files changed, 106 insertions(+), 98 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index fadce04..4dc06a13 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -272,8 +272,8 @@ qla2x00_sysfs_write_nvram(struct file *filp, struct kobject 
*kobj,
 
iter = (uint32_t *)buf;
chksum = 0;
-   for (cnt = 0; cnt < ((count >> 2) - 1); cnt++)
-   chksum += le32_to_cpu(*iter++);
+   for (cnt = 0; cnt < ((count >> 2) - 1); cnt++, iter++)
+   chksum += le32_to_cpu(*iter);
chksum = ~chksum + 1;
*iter = cpu_to_le32(chksum);
} else {
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index aa6694b..b64c504 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -294,8 +294,8 @@ qla24xx_read_window(struct device_reg_24xx __iomem *reg, 
uint32_t iobase,
 
WRT_REG_DWORD(>iobase_addr, iobase);
dmp_reg = >iobase_window;
-   while (count--)
-   *buf++ = htonl(RD_REG_DWORD(dmp_reg++));
+   for ( ; count--; dmp_reg++)
+   *buf++ = htonl(RD_REG_DWORD(dmp_reg));
 
return buf;
 }
@@ -457,8 +457,8 @@ qla2xxx_read_window(struct device_reg_2xxx __iomem *reg, 
uint32_t count,
 {
uint16_t __iomem *dmp_reg = >u.isp2300.fb_cmd;
 
-   while (count--)
-   *buf++ = htons(RD_REG_WORD(dmp_reg++));
+   for ( ; count--; dmp_reg++)
+   *buf++ = htons(RD_REG_WORD(dmp_reg));
 }
 
 static inline void *
@@ -733,16 +733,18 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
 
if (rval == QLA_SUCCESS) {
dmp_reg = >flash_address;
-   for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++)
-   fw->pbiu_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
+   for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++, dmp_reg++)
+   fw->pbiu_reg[cnt] = htons(RD_REG_WORD(dmp_reg));
 
dmp_reg = >u.isp2300.req_q_in;
-   for (cnt = 0; cnt < sizeof(fw->risc_host_reg) / 2; cnt++)
-   fw->risc_host_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
+   for (cnt = 0; cnt < sizeof(fw->risc_host_reg) / 2;
+   cnt++, dmp_reg++)
+   fw->risc_host_reg[cnt] = htons(RD_REG_WORD(dmp_reg));
 
dmp_reg = >u.isp2300.mailbox0;
-   for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2; cnt++)
-   fw->mailbox_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
+   for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2;
+   cnt++, dmp_reg++)
+   fw->mailbox_reg[cnt] = htons(RD_REG_WORD(dmp_reg));
 
WRT_REG_WORD(>ctrl_status, 0x40);
qla2xxx_read_window(reg, 32, fw->resp_dma_reg);
@@ -752,8 +754,9 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
 
WRT_REG_WORD(>ctrl_status, 0x00);
dmp_reg = >risc_hw;
-   for (cnt = 0; cnt < sizeof(fw->risc_hdw_reg) / 2; cnt++)
-   fw->risc_hdw_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
+   for (cnt = 0; cnt < sizeof(fw->risc_hdw_reg) / 2;
+   cnt++, dmp_reg++)
+   fw->risc_hdw_reg[cnt] = htons(RD_REG_WORD(dmp_reg));
 
WRT_REG_WORD(>pcr, 0x2000);
qla2xxx_read_window(reg, 16, fw->risc_gp0_reg);
@@ -896,25 +899,25 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
}
if (rval == QLA_SUCCESS) {
dmp_reg = >flash_address;
-   for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++)
-   fw->pbiu_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
+   for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++, dmp_reg++)
+   fw->pbiu_reg[cnt] = htons(RD_REG_WORD(dmp_reg));
 
dmp_reg = >u.isp2100.mailbox0;
-   for (cnt = 0; cnt < ha->mbx_count; cnt++) {
+   for (cnt = 0; cnt < ha->mbx_count; cnt++, dmp_reg++) {
if (cnt == 8)
dmp_reg = >u_end.isp2200.mailbox8;
 
-   fw->mailbox_reg[cnt] = htons(RD_REG_WORD(dmp_reg++));
+   fw->mailbox_reg[cnt] = htons(RD_REG_WORD(dmp_reg));

[PATCH v2 05/11] qla2xxx: Add support for buffer to buffer credit value for ISP27XX.

2016-01-27 Thread Himanshu Madhani
From: Sawan Chandak 

Signed-off-by: Sawan Chandak 
Signed-off-by: Himanshu Madhani 
---
 drivers/scsi/qla2xxx/qla_bsg.c |   55 
 drivers/scsi/qla2xxx/qla_bsg.h |   24 +
 drivers/scsi/qla2xxx/qla_def.h |2 +
 drivers/scsi/qla2xxx/qla_fw.h  |4 ++-
 drivers/scsi/qla2xxx/qla_mbx.c |8 ++
 5 files changed, 92 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index 64fe17a..d135d6a 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -2181,6 +2181,58 @@ qla27xx_set_flash_upd_cap(struct fc_bsg_job *bsg_job)
 }
 
 static int
+qla27xx_get_bbcr_data(struct fc_bsg_job *bsg_job)
+{
+   struct Scsi_Host *host = bsg_job->shost;
+   scsi_qla_host_t *vha = shost_priv(host);
+   struct qla_hw_data *ha = vha->hw;
+   struct qla_bbcr_data bbcr;
+   uint16_t loop_id, topo, sw_cap;
+   uint8_t domain, area, al_pa, state;
+   int rval;
+
+   if (!(IS_QLA27XX(ha)))
+   return -EPERM;
+
+   memset(, 0, sizeof(bbcr));
+
+   if (vha->flags.bbcr_enable)
+   bbcr.status = QLA_BBCR_STATUS_ENABLED;
+   else
+   bbcr.status = QLA_BBCR_STATUS_DISABLED;
+
+   if (bbcr.status == QLA_BBCR_STATUS_ENABLED) {
+   rval = qla2x00_get_adapter_id(vha, _id, _pa,
+   , , , _cap);
+   if (rval != QLA_SUCCESS)
+   return -EIO;
+
+   state = (vha->bbcr >> 12) & 0x1;
+
+   if (state) {
+   bbcr.state = QLA_BBCR_STATE_OFFLINE;
+   bbcr.offline_reason_code = QLA_BBCR_REASON_LOGIN_REJECT;
+   } else {
+   bbcr.state = QLA_BBCR_STATE_ONLINE;
+   bbcr.negotiated_bbscn = (vha->bbcr >> 8) & 0xf;
+   }
+
+   bbcr.configured_bbscn = vha->bbcr & 0xf;
+   }
+
+   sg_copy_from_buffer(bsg_job->reply_payload.sg_list,
+   bsg_job->reply_payload.sg_cnt, , sizeof(bbcr));
+   bsg_job->reply->reply_payload_rcv_len = sizeof(bbcr);
+
+   bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] = EXT_STATUS_OK;
+
+   bsg_job->reply_len = sizeof(struct fc_bsg_reply);
+   bsg_job->reply->result = DID_OK << 16;
+   bsg_job->job_done(bsg_job);
+   return 0;
+}
+
+static int
 qla2x00_process_vendor_specific(struct fc_bsg_job *bsg_job)
 {
switch (bsg_job->request->rqst_data.h_vendor.vendor_cmd[0]) {
@@ -2241,6 +2293,9 @@ qla2x00_process_vendor_specific(struct fc_bsg_job 
*bsg_job)
case QL_VND_SET_FLASH_UPDATE_CAPS:
return qla27xx_set_flash_upd_cap(bsg_job);
 
+   case QL_VND_GET_BBCR_DATA:
+   return qla27xx_get_bbcr_data(bsg_job);
+
default:
return -ENOSYS;
}
diff --git a/drivers/scsi/qla2xxx/qla_bsg.h b/drivers/scsi/qla2xxx/qla_bsg.h
index 6c45bf4..4275177 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.h
+++ b/drivers/scsi/qla2xxx/qla_bsg.h
@@ -27,6 +27,7 @@
 #defineQL_VND_SERDES_OP_EX 0x14
 #define QL_VND_GET_FLASH_UPDATE_CAPS0x15
 #define QL_VND_SET_FLASH_UPDATE_CAPS0x16
+#define QL_VND_GET_BBCR_DATA0x17
 
 /* BSG Vendor specific subcode returns */
 #define EXT_STATUS_OK  0
@@ -239,4 +240,27 @@ struct qla_flash_update_caps {
uint32_t  outage_duration;
uint8_t   reserved[20];
 } __packed;
+
+/* BB_CR Status */
+#define QLA_BBCR_STATUS_DISABLED   0
+#define QLA_BBCR_STATUS_ENABLED1
+
+/* BB_CR State */
+#define QLA_BBCR_STATE_OFFLINE 0
+#define QLA_BBCR_STATE_ONLINE  1
+
+/* BB_CR Offline Reason Code */
+#define QLA_BBCR_REASON_PORT_SPEED 1
+#define QLA_BBCR_REASON_PEER_PORT  2
+#define QLA_BBCR_REASON_SWITCH 3
+#define QLA_BBCR_REASON_LOGIN_REJECT   4
+
+struct  qla_bbcr_data {
+   uint8_t   status; /* 1 - enabled, 0 - Disabled */
+   uint8_t   state;  /* 1 - online, 0 - offline */
+   uint8_t   configured_bbscn;   /* 0-15 */
+   uint8_t   negotiated_bbscn;   /* 0-15 */
+   uint8_t   offline_reason_code;
+   uint8_t   reserved[11];
+} __packed;
 #endif
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 987480f..c4bd62a 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -3583,6 +3583,7 @@ typedef struct scsi_qla_host {
uint32_tdelete_progress:1;
 
uint32_tfw_tgt_reported:1;
+   uint32_tbbcr_enable:1;
} flags;
 
atomic_tloop_state;
@@ -3715,6 +3716,7 @@ typedef struct scsi_qla_host {
atomic_tvref_count;
struct qla8044_reset_template reset_tmplt;
struct qla_tgt_counters tgt_counters;
+   uint16_tbbcr;
 } 

[PATCH v2 00/11] qla2xxx: Patches for scsi "misc" branch.

2016-01-27 Thread Himanshu Madhani
Hi James, Martin,

Please apply following patches to the scsi tree, misc branch
at your earliest convenience.

Changes from v1 --> v2
 o Fix kbuild warning for following patch
"qla2xxx: Avoid side effects when using endianizer macros."

Thanks,
- Himanshu

Chad Dupuis (2):
  qla2xxx: Remove unneeded link offline message.
  qla2xxx: Set relogin flag when we fail to queue login requests.

Harish Zunjarrao (2):
  qla2xxx: Add support for Private link statistics counters.
  qla2xxx: Provide mbx info in BBCR data after mbx failure

Himanshu Madhani (3):
  qla2xxx: Allow fw to hold status before sending ABTS response.
  qla2xxx: Enable T10-DIF for ISP27XX
  qla2xxx: Update driver version to 8.07.00.33-k

Joe Carnuccio (2):
  qla2xxx: Seed init-cb login timeout from nvram exclusively.
  qla2xxx: Avoid side effects when using endianizer macros.

Sawan Chandak (2):
  qla2xxx: Add support for online flash update for ISP27XX.
  qla2xxx: Add support for buffer to buffer credit value for ISP27XX.

 drivers/scsi/qla2xxx/qla_attr.c|   22 +++-
 drivers/scsi/qla2xxx/qla_bsg.c |  201 
 drivers/scsi/qla2xxx/qla_bsg.h |   34 ++
 drivers/scsi/qla2xxx/qla_dbg.c |  146 ++
 drivers/scsi/qla2xxx/qla_def.h |   56 ++-
 drivers/scsi/qla2xxx/qla_fw.h  |   14 +++-
 drivers/scsi/qla2xxx/qla_gbl.h |2 +
 drivers/scsi/qla2xxx/qla_init.c|  119 --
 drivers/scsi/qla2xxx/qla_inline.h  |4 +-
 drivers/scsi/qla2xxx/qla_isr.c |4 -
 drivers/scsi/qla2xxx/qla_mbx.c |   27 +++--
 drivers/scsi/qla2xxx/qla_os.c  |   10 ++
 drivers/scsi/qla2xxx/qla_sup.c |   70 ++---
 drivers/scsi/qla2xxx/qla_version.h |2 +-
 14 files changed, 594 insertions(+), 117 deletions(-)

-- 
1.7.7

--
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 v2 04/11] qla2xxx: Add support for online flash update for ISP27XX.

2016-01-27 Thread Himanshu Madhani
From: Sawan Chandak 

Signed-off-by: Sawan Chandak 
Signed-off-by: Himanshu Madhani 
---
 drivers/scsi/qla2xxx/qla_attr.c |   12 -
 drivers/scsi/qla2xxx/qla_bsg.c  |   80 ++
 drivers/scsi/qla2xxx/qla_bsg.h  |7 +++
 drivers/scsi/qla2xxx/qla_dbg.c  |2 +-
 drivers/scsi/qla2xxx/qla_def.h  |   22 +
 drivers/scsi/qla2xxx/qla_fw.h   |   10 
 drivers/scsi/qla2xxx/qla_gbl.h  |1 +
 drivers/scsi/qla2xxx/qla_init.c |   91 +++
 drivers/scsi/qla2xxx/qla_sup.c  |   47 +++-
 9 files changed, 266 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 6992ebc..fef659a 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -562,6 +562,7 @@ qla2x00_sysfs_read_vpd(struct file *filp, struct kobject 
*kobj,
struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
struct device, kobj)));
struct qla_hw_data *ha = vha->hw;
+   uint32_t faddr;
 
if (unlikely(pci_channel_offline(ha->pdev)))
return -EAGAIN;
@@ -569,9 +570,16 @@ qla2x00_sysfs_read_vpd(struct file *filp, struct kobject 
*kobj,
if (!capable(CAP_SYS_ADMIN))
return -EINVAL;
 
-   if (IS_NOCACHE_VPD_TYPE(ha))
-   ha->isp_ops->read_optrom(vha, ha->vpd, ha->flt_region_vpd << 2,
+   if (IS_NOCACHE_VPD_TYPE(ha)) {
+   faddr = ha->flt_region_vpd << 2;
+
+   if (IS_QLA27XX(ha) &&
+   qla27xx_find_valid_image(vha) == QLA27XX_SECONDARY_IMAGE)
+   faddr = ha->flt_region_vpd_sec << 2;
+
+   ha->isp_ops->read_optrom(vha, ha->vpd, faddr,
ha->vpd_size);
+   }
return memory_read_from_buffer(buf, count, , ha->vpd, ha->vpd_size);
 }
 
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index c26acde..64fe17a 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -2107,6 +2107,80 @@ qla8044_serdes_op(struct fc_bsg_job *bsg_job)
 }
 
 static int
+qla27xx_get_flash_upd_cap(struct fc_bsg_job *bsg_job)
+{
+   struct Scsi_Host *host = bsg_job->shost;
+   scsi_qla_host_t *vha = shost_priv(host);
+   struct qla_hw_data *ha = vha->hw;
+   struct qla_flash_update_caps cap;
+
+   if (!(IS_QLA27XX(ha)))
+   return -EPERM;
+
+   memset(, 0, sizeof(cap));
+   cap.capabilities = (uint64_t)ha->fw_attributes_ext[1] << 48 |
+  (uint64_t)ha->fw_attributes_ext[0] << 32 |
+  (uint64_t)ha->fw_attributes_h << 16 |
+  (uint64_t)ha->fw_attributes;
+
+   sg_copy_from_buffer(bsg_job->reply_payload.sg_list,
+   bsg_job->reply_payload.sg_cnt, , sizeof(cap));
+   bsg_job->reply->reply_payload_rcv_len = sizeof(cap);
+
+   bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] =
+   EXT_STATUS_OK;
+
+   bsg_job->reply_len = sizeof(struct fc_bsg_reply);
+   bsg_job->reply->result = DID_OK << 16;
+   bsg_job->job_done(bsg_job);
+   return 0;
+}
+
+static int
+qla27xx_set_flash_upd_cap(struct fc_bsg_job *bsg_job)
+{
+   struct Scsi_Host *host = bsg_job->shost;
+   scsi_qla_host_t *vha = shost_priv(host);
+   struct qla_hw_data *ha = vha->hw;
+   uint64_t online_fw_attr = 0;
+   struct qla_flash_update_caps cap;
+
+   if (!(IS_QLA27XX(ha)))
+   return -EPERM;
+
+   memset(, 0, sizeof(cap));
+   sg_copy_to_buffer(bsg_job->request_payload.sg_list,
+   bsg_job->request_payload.sg_cnt, , sizeof(cap));
+
+   online_fw_attr = (uint64_t)ha->fw_attributes_ext[1] << 48 |
+(uint64_t)ha->fw_attributes_ext[0] << 32 |
+(uint64_t)ha->fw_attributes_h << 16 |
+(uint64_t)ha->fw_attributes;
+
+   if (online_fw_attr != cap.capabilities) {
+   bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] =
+   EXT_STATUS_INVALID_PARAM;
+   return -EINVAL;
+   }
+
+   if (cap.outage_duration < MAX_LOOP_TIMEOUT)  {
+   bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] =
+   EXT_STATUS_INVALID_PARAM;
+   return -EINVAL;
+   }
+
+   bsg_job->reply->reply_payload_rcv_len = 0;
+
+   bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] =
+   EXT_STATUS_OK;
+
+   bsg_job->reply_len = sizeof(struct fc_bsg_reply);
+   bsg_job->reply->result = DID_OK << 16;
+   bsg_job->job_done(bsg_job);
+   return 0;
+}
+
+static int
 qla2x00_process_vendor_specific(struct fc_bsg_job *bsg_job)
 {
switch (bsg_job->request->rqst_data.h_vendor.vendor_cmd[0]) {
@@ -2161,6 +2235,12 @@ 

[PATCH v2 08/11] qla2xxx: Provide mbx info in BBCR data after mbx failure

2016-01-27 Thread Himanshu Madhani
From: Harish Zunjarrao 

Signed-off-by: Harish Zunjarrao 
Signed-off-by: Himanshu Madhani 
---
 drivers/scsi/qla2xxx/qla_bsg.c |9 +++--
 drivers/scsi/qla2xxx/qla_bsg.h |4 +++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index 913fef2..392c147 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -2204,8 +2204,12 @@ qla27xx_get_bbcr_data(struct fc_bsg_job *bsg_job)
if (bbcr.status == QLA_BBCR_STATUS_ENABLED) {
rval = qla2x00_get_adapter_id(vha, _id, _pa,
, , , _cap);
-   if (rval != QLA_SUCCESS)
-   return -EIO;
+   if (rval != QLA_SUCCESS) {
+   bbcr.status = QLA_BBCR_STATUS_UNKNOWN;
+   bbcr.state = QLA_BBCR_STATE_OFFLINE;
+   bbcr.mbx1 = loop_id;
+   goto done;
+   }
 
state = (vha->bbcr >> 12) & 0x1;
 
@@ -2220,6 +2224,7 @@ qla27xx_get_bbcr_data(struct fc_bsg_job *bsg_job)
bbcr.configured_bbscn = vha->bbcr & 0xf;
}
 
+done:
sg_copy_from_buffer(bsg_job->reply_payload.sg_list,
bsg_job->reply_payload.sg_cnt, , sizeof(bbcr));
bsg_job->reply->reply_payload_rcv_len = sizeof(bbcr);
diff --git a/drivers/scsi/qla2xxx/qla_bsg.h b/drivers/scsi/qla2xxx/qla_bsg.h
index c40dd8b..c80192d 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.h
+++ b/drivers/scsi/qla2xxx/qla_bsg.h
@@ -245,6 +245,7 @@ struct qla_flash_update_caps {
 /* BB_CR Status */
 #define QLA_BBCR_STATUS_DISABLED   0
 #define QLA_BBCR_STATUS_ENABLED1
+#define QLA_BBCR_STATUS_UNKNOWN2
 
 /* BB_CR State */
 #define QLA_BBCR_STATE_OFFLINE 0
@@ -262,6 +263,7 @@ struct  qla_bbcr_data {
uint8_t   configured_bbscn;   /* 0-15 */
uint8_t   negotiated_bbscn;   /* 0-15 */
uint8_t   offline_reason_code;
-   uint8_t   reserved[11];
+   uint16_t  mbx1; /* Port state */
+   uint8_t   reserved[9];
 } __packed;
 #endif
-- 
1.7.7

--
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 v2 11/11] qla2xxx: Update driver version to 8.07.00.33-k

2016-01-27 Thread Himanshu Madhani
Signed-off-by: Himanshu Madhani 
---
 drivers/scsi/qla2xxx/qla_version.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_version.h 
b/drivers/scsi/qla2xxx/qla_version.h
index 6d31faa..0bc93fa 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -7,7 +7,7 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION  "8.07.00.26-k"
+#define QLA2XXX_VERSION  "8.07.00.33-k"
 
 #define QLA_DRIVER_MAJOR_VER   8
 #define QLA_DRIVER_MINOR_VER   7
-- 
1.7.7

--
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 v2 01/11] qla2xxx: Remove unneeded link offline message.

2016-01-27 Thread Himanshu Madhani
From: Chad Dupuis 

Signed-off-by: Chad Dupuis 
Signed-off-by: Himanshu Madhani 
---
 drivers/scsi/qla2xxx/qla_dbg.c |1 +
 drivers/scsi/qla2xxx/qla_isr.c |4 
 2 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index cd0d94e..9e714cc 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -27,6 +27,7 @@
  * |  || 0x303a
|
  * | DPC Thread   |   0x4023   | 0x4002,0x4013  |
  * | Async Events |   0x5089   | 0x502b-0x502f  |
+ * |  || 0x505e |
  * |  || 0x5084,0x5075 |
  * |  || 0x503d,0x5044  |
  * |  || 0x507b,0x505f |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index d4d65eb..edd97de 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -934,10 +934,6 @@ skip_rio:
break;
 
 global_port_update:
-   /* Port unavailable. */
-   ql_log(ql_log_warn, vha, 0x505e,
-   "Link is offline.\n");
-
if (atomic_read(>loop_state) != LOOP_DOWN) {
atomic_set(>loop_state, LOOP_DOWN);
atomic_set(>loop_down_timer,
-- 
1.7.7

--
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 v2 06/11] qla2xxx: Add support for Private link statistics counters.

2016-01-27 Thread Himanshu Madhani
From: Harish Zunjarrao 

Signed-off-by: Harish Zunjarrao 
Signed-off-by: Himanshu Madhani 
---
 drivers/scsi/qla2xxx/qla_attr.c |6 ++-
 drivers/scsi/qla2xxx/qla_bsg.c  |   61 +++
 drivers/scsi/qla2xxx/qla_bsg.h  |1 +
 drivers/scsi/qla2xxx/qla_dbg.c  |2 +-
 drivers/scsi/qla2xxx/qla_def.h  |   32 +++-
 drivers/scsi/qla2xxx/qla_mbx.c  |3 +-
 6 files changed, 99 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index fef659a..fadce04 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1917,7 +1917,8 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
if (qla2x00_reset_active(vha))
goto done;
 
-   stats = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, _dma);
+   stats = dma_alloc_coherent(>pdev->dev,
+   sizeof(struct link_statistics), _dma, GFP_KERNEL);
if (stats == NULL) {
ql_log(ql_log_warn, vha, 0x707d,
"Failed to allocate memory for stats.\n");
@@ -1965,7 +1966,8 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
do_div(pfc_host_stat->seconds_since_last_reset, HZ);
 
 done_free:
-dma_pool_free(ha->s_dma_pool, stats, stats_dma);
+   dma_free_coherent(>pdev->dev, sizeof(struct link_statistics),
+   stats, stats_dma);
 done:
return pfc_host_stat;
 }
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index d135d6a..913fef2 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -2233,6 +2233,64 @@ qla27xx_get_bbcr_data(struct fc_bsg_job *bsg_job)
 }
 
 static int
+qla2x00_get_priv_stats(struct fc_bsg_job *bsg_job)
+{
+   struct Scsi_Host *host = bsg_job->shost;
+   scsi_qla_host_t *vha = shost_priv(host);
+   struct qla_hw_data *ha = vha->hw;
+   struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
+   struct link_statistics *stats = NULL;
+   dma_addr_t stats_dma;
+   int rval = QLA_FUNCTION_FAILED;
+
+   if (test_bit(UNLOADING, >dpc_flags))
+   goto done;
+
+   if (unlikely(pci_channel_offline(ha->pdev)))
+   goto done;
+
+   if (qla2x00_reset_active(vha))
+   goto done;
+
+   if (!IS_FWI2_CAPABLE(ha))
+   goto done;
+
+   stats = dma_alloc_coherent(>pdev->dev,
+   sizeof(struct link_statistics), _dma, GFP_KERNEL);
+   if (!stats) {
+   ql_log(ql_log_warn, vha, 0x70e2,
+   "Failed to allocate memory for stats.\n");
+   goto done;
+   }
+
+   memset(stats, 0, sizeof(struct link_statistics));
+
+   rval = qla24xx_get_isp_stats(base_vha, stats, stats_dma);
+
+   if (rval != QLA_SUCCESS)
+   goto done_free;
+
+   ql_dump_buffer(ql_dbg_user + ql_dbg_verbose, vha, 0x70e3,
+   (uint8_t *)stats, sizeof(struct link_statistics));
+
+   sg_copy_from_buffer(bsg_job->reply_payload.sg_list,
+   bsg_job->reply_payload.sg_cnt, stats, sizeof(struct link_statistics));
+   bsg_job->reply->reply_payload_rcv_len = sizeof(struct link_statistics);
+
+   bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] = EXT_STATUS_OK;
+
+   bsg_job->reply_len = sizeof(struct fc_bsg_reply);
+   bsg_job->reply->result = DID_OK << 16;
+   bsg_job->job_done(bsg_job);
+
+done_free:
+   dma_free_coherent(>pdev->dev, sizeof(struct link_statistics),
+   stats, stats_dma);
+done:
+   return rval;
+}
+
+static int
 qla2x00_process_vendor_specific(struct fc_bsg_job *bsg_job)
 {
switch (bsg_job->request->rqst_data.h_vendor.vendor_cmd[0]) {
@@ -2296,6 +2354,9 @@ qla2x00_process_vendor_specific(struct fc_bsg_job 
*bsg_job)
case QL_VND_GET_BBCR_DATA:
return qla27xx_get_bbcr_data(bsg_job);
 
+   case QL_VND_GET_PRIV_STATS:
+   return qla2x00_get_priv_stats(bsg_job);
+
default:
return -ENOSYS;
}
diff --git a/drivers/scsi/qla2xxx/qla_bsg.h b/drivers/scsi/qla2xxx/qla_bsg.h
index 4275177..c40dd8b 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.h
+++ b/drivers/scsi/qla2xxx/qla_bsg.h
@@ -28,6 +28,7 @@
 #define QL_VND_GET_FLASH_UPDATE_CAPS0x15
 #define QL_VND_SET_FLASH_UPDATE_CAPS0x16
 #define QL_VND_GET_BBCR_DATA0x17
+#define QL_VND_GET_PRIV_STATS  0x18
 
 /* BSG Vendor specific subcode returns */
 #define EXT_STATUS_OK  0
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 493a3ea81..aa6694b 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -32,7 +32,7 @@
  * |  || 0x503d,0x5044  |
  * |  || 0x507b,0x505f |
  * | Timer Routines   |  

[PATCH v2 09/11] qla2xxx: Enable T10-DIF for ISP27XX

2016-01-27 Thread Himanshu Madhani
Signed-off-by: Himanshu Madhani 
Signed-off-by: Giridhar Malavali 
---
 drivers/scsi/qla2xxx/qla_os.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index d94a236..fa017e9 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2217,6 +2217,7 @@ qla2x00_set_isp_flags(struct qla_hw_data *ha)
ha->device_type |= DT_ZIO_SUPPORTED;
ha->device_type |= DT_FWI2;
ha->device_type |= DT_IIDMA;
+   ha->device_type |= DT_T10_PI;
ha->fw_srisc_address = RISC_START_ADDRESS_2400;
break;
case PCI_DEVICE_ID_QLOGIC_ISP2271:
@@ -2224,6 +2225,7 @@ qla2x00_set_isp_flags(struct qla_hw_data *ha)
ha->device_type |= DT_ZIO_SUPPORTED;
ha->device_type |= DT_FWI2;
ha->device_type |= DT_IIDMA;
+   ha->device_type |= DT_T10_PI;
ha->fw_srisc_address = RISC_START_ADDRESS_2400;
break;
case PCI_DEVICE_ID_QLOGIC_ISP2261:
@@ -2231,6 +2233,7 @@ qla2x00_set_isp_flags(struct qla_hw_data *ha)
ha->device_type |= DT_ZIO_SUPPORTED;
ha->device_type |= DT_FWI2;
ha->device_type |= DT_IIDMA;
+   ha->device_type |= DT_T10_PI;
ha->fw_srisc_address = RISC_START_ADDRESS_2400;
break;
}
-- 
1.7.7

--
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 v2 10/11] qla2xxx: Set relogin flag when we fail to queue login requests.

2016-01-27 Thread Himanshu Madhani
From: Chad Dupuis 

If we fail to queue an srb for an async login we should set the
relogin flag so it will be retried as the reason for the queuing
failure was most likely transient.  Failure to do this can lead to
failed paths as login is never retried if the relogin flag is not
set.

Signed-off-by: Chad Dupuis 
Signed-off-by: Himanshu Madhani 
---
 drivers/scsi/qla2xxx/qla_init.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 8001c89..184b6b6 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -157,8 +157,12 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t 
*fcport,
if (data[1] & QLA_LOGIO_LOGIN_RETRIED)
lio->u.logio.flags |= SRB_LOGIN_RETRIED;
rval = qla2x00_start_sp(sp);
-   if (rval != QLA_SUCCESS)
+   if (rval != QLA_SUCCESS) {
+   fcport->flags &= ~FCF_ASYNC_SENT;
+   fcport->flags |= FCF_LOGIN_NEEDED;
+   set_bit(RELOGIN_NEEDED, >dpc_flags);
goto done_free_sp;
+   }
 
ql_dbg(ql_dbg_disc, vha, 0x2072,
"Async-login - hdl=%x, loopid=%x portid=%02x%02x%02x "
-- 
1.7.7

--
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 V3 7/9] aacraid: Fix AIF triggered IOP_RESET

2016-01-27 Thread Raghava Aditya Renukunta
Hello Martin,

> -Original Message-
> From: Martin K. Petersen [mailto:martin.peter...@oracle.com]
> Sent: Tuesday, January 26, 2016 6:31 PM
> To: Raghava Aditya Renukunta
> Cc: Tomas Henzl; james.bottom...@hansenpartnership.com;
> martin.peter...@oracle.com; linux-scsi@vger.kernel.org; Mahesh
> Rajashekhara; Murthy Bhat; Gana Sridaran; aacr...@pmc-sierra.com; Scott
> Benesh; jthumsh...@suse.de; shane.seym...@hpe.com; zzzDavid Carroll
> Subject: Re: [PATCH V3 7/9] aacraid: Fix AIF triggered IOP_RESET
> 
> > "Tomas" == Tomas Henzl  writes:
> 
> >> 2.Since commands are sync , place a check in aac_fib_send to block
> >> commands once adapter_shutdown is set(only shutdown command will
> be
> >> sent thru)
> 
> Tomas> This option looks better but I guess you still can find a tiny
> Tomas> race window.  What do you think about a mutual exclusive access
> Tomas> using a mutex, do you think this could work?
> 
> [...]
> 
> Raghava?

I have replied that I will create a new set patches with this change shortly. 
Please expect it by tomorrow at the latest.

Regards,
Raghava Aditya

> 
> --
> Martin K. PetersenOracle 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


[LSF/MM TOPIC] Improving DISCARD support

2016-01-27 Thread Bart Van Assche
Increasing the discard granularity of an SSD helps with reducing the 
production cost of an SSD. This makes it likely that in the future even 
more SSDs will have a discard granularity that is larger than the block 
size than today. Kernel drivers like DRBD and OCFS2 need a way to 
efficiently erase a data range. This is why the function 
blkdev_issue_zeroout() has been introduced in the block layer. This 
function uses the DISCARD operation for those devices for which 
discarded ranges read back as zero (discard_zeroes_data == 1). However, 
support in the block layer for devices with a discard granularity that 
is larger than the block size is suboptimal. Callers of 
blkdev_issue_zeroout() namely have to ensure that the start and end of 
the range that has to be zeroed are aligned with discard boundaries. 
This forces driver writers to write wrapper functions that work around 
this limitation. An example can be found in [1]. My proposal is to 
provide such functionality in the block layer instead of forcing every 
driver author to reimplement this functionality. A candidate 
implementation is available in [2].


[1] Lars Ellenberg, drbd: when receiving P_TRIM, zero-out partial 
unaligned chunks, October 2015 
(http://git.drbd.org/drbd-8.4.git/commitdiff/5204727f9dfa695fc57915c4edeb2a9f186e5fba).
[2] Bart Van Assche, Make blkdev_issue_discard() submit aligned discard 
requests, December 2015 
(http://thread.gmane.org/gmane.linux.kernel.device-mapper.devel/23801).

--
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 v2 03/11] qla2xxx: Allow fw to hold status before sending ABTS response.

2016-01-27 Thread Himanshu Madhani
Set bit 12 of additional firmware options 3 to let firmware
hold status IOCB until ABTS response is received from Target.

Signed-off-by: Himanshu Madhani 
Signed-off-by: Giridhar Malavali 
---
 drivers/scsi/qla2xxx/qla_gbl.h  |1 +
 drivers/scsi/qla2xxx/qla_init.c |   11 ++-
 drivers/scsi/qla2xxx/qla_os.c   |7 +++
 3 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 0103e46..1bfdcdf 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -121,6 +121,7 @@ extern int ql2xmdcapmask;
 extern int ql2xmdenable;
 extern int ql2xexlogins;
 extern int ql2xexchoffld;
+extern int ql2xfwholdabts;
 
 extern int qla2x00_loop_reset(scsi_qla_host_t *);
 extern void qla2x00_abort_all_cmds(scsi_qla_host_t *, int);
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index a663ff6..cf487b9 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2062,6 +2062,10 @@ qla24xx_update_fw_options(scsi_qla_host_t *vha)
if (IS_P3P_TYPE(ha))
return;
 
+   /*  Hold status IOCBs until ABTS response received. */
+   if (ql2xfwholdabts)
+   ha->fw_options[3] |= BIT_12;
+
/* Update Serial Link options. */
if ((le16_to_cpu(ha->fw_seriallink_options24[0]) & BIT_0) == 0)
return;
@@ -6410,12 +6414,17 @@ qla81xx_update_fw_options(scsi_qla_host_t *vha)
 {
struct qla_hw_data *ha = vha->hw;
 
+   /*  Hold status IOCBs until ABTS response received. */
+   if (ql2xfwholdabts)
+   ha->fw_options[3] |= BIT_12;
+
if (!ql2xetsenable)
-   return;
+   goto out;
 
/* Enable ETS Burst. */
memset(ha->fw_options, 0, sizeof(ha->fw_options));
ha->fw_options[2] |= BIT_9;
+out:
qla2x00_set_fw_options(vha, ha->fw_options);
 }
 
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index f1788db..d94a236 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -233,6 +233,13 @@ MODULE_PARM_DESC(ql2xexchoffld,
 "Number of exchanges to offload. "
 "0 (Default)- Disabled.");
 
+int ql2xfwholdabts = 0;
+module_param(ql2xfwholdabts, int, S_IRUGO);
+MODULE_PARM_DESC(ql2xfwholdabts,
+   "Allow FW to hold status IOCB until ABTS rsp received. "
+   "0 (Default) Do not set fw option. "
+   "1 - Set fw option to hold ABTS.");
+
 /*
  * SCSI host template entry points
  */
-- 
1.7.7

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


[LSF/MM TOPIC] LIO/SCST Merger

2016-01-27 Thread Bart Van Assche
Last year, during the 2015 LSF/MM summit, it has been decided that the 
LIO/SCST merger project should proceed by sending the functionality 
upstream that is present in SCST but not yet in LIO. This will help to 
reduce the workload of target driver maintainers that maintain a version 
of their target driver for both LIO and SCST (QLogic FC and FCoE target 
drivers, Emulex FC and FCoE target drivers, RDMA iSER target driver, 
RDMA SRP target driver, ...). My proposal is to organize a session 
during which the following is discussed:
* Which patches are already upstream in the context of the LIO/SCST 
merger project.

* About which patches there is agreement but that are not yet upstream.
* To discuss how to proceed from here and what to address first.

References:
[1] Bart Van Assche,  [LSF/MM TOPIC] Unifying the LIO and SCST target 
drivers, January 2015 
(http://thread.gmane.org/gmane.linux.scsi.target.devel/7779)
[2] James Bottomley, LIO/SCST merger, April 2015 
(https://plus.google.com/112086662098298535411/posts/HuGsCMU41uy).

--
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 07/15] megaraid_sas: Reply Descriptor Post Queue(RDPQ) support

2016-01-27 Thread Sumit Saxena
Tomas,
This reply was stuck in my outbox(was not sent). Just realized now this
when reworking on patches to accommodate your feedback. Apologies for late
reply.

Thanks,
Sumit

> -Original Message-
> From: Tomas Henzl [mailto:the...@redhat.com]
> Sent: Thursday, January 14, 2016 11:09 PM
> To: Sumit Saxena; jbottom...@parallels.com; h...@infradead.org;
> martin.peter...@oracle.com
> Cc: linux-scsi@vger.kernel.org; kashyap.de...@avagotech.com
> Subject: Re: [PATCH 07/15] megaraid_sas: Reply Descriptor Post
Queue(RDPQ)
> support
>
> On 18.12.2015 14:27, Sumit Saxena wrote:
> > This patch will create reply queue pool for each MSI-x index and will
> > provide array of all reply queue base address instead of single base
> > address of legacy mode. Using this new interface Driver can support
higher
> Queue depth allocating more reply queue as scattered DMA pool.
> >
> > If array mode is not supported driver will fall back to legacy method
of
> allocation reply pool.
> > This method fall back controller queue depth to 1K max. To enable more
> > than 1K QD, driver expect FW to support Array mode and scratch_pad3
should
> provide new queue depth value.
> >
> > Using this method, Firmware should not allow downgrade (OFU) if latest
driver
> and latest FW report 4K QD and Array mode reply queue.
> > This type of FW upgrade may cause firmware fault and it should not be
> > supported. Upgrade of FW will work, but queue depth of the controller
will be
> unchanged until reboot/driver reload.
> >
> > Signed-off-by: Kashyap Desai 
> > Signed-off-by: Sumit Saxena 
> > ---
> >  drivers/scsi/megaraid/megaraid_sas.h|6 +-
> >  drivers/scsi/megaraid/megaraid_sas_base.c   |9 +
> >  drivers/scsi/megaraid/megaraid_sas_fusion.c |  543
+++
> 
> >  drivers/scsi/megaraid/megaraid_sas_fusion.h |   12 +-
> >  4 files changed, 330 insertions(+), 240 deletions(-)
> >
> > diff --git a/drivers/scsi/megaraid/megaraid_sas.h
> > b/drivers/scsi/megaraid/megaraid_sas.h
> > index 01135be..c539516 100644
> > --- a/drivers/scsi/megaraid/megaraid_sas.h
> > +++ b/drivers/scsi/megaraid/megaraid_sas.h
> > @@ -152,6 +152,7 @@
> >  #define MFI_RESET_FLAGSMFI_INIT_READY| \
> > MFI_INIT_MFIMODE| \
> > MFI_INIT_ABORT
> > +#define MPI2_IOCINIT_MSGFLAG_RDPQ_ARRAY_MODE(0x01)
> >
> >  /*
> >   * MFI frame flags
> > @@ -1416,6 +1417,7 @@ enum DCMD_TIMEOUT_ACTION {
> >  #define MR_MAX_REPLY_QUEUES_EXT_OFFSET  0X003FC000
> >  #define MR_MAX_REPLY_QUEUES_EXT_OFFSET_SHIFT14
> >  #define MR_MAX_MSIX_REG_ARRAY   16
> > +#define MR_RDPQ_MODE_OFFSET0X0080
> >  /*
> >  * register set for both 1068 and 1078 controllers
> >  * structure extended for 1078 registers @@ -1455,8 +1457,9 @@ struct
> > megasas_register_set {
> >
> > u32 outbound_scratch_pad ;  /*00B0h*/
> > u32 outbound_scratch_pad_2; /*00B4h*/
> > +   u32 outbound_scratch_pad_3; /*00B8h*/
> >
> > -   u32 reserved_4[2];  /*00B8h*/
> > +   u32 reserved_4; /*00BCh*/
> >
> > u32 inbound_low_queue_port ;/*00C0h*/
> >
> > @@ -2117,6 +2120,7 @@ struct megasas_instance {
> > u8 mask_interrupts;
> > u16 max_chain_frame_sz;
> > u8 is_imr;
> > +   u8 is_rdpq;
> > bool dev_handle;
> >  };
> >  struct MR_LD_VF_MAP {
> > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
> > b/drivers/scsi/megaraid/megaraid_sas_base.c
> > index df93fa1..a3b63fa 100644
> > --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> > @@ -92,6 +92,10 @@ 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)");
> >
> > +int rdpq_enable = 1;
> > +module_param(rdpq_enable, int, S_IRUGO);
> > +MODULE_PARM_DESC(rdpq_enable, " Allocate reply queue in chunks for
> > +large queue depth enable/disbale Default: disable(0)");
>
> Is it enabled or disabled by default (-> int rdpq_enable = 1;) ? also
fix 'disbale'

It's enabled by default. I will fix typo.
>
> > +
> >  MODULE_LICENSE("GPL");
> >  MODULE_VERSION(MEGASAS_VERSION);
> >  MODULE_AUTHOR("megaraidlinux@avagotech.com");
> > @@ -5081,6 +5085,9 @@ static int megasas_init_fw(struct
megasas_instance
> *instance)
> > instance->msix_vectors = ((scratch_pad_2
> > &
> MR_MAX_REPLY_QUEUES_EXT_OFFSET)
> > >>
> MR_MAX_REPLY_QUEUES_EXT_OFFSET_SHIFT) + 1;
> > +   if (rdpq_enable)
> > +   instance->is_rdpq = (scratch_pad_2
&
> MR_RDPQ_MODE_OFFSET) ?
> > + 

UFS Help: OCS is returning invalid (0x7)

2016-01-27 Thread Joao Pinto
Hi!
I am currently working in the implementation of DesignWare Quirks in the
existing UFS core and implementing a glue platform driver.
The project status is the following:

- Synopsys MPHY Test Chip is well configured
- Link is up in Host & Device (validated through the 0xd083 register)
- Additional connection setup are made successfully
- HBA is operational
- NOP_OUT is failing with OCS = 0x7

The OCS value is calculated in ufshcd_get_tr_ocs() in ufshcd.c.
I made a dump of the UTRD pointer where we can check the status = 7 ([2]).

UTRD at: 7007c3e0
@ [0]:2100
@0004 [1]:93936a6a
@0008 [2]:0007
@000c [3]:93936a6a
@0010 [4]:9f317400
@0014 [5]:
@0018 [6]:00800080
@001c [7]:01006a6a

Did anyone have the same problem? Any hints to overcome this issue?

Thank you very much for your help!

Joao
--
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: [Lsf-pc] [LSF/MM TOPIC] LIO/SCST Merger

2016-01-27 Thread James Bottomley
On Wed, 2016-01-27 at 09:54 -0800, Bart Van Assche wrote:
> Last year, during the 2015 LSF/MM summit, it has been decided that 
> the LIO/SCST merger project should proceed by sending the 
> functionality upstream that is present in SCST but not yet in LIO. 
> This will help to reduce the workload of target driver maintainers 
> that maintain a version of their target driver for both LIO and SCST 
> (QLogic FC and FCoE target drivers, Emulex FC and FCoE target 
> drivers, RDMA iSER target driver, RDMA SRP target driver, ...). My 
> proposal is to organize a session during which the following is
> discussed:
> * Which patches are already upstream in the context of the LIO/SCST 
> merger project.
> * About which patches there is agreement but that are not yet
> upstream.
> * To discuss how to proceed from here and what to address first.

Can you begin this in email ... I don't think any of us are clear if
there's still an issue here ... or that we'd say more than send the
patches upstream, like we did last year.  Just reporting on patch
status isn't that useful ... if there were design disputes or issues to
discuss that caused the patches not to be accepted, that would be more
useful.

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: [Lsf-pc] [LSF/MM TOPIC] LIO/SCST Merger

2016-01-27 Thread Bart Van Assche

On 01/27/2016 10:08 AM, James Bottomley wrote:

On Wed, 2016-01-27 at 09:54 -0800, Bart Van Assche wrote:

Last year, during the 2015 LSF/MM summit, it has been decided that
the LIO/SCST merger project should proceed by sending the
functionality upstream that is present in SCST but not yet in LIO.
This will help to reduce the workload of target driver maintainers
that maintain a version of their target driver for both LIO and SCST
(QLogic FC and FCoE target drivers, Emulex FC and FCoE target
drivers, RDMA iSER target driver, RDMA SRP target driver, ...). My
proposal is to organize a session during which the following is
discussed:
* Which patches are already upstream in the context of the LIO/SCST
merger project.
* About which patches there is agreement but that are not yet
upstream.
* To discuss how to proceed from here and what to address first.


Can you begin this in email ... I don't think any of us are clear if
there's still an issue here ... or that we'd say more than send the
patches upstream, like we did last year.  Just reporting on patch
status isn't that useful ... if there were design disputes or issues to
discuss that caused the patches not to be accepted, that would be more
useful.


Hello James,

Several patch series have been posted by different authors. Some of 
these patch series have already been reworked several times for 
different kernel versions. I think a meeting in person would make it 
easier to discuss which patch series to take upstream first and thereby 
avoid to have to keep reworking these patch series against an evolving 
target API. These patch series are:


* Christoph Hellwig, [RFC] simplify session shutdown, January 14 
(http://thread.gmane.org/gmane.linux.scsi.target.devel/11135).
* Nicholas Bellinger, [PATCH 0/2] target: Fix LUN_RESET active I/O + TMR 
handling, January 12, 2016 
(http://thread.gmane.org/gmane.linux.scsi.target.devel/11097).
* Bart Van Assche,  [PATCH 00/21] SCSI target patches for kernel v4.5, 
January 5 (http://thread.gmane.org/gmane.linux.scsi.target.devel/10905).


Thanks,

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 03/11] qla2xxx: Allow fw to hold status before sending ABTS response.

2016-01-27 Thread Himanshu Madhani

On 1/27/16, 12:24 AM, "Hannes Reinecke"  wrote:

>On 01/26/2016 06:10 PM, Himanshu Madhani wrote:
>> Set bit 12 of additional firmware options 3 to let firmware
>> hold status IOCB until ABTS response is received from Target.
>> 
>> Signed-off-by: Himanshu Madhani 
>> Signed-off-by: Giridhar Malavali 
>> ---
>>  drivers/scsi/qla2xxx/qla_gbl.h  |1 +
>>  drivers/scsi/qla2xxx/qla_init.c |   11 ++-
>>  drivers/scsi/qla2xxx/qla_os.c   |7 +++
>>  3 files changed, 18 insertions(+), 1 deletions(-)
>> 
>:-)
>We would have needed that earlier...

Sorry did not see this response before I reposted series with fix for
build warning. 


>
>Begs the question what happens if you do _not_ receive an ABTS
>response; will the iocb freed eventually?

Yes.

>
>Other than that:
>
>Reviewed-by: Hannes Reinecke 
>
>Cheers,
>
>Hannes
>-- 
>Dr. Hannes Reinecke   Teamlead 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)

<>

Re: [Lsf-pc] [LSF/MM TOPIC] LIO/SCST Merger

2016-01-27 Thread James Bottomley
On Wed, 2016-01-27 at 10:19 -0800, Bart Van Assche wrote:
> On 01/27/2016 10:08 AM, James Bottomley wrote:
> > On Wed, 2016-01-27 at 09:54 -0800, Bart Van Assche wrote:
> > > Last year, during the 2015 LSF/MM summit, it has been decided
> > > that
> > > the LIO/SCST merger project should proceed by sending the
> > > functionality upstream that is present in SCST but not yet in
> > > LIO.
> > > This will help to reduce the workload of target driver
> > > maintainers
> > > that maintain a version of their target driver for both LIO and
> > > SCST
> > > (QLogic FC and FCoE target drivers, Emulex FC and FCoE target
> > > drivers, RDMA iSER target driver, RDMA SRP target driver, ...).
> > > My
> > > proposal is to organize a session during which the following is
> > > discussed:
> > > * Which patches are already upstream in the context of the
> > > LIO/SCST
> > > merger project.
> > > * About which patches there is agreement but that are not yet
> > > upstream.
> > > * To discuss how to proceed from here and what to address first.
> > 
> > Can you begin this in email ... I don't think any of us are clear
> > if
> > there's still an issue here ... or that we'd say more than send the
> > patches upstream, like we did last year.  Just reporting on patch
> > status isn't that useful ... if there were design disputes or
> > issues to
> > discuss that caused the patches not to be accepted, that would be
> > more
> > useful.
> 
> Hello James,
> 
> Several patch series have been posted by different authors. Some of 
> these patch series have already been reworked several times for 
> different kernel versions. I think a meeting in person would make it 
> easier to discuss which patch series to take upstream first and 
> thereby avoid to have to keep reworking these patch series against an
> evolving target API. These patch series are:
> 
> * Christoph Hellwig, [RFC] simplify session shutdown, January 14 
> (http://thread.gmane.org/gmane.linux.scsi.target.devel/11135).
> * Nicholas Bellinger, [PATCH 0/2] target: Fix LUN_RESET active I/O +
> TMR 
> handling, January 12, 2016 
> (http://thread.gmane.org/gmane.linux.scsi.target.devel/11097).
> * Bart Van Assche,  [PATCH 00/21] SCSI target patches for kernel
> v4.5, 
> January 5 (
> http://thread.gmane.org/gmane.linux.scsi.target.devel/10905)

So you don't really want a topic, you want a BoF?  We can do that.

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


[Bug 111381] New: mvsas 0.8.16 on Marvell 88SE9485 reports timeouts on load

2016-01-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=111381

Bug ID: 111381
   Summary: mvsas 0.8.16 on Marvell 88SE9485 reports timeouts on
load
   Product: SCSI Drivers
   Version: 2.5
Kernel Version: 4.1.15
  Hardware: x86-64
OS: Linux
  Tree: Mainline
Status: NEW
  Severity: high
  Priority: P1
 Component: Other
  Assignee: scsi_drivers-ot...@kernel-bugs.osdl.org
  Reporter: gdeve...@gmail.com
Regression: No

Motherboard: P9A-I/C2550/SAS/4L

lsscsi -t -v:
[0:0:0:0]disksas:0x5000c50034367baa  /dev/sdb 
  dir: /sys/bus/scsi/devices/0:0:0:0 
[/sys/devices/pci:00/:00:03.0/:02:00.0/host0/port-0:0/end_device-0:0/target0:0:0/0:0:0:0]
[0:0:1:0]disksas:0x5000c50034367ba9  /dev/sdc 
  dir: /sys/bus/scsi/devices/0:0:1:0 
[/sys/devices/pci:00/:00:03.0/:02:00.0/host0/port-0:1/end_device-0:1/target0:0:1/0:0:1:0]
[0:0:2:0]disksas:0x5000c5003432eafe  /dev/sdd 
  dir: /sys/bus/scsi/devices/0:0:2:0 
[/sys/devices/pci:00/:00:03.0/:02:00.0/host0/port-0:2/end_device-0:2/target0:0:2/0:0:2:0]
[0:0:3:0]disksas:0x5000c5003432eafd  /dev/sde 
  dir: /sys/bus/scsi/devices/0:0:3:0 
[/sys/devices/pci:00/:00:03.0/:02:00.0/host0/port-0:3/end_device-0:3/target0:0:3/0:0:3:0]
[0:0:4:0]disksas:0x5000c500741d842a  /dev/sdf 
  dir: /sys/bus/scsi/devices/0:0:4:0 
[/sys/devices/pci:00/:00:03.0/:02:00.0/host0/port-0:4/end_device-0:4/target0:0:4/0:0:4:0]
[0:0:5:0]disksas:0x5000c500741d8429  /dev/sdg 
  dir: /sys/bus/scsi/devices/0:0:5:0 
[/sys/devices/pci:00/:00:03.0/:02:00.0/host0/port-0:5/end_device-0:5/target0:0:5/0:0:5:0]
[0:0:6:0]disksas:0x5000c5003c9335ca  /dev/sdh 
  dir: /sys/bus/scsi/devices/0:0:6:0 
[/sys/devices/pci:00/:00:03.0/:02:00.0/host0/port-0:6/end_device-0:6/target0:0:6/0:0:6:0]
[0:0:7:0]disksas:0x5000c5003c9335c9  /dev/sdi 
  dir: /sys/bus/scsi/devices/0:0:7:0 
[/sys/devices/pci:00/:00:03.0/:02:00.0/host0/port-0:7/end_device-0:7/target0:0:7/0:0:7:0]
[2:0:0:0]disksata:   /dev/sda 
  dir: /sys/bus/scsi/devices/2:0:0:0 
[/sys/devices/pci:00/:00:18.0/ata2/host2/target2:0:0/2:0:0:0]
[3:0:0:0]disksas:0x5000c5005d722942  /dev/sdj 
  dir: /sys/bus/scsi/devices/3:0:0:0 
[/sys/devices/pci:00/:00:04.0/:01:00.0/host3/port-3:0/end_device-3:0/target3:0:0/3:0:0:0]
[3:0:1:0]disksas:0x5000c5005d722941  /dev/sdk 
  dir: /sys/bus/scsi/devices/3:0:1:0 
[/sys/devices/pci:00/:00:04.0/:01:00.0/host3/port-3:1/end_device-3:1/target3:0:1/3:0:1:0]
[3:0:2:0]disksas:0x5000c5005d84e1a6  /dev/sdl 
  dir: /sys/bus/scsi/devices/3:0:2:0 
[/sys/devices/pci:00/:00:04.0/:01:00.0/host3/port-3:2/end_device-3:2/target3:0:2/3:0:2:0]
[3:0:3:0]disksas:0x5000c5005d84e1a5  /dev/sdm 
  dir: /sys/bus/scsi/devices/3:0:3:0 
[/sys/devices/pci:00/:00:04.0/:01:00.0/host3/port-3:3/end_device-3:3/target3:0:3/3:0:3:0]
[3:0:4:0]disksas:0x5000c5007408d282  /dev/sdn 
  dir: /sys/bus/scsi/devices/3:0:4:0 
[/sys/devices/pci:00/:00:04.0/:01:00.0/host3/port-3:4/end_device-3:4/target3:0:4/3:0:4:0]
[3:0:5:0]disksas:0x5000c5007408d281  /dev/sdo 
  dir: /sys/bus/scsi/devices/3:0:5:0 
[/sys/devices/pci:00/:00:04.0/:01:00.0/host3/port-3:5/end_device-3:5/target3:0:5/3:0:5:0]
[3:0:6:0]disksas:0x5000c500740c1212  /dev/sdp 
  dir: /sys/bus/scsi/devices/3:0:6:0 
[/sys/devices/pci:00/:00:04.0/:01:00.0/host3/port-3:6/end_device-3:6/target3:0:6/3:0:6:0]
[3:0:7:0]disksas:0x5000c500740c1211  /dev/sdq 
  dir: /sys/bus/scsi/devices/3:0:7:0 
[/sys/devices/pci:00/:00:04.0/:01:00.0/host3/port-3:7/end_device-3:7/target3:0:7/3:0:7:0]
[4:0:0:0]cd/dvd  usb: 1-1.3.2:1.0/dev/sr0 
  dir: /sys/bus/scsi/devices/4:0:0:0 
[/sys/devices/pci:00/:00:16.0/usb1/1-1/1-1.3/1-1.3.2/1-1.3.2:1.0/host4/target4:0:0/4:0:0:0]
[5:0:0:0]diskusb: 1-1.3.3:1.0/dev/sdr 
  dir: /sys/bus/scsi/devices/5:0:0:0 
[/sys/devices/pci:00/:00:16.0/usb1/1-1/1-1.3/1-1.3.3/1-1.3.3:1.0/host5/target5:0:0/5:0:0:0]
[6:0:0:0]diskusb: 1-1.3.4:1.0/dev/sds 
  dir: /sys/bus/scsi/devices/6:0:0:0 
[/sys/devices/pci:00/:00:16.0/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.0/host6/target6:0:0/6:0:0:0]

Relevant dmesg snip:
[1.274088] mvsas :02:00.0: mvsas: driver version 0.8.16
[1.276086] dca service started, version 1.12.1
[1.296857] mvsas :02:00.0: mvsas: PCI-E x4, Bandwidth Usage: 5.0 Gbps
[1.303168] ahci :00:18.0: version 3.0
[1.303887] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.2.15-k
[1.310071] igb: 

Re: [Bug 111381] New: mvsas 0.8.16 on Marvell 88SE9485 reports timeouts on load

2016-01-27 Thread James Bottomley
On Wed, 2016-01-27 at 21:56 +, bugzilla-dae...@bugzilla.kernel.org
wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=111381
> 
> Bug ID: 111381
>Summary: mvsas 0.8.16 on Marvell 88SE9485 reports timeouts
> on
> load
>Product: SCSI Drivers
>Version: 2.5
> Kernel Version: 4.1.15
>   Hardware: x86-64
> OS: Linux
>   Tree: Mainline
> Status: NEW
>   Severity: high
>   Priority: P1
>  Component: Other
>   Assignee: scsi_drivers-ot...@kernel-bugs.osdl.org
>   Reporter: gdeve...@gmail.com
> Regression: No
[...]
> [ 2007.415257] blk_update_request: I/O error, dev sdh, sector
> 755146020
> [ 2958.428448] sd 0:0:6:0: [sdh] tag#0 FAILED Result: hostbyte=DID_OK
> driverbyte=DRIVER_SENSE
> [ 2958.428466] sd 0:0:6:0: [sdh] tag#0 Sense Key : Aborted Command
> [current] 
> [ 2958.428474] sd 0:0:6:0: [sdh] tag#0 Add. Sense: Ack/nak timeout
> [ 2958.428481] sd 0:0:6:0: [sdh] tag#0 CDB: Read(10) 28 00 08 fe 2f
> c9 00 00 dd
> 00
> [ 2958.428486] blk_update_request: I/O error, dev sdh, sector 
> 150876105

This doesn't look like a driver bug.  An Ack/Nak timeout is most likely
caused by a bad cable (or if you're really unlucky, a bad phy
transciever).

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


[LSF/MM TOPIC] NVMe target support

2016-01-27 Thread Nicholas A. Bellinger
Hi lsf-pc & Co,

I'd like to propose a NVMe target discussion topic for LSF/MM 2016.

My interest wrt NVMe target drivers is specifically around using shared
infrastructure with existing TCM backend drivers (IBLOCK, FILEIO,
RAMDISK), and how se_device->dev_group configfs symlinks can be
associated with NVMe target driver ports following HCH's WIP code.
Also, there is still a vendor need around some type of NVMe backend
driver (eg: target_core_nvme) for exposing + mapping NVMe-HI queues to
front-end fabric driver RDMA queues.

Beyond the back-end driver discussion, our target_core_fabric_configfs.c
logic for exposing a common user-space ABI has served LIO target drivers
well over the last 10 upstream fabrics, plus other out-of-tree and WIP
drivers.  The design has never once had to break userspace ABI
compatibility, and the only user-visible addition to original design
was allowing network portal attributes to be exposed by fabrics for
iser-target + iscsit_transport friends.

I think one of the more interesting questions is going to be around how
NVMe-over-Fabrics (NVMe_OF) + vhost-nvme will end up using
target_core_fabric_configfs.c code.  What struct config_groups from
target_core_fabric_configfs.c can be common across both SCSI target and
NVMe controller export..?

The folks for such a discussion would include:

   Christoph Hellwig, Hannes Reinecke, Dave Minturn, Sagi Grimberg,
   Ming Lin, Roland Dreier and Mike Christie.

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


Re: [PATCH-v2 1/3] target: Fix LUN_RESET active I/O handling for ACK_KREF

2016-01-27 Thread Nicholas A. Bellinger
On Tue, 2016-01-26 at 18:19 +0100, Christoph Hellwig wrote:
> > +static bool __target_check_io_state(struct se_cmd *se_cmd)
> > +{
> > +   struct se_session *sess = se_cmd->se_sess;
> > +
> > +   assert_spin_locked(_session->sess_cmd_lock);
> > +   WARN_ON_ONCE(!irqs_disabled());
> 
> Btw, I looked a the code and can't really see what sess_cmd_lock is
> supposed to protect here.
> 
> > +   sess = cmd->se_sess;
> > +   if (WARN_ON_ONCE(!sess))
> > +   continue;
> > +
> > +   spin_lock(>sess_cmd_lock);
> > +   rc = __target_check_io_state(cmd);
> > +   spin_unlock(>sess_cmd_lock);
> > +   if (!rc) {
> > +   printk("LUN_RESET I/O: non-zero 
> > kref_get_unless_zero\n");
> > +   continue;
> > +   }
> 
> And thus why we care about taking it here.

I'm still working on -v3 series to handle se_session shutdown during
this specific multi-port LUN_RESET case, and considering using the
existing se_cmd->cmd_wait_set bit to signal when this special case
happens.

Currently ->sess_cmd_lock is held in target_release_cmd_kref() and
target_sess_cmd_list_set_waiting() while checking and setting this
value.

--
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 07/11] qla2xxx: Avoid side effects when using endianizer macros.

2016-01-27 Thread Hannes Reinecke
On 01/26/2016 06:10 PM, Himanshu Madhani wrote:
> From: Joe Carnuccio 
> 
> Signed-off-by: Joe Carnuccio 
> Signed-off-by: Himanshu Madhani 
> ---
>  drivers/scsi/qla2xxx/qla_attr.c   |4 +-
>  drivers/scsi/qla2xxx/qla_dbg.c|  141 
> -
>  drivers/scsi/qla2xxx/qla_init.c   |   16 ++--
>  drivers/scsi/qla2xxx/qla_inline.h |4 +-
>  drivers/scsi/qla2xxx/qla_mbx.c|   16 ++--
>  drivers/scsi/qla2xxx/qla_sup.c|   23 +++---
>  6 files changed, 106 insertions(+), 98 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

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 10/11] qla2xxx: Set relogin flag when we fail to queue login requests.

2016-01-27 Thread Hannes Reinecke
On 01/26/2016 06:10 PM, Himanshu Madhani wrote:
> From: Chad Dupuis 
> 
> If we fail to queue an srb for an async login we should set the
> relogin flag so it will be retried as the reason for the queuing
> failure was most likely transient.  Failure to do this can lead to
> failed paths as login is never retried if the relogin flag is not
> set.
> 
> Signed-off-by: Chad Dupuis 
> Signed-off-by: Himanshu Madhani 
> ---
>  drivers/scsi/qla2xxx/qla_init.c |6 +-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
> index 8001c89..184b6b6 100644
> --- a/drivers/scsi/qla2xxx/qla_init.c
> +++ b/drivers/scsi/qla2xxx/qla_init.c
> @@ -157,8 +157,12 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t 
> *fcport,
>   if (data[1] & QLA_LOGIO_LOGIN_RETRIED)
>   lio->u.logio.flags |= SRB_LOGIN_RETRIED;
>   rval = qla2x00_start_sp(sp);
> - if (rval != QLA_SUCCESS)
> + if (rval != QLA_SUCCESS) {
> + fcport->flags &= ~FCF_ASYNC_SENT;
> + fcport->flags |= FCF_LOGIN_NEEDED;
> + set_bit(RELOGIN_NEEDED, >dpc_flags);
>   goto done_free_sp;
> + }
>  
>   ql_dbg(ql_dbg_disc, vha, 0x2072,
>   "Async-login - hdl=%x, loopid=%x portid=%02x%02x%02x "
> 
Reviewed-by: Hannes Reinecke 

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-v2 11/12] xen-scsiback: Convert to percpu_ida tag allocation

2016-01-27 Thread Juergen Gross
On 27/01/16 07:28, Nicholas A. Bellinger wrote:
> On Tue, 2016-01-26 at 10:45 +0100, Juergen Gross wrote:
>> On 25/01/16 09:11, Nicholas A. Bellinger wrote:
>>> From: Nicholas Bellinger 
>>>
>>> Cc: Juergen Gross 
>>> Cc: Hannes Reinecke 
>>> Cc: David Vrabel 
>>> Signed-off-by: Nicholas Bellinger 
>>> ---
>>>  drivers/xen/xen-scsiback.c | 163 
>>> -
>>>  1 file changed, 87 insertions(+), 76 deletions(-)
>>>
>>> diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
>>> index 594f8a7..640fb22 100644
>>> --- a/drivers/xen/xen-scsiback.c
>>> +++ b/drivers/xen/xen-scsiback.c
>>> @@ -190,7 +190,6 @@ module_param_named(max_buffer_pages, 
>>> scsiback_max_buffer_pages, int, 0644);
>>>  MODULE_PARM_DESC(max_buffer_pages,
>>>  "Maximum number of free pages to keep in backend buffer");
>>>  
>>> -static struct kmem_cache *scsiback_cachep;
>>>  static DEFINE_SPINLOCK(free_pages_lock);
>>>  static int free_pages_num;
>>>  static LIST_HEAD(scsiback_free_pages);
>>> @@ -322,7 +321,8 @@ static void scsiback_free_translation_entry(struct kref 
>>> *kref)
>>>  }
>>>  
>>>  static void scsiback_do_resp_with_sense(char *sense_buffer, int32_t result,
>>> -   uint32_t resid, struct vscsibk_pend *pending_req)
>>> +   uint32_t resid, struct vscsibk_pend *pending_req,
>>> +   uint16_t rqid)
>>>  {
>>> struct vscsiif_response *ring_res;
>>> struct vscsibk_info *info = pending_req->info;
>>
>> pending_req might be NULL now, so this will panic the system.
>>
> 
> Thanks for the review.
> 
> Added the following to propagate up original *info into
> scsiback_do_resp_with_sense() to address the early pending_req
> failure case.
> 
> https://git.kernel.org/cgit/linux/kernel/git/nab/target-pending.git/commit/?h=queue-next=5873f22a9b7c7aa16ff9a85074a07b739f1d06a5

Hmm, wouldn't it make more sense to split scsiback_do_resp_with_sense()
into two functions now? Something like:


diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
index ad4eb10..0d71467 100644
--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
@@ -321,11 +321,10 @@ static void scsiback_free_translation_entry(struct
kref *kref)
kfree(entry);
 }

-static void scsiback_do_resp_with_sense(char *sense_buffer, int32_t result,
-   uint32_t resid, struct vscsibk_pend *pending_req)
+static void scsiback_send_response(struct vscsibk_info *info,
+   char *sense_buffer, int32_t result, uint32_t resid, uint16_t rqid)
 {
struct vscsiif_response *ring_res;
-   struct vscsibk_info *info = pending_req->info;
int notify;
struct scsi_sense_hdr sshdr;
unsigned long flags;
@@ -337,7 +336,7 @@ static void scsiback_do_resp_with_sense(char
*sense_buffer, int32_t result,
info->ring.rsp_prod_pvt++;

ring_res->rslt   = result;
-   ring_res->rqid   = pending_req->rqid;
+   ring_res->rqid   = rqid;

if (sense_buffer != NULL &&
scsi_normalize_sense(sense_buffer, VSCSIIF_SENSE_BUFFERSIZE,
@@ -357,6 +356,13 @@ static void scsiback_do_resp_with_sense(char
*sense_buffer, int32_t result,

if (notify)
notify_remote_via_irq(info->irq);
+}
+
+static void scsiback_do_resp_with_sense(char *sense_buffer, int32_t result,
+   uint32_t resid, struct vscsibk_pend *pending_req)
+{
+   scsiback_send_response(pending_req->info, sense_buffer, result,
+  resid, pending_req->rqid);

if (pending_req->v2p)
kref_put(_req->v2p->kref,


And then call scsiback_send_response() directly in case pending_req
is NULL.


Juergen
--
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 05/11] qla2xxx: Add support for buffer to buffer credit value for ISP27XX.

2016-01-27 Thread Hannes Reinecke
On 01/26/2016 06:10 PM, Himanshu Madhani wrote:
> From: Sawan Chandak 
> 
> Signed-off-by: Sawan Chandak 
> Signed-off-by: Himanshu Madhani 
> ---
>  drivers/scsi/qla2xxx/qla_bsg.c |   55 
> 
>  drivers/scsi/qla2xxx/qla_bsg.h |   24 +
>  drivers/scsi/qla2xxx/qla_def.h |2 +
>  drivers/scsi/qla2xxx/qla_fw.h  |4 ++-
>  drivers/scsi/qla2xxx/qla_mbx.c |8 ++
>  5 files changed, 92 insertions(+), 1 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

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 09/11] qla2xxx: Enable T10-DIF for ISP27XX

2016-01-27 Thread Hannes Reinecke
On 01/26/2016 06:10 PM, Himanshu Madhani wrote:
> Signed-off-by: Himanshu Madhani 
> Signed-off-by: Giridhar Malavali 
> ---
>  drivers/scsi/qla2xxx/qla_os.c |3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

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 08/11] qla2xxx: Provide mbx info in BBCR data after mbx failure

2016-01-27 Thread Hannes Reinecke
On 01/26/2016 06:10 PM, Himanshu Madhani wrote:
> From: Harish Zunjarrao 
> 
> Signed-off-by: Harish Zunjarrao 
> Signed-off-by: Himanshu Madhani 
> ---
>  drivers/scsi/qla2xxx/qla_bsg.c |9 +++--
>  drivers/scsi/qla2xxx/qla_bsg.h |4 +++-
>  2 files changed, 10 insertions(+), 3 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

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 11/11] qla2xxx: Update driver version to 8.07.00.33-k

2016-01-27 Thread Hannes Reinecke
On 01/26/2016 06:10 PM, Himanshu Madhani wrote:
> Signed-off-by: Himanshu Madhani 
> ---
>  drivers/scsi/qla2xxx/qla_version.h |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_version.h 
> b/drivers/scsi/qla2xxx/qla_version.h
> index 6d31faa..0bc93fa 100644
> --- a/drivers/scsi/qla2xxx/qla_version.h
> +++ b/drivers/scsi/qla2xxx/qla_version.h
> @@ -7,7 +7,7 @@
>  /*
>   * Driver version
>   */
> -#define QLA2XXX_VERSION  "8.07.00.26-k"
> +#define QLA2XXX_VERSION  "8.07.00.33-k"
>  
>  #define QLA_DRIVER_MAJOR_VER 8
>  #define QLA_DRIVER_MINOR_VER 7
> 
Reviewed-by: Hannes Reinecke 

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


[PATCH] SCSI: Add Marvell Console to VPD blacklist

2016-01-27 Thread Mika Westerberg
I have a Marvell 88SE9230 SATA Controller that has some sort of
integrated console SCSI device attached to one of the ports.

  ata14: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
  ata14.00: ATAPI: MARVELL VIRTUALL, 1.09, max UDMA/66
  ata14.00: configured for UDMA/66
  scsi 13:0:0:0: Processor Marvell  Console 1.01 PQ: 0 ANSI: 5

Sending it VPD INQUIRY command seem to always fail with following error:

  ata14.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
  ata14.00: irq_stat 0x4001
  ata14.00: cmd a0/01:00:00:00:01/00:00:00:00:00/a0 tag 2 dma 16640 in
Inquiry 12 01 00 00 ff 00res 00/00:00:00:00:00/00:00:00:00:00/00 
Emask 0x3 (HSM violation)
  ata14: hard resetting link

This has been minor annoyance (only error printed on dmesg) until commit
09e2b0b14690 ("scsi: rescan VPD attributes") added call to scsi_attach_vpd()
in scsi_rescan_device(). The commit causes the system to splat out
following errors continuously without ever reaching the UI:

  ata14.00: configured for UDMA/66
  ata14: EH complete
  ata14.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
  ata14.00: irq_stat 0x4001
  ata14.00: cmd a0/01:00:00:00:01/00:00:00:00:00/a0 tag 6 dma 16640 in
Inquiry 12 01 00 00 ff 00res 00/00:00:00:00:00/00:00:00:00:00/00 
Emask 0x3 (HSM violation)
  ata14: hard resetting link
  ata14: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
  ata14.00: configured for UDMA/66
  ata14: EH complete
  ata14.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
  ata14.00: irq_stat 0x4001
  ata14.00: cmd a0/01:00:00:00:01/00:00:00:00:00/a0 tag 7 dma 16640 in
Inquiry 12 01 00 00 ff 00res 00/00:00:00:00:00/00:00:00:00:00/00 
Emask 0x3 (HSM violation)

Without in-depth understanding of SCSI layer and the Marvell controller, I
suspect this happens because when the link goes down (because of an error)
we schedule scsi_rescan_device() which again fails to read VPD data... ad
infinitum.

Since VPD data cannot be read from the device anyway we prevent the SCSI
layer from even trying by blacklisting the device. This gets away the error
and the system starts up normally.

Signed-off-by: Mika Westerberg 
Cc: Hannes Reinecke 
---
I'm not sure if this is most ideal fix. Comment on top of
scsi_static_device_list[] says that the list is going away eventually and
suggest me to use command line instead. I can do that but then everyone
else having similar device will need to do the same to get rid of the boot
failure.

 drivers/scsi/scsi_devinfo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index 47b9d13..350cbed 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -205,6 +205,7 @@ static struct {
{"Intel", "Multi-Flex", NULL, BLIST_NO_RSOC},
{"iRiver", "iFP Mass Driver", NULL, BLIST_NOT_LOCKABLE | 
BLIST_INQUIRY_36},
{"LASOUND", "CDX7405", "3.10", BLIST_MAX5LUN | BLIST_SINGLELUN},
+   {"Marvell", "Console", "1.01", BLIST_SKIP_VPD_PAGES},
{"MATSHITA", "PD-1", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
{"MATSHITA", "DMC-LC5", NULL, BLIST_NOT_LOCKABLE | BLIST_INQUIRY_36},
{"MATSHITA", "DMC-LC40", NULL, BLIST_NOT_LOCKABLE | BLIST_INQUIRY_36},
-- 
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 06/11] qla2xxx: Add support for Private link statistics counters.

2016-01-27 Thread Hannes Reinecke
On 01/26/2016 06:10 PM, Himanshu Madhani wrote:
> From: Harish Zunjarrao 
> 
> Signed-off-by: Harish Zunjarrao 
> Signed-off-by: Himanshu Madhani 
> ---
>  drivers/scsi/qla2xxx/qla_attr.c |6 ++-
>  drivers/scsi/qla2xxx/qla_bsg.c  |   61 
> +++
>  drivers/scsi/qla2xxx/qla_bsg.h  |1 +
>  drivers/scsi/qla2xxx/qla_dbg.c  |2 +-
>  drivers/scsi/qla2xxx/qla_def.h  |   32 +++-
>  drivers/scsi/qla2xxx/qla_mbx.c  |3 +-
>  6 files changed, 99 insertions(+), 6 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

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