[PATCH v2] mpt2sas: delay scsi_add_host call to work with scsi-mq

2014-07-14 Thread Reddy, Sreekanth

In _scsih_probe, delay the call to scsi_add_host until the host has been
fully set up.

Otherwise, the default .can_queue value of 1 causes scsi-mq to set the block
layer request queue size to its minimum size, resulting in awful performance.

In _scsih_probe error handling, call mpt3sas_base_detach rather than
scsi_remove_host to properly clean up in reverse order.

In _scsih_remove, call scsi_remove_host earlier to clean up in reverse order.

Signed-off-by: Robert Elliott elli...@hp.com
Signed-off-by: Christoph Hellwig h...@lst.de
Signed-off-by: Nagalakshmi Nandigama nagalakshmi.nandig...@avagotech.com
Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.c  |2 +-
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |   25 -
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c 
b/drivers/scsi/mpt2sas/mpt2sas_base.c
index b4b391d..20e2ff8 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -281,7 +281,7 @@ mpt2sas_base_stop_watchdog(struct MPT2SAS_ADAPTER *ioc)
ioc-fault_reset_work_q = NULL;
spin_unlock_irqrestore(ioc-ioc_reset_in_progress_lock, flags);
if (wq) {
-   if (!cancel_delayed_work(ioc-fault_reset_work))
+   if (!cancel_delayed_work_sync(ioc-fault_reset_work))
flush_workqueue(wq);
destroy_workqueue(wq);
}
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c 
b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index ed8b6c1..53c4764 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -2906,11 +2906,10 @@ _scsih_fw_event_cleanup_queue(struct MPT2SAS_ADAPTER 
*ioc)
return;
 
list_for_each_entry_safe(fw_event, next, ioc-fw_event_list, list) {
-   if (cancel_delayed_work(fw_event-delayed_work)) {
+   if (cancel_delayed_work_sync(fw_event-delayed_work)) {
_scsih_fw_event_free(ioc, fw_event);
continue;
}
-   fw_event-cancel_pending_work = 1;
}
 }
 
@@ -7514,7 +7513,7 @@ _firmware_event_work(struct work_struct *work)
struct MPT2SAS_ADAPTER *ioc = fw_event-ioc;
 
/* the queue is being flushed so ignore this event */
-   if (ioc-remove_host || fw_event-cancel_pending_work ||
+   if (ioc-remove_host ||
ioc-pci_error_recovery) {
_scsih_fw_event_free(ioc, fw_event);
return;
@@ -7970,9 +7969,9 @@ _scsih_remove(struct pci_dev *pdev)
}
 
sas_remove_host(shost);
+   scsi_remove_host(shost);
mpt2sas_base_detach(ioc);
list_del(ioc-list);
-   scsi_remove_host(shost);
scsi_host_put(shost);
 }
 
@@ -8313,13 +8312,6 @@ _scsih_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
}
}
 
-   if ((scsi_add_host(shost, pdev-dev))) {
-   printk(MPT2SAS_ERR_FMT failure at %s:%d/%s()!\n,
-   ioc-name, __FILE__, __LINE__, __func__);
-   list_del(ioc-list);
-   goto out_add_shost_fail;
-   }
-
/* register EEDP capabilities with SCSI layer */
if (prot_mask)
scsi_host_set_prot(shost, prot_mask);
@@ -8361,16 +8353,23 @@ _scsih_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
}
} else
ioc-hide_drives = 0;
+
+   if ((scsi_add_host(shost, pdev-dev))) {
+   printk(MPT2SAS_ERR_FMT failure at %s:%d/%s()!\n,
+   ioc-name, __FILE__, __LINE__, __func__);
+   goto out_add_shost_fail;
+   }
+
scsi_scan_host(shost);
 
return 0;
 
+ out_add_shost_fail:
+   mpt2sas_base_detach(ioc);
  out_attach_fail:
destroy_workqueue(ioc-firmware_event_thread);
  out_thread_fail:
list_del(ioc-list);
-   scsi_remove_host(shost);
- out_add_shost_fail:
scsi_host_put(shost);
return -ENODEV;
 }
-- 
1.7.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] mpt3sas: delay scsi_add_host call to work with scsi-mq

2014-07-14 Thread Reddy, Sreekanth

In _scsih_probe, delay the call to scsi_add_host until the host has been
fully set up.

Otherwise, the default .can_queue value of 1 causes scsi-mq to set the block
layer request queue size to its minimum size, resulting in awful performance.

In _scsih_probe error handling, call mpt3sas_base_detach rather than
scsi_remove_host to properly clean up in reverse order.

In _scsih_remove, call scsi_remove_host earlier to clean up in reverse order.

Signed-off-by: Robert Elliott elli...@hp.com
Signed-off-by: Christoph Hellwig h...@lst.de
Signed-off-by: Nagalakshmi Nandigama nagalakshmi.nandig...@avagotech.com
Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt3sas/mpt3sas_base.c  |2 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c |   26 --
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index cb5f879..b2817c7 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -266,7 +266,7 @@ mpt3sas_base_stop_watchdog(struct MPT3SAS_ADAPTER *ioc)
ioc-fault_reset_work_q = NULL;
spin_unlock_irqrestore(ioc-ioc_reset_in_progress_lock, flags);
if (wq) {
-   if (!cancel_delayed_work(ioc-fault_reset_work))
+   if (!cancel_delayed_work_sync(ioc-fault_reset_work))
flush_workqueue(wq);
destroy_workqueue(wq);
}
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 21b50c1..7c830af 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -2586,11 +2586,10 @@ _scsih_fw_event_cleanup_queue(struct MPT3SAS_ADAPTER 
*ioc)
return;
 
list_for_each_entry_safe(fw_event, next, ioc-fw_event_list, list) {
-   if (cancel_delayed_work(fw_event-delayed_work)) {
+   if (cancel_delayed_work_sync(fw_event-delayed_work)) {
_scsih_fw_event_free(ioc, fw_event);
continue;
}
-   fw_event-cancel_pending_work = 1;
}
 }
 
@@ -7077,7 +7076,7 @@ static void
 _mpt3sas_fw_work(struct MPT3SAS_ADAPTER *ioc, struct fw_event_work *fw_event)
 {
/* the queue is being flushed so ignore this event */
-   if (ioc-remove_host || fw_event-cancel_pending_work ||
+   if (ioc-remove_host ||
ioc-pci_error_recovery) {
_scsih_fw_event_free(ioc, fw_event);
return;
@@ -7482,9 +7481,9 @@ static void _scsih_remove(struct pci_dev *pdev)
}
 
sas_remove_host(shost);
+   scsi_remove_host(shost);
mpt3sas_base_detach(ioc);
list_del(ioc-list);
-   scsi_remove_host(shost);
scsi_host_put(shost);
 }
 
@@ -7852,13 +7851,6 @@ _scsih_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
}
}
 
-   if ((scsi_add_host(shost, pdev-dev))) {
-   pr_err(MPT3SAS_FMT failure at %s:%d/%s()!\n,
-   ioc-name, __FILE__, __LINE__, __func__);
-   list_del(ioc-list);
-   goto out_add_shost_fail;
-   }
-
/* register EEDP capabilities with SCSI layer */
if (prot_mask  0)
scsi_host_set_prot(shost, prot_mask);
@@ -7886,15 +7878,21 @@ _scsih_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
ioc-name, __FILE__, __LINE__, __func__);
goto out_attach_fail;
}
+   if ((scsi_add_host(shost, pdev-dev))) {
+   pr_err(MPT3SAS_FMT failure at %s:%d/%s()!\n,
+   ioc-name, __FILE__, __LINE__, __func__);
+   list_del(ioc-list);
+   goto out_add_shost_fail;
+   }
+
scsi_scan_host(shost);
return 0;
-
+out_add_shost_fail:
+   mpt3sas_base_detach(ioc);
  out_attach_fail:
destroy_workqueue(ioc-firmware_event_thread);
  out_thread_fail:
list_del(ioc-list);
-   scsi_remove_host(shost);
- out_add_shost_fail:
scsi_host_put(shost);
return -ENODEV;
 }
-- 
1.7.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][SCSI]mpt2sas: Description Patch

2014-06-25 Thread Reddy, Sreekanth
Just resending below set of patches which I have sent on 14th March 2014.
And I have removed below subjected patch since we have already have the
module parameter port_mask to disable EEDP support.
[PATCH 02/11][SCSI]mpt2sas: Added new driver module Parameter disable_eedp to 
Disable EEDP Support.

Please consider this patch set for next kernel release.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---

[RESEND][PATCH 01/10][SCSI]mpt2sas: Added driver module parameter 
max_msix_vectors.
[RESEND][PATCH 02/10][SCSI]mpt2sas: MPI2 Rev Y (2.00.17) and Rev Z (2.00.18) 
specifications.
[RESEND][PATCH 03/10][SCSI]mpt2sas: Copyright in driver sources is updated for 
year the 2014.
[RESEND][PATCH 04/10][SCSI]mpt2sas: Clear PFA Status on SGPIO when PFA Drive is 
Removed or Replaced.
[RESEND][PATCH 05/10][SCSI]mpt2sas: Bump mpt2sas driver version to 17.100.00.00.
[RESEND][PATCH 06/10][SCSI]mpt2sas: For 2TB volumes, DirectDrive support sends 
IO's with LBA bit 31 to IR FW instead of DirectDrive.
[RESEND][PATCH 07/10][SCSI]mpt2sas: Added Reply Descriptor Post Queue (RDPQ) 
Array support.
[RESEND][PATCH 08/10][SCSI]mpt2sas: Get IOC_FACTS information using handshake 
protocol only after HBA card gets into READY or Operational state.
[RESEND][PATCH 09/10][SCSI]mpt2sas: Added module parameter 'unblock_io' to 
unblock IO's during disk addition.
[RESEND][PATCH 10/10][SCSI]mpt2sas: Bump mpt2sas driver version to 18.100.00.00.
--
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


[RESEND][PATCH 01/10][SCSI]mpt2sas: Added driver module parameter max_msix_vectors

2014-06-25 Thread Reddy, Sreekanth
Added driver module parameter max_msix_vectors. Using this
module parameter the maximum number of MSI-X vectors could be set.

The number of MSI-X vectors used would be the minimum of MSI-X vectors
supported by the HBA, the number of CPU cores and the value set to
max_msix_vectors module parameters.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c 
b/drivers/scsi/mpt2sas/mpt2sas_base.c
index bde63f7..ed810fb 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -80,6 +80,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 max_msix_vectors = -1;
+module_param(max_msix_vectors, int, 0);
+MODULE_PARM_DESC(max_msix_vectors,  max msix vectors );
+
 static int mpt2sas_fwfault_debug;
 MODULE_PARM_DESC(mpt2sas_fwfault_debug,  enable detection of firmware fault 
and halt firmware - (default=0));
@@ -1420,6 +1424,16 @@ _base_enable_msix(struct MPT2SAS_ADAPTER *ioc)
ioc-reply_queue_count = min_t(int, ioc-cpu_count,
ioc-msix_vector_count);
 
+   if (max_msix_vectors  0) {
+   ioc-reply_queue_count = min_t(int, max_msix_vectors,
+   ioc-reply_queue_count);
+   ioc-msix_vector_count = ioc-reply_queue_count;
+   }
+
+   printk(MPT2SAS_INFO_FMT
+   MSI-X vectors supported: %d, no of cores: %d, max_msix_vectors: %d\n,
+ioc-name, ioc-msix_vector_count, ioc-cpu_count, max_msix_vectors);
+
entries = kcalloc(ioc-reply_queue_count, sizeof(struct msix_entry),
GFP_KERNEL);
if (!entries) {
-- 
1.7.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


[RESEND][PATCH 06/10][SCSI]mpt2sas: For 2TB volumes, DirectDrive support sends IO's with LBA bit 31 to IR FW instead of DirectDrive

2014-06-25 Thread Reddy, Sreekanth
There was a down casting of the volume max LBA from a U64 to a U32,
which is taken out and now the max LBA is set appropriately to U64.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |   14 ++
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c 
b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 6ae109b..4a0728a 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -3865,7 +3865,8 @@ _scsih_setup_direct_io(struct MPT2SAS_ADAPTER *ioc, 
struct scsi_cmnd *scmd,
struct _raid_device *raid_device, Mpi2SCSIIORequest_t *mpi_request,
u16 smid)
 {
-   u32 v_lba, p_lba, stripe_off, stripe_unit, column, io_size;
+   u32 p_lba, stripe_off, stripe_unit, column, io_size;
+   u64 v_lba;
u32 stripe_sz, stripe_exp;
u8 num_pds, *cdb_ptr, i;
u8 cdb0 = scmd-cmnd[0];
@@ -3882,12 +3883,17 @@ _scsih_setup_direct_io(struct MPT2SAS_ADAPTER *ioc, 
struct scsi_cmnd *scmd,
| cdb_ptr[5])) {
io_size = scsi_bufflen(scmd) 
raid_device-block_exponent;
-   i = (cdb0  READ_16) ? 2 : 6;
+
/* get virtual lba */
-   v_lba = be32_to_cpu(*(__be32 *)(cdb_ptr[i]));
+   if (cdb0  READ_16)
+   v_lba = be32_to_cpu(*(__be32 *)(cdb_ptr[2]));
+   else
+   v_lba = be64_to_cpu(*(__be64 *)(cdb_ptr[2]));
+
+   i = (cdb0  READ_16) ? 2 : 6;
 
if (((u64)v_lba + (u64)io_size - 1) =
-   (u32)raid_device-max_lba) {
+   raid_device-max_lba) {
stripe_sz = raid_device-stripe_sz;
stripe_exp = raid_device-stripe_exponent;
stripe_off = v_lba  (stripe_sz - 1);
-- 
1.7.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


[RESEND][PATCH 05/10][SCSI]mpt2sas: Bump mpt2sas driver version to 17.100.00.00

2014-06-25 Thread Reddy, Sreekanth
Bump mpt2sas driver version to 17.100.00.00.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h 
b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 80d26c1..0a6747a 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -69,8 +69,8 @@
 #define MPT2SAS_DRIVER_NAMEmpt2sas
 #define MPT2SAS_AUTHOR LSI Corporation dl-mptfusionli...@lsi.com
 #define MPT2SAS_DESCRIPTIONLSI MPT Fusion SAS 2.0 Device Driver
-#define MPT2SAS_DRIVER_VERSION 16.100.00.00
-#define MPT2SAS_MAJOR_VERSION  16
+#define MPT2SAS_DRIVER_VERSION 17.100.00.00
+#define MPT2SAS_MAJOR_VERSION  17
 #define MPT2SAS_MINOR_VERSION  100
 #define MPT2SAS_BUILD_VERSION  00
 #define MPT2SAS_RELEASE_VERSION00
-- 
1.7.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


[RESEND][PATCH 07/10][SCSI]mpt2sas: Added Reply Descriptor Post Queue (RDPQ) Array support

2014-06-25 Thread Reddy, Sreekanth
Up to now, Driver allocates a single contiguous block of memory
pool for all reply queues and passes down a single address in the
ReplyDescriptorPostQueueAddress field of the IOC Init Request
Message to the firmware.

When firmware receives this address, it will program each of the
Reply Descriptor Post Queue registers, as each reply queue has its
own register. Thus the firmware, starting from a base address it
determines the starting address of the subsequent reply queues
through some simple arithmetic calculations.

The size of this contiguous block of memory pool is directly proportional
to number of MSI-X vectors and the HBA queue depth. For example higher
MSIX vectors requires larger contiguous block of memory pool.

But some of the OS kernels are unable to allocate this larger
contiguous block of memory pool.

So, the proposal is to allocate memory independently for each
Reply Queue and pass down all of the addresses to the firmware.
Then the firmware will just take each address and program the value
into the correct register.

When HBAs with older firmware(i.e. without RDPQ capability) is used
with this new driver then the max_msix_vectors value would be set
to 8 by default.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.c |  923 +--
 drivers/scsi/mpt2sas/mpt2sas_base.h |   18 +-
 2 files changed, 558 insertions(+), 383 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c 
b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 774720f..81f1d58 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -1427,6 +1427,9 @@ _base_enable_msix(struct MPT2SAS_ADAPTER *ioc)
ioc-reply_queue_count = min_t(int, ioc-cpu_count,
ioc-msix_vector_count);
 
+   if (!ioc-rdpq_array_enable  max_msix_vectors == -1)
+   max_msix_vectors = 8;
+
if (max_msix_vectors  0) {
ioc-reply_queue_count = min_t(int, max_msix_vectors,
ioc-reply_queue_count);
@@ -1480,6 +1483,335 @@ _base_enable_msix(struct MPT2SAS_ADAPTER *ioc)
 }
 
 /**
+ * _base_wait_for_doorbell_int - waiting for controller interrupt(generated by
+ * a write to the doorbell)
+ * @ioc: per adapter object
+ * @timeout: timeout in second
+ * @sleep_flag: CAN_SLEEP or NO_SLEEP
+ *
+ * Returns 0 for success, non-zero for failure.
+ *
+ * Notes: MPI2_HIS_IOC2SYS_DB_STATUS - set to one when IOC writes to doorbell.
+ */
+static int
+_base_wait_for_doorbell_int(struct MPT2SAS_ADAPTER *ioc, int timeout,
+   int sleep_flag)
+{
+   u32 cntdn, count;
+   u32 int_status;
+
+   count = 0;
+   cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout;
+   do {
+   int_status = readl(ioc-chip-HostInterruptStatus);
+   if (int_status  MPI2_HIS_IOC2SYS_DB_STATUS) {
+   dhsprintk(ioc, printk(MPT2SAS_INFO_FMT
+   %s: successful count(%d), timeout(%d)\n,
+   ioc-name, __func__, count, timeout));
+   return 0;
+   }
+   if (sleep_flag == CAN_SLEEP)
+   msleep(1);
+   else
+   udelay(500);
+   count++;
+   } while (--cntdn);
+
+   printk(MPT2SAS_ERR_FMT
+   %s: failed due to timeout count(%d), int_status(%x)!\n,
+   ioc-name, __func__, count, int_status);
+   return -EFAULT;
+}
+
+/**
+ * _base_wait_for_doorbell_ack - waiting for controller to read the doorbell.
+ * @ioc: per adapter object
+ * @timeout: timeout in second
+ * @sleep_flag: CAN_SLEEP or NO_SLEEP
+ *
+ * Returns 0 for success, non-zero for failure.
+ *
+ * Notes: MPI2_HIS_SYS2IOC_DB_STATUS - set to one when host writes to
+ * doorbell.
+ */
+static int
+_base_wait_for_doorbell_ack(struct MPT2SAS_ADAPTER *ioc, int timeout,
+   int sleep_flag)
+{
+   u32 cntdn, count;
+   u32 int_status;
+   u32 doorbell;
+
+   count = 0;
+   cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout;
+   do {
+   int_status = readl(ioc-chip-HostInterruptStatus);
+   if (!(int_status  MPI2_HIS_SYS2IOC_DB_STATUS)) {
+   dhsprintk(ioc, printk(MPT2SAS_INFO_FMT
+   %s: successful count(%d), timeout(%d)\n,
+   ioc-name, __func__, count, timeout));
+   return 0;
+   } else if (int_status  MPI2_HIS_IOC2SYS_DB_STATUS) {
+   doorbell = readl(ioc-chip-Doorbell);
+   if ((doorbell  MPI2_IOC_STATE_MASK) ==
+   MPI2_IOC_STATE_FAULT) {
+   mpt2sas_base_fault_info(ioc , doorbell);
+   return -EFAULT;
+   }
+   } else if (int_status == 0x)
+   goto out;
+
+   if 

[RESEND][PATCH 09/10][SCSI]mpt2sas: Added module parameter 'unblock_io' to unblock IO's during disk addition

2014-06-25 Thread Reddy, Sreekanth

During hot-plugging of a disk(having a flaky link) the disk addition
stops and any further disk addition or removal doesn't happen on that 
controller.

This is because, when driver receives DELAY_NOT_RESPONDING for a disk when it 
is undergoing
addition in the SCSI Mid layer, the driver would block the I/O to that disk
resulting in a deadlock. i.e the disk addition work couldn't be completed
as it can't send any I/O to the disk as I/Os are blocked. Any device removal 
(TARGET_NOT_RESPONDING)
or link update(RC_PHY_CHANGED) couldn't be processed as they are in the queue
to get processed after disk addition.

Description of Change:
To handle such cases, unblock the I/Os to the disk in ISR context if the disk 
is undergoing
addition. The I/Os would get unblocked only if the driver receives 
RC_PHY_CHANGED reason
code when the device addition is within the SAS Transport layer.

An module parameter 'unblock_io' is introduced which needs to be set to have 
this
functionality enabled. By default this functionality is disabled.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.h  |3 +
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |   67 ++---
 drivers/scsi/mpt2sas/mpt2sas_transport.c |   13 ++
 3 files changed, 76 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h 
b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 32181a6..7de7ba4 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -356,6 +356,8 @@ struct _internal_cmd {
  * @phy: phy identifier provided in sas device page 0
  * @responding: used in _scsih_sas_device_mark_responding
  * @pfa_led_on: flag for PFA LED status
+ * @pend_sas_rphy_add: flag to check if device is in sas_rphy_add()
+ * addition routine
  */
 struct _sas_device {
struct list_head list;
@@ -375,6 +377,7 @@ struct _sas_device {
u8  phy;
u8  responding;
u8  pfa_led_on;
+   u8  pend_sas_rphy_add;
 };
 
 /**
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c 
b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 4a0728a..b08d8fd 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -105,6 +105,11 @@ static int missing_delay[2] = {-1, -1};
 module_param_array(missing_delay, int, NULL, 0);
 MODULE_PARM_DESC(missing_delay,  device missing delay , io missing delay);
 
+static int unblock_io;
+module_param(unblock_io, int, 0);
+MODULE_PARM_DESC(unblock_io,
+unblocks I/O if set to 1 when device is undergoing addition (default=0));
+
 /* scsi-mid layer global parmeter is max_report_luns, which is 511 */
 #define MPT2SAS_MAX_LUN (16895)
 static int max_lun = MPT2SAS_MAX_LUN;
@@ -2972,6 +2977,34 @@ _scsih_ublock_io_device(struct MPT2SAS_ADAPTER *ioc, u64 
sas_address)
 }
 
 /**
+ * _scsih_ublock_io_device_to_running - set the device state to SDEV_RUNNING
+ * @ioc: per adapter object
+ * @sas_addr: sas address
+ *
+ * unblock the device to receive IO during device addition. Device
+ * responsiveness is not checked before unblocking
+ */
+static void
+_scsih_ublock_io_device_to_running(struct MPT2SAS_ADAPTER *ioc, u64 
sas_address)
+{
+   struct MPT2SAS_DEVICE *sas_device_priv_data;
+   struct scsi_device *sdev;
+
+   shost_for_each_device(sdev, ioc-shost) {
+   sas_device_priv_data = sdev-hostdata;
+   if (!sas_device_priv_data)
+   continue;
+   if (sas_device_priv_data-sas_target-sas_address
+   != sas_address)
+   continue;
+   if (sas_device_priv_data-block) {
+   sas_device_priv_data-block = 0;
+   scsi_internal_device_unblock(sdev, SDEV_RUNNING);
+   }
+   }
+}
+
+/**
  * _scsih_block_io_all_device - set the device state to SDEV_BLOCK
  * @ioc: per adapter object
  * @handle: device handle
@@ -3081,21 +3114,23 @@ _scsih_block_io_to_children_attached_to_ex(struct 
MPT2SAS_ADAPTER *ioc,
 }
 
 /**
- * _scsih_block_io_to_children_attached_directly
+ * _scsih_handle_io_to_children_attached_directly
  * @ioc: per adapter object
  * @event_data: topology change event data
  *
- * This routine set sdev state to SDEV_BLOCK for all devices
- * direct attached during device pull.
+ * This routine set sdev state to SDEV_BLOCK or SDEV_RUNNING for all devices
+ * direct attached during device pull/reconnect.
  */
 static void
-_scsih_block_io_to_children_attached_directly(struct MPT2SAS_ADAPTER *ioc,
-Mpi2EventDataSasTopologyChangeList_t *event_data)
+_scsih_handle_io_to_children_attached_directly(struct MPT2SAS_ADAPTER *ioc,
+   Mpi2EventDataSasTopologyChangeList_t *event_data)
 {
int i;
u16 handle;
u16 reason_code;
u8 phy_number;
+   struct _sas_device *sas_device;
+   u8 link_rate, prev_link_rate;
 
for (i = 0; i  event_data-NumEntries; 

[RESEND][PATCH 08/10][SCSI]mpt2sas: Get IOC_FACTS information using handshake protocol only after HBA card gets into READY or Operational state

2014-06-25 Thread Reddy, Sreekanth
The driver would send IOC facts only if HBA is in operational or ready
state. If it is in fault state, a diagnostic reset would be issued. It
would wait for 10 seconds to exit out of reset state. If the HBA continues
to be in reset state, then the HBA wouldn't be claimed by the driver.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.c |  416 ---
 1 files changed, 239 insertions(+), 177 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c 
b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 81f1d58..697c841 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -1737,6 +1737,238 @@ _base_handshake_req_reply_wait(struct MPT2SAS_ADAPTER 
*ioc, int request_bytes,
 }
 
 /**
+ * mpt2sas_base_get_iocstate - Get the current state of a MPT adapter.
+ * @ioc: Pointer to MPT_ADAPTER structure
+ * @cooked: Request raw or cooked IOC state
+ *
+ * Returns all IOC Doorbell register bits if cooked==0, else just the
+ * Doorbell bits in MPI_IOC_STATE_MASK.
+ */
+u32
+mpt2sas_base_get_iocstate(struct MPT2SAS_ADAPTER *ioc, int cooked)
+{
+   u32 s, sc;
+
+   s = readl(ioc-chip-Doorbell);
+   sc = s  MPI2_IOC_STATE_MASK;
+   return cooked ? sc : s;
+}
+
+/**
+ * _base_wait_on_iocstate - waiting on a particular ioc state
+ * @ioc_state: controller state { READY, OPERATIONAL, or RESET }
+ * @timeout: timeout in second
+ * @sleep_flag: CAN_SLEEP or NO_SLEEP
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+static int
+_base_wait_on_iocstate(struct MPT2SAS_ADAPTER *ioc, u32 ioc_state, int timeout,
+   int sleep_flag)
+{
+   u32 count, cntdn;
+   u32 current_state;
+
+   count = 0;
+   cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout;
+   do {
+   current_state = mpt2sas_base_get_iocstate(ioc, 1);
+   if (current_state == ioc_state)
+   return 0;
+   if (count  current_state == MPI2_IOC_STATE_FAULT)
+   break;
+   if (sleep_flag == CAN_SLEEP)
+   msleep(1);
+   else
+   udelay(500);
+   count++;
+   } while (--cntdn);
+
+   return current_state;
+}
+
+/**
+ * _base_diag_reset - the big hammer start of day reset
+ * @ioc: per adapter object
+ * @sleep_flag: CAN_SLEEP or NO_SLEEP
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+static int
+_base_diag_reset(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
+{
+   u32 host_diagnostic;
+   u32 ioc_state;
+   u32 count;
+   u32 hcb_size;
+
+   printk(MPT2SAS_INFO_FMT sending diag reset !!\n, ioc-name);
+
+   drsprintk(ioc, printk(MPT2SAS_INFO_FMT clear interrupts\n,
+   ioc-name));
+
+   count = 0;
+   do {
+   /* Write magic sequence to WriteSequence register
+* Loop until in diagnostic mode
+*/
+   drsprintk(ioc, printk(MPT2SAS_INFO_FMT write magic sequence\n
+   , ioc-name));
+   writel(MPI2_WRSEQ_FLUSH_KEY_VALUE, ioc-chip-WriteSequence);
+   writel(MPI2_WRSEQ_1ST_KEY_VALUE, ioc-chip-WriteSequence);
+   writel(MPI2_WRSEQ_2ND_KEY_VALUE, ioc-chip-WriteSequence);
+   writel(MPI2_WRSEQ_3RD_KEY_VALUE, ioc-chip-WriteSequence);
+   writel(MPI2_WRSEQ_4TH_KEY_VALUE, ioc-chip-WriteSequence);
+   writel(MPI2_WRSEQ_5TH_KEY_VALUE, ioc-chip-WriteSequence);
+   writel(MPI2_WRSEQ_6TH_KEY_VALUE, ioc-chip-WriteSequence);
+
+   /* wait 100 msec */
+   if (sleep_flag == CAN_SLEEP)
+   msleep(100);
+   else
+   mdelay(100);
+
+   if (count++  20)
+   goto out;
+
+   host_diagnostic = readl(ioc-chip-HostDiagnostic);
+   drsprintk(ioc, printk(MPT2SAS_INFO_FMT
+ wrote magic sequence: count(%d), host_diagnostic(0x%08x)\n,
+ ioc-name, count, host_diagnostic));
+
+   } while ((host_diagnostic  MPI2_DIAG_DIAG_WRITE_ENABLE) == 0);
+
+   hcb_size = readl(ioc-chip-HCBSize);
+
+   drsprintk(ioc, printk(MPT2SAS_INFO_FMT diag reset: issued\n,
+   ioc-name));
+   writel(host_diagnostic | MPI2_DIAG_RESET_ADAPTER,
+ioc-chip-HostDiagnostic);
+
+   /*This delay allows the chip PCIe hardware time to finish reset tasks*/
+   if (sleep_flag == CAN_SLEEP)
+   msleep(MPI2_HARD_RESET_PCIE_FIRST_READ_DELAY_MICRO_SEC/1000);
+   else
+   mdelay(MPI2_HARD_RESET_PCIE_FIRST_READ_DELAY_MICRO_SEC/1000);
+
+   /* Approximately 300 second max wait */
+   for (count = 0; count  (3 /
+   MPI2_HARD_RESET_PCIE_SECOND_READ_DELAY_MICRO_SEC); count++) {
+
+   host_diagnostic = readl(ioc-chip-HostDiagnostic);
+
+   if 

[RESEND][PATCH 10/10][SCSI]mpt2sas: Bump mpt2sas driver version to 18.100.00.00

2014-06-25 Thread Reddy, Sreekanth
Bump mpt2sas driver version to 18.100.00.00.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h 
b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 6dbbaba..cc49cbf 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -69,8 +69,8 @@
 #define MPT2SAS_DRIVER_NAMEmpt2sas
 #define MPT2SAS_AUTHOR LSI Corporation dl-mptfusionli...@lsi.com
 #define MPT2SAS_DESCRIPTIONLSI MPT Fusion SAS 2.0 Device Driver
-#define MPT2SAS_DRIVER_VERSION 17.100.00.00
-#define MPT2SAS_MAJOR_VERSION  17
+#define MPT2SAS_DRIVER_VERSION 18.100.00.00
+#define MPT2SAS_MAJOR_VERSION  18
 #define MPT2SAS_MINOR_VERSION  100
 #define MPT2SAS_BUILD_VERSION  00
 #define MPT2SAS_RELEASE_VERSION00
-- 
1.7.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][SCSI]mpt3sas: Description Patch

2014-06-25 Thread Reddy, Sreekanth
Just resending below set of patches which I have sent on 14th March 2014.
And I have removed below subjected patch since we have already have the
module parameter port_mask to disable EEDP support.
[PATCH 1/9][SCSI]mpt3sas: Added new driver module Parameter disable_eedp to 
Disable EEDP Support.

Please consider this patch set for next kernel release.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---

[RESEND][PATCH 1/8][SCSI]mpt3sas: MPI2.5 Rev G (2.5.2) specifications.
[RESEND][PATCH 2/8][SCSI]mpt3sas: Clear PFA Status on SGPIO when PFA Drive is 
Removed or Replaced.
[RESEND][PATCH 3/8][SCSI]mpt3sas: Bump mpt3sas driver version to 03.100.00.00.
[RESEND][PATCH 4/8][SCSI]mpt3sas: MPI2.5 Rev H (2.5.3) specifications.
[RESEND][PATCH 5/8][SCSI]mpt3sas: Copyright in driver sources is updated for 
year the 2014.
[RESEND][PATCH 6/8][SCSI]mpt3sas: Added OEM branding Strings.
[RESEND][PATCH 7/8][SCSI]mpt3sas: Added Reply Descriptor Post Queue (RDPQ) 
Array support.
[RESEND][PATCH 8/8][SCSI]mpt3sas: Bump mpt3sas driver version to 04.100.00.00.
--
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


[RESEND][PATCH 1/8][SCSI]mpt3sas: MPI2.5 Rev G (2.5.2) specifications

2014-06-25 Thread Reddy, Sreekanth
Below is the change set in MPI2.5 Rev G specification and 2.00.31 header files
1) Added SCSIStatusQualifier to SCSI IO Error Reply message.
2) Added ATA Security Freeze Lock to IO Unit Page 1 Flags field.
3) Added Allow Protection Information bit for IR Volume Create.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt3sas/mpi/mpi2.h  |6 --
 drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h |8 ++--
 drivers/scsi/mpt3sas/mpi/mpi2_init.h |6 --
 drivers/scsi/mpt3sas/mpi/mpi2_raid.h |6 +-
 4 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpi/mpi2.h b/drivers/scsi/mpt3sas/mpi/mpi2.h
index 20da8f9..dc143dd 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.29
+ * mpi2.h Version:  02.00.31
  *
  * 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
@@ -86,6 +86,8 @@
  * 11-27-12  02.00.28  Bumped MPI2_HEADER_VERSION_UNIT.
  * 12-20-12  02.00.29  Bumped MPI2_HEADER_VERSION_UNIT.
  * Added MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET.
+ * 04-09-13  02.00.30  Bumped MPI2_HEADER_VERSION_UNIT.
+ * 04-17-13  02.00.31  Bumped MPI2_HEADER_VERSION_UNIT.
  * --
  */
 
@@ -119,7 +121,7 @@
 #define MPI2_VERSION_02_05  (0x0205)
 
 /*Unit and Dev versioning for this MPI header set */
-#define MPI2_HEADER_VERSION_UNIT(0x1D)
+#define MPI2_HEADER_VERSION_UNIT(0x1F)
 #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 889aa70..5b0e5c1 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.24
+ *   mpi2_cnfg.h Version:  02.00.25
  *
  * 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
@@ -160,6 +160,9 @@
  * 12-20-12  02.00.24  Marked MPI2_SASIOUNIT1_CONTROL_CLEAR_AFFILIATION as
  * obsolete for MPI v2.5 and later.
  * Added some defines for 12G SAS speeds.
+ * 04-09-13  02.00.25  Added MPI2_IOUNITPAGE1_ATA_SECURITY_FREEZE_LOCK.
+ * Fixed MPI2_IOUNITPAGE5_DMA_CAP_MASK_MAX_REQUESTS to
+ * match the specification.
  * --
  */
 
@@ -792,6 +795,7 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_1 {
 #define MPI2_IOUNITPAGE1_PAGEVERSION(0x04)
 
 /*IO Unit Page 1 Flags defines */
+#define MPI2_IOUNITPAGE1_ATA_SECURITY_FREEZE_LOCK   (0x4000)
 #define MPI25_IOUNITPAGE1_NEW_DEVICE_FAST_PATH_DISABLE  (0x2000)
 #define MPI25_IOUNITPAGE1_DISABLE_FAST_PATH (0x1000)
 #define MPI2_IOUNITPAGE1_ENABLE_HOST_BASED_DISCOVERY(0x0800)
@@ -870,7 +874,7 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_5 {
 #define MPI2_IOUNITPAGE5_PAGEVERSION(0x00)
 
 /*defines for IO Unit Page 5 DmaEngineCapabilities field */
-#define MPI2_IOUNITPAGE5_DMA_CAP_MASK_MAX_REQUESTS  (0xFF00)
+#define MPI2_IOUNITPAGE5_DMA_CAP_MASK_MAX_REQUESTS  (0x)
 #define MPI2_IOUNITPAGE5_DMA_CAP_SHIFT_MAX_REQUESTS (16)
 
 #define MPI2_IOUNITPAGE5_DMA_CAP_EEDP   (0x0008)
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_init.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_init.h
index f7928bf..b3e3331 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_init.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_init.h
@@ -6,7 +6,7 @@
  * Title:  MPI SCSI initiator mode messages and structures
  * Creation Date:  June 23, 2006
  *
- * mpi2_init.h Version:  02.00.14
+ * mpi2_init.h Version:  02.00.15
  *
  * 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
@@ -44,6 +44,8 @@
  * Priority to match SAM-4.
  * Added EEDPErrorOffset to MPI2_SCSI_IO_REPLY.
  * 07-10-12  02.00.14  Added MPI2_SCSIIO_CONTROL_SHIFT_DATADIRECTION.
+ * 04-09-13  02.00.15  Added SCSIStatusQualifier field to MPI2_SCSI_IO_REPLY,
+ * replacing the Reserved4 field.
  * --
  */
 
@@ -347,7 +349,7 @@ typedef struct _MPI2_SCSI_IO_REPLY {
U32 SenseCount; /*0x18 */
U32 ResponseInfo;   /*0x1C */
U16 TaskTag;

[RESEND][PATCH 2/8][SCSI]mpt3sas: Clear PFA Status on SGPIO when PFA Drive is Removed or Replaced

2014-06-25 Thread Reddy, Sreekanth
Added code to send an SEP message that turns off the Predictive
Failure LED when a drive is removed (if Predictive Failure LED was turned on).

Added a new flag 'pfa_led_on' per device that tracks the status of Predictive
Failure LED. When the drive is removed, this flag is checked and
sends an SEP message to turn off the respective Predictive Failure LED.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt3sas/mpt3sas_base.h  |5 ++-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c |   67 +-
 2 files changed, 61 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h 
b/drivers/scsi/mpt3sas/mpt3sas_base.h
index b1494ce..3007521 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -272,8 +272,10 @@ struct _internal_cmd {
  * @channel: target channel
  * @slot: number number
  * @phy: phy identifier provided in sas device page 0
- * @fast_path: fast path feature enable bit
  * @responding: used in _scsih_sas_device_mark_responding
+ * @fast_path: fast path feature enable bit
+ * @pfa_led_on: flag for PFA LED status
+ *
  */
 struct _sas_device {
struct list_head list;
@@ -293,6 +295,7 @@ struct _sas_device {
u8  phy;
u8  responding;
u8  fast_path;
+   u8  pfa_led_on;
 };
 
 /**
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 1056cbf..905c82c 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -162,7 +162,7 @@ struct sense_info {
 };
 
 #define MPT3SAS_PROCESS_TRIGGER_DIAG (0xFFFB)
-#define MPT3SAS_TURN_ON_FAULT_LED (0xFFFC)
+#define MPT3SAS_TURN_ON_PFA_LED (0xFFFC)
 #define MPT3SAS_PORT_ENABLE_COMPLETE (0xFFFD)
 #define MPT3SAS_ABRT_TASK_SET (0xFFFE)
 #define MPT3SAS_REMOVE_UNRESPONDING_DEVICES (0x)
@@ -3903,7 +3903,7 @@ _scsih_scsi_ioc_info(struct MPT3SAS_ADAPTER *ioc, struct 
scsi_cmnd *scmd,
 #endif
 
 /**
- * _scsih_turn_on_fault_led - illuminate Fault LED
+ * _scsih_turn_on_pfa_led - illuminate PFA LED
  * @ioc: per adapter object
  * @handle: device handle
  * Context: process
@@ -3911,10 +3911,15 @@ _scsih_scsi_ioc_info(struct MPT3SAS_ADAPTER *ioc, 
struct scsi_cmnd *scmd,
  * Return nothing.
  */
 static void
-_scsih_turn_on_fault_led(struct MPT3SAS_ADAPTER *ioc, u16 handle)
+_scsih_turn_on_pfa_led(struct MPT3SAS_ADAPTER *ioc, u16 handle)
 {
Mpi2SepReply_t mpi_reply;
Mpi2SepRequest_t mpi_request;
+   struct _sas_device *sas_device;
+
+   sas_device = _scsih_sas_device_find_by_handle(ioc, handle);
+   if (!sas_device)
+   return;
 
memset(mpi_request, 0, sizeof(Mpi2SepRequest_t));
mpi_request.Function = MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR;
@@ -3929,6 +3934,7 @@ _scsih_turn_on_fault_led(struct MPT3SAS_ADAPTER *ioc, u16 
handle)
__FILE__, __LINE__, __func__);
return;
}
+   sas_device-pfa_led_on = 1;
 
if (mpi_reply.IOCStatus || mpi_reply.IOCLogInfo) {
dewtprintk(ioc, pr_info(MPT3SAS_FMT
@@ -3938,9 +3944,46 @@ _scsih_turn_on_fault_led(struct MPT3SAS_ADAPTER *ioc, 
u16 handle)
return;
}
 }
+/**
+ * _scsih_turn_off_pfa_led - turn off Fault LED
+ * @ioc: per adapter object
+ * @sas_device: sas device whose PFA LED has to turned off
+ * Context: process
+ *
+ * Return nothing.
+ */
+static void
+_scsih_turn_off_pfa_led(struct MPT3SAS_ADAPTER *ioc,
+   struct _sas_device *sas_device)
+{
+   Mpi2SepReply_t mpi_reply;
+   Mpi2SepRequest_t mpi_request;
 
+   memset(mpi_request, 0, sizeof(Mpi2SepRequest_t));
+   mpi_request.Function = MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR;
+   mpi_request.Action = MPI2_SEP_REQ_ACTION_WRITE_STATUS;
+   mpi_request.SlotStatus = 0;
+   mpi_request.Slot = cpu_to_le16(sas_device-slot);
+   mpi_request.DevHandle = 0;
+   mpi_request.EnclosureHandle = cpu_to_le16(sas_device-enclosure_handle);
+   mpi_request.Flags = MPI2_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS;
+   if ((mpt3sas_base_scsi_enclosure_processor(ioc, mpi_reply,
+   mpi_request)) != 0) {
+   printk(MPT3SAS_FMT failure at %s:%d/%s()!\n, ioc-name,
+   __FILE__, __LINE__, __func__);
+   return;
+   }
+
+   if (mpi_reply.IOCStatus || mpi_reply.IOCLogInfo) {
+   dewtprintk(ioc, printk(MPT3SAS_FMT
+enclosure_processor: ioc_status (0x%04x), loginfo(0x%08x)\n,
+ioc-name, le16_to_cpu(mpi_reply.IOCStatus),
+le32_to_cpu(mpi_reply.IOCLogInfo)));
+   return;
+   }
+}
 /**
- * _scsih_send_event_to_turn_on_fault_led - fire delayed event
+ * _scsih_send_event_to_turn_on_pfa_led - fire delayed event
  * @ioc: per adapter object
  * @handle: device handle
  * Context: interrupt.
@@ -3948,14 +3991,14 @@ _scsih_turn_on_fault_led(struct MPT3SAS_ADAPTER 

[RESEND][PATCH 4/8][SCSI]mpt3sas: MPI2.5 Rev H (2.5.3) specifications

2014-06-25 Thread Reddy, Sreekanth
Below is the change set in MPI2.5 Rev H specification and 2.00.32 header files
1) Added reserved fields to IO Unit Page 7 for future use.
2) Added optional functionality to IOCInit Request so that
   the host may specify a separate base address for each
   Reply Descriptor Post Queue. IOC support for this is
   indicated using a new IOCCapabilities bit in the IOCFacts Reply.
3) Added Toolbox Console Text Display Tool
   The host uses the Console Text Display Tool to send a string to
   IOC's Console using different console types (eg: UART serial terminal or 
Ethernet terminal).
4) Firmware images can now be signed using an encrypted hash.
5) Added MPI2_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL
6) Added more details about configuration page restrictions when Host Based 
Discovery is enabled
   Enabling host based discovery affects the availability of some configuration 
pages and events.
   The SAS Expander, SAS Device, and SAS Enclosure configuration  pages are not 
available from the IOC.
   The IOC returns an error status to any Configuration Request message 
attempting to access these pages.
   The IOC does not send the SAS Discovery Event, the SAS Topology Change List 
Event, or
   the SAS Enclosure Device Status Change Event when host based discovery is 
enabled.
7) Bit 13 of the SAS IO Unit Page 1 ControlFlags field is now obsolete.
   It was used to enable limiting direct attached SATA maximum link rate to 1.5 
Gbps.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h |   10 -
 drivers/scsi/mpt3sas/mpi/mpi2_ioc.h  |   62 -
 drivers/scsi/mpt3sas/mpi/mpi2_sas.h  |6 ++-
 drivers/scsi/mpt3sas/mpi/mpi2_tool.h |   43 +++-
 4 files changed, 114 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
index 5b0e5c1..becee07 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.25
+ *   mpi2_cnfg.h Version:  02.00.26
  *
  * 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
@@ -163,6 +163,8 @@
  * 04-09-13  02.00.25  Added MPI2_IOUNITPAGE1_ATA_SECURITY_FREEZE_LOCK.
  * Fixed MPI2_IOUNITPAGE5_DMA_CAP_MASK_MAX_REQUESTS to
  * match the specification.
+ * 08-19-13  02.00.26  Added reserved words to MPI2_CONFIG_PAGE_IO_UNIT_7 for
+ * future use.
  * --
  */
 
@@ -924,11 +926,15 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_7 {
U8
BoardTemperatureUnits;  /*0x16 */
U8  Reserved3;  /*0x17 */
+   U32 Reserved4;  /* 0x18 */
+   U32 Reserved5;  /* 0x1C */
+   U32 Reserved6;  /* 0x20 */
+   U32 Reserved7;  /* 0x24 */
 } MPI2_CONFIG_PAGE_IO_UNIT_7,
*PTR_MPI2_CONFIG_PAGE_IO_UNIT_7,
Mpi2IOUnitPage7_t, *pMpi2IOUnitPage7_t;
 
-#define MPI2_IOUNITPAGE7_PAGEVERSION(0x02)
+#define MPI2_IOUNITPAGE7_PAGEVERSION   (0x04)
 
 /*defines for IO Unit Page 7 CurrentPowerMode and PreviousPowerMode fields */
 #define MPI25_IOUNITPAGE7_PM_INIT_MASK  (0xC0)
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
index e2bb821..15813f3 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
@@ -6,7 +6,7 @@
  * Title:  MPI IOC, Port, Event, FW Download, and FW Upload messages
  * Creation Date:  October 11, 2006
  *
- * mpi2_ioc.h Version:  02.00.22
+ * mpi2_ioc.h Version:  02.00.23
  *
  * 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
@@ -127,6 +127,11 @@
  * 07-26-12  02.00.22  Added MPI2_IOCFACTS_EXCEPT_PARTIAL_MEMORY_FAILURE.
  * Added ElapsedSeconds field to
  * MPI2_EVENT_DATA_IR_OPERATION_STATUS.
+ * 08-19-13  02.00.23  For IOCInit, added MPI2_IOCINIT_MSGFLAG_RDPQ_ARRAY_MODE
+ * and MPI2_IOC_INIT_RDPQ_ARRAY_ENTRY.
+ * Added MPI2_IOCFACTS_CAPABILITY_RDPQ_ARRAY_CAPABLE.
+ * Added MPI2_FW_DOWNLOAD_ITYPE_PUBLIC_KEY.
+ * Added Encrypted Hash Extended Image.
  * --
  */
 
@@ -182,6 +187,10 @@ typedef struct _MPI2_IOC_INIT_REQUEST {
 #define MPI2_WHOINIT_HOST_DRIVER(0x04)
 #define MPI2_WHOINIT_MANUFACTURER  

[RESEND][PATCH 6/8][SCSI]mpt3sas: Added OEM branding Strings

2014-06-25 Thread Reddy, Sreekanth
Added following branding Strings for Intel custom HBAs support.

Driver String:  Vendor ID   Device ID   
SubSystemVendor ID  SubSystemDevice ID
Intel(R) Integrated RAID Module RMS3JC080   0x1000  0x0097  
0x8086  0x3521
Intel(R) RAID Controller RS3GC008   0x1000  0x0097  
0x8086  0x3522
Intel(R) RAID Controller RS3FC044   0x1000  0x0097  
0x8086  0x3523
Intel(R) RAID Controller RS3UC080   0x1000  0x0097  
0x8086  0x3524

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt3sas/mpt3sas_base.c |   49 +++
 drivers/scsi/mpt3sas/mpt3sas_base.h |   18 +
 2 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 8c77cd4..f1406cc 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -2219,6 +2219,53 @@ mpt3sas_base_put_smid_default(struct MPT3SAS_ADAPTER 
*ioc, u16 smid)
ioc-scsi_lookup_lock);
 }
 
+/**
+ * _base_display_intel_branding - Display branding string
+ * @ioc: per adapter object
+ *
+ * Return nothing.
+ */
+static void
+_base_display_intel_branding(struct MPT3SAS_ADAPTER *ioc)
+{
+   if (ioc-pdev-subsystem_vendor != PCI_VENDOR_ID_INTEL)
+   return;
+
+   switch (ioc-pdev-device) {
+   case MPI25_MFGPAGE_DEVID_SAS3008:
+   switch (ioc-pdev-subsystem_device) {
+   case MPT3SAS_INTEL_RMS3JC080_SSDID:
+   pr_info(MPT3SAS_FMT %s\n, ioc-name,
+   MPT3SAS_INTEL_RMS3JC080_BRANDING);
+   break;
+
+   case MPT3SAS_INTEL_RS3GC008_SSDID:
+   pr_info(MPT3SAS_FMT %s\n, ioc-name,
+   MPT3SAS_INTEL_RS3GC008_BRANDING);
+   break;
+   case MPT3SAS_INTEL_RS3FC044_SSDID:
+   pr_info(MPT3SAS_FMT %s\n, ioc-name,
+   MPT3SAS_INTEL_RS3FC044_BRANDING);
+   break;
+   case MPT3SAS_INTEL_RS3UC080_SSDID:
+   pr_info(MPT3SAS_FMT %s\n, ioc-name,
+   MPT3SAS_INTEL_RS3UC080_BRANDING);
+   break;
+   default:
+   pr_info(MPT3SAS_FMT
+   Intel(R) Controller: Subsystem ID: 0x%X\n,
+   ioc-name, ioc-pdev-subsystem_device);
+   break;
+   }
+   break;
+   default:
+   pr_info(MPT3SAS_FMT
+   Intel(R) Controller: Subsystem ID: 0x%X\n,
+   ioc-name, ioc-pdev-subsystem_device);
+   break;
+   }
+}
+
 
 
 /**
@@ -2250,6 +2297,8 @@ _base_display_ioc_capabilities(struct MPT3SAS_ADAPTER 
*ioc)
   (bios_version  0xFF00)  8,
bios_version  0x00FF);
 
+   _base_display_intel_branding(ioc);
+
pr_info(MPT3SAS_FMT Protocol=(, ioc-name);
 
if (ioc-facts.ProtocolFlags  MPI2_IOCFACTS_PROTOCOL_SCSI_INITIATOR) {
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h 
b/drivers/scsi/mpt3sas/mpt3sas_base.h
index f163423..f61765c 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -130,7 +130,25 @@
 #define MPT_TARGET_FLAGS_DELETED   0x04
 #define MPT_TARGET_FASTPATH_IO 0x08
 
+/*
+ * Intel HBA branding
+ */
+#define MPT3SAS_INTEL_RMS3JC080_BRANDING   \
+   Intel(R) Integrated RAID Module RMS3JC080
+#define MPT3SAS_INTEL_RS3GC008_BRANDING   \
+   Intel(R) RAID Controller RS3GC008
+#define MPT3SAS_INTEL_RS3FC044_BRANDING   \
+   Intel(R) RAID Controller RS3FC044
+#define MPT3SAS_INTEL_RS3UC080_BRANDING   \
+   Intel(R) RAID Controller RS3UC080
 
+/*
+ * Intel HBA SSDIDs
+ */
+#define MPT3SAS_INTEL_RMS3JC080_SSDID  0x3521
+#define MPT3SAS_INTEL_RS3GC008_SSDID   0x3522
+#define MPT3SAS_INTEL_RS3FC044_SSDID   0x3523
+#define MPT3SAS_INTEL_RS3UC080_SSDID0x3524
 
 /*
  * status bits for ioc-diag_buffer_status
-- 
1.7.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


[RESEND][PATCH 5/8][SCSI]mpt3sas: Copyright in driver sources is updated for year the 2014

2014-06-25 Thread Reddy, Sreekanth
Copyright in driver sources is updated for year the 2014.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt3sas/Kconfig|2 +-
 drivers/scsi/mpt3sas/mpi/mpi2.h |2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h|2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_init.h|2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_ioc.h |2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_raid.h|2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_sas.h |2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_tool.h|2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_type.h|2 +-
 drivers/scsi/mpt3sas/mpt3sas_base.c |2 +-
 drivers/scsi/mpt3sas/mpt3sas_base.h |2 +-
 drivers/scsi/mpt3sas/mpt3sas_config.c   |2 +-
 drivers/scsi/mpt3sas/mpt3sas_ctl.c  |2 +-
 drivers/scsi/mpt3sas/mpt3sas_ctl.h  |2 +-
 drivers/scsi/mpt3sas/mpt3sas_debug.h|2 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c|2 +-
 drivers/scsi/mpt3sas/mpt3sas_transport.c|2 +-
 drivers/scsi/mpt3sas/mpt3sas_trigger_diag.c |2 +-
 drivers/scsi/mpt3sas/mpt3sas_trigger_diag.h |2 +-
 19 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/scsi/mpt3sas/Kconfig b/drivers/scsi/mpt3sas/Kconfig
index d53e1b0..4d235dd 100644
--- a/drivers/scsi/mpt3sas/Kconfig
+++ b/drivers/scsi/mpt3sas/Kconfig
@@ -2,7 +2,7 @@
 # Kernel configuration file for the MPT3SAS
 #
 # This code is based on drivers/scsi/mpt3sas/Kconfig
-# Copyright (C) 2012-2013  LSI Corporation
+# Copyright (C) 2012-2014  LSI Corporation
 #  (mailto:dl-mptfusionli...@lsi.com)
 
 # This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2.h b/drivers/scsi/mpt3sas/mpi/mpi2.h
index dc143dd..c34c115 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *  Name:  mpi2.h
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
index becee07..e261a31 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *  Name:  mpi2_cnfg.h
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_init.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_init.h
index b3e3331..068c98e 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_init.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_init.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *  Name:  mpi2_init.h
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
index 15813f3..4908309 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *  Name:  mpi2_ioc.h
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_raid.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_raid.h
index fbe3aae..13d93ca 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_raid.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_raid.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *  Name:  mpi2_raid.h
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_sas.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_sas.h
index 361a275..156e305 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_sas.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_sas.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *  Name:  mpi2_sas.h
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_tool.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_tool.h
index 94e32c2..904910d 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_tool.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_tool.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *  Name:  mpi2_tool.h
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_type.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_type.h
index ba1fed5..99ab093 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_type.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_type.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000-2013 LSI Corporation.
+ *  Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *   Name:  mpi2_type.h
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index d46956e..8c77cd4 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -3,7 +3,7 @@
  * for access to MPT (Message Passing Technology) firmware.
  *
  * This code is based on drivers/scsi/mpt3sas/mpt3sas_base.c
- * Copyright (C) 2012-2013  LSI Corporation
+ * Copyright (C) 2012-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
 

[RESEND][PATCH 3/8][SCSI]mpt3sas: Bump mpt3sas driver version to 03.100.00.00

2014-06-25 Thread Reddy, Sreekanth
Bump mpt3sas driver version to 03.100.00.00.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt3sas/mpt3sas_base.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h 
b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 3007521..0f7add9 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -70,8 +70,8 @@
 #define MPT3SAS_DRIVER_NAMEmpt3sas
 #define MPT3SAS_AUTHOR LSI Corporation dl-mptfusionli...@lsi.com
 #define MPT3SAS_DESCRIPTIONLSI MPT Fusion SAS 3.0 Device Driver
-#define MPT3SAS_DRIVER_VERSION 02.100.00.00
-#define MPT3SAS_MAJOR_VERSION  2
+#define MPT3SAS_DRIVER_VERSION 03.100.00.00
+#define MPT3SAS_MAJOR_VERSION  3
 #define MPT3SAS_MINOR_VERSION  100
 #define MPT3SAS_BUILD_VERSION  0
 #define MPT3SAS_RELEASE_VERSION00
-- 
1.7.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


[RESEND][PATCH 8/8][SCSI]mpt3sas: Bump mpt3sas driver version to 04.100.00.00

2014-06-25 Thread Reddy, Sreekanth
Bump mpt3sas driver version to 04.100.00.00.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt3sas/mpt3sas_base.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h 
b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 8fb2a38..09545fc 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -70,8 +70,8 @@
 #define MPT3SAS_DRIVER_NAMEmpt3sas
 #define MPT3SAS_AUTHOR LSI Corporation dl-mptfusionli...@lsi.com
 #define MPT3SAS_DESCRIPTIONLSI MPT Fusion SAS 3.0 Device Driver
-#define MPT3SAS_DRIVER_VERSION 03.100.00.00
-#define MPT3SAS_MAJOR_VERSION  3
+#define MPT3SAS_DRIVER_VERSION 04.100.00.00
+#define MPT3SAS_MAJOR_VERSION  4
 #define MPT3SAS_MINOR_VERSION  100
 #define MPT3SAS_BUILD_VERSION  0
 #define MPT3SAS_RELEASE_VERSION00
-- 
1.7.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


[RESEND][PATCH 7/8][SCSI]mpt3sas: Added Reply Descriptor Post Queue (RDPQ) Array support

2014-06-25 Thread Reddy, Sreekanth
Up to now, Driver allocates a single contiguous block of memory
pool for all reply queues and passes down a single address in the
ReplyDescriptorPostQueueAddress field of the IOC Init Request
Message to the firmware.

When firmware receives this address, it will program each of the
Reply Descriptor Post Queue registers, as each reply queue has its
own register. Thus the firmware, starting from a base address it
determines the starting address of the subsequent reply queues
through some simple arithmetic calculations.

The size of this contiguous block of memory pool is directly proportional
to number of MSI-X vectors and the HBA queue depth. For example higher
MSIX vectors requires larger contiguous block of memory pool.

But some of the OS kernels are unable to allocate this larger
contiguous block of memory pool.

So, the proposal is to allocate memory independently for each
Reply Queue and pass down all of the addresses to the firmware.
Then the firmware will just take each address and program the value
into the correct register.

When HBAs with older firmware(i.e. without RDPQ capability) is used
with this new driver then the max_msix_vectors value would be set
to 8 by default.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt3sas/mpt3sas_base.c |  916 ---
 drivers/scsi/mpt3sas/mpt3sas_base.h |   19 +-
 2 files changed, 543 insertions(+), 392 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index f1406cc..483785b 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -82,10 +82,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 max_msix_vectors = 8;
+static int max_msix_vectors = -1;
 module_param(max_msix_vectors, int, 0);
 MODULE_PARM_DESC(max_msix_vectors,
-max msix vectors - (default=8));
+max msix vectors);
 
 static int mpt3sas_fwfault_debug;
 MODULE_PARM_DESC(mpt3sas_fwfault_debug,
@@ -1728,6 +1728,9 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
ioc-reply_queue_count = min_t(int, ioc-cpu_count,
ioc-msix_vector_count);
 
+   if (!ioc-rdpq_array_enable  max_msix_vectors == -1)
+   max_msix_vectors = 8;
+
printk(MPT3SAS_FMT MSI-X vectors supported: %d, no of cores
  : %d, max_msix_vectors: %d\n, ioc-name, ioc-msix_vector_count,
  ioc-cpu_count, max_msix_vectors);
@@ -1782,6 +1785,334 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
 }
 
 /**
+ * _base_wait_for_doorbell_int - waiting for controller interrupt(generated by
+ * a write to the doorbell)
+ * @ioc: per adapter object
+ * @timeout: timeout in second
+ * @sleep_flag: CAN_SLEEP or NO_SLEEP
+ *
+ * Returns 0 for success, non-zero for failure.
+ *
+ * Notes: MPI2_HIS_IOC2SYS_DB_STATUS - set to one when IOC writes to doorbell.
+ */
+static int
+_base_wait_for_doorbell_int(struct MPT3SAS_ADAPTER *ioc, int timeout,
+   int sleep_flag)
+{
+   u32 cntdn, count;
+   u32 int_status;
+
+   count = 0;
+   cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout;
+   do {
+   int_status = readl(ioc-chip-HostInterruptStatus);
+   if (int_status  MPI2_HIS_IOC2SYS_DB_STATUS) {
+   dhsprintk(ioc, pr_info(MPT3SAS_FMT
+   %s: successfull count(%d), timeout(%d)\n,
+   ioc-name, __func__, count, timeout));
+   return 0;
+   }
+   if (sleep_flag == CAN_SLEEP)
+   msleep(1);
+   else
+   udelay(500);
+   count++;
+   } while (--cntdn);
+
+   pr_err(MPT3SAS_FMT
+   %s: failed due to timeout count(%d), int_status(%x)!\n,
+   ioc-name, __func__, count, int_status);
+   return -EFAULT;
+}
+
+/**
+ * _base_wait_for_doorbell_ack - waiting for controller to read the doorbell.
+ * @ioc: per adapter object
+ * @timeout: timeout in second
+ * @sleep_flag: CAN_SLEEP or NO_SLEEP
+ *
+ * Returns 0 for success, non-zero for failure.
+ *
+ * Notes: MPI2_HIS_SYS2IOC_DB_STATUS - set to one when host writes to
+ * doorbell.
+ */
+static int
+_base_wait_for_doorbell_ack(struct MPT3SAS_ADAPTER *ioc, int timeout,
+   int sleep_flag)
+{
+   u32 cntdn, count;
+   u32 int_status;
+   u32 doorbell;
+
+   count = 0;
+   cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout;
+   do {
+   int_status = readl(ioc-chip-HostInterruptStatus);
+   if (!(int_status  MPI2_HIS_SYS2IOC_DB_STATUS)) {
+   dhsprintk(ioc, pr_info(MPT3SAS_FMT
+   %s: successfull count(%d), timeout(%d)\n,
+   ioc-name, __func__, count, timeout));
+   return 0;
+  

[RESEND][PATCH 03/10][SCSI]mpt2sas: Copyright in driver sources is updated for year the 2014

2014-06-25 Thread Reddy, Sreekanth
Copyright in driver sources is updated for year the 2014.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt2sas/Kconfig |2 +-
 drivers/scsi/mpt2sas/mpt2sas_base.c  |2 +-
 drivers/scsi/mpt2sas/mpt2sas_base.h  |2 +-
 drivers/scsi/mpt2sas/mpt2sas_config.c|2 +-
 drivers/scsi/mpt2sas/mpt2sas_ctl.c   |2 +-
 drivers/scsi/mpt2sas/mpt2sas_ctl.h   |2 +-
 drivers/scsi/mpt2sas/mpt2sas_debug.h |2 +-
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |2 +-
 drivers/scsi/mpt2sas/mpt2sas_transport.c |2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/mpt2sas/Kconfig b/drivers/scsi/mpt2sas/Kconfig
index 39f08dd..657b45c 100644
--- a/drivers/scsi/mpt2sas/Kconfig
+++ b/drivers/scsi/mpt2sas/Kconfig
@@ -2,7 +2,7 @@
 # Kernel configuration file for the MPT2SAS
 #
 # This code is based on drivers/scsi/mpt2sas/Kconfig
-# Copyright (C) 2007-2012  LSI Corporation
+# Copyright (C) 2007-2014  LSI Corporation
 #  (mailto:dl-mptfusionli...@lsi.com)
 
 # This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c 
b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 7355b28..774720f 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -3,7 +3,7 @@
  * for access to MPT (Message Passing Technology) firmware.
  *
  * This code is based on drivers/scsi/mpt2sas/mpt2_base.c
- * Copyright (C) 2007-2013  LSI Corporation
+ * Copyright (C) 2007-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  * This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h 
b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 61b02ee..863a248 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -3,7 +3,7 @@
  * for access to MPT (Message Passing Technology) firmware.
  *
  * This code is based on drivers/scsi/mpt2sas/mpt2_base.h
- * Copyright (C) 2007-2013  LSI Corporation
+ * Copyright (C) 2007-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  * This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_config.c 
b/drivers/scsi/mpt2sas/mpt2sas_config.c
index 0c47425..c72a2ff 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_config.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_config.c
@@ -2,7 +2,7 @@
  * This module provides common API for accessing firmware configuration pages
  *
  * This code is based on drivers/scsi/mpt2sas/mpt2_base.c
- * Copyright (C) 2007-2013  LSI Corporation
+ * Copyright (C) 2007-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  * This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c 
b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
index b7f887c..5221c4b 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
@@ -3,7 +3,7 @@
  * controllers
  *
  * This code is based on drivers/scsi/mpt2sas/mpt2_ctl.c
- * Copyright (C) 2007-2013  LSI Corporation
+ * Copyright (C) 2007-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  * This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.h 
b/drivers/scsi/mpt2sas/mpt2sas_ctl.h
index 8b2ac18..fa0567c 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_ctl.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.h
@@ -3,7 +3,7 @@
  * controllers
  *
  * This code is based on drivers/scsi/mpt2sas/mpt2_ctl.h
- * Copyright (C) 2007-2013  LSI Corporation
+ * Copyright (C) 2007-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  * This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_debug.h 
b/drivers/scsi/mpt2sas/mpt2sas_debug.h
index a9021cb..cc57ef3 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_debug.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_debug.h
@@ -2,7 +2,7 @@
  * Logging Support for MPT (Message Passing Technology) based controllers
  *
  * This code is based on drivers/scsi/mpt2sas/mpt2_debug.c
- * Copyright (C) 2007-2013  LSI Corporation
+ * Copyright (C) 2007-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  * This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c 
b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index d502728..5ee6bf0 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -2,7 +2,7 @@
  * Scsi Host Layer for MPT (Message Passing Technology) based controllers
  *
  * This code is based on drivers/scsi/mpt2sas/mpt2_scsih.c
- * Copyright (C) 2007-2013  LSI Corporation
+ * Copyright (C) 2007-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  * This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c 
b/drivers/scsi/mpt2sas/mpt2sas_transport.c
index 

[RESEND][PATCH 02/10][SCSI]mpt2sas: MPI2 Rev Y (2.00.17) and Rev Z (2.00.18) specifications

2014-06-25 Thread Reddy, Sreekanth
Below is the change set in MPI2 Rev Y specification and in 2.00.17 header files
1) Added SCSIStatusQualifier to SCSI IO Error Reply message.
2) Added ATA Security Freeze Lock to IO Unit Page 1 Flags field.

Below is the change set in MPI2 Rev Z specification and in 2.00.19 header files
1) Added reserved fields to IO Unit Page 7 for future use.
2) Added optional functionality to IOCInit Request so that
   the host may specify a separate base address for each
   Reply Descriptor Post Queue. IOC support for this is
   indicated using a new IOCCapabilities bit in the IOCFacts Reply.
3) Added Toolbox Console Text Display Tool
   The host uses the Console Text Display Tool to send a string to
   IOC's Console using different console types (eg: UART serial terminal or 
Ethernet terminal).

The copyright in the mpi files is updated for year 2014

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt2sas/mpi/mpi2.h  |   12 -
 drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h |   29 ++
 drivers/scsi/mpt2sas/mpi/mpi2_init.h |8 ++-
 drivers/scsi/mpt2sas/mpi/mpi2_ioc.h  |   74 +-
 drivers/scsi/mpt2sas/mpi/mpi2_raid.h |8 +++-
 drivers/scsi/mpt2sas/mpi/mpi2_sas.h  |2 +-
 drivers/scsi/mpt2sas/mpi/mpi2_tool.h |   44 +++-
 drivers/scsi/mpt2sas/mpi/mpi2_type.h |2 +-
 8 files changed, 148 insertions(+), 31 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpi/mpi2.h b/drivers/scsi/mpt2sas/mpi/mpi2.h
index 7b14a01..088eefa 100644
--- a/drivers/scsi/mpt2sas/mpi/mpi2.h
+++ b/drivers/scsi/mpt2sas/mpi/mpi2.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000-2013 LSI Corporation.
+ *  Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *   Name:  mpi2.h
@@ -8,7 +8,7 @@
  *  scatter/gather formats.
  *  Creation Date:  June 21, 2006
  *
- *  mpi2.h Version:  02.00.28
+ *  mpi2.h Version:  02.00.32
  *
  *  Version History
  *  ---
@@ -78,6 +78,11 @@
  *  07-10-12  02.00.26  Bumped MPI2_HEADER_VERSION_UNIT.
  *  07-26-12  02.00.27  Bumped MPI2_HEADER_VERSION_UNIT.
  *  11-27-12  02.00.28  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  12-20-12  02.00.29  Bumped MPI2_HEADER_VERSION_UNIT.
+ * Added MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET.
+ *  04-09-13  02.00.30  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  04-17-13  02.00.31  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  08-19-13  02.00.32  Bumped MPI2_HEADER_VERSION_UNIT.
  *  --
  */
 
@@ -103,7 +108,7 @@
 #define MPI2_VERSION_02_00  (0x0200)
 
 /* versioning for this MPI header set */
-#define MPI2_HEADER_VERSION_UNIT(0x1C)
+#define MPI2_HEADER_VERSION_UNIT(0x20)
 #define MPI2_HEADER_VERSION_DEV (0x00)
 #define MPI2_HEADER_VERSION_UNIT_MASK   (0xFF00)
 #define MPI2_HEADER_VERSION_UNIT_SHIFT  (8)
@@ -263,6 +268,7 @@ typedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS
 #define MPI2_REPLY_POST_HOST_INDEX_MASK (0x00FF)
 #define MPI2_RPHI_MSIX_INDEX_MASK   (0xFF00)
 #define MPI2_RPHI_MSIX_INDEX_SHIFT  (24)
+#define MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET  (0x030C) /* MPI v2.5 only 
*/
 
 /*
  * Defines for the HCBSize and address
diff --git a/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h 
b/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h
index 88cb7f8..510ef0d 100644
--- a/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h
+++ b/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h
@@ -1,12 +1,12 @@
 /*
- *  Copyright (c) 2000-2013 LSI Corporation.
+ *  Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *   Name:  mpi2_cnfg.h
  *  Title:  MPI Configuration messages and pages
  *  Creation Date:  November 10, 2006
  *
- *mpi2_cnfg.h Version:  02.00.23
+ *mpi2_cnfg.h Version:  02.00.26
  *
  *  Version History
  *  ---
@@ -150,7 +150,13 @@
  *  Added UEFIVersion field to BIOS Page 1 and defined new
  *  BiosOptions bits.
  *  11-27-12  02.00.23  Added MPI2_MANPAGE7_FLAG_EVENTREPLAY_SLOT_ORDER.
- *  Added MPI2_BIOSPAGE1_OPTIONS_MASK_OEM_ID.
+ * Added MPI2_BIOSPAGE1_OPTIONS_MASK_OEM_ID.
+ *  12-20-12  02.00.24  Marked MPI2_SASIOUNIT1_CONTROL_CLEAR_AFFILIATION as
+ * obsolete for MPI v2.5 and later.
+ * Added some defines for 12G SAS speeds.
+ *  04-09-13  02.00.25  Added MPI2_IOUNITPAGE1_ATA_SECURITY_FREEZE_LOCK.
+ * Fixed MPI2_IOUNITPAGE5_DMA_CAP_MASK_MAX_REQUESTS to
+ * match the specification.
  *  --
  */
 
@@ -773,6 +779,7 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_1
 #define MPI2_IOUNITPAGE1_PAGEVERSION(0x04)
 
 /* IO Unit Page 1 Flags defines */
+#define MPI2_IOUNITPAGE1_ATA_SECURITY_FREEZE_LOCK   (0x4000)
 #define 

[RESEND][PATCH 04/10][SCSI]mpt2sas: Clear PFA Status on SGPIO when PFA Drive is Removed or Replaced

2014-06-25 Thread Reddy, Sreekanth
Added code to send a SEP message that turns off the Predictive
Failure LED when a drive is removed (if Predictive Failure LED was turned on).

Added a new flag 'pfa_led_on' per device that tracks the status of Predictive
Failure LED. When the drive is removed, this flag is checked and
sends the SEP message to turn off the respective Predictive Failure LED.

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.h  |2 +
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |   70 +
 2 files changed, 63 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h 
b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 863a248..80d26c1 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -355,6 +355,7 @@ struct _internal_cmd {
  * @slot: number number
  * @phy: phy identifier provided in sas device page 0
  * @responding: used in _scsih_sas_device_mark_responding
+ * @pfa_led_on: flag for PFA LED status
  */
 struct _sas_device {
struct list_head list;
@@ -373,6 +374,7 @@ struct _sas_device {
u16 slot;
u8  phy;
u8  responding;
+   u8  pfa_led_on;
 };
 
 /**
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c 
b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 5ee6bf0..6ae109b 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -150,7 +150,7 @@ struct sense_info {
 };
 
 
-#define MPT2SAS_TURN_ON_FAULT_LED (0xFFFC)
+#define MPT2SAS_TURN_ON_PFA_LED (0xFFFC)
 #define MPT2SAS_PORT_ENABLE_COMPLETE (0xFFFD)
 #define MPT2SAS_REMOVE_UNRESPONDING_DEVICES (0x)
 /**
@@ -4325,7 +4325,7 @@ _scsih_scsi_ioc_info(struct MPT2SAS_ADAPTER *ioc, struct 
scsi_cmnd *scmd,
 #endif
 
 /**
- * _scsih_turn_on_fault_led - illuminate Fault LED
+ * _scsih_turn_on_pfa_led - illuminate PFA LED
  * @ioc: per adapter object
  * @handle: device handle
  * Context: process
@@ -4333,10 +4333,15 @@ _scsih_scsi_ioc_info(struct MPT2SAS_ADAPTER *ioc, 
struct scsi_cmnd *scmd,
  * Return nothing.
  */
 static void
-_scsih_turn_on_fault_led(struct MPT2SAS_ADAPTER *ioc, u16 handle)
+_scsih_turn_on_pfa_led(struct MPT2SAS_ADAPTER *ioc, u16 handle)
 {
Mpi2SepReply_t mpi_reply;
Mpi2SepRequest_t mpi_request;
+   struct _sas_device *sas_device;
+
+   sas_device = _scsih_sas_device_find_by_handle(ioc, handle);
+   if (!sas_device)
+   return;
 
memset(mpi_request, 0, sizeof(Mpi2SepRequest_t));
mpi_request.Function = MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR;
@@ -4351,6 +4356,47 @@ _scsih_turn_on_fault_led(struct MPT2SAS_ADAPTER *ioc, 
u16 handle)
__FILE__, __LINE__, __func__);
return;
}
+   sas_device-pfa_led_on = 1;
+
+
+   if (mpi_reply.IOCStatus || mpi_reply.IOCLogInfo) {
+   dewtprintk(ioc, printk(MPT2SAS_INFO_FMT
+enclosure_processor: ioc_status (0x%04x), loginfo(0x%08x)\n,
+ioc-name, le16_to_cpu(mpi_reply.IOCStatus),
+le32_to_cpu(mpi_reply.IOCLogInfo)));
+   return;
+   }
+}
+
+/**
+ * _scsih_turn_off_pfa_led - turn off PFA LED
+ * @ioc: per adapter object
+ * @sas_device: sas device whose PFA LED has to turned off
+ * Context: process
+ *
+ * Return nothing.
+ */
+static void
+_scsih_turn_off_pfa_led(struct MPT2SAS_ADAPTER *ioc,
+   struct _sas_device *sas_device)
+{
+   Mpi2SepReply_t mpi_reply;
+   Mpi2SepRequest_t mpi_request;
+
+   memset(mpi_request, 0, sizeof(Mpi2SepRequest_t));
+   mpi_request.Function = MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR;
+   mpi_request.Action = MPI2_SEP_REQ_ACTION_WRITE_STATUS;
+   mpi_request.SlotStatus = 0;
+   mpi_request.Slot = cpu_to_le16(sas_device-slot);
+   mpi_request.DevHandle = 0;
+   mpi_request.EnclosureHandle = cpu_to_le16(sas_device-enclosure_handle);
+   mpi_request.Flags = MPI2_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS;
+   if ((mpt2sas_base_scsi_enclosure_processor(ioc, mpi_reply,
+   mpi_request)) != 0) {
+   printk(MPT2SAS_ERR_FMT failure at %s:%d/%s()!\n, ioc-name,
+   __FILE__, __LINE__, __func__);
+   return;
+   }
 
if (mpi_reply.IOCStatus || mpi_reply.IOCLogInfo) {
dewtprintk(ioc, printk(MPT2SAS_INFO_FMT enclosure_processor: 
@@ -4362,7 +4408,7 @@ _scsih_turn_on_fault_led(struct MPT2SAS_ADAPTER *ioc, u16 
handle)
 }
 
 /**
- * _scsih_send_event_to_turn_on_fault_led - fire delayed event
+ * _scsih_send_event_to_turn_on_pfa_led - fire delayed event
  * @ioc: per adapter object
  * @handle: device handle
  * Context: interrupt.
@@ -4370,14 +4416,14 @@ _scsih_turn_on_fault_led(struct MPT2SAS_ADAPTER *ioc, 
u16 handle)
  * Return nothing.
  */
 static void
-_scsih_send_event_to_turn_on_fault_led(struct MPT2SAS_ADAPTER *ioc, u16 handle)
+_scsih_send_event_to_turn_on_pfa_led(struct MPT2SAS_ADAPTER *ioc, u16 handle)

[PATCH] MAINTAINERS: update LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) maintainers Email IDs

2014-06-13 Thread Reddy, Sreekanth

Updating the MAINTAINERS file for the entry LSILOGIC MPT FUSION DRIVERS

Signed-off-by: Sreekanth Reddy sreekanth.re...@avagotech.com
---
 MAINTAINERS |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index b2cf5cf..4e40d50 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5352,10 +5352,9 @@ S:   Maintained
 F: arch/arm/mach-lpc32xx/
 
 LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)
-M: Nagalakshmi Nandigama nagalakshmi.nandig...@lsi.com
-M: Sreekanth Reddy sreekanth.re...@lsi.com
-M: supp...@lsi.com
-L: dl-mptfusionli...@lsi.com
+M: Nagalakshmi Nandigama nagalakshmi.nandig...@avagotech.com
+M: Sreekanth Reddy sreekanth.re...@avagotech.com
+L: mpt-fusionlinux@avagotech.com
 L: linux-scsi@vger.kernel.org
 W: http://www.lsilogic.com/support
 S: Supported
-- 
1.7.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] [SCSI] mpt3sas: tidy up output slightly

2014-05-02 Thread Reddy, Sreekanth
James,

This patch seem to be fine. Please consider this patch.

Regards,
Sreekanth

-Original Message-
From: Dan Carpenter [mailto:dan.carpen...@oracle.com]
Sent: Friday, March 28, 2014 2:09 PM
To: Nandigama, Nagalakshmi
Cc: Reddy, Sreekanth; Support; James E.J. Bottomley; DL-MPT Fusion Linux;
linux-scsi@vger.kernel.org; kernel-janit...@vger.kernel.org
Subject: [patch] [SCSI] mpt3sas: tidy up output slightly

The indenting here for pr_info(\n); is not correct.  It's not part of the 
if
condition.

Also using pr_info() would put extra characters in the middle of the line.  I
suppose that people could complain that pr_cont() is racy but at least it's
better than the original code.

Signed-off-by: Dan Carpenter dan.carpen...@oracle.com

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 0cf4f70..aa0e042 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -585,9 +585,9 @@ _base_display_event_data(struct MPT3SAS_ADAPTER
*ioc,
   (event_data-ReasonCode ==
MPI2_EVENT_SAS_DISC_RC_STARTED) ?
   start : stop);
   if (event_data-DiscoveryStatus)
-  pr_info(discovery_status(0x%08x),
+  pr_cont(discovery_status(0x%08x),
   le32_to_cpu(event_data-DiscoveryStatus));
-  pr_info(\n);
+  pr_cont(\n);
   return;
   }
   case MPI2_EVENT_SAS_BROADCAST_PRIMITIVE:

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


RE: [PATCH 0/7] Performance improvements for LSI SCSI cards

2014-04-07 Thread Reddy, Sreekanth
Hi James,

This patch set seem to be fine. Please consider this patch set as Acked-by: 
Sreekanth Reddy sreekanth.re...@lsi.com.

Regards,
Sreekanth

-Original Message-
From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi-
ow...@vger.kernel.org] On Behalf Of Matthew Wilcox
Sent: Friday, March 28, 2014 2:10 AM
To: linux-scsi@vger.kernel.org
Cc: Matthew Wilcox; wi...@linux.intel.com
Subject: [PATCH 0/7] Performance improvements for LSI SCSI cards

The host lock is a serious scalability problem on 2-socket and larger systems
which are doing a lot of I/O.  Before removing the temporary usgae of
DEF_SCSI_QCMD, we need to remove all uses of serial_number.

An unrelated performance issue is that reusing the most recent driver-specific
data structure to track the I/O instead of the least recently used keeps the
cache-hot lines in use, which is a nice performance improvement.  It's already
present in the mpt3sas driver, it just didn't make it into the fusion or 
mpt2sas
drivers yet.

Matthew Wilcox (7):
  mpt3sas: Remove uses of serial_number
  mpt3sas: Remove use of DEF_SCSI_QCMD
  mpt2sas: Remove uses of serial_number
  mpt2sas: Remove use of DEF_SCSI_QCMD
  mpt2sas: Add free smids to the head, not tail of list
  fusion: Add free msg frames to the head, not tail of list
  fusion: Remove use of DEF_SCSI_QCMD

 drivers/message/fusion/mptbase.c |  2 +-
 drivers/message/fusion/mptfc.c   | 12 +---
 drivers/message/fusion/mptsas.c  | 10 --
 drivers/message/fusion/mptscsih.c|  8 +++-
 drivers/message/fusion/mptscsih.h|  2 +-
 drivers/message/fusion/mptspi.c  | 12 +---
 drivers/scsi/mpt2sas/mpt2sas_base.c  |  8 
drivers/scsi/mpt2sas/mpt2sas_base.h  |  2 +-
 drivers/scsi/mpt2sas/mpt2sas_ctl.c   |  2 +-
 drivers/scsi/mpt2sas/mpt2sas_scsih.c | 24 +---
drivers/scsi/mpt3sas/mpt3sas_base.h  |  2 +-
 drivers/scsi/mpt3sas/mpt3sas_ctl.c   |  2 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 24 +---
 13 files changed, 45 insertions(+), 65 deletions(-)

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

--
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]mpt2sas: Description Patch

2014-03-14 Thread Reddy, Sreekanth

Please consider this patch set for next kernel release.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---

[PATCH 01/11][SCSI]mpt2sas: Added driver module parameter max_msix_vectors.
[PATCH 02/11][SCSI]mpt2sas: Added new driver module Parameter disable_eedp to 
Disable EEDP Support.
[PATCH 03/11][SCSI]mpt2sas: MPI2 Rev Y (2.00.17) and Rev Z (2.00.18) 
specifications.
[PATCH 04/11][SCSI]mpt2sas: Copyright in driver sources is updated for year the 
2014.
[PATCH 05/11][SCSI]mpt2sas: Clear PFA Status on SGPIO when PFA Drive is Removed 
or Replaced.
[PATCH 06/11][SCSI]mpt2sas: Bump mpt2sas driver version to 17.100.00.00.
[PATCH 07/11][SCSI]mpt2sas: For 2TB volumes, DirectDrive support sends IO's 
with LBA bit 31 to IR FW instead of DirectDrive.
[PATCH 08/11][SCSI]mpt2sas: Added Reply Descriptor Post Queue (RDPQ) Array 
support.
[PATCH 09/11][SCSI]mpt2sas: Get IOC_FACTS information using handshake protocol 
only after HBA card gets into READY or Operational state.
[PATCH 10/11][SCSI]mpt2sas: Added module parameter 'unblock_io' to unblock IO's 
during disk addition.
[PATCH 11/11][SCSI]mpt2sas: Bump mpt2sas driver version to 18.100.00.00.

--
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 01/11][SCSI]mpt2sas: Added driver module parameter max_msix_vectors

2014-03-14 Thread Reddy, Sreekanth
Added driver module parameter max_msix_vectors. Using this
module parameter the maximum number of MSI-X vectors could be set.

The number of MSI-X vectors used would be the minimum of MSI-X vectors
supported by the HBA, the number of CPU cores and the value set to
max_msix_vectors module parameters.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c 
b/drivers/scsi/mpt2sas/mpt2sas_base.c
index bde63f7..ed810fb 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -80,6 +80,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 max_msix_vectors = -1;
+module_param(max_msix_vectors, int, 0);
+MODULE_PARM_DESC(max_msix_vectors,  max msix vectors );
+
 static int mpt2sas_fwfault_debug;
 MODULE_PARM_DESC(mpt2sas_fwfault_debug,  enable detection of firmware fault 
and halt firmware - (default=0));
@@ -1420,6 +1424,16 @@ _base_enable_msix(struct MPT2SAS_ADAPTER *ioc)
ioc-reply_queue_count = min_t(int, ioc-cpu_count,
ioc-msix_vector_count);
 
+   if (max_msix_vectors  0) {
+   ioc-reply_queue_count = min_t(int, max_msix_vectors,
+   ioc-reply_queue_count);
+   ioc-msix_vector_count = ioc-reply_queue_count;
+   }
+
+   printk(MPT2SAS_INFO_FMT
+   MSI-X vectors supported: %d, no of cores: %d, max_msix_vectors: %d\n,
+ioc-name, ioc-msix_vector_count, ioc-cpu_count, max_msix_vectors);
+
entries = kcalloc(ioc-reply_queue_count, sizeof(struct msix_entry),
GFP_KERNEL);
if (!entries) {
-- 
1.7.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 06/11][SCSI]mpt2sas: Bump mpt2sas driver version to 17.100.00.00

2014-03-14 Thread Reddy, Sreekanth
Bump mpt2sas driver version to 17.100.00.00.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h 
b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 80d26c1..0a6747a 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -69,8 +69,8 @@
 #define MPT2SAS_DRIVER_NAMEmpt2sas
 #define MPT2SAS_AUTHOR LSI Corporation dl-mptfusionli...@lsi.com
 #define MPT2SAS_DESCRIPTIONLSI MPT Fusion SAS 2.0 Device Driver
-#define MPT2SAS_DRIVER_VERSION 16.100.00.00
-#define MPT2SAS_MAJOR_VERSION  16
+#define MPT2SAS_DRIVER_VERSION 17.100.00.00
+#define MPT2SAS_MAJOR_VERSION  17
 #define MPT2SAS_MINOR_VERSION  100
 #define MPT2SAS_BUILD_VERSION  00
 #define MPT2SAS_RELEASE_VERSION00
-- 
1.7.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 05/11][SCSI]mpt2sas: Clear PFA Status on SGPIO when PFA Drive is Removed or Replaced

2014-03-14 Thread Reddy, Sreekanth
Added code to send a SEP message that turns off the Predictive
Failure LED when a drive is removed (if Predictive Failure LED was turned on).

Added a new flag 'pfa_led_on' per device that tracks the status of Predictive
Failure LED. When the drive is removed, this flag is checked and
sends the SEP message to turn off the respective Predictive Failure LED.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.h  |2 +
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |   70 +
 2 files changed, 63 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h 
b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 863a248..80d26c1 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -355,6 +355,7 @@ struct _internal_cmd {
  * @slot: number number
  * @phy: phy identifier provided in sas device page 0
  * @responding: used in _scsih_sas_device_mark_responding
+ * @pfa_led_on: flag for PFA LED status
  */
 struct _sas_device {
struct list_head list;
@@ -373,6 +374,7 @@ struct _sas_device {
u16 slot;
u8  phy;
u8  responding;
+   u8  pfa_led_on;
 };
 
 /**
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c 
b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 5ee6bf0..6ae109b 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -150,7 +150,7 @@ struct sense_info {
 };
 
 
-#define MPT2SAS_TURN_ON_FAULT_LED (0xFFFC)
+#define MPT2SAS_TURN_ON_PFA_LED (0xFFFC)
 #define MPT2SAS_PORT_ENABLE_COMPLETE (0xFFFD)
 #define MPT2SAS_REMOVE_UNRESPONDING_DEVICES (0x)
 /**
@@ -4325,7 +4325,7 @@ _scsih_scsi_ioc_info(struct MPT2SAS_ADAPTER *ioc, struct 
scsi_cmnd *scmd,
 #endif
 
 /**
- * _scsih_turn_on_fault_led - illuminate Fault LED
+ * _scsih_turn_on_pfa_led - illuminate PFA LED
  * @ioc: per adapter object
  * @handle: device handle
  * Context: process
@@ -4333,10 +4333,15 @@ _scsih_scsi_ioc_info(struct MPT2SAS_ADAPTER *ioc, 
struct scsi_cmnd *scmd,
  * Return nothing.
  */
 static void
-_scsih_turn_on_fault_led(struct MPT2SAS_ADAPTER *ioc, u16 handle)
+_scsih_turn_on_pfa_led(struct MPT2SAS_ADAPTER *ioc, u16 handle)
 {
Mpi2SepReply_t mpi_reply;
Mpi2SepRequest_t mpi_request;
+   struct _sas_device *sas_device;
+
+   sas_device = _scsih_sas_device_find_by_handle(ioc, handle);
+   if (!sas_device)
+   return;
 
memset(mpi_request, 0, sizeof(Mpi2SepRequest_t));
mpi_request.Function = MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR;
@@ -4351,6 +4356,47 @@ _scsih_turn_on_fault_led(struct MPT2SAS_ADAPTER *ioc, 
u16 handle)
__FILE__, __LINE__, __func__);
return;
}
+   sas_device-pfa_led_on = 1;
+
+
+   if (mpi_reply.IOCStatus || mpi_reply.IOCLogInfo) {
+   dewtprintk(ioc, printk(MPT2SAS_INFO_FMT
+enclosure_processor: ioc_status (0x%04x), loginfo(0x%08x)\n,
+ioc-name, le16_to_cpu(mpi_reply.IOCStatus),
+le32_to_cpu(mpi_reply.IOCLogInfo)));
+   return;
+   }
+}
+
+/**
+ * _scsih_turn_off_pfa_led - turn off PFA LED
+ * @ioc: per adapter object
+ * @sas_device: sas device whose PFA LED has to turned off
+ * Context: process
+ *
+ * Return nothing.
+ */
+static void
+_scsih_turn_off_pfa_led(struct MPT2SAS_ADAPTER *ioc,
+   struct _sas_device *sas_device)
+{
+   Mpi2SepReply_t mpi_reply;
+   Mpi2SepRequest_t mpi_request;
+
+   memset(mpi_request, 0, sizeof(Mpi2SepRequest_t));
+   mpi_request.Function = MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR;
+   mpi_request.Action = MPI2_SEP_REQ_ACTION_WRITE_STATUS;
+   mpi_request.SlotStatus = 0;
+   mpi_request.Slot = cpu_to_le16(sas_device-slot);
+   mpi_request.DevHandle = 0;
+   mpi_request.EnclosureHandle = cpu_to_le16(sas_device-enclosure_handle);
+   mpi_request.Flags = MPI2_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS;
+   if ((mpt2sas_base_scsi_enclosure_processor(ioc, mpi_reply,
+   mpi_request)) != 0) {
+   printk(MPT2SAS_ERR_FMT failure at %s:%d/%s()!\n, ioc-name,
+   __FILE__, __LINE__, __func__);
+   return;
+   }
 
if (mpi_reply.IOCStatus || mpi_reply.IOCLogInfo) {
dewtprintk(ioc, printk(MPT2SAS_INFO_FMT enclosure_processor: 
@@ -4362,7 +4408,7 @@ _scsih_turn_on_fault_led(struct MPT2SAS_ADAPTER *ioc, u16 
handle)
 }
 
 /**
- * _scsih_send_event_to_turn_on_fault_led - fire delayed event
+ * _scsih_send_event_to_turn_on_pfa_led - fire delayed event
  * @ioc: per adapter object
  * @handle: device handle
  * Context: interrupt.
@@ -4370,14 +4416,14 @@ _scsih_turn_on_fault_led(struct MPT2SAS_ADAPTER *ioc, 
u16 handle)
  * Return nothing.
  */
 static void
-_scsih_send_event_to_turn_on_fault_led(struct MPT2SAS_ADAPTER *ioc, u16 handle)
+_scsih_send_event_to_turn_on_pfa_led(struct MPT2SAS_ADAPTER *ioc, u16 handle)
 {
   

[PATCH 07/11][SCSI]mpt2sas: For 2TB volumes, DirectDrive support sends I/Os with LBA bit 31 to IR FW instead of DirectDrive

2014-03-14 Thread Reddy, Sreekanth
There was a down casting of the volume max LBA from a U64 to a U32,
which is taken out and now the max LBA is set appropriately to U64.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |   14 ++
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c 
b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 6ae109b..4a0728a 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -3865,7 +3865,8 @@ _scsih_setup_direct_io(struct MPT2SAS_ADAPTER *ioc, 
struct scsi_cmnd *scmd,
struct _raid_device *raid_device, Mpi2SCSIIORequest_t *mpi_request,
u16 smid)
 {
-   u32 v_lba, p_lba, stripe_off, stripe_unit, column, io_size;
+   u32 p_lba, stripe_off, stripe_unit, column, io_size;
+   u64 v_lba;
u32 stripe_sz, stripe_exp;
u8 num_pds, *cdb_ptr, i;
u8 cdb0 = scmd-cmnd[0];
@@ -3882,12 +3883,17 @@ _scsih_setup_direct_io(struct MPT2SAS_ADAPTER *ioc, 
struct scsi_cmnd *scmd,
| cdb_ptr[5])) {
io_size = scsi_bufflen(scmd) 
raid_device-block_exponent;
-   i = (cdb0  READ_16) ? 2 : 6;
+
/* get virtual lba */
-   v_lba = be32_to_cpu(*(__be32 *)(cdb_ptr[i]));
+   if (cdb0  READ_16)
+   v_lba = be32_to_cpu(*(__be32 *)(cdb_ptr[2]));
+   else
+   v_lba = be64_to_cpu(*(__be64 *)(cdb_ptr[2]));
+
+   i = (cdb0  READ_16) ? 2 : 6;
 
if (((u64)v_lba + (u64)io_size - 1) =
-   (u32)raid_device-max_lba) {
+   raid_device-max_lba) {
stripe_sz = raid_device-stripe_sz;
stripe_exp = raid_device-stripe_exponent;
stripe_off = v_lba  (stripe_sz - 1);
-- 
1.7.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 08/11][SCSI]mpt2sas: Added Reply Descriptor Post Queue (RDPQ) Array support

2014-03-14 Thread Reddy, Sreekanth
Up to now, Driver allocates a single contiguous block of memory
pool for all reply queues and passes down a single address in the
ReplyDescriptorPostQueueAddress field of the IOC Init Request
Message to the firmware.

When firmware receives this address, it will program each of the
Reply Descriptor Post Queue registers, as each reply queue has its
own register. Thus the firmware, starting from a base address it
determines the starting address of the subsequent reply queues
through some simple arithmetic calculations.

The size of this contiguous block of memory pool is directly proportional
to number of MSI-X vectors and the HBA queue depth. For example higher
MSIX vectors requires larger contiguous block of memory pool.

But some of the OS kernels are unable to allocate this larger
contiguous block of memory pool.

So, the proposal is to allocate memory independently for each
Reply Queue and pass down all of the addresses to the firmware.
Then the firmware will just take each address and program the value
into the correct register.

When HBAs with older firmware(i.e. without RDPQ capability) is used
with this new driver then the max_msix_vectors value would be set
to 8 by default.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.c |  923 +--
 drivers/scsi/mpt2sas/mpt2sas_base.h |   18 +-
 2 files changed, 558 insertions(+), 383 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c 
b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 774720f..81f1d58 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -1427,6 +1427,9 @@ _base_enable_msix(struct MPT2SAS_ADAPTER *ioc)
ioc-reply_queue_count = min_t(int, ioc-cpu_count,
ioc-msix_vector_count);
 
+   if (!ioc-rdpq_array_enable  max_msix_vectors == -1)
+   max_msix_vectors = 8;
+
if (max_msix_vectors  0) {
ioc-reply_queue_count = min_t(int, max_msix_vectors,
ioc-reply_queue_count);
@@ -1480,6 +1483,335 @@ _base_enable_msix(struct MPT2SAS_ADAPTER *ioc)
 }
 
 /**
+ * _base_wait_for_doorbell_int - waiting for controller interrupt(generated by
+ * a write to the doorbell)
+ * @ioc: per adapter object
+ * @timeout: timeout in second
+ * @sleep_flag: CAN_SLEEP or NO_SLEEP
+ *
+ * Returns 0 for success, non-zero for failure.
+ *
+ * Notes: MPI2_HIS_IOC2SYS_DB_STATUS - set to one when IOC writes to doorbell.
+ */
+static int
+_base_wait_for_doorbell_int(struct MPT2SAS_ADAPTER *ioc, int timeout,
+   int sleep_flag)
+{
+   u32 cntdn, count;
+   u32 int_status;
+
+   count = 0;
+   cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout;
+   do {
+   int_status = readl(ioc-chip-HostInterruptStatus);
+   if (int_status  MPI2_HIS_IOC2SYS_DB_STATUS) {
+   dhsprintk(ioc, printk(MPT2SAS_INFO_FMT
+   %s: successful count(%d), timeout(%d)\n,
+   ioc-name, __func__, count, timeout));
+   return 0;
+   }
+   if (sleep_flag == CAN_SLEEP)
+   msleep(1);
+   else
+   udelay(500);
+   count++;
+   } while (--cntdn);
+
+   printk(MPT2SAS_ERR_FMT
+   %s: failed due to timeout count(%d), int_status(%x)!\n,
+   ioc-name, __func__, count, int_status);
+   return -EFAULT;
+}
+
+/**
+ * _base_wait_for_doorbell_ack - waiting for controller to read the doorbell.
+ * @ioc: per adapter object
+ * @timeout: timeout in second
+ * @sleep_flag: CAN_SLEEP or NO_SLEEP
+ *
+ * Returns 0 for success, non-zero for failure.
+ *
+ * Notes: MPI2_HIS_SYS2IOC_DB_STATUS - set to one when host writes to
+ * doorbell.
+ */
+static int
+_base_wait_for_doorbell_ack(struct MPT2SAS_ADAPTER *ioc, int timeout,
+   int sleep_flag)
+{
+   u32 cntdn, count;
+   u32 int_status;
+   u32 doorbell;
+
+   count = 0;
+   cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout;
+   do {
+   int_status = readl(ioc-chip-HostInterruptStatus);
+   if (!(int_status  MPI2_HIS_SYS2IOC_DB_STATUS)) {
+   dhsprintk(ioc, printk(MPT2SAS_INFO_FMT
+   %s: successful count(%d), timeout(%d)\n,
+   ioc-name, __func__, count, timeout));
+   return 0;
+   } else if (int_status  MPI2_HIS_IOC2SYS_DB_STATUS) {
+   doorbell = readl(ioc-chip-Doorbell);
+   if ((doorbell  MPI2_IOC_STATE_MASK) ==
+   MPI2_IOC_STATE_FAULT) {
+   mpt2sas_base_fault_info(ioc , doorbell);
+   return -EFAULT;
+   }
+   } else if (int_status == 0x)
+   goto out;
+
+   if 

[PATCH 04/11][SCSI]mpt2sas: Copyright in driver sources is updated for year the 2014

2014-03-14 Thread Reddy, Sreekanth
Copyright in driver sources is updated for year the 2014.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt2sas/Kconfig |2 +-
 drivers/scsi/mpt2sas/mpt2sas_base.c  |2 +-
 drivers/scsi/mpt2sas/mpt2sas_base.h  |2 +-
 drivers/scsi/mpt2sas/mpt2sas_config.c|2 +-
 drivers/scsi/mpt2sas/mpt2sas_ctl.c   |2 +-
 drivers/scsi/mpt2sas/mpt2sas_ctl.h   |2 +-
 drivers/scsi/mpt2sas/mpt2sas_debug.h |2 +-
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |2 +-
 drivers/scsi/mpt2sas/mpt2sas_transport.c |2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/mpt2sas/Kconfig b/drivers/scsi/mpt2sas/Kconfig
index 39f08dd..657b45c 100644
--- a/drivers/scsi/mpt2sas/Kconfig
+++ b/drivers/scsi/mpt2sas/Kconfig
@@ -2,7 +2,7 @@
 # Kernel configuration file for the MPT2SAS
 #
 # This code is based on drivers/scsi/mpt2sas/Kconfig
-# Copyright (C) 2007-2012  LSI Corporation
+# Copyright (C) 2007-2014  LSI Corporation
 #  (mailto:dl-mptfusionli...@lsi.com)
 
 # This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c 
b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 7355b28..774720f 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -3,7 +3,7 @@
  * for access to MPT (Message Passing Technology) firmware.
  *
  * This code is based on drivers/scsi/mpt2sas/mpt2_base.c
- * Copyright (C) 2007-2013  LSI Corporation
+ * Copyright (C) 2007-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  * This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h 
b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 61b02ee..863a248 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -3,7 +3,7 @@
  * for access to MPT (Message Passing Technology) firmware.
  *
  * This code is based on drivers/scsi/mpt2sas/mpt2_base.h
- * Copyright (C) 2007-2013  LSI Corporation
+ * Copyright (C) 2007-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  * This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_config.c 
b/drivers/scsi/mpt2sas/mpt2sas_config.c
index 0c47425..c72a2ff 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_config.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_config.c
@@ -2,7 +2,7 @@
  * This module provides common API for accessing firmware configuration pages
  *
  * This code is based on drivers/scsi/mpt2sas/mpt2_base.c
- * Copyright (C) 2007-2013  LSI Corporation
+ * Copyright (C) 2007-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  * This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c 
b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
index b7f887c..5221c4b 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
@@ -3,7 +3,7 @@
  * controllers
  *
  * This code is based on drivers/scsi/mpt2sas/mpt2_ctl.c
- * Copyright (C) 2007-2013  LSI Corporation
+ * Copyright (C) 2007-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  * This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.h 
b/drivers/scsi/mpt2sas/mpt2sas_ctl.h
index 8b2ac18..fa0567c 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_ctl.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.h
@@ -3,7 +3,7 @@
  * controllers
  *
  * This code is based on drivers/scsi/mpt2sas/mpt2_ctl.h
- * Copyright (C) 2007-2013  LSI Corporation
+ * Copyright (C) 2007-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  * This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_debug.h 
b/drivers/scsi/mpt2sas/mpt2sas_debug.h
index a9021cb..cc57ef3 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_debug.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_debug.h
@@ -2,7 +2,7 @@
  * Logging Support for MPT (Message Passing Technology) based controllers
  *
  * This code is based on drivers/scsi/mpt2sas/mpt2_debug.c
- * Copyright (C) 2007-2013  LSI Corporation
+ * Copyright (C) 2007-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  * This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c 
b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index d502728..5ee6bf0 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -2,7 +2,7 @@
  * Scsi Host Layer for MPT (Message Passing Technology) based controllers
  *
  * This code is based on drivers/scsi/mpt2sas/mpt2_scsih.c
- * Copyright (C) 2007-2013  LSI Corporation
+ * Copyright (C) 2007-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  * This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c 
b/drivers/scsi/mpt2sas/mpt2sas_transport.c
index 

[PATCH 02/11][SCSI]mpt2sas: Added new driver module Parameter disable_eedp to Disable EEDP Support

2014-03-14 Thread Reddy, Sreekanth
A new mpt2sas driver module parameter 'disable_eedp' is added to Disable
EEDP support. By default DIF support is enabled in the driver and
this module parameter would allow users to turn it off.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.c  |9 --
 drivers/scsi/mpt2sas/mpt2sas_base.h  |1 +
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |   47 +++---
 3 files changed, 39 insertions(+), 18 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c 
b/drivers/scsi/mpt2sas/mpt2sas_base.c
index ed810fb..7355b28 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -440,13 +440,16 @@ _base_sas_ioc_info(struct MPT2SAS_ADAPTER *ioc, 
MPI2DefaultReply_t *mpi_reply,
 /
 
case MPI2_IOCSTATUS_EEDP_GUARD_ERROR:
-   desc = eedp guard error;
+   if (!ioc-disable_eedp_support)
+   desc = eedp guard error;
break;
case MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR:
-   desc = eedp ref tag error;
+   if (!ioc-disable_eedp_support)
+   desc = eedp ref tag error;
break;
case MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR:
-   desc = eedp app tag error;
+   if (!ioc-disable_eedp_support)
+   desc = eedp app tag error;
break;
 
 /
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h 
b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 1f2ac3a..61b02ee 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -842,6 +842,7 @@ struct MPT2SAS_ADAPTER {
u32 ioc_reset_count;
MPT2SAS_FLUSH_RUNNING_CMDS schedule_dead_ioc_flush_running_cmds;
u32 non_operational_loop;
+   u8  disable_eedp_support;
 
/* internal commands, callback index */
u8  scsi_io_cb_idx;
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c 
b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 7f0af4f..d502728 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -127,6 +127,11 @@ static int disable_discovery = -1;
 module_param(disable_discovery, int, 0);
 MODULE_PARM_DESC(disable_discovery,  disable discovery );
 
+/* Enable or disable EEDP support */
+static int disable_eedp;
+module_param(disable_eedp, uint, 0);
+MODULE_PARM_DESC(disable_eedp,  disable EEDP support: (default=0));
+
 /* permit overriding the host protection capabilities mask (EEDP/T10 PI) */
 static int prot_mask = 0;
 module_param(prot_mask, int, 0);
@@ -4031,7 +4036,8 @@ _scsih_qcmd_lck(struct scsi_cmnd *scmd, void 
(*done)(struct scsi_cmnd *))
}
mpi_request = mpt2sas_base_get_msg_frame(ioc, smid);
memset(mpi_request, 0, sizeof(Mpi2SCSIIORequest_t));
-   _scsih_setup_eedp(scmd, mpi_request);
+   if (!ioc-disable_eedp_support)
+   _scsih_setup_eedp(scmd, mpi_request);
if (scmd-cmd_len == 32)
mpi_control |= 4  MPI2_SCSIIO_CONTROL_ADDCDBLEN_SHIFT;
mpi_request-Function = MPI2_FUNCTION_SCSI_IO_REQUEST;
@@ -4196,14 +4202,20 @@ _scsih_scsi_ioc_info(struct MPT2SAS_ADAPTER *ioc, 
struct scsi_cmnd *scmd,
desc_ioc_state = scsi ext terminated;
break;
case MPI2_IOCSTATUS_EEDP_GUARD_ERROR:
-   desc_ioc_state = eedp guard error;
-   break;
+   if (!ioc-disable_eedp_support) {
+   desc_ioc_state = eedp guard error;
+   break;
+   }
case MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR:
-   desc_ioc_state = eedp ref tag error;
-   break;
+   if (!ioc-disable_eedp_support) {
+   desc_ioc_state = eedp ref tag error;
+   break;
+   }
case MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR:
-   desc_ioc_state = eedp app tag error;
-   break;
+   if (!ioc-disable_eedp_support) {
+   desc_ioc_state = eedp app tag error;
+   break;
+   }
default:
desc_ioc_state = unknown;
break;
@@ -4625,8 +4637,10 @@ _scsih_io_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 
msix_index, u32 reply)
case MPI2_IOCSTATUS_EEDP_GUARD_ERROR:
case MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR:
case MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR:
-   _scsih_eedp_error_handling(scmd, ioc_status);
-   break;
+   if (!ioc-disable_eedp_support) {
+   _scsih_eedp_error_handling(scmd, ioc_status);
+   break;
+   }
case MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR:
case 

[PATCH 03/11][SCSI]mpt2sas: MPI2 Rev Y (2.00.17) and Rev Z (2.00.18) specifications

2014-03-14 Thread Reddy, Sreekanth
Below is the change set in MPI2 Rev Y specification and in 2.00.17 header files
1) Added SCSIStatusQualifier to SCSI IO Error Reply message.
2) Added ATA Security Freeze Lock to IO Unit Page 1 Flags field.

Below is the change set in MPI2 Rev Z specification and in 2.00.19 header files
1) Added reserved fields to IO Unit Page 7 for future use.
2) Added optional functionality to IOCInit Request so that
   the host may specify a separate base address for each
   Reply Descriptor Post Queue. IOC support for this is
   indicated using a new IOCCapabilities bit in the IOCFacts Reply.
3) Added Toolbox Console Text Display Tool
   The host uses the Console Text Display Tool to send a string to
   IOC's Console using different console types (eg: UART serial terminal or 
Ethernet terminal).

The copyright in the mpi files is updated for year 2014

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt2sas/mpi/mpi2.h  |   12 -
 drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h |   29 ++
 drivers/scsi/mpt2sas/mpi/mpi2_init.h |8 ++-
 drivers/scsi/mpt2sas/mpi/mpi2_ioc.h  |   74 +-
 drivers/scsi/mpt2sas/mpi/mpi2_raid.h |8 +++-
 drivers/scsi/mpt2sas/mpi/mpi2_sas.h  |2 +-
 drivers/scsi/mpt2sas/mpi/mpi2_tool.h |   44 +++-
 drivers/scsi/mpt2sas/mpi/mpi2_type.h |2 +-
 8 files changed, 148 insertions(+), 31 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpi/mpi2.h b/drivers/scsi/mpt2sas/mpi/mpi2.h
index 7b14a01..088eefa 100644
--- a/drivers/scsi/mpt2sas/mpi/mpi2.h
+++ b/drivers/scsi/mpt2sas/mpi/mpi2.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000-2013 LSI Corporation.
+ *  Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *   Name:  mpi2.h
@@ -8,7 +8,7 @@
  *  scatter/gather formats.
  *  Creation Date:  June 21, 2006
  *
- *  mpi2.h Version:  02.00.28
+ *  mpi2.h Version:  02.00.32
  *
  *  Version History
  *  ---
@@ -78,6 +78,11 @@
  *  07-10-12  02.00.26  Bumped MPI2_HEADER_VERSION_UNIT.
  *  07-26-12  02.00.27  Bumped MPI2_HEADER_VERSION_UNIT.
  *  11-27-12  02.00.28  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  12-20-12  02.00.29  Bumped MPI2_HEADER_VERSION_UNIT.
+ * Added MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET.
+ *  04-09-13  02.00.30  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  04-17-13  02.00.31  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  08-19-13  02.00.32  Bumped MPI2_HEADER_VERSION_UNIT.
  *  --
  */
 
@@ -103,7 +108,7 @@
 #define MPI2_VERSION_02_00  (0x0200)
 
 /* versioning for this MPI header set */
-#define MPI2_HEADER_VERSION_UNIT(0x1C)
+#define MPI2_HEADER_VERSION_UNIT(0x20)
 #define MPI2_HEADER_VERSION_DEV (0x00)
 #define MPI2_HEADER_VERSION_UNIT_MASK   (0xFF00)
 #define MPI2_HEADER_VERSION_UNIT_SHIFT  (8)
@@ -263,6 +268,7 @@ typedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS
 #define MPI2_REPLY_POST_HOST_INDEX_MASK (0x00FF)
 #define MPI2_RPHI_MSIX_INDEX_MASK   (0xFF00)
 #define MPI2_RPHI_MSIX_INDEX_SHIFT  (24)
+#define MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET  (0x030C) /* MPI v2.5 only 
*/
 
 /*
  * Defines for the HCBSize and address
diff --git a/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h 
b/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h
index 88cb7f8..510ef0d 100644
--- a/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h
+++ b/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h
@@ -1,12 +1,12 @@
 /*
- *  Copyright (c) 2000-2013 LSI Corporation.
+ *  Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *   Name:  mpi2_cnfg.h
  *  Title:  MPI Configuration messages and pages
  *  Creation Date:  November 10, 2006
  *
- *mpi2_cnfg.h Version:  02.00.23
+ *mpi2_cnfg.h Version:  02.00.26
  *
  *  Version History
  *  ---
@@ -150,7 +150,13 @@
  *  Added UEFIVersion field to BIOS Page 1 and defined new
  *  BiosOptions bits.
  *  11-27-12  02.00.23  Added MPI2_MANPAGE7_FLAG_EVENTREPLAY_SLOT_ORDER.
- *  Added MPI2_BIOSPAGE1_OPTIONS_MASK_OEM_ID.
+ * Added MPI2_BIOSPAGE1_OPTIONS_MASK_OEM_ID.
+ *  12-20-12  02.00.24  Marked MPI2_SASIOUNIT1_CONTROL_CLEAR_AFFILIATION as
+ * obsolete for MPI v2.5 and later.
+ * Added some defines for 12G SAS speeds.
+ *  04-09-13  02.00.25  Added MPI2_IOUNITPAGE1_ATA_SECURITY_FREEZE_LOCK.
+ * Fixed MPI2_IOUNITPAGE5_DMA_CAP_MASK_MAX_REQUESTS to
+ * match the specification.
  *  --
  */
 
@@ -773,6 +779,7 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_1
 #define MPI2_IOUNITPAGE1_PAGEVERSION(0x04)
 
 /* IO Unit Page 1 Flags defines */
+#define MPI2_IOUNITPAGE1_ATA_SECURITY_FREEZE_LOCK   (0x4000)
 #define 

[PATCH 09/11][SCSI]mpt2sas: Get IOC_FACTS information using handshake protocol only after HBA card gets into READY or Operational state

2014-03-14 Thread Reddy, Sreekanth
The driver would send IOC facts only if HBA is in operational or ready
state. If it is in fault state, a diagnostic reset would be issued. It
would wait for 10 seconds to exit out of reset state. If the HBA continues
to be in reset state, then the HBA wouldn't be claimed by the driver.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.c |  416 ---
 1 files changed, 239 insertions(+), 177 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c 
b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 81f1d58..697c841 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -1737,6 +1737,238 @@ _base_handshake_req_reply_wait(struct MPT2SAS_ADAPTER 
*ioc, int request_bytes,
 }
 
 /**
+ * mpt2sas_base_get_iocstate - Get the current state of a MPT adapter.
+ * @ioc: Pointer to MPT_ADAPTER structure
+ * @cooked: Request raw or cooked IOC state
+ *
+ * Returns all IOC Doorbell register bits if cooked==0, else just the
+ * Doorbell bits in MPI_IOC_STATE_MASK.
+ */
+u32
+mpt2sas_base_get_iocstate(struct MPT2SAS_ADAPTER *ioc, int cooked)
+{
+   u32 s, sc;
+
+   s = readl(ioc-chip-Doorbell);
+   sc = s  MPI2_IOC_STATE_MASK;
+   return cooked ? sc : s;
+}
+
+/**
+ * _base_wait_on_iocstate - waiting on a particular ioc state
+ * @ioc_state: controller state { READY, OPERATIONAL, or RESET }
+ * @timeout: timeout in second
+ * @sleep_flag: CAN_SLEEP or NO_SLEEP
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+static int
+_base_wait_on_iocstate(struct MPT2SAS_ADAPTER *ioc, u32 ioc_state, int timeout,
+   int sleep_flag)
+{
+   u32 count, cntdn;
+   u32 current_state;
+
+   count = 0;
+   cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout;
+   do {
+   current_state = mpt2sas_base_get_iocstate(ioc, 1);
+   if (current_state == ioc_state)
+   return 0;
+   if (count  current_state == MPI2_IOC_STATE_FAULT)
+   break;
+   if (sleep_flag == CAN_SLEEP)
+   msleep(1);
+   else
+   udelay(500);
+   count++;
+   } while (--cntdn);
+
+   return current_state;
+}
+
+/**
+ * _base_diag_reset - the big hammer start of day reset
+ * @ioc: per adapter object
+ * @sleep_flag: CAN_SLEEP or NO_SLEEP
+ *
+ * Returns 0 for success, non-zero for failure.
+ */
+static int
+_base_diag_reset(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
+{
+   u32 host_diagnostic;
+   u32 ioc_state;
+   u32 count;
+   u32 hcb_size;
+
+   printk(MPT2SAS_INFO_FMT sending diag reset !!\n, ioc-name);
+
+   drsprintk(ioc, printk(MPT2SAS_INFO_FMT clear interrupts\n,
+   ioc-name));
+
+   count = 0;
+   do {
+   /* Write magic sequence to WriteSequence register
+* Loop until in diagnostic mode
+*/
+   drsprintk(ioc, printk(MPT2SAS_INFO_FMT write magic sequence\n
+   , ioc-name));
+   writel(MPI2_WRSEQ_FLUSH_KEY_VALUE, ioc-chip-WriteSequence);
+   writel(MPI2_WRSEQ_1ST_KEY_VALUE, ioc-chip-WriteSequence);
+   writel(MPI2_WRSEQ_2ND_KEY_VALUE, ioc-chip-WriteSequence);
+   writel(MPI2_WRSEQ_3RD_KEY_VALUE, ioc-chip-WriteSequence);
+   writel(MPI2_WRSEQ_4TH_KEY_VALUE, ioc-chip-WriteSequence);
+   writel(MPI2_WRSEQ_5TH_KEY_VALUE, ioc-chip-WriteSequence);
+   writel(MPI2_WRSEQ_6TH_KEY_VALUE, ioc-chip-WriteSequence);
+
+   /* wait 100 msec */
+   if (sleep_flag == CAN_SLEEP)
+   msleep(100);
+   else
+   mdelay(100);
+
+   if (count++  20)
+   goto out;
+
+   host_diagnostic = readl(ioc-chip-HostDiagnostic);
+   drsprintk(ioc, printk(MPT2SAS_INFO_FMT
+ wrote magic sequence: count(%d), host_diagnostic(0x%08x)\n,
+ ioc-name, count, host_diagnostic));
+
+   } while ((host_diagnostic  MPI2_DIAG_DIAG_WRITE_ENABLE) == 0);
+
+   hcb_size = readl(ioc-chip-HCBSize);
+
+   drsprintk(ioc, printk(MPT2SAS_INFO_FMT diag reset: issued\n,
+   ioc-name));
+   writel(host_diagnostic | MPI2_DIAG_RESET_ADAPTER,
+ioc-chip-HostDiagnostic);
+
+   /*This delay allows the chip PCIe hardware time to finish reset tasks*/
+   if (sleep_flag == CAN_SLEEP)
+   msleep(MPI2_HARD_RESET_PCIE_FIRST_READ_DELAY_MICRO_SEC/1000);
+   else
+   mdelay(MPI2_HARD_RESET_PCIE_FIRST_READ_DELAY_MICRO_SEC/1000);
+
+   /* Approximately 300 second max wait */
+   for (count = 0; count  (3 /
+   MPI2_HARD_RESET_PCIE_SECOND_READ_DELAY_MICRO_SEC); count++) {
+
+   host_diagnostic = readl(ioc-chip-HostDiagnostic);
+
+   if 

[PATCH 11/11][SCSI]mpt2sas: Bump mpt2sas driver version to 18.100.00.00

2014-03-14 Thread Reddy, Sreekanth
Bump mpt2sas driver version to 18.100.00.00.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h 
b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 6dbbaba..cc49cbf 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -69,8 +69,8 @@
 #define MPT2SAS_DRIVER_NAMEmpt2sas
 #define MPT2SAS_AUTHOR LSI Corporation dl-mptfusionli...@lsi.com
 #define MPT2SAS_DESCRIPTIONLSI MPT Fusion SAS 2.0 Device Driver
-#define MPT2SAS_DRIVER_VERSION 17.100.00.00
-#define MPT2SAS_MAJOR_VERSION  17
+#define MPT2SAS_DRIVER_VERSION 18.100.00.00
+#define MPT2SAS_MAJOR_VERSION  18
 #define MPT2SAS_MINOR_VERSION  100
 #define MPT2SAS_BUILD_VERSION  00
 #define MPT2SAS_RELEASE_VERSION00
-- 
1.7.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 10/11][SCSI]mpt2sas: Added module parameter 'unblock_io' to unblock IO's during disk addition

2014-03-14 Thread Reddy, Sreekanth

During hot-plugging of a disk(having a flaky link) the disk addition
stops and any further disk addition or removal doesn't happen on that 
controller.

This is because, when driver receives DELAY_NOT_RESPONDING for a disk when it 
is undergoing
addition in the SCSI Mid layer, the driver would block the I/O to that disk
resulting in a deadlock. i.e the disk addition work couldn't be completed
as it can't send any I/O to the disk as I/Os are blocked. Any device removal 
(TARGET_NOT_RESPONDING)
or link update(RC_PHY_CHANGED) couldn't be processed as they are in the queue
to get processed after disk addition.

Description of Change:
To handle such cases, unblock the I/Os to the disk in ISR context if the disk 
is undergoing
addition. The I/Os would get unblocked only if the driver receives 
RC_PHY_CHANGED reason
code when the device addition is within the SAS Transport layer.

An module parameter 'unblock_io' is introduced which needs to be set to have 
this
functionality enabled. By default this functionality is disabled.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.h  |3 +
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |   67 ++---
 drivers/scsi/mpt2sas/mpt2sas_transport.c |   13 ++
 3 files changed, 76 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h 
b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 32181a6..7de7ba4 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -356,6 +356,8 @@ struct _internal_cmd {
  * @phy: phy identifier provided in sas device page 0
  * @responding: used in _scsih_sas_device_mark_responding
  * @pfa_led_on: flag for PFA LED status
+ * @pend_sas_rphy_add: flag to check if device is in sas_rphy_add()
+ * addition routine
  */
 struct _sas_device {
struct list_head list;
@@ -375,6 +377,7 @@ struct _sas_device {
u8  phy;
u8  responding;
u8  pfa_led_on;
+   u8  pend_sas_rphy_add;
 };
 
 /**
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c 
b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 4a0728a..b08d8fd 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -105,6 +105,11 @@ static int missing_delay[2] = {-1, -1};
 module_param_array(missing_delay, int, NULL, 0);
 MODULE_PARM_DESC(missing_delay,  device missing delay , io missing delay);
 
+static int unblock_io;
+module_param(unblock_io, int, 0);
+MODULE_PARM_DESC(unblock_io,
+unblocks I/O if set to 1 when device is undergoing addition (default=0));
+
 /* scsi-mid layer global parmeter is max_report_luns, which is 511 */
 #define MPT2SAS_MAX_LUN (16895)
 static int max_lun = MPT2SAS_MAX_LUN;
@@ -2972,6 +2977,34 @@ _scsih_ublock_io_device(struct MPT2SAS_ADAPTER *ioc, u64 
sas_address)
 }
 
 /**
+ * _scsih_ublock_io_device_to_running - set the device state to SDEV_RUNNING
+ * @ioc: per adapter object
+ * @sas_addr: sas address
+ *
+ * unblock the device to receive IO during device addition. Device
+ * responsiveness is not checked before unblocking
+ */
+static void
+_scsih_ublock_io_device_to_running(struct MPT2SAS_ADAPTER *ioc, u64 
sas_address)
+{
+   struct MPT2SAS_DEVICE *sas_device_priv_data;
+   struct scsi_device *sdev;
+
+   shost_for_each_device(sdev, ioc-shost) {
+   sas_device_priv_data = sdev-hostdata;
+   if (!sas_device_priv_data)
+   continue;
+   if (sas_device_priv_data-sas_target-sas_address
+   != sas_address)
+   continue;
+   if (sas_device_priv_data-block) {
+   sas_device_priv_data-block = 0;
+   scsi_internal_device_unblock(sdev, SDEV_RUNNING);
+   }
+   }
+}
+
+/**
  * _scsih_block_io_all_device - set the device state to SDEV_BLOCK
  * @ioc: per adapter object
  * @handle: device handle
@@ -3081,21 +3114,23 @@ _scsih_block_io_to_children_attached_to_ex(struct 
MPT2SAS_ADAPTER *ioc,
 }
 
 /**
- * _scsih_block_io_to_children_attached_directly
+ * _scsih_handle_io_to_children_attached_directly
  * @ioc: per adapter object
  * @event_data: topology change event data
  *
- * This routine set sdev state to SDEV_BLOCK for all devices
- * direct attached during device pull.
+ * This routine set sdev state to SDEV_BLOCK or SDEV_RUNNING for all devices
+ * direct attached during device pull/reconnect.
  */
 static void
-_scsih_block_io_to_children_attached_directly(struct MPT2SAS_ADAPTER *ioc,
-Mpi2EventDataSasTopologyChangeList_t *event_data)
+_scsih_handle_io_to_children_attached_directly(struct MPT2SAS_ADAPTER *ioc,
+   Mpi2EventDataSasTopologyChangeList_t *event_data)
 {
int i;
u16 handle;
u16 reason_code;
u8 phy_number;
+   struct _sas_device *sas_device;
+   u8 link_rate, prev_link_rate;
 
for (i = 0; i  event_data-NumEntries; i++) 

[PATCH 1/9][SCSI]mpt3sas: Added new driver module Parameter disable_eedp to Disable EEDP Support

2014-03-14 Thread Reddy, Sreekanth
A new mpt3sas driver module parameter 'disable_eedp' is added to Disable
EEDP support. By default DIF support is enabled in the driver and
this module parameter would allow users to turn it off.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt3sas/mpt3sas_base.c  |   38 -
 drivers/scsi/mpt3sas/mpt3sas_base.h  |1 +
 drivers/scsi/mpt3sas/mpt3sas_scsih.c |   45 ++---
 3 files changed, 52 insertions(+), 32 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 0cf4f70..d46956e 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -429,13 +429,16 @@ _base_sas_ioc_info(struct MPT3SAS_ADAPTER *ioc, 
MPI2DefaultReply_t *mpi_reply,
 /
 
case MPI2_IOCSTATUS_EEDP_GUARD_ERROR:
-   desc = eedp guard error;
+   if (!ioc-disable_eedp_support)
+   desc = eedp guard error;
break;
case MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR:
-   desc = eedp ref tag error;
+   if (!ioc-disable_eedp_support)
+   desc = eedp ref tag error;
break;
case MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR:
-   desc = eedp app tag error;
+   if (!ioc-disable_eedp_support)
+   desc = eedp app tag error;
break;
 
 /
@@ -2429,21 +2432,22 @@ _base_static_config_pages(struct MPT3SAS_ADAPTER *ioc)
if (ioc-ir_firmware)
mpt3sas_config_get_manufacturing_pg10(ioc, mpi_reply,
ioc-manu_pg10);
-
-   /*
-* Ensure correct T10 PI operation if vendor left EEDPTagMode
-* flag unset in NVDATA.
-*/
-   mpt3sas_config_get_manufacturing_pg11(ioc, mpi_reply, ioc-manu_pg11);
-   if (ioc-manu_pg11.EEDPTagMode == 0) {
-   pr_err(%s: overriding NVDATA EEDPTagMode setting\n,
-   ioc-name);
-   ioc-manu_pg11.EEDPTagMode = ~0x3;
-   ioc-manu_pg11.EEDPTagMode |= 0x1;
-   mpt3sas_config_set_manufacturing_pg11(ioc, mpi_reply,
-   ioc-manu_pg11);
+   if (!ioc-disable_eedp_support) {
+   /*
+* Ensure correct T10 PI operation if vendor left EEDPTagMode
+* flag unset in NVDATA.
+*/
+   mpt3sas_config_get_manufacturing_pg11(ioc, mpi_reply,
+   ioc-manu_pg11);
+   if (ioc-manu_pg11.EEDPTagMode == 0) {
+   pr_err(%s: overriding NVDATA EEDPTagMode setting\n,
+   ioc-name);
+   ioc-manu_pg11.EEDPTagMode = ~0x3;
+   ioc-manu_pg11.EEDPTagMode |= 0x1;
+   mpt3sas_config_set_manufacturing_pg11(ioc, mpi_reply,
+   ioc-manu_pg11);
+   }
}
-
mpt3sas_config_get_bios_pg2(ioc, mpi_reply, ioc-bios_pg2);
mpt3sas_config_get_bios_pg3(ioc, mpi_reply, ioc-bios_pg3);
mpt3sas_config_get_ioc_pg8(ioc, mpi_reply, ioc-ioc_pg8);
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h 
b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 0ebf5d9..b1494ce 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -791,6 +791,7 @@ struct MPT3SAS_ADAPTER {
u32 event_context;
void*event_log;
u32 event_masks[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS];
+   u8  disable_eedp_support;
 
/* static config pages */
struct mpt3sas_facts facts;
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index a961fe1..1056cbf 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -116,7 +116,10 @@ static int max_lun = MPT3SAS_MAX_LUN;
 module_param(max_lun, int, 0);
 MODULE_PARM_DESC(max_lun,  max lun, default=16895 );
 
-
+/* Enable or disable EEDP support */
+static int disable_eedp;
+module_param(disable_eedp, uint, 0);
+MODULE_PARM_DESC(disable_eedp,  disable EEDP support: (default=0));
 
 
 /* diag_buffer_enable is bitwise
@@ -3614,7 +3617,8 @@ _scsih_qcmd_lck(struct scsi_cmnd *scmd, void 
(*done)(struct scsi_cmnd *))
}
mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
memset(mpi_request, 0, sizeof(Mpi2SCSIIORequest_t));
-   _scsih_setup_eedp(ioc, scmd, mpi_request);
+   if (!ioc-disable_eedp_support)
+   _scsih_setup_eedp(ioc, scmd, mpi_request);
 
if (scmd-cmd_len == 32)
mpi_control |= 4  MPI2_SCSIIO_CONTROL_ADDCDBLEN_SHIFT;
@@ -3769,14 +3773,21 @@ _scsih_scsi_ioc_info(struct MPT3SAS_ADAPTER *ioc, 
struct 

[PATCH][SCSI]mpt3sas: Description Patch

2014-03-14 Thread Reddy, Sreekanth
Please consider this patch set for next kernel release.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---

[PATCH 1/9][SCSI]mpt3sas: Added new driver module Parameter disable_eedp to 
Disable EEDP Support.
[PATCH 2/9][SCSI]mpt3sas: MPI2.5 Rev G (2.5.2) specifications.
[PATCH 3/9][SCSI]mpt3sas: Clear PFA Status on SGPIO when PFA Drive is Removed 
or Replaced.
[PATCH 4/9][SCSI]mpt3sas: Bump mpt3sas driver version to 03.100.00.00.
[PATCH 5/9][SCSI]mpt3sas: MPI2.5 Rev H (2.5.3) specifications.
[PATCH 6/9][SCSI]mpt3sas: Copyright in driver sources is updated for year the 
2014.
[PATCH 7/9][SCSI]mpt3sas: Added OEM branding Strings.
[PATCH 8/9][SCSI]mpt3sas: Added Reply Descriptor Post Queue (RDPQ) Array 
support.
[PATCH 9/9][SCSI]mpt3sas: Bump mpt3sas driver version to 04.100.00.00.
--
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/9][SCSI]mpt3sas: Clear PFA Status on SGPIO when PFA Drive is Removed or Replaced

2014-03-14 Thread Reddy, Sreekanth
Added code to send an SEP message that turns off the Predictive
Failure LED when a drive is removed (if Predictive Failure LED was turned on).

Added a new flag 'pfa_led_on' per device that tracks the status of Predictive
Failure LED. When the drive is removed, this flag is checked and
sends an SEP message to turn off the respective Predictive Failure LED.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt3sas/mpt3sas_base.h  |5 ++-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c |   67 +-
 2 files changed, 61 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h 
b/drivers/scsi/mpt3sas/mpt3sas_base.h
index b1494ce..3007521 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -272,8 +272,10 @@ struct _internal_cmd {
  * @channel: target channel
  * @slot: number number
  * @phy: phy identifier provided in sas device page 0
- * @fast_path: fast path feature enable bit
  * @responding: used in _scsih_sas_device_mark_responding
+ * @fast_path: fast path feature enable bit
+ * @pfa_led_on: flag for PFA LED status
+ *
  */
 struct _sas_device {
struct list_head list;
@@ -293,6 +295,7 @@ struct _sas_device {
u8  phy;
u8  responding;
u8  fast_path;
+   u8  pfa_led_on;
 };
 
 /**
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 1056cbf..905c82c 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -162,7 +162,7 @@ struct sense_info {
 };
 
 #define MPT3SAS_PROCESS_TRIGGER_DIAG (0xFFFB)
-#define MPT3SAS_TURN_ON_FAULT_LED (0xFFFC)
+#define MPT3SAS_TURN_ON_PFA_LED (0xFFFC)
 #define MPT3SAS_PORT_ENABLE_COMPLETE (0xFFFD)
 #define MPT3SAS_ABRT_TASK_SET (0xFFFE)
 #define MPT3SAS_REMOVE_UNRESPONDING_DEVICES (0x)
@@ -3903,7 +3903,7 @@ _scsih_scsi_ioc_info(struct MPT3SAS_ADAPTER *ioc, struct 
scsi_cmnd *scmd,
 #endif
 
 /**
- * _scsih_turn_on_fault_led - illuminate Fault LED
+ * _scsih_turn_on_pfa_led - illuminate PFA LED
  * @ioc: per adapter object
  * @handle: device handle
  * Context: process
@@ -3911,10 +3911,15 @@ _scsih_scsi_ioc_info(struct MPT3SAS_ADAPTER *ioc, 
struct scsi_cmnd *scmd,
  * Return nothing.
  */
 static void
-_scsih_turn_on_fault_led(struct MPT3SAS_ADAPTER *ioc, u16 handle)
+_scsih_turn_on_pfa_led(struct MPT3SAS_ADAPTER *ioc, u16 handle)
 {
Mpi2SepReply_t mpi_reply;
Mpi2SepRequest_t mpi_request;
+   struct _sas_device *sas_device;
+
+   sas_device = _scsih_sas_device_find_by_handle(ioc, handle);
+   if (!sas_device)
+   return;
 
memset(mpi_request, 0, sizeof(Mpi2SepRequest_t));
mpi_request.Function = MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR;
@@ -3929,6 +3934,7 @@ _scsih_turn_on_fault_led(struct MPT3SAS_ADAPTER *ioc, u16 
handle)
__FILE__, __LINE__, __func__);
return;
}
+   sas_device-pfa_led_on = 1;
 
if (mpi_reply.IOCStatus || mpi_reply.IOCLogInfo) {
dewtprintk(ioc, pr_info(MPT3SAS_FMT
@@ -3938,9 +3944,46 @@ _scsih_turn_on_fault_led(struct MPT3SAS_ADAPTER *ioc, 
u16 handle)
return;
}
 }
+/**
+ * _scsih_turn_off_pfa_led - turn off Fault LED
+ * @ioc: per adapter object
+ * @sas_device: sas device whose PFA LED has to turned off
+ * Context: process
+ *
+ * Return nothing.
+ */
+static void
+_scsih_turn_off_pfa_led(struct MPT3SAS_ADAPTER *ioc,
+   struct _sas_device *sas_device)
+{
+   Mpi2SepReply_t mpi_reply;
+   Mpi2SepRequest_t mpi_request;
 
+   memset(mpi_request, 0, sizeof(Mpi2SepRequest_t));
+   mpi_request.Function = MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR;
+   mpi_request.Action = MPI2_SEP_REQ_ACTION_WRITE_STATUS;
+   mpi_request.SlotStatus = 0;
+   mpi_request.Slot = cpu_to_le16(sas_device-slot);
+   mpi_request.DevHandle = 0;
+   mpi_request.EnclosureHandle = cpu_to_le16(sas_device-enclosure_handle);
+   mpi_request.Flags = MPI2_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS;
+   if ((mpt3sas_base_scsi_enclosure_processor(ioc, mpi_reply,
+   mpi_request)) != 0) {
+   printk(MPT3SAS_FMT failure at %s:%d/%s()!\n, ioc-name,
+   __FILE__, __LINE__, __func__);
+   return;
+   }
+
+   if (mpi_reply.IOCStatus || mpi_reply.IOCLogInfo) {
+   dewtprintk(ioc, printk(MPT3SAS_FMT
+enclosure_processor: ioc_status (0x%04x), loginfo(0x%08x)\n,
+ioc-name, le16_to_cpu(mpi_reply.IOCStatus),
+le32_to_cpu(mpi_reply.IOCLogInfo)));
+   return;
+   }
+}
 /**
- * _scsih_send_event_to_turn_on_fault_led - fire delayed event
+ * _scsih_send_event_to_turn_on_pfa_led - fire delayed event
  * @ioc: per adapter object
  * @handle: device handle
  * Context: interrupt.
@@ -3948,14 +3991,14 @@ _scsih_turn_on_fault_led(struct MPT3SAS_ADAPTER *ioc, 
u16 

[PATCH 4/9][SCSI]mpt3sas: Bump mpt3sas driver version to v03.100.00.00

2014-03-14 Thread Reddy, Sreekanth
Bump mpt3sas driver version to 03.100.00.00.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt3sas/mpt3sas_base.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h 
b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 3007521..0f7add9 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -70,8 +70,8 @@
 #define MPT3SAS_DRIVER_NAMEmpt3sas
 #define MPT3SAS_AUTHOR LSI Corporation dl-mptfusionli...@lsi.com
 #define MPT3SAS_DESCRIPTIONLSI MPT Fusion SAS 3.0 Device Driver
-#define MPT3SAS_DRIVER_VERSION 02.100.00.00
-#define MPT3SAS_MAJOR_VERSION  2
+#define MPT3SAS_DRIVER_VERSION 03.100.00.00
+#define MPT3SAS_MAJOR_VERSION  3
 #define MPT3SAS_MINOR_VERSION  100
 #define MPT3SAS_BUILD_VERSION  0
 #define MPT3SAS_RELEASE_VERSION00
-- 
1.7.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 2/9][SCSI]mpt3sas: MPI2.5 Rev G (2.5.2) specifications

2014-03-14 Thread Reddy, Sreekanth
Below is the change set in MPI2.5 Rev G specification and 2.00.31 header files
1) Added SCSIStatusQualifier to SCSI IO Error Reply message.
2) Added ATA Security Freeze Lock to IO Unit Page 1 Flags field.
3) Added Allow Protection Information bit for IR Volume Create.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt3sas/mpi/mpi2.h  |6 --
 drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h |8 ++--
 drivers/scsi/mpt3sas/mpi/mpi2_init.h |6 --
 drivers/scsi/mpt3sas/mpi/mpi2_raid.h |6 +-
 4 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpi/mpi2.h b/drivers/scsi/mpt3sas/mpi/mpi2.h
index 20da8f9..dc143dd 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.29
+ * mpi2.h Version:  02.00.31
  *
  * 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
@@ -86,6 +86,8 @@
  * 11-27-12  02.00.28  Bumped MPI2_HEADER_VERSION_UNIT.
  * 12-20-12  02.00.29  Bumped MPI2_HEADER_VERSION_UNIT.
  * Added MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET.
+ * 04-09-13  02.00.30  Bumped MPI2_HEADER_VERSION_UNIT.
+ * 04-17-13  02.00.31  Bumped MPI2_HEADER_VERSION_UNIT.
  * --
  */
 
@@ -119,7 +121,7 @@
 #define MPI2_VERSION_02_05  (0x0205)
 
 /*Unit and Dev versioning for this MPI header set */
-#define MPI2_HEADER_VERSION_UNIT(0x1D)
+#define MPI2_HEADER_VERSION_UNIT(0x1F)
 #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 889aa70..5b0e5c1 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.24
+ *   mpi2_cnfg.h Version:  02.00.25
  *
  * 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
@@ -160,6 +160,9 @@
  * 12-20-12  02.00.24  Marked MPI2_SASIOUNIT1_CONTROL_CLEAR_AFFILIATION as
  * obsolete for MPI v2.5 and later.
  * Added some defines for 12G SAS speeds.
+ * 04-09-13  02.00.25  Added MPI2_IOUNITPAGE1_ATA_SECURITY_FREEZE_LOCK.
+ * Fixed MPI2_IOUNITPAGE5_DMA_CAP_MASK_MAX_REQUESTS to
+ * match the specification.
  * --
  */
 
@@ -792,6 +795,7 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_1 {
 #define MPI2_IOUNITPAGE1_PAGEVERSION(0x04)
 
 /*IO Unit Page 1 Flags defines */
+#define MPI2_IOUNITPAGE1_ATA_SECURITY_FREEZE_LOCK   (0x4000)
 #define MPI25_IOUNITPAGE1_NEW_DEVICE_FAST_PATH_DISABLE  (0x2000)
 #define MPI25_IOUNITPAGE1_DISABLE_FAST_PATH (0x1000)
 #define MPI2_IOUNITPAGE1_ENABLE_HOST_BASED_DISCOVERY(0x0800)
@@ -870,7 +874,7 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_5 {
 #define MPI2_IOUNITPAGE5_PAGEVERSION(0x00)
 
 /*defines for IO Unit Page 5 DmaEngineCapabilities field */
-#define MPI2_IOUNITPAGE5_DMA_CAP_MASK_MAX_REQUESTS  (0xFF00)
+#define MPI2_IOUNITPAGE5_DMA_CAP_MASK_MAX_REQUESTS  (0x)
 #define MPI2_IOUNITPAGE5_DMA_CAP_SHIFT_MAX_REQUESTS (16)
 
 #define MPI2_IOUNITPAGE5_DMA_CAP_EEDP   (0x0008)
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_init.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_init.h
index f7928bf..b3e3331 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_init.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_init.h
@@ -6,7 +6,7 @@
  * Title:  MPI SCSI initiator mode messages and structures
  * Creation Date:  June 23, 2006
  *
- * mpi2_init.h Version:  02.00.14
+ * mpi2_init.h Version:  02.00.15
  *
  * 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
@@ -44,6 +44,8 @@
  * Priority to match SAM-4.
  * Added EEDPErrorOffset to MPI2_SCSI_IO_REPLY.
  * 07-10-12  02.00.14  Added MPI2_SCSIIO_CONTROL_SHIFT_DATADIRECTION.
+ * 04-09-13  02.00.15  Added SCSIStatusQualifier field to MPI2_SCSI_IO_REPLY,
+ * replacing the Reserved4 field.
  * --
  */
 
@@ -347,7 +349,7 @@ typedef struct _MPI2_SCSI_IO_REPLY {
U32 SenseCount; /*0x18 */
U32 ResponseInfo;   /*0x1C */
U16 TaskTag;/*0x20 

[PATCH 5/9][SCSI]mpt3sas: MPI2.5 Rev H (2.5.3) specifications

2014-03-14 Thread Reddy, Sreekanth
Below is the change set in MPI2.5 Rev H specification and 2.00.32 header files
1) Added reserved fields to IO Unit Page 7 for future use.
2) Added optional functionality to IOCInit Request so that
   the host may specify a separate base address for each
   Reply Descriptor Post Queue. IOC support for this is
   indicated using a new IOCCapabilities bit in the IOCFacts Reply.
3) Added Toolbox Console Text Display Tool
   The host uses the Console Text Display Tool to send a string to
   IOC's Console using different console types (eg: UART serial terminal or 
Ethernet terminal).
4) Firmware images can now be signed using an encrypted hash.
5) Added MPI2_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL
6) Added more details about configuration page restrictions when Host Based 
Discovery is enabled
   Enabling host based discovery affects the availability of some configuration 
pages and events.
   The SAS Expander, SAS Device, and SAS Enclosure configuration  pages are not 
available from the IOC.
   The IOC returns an error status to any Configuration Request message 
attempting to access these pages.
   The IOC does not send the SAS Discovery Event, the SAS Topology Change List 
Event, or
   the SAS Enclosure Device Status Change Event when host based discovery is 
enabled.
7) Bit 13 of the SAS IO Unit Page 1 ControlFlags field is now obsolete.
   It was used to enable limiting direct attached SATA maximum link rate to 1.5 
Gbps.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h |   10 -
 drivers/scsi/mpt3sas/mpi/mpi2_ioc.h  |   62 -
 drivers/scsi/mpt3sas/mpi/mpi2_sas.h  |6 ++-
 drivers/scsi/mpt3sas/mpi/mpi2_tool.h |   43 +++-
 4 files changed, 114 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
index 5b0e5c1..becee07 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.25
+ *   mpi2_cnfg.h Version:  02.00.26
  *
  * 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
@@ -163,6 +163,8 @@
  * 04-09-13  02.00.25  Added MPI2_IOUNITPAGE1_ATA_SECURITY_FREEZE_LOCK.
  * Fixed MPI2_IOUNITPAGE5_DMA_CAP_MASK_MAX_REQUESTS to
  * match the specification.
+ * 08-19-13  02.00.26  Added reserved words to MPI2_CONFIG_PAGE_IO_UNIT_7 for
+ * future use.
  * --
  */
 
@@ -924,11 +926,15 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_7 {
U8
BoardTemperatureUnits;  /*0x16 */
U8  Reserved3;  /*0x17 */
+   U32 Reserved4;  /* 0x18 */
+   U32 Reserved5;  /* 0x1C */
+   U32 Reserved6;  /* 0x20 */
+   U32 Reserved7;  /* 0x24 */
 } MPI2_CONFIG_PAGE_IO_UNIT_7,
*PTR_MPI2_CONFIG_PAGE_IO_UNIT_7,
Mpi2IOUnitPage7_t, *pMpi2IOUnitPage7_t;
 
-#define MPI2_IOUNITPAGE7_PAGEVERSION(0x02)
+#define MPI2_IOUNITPAGE7_PAGEVERSION   (0x04)
 
 /*defines for IO Unit Page 7 CurrentPowerMode and PreviousPowerMode fields */
 #define MPI25_IOUNITPAGE7_PM_INIT_MASK  (0xC0)
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
index e2bb821..15813f3 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
@@ -6,7 +6,7 @@
  * Title:  MPI IOC, Port, Event, FW Download, and FW Upload messages
  * Creation Date:  October 11, 2006
  *
- * mpi2_ioc.h Version:  02.00.22
+ * mpi2_ioc.h Version:  02.00.23
  *
  * 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
@@ -127,6 +127,11 @@
  * 07-26-12  02.00.22  Added MPI2_IOCFACTS_EXCEPT_PARTIAL_MEMORY_FAILURE.
  * Added ElapsedSeconds field to
  * MPI2_EVENT_DATA_IR_OPERATION_STATUS.
+ * 08-19-13  02.00.23  For IOCInit, added MPI2_IOCINIT_MSGFLAG_RDPQ_ARRAY_MODE
+ * and MPI2_IOC_INIT_RDPQ_ARRAY_ENTRY.
+ * Added MPI2_IOCFACTS_CAPABILITY_RDPQ_ARRAY_CAPABLE.
+ * Added MPI2_FW_DOWNLOAD_ITYPE_PUBLIC_KEY.
+ * Added Encrypted Hash Extended Image.
  * --
  */
 
@@ -182,6 +187,10 @@ typedef struct _MPI2_IOC_INIT_REQUEST {
 #define MPI2_WHOINIT_HOST_DRIVER(0x04)
 #define MPI2_WHOINIT_MANUFACTURER

[PATCH 6/9][SCSI]mpt3sas: Copyright in driver sources is updated for year the 2014

2014-03-14 Thread Reddy, Sreekanth
Copyright in driver sources is updated for year the 2014.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt3sas/Kconfig|2 +-
 drivers/scsi/mpt3sas/mpi/mpi2.h |2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h|2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_init.h|2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_ioc.h |2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_raid.h|2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_sas.h |2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_tool.h|2 +-
 drivers/scsi/mpt3sas/mpi/mpi2_type.h|2 +-
 drivers/scsi/mpt3sas/mpt3sas_base.c |2 +-
 drivers/scsi/mpt3sas/mpt3sas_base.h |2 +-
 drivers/scsi/mpt3sas/mpt3sas_config.c   |2 +-
 drivers/scsi/mpt3sas/mpt3sas_ctl.c  |2 +-
 drivers/scsi/mpt3sas/mpt3sas_ctl.h  |2 +-
 drivers/scsi/mpt3sas/mpt3sas_debug.h|2 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c|2 +-
 drivers/scsi/mpt3sas/mpt3sas_transport.c|2 +-
 drivers/scsi/mpt3sas/mpt3sas_trigger_diag.c |2 +-
 drivers/scsi/mpt3sas/mpt3sas_trigger_diag.h |2 +-
 19 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/scsi/mpt3sas/Kconfig b/drivers/scsi/mpt3sas/Kconfig
index d53e1b0..4d235dd 100644
--- a/drivers/scsi/mpt3sas/Kconfig
+++ b/drivers/scsi/mpt3sas/Kconfig
@@ -2,7 +2,7 @@
 # Kernel configuration file for the MPT3SAS
 #
 # This code is based on drivers/scsi/mpt3sas/Kconfig
-# Copyright (C) 2012-2013  LSI Corporation
+# Copyright (C) 2012-2014  LSI Corporation
 #  (mailto:dl-mptfusionli...@lsi.com)
 
 # This program is free software; you can redistribute it and/or
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2.h b/drivers/scsi/mpt3sas/mpi/mpi2.h
index dc143dd..c34c115 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *  Name:  mpi2.h
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
index becee07..e261a31 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *  Name:  mpi2_cnfg.h
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_init.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_init.h
index b3e3331..068c98e 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_init.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_init.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *  Name:  mpi2_init.h
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
index 15813f3..4908309 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *  Name:  mpi2_ioc.h
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_raid.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_raid.h
index fbe3aae..13d93ca 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_raid.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_raid.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *  Name:  mpi2_raid.h
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_sas.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_sas.h
index 361a275..156e305 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_sas.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_sas.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *  Name:  mpi2_sas.h
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_tool.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_tool.h
index 94e32c2..904910d 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_tool.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_tool.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *  Name:  mpi2_tool.h
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_type.h 
b/drivers/scsi/mpt3sas/mpi/mpi2_type.h
index ba1fed5..99ab093 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2_type.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_type.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000-2013 LSI Corporation.
+ *  Copyright (c) 2000-2014 LSI Corporation.
  *
  *
  *   Name:  mpi2_type.h
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index d46956e..8c77cd4 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -3,7 +3,7 @@
  * for access to MPT (Message Passing Technology) firmware.
  *
  * This code is based on drivers/scsi/mpt3sas/mpt3sas_base.c
- * Copyright (C) 2012-2013  LSI Corporation
+ * Copyright (C) 2012-2014  LSI Corporation
  *  (mailto:dl-mptfusionli...@lsi.com)
  *
  

[PATCH 7/9][SCSI]mpt3sas: Added OEM branding Strings

2014-03-14 Thread Reddy, Sreekanth
Added following branding Strings for Intel custom HBAs support.

Driver String:  Vendor ID   Device ID   
SubSystemVendor ID  SubSystemDevice ID
Intel(R) Integrated RAID Module RMS3JC080   0x1000  0x0097  
0x8086  0x3521
Intel(R) RAID Controller RS3GC008   0x1000  0x0097  
0x8086  0x3522
Intel(R) RAID Controller RS3FC044   0x1000  0x0097  
0x8086  0x3523
Intel(R) RAID Controller RS3UC080   0x1000  0x0097  
0x8086  0x3524

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt3sas/mpt3sas_base.c |   49 +++
 drivers/scsi/mpt3sas/mpt3sas_base.h |   18 +
 2 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 8c77cd4..f1406cc 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -2219,6 +2219,53 @@ mpt3sas_base_put_smid_default(struct MPT3SAS_ADAPTER 
*ioc, u16 smid)
ioc-scsi_lookup_lock);
 }
 
+/**
+ * _base_display_intel_branding - Display branding string
+ * @ioc: per adapter object
+ *
+ * Return nothing.
+ */
+static void
+_base_display_intel_branding(struct MPT3SAS_ADAPTER *ioc)
+{
+   if (ioc-pdev-subsystem_vendor != PCI_VENDOR_ID_INTEL)
+   return;
+
+   switch (ioc-pdev-device) {
+   case MPI25_MFGPAGE_DEVID_SAS3008:
+   switch (ioc-pdev-subsystem_device) {
+   case MPT3SAS_INTEL_RMS3JC080_SSDID:
+   pr_info(MPT3SAS_FMT %s\n, ioc-name,
+   MPT3SAS_INTEL_RMS3JC080_BRANDING);
+   break;
+
+   case MPT3SAS_INTEL_RS3GC008_SSDID:
+   pr_info(MPT3SAS_FMT %s\n, ioc-name,
+   MPT3SAS_INTEL_RS3GC008_BRANDING);
+   break;
+   case MPT3SAS_INTEL_RS3FC044_SSDID:
+   pr_info(MPT3SAS_FMT %s\n, ioc-name,
+   MPT3SAS_INTEL_RS3FC044_BRANDING);
+   break;
+   case MPT3SAS_INTEL_RS3UC080_SSDID:
+   pr_info(MPT3SAS_FMT %s\n, ioc-name,
+   MPT3SAS_INTEL_RS3UC080_BRANDING);
+   break;
+   default:
+   pr_info(MPT3SAS_FMT
+   Intel(R) Controller: Subsystem ID: 0x%X\n,
+   ioc-name, ioc-pdev-subsystem_device);
+   break;
+   }
+   break;
+   default:
+   pr_info(MPT3SAS_FMT
+   Intel(R) Controller: Subsystem ID: 0x%X\n,
+   ioc-name, ioc-pdev-subsystem_device);
+   break;
+   }
+}
+
 
 
 /**
@@ -2250,6 +2297,8 @@ _base_display_ioc_capabilities(struct MPT3SAS_ADAPTER 
*ioc)
   (bios_version  0xFF00)  8,
bios_version  0x00FF);
 
+   _base_display_intel_branding(ioc);
+
pr_info(MPT3SAS_FMT Protocol=(, ioc-name);
 
if (ioc-facts.ProtocolFlags  MPI2_IOCFACTS_PROTOCOL_SCSI_INITIATOR) {
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h 
b/drivers/scsi/mpt3sas/mpt3sas_base.h
index f163423..f61765c 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -130,7 +130,25 @@
 #define MPT_TARGET_FLAGS_DELETED   0x04
 #define MPT_TARGET_FASTPATH_IO 0x08
 
+/*
+ * Intel HBA branding
+ */
+#define MPT3SAS_INTEL_RMS3JC080_BRANDING   \
+   Intel(R) Integrated RAID Module RMS3JC080
+#define MPT3SAS_INTEL_RS3GC008_BRANDING   \
+   Intel(R) RAID Controller RS3GC008
+#define MPT3SAS_INTEL_RS3FC044_BRANDING   \
+   Intel(R) RAID Controller RS3FC044
+#define MPT3SAS_INTEL_RS3UC080_BRANDING   \
+   Intel(R) RAID Controller RS3UC080
 
+/*
+ * Intel HBA SSDIDs
+ */
+#define MPT3SAS_INTEL_RMS3JC080_SSDID  0x3521
+#define MPT3SAS_INTEL_RS3GC008_SSDID   0x3522
+#define MPT3SAS_INTEL_RS3FC044_SSDID   0x3523
+#define MPT3SAS_INTEL_RS3UC080_SSDID0x3524
 
 /*
  * status bits for ioc-diag_buffer_status
-- 
1.7.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 8/9][SCSI]mpt3sas: Added Reply Descriptor Post Queue (RDPQ) Array support

2014-03-14 Thread Reddy, Sreekanth
Up to now, Driver allocates a single contiguous block of memory
pool for all reply queues and passes down a single address in the
ReplyDescriptorPostQueueAddress field of the IOC Init Request
Message to the firmware.

When firmware receives this address, it will program each of the
Reply Descriptor Post Queue registers, as each reply queue has its
own register. Thus the firmware, starting from a base address it
determines the starting address of the subsequent reply queues
through some simple arithmetic calculations.

The size of this contiguous block of memory pool is directly proportional
to number of MSI-X vectors and the HBA queue depth. For example higher
MSIX vectors requires larger contiguous block of memory pool.

But some of the OS kernels are unable to allocate this larger
contiguous block of memory pool.

So, the proposal is to allocate memory independently for each
Reply Queue and pass down all of the addresses to the firmware.
Then the firmware will just take each address and program the value
into the correct register.

When HBAs with older firmware(i.e. without RDPQ capability) is used
with this new driver then the max_msix_vectors value would be set
to 8 by default.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt3sas/mpt3sas_base.c |  916 ---
 drivers/scsi/mpt3sas/mpt3sas_base.h |   19 +-
 2 files changed, 543 insertions(+), 392 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index f1406cc..483785b 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -82,10 +82,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 max_msix_vectors = 8;
+static int max_msix_vectors = -1;
 module_param(max_msix_vectors, int, 0);
 MODULE_PARM_DESC(max_msix_vectors,
-max msix vectors - (default=8));
+max msix vectors);
 
 static int mpt3sas_fwfault_debug;
 MODULE_PARM_DESC(mpt3sas_fwfault_debug,
@@ -1728,6 +1728,9 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
ioc-reply_queue_count = min_t(int, ioc-cpu_count,
ioc-msix_vector_count);
 
+   if (!ioc-rdpq_array_enable  max_msix_vectors == -1)
+   max_msix_vectors = 8;
+
printk(MPT3SAS_FMT MSI-X vectors supported: %d, no of cores
  : %d, max_msix_vectors: %d\n, ioc-name, ioc-msix_vector_count,
  ioc-cpu_count, max_msix_vectors);
@@ -1782,6 +1785,334 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
 }
 
 /**
+ * _base_wait_for_doorbell_int - waiting for controller interrupt(generated by
+ * a write to the doorbell)
+ * @ioc: per adapter object
+ * @timeout: timeout in second
+ * @sleep_flag: CAN_SLEEP or NO_SLEEP
+ *
+ * Returns 0 for success, non-zero for failure.
+ *
+ * Notes: MPI2_HIS_IOC2SYS_DB_STATUS - set to one when IOC writes to doorbell.
+ */
+static int
+_base_wait_for_doorbell_int(struct MPT3SAS_ADAPTER *ioc, int timeout,
+   int sleep_flag)
+{
+   u32 cntdn, count;
+   u32 int_status;
+
+   count = 0;
+   cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout;
+   do {
+   int_status = readl(ioc-chip-HostInterruptStatus);
+   if (int_status  MPI2_HIS_IOC2SYS_DB_STATUS) {
+   dhsprintk(ioc, pr_info(MPT3SAS_FMT
+   %s: successfull count(%d), timeout(%d)\n,
+   ioc-name, __func__, count, timeout));
+   return 0;
+   }
+   if (sleep_flag == CAN_SLEEP)
+   msleep(1);
+   else
+   udelay(500);
+   count++;
+   } while (--cntdn);
+
+   pr_err(MPT3SAS_FMT
+   %s: failed due to timeout count(%d), int_status(%x)!\n,
+   ioc-name, __func__, count, int_status);
+   return -EFAULT;
+}
+
+/**
+ * _base_wait_for_doorbell_ack - waiting for controller to read the doorbell.
+ * @ioc: per adapter object
+ * @timeout: timeout in second
+ * @sleep_flag: CAN_SLEEP or NO_SLEEP
+ *
+ * Returns 0 for success, non-zero for failure.
+ *
+ * Notes: MPI2_HIS_SYS2IOC_DB_STATUS - set to one when host writes to
+ * doorbell.
+ */
+static int
+_base_wait_for_doorbell_ack(struct MPT3SAS_ADAPTER *ioc, int timeout,
+   int sleep_flag)
+{
+   u32 cntdn, count;
+   u32 int_status;
+   u32 doorbell;
+
+   count = 0;
+   cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout;
+   do {
+   int_status = readl(ioc-chip-HostInterruptStatus);
+   if (!(int_status  MPI2_HIS_SYS2IOC_DB_STATUS)) {
+   dhsprintk(ioc, pr_info(MPT3SAS_FMT
+   %s: successfull count(%d), timeout(%d)\n,
+   ioc-name, __func__, count, timeout));
+   return 0;
+   } 

[PATCH 9/9][SCSI]mpt3sas: Bump mpt3sas driver version to v04.100.00.00

2014-03-14 Thread Reddy, Sreekanth
Bump mpt3sas driver version to 04.100.00.00.

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---
 drivers/scsi/mpt3sas/mpt3sas_base.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h 
b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 8fb2a38..09545fc 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -70,8 +70,8 @@
 #define MPT3SAS_DRIVER_NAMEmpt3sas
 #define MPT3SAS_AUTHOR LSI Corporation dl-mptfusionli...@lsi.com
 #define MPT3SAS_DESCRIPTIONLSI MPT Fusion SAS 3.0 Device Driver
-#define MPT3SAS_DRIVER_VERSION 03.100.00.00
-#define MPT3SAS_MAJOR_VERSION  3
+#define MPT3SAS_DRIVER_VERSION 04.100.00.00
+#define MPT3SAS_MAJOR_VERSION  4
 #define MPT3SAS_MINOR_VERSION  100
 #define MPT3SAS_BUILD_VERSION  0
 #define MPT3SAS_RELEASE_VERSION00
-- 
1.7.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 5/8][SCSI] mpt2sas: Infinite loop can occur if MPI2_IOCSTATUS_CONFIG_INVALID_PAGE is not returned

2013-08-26 Thread Reddy, Sreekanth
Hi James,

Sorry  for the delay. 

we support the first method i.e. strip the cc: stable from this patch and send 
it to the misc branch.

Thanks,
Sreekanth.

-Original Message-
From: James Bottomley [mailto:james.bottom...@hansenpartnership.com]
Sent: Monday, August 26, 2013 2:11 PM
To: Reddy, Sreekanth
Cc: linux-scsi; Prakash, Sathya; Nandigama, Nagalakshmi
Subject: Re: [PATCH 5/8][SCSI] mpt2sas: Infinite loop can occur if
MPI2_IOCSTATUS_CONFIG_INVALID_PAGE is not returned

On Thu, 2013-07-25 at 07:00 -0700, James Bottomley wrote:
 On Thu, 2013-07-25 at 11:29 +0530, Sreekanth Reddy wrote:
  Infinite loop can occur if IOCStatus is not equal to
  MPI2_IOCSTATUS_CONFIG_INVALID_PAGE value in the while loops in
  functions _scsih_search_responding_sas_devices,
  _scsih_search_responding_raid_devices and
  _scsih_search_responding_expanders
 
  So, Instead of checking for MPI2_IOCSTATUS_CONFIG_INVALID_PAGE
  value, in this patch code is modified to check for IOCStatus not
  equals to MPI2_IOCSTATUS_SUCCESS to break the while loop.
 
  Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
  Cc: sta...@vger.kernel.org

 Patches like this aren't acceptable any more: Greg will find this and
 reject it from Stable.

 If there's a bug in the driver, it needs to be in a separate patch set
 for the fixes branch of SCSI to go upstream now rather than waiting
 for the merge window.  Only patches for the fixes branch can be tagged
 for stable.

Ping on this, please.  What do you want me to do?  I can strip the cc:
stable from the series and send it to the misc branch or you can resubmit as
two series: one for fixes with the stable tags and the rest for misc.

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 0/2] mpt{2,3}sas remove disconnected phys on topology change

2013-08-26 Thread Reddy, Sreekanth
Hi James,

This patch set seem to be fine. Please consider this patch set.

Regards,
Sreekanth

-Original Message-
From: Jan Vesely [mailto:jves...@redhat.com]
Sent: Thursday, August 01, 2013 3:31 PM
To: linux-scsi@vger.kernel.org; linux-ker...@vger.kernel.org
Cc: Jan Vesely; Nandigama, Nagalakshmi; Reddy, Sreekanth; Tomas Henzl
Subject: [PATCH 0/2] mpt{2,3}sas remove disconnected phys on topology
change

From: Jan Vesely jves...@redhat.com

These two patches add phy removal on link loss. This change keeps sysfs up-
to-date with actually connected phys. Without these patches,  disconnected
phys remain listed under their former ports.

tested on both mpt2sas and mpt3sas hw.

CC: Nagalakshmi Nandigama nagalakshmi.nandig...@lsi.com
CC: Sreekanth Reddy sreekanth.re...@lsi.com
CC: Tomas Henzl the...@redhat.com
Signed-off-by: Jan Vesely jves...@redhat.com

Jan Vesely (2):
  mpt2sas: Remove phys on topology change.
  mpt3sas: Remove phys on topology change

 drivers/scsi/mpt2sas/mpt2sas_transport.c |5 -
 drivers/scsi/mpt3sas/mpt3sas_transport.c |5 -
 2 files changed, 8 insertions(+), 2 deletions(-)



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


RE: [PATCH] [SCSI] mpt3sas: Added a driver module parameter max_msix_vectors

2013-08-22 Thread Reddy, Sreekanth
Hi Joe,

Replied inline..

Regards,
Sreekanth

-Original Message-
From: Joe Lawrence [mailto:joe.lawre...@stratus.com]
Sent: Thursday, August 15, 2013 7:23 PM
To: Reddy, Sreekanth
Cc: Tomas Henzl; j...@kernel.org; jbottom...@parallels.com; linux-
s...@vger.kernel.org; Nandigama, Nagalakshmi
Subject: Re: [PATCH] [SCSI] mpt3sas: Added a driver module parameter
max_msix_vectors

Hi Sreekanth,

Will there be a follow up patch to fix the crash scenario?

yes there will be a follow up patch to the issue.  we are already in process of 
implementing a new design with will overcome this issue.

  Is there some error
path in _base_allocate_memory_pools that isn't handled gracefully that
needs to be cleaned up?

The crash happens when the kernel couldn't allocate the DMA'able memory that 
the driver requests for. The amount of memory allocated is directly 
proportional to the HBA queue depth and the no of MSI-X vectors.
Here is call trace

Feb 20 09:13:54 linux kernel: [  136.875370] mpt3sas0: 
iomem(0xdf3f), mapped(0xc900178c), size(65536)
Feb 20 09:13:54 linux kernel: [  136.875374] mpt3sas0: 
ioport(0xdc00), size(256)
Feb 20 09:13:54 linux kernel: [  137.161326] mpt3sas0: sending message unit 
reset !!
Feb 20 09:13:54 linux kernel: [  137.217104] mpt3sas0: message unit reset: 
SUCCESS
Feb 20 09:13:54 linux kernel: [  137.404763] [ cut here 
]
Feb 20 09:13:54 linux kernel: [  137.404779] WARNING: at 
/usr/src/packages/BUILD/kernel-default-2.6.32.12/linux-2.6.32/mm/page_alloc.c:1864
 __alloc_pages_slowpath+0x4c9/0x550()
Feb 20 09:13:54 linux kernel: [  137.404784] Hardware name: PowerEdge T610
Feb 20 09:13:54 linux kernel: [  137.404785] Modules linked in: mpt3sas(N+) 
raid_class scsi_transport_sas ip6t_LOG xt_tcpudp xt_pkttype ipt_LOG xt_limit 
af_packet microcode ip6t_REJECT nf_conntrack_ipv6 ip6table_raw xt_NOTRACK 
ipt_REJECT xt_state iptable_raw iptable_filter ip6table_mangle 
nf_conntrack_netbios_ns nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 ip_tables 
ip6table_filter ip6_tables x_tables ipv6 fuse loop dm_mod rtc_cmos iTCO_wdt 
tpm_tis rtc_core sr_mod tpm iTCO_vendor_support e1000e bnx2 rtc_lib dcdbas(X) 
sg cdrom tpm_bios pcspkr serio_raw power_meter button usbhid hid uhci_hcd 
sd_mod crc_t10dif ehci_hcd usbcore edd ext3 mbcache jbd fan processor 
ide_pci_generic ide_core ata_generic ata_piix libata scsi_mod thermal 
thermal_sys hwmon
Feb 20 09:13:54 linux kernel: [  137.404837] Supported: Yes
Feb 20 09:13:54 linux kernel: [  137.404840] Pid: 5770, comm: insmod Tainted: G 
 NX 2.6.32.12-0.7-default #1
Feb 20 09:13:54 linux kernel: [  137.404843] Call Trace:
Feb 20 09:13:54 linux kernel: [  137.404857]  [810061dc] 
dump_trace+0x6c/0x2d0
Feb 20 09:13:54 linux kernel: [  137.404867]  [81394288] 
dump_stack+0x69/0x71
Feb 20 09:13:54 linux kernel: [  137.404875]  [8104caf4] 
warn_slowpath_common+0x74/0xd0
Feb 20 09:13:54 linux kernel: [  137.404881]  [810bab59] 
__alloc_pages_slowpath+0x4c9/0x550
Feb 20 09:13:54 linux kernel: [  137.404887]  [810bad1a] 
__alloc_pages_nodemask+0x13a/0x140
Feb 20 09:13:54 linux kernel: [  137.404893]  [81008686] 
dma_generic_alloc_coherent+0xa6/0x160
Feb 20 09:13:54 linux kernel: [  137.404900]  [81024358] 
x86_swiotlb_alloc_coherent+0x28/0x80
Feb 20 09:13:54 linux kernel: [  137.404908]  [810e2428] 
pool_alloc_page+0xb8/0x190
Feb 20 09:13:54 linux kernel: [  137.404913]  [810e2565] 
dma_pool_alloc+0x65/0x160
Feb 20 09:13:54 linux kernel: [  137.404927]  [a037ca4b] 
mpt3sas_base_attach+0xb0b/0x16b0 [mpt3sas]
Feb 20 09:13:54 linux kernel: [  137.404951]  [a038317e] 
_scsih_probe+0x3be/0x700 [mpt3sas]
Feb 20 09:13:54 linux kernel: [  137.404966]  [811f92d2] 
local_pci_probe+0x12/0x20
Feb 20 09:13:54 linux kernel: [  137.404972]  [811f9580] 
__pci_device_probe+0xe0/0xf0
Feb 20 09:13:54 linux kernel: [  137.404977]  [811fa493] 
pci_device_probe+0x33/0x60
Feb 20 09:13:54 linux kernel: [  137.404983]  [812948f7] 
really_probe+0x77/0x230
Feb 20 09:13:54 linux kernel: [  137.404988]  [81294b1a] 
driver_probe_device+0x6a/0xc0
Feb 20 09:13:54 linux kernel: [  137.404993]  [81294c03] 
__driver_attach+0x93/0xa0
Feb 20 09:13:54 linux kernel: [  137.404997]  [81293f78] 
bus_for_each_dev+0x58/0x80
Feb 20 09:13:54 linux kernel: [  137.405002]  [81293765] 
bus_add_driver+0x155/0x2b0
Feb 20 09:13:54 linux kernel: [  137.405007]  [81294f19] 
driver_register+0x79/0x170
Feb 20 09:13:54 linux kernel: [  137.405012]  [811fa728] 
__pci_register_driver+0x58/0xe0
Feb 20 09:13:54 linux kernel: [  137.405023]  [a0304184] 
_scsih_init+0x184/0x1b9 [mpt3sas]
Feb 20 09:13:54 linux kernel: [  137.405037]  [810001e5] 
do_one_initcall+0x35/0x190
Feb 20 09:13:54 linux kernel: [  137.405045]  [8107cfd4] 
sys_init_module+0xe4/0x270
Feb 20 09:13:54 linux

RE: [PATCH v3 0/2] mpt2sas/mpt3sas resource cleanup fixes

2013-08-14 Thread Reddy, Sreekanth
Hi James,

This patch set seem to be fine. Please consider these patches.

Regards,
Sreekanth.

-Original Message-
From: Joe Lawrence [mailto:joe.lawre...@stratus.com]
Sent: Friday, August 09, 2013 2:16 AM
To: linux-scsi@vger.kernel.org
Cc: Reddy, Sreekanth; Joe Lawrence
Subject: [PATCH v3 0/2] mpt2sas/mpt3sas resource cleanup fixes

Hi Sreekanth,

Here are the patches that address your offlist feedback and testing of earlier
patchset versions.

I tested with as many early exits as I could think of inside of
mpt2sas_base_map_resources to verify, so I believe all error paths should be
safe and message-log-friendly.

Regards,

Joe

---

Changes from v2 (offlist):
  - Clear ioc-bars if pci_enable_device_mem fails.
  - pci_release_selected_regions verifies non-zero bar pointer, so as
long as it's cleared when not actually enabled, we don't need to
check it first.

Changes from v1:
  - Verify that the PCI device is enabled before disabling it.
  - Verify that the PCI BARs have been enabled before releasing them.

Joe Lawrence (2):
  mpt2sas: fix cleanup on controller resource mapping failure
  mpt3sas: fix cleanup on controller resource mapping failure

 drivers/scsi/mpt2sas/mpt2sas_base.c  | 27 +--
drivers/scsi/mpt2sas/mpt2sas_scsih.c |  1 +
drivers/scsi/mpt3sas/mpt3sas_base.c  | 27 +--
drivers/scsi/mpt3sas/mpt3sas_scsih.c |  1 +
 4 files changed, 36 insertions(+), 20 deletions(-)

--
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] [SCSI] mpt3sas: Added a driver module parameter max_msix_vectors

2013-08-14 Thread Reddy, Sreekanth
Hi Tomas,

The crash happens when the kernel couldn't allocate the DMA'able memory that 
the driver requests for Reply Descriptor post queue. The amount of memory 
allocated is directly proportional to the HBA queue depth and the number of 
MSI-X vectors. 

The indirect fix for this issue is to add a module parameter max_msix_vectors 
to the driver. Using this module parameter the max number of MSI-X vectors 
could be set. The amount of memory that is allocated could be decreased by 
reducing the number of MSI-X vectors. Therefore if a crash is seen on a system 
due to the memory allocation failure, then max_queue_depth and the 
max_msix_vectors could be set to a lower value during driver load time so that 
the memory requested by the driver is less and thereby preventing the kernel 
crash.

So, lower  the value of this variable 'max_msix_vectors' only if  kernel 
couldn't allocate the DMA'able memory that the driver requests for and crash is 
observed.

Regards,
Sreekanth

-Original Message-
From: Tomas Henzl [mailto:the...@redhat.com]
Sent: Wednesday, August 14, 2013 8:48 PM
To: Reddy, Sreekanth
Cc: j...@kernel.org; jbottom...@parallels.com; linux-scsi@vger.kernel.org;
Nandigama, Nagalakshmi
Subject: Re: [PATCH] [SCSI] mpt3sas: Added a driver module parameter
max_msix_vectors

On 08/14/2013 02:53 PM, Sreekanth Reddy wrote:
 Added a driver module parameter max_msix_vectors. Using this module
 parameter the maximum number of MSI-X vectors could be set.

 The number of MSI-X vectors used would be the minimum of MSI-X vectors
 supported by the HBA, the number of CPU cores and the value set to
max_msix_vectors module parameter.

 The default value of this module parameter is set to 8. The default
 value of this parameter is set to 8 inorder to reduce the amount of memory
required for Reply Descriptor Post queue.
 This is because with the higher MSI-X vectors, some times kernel is
 not able to allocate the requested amount of memory and crash is
 observed. To overcome this problem, the default value is set to 8.

Hi Sreekanth,
I don't know exactly which allocation fails, but wouldn't be for the user 
better
to just try to allocate and only when it fails lower the msi-x vectors count?
Tomas


 Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
 ---

 diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c
 b/drivers/scsi/mpt3sas/mpt3sas_base.c
 index a32d63b..d40ba0b 100644
 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c
 +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
 @@ -82,6 +82,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 max_msix_vectors = 8;
 +module_param(max_msix_vectors, int, 0);
 +MODULE_PARM_DESC(max_msix_vectors,
 + max msix vectors - (default=8));

  static int mpt3sas_fwfault_debug;
  MODULE_PARM_DESC(mpt3sas_fwfault_debug,
 @@ -1723,6 +1727,16 @@ _base_enable_msix(struct MPT3SAS_ADAPTER
*ioc)
  ioc-reply_queue_count = min_t(int, ioc-cpu_count,
  ioc-msix_vector_count);

 +printk(MPT3SAS_FMT MSI-X vectors supported: %d, no of cores
 +  : %d, max_msix_vectors: %d\n, ioc-name, ioc-
msix_vector_count,
 +  ioc-cpu_count, max_msix_vectors);
 +
 +if (max_msix_vectors  0) {
 +ioc-reply_queue_count = min_t(int, max_msix_vectors,
 +ioc-reply_queue_count);
 +ioc-msix_vector_count = ioc-reply_queue_count;
 +}
 +
  entries = kcalloc(ioc-reply_queue_count, sizeof(struct msix_entry),
  GFP_KERNEL);
  if (!entries) {

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



--
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: mpt2sas,mpt3sas watchdog device removal

2013-07-17 Thread Reddy, Sreekanth
Hi Joe,

-Original Message-
From: Joe Lawrence [mailto:joe.lawre...@stratus.com]
Sent: Tuesday, July 16, 2013 8:52 PM
To: James Bottomley
Cc: Reddy, Sreekanth; linux-scsi@vger.kernel.org
Subject: Re: mpt2sas,mpt3sas watchdog device removal

On Tue, 16 Jul 2013 16:03:38 +0400
James Bottomley james.bottom...@hansenpartnership.com wrote:

 On Tue, 2013-07-16 at 17:30 +0530, Reddy, Sreekanth wrote:
  James,
 
  This patch seem to be fine. Please consider this patch.

 Where's the new version?  The one that has all of this fixed:

  Off list, Sreekanth from LSI tested and noticed a few issues with
  this
  patch:
 
   - mpt2sas_base_stop_watchdog is called twice: The call from
 mpt2sas_base_detach is safe, but now unnecessary (as a call was
 added earlier up in the PCI driver callbacks to ensure that the
 watchdog was out of the way.) This second invocation can be
  removed.
 
   - If the watchdog detects a bad IOC, the watchdog remains running:
 The watchdog workqueue isn't cleaned up until
 mpt2sas_base_stop_watchdog is called, so in the case that the
 watchdog removes the device from SCSI topo, the workqueue will
 remain unused until PCI .remove/.shutdown cleans it up. Perhaps a
 single watchdog that iterates over all adapters would be simpler?
 
  Finally, if SCSI topo detachment is all that is interesting here,
  would it make more sense to move the watchdog into the MPT scsi
  code?  I haven't looked at the code yet, but this might make an MPT
  fusion patch easier (due to dependencies between its scsi and
  base modules).

This patch fizzled out in May as other work took priority.  If LSI is still
interested in these changes, I can dust off my notes and test/rebase for the
3.11 series.
 

It would be grate help if you post the updated patch which will accommodate the 
fixes for above comments.   
 

A few of the issues quoted above are easily fixed, however I remember
having an outstanding question of how to best clean up the driver's per device
watchdog workqueue:

The way the MPT drivers are working right now is that the watchdog
workqueue function _base_fault_reset_work() initiates a PCI device removal
via kthread.  The PCI callback kthread context then tears down the device and
cancel/flush/destroys the watchdog workqueue.

This patch eliminated the kthread and its call into PCI API, simply detaching
from the SCSI midlayer.  In my opinion, the kthread complicated device
removal and introduced potential races if the watchdog tried removing the
device at the same time an ordinary device removal request occurred.

At the time, the best solution I had was to leave the unused workqueue
around until its PCI device was removed.

Regards,

-- Joe

Regards,
Sreekanth

--
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: mpt2sas,mpt3sas watchdog device removal

2013-07-16 Thread Reddy, Sreekanth
James,

This patch seem to be fine. Please consider this patch.

Regards,
Sreekanth.

-Original Message-
From: Joe Lawrence [mailto:joe.lawre...@stratus.com]
Sent: Wednesday, May 15, 2013 11:00 PM
To: linux-scsi@vger.kernel.org
Cc: James E.J. Bottomley; Reddy, Sreekanth; Desai, Kashyap; Nandigama, 
Nagalakshmi; Bjorn Helgaas
Subject: Re: mpt2sas,mpt3sas watchdog device removal

From 84ac7a35ebd61e84d4254eae78bb967de17254c2 Mon Sep 17 00:00:00 2001
From: Joe Lawrence joe.lawre...@stratus.com
Date: Wed, 15 May 2013 12:52:31 -0400
Subject: [PATCH] mpt2sas,mpt3sas: make watchdog instantiated device removal  
safe

Calling pci_stop_and_remove_bus_device from a SCSI LLD may introduce device 
removal races with PCI callback functions.

Simplify the mpt2sas watchdog mechanism by separating PCI device removal from 
SCSI midlayer detachment. When the watchdog wishes to remove a SCSI device from 
the topology, detach from the SCSI midlayer, leaving the PCI device alone. 
Adjust various pci_driver callbacks to account for a potentially SCSI detached 
PCI device.

Signed-off-by: Joe Lawrence joe.lawre...@stratus.com
---
 drivers/scsi/mpt2sas/mpt2sas_base.c  | 43 +---  
drivers/scsi/mpt2sas/mpt2sas_base.h  |  2 +  
drivers/scsi/mpt2sas/mpt2sas_scsih.c | 97 +---
 drivers/scsi/mpt3sas/mpt3sas_base.c  | 43 +---  
drivers/scsi/mpt3sas/mpt3sas_base.h  |  2 +  
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 65 +++-
 6 files changed, 105 insertions(+), 147 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c 
b/drivers/scsi/mpt2sas/mpt2sas_base.c
index bcb23d2..cc1bf28 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -57,7 +57,6 @@
 #include linux/sort.h
 #include linux/io.h
 #include linux/time.h
-#include linux/kthread.h
 #include linux/aer.h

 #include mpt2sas_base.h
@@ -115,29 +114,6 @@ module_param_call(mpt2sas_fwfault_debug, 
_scsih_set_fwfault_debug,
 param_get_int, mpt2sas_fwfault_debug, 0644);

 /**
- *  mpt2sas_remove_dead_ioc_func - kthread context to remove dead ioc
- * @arg: input argument, used to derive ioc
- *
- * Return 0 if controller is removed from pci subsystem.
- * Return -1 for other case.
- */
-static int mpt2sas_remove_dead_ioc_func(void *arg) -{
-   struct MPT2SAS_ADAPTER *ioc = (struct MPT2SAS_ADAPTER *)arg;
-   struct pci_dev *pdev;
-
-   if ((ioc == NULL))
-   return -1;
-
-   pdev = ioc-pdev;
-   if ((pdev == NULL))
-   return -1;
-   pci_stop_and_remove_bus_device(pdev);
-   return 0;
-}
-
-
-/**
  * _base_fault_reset_work - workq handling ioc fault conditions
  * @work: input argument, used to derive ioc
  * Context: sleep.
@@ -152,7 +128,6 @@ _base_fault_reset_work(struct work_struct *work)
unsigned longflags;
u32 doorbell;
int rc;
-   struct task_struct *p;

spin_lock_irqsave(ioc-ioc_reset_in_progress_lock, flags);
if (ioc-shost_recovery || ioc-pci_error_recovery) @@ -186,23 +161,7 
@@ _base_fault_reset_work(struct work_struct *work)
 * command back from HW.
 */
ioc-schedule_dead_ioc_flush_running_cmds(ioc);
-   /*
-* Set remove_host flag early since kernel thread will
-* take some time to execute.
-*/
-   ioc-remove_host = 1;
-   /*Remove the Dead Host */
-   p = kthread_run(mpt2sas_remove_dead_ioc_func, ioc,
-   mpt2sas_dead_ioc_%d, ioc-id);
-   if (IS_ERR(p)) {
-   printk(MPT2SAS_ERR_FMT
-   %s: Running mpt2sas_dead_ioc thread failed \n,
-   ioc-name, __func__);
-   } else {
-   printk(MPT2SAS_ERR_FMT
-   %s: Running mpt2sas_dead_ioc thread success \n,
-   ioc-name, __func__);
-   }
+   mpt2sas_scsih_detach(ioc);

return; /* don't rearm timer */
}
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h 
b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 4caaac1..94d0e98 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -817,6 +817,7 @@ struct MPT2SAS_ADAPTER {
u8  broadcast_aen_busy;
u16 broadcast_aen_pending;
u8  shost_recovery;
+   u8  shost_attached;

struct mutexreset_in_progress_mutex;
spinlock_t  ioc_reset_in_progress_lock;
@@ -1078,6 +1079,7 @@ struct _sas_device 
*mpt2sas_scsih_sas_device_find_by_sas_address(
 void mpt2sas_port_enable_complete(struct MPT2SAS_ADAPTER *ioc);

 void mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase);
+void mpt2sas_scsih_detach(struct MPT2SAS_ADAPTER

Re: [RESEND][PATCH 2/8][SCSI] mpt2sas : Fix for issue Missing delay not getting set during system bootup

2013-02-26 Thread Reddy, Sreekanth
 From: James Bottomley [mailto:james.bottom...@hansenpartnership.com]
 Sent: Sunday, February 24, 2013 2:26 PM
 To: Reddy, Sreekanth
 Cc: Nandigama, Nagalakshmi; linux-scsi@vger.kernel.org; Prakash, Sathya;
 sta...@vger.kernel.org
 Subject: Re: [RESEND][PATCH 2/8][SCSI] mpt2sas : Fix for issue Missing delay
 not getting set during system bootup
 
 On Sat, 2013-02-02 at 00:54 +0530, Sreekanth Reddy wrote:
  Missing delay is not getting set properly. The reason is it is not defined 
  in
 the same file from where it is being invoked.
 
  The fix is to move the missing delay module parameter from
 mpt2sas_base.c to mpt2sas_scsh.c.
 
  Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
  Cc: sta...@vger.kernel.org
  ---
 
  diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c
  b/drivers/scsi/mpt2sas/mpt2sas_base.c
  index 0bb2b30..ce89b14 100644
  --- a/drivers/scsi/mpt2sas/mpt2sas_base.c
  +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
  @@ -80,10 +80,6 @@ static int msix_disable = -1;
  module_param(msix_disable, int, 0);  MODULE_PARM_DESC(msix_disable,
 
  disable msix routed interrupts (default=0));
 
  -static int missing_delay[2] = {-1, -1};
  -module_param_array(missing_delay, int, NULL, 0);
  -MODULE_PARM_DESC(missing_delay,  device missing delay , io missing
  delay);
  -
   static int mpt2sas_fwfault_debug;
   MODULE_PARM_DESC(mpt2sas_fwfault_debug,  enable detection of
 firmware fault 
  and halt firmware - (default=0));
  @@ -2183,7 +2179,7 @@ _base_display_ioc_capabilities(struct
  MPT2SAS_ADAPTER *ioc)  }
 
   /**
  - * _base_update_missing_delay - change the missing delay timers
  + * mpt2sas_base_update_missing_delay - change the missing delay
  + timers
* @ioc: per adapter object
* @device_missing_delay: amount of time till device is reported missing
* @io_missing_delay: interval IO is returned when there is a missing
  device @@ -2194,8 +2190,8 @@ _base_display_ioc_capabilities(struct
 MPT2SAS_ADAPTER *ioc)
* delay, as well as the io missing delay. This should be called at driver
* load time.
*/
  -static void
  -_base_update_missing_delay(struct MPT2SAS_ADAPTER *ioc,
  +void
  +mpt2sas_base_update_missing_delay(struct MPT2SAS_ADAPTER *ioc,
  u16 device_missing_delay, u8 io_missing_delay)  {
  u16 dmd, dmd_new, dmd_orignal;
  @@ -4391,10 +4387,6 @@ mpt2sas_base_attach(struct
 MPT2SAS_ADAPTER *ioc)
  if (r)
  goto out_free_resources;
 
  -   if (missing_delay[0] != -1  missing_delay[1] != -1)
  -   _base_update_missing_delay(ioc, missing_delay[0],
  -   missing_delay[1]);
  -
  return 0;
 
out_free_resources:
  diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h
  b/drivers/scsi/mpt2sas/mpt2sas_base.h
  index b46024c..ee7a030 100644
  --- a/drivers/scsi/mpt2sas/mpt2sas_base.h
  +++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
  @@ -1054,6 +1054,9 @@ void mpt2sas_base_validate_event_type(struct
  MPT2SAS_ADAPTER *ioc, u32 *event_ty
 
   void mpt2sas_halt_firmware(struct MPT2SAS_ADAPTER *ioc);
 
  +void mpt2sas_base_update_missing_delay(struct MPT2SAS_ADAPTER
 *ioc,
  +   u16 device_missing_delay, u8 io_missing_delay);
  +
   int mpt2sas_port_enable(struct MPT2SAS_ADAPTER *ioc);
 
   /* scsih shared API */
  diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
  b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
  index af4e6c4..ab89b2d 100644
  --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
  +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
  @@ -101,6 +101,10 @@ static ushort max_sectors = 0x;
  module_param(max_sectors, ushort, 0);
 MODULE_PARM_DESC(max_sectors,
  max sectors, range 64 to 32767  default=32767);
 
  +static int missing_delay[2] = {-1, -1};
  +module_param_array(missing_delay, int, NULL, 0);
  +MODULE_PARM_DESC(missing_delay,  device missing delay , io missing
  +delay);
  +
   /* scsi-mid layer global parmeter is max_report_luns, which is 511 */
  #define MPT2SAS_MAX_LUN (16895)  static int max_lun =
 MPT2SAS_MAX_LUN;
  @@ -7303,7 +7307,9 @@ _firmware_event_work(struct work_struct
 *work)
  case MPT2SAS_PORT_ENABLE_COMPLETE:
  ioc-start_scan = 0;
 
  -
  +   if (missing_delay[0] != -1  missing_delay[1] != -1)
  +   mpt2sas_base_update_missing_delay(ioc,
 missing_delay[0],
  +   missing_delay[1]);
 
 This patch is rejecting here.  It looks to be because a previous patch of 
 yours:
 
 commit b4730fb6e54a634a145c9c71c5cf856f00beb5cd
 Author: Sreekanth Reddy sreekanth.re...@lsi.com
 Date:   Tue Dec 18 14:45:30 2012 +0100
 
 [SCSI] mpt2sas: fix for driver fails EEH, recovery from injected pci bus 
 error
 
 Added
 
 @@ -4386,6 +4402,7 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER
 *ioc)
 if (missing_delay[0] != -1  missing_delay[1] != -1)
 _base_update_missing_delay(ioc, missing_delay[0],
 missing_delay[1]);
 +   ioc-non_operational_loop = 0;
 
 return 0;
 
 I'm stopping here because correct resolution doesn't

[PATCH][SCSI] mpt2sas: fix for unused variable 'event_data' warning

2013-02-26 Thread Reddy, Sreekanth
If CONFIG_SCSI_MPT2SAS_LOGGING is undefined, then these warnings are emitted

drivers/scsi/mpt2sas/mpt2sas_scsih.c: In function 
'_scsih_sas_broadcast_primitive_event'
drivers/scsi/mpt2sas/mpt2sas_scsih.c:5810:40: warning: unused variable 
'event_data'

Use pr_info() function instead of dewtprintk().

Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
---

diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c 
b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index c6bdc92..197ccad 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -5815,9 +5815,10 @@ _scsih_sas_broadcast_primitive_event(struct 
MPT2SAS_ADAPTER *ioc,
u8 task_abort_retries;
 
mutex_lock(ioc-tm_cmds.mutex);
-   dewtprintk(ioc, printk(MPT2SAS_INFO_FMT %s: enter: phy number(%d), 
-   width(%d)\n, ioc-name, __func__, event_data-PhyNum,
-event_data-PortWidth));
+   pr_info(MPT2SAS_FMT
+   %s: enter: phy number(%d), width(%d)\n,
+   ioc-name, __func__, event_data-PhyNum,
+   event_data-PortWidth);
 
_scsih_block_io_all_device(ioc);
 
--
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 linux/linux-next] mpt2sas: _scsih_sas_broadcast_primitive_event: Quiet unused variable warning

2013-02-26 Thread Reddy, Sreekanth
Hi Tim,

Today I have sent the below titled patch to upstream which fix the Unused 
variable 'event_data' warning.
 The Patch title is 
[PATCH][SCSI] mpt2sas: fix for unused variable 'event_data' warning

This patch will help you in fixing the Unused variable 'event_data' warning.

Thanks,
Sreekanth

 -Original Message-
 From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi-
 ow...@vger.kernel.org] On Behalf Of Tim Gardner
 Sent: Thursday, February 21, 2013 12:18 AM
 To: linux-ker...@vger.kernel.org
 Cc: Tim Gardner; Nandigama, Nagalakshmi; Reddy, Sreekanth; Support;
 James E.J. Bottomley; DL-MPT Fusion Linux; linux-scsi@vger.kernel.org
 Subject: [PATCH linux/linux-next] mpt2sas:
 _scsih_sas_broadcast_primitive_event: Quiet unused variable warning
 
 If CONFIG_SCSI_MPT2SAS_LOGGING is undefined, then these warnings are
 emitted:
 
 drivers/scsi/mpt2sas/mpt2sas_scsih.c: In function
 '_scsih_sas_broadcast_primitive_event':
 drivers/scsi/mpt2sas/mpt2sas_scsih.c:5810:40: warning: unused variable
 'event_data' [-Wunused-variable]
 
 Add __maybe_unused to the definition of event_data.
 
 Cc: Nagalakshmi Nandigama nagalakshmi.nandig...@lsi.com
 Cc: Sreekanth Reddy sreekanth.re...@lsi.com
 Cc: supp...@lsi.com
 Cc: James E.J. Bottomley jbottom...@parallels.com
 Cc: dl-mptfusionli...@lsi.com
 Cc: linux-scsi@vger.kernel.org
 Signed-off-by: Tim Gardner tim.gard...@canonical.com
 ---
  drivers/scsi/mpt2sas/mpt2sas_scsih.c |3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
 b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
 index c6bdc92..416f907 100644
 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
 +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
 @@ -5807,7 +5807,8 @@ _scsih_sas_broadcast_primitive_event(struct
 MPT2SAS_ADAPTER *ioc,
   u32 termination_count;
   u32 query_count;
   Mpi2SCSITaskManagementReply_t *mpi_reply;
 - Mpi2EventDataSasBroadcastPrimitive_t *event_data = fw_event-
 event_data;
 + Mpi2EventDataSasBroadcastPrimitive_t *event_data
 __maybe_unused =
 + fw_event-event_data;
   u16 ioc_status;
   unsigned long flags;
   int r;
 --
 1.7.9.5
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-scsi in the
 body of a message to majord...@vger.kernel.org More majordomo info at
 http://vger.kernel.org/majordomo-info.html
--
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: mpt2sas: device_blocked question

2013-01-29 Thread Reddy, Sreekanth
Hi Spren,

Reason code MPI2_EVENT_SAS_TOPO_RC_DELAY_NOT_RESPONDING mean that A target 
device has stopped responding or is missing but the ReportDeviceMissingDelay 
timer has not expired for this device.

Can you please send me the some more information i.e.

 1. For which operation/TestCase this issue has occurred?
 2. Which Driver  Firmware version you are using?
 3. Can you also please send me the complete log.

Thanks,
Sreekanth.

-Original Message-
From: spren...@gmail.com [mailto:spren...@gmail.com] 
Sent: Saturday, January 26, 2013 9:22 AM
To: JörnEngel; BjørnMork; Nandigama, Nagalakshmi; Reddy, Sreekanth; Support; 
James E.J. Bottomley; DL-MPT Fusion Linux
Cc: linux-scsi@vger.kernel.org
Subject: mpt2sas: device_blocked question

Hi,
  we encounter a problem that a disk is blocked forever, the key log is:

mpt2sas0: TEST_UNIT_READY: handle(0x000a), lun(0)
mpt2sas0: TEST_UNIT_READY: handle(0x000a), lun(0)
mpt2sas0: Spinning up disk handle(0x000a), lun(0)
mpt2sas0: TEST_UNIT_READY: handle(0x000a), lun(0)
mpt2sas0: Spinning up disk handle(0x000a), lun(0)
mpt2sas0: TEST_UNIT_READY: handle(0x000a), lun(0)
mpt2sas0: Spinning up disk handle(0x000a), lun(0) sd 2:0:1:0: 
device_blocked, handle(0x000a)

  looking into the driver code, it seems that the device is blocked by function
_scsih_block_io_to_children_attached_directly() in mpt2sas/mpt2sas_scsih.c with 
reason_code == MPI2_EVENT_SAS_TOPO_RC_DELAY_NOT_RESPONDING,
  what does this reason_code mean please? when should it be returned? and any 
way to handle it?

Best Regards,
spren
2013-01-26

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


RE: [PATCH] [SCSI] mpt2sas: fix for driver fails EEH recovery from injected pci bus error

2012-12-17 Thread Reddy, Sreekanth
Yes Thomas, we need to reset the non_operational_loop to zero after the 
transient event.

Thanks,
Sreekanth.

-Original Message-
From: Tomas Henzl [mailto:the...@redhat.com] 
Sent: Monday, December 17, 2012 6:43 PM
To: Reddy, Sreekanth
Cc: j...@kernel.org; Nandigama, Nagalakshmi; jbottom...@parallels.com; 
linux-scsi@vger.kernel.org; Prakash, Sathya
Subject: Re: [PATCH] [SCSI] mpt2sas: fix for driver fails EEH recovery from 
injected pci bus error

On 12/17/2012 10:58 PM, Sreekanth Reddy wrote:
 This patch stops the driver to invoke kthread (which remove the dead 
 ioc) for some time while EEH recovery has started.

Thank you for posting this, the issue we have seen is resolved now.
Shouldn't be an additional initialization added?
So after a transient event the non_operational_loop is reset again?

Tomas
 
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c 
b/drivers/scsi/mpt2sas/mpt2sas_base.c
index fd3b3d7..480111c 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -208,6 +208,8 @@ _base_fault_reset_work(struct work_struct *work)
return; /* don't rearm timer */
}
 
+   ioc-non_operational_loop = 0;
+
if ((doorbell  MPI2_IOC_STATE_MASK) == MPI2_IOC_STATE_FAULT) {
rc = mpt2sas_base_hard_reset_handler(ioc, CAN_SLEEP,
FORCE_BIG_HAMMER);




 Signed-off-by: Sreekanth Reddy sreekanth.re...@lsi.com
 ---

 diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c 
 b/drivers/scsi/mpt2sas/mpt2sas_base.c
 index ffd85c5..2349531 100755
 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c
 +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
 @@ -155,7 +155,7 @@ _base_fault_reset_work(struct work_struct *work)
   struct task_struct *p;
  
   spin_lock_irqsave(ioc-ioc_reset_in_progress_lock, flags);
 - if (ioc-shost_recovery)
 + if (ioc-shost_recovery || ioc-pci_error_recovery)
   goto rearm_timer;
   spin_unlock_irqrestore(ioc-ioc_reset_in_progress_lock, flags);
  
 @@ -164,6 +164,20 @@ _base_fault_reset_work(struct work_struct *work)
   printk(MPT2SAS_INFO_FMT %s : SAS host is non-operational 
 \n,
   ioc-name, __func__);
  
 + /* It may be possible that EEH recovery can resolve some of
 +  * pci bus failure issues rather removing the dead ioc function
 +  * by considering controller is in a non-operational state. So
 +  * here priority is given to the EEH recovery. If it doesn't
 +  * not resolve this issue, mpt2sas driver will consider this
 +  * controller to non-operational state and remove the dead ioc
 +  * function.
 +  */
 + if (ioc-non_operational_loop++  5) {
 + spin_lock_irqsave(ioc-ioc_reset_in_progress_lock,
 +  flags);
 + goto rearm_timer;
 + }
 +
   /*
* Call _scsih_flush_pending_cmds callback so that we flush all
* pending commands back to OS. This call is required to aovid 
 @@ 
 -4386,6 +4400,7 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc)
   if (missing_delay[0] != -1  missing_delay[1] != -1)
   _base_update_missing_delay(ioc, missing_delay[0],
   missing_delay[1]);
 + ioc-non_operational_loop = 0;
  
   return 0;
  
 diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h 
 b/drivers/scsi/mpt2sas/mpt2sas_base.h
 index 543d8d6..c6ee7aa 100755
 --- a/drivers/scsi/mpt2sas/mpt2sas_base.h
 +++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
 @@ -835,6 +835,7 @@ struct MPT2SAS_ADAPTER {
   u16 cpu_msix_table_sz;
   u32 ioc_reset_count;
   MPT2SAS_FLUSH_RUNNING_CMDS schedule_dead_ioc_flush_running_cmds;
 + u32 non_operational_loop;
  
   /* internal commands, callback index */
   u8  scsi_io_cb_idx;
 --
 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

--
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] mpt3sas: Remove unneeded version.h header inclusion

2012-12-11 Thread Reddy, Sreekanth
James,

This patch seem to be fine. Please consider this patch as Acked-by: Sreekanth 
Reddy sreekanth.re...@lsi.com

Regards,
Sreekanth.

-Original Message-
From: Sachin Kamat [mailto:sachin.ka...@linaro.org] 
Sent: Monday, December 03, 2012 3:30 PM
To: linux-scsi@vger.kernel.org
Cc: DL-MPT Fusion Linux; jbottom...@parallels.com; Support; Reddy, Sreekanth; 
Nandigama, Nagalakshmi; sachin.ka...@linaro.org; patc...@linaro.org
Subject: [PATCH 1/1] [SCSI] mpt3sas: Remove unneeded version.h header inclusion

linux/version.h is not necessary as detected by checkversion.pl script.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/scsi/mpt3sas/mpt3sas_base.c |1 -
 drivers/scsi/mpt3sas/mpt3sas_config.c   |1 -
 drivers/scsi/mpt3sas/mpt3sas_ctl.c  |1 -
 drivers/scsi/mpt3sas/mpt3sas_scsih.c|1 -
 drivers/scsi/mpt3sas/mpt3sas_trigger_diag.c |1 -
 5 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 04f8010..d5e8463 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -42,7 +42,6 @@
  * USA.
  */
 
-#include linux/version.h
 #include linux/kernel.h
 #include linux/module.h
 #include linux/errno.h
diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c 
b/drivers/scsi/mpt3sas/mpt3sas_config.c
index ce7e59b..1df9ed4 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
@@ -41,7 +41,6 @@
  * USA.
  */
 
-#include linux/version.h
 #include linux/module.h
 #include linux/kernel.h
 #include linux/init.h
diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c 
b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
index 8af944d..5b0d4f8 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
@@ -42,7 +42,6 @@
  * USA.
  */
 
-#include linux/version.h
 #include linux/kernel.h
 #include linux/module.h
 #include linux/errno.h
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 05f8045..ac9dbc2 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -41,7 +41,6 @@
  * USA.
  */
 
-#include linux/version.h
 #include linux/module.h
 #include linux/kernel.h
 #include linux/init.h
diff --git a/drivers/scsi/mpt3sas/mpt3sas_trigger_diag.c 
b/drivers/scsi/mpt3sas/mpt3sas_trigger_diag.c
index da6c5f2..6f8d621 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_trigger_diag.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_trigger_diag.c
@@ -42,7 +42,6 @@
  * USA.
  */
 
-#include linux/version.h
 #include linux/kernel.h
 #include linux/module.h
 #include linux/errno.h
-- 
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: [patch] [SCSI] mpt3sas: cut and paste bug storing trigger mpi

2012-12-11 Thread Reddy, Sreekanth
James,

This patch seem to be fine. Please consider this patch as Acked-by: Sreekanth 
Reddy sreekanth.re...@lsi.com

Regards,
Sreekanth.

-Original Message-
From: Dan Carpenter [mailto:dan.carpen...@oracle.com] 
Sent: Friday, December 07, 2012 11:58 AM
To: Nandigama, Nagalakshmi
Cc: Reddy, Sreekanth; Support; James E.J. Bottomley; DL-MPT Fusion Linux; 
linux-scsi@vger.kernel.org; linux-ker...@vger.kernel.org; 
kernel-janit...@vger.kernel.org
Subject: [patch] [SCSI] mpt3sas: cut and paste bug storing trigger mpi

ioc-diag_trigger_mpi is an SL_WH_MPI_TRIGGERS_T struct.

There is a cut and paste error here and SL_WH_EVENT_TRIGGERS_T is used instead 
of SL_WH_MPI_TRIGGERS_T.  Since the SL_WH_EVENT_TRIGGERS_T is smaller than 
SL_WH_MPI_TRIGGERS_T, it means we only clear part of the buffer.

Signed-off-by: Dan Carpenter dan.carpen...@oracle.com
---
Only needed in linux-next.

This is a static analysis patch.  Even though I'm pretty sure it's correct, I'm 
not able to test it.

diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c 
b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
index 8af944d..3e35e64 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
@@ -3136,7 +3136,7 @@ _ctl_diag_trigger_mpi_store(struct device *cdev,
spin_lock_irqsave(ioc-diag_trigger_lock, flags);
sz = min(sizeof(struct SL_WH_MPI_TRIGGERS_T), count);
memset(ioc-diag_trigger_mpi, 0,
-   sizeof(struct SL_WH_EVENT_TRIGGERS_T));
+   sizeof(struct SL_WH_MPI_TRIGGERS_T));
memcpy(ioc-diag_trigger_mpi, buf, sz);
if (ioc-diag_trigger_mpi.ValidEntries  NUM_VALID_ENTRIES)
ioc-diag_trigger_mpi.ValidEntries = NUM_VALID_ENTRIES;
--
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 08/24] block: Remove some unnecessary bi_vcnt usage

2012-11-06 Thread Reddy, Sreekanth
Hi,

This patch seem to be fine. Please consider this patch as Acked-by: Sreekanth 
Reddy sreekanth.re...@lsi.com

Regards,
Sreekanth.

-Original Message-
From: linux-scsi-ow...@vger.kernel.org 
[mailto:linux-scsi-ow...@vger.kernel.org] On Behalf Of Kent Overstreet
Sent: Tuesday, October 16, 2012 1:39 AM
To: linux-bca...@vger.kernel.org; linux-ker...@vger.kernel.org; 
dm-de...@redhat.com
Cc: Kent Overstreet; t...@kernel.org; ax...@kernel.dk; ne...@suse.de; 
vgo...@redhat.com; Moore, Eric; James E.J. Bottomley; linux-scsi@vger.kernel.org
Subject: [PATCH v4 08/24] block: Remove some unnecessary bi_vcnt usage

More prep work for immutable bvecs/effecient bio splitting - usage of bi_vcnt 
has to be auditing, so getting rid of all the unnecessary usage makes that 
easier.

Plus, bio_segments() is really what this code wanted, as it respects the 
current value of bi_idx.

Signed-off-by: Kent Overstreet koverstr...@google.com
CC: Jens Axboe ax...@kernel.dk
CC: Eric Moore eric.mo...@lsi.com
CC: James E.J. Bottomley jbottom...@parallels.com
CC: linux-scsi@vger.kernel.org
---
 drivers/message/fusion/mptsas.c  |  6 +++---
 drivers/scsi/libsas/sas_expander.c   |  6 +++---
 drivers/scsi/mpt2sas/mpt2sas_transport.c | 10 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c 
index 551262e..5406a9f 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -2235,10 +2235,10 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, 
struct sas_rphy *rphy,
}
 
/* do we need to support multiple segments? */
-   if (req-bio-bi_vcnt  1 || rsp-bio-bi_vcnt  1) {
+   if (bio_segments(req-bio)  1 || bio_segments(rsp-bio)  1) {
printk(MYIOC_s_ERR_FMT %s: multiple segments req %u %u, rsp %u 
%u\n,
-   ioc-name, __func__, req-bio-bi_vcnt, blk_rq_bytes(req),
-   rsp-bio-bi_vcnt, blk_rq_bytes(rsp));
+   ioc-name, __func__, bio_segments(req-bio), 
blk_rq_bytes(req),
+   bio_segments(rsp-bio), blk_rq_bytes(rsp));
return -EINVAL;
}
 
diff --git a/drivers/scsi/libsas/sas_expander.c 
b/drivers/scsi/libsas/sas_expander.c
index efc6e72..ee331a7 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -2151,10 +2151,10 @@ int sas_smp_handler(struct Scsi_Host *shost, struct 
sas_rphy *rphy,
}
 
/* do we need to support multiple segments? */
-   if (req-bio-bi_vcnt  1 || rsp-bio-bi_vcnt  1) {
+   if (bio_segments(req-bio)  1 || bio_segments(rsp-bio)  1) {
printk(%s: multiple segments req %u %u, rsp %u %u\n,
-  __func__, req-bio-bi_vcnt, blk_rq_bytes(req),
-  rsp-bio-bi_vcnt, blk_rq_bytes(rsp));
+  __func__, bio_segments(req-bio), blk_rq_bytes(req),
+  bio_segments(rsp-bio), blk_rq_bytes(rsp));
return -EINVAL;
}
 
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c 
b/drivers/scsi/mpt2sas/mpt2sas_transport.c
index c6cf20f..403a57b 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_transport.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_transport.c
@@ -1939,7 +1939,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct 
sas_rphy *rphy,
ioc-transport_cmds.status = MPT2_CMD_PENDING;
 
/* Check if the request is split across multiple segments */
-   if (req-bio-bi_vcnt  1) {
+   if (bio_segments(req-bio)  1) {
u32 offset = 0;
 
/* Allocate memory and copy the request */ @@ -1971,7 +1971,7 
@@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
 
/* Check if the response needs to be populated across
 * multiple segments */
-   if (rsp-bio-bi_vcnt  1) {
+   if (bio_segments(rsp-bio)  1) {
pci_addr_in = pci_alloc_consistent(ioc-pdev, blk_rq_bytes(rsp),
pci_dma_in);
if (!pci_addr_in) {
@@ -2038,7 +2038,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct 
sas_rphy *rphy,
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;
-   if (req-bio-bi_vcnt  1) {
+   if (bio_segments(req-bio)  1) {
ioc-base_add_sg_single(psge, sgl_flags |
(blk_rq_bytes(req) - 4), pci_dma_out);
} else {
@@ -2054,7 +2054,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct 
sas_rphy *rphy,
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;
-   if (rsp-bio-bi_vcnt  1) {
+   if (bio_segments(rsp-bio)  1) {
ioc-base_add_sg_single(psge, sgl_flags |
(blk_rq_bytes(rsp) + 

RE: [PATCH 5/5] mpt2sas: Add a module parameter that permits overriding protection capabilities

2012-08-29 Thread Reddy, Sreekanth
James,

This patch seem to be fine. Please consider this patch as Acked-by: Sreekanth 
Reddy sreekanth.re...@lsi.com

Regards,
Sreekanth

 -Original Message-
 From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi-
 ow...@vger.kernel.org] On Behalf Of Martin K. Petersen
 Sent: Wednesday, August 29, 2012 12:00 AM
 To: linux-scsi@vger.kernel.org
 Cc: james.bottom...@hansenpartnership.com; Martin K. Petersen;
 Nandigama, Nagalakshmi; Moore, Eric
 Subject: [PATCH 5/5] mpt2sas: Add a module parameter that permits
 overriding protection capabilities
 
 From: Martin K. Petersen martin.peter...@oracle.com
 
 Add a parameter that allows the host protection capabilities mask to be
 provided at module load time.
 
 Signed-off-by: Martin K. Petersen martin.peter...@oracle.com
 Cc: nagalakshmi.nandig...@lsi.com
 Cc: eric.mo...@lsi.com
 ---
  drivers/scsi/mpt2sas/mpt2sas_scsih.c |   15 +--
  1 files changed, 13 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
 b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
 index bfda0ec..96f4d1f 100644
 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
 +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
 @@ -123,6 +123,11 @@ static int disable_discovery = -1;
  module_param(disable_discovery, int, 0);
  MODULE_PARM_DESC(disable_discovery,  disable discovery );
 
 +/* permit overriding the host protection capabilities mask (EEDP/T10
 PI) */
 +static int prot_mask = 0;
 +module_param(prot_mask, int, 0);
 +MODULE_PARM_DESC(prot_mask,  host protection capabilities mask, def=7
 );
 +
  /**
   * struct sense_info - common structure for obtaining sense keys
   * @skey: sense key
 @@ -8088,8 +8093,14 @@ _scsih_probe(struct pci_dev *pdev, const struct
 pci_device_id *id)
   goto out_add_shost_fail;
   }
 
 - scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION
 - | SHOST_DIF_TYPE2_PROTECTION | SHOST_DIF_TYPE3_PROTECTION);
 + /* register EEDP capabilities with SCSI layer */
 + if (prot_mask)
 + scsi_host_set_prot(shost, prot_mask);
 + else
 + scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION
 +| SHOST_DIF_TYPE2_PROTECTION
 +| SHOST_DIF_TYPE3_PROTECTION);
 +
   scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC);
 
   /* event thread */
 --
 1.7.7.6
 
 --
 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
--
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] [SCSI] mpt2sas: fix double mutex lock in NON_BLOCKING state

2012-08-29 Thread Reddy, Sreekanth
James,

This patch seem to be fine. Please consider this patch as Acked-by: Sreekanth 
Reddy sreekanth.re...@lsi.com

Regards,
Sreekanth.

 -Original Message-
 From: Alexey Khoroshilov [mailto:khoroshi...@ispras.ru]
 Sent: Tuesday, August 28, 2012 8:08 PM
 To: James E.J. Bottomley
 Cc: Alexey Khoroshilov; linux-scsi@vger.kernel.org; Nandigama,
 Nagalakshmi; Reddy, Sreekanth; linux-ker...@vger.kernel.org; ldv-
 proj...@ispras.ru
 Subject: [PATCH v2] [SCSI] mpt2sas: fix double mutex lock in
 NON_BLOCKING state
 
 If state is NON_BLOCKING and mutex_trylock is succeed,
 the control flow goes to mutex_lock_interruptible() that is a deadlock.
 
 The previous version of the patch becomes obsolete after
 code movement in commit 913809f6.
 
 Found by Linux Driver Verification project (linuxtesting.org).
 
 Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru
 ---
  drivers/scsi/mpt2sas/mpt2sas_ctl.c |6 --
  1 file changed, 4 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c
 b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
 index 49bdd2d..d29ea56 100644
 --- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c
 +++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
 @@ -2181,8 +2181,10 @@ _ctl_ioctl_main(struct file *file, unsigned int
 cmd, void __user *arg,
   return -EAGAIN;
 
   state = (file-f_flags  O_NONBLOCK) ? NON_BLOCKING : BLOCKING;
 - if (state == NON_BLOCKING  !mutex_trylock(ioc-
 ctl_cmds.mutex))
 - return -EAGAIN;
 + if (state == NON_BLOCKING) {
 + if (!mutex_trylock(ioc-ctl_cmds.mutex))
 + return -EAGAIN;
 + }
   else if (mutex_lock_interruptible(ioc-ctl_cmds.mutex))
   return -ERESTARTSYS;
 
 --
 1.7.9.5

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


RE: [PATCH 4/5] mpt2sas: Return the correct sense key for DIF errors

2012-08-29 Thread Reddy, Sreekanth
James,

This patch seem to be fine. Please consider this patch as Acked-by: Sreekanth 
Reddy sreekanth.re...@lsi.com

Regards,
Sreekanth.

 -Original Message-
 From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi-
 ow...@vger.kernel.org] On Behalf Of Martin K. Petersen
 Sent: Wednesday, August 29, 2012 12:00 AM
 To: linux-scsi@vger.kernel.org
 Cc: james.bottom...@hansenpartnership.com; Martin K. Petersen;
 Nandigama, Nagalakshmi; Moore, Eric
 Subject: [PATCH 4/5] mpt2sas: Return the correct sense key for DIF
 errors
 
 From: Martin K. Petersen martin.peter...@oracle.com
 
 Only a target device should return ABORTED COMMAND when a PI error is
 discovered. The HBA should always set the sense key to ILLEGAL REQUEST.
 
 Signed-off-by: Martin K. Petersen martin.peter...@oracle.com
 Cc: nagalakshmi.nandig...@lsi.com
 Cc: eric.mo...@lsi.com
 ---
  drivers/scsi/mpt2sas/mpt2sas_scsih.c |   14 ++
  1 files changed, 2 insertions(+), 12 deletions(-)
 
 diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
 b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
 index 7d774c5..bfda0ec 100644
 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
 +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
 @@ -3772,8 +3772,6 @@ static void
  _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
  {
   u8 ascq;
 - u8 sk;
 - u8 host_byte;
 
   switch (ioc_status) {
   case MPI2_IOCSTATUS_EEDP_GUARD_ERROR:
 @@ -3790,16 +3788,8 @@ _scsih_eedp_error_handling(struct scsi_cmnd
 *scmd, u16 ioc_status)
   break;
   }
 
 - if (scmd-sc_data_direction == DMA_TO_DEVICE) {
 - sk = ILLEGAL_REQUEST;
 - host_byte = DID_ABORT;
 - } else {
 - sk = ABORTED_COMMAND;
 - host_byte = DID_OK;
 - }
 -
 - scsi_build_sense_buffer(0, scmd-sense_buffer, sk, 0x10, ascq);
 - scmd-result = DRIVER_SENSE  24 | (host_byte  16) |
 + scsi_build_sense_buffer(0, scmd-sense_buffer, ILLEGAL_REQUEST,
 0x10, ascq);
 + scmd-result = DRIVER_SENSE  24 | (DID_ABORT  16) |
   SAM_STAT_CHECK_CONDITION;
  }
 
 --
 1.7.7.6
 
 --
 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
--
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: 'Device not ready' issue on mpt2sas since 3.1.10

2012-07-25 Thread Reddy, Sreekanth
Hi,

We have done some analysis on this issue. From our analysis we observed that, 
this issue is reproducible on kernel 3.1.10 onwards but in 3.0.36 this issue is 
not reproducible. So, we have taken the mpt2sas code from 3.1.10 kernel and 
compiled and run it on 3.0.36 kernel. Here this issue is not reproducible (i.e. 
it is working fine). 

From 3.0.36 kernel onwards we have not added any patches that will cause this 
issue. So, what I mean to say is this issue is not because of mpt2sas driver.

Regards,
Sreekanth.  

 -Original Message-
 From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi-
 ow...@vger.kernel.org] On Behalf Of Matthias Prager
 Sent: Wednesday, July 25, 2012 3:34 AM
 To: Tejun Heo
 Cc: Robert Trace; linux-scsi@vger.kernel.org; Jens Axboe; Moore, Eric;
 James E.J. Bottomley; Alan; Darrick J. Wong; Matthias Prager
 Subject: Re: 'Device not ready' issue on mpt2sas since 3.1.10
 
 Hello everyone,
 
 I retested with a new firmware (P14 - released today), since it
 contains
 a bunch of sata and SATL fixes (according to the changelog).
 Unfortunately the observed behavior is unchanged (tested on a 3.4.5
 kernel).
 
 Just wanted to let everyone know.
 
 Cheers
 Matthias
 --
 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