|
|
b312fc |
From 081008132942c3c50c43d1fded60080cfa8cda91 Mon Sep 17 00:00:00 2001
|
|
|
b312fc |
From: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
|
|
|
b312fc |
Date: Wed, 26 Oct 2016 13:34:40 +0530
|
|
|
b312fc |
Subject: [PATCH 09/11] scsi: mpt3sas: Use the new MPI 2.6 32-bit Atomic
|
|
|
b312fc |
Request Descriptors for SAS35 devices.
|
|
|
b312fc |
|
|
|
b312fc |
Support Atomic Request Descriptors for Ventura/SAS35 devices.
|
|
|
b312fc |
|
|
|
b312fc |
Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.com>
|
|
|
b312fc |
Signed-off-by: Sathya Prakash <sathya.prakash@broadcom.com>
|
|
|
b312fc |
Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
|
|
|
b312fc |
Reviewed-by: Hannes Reinecke <hare@suse.com>
|
|
|
b312fc |
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
|
|
|
b312fc |
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
|
|
|
b312fc |
---
|
|
|
b312fc |
drivers/scsi/mpt3sas/mpt3sas_base.c | 141 +++++++++++++++++++++++++++----
|
|
|
b312fc |
drivers/scsi/mpt3sas/mpt3sas_base.h | 18 ++--
|
|
|
b312fc |
drivers/scsi/mpt3sas/mpt3sas_config.c | 2 +-
|
|
|
b312fc |
drivers/scsi/mpt3sas/mpt3sas_ctl.c | 22 ++---
|
|
|
b312fc |
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 24 +++---
|
|
|
b312fc |
drivers/scsi/mpt3sas/mpt3sas_transport.c | 8 +-
|
|
|
b312fc |
6 files changed, 161 insertions(+), 54 deletions(-)
|
|
|
b312fc |
|
|
|
b312fc |
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
|
|
|
b312fc |
index b26fa23..9ef253b 100644
|
|
|
b312fc |
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
|
|
|
b312fc |
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
|
|
|
b312fc |
@@ -850,7 +850,7 @@ _base_async_event(struct MPT3SAS_ADAPTER *ioc, u8 msix_index, u32 reply)
|
|
|
b312fc |
ack_request->EventContext = mpi_reply->EventContext;
|
|
|
b312fc |
ack_request->VF_ID = 0; /* TODO */
|
|
|
b312fc |
ack_request->VP_ID = 0;
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
|
|
|
b312fc |
out:
|
|
|
b312fc |
|
|
|
b312fc |
@@ -2454,15 +2454,15 @@ _base_writeq(__u64 b, volatile void __iomem *addr, spinlock_t *writeq_lock)
|
|
|
b312fc |
#endif
|
|
|
b312fc |
|
|
|
b312fc |
/**
|
|
|
b312fc |
- * mpt3sas_base_put_smid_scsi_io - send SCSI_IO request to firmware
|
|
|
b312fc |
+ * _base_put_smid_scsi_io - send SCSI_IO request to firmware
|
|
|
b312fc |
* @ioc: per adapter object
|
|
|
b312fc |
* @smid: system request message index
|
|
|
b312fc |
* @handle: device handle
|
|
|
b312fc |
*
|
|
|
b312fc |
* Return nothing.
|
|
|
b312fc |
*/
|
|
|
b312fc |
-void
|
|
|
b312fc |
-mpt3sas_base_put_smid_scsi_io(struct MPT3SAS_ADAPTER *ioc, u16 smid, u16 handle)
|
|
|
b312fc |
+static void
|
|
|
b312fc |
+_base_put_smid_scsi_io(struct MPT3SAS_ADAPTER *ioc, u16 smid, u16 handle)
|
|
|
b312fc |
{
|
|
|
b312fc |
Mpi2RequestDescriptorUnion_t descriptor;
|
|
|
b312fc |
u64 *request = (u64 *)&descriptor;
|
|
|
b312fc |
@@ -2478,15 +2478,15 @@ mpt3sas_base_put_smid_scsi_io(struct MPT3SAS_ADAPTER *ioc, u16 smid, u16 handle)
|
|
|
b312fc |
}
|
|
|
b312fc |
|
|
|
b312fc |
/**
|
|
|
b312fc |
- * mpt3sas_base_put_smid_fast_path - send fast path request to firmware
|
|
|
b312fc |
+ * _base_put_smid_fast_path - send fast path request to firmware
|
|
|
b312fc |
* @ioc: per adapter object
|
|
|
b312fc |
* @smid: system request message index
|
|
|
b312fc |
* @handle: device handle
|
|
|
b312fc |
*
|
|
|
b312fc |
* Return nothing.
|
|
|
b312fc |
*/
|
|
|
b312fc |
-void
|
|
|
b312fc |
-mpt3sas_base_put_smid_fast_path(struct MPT3SAS_ADAPTER *ioc, u16 smid,
|
|
|
b312fc |
+static void
|
|
|
b312fc |
+_base_put_smid_fast_path(struct MPT3SAS_ADAPTER *ioc, u16 smid,
|
|
|
b312fc |
u16 handle)
|
|
|
b312fc |
{
|
|
|
b312fc |
Mpi2RequestDescriptorUnion_t descriptor;
|
|
|
b312fc |
@@ -2503,14 +2503,14 @@ mpt3sas_base_put_smid_fast_path(struct MPT3SAS_ADAPTER *ioc, u16 smid,
|
|
|
b312fc |
}
|
|
|
b312fc |
|
|
|
b312fc |
/**
|
|
|
b312fc |
- * mpt3sas_base_put_smid_hi_priority - send Task Managment request to firmware
|
|
|
b312fc |
+ * _base_put_smid_hi_priority - send Task Management request to firmware
|
|
|
b312fc |
* @ioc: per adapter object
|
|
|
b312fc |
* @smid: system request message index
|
|
|
b312fc |
* @msix_task: msix_task will be same as msix of IO incase of task abort else 0.
|
|
|
b312fc |
* Return nothing.
|
|
|
b312fc |
*/
|
|
|
b312fc |
-void
|
|
|
b312fc |
-mpt3sas_base_put_smid_hi_priority(struct MPT3SAS_ADAPTER *ioc, u16 smid,
|
|
|
b312fc |
+static void
|
|
|
b312fc |
+_base_put_smid_hi_priority(struct MPT3SAS_ADAPTER *ioc, u16 smid,
|
|
|
b312fc |
u16 msix_task)
|
|
|
b312fc |
{
|
|
|
b312fc |
Mpi2RequestDescriptorUnion_t descriptor;
|
|
|
b312fc |
@@ -2527,14 +2527,14 @@ mpt3sas_base_put_smid_hi_priority(struct MPT3SAS_ADAPTER *ioc, u16 smid,
|
|
|
b312fc |
}
|
|
|
b312fc |
|
|
|
b312fc |
/**
|
|
|
b312fc |
- * mpt3sas_base_put_smid_default - Default, primarily used for config pages
|
|
|
b312fc |
+ * _base_put_smid_default - Default, primarily used for config pages
|
|
|
b312fc |
* @ioc: per adapter object
|
|
|
b312fc |
* @smid: system request message index
|
|
|
b312fc |
*
|
|
|
b312fc |
* Return nothing.
|
|
|
b312fc |
*/
|
|
|
b312fc |
-void
|
|
|
b312fc |
-mpt3sas_base_put_smid_default(struct MPT3SAS_ADAPTER *ioc, u16 smid)
|
|
|
b312fc |
+static void
|
|
|
b312fc |
+_base_put_smid_default(struct MPT3SAS_ADAPTER *ioc, u16 smid)
|
|
|
b312fc |
{
|
|
|
b312fc |
Mpi2RequestDescriptorUnion_t descriptor;
|
|
|
b312fc |
u64 *request = (u64 *)&descriptor;
|
|
|
b312fc |
@@ -2549,6 +2549,95 @@ mpt3sas_base_put_smid_default(struct MPT3SAS_ADAPTER *ioc, u16 smid)
|
|
|
b312fc |
}
|
|
|
b312fc |
|
|
|
b312fc |
/**
|
|
|
b312fc |
+* _base_put_smid_scsi_io_atomic - send SCSI_IO request to firmware using
|
|
|
b312fc |
+* Atomic Request Descriptor
|
|
|
b312fc |
+* @ioc: per adapter object
|
|
|
b312fc |
+* @smid: system request message index
|
|
|
b312fc |
+* @handle: device handle, unused in this function, for function type match
|
|
|
b312fc |
+*
|
|
|
b312fc |
+* Return nothing.
|
|
|
b312fc |
+*/
|
|
|
b312fc |
+static void
|
|
|
b312fc |
+_base_put_smid_scsi_io_atomic(struct MPT3SAS_ADAPTER *ioc, u16 smid,
|
|
|
b312fc |
+ u16 handle)
|
|
|
b312fc |
+{
|
|
|
b312fc |
+ Mpi26AtomicRequestDescriptor_t descriptor;
|
|
|
b312fc |
+ u32 *request = (u32 *)&descriptor;
|
|
|
b312fc |
+
|
|
|
b312fc |
+ descriptor.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO;
|
|
|
b312fc |
+ descriptor.MSIxIndex = _base_get_msix_index(ioc);
|
|
|
b312fc |
+ descriptor.SMID = cpu_to_le16(smid);
|
|
|
b312fc |
+
|
|
|
b312fc |
+ writel(cpu_to_le32(*request), &ioc->chip->AtomicRequestDescriptorPost);
|
|
|
b312fc |
+}
|
|
|
b312fc |
+
|
|
|
b312fc |
+/**
|
|
|
b312fc |
+ * _base_put_smid_fast_path_atomic - send fast path request to firmware
|
|
|
b312fc |
+ * using Atomic Request Descriptor
|
|
|
b312fc |
+ * @ioc: per adapter object
|
|
|
b312fc |
+ * @smid: system request message index
|
|
|
b312fc |
+ * @handle: device handle, unused in this function, for function type match
|
|
|
b312fc |
+ * Return nothing
|
|
|
b312fc |
+ */
|
|
|
b312fc |
+static void
|
|
|
b312fc |
+_base_put_smid_fast_path_atomic(struct MPT3SAS_ADAPTER *ioc, u16 smid,
|
|
|
b312fc |
+ u16 handle)
|
|
|
b312fc |
+{
|
|
|
b312fc |
+ Mpi26AtomicRequestDescriptor_t descriptor;
|
|
|
b312fc |
+ u32 *request = (u32 *)&descriptor;
|
|
|
b312fc |
+
|
|
|
b312fc |
+ descriptor.RequestFlags = MPI25_REQ_DESCRIPT_FLAGS_FAST_PATH_SCSI_IO;
|
|
|
b312fc |
+ descriptor.MSIxIndex = _base_get_msix_index(ioc);
|
|
|
b312fc |
+ descriptor.SMID = cpu_to_le16(smid);
|
|
|
b312fc |
+
|
|
|
b312fc |
+ writel(cpu_to_le32(*request), &ioc->chip->AtomicRequestDescriptorPost);
|
|
|
b312fc |
+}
|
|
|
b312fc |
+
|
|
|
b312fc |
+/**
|
|
|
b312fc |
+ * _base_put_smid_hi_priority_atomic - send Task Management request to
|
|
|
b312fc |
+ * firmware using Atomic Request Descriptor
|
|
|
b312fc |
+ * @ioc: per adapter object
|
|
|
b312fc |
+ * @smid: system request message index
|
|
|
b312fc |
+ * @msix_task: msix_task will be same as msix of IO incase of task abort else 0
|
|
|
b312fc |
+ *
|
|
|
b312fc |
+ * Return nothing.
|
|
|
b312fc |
+ */
|
|
|
b312fc |
+static void
|
|
|
b312fc |
+_base_put_smid_hi_priority_atomic(struct MPT3SAS_ADAPTER *ioc, u16 smid,
|
|
|
b312fc |
+ u16 msix_task)
|
|
|
b312fc |
+{
|
|
|
b312fc |
+ Mpi26AtomicRequestDescriptor_t descriptor;
|
|
|
b312fc |
+ u32 *request = (u32 *)&descriptor;
|
|
|
b312fc |
+
|
|
|
b312fc |
+ descriptor.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
|
|
|
b312fc |
+ descriptor.MSIxIndex = msix_task;
|
|
|
b312fc |
+ descriptor.SMID = cpu_to_le16(smid);
|
|
|
b312fc |
+
|
|
|
b312fc |
+ writel(cpu_to_le32(*request), &ioc->chip->AtomicRequestDescriptorPost);
|
|
|
b312fc |
+}
|
|
|
b312fc |
+
|
|
|
b312fc |
+/**
|
|
|
b312fc |
+ * _base_put_smid_default - Default, primarily used for config pages
|
|
|
b312fc |
+ * use Atomic Request Descriptor
|
|
|
b312fc |
+ * @ioc: per adapter object
|
|
|
b312fc |
+ * @smid: system request message index
|
|
|
b312fc |
+ *
|
|
|
b312fc |
+ * Return nothing.
|
|
|
b312fc |
+ */
|
|
|
b312fc |
+static void
|
|
|
b312fc |
+_base_put_smid_default_atomic(struct MPT3SAS_ADAPTER *ioc, u16 smid)
|
|
|
b312fc |
+{
|
|
|
b312fc |
+ Mpi26AtomicRequestDescriptor_t descriptor;
|
|
|
b312fc |
+ u32 *request = (u32 *)&descriptor;
|
|
|
b312fc |
+
|
|
|
b312fc |
+ descriptor.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
|
|
|
b312fc |
+ descriptor.MSIxIndex = _base_get_msix_index(ioc);
|
|
|
b312fc |
+ descriptor.SMID = cpu_to_le16(smid);
|
|
|
b312fc |
+
|
|
|
b312fc |
+ writel(cpu_to_le32(*request), &ioc->chip->AtomicRequestDescriptorPost);
|
|
|
b312fc |
+}
|
|
|
b312fc |
+
|
|
|
b312fc |
+/**
|
|
|
b312fc |
* _base_display_OEMs_branding - Display branding string
|
|
|
b312fc |
* @ioc: per adapter object
|
|
|
b312fc |
*
|
|
|
b312fc |
@@ -4058,7 +4147,7 @@ mpt3sas_base_sas_iounit_control(struct MPT3SAS_ADAPTER *ioc,
|
|
|
b312fc |
mpi_request->Operation == MPI2_SAS_OP_PHY_LINK_RESET)
|
|
|
b312fc |
ioc->ioc_link_reset_in_progress = 1;
|
|
|
b312fc |
init_completion(&ioc->base_cmds.done);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
timeleft = wait_for_completion_timeout(&ioc->base_cmds.done,
|
|
|
b312fc |
msecs_to_jiffies(10000));
|
|
|
b312fc |
if ((mpi_request->Operation == MPI2_SAS_OP_PHY_HARD_RESET ||
|
|
|
b312fc |
@@ -4160,7 +4249,7 @@ mpt3sas_base_scsi_enclosure_processor(struct MPT3SAS_ADAPTER *ioc,
|
|
|
b312fc |
ioc->base_cmds.smid = smid;
|
|
|
b312fc |
memcpy(request, mpi_request, sizeof(Mpi2SepReply_t));
|
|
|
b312fc |
init_completion(&ioc->base_cmds.done);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
timeleft = wait_for_completion_timeout(&ioc->base_cmds.done,
|
|
|
b312fc |
msecs_to_jiffies(10000));
|
|
|
b312fc |
if (!(ioc->base_cmds.status & MPT3_CMD_COMPLETE)) {
|
|
|
b312fc |
@@ -4351,6 +4440,8 @@ _base_get_ioc_facts(struct MPT3SAS_ADAPTER *ioc, int sleep_flag)
|
|
|
b312fc |
if ((facts->IOCCapabilities &
|
|
|
b312fc |
MPI2_IOCFACTS_CAPABILITY_RDPQ_ARRAY_CAPABLE))
|
|
|
b312fc |
ioc->rdpq_array_capable = 1;
|
|
|
b312fc |
+ if (facts->IOCCapabilities & MPI26_IOCFACTS_CAPABILITY_ATOMIC_REQ)
|
|
|
b312fc |
+ ioc->atomic_desc_capable = 1;
|
|
|
b312fc |
facts->FWVersion.Word = le32_to_cpu(mpi_reply.FWVersion.Word);
|
|
|
b312fc |
facts->IOCRequestFrameSize =
|
|
|
b312fc |
le16_to_cpu(mpi_reply.IOCRequestFrameSize);
|
|
|
b312fc |
@@ -4582,7 +4673,7 @@ _base_send_port_enable(struct MPT3SAS_ADAPTER *ioc, int sleep_flag)
|
|
|
b312fc |
mpi_request->Function = MPI2_FUNCTION_PORT_ENABLE;
|
|
|
b312fc |
|
|
|
b312fc |
init_completion(&ioc->port_enable_cmds.done);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
timeleft = wait_for_completion_timeout(&ioc->port_enable_cmds.done,
|
|
|
b312fc |
300*HZ);
|
|
|
b312fc |
if (!(ioc->port_enable_cmds.status & MPT3_CMD_COMPLETE)) {
|
|
|
b312fc |
@@ -4646,7 +4737,7 @@ mpt3sas_port_enable(struct MPT3SAS_ADAPTER *ioc)
|
|
|
b312fc |
memset(mpi_request, 0, sizeof(Mpi2PortEnableRequest_t));
|
|
|
b312fc |
mpi_request->Function = MPI2_FUNCTION_PORT_ENABLE;
|
|
|
b312fc |
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
return 0;
|
|
|
b312fc |
}
|
|
|
b312fc |
|
|
|
b312fc |
@@ -4767,7 +4858,7 @@ _base_event_notification(struct MPT3SAS_ADAPTER *ioc, int sleep_flag)
|
|
|
b312fc |
mpi_request->EventMasks[i] =
|
|
|
b312fc |
cpu_to_le32(ioc->event_masks[i]);
|
|
|
b312fc |
init_completion(&ioc->base_cmds.done);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, 30*HZ);
|
|
|
b312fc |
if (!(ioc->base_cmds.status & MPT3_CMD_COMPLETE)) {
|
|
|
b312fc |
pr_err(MPT3SAS_FMT "%s: timeout\n",
|
|
|
b312fc |
@@ -5316,9 +5407,23 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc)
|
|
|
b312fc |
ioc->build_sg = &_base_build_sg_ieee;
|
|
|
b312fc |
ioc->build_zero_len_sge = &_base_build_zero_len_sge_ieee;
|
|
|
b312fc |
ioc->sge_size_ieee = sizeof(Mpi2IeeeSgeSimple64_t);
|
|
|
b312fc |
+
|
|
|
b312fc |
break;
|
|
|
b312fc |
}
|
|
|
b312fc |
|
|
|
b312fc |
+ if (ioc->atomic_desc_capable) {
|
|
|
b312fc |
+ ioc->put_smid_default = &_base_put_smid_default_atomic;
|
|
|
b312fc |
+ ioc->put_smid_scsi_io = &_base_put_smid_scsi_io_atomic;
|
|
|
b312fc |
+ ioc->put_smid_fast_path = &_base_put_smid_fast_path_atomic;
|
|
|
b312fc |
+ ioc->put_smid_hi_priority = &_base_put_smid_hi_priority_atomic;
|
|
|
b312fc |
+ } else {
|
|
|
b312fc |
+ ioc->put_smid_default = &_base_put_smid_default;
|
|
|
b312fc |
+ ioc->put_smid_scsi_io = &_base_put_smid_scsi_io;
|
|
|
b312fc |
+ ioc->put_smid_fast_path = &_base_put_smid_fast_path;
|
|
|
b312fc |
+ ioc->put_smid_hi_priority = &_base_put_smid_hi_priority;
|
|
|
b312fc |
+ }
|
|
|
b312fc |
+
|
|
|
b312fc |
+
|
|
|
b312fc |
/*
|
|
|
b312fc |
* These function pointers for other requests that don't
|
|
|
b312fc |
* the require IEEE scatter gather elements.
|
|
|
b312fc |
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
|
|
|
b312fc |
index 240c360..b8c8be4 100644
|
|
|
b312fc |
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
|
|
|
b312fc |
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
|
|
|
b312fc |
@@ -740,7 +740,10 @@ typedef void (*MPT_BUILD_SG)(struct MPT3SAS_ADAPTER *ioc, void *psge,
|
|
|
b312fc |
typedef void (*MPT_BUILD_ZERO_LEN_SGE)(struct MPT3SAS_ADAPTER *ioc,
|
|
|
b312fc |
void *paddr);
|
|
|
b312fc |
|
|
|
b312fc |
-
|
|
|
b312fc |
+/* To support atomic and non atomic descriptors*/
|
|
|
b312fc |
+typedef void (*PUT_SMID_IO_FP_HIP) (struct MPT3SAS_ADAPTER *ioc, u16 smid,
|
|
|
b312fc |
+ u16 funcdep);
|
|
|
b312fc |
+typedef void (*PUT_SMID_DEFAULT) (struct MPT3SAS_ADAPTER *ioc, u16 smid);
|
|
|
b312fc |
|
|
|
b312fc |
/* IOC Facts and Port Facts converted from little endian to cpu */
|
|
|
b312fc |
union mpi3_version_union {
|
|
|
b312fc |
@@ -1208,6 +1211,12 @@ struct MPT3SAS_ADAPTER {
|
|
|
b312fc |
void *device_remove_in_progress;
|
|
|
b312fc |
u16 device_remove_in_progress_sz;
|
|
|
b312fc |
u8 is_gen35_ioc;
|
|
|
b312fc |
+ u8 atomic_desc_capable;
|
|
|
b312fc |
+ PUT_SMID_IO_FP_HIP put_smid_scsi_io;
|
|
|
b312fc |
+ PUT_SMID_IO_FP_HIP put_smid_fast_path;
|
|
|
b312fc |
+ PUT_SMID_IO_FP_HIP put_smid_hi_priority;
|
|
|
b312fc |
+ PUT_SMID_DEFAULT put_smid_default;
|
|
|
b312fc |
+
|
|
|
b312fc |
};
|
|
|
b312fc |
|
|
|
b312fc |
typedef u8 (*MPT_CALLBACK)(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
|
|
|
b312fc |
@@ -1253,13 +1262,6 @@ u16 mpt3sas_base_get_smid_scsiio(struct MPT3SAS_ADAPTER *ioc, u8 cb_idx,
|
|
|
b312fc |
|
|
|
b312fc |
u16 mpt3sas_base_get_smid(struct MPT3SAS_ADAPTER *ioc, u8 cb_idx);
|
|
|
b312fc |
void mpt3sas_base_free_smid(struct MPT3SAS_ADAPTER *ioc, u16 smid);
|
|
|
b312fc |
-void mpt3sas_base_put_smid_scsi_io(struct MPT3SAS_ADAPTER *ioc, u16 smid,
|
|
|
b312fc |
- u16 handle);
|
|
|
b312fc |
-void mpt3sas_base_put_smid_fast_path(struct MPT3SAS_ADAPTER *ioc, u16 smid,
|
|
|
b312fc |
- u16 handle);
|
|
|
b312fc |
-void mpt3sas_base_put_smid_hi_priority(struct MPT3SAS_ADAPTER *ioc,
|
|
|
b312fc |
- u16 smid, u16 msix_task);
|
|
|
b312fc |
-void mpt3sas_base_put_smid_default(struct MPT3SAS_ADAPTER *ioc, u16 smid);
|
|
|
b312fc |
void mpt3sas_base_initialize_callback_handler(void);
|
|
|
b312fc |
u8 mpt3sas_base_register_callback_handler(MPT_CALLBACK cb_func);
|
|
|
b312fc |
void mpt3sas_base_release_callback_handler(u8 cb_idx);
|
|
|
b312fc |
diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c
|
|
|
b312fc |
index a6914ec..b024e14 100644
|
|
|
b312fc |
--- a/drivers/scsi/mpt3sas/mpt3sas_config.c
|
|
|
b312fc |
+++ b/drivers/scsi/mpt3sas/mpt3sas_config.c
|
|
|
b312fc |
@@ -385,7 +385,7 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t
|
|
|
b312fc |
memcpy(config_request, mpi_request, sizeof(Mpi2ConfigRequest_t));
|
|
|
b312fc |
_config_display_some_debug(ioc, smid, "config_request", NULL);
|
|
|
b312fc |
init_completion(&ioc->config_cmds.done);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
timeleft = wait_for_completion_timeout(&ioc->config_cmds.done,
|
|
|
b312fc |
timeout*HZ);
|
|
|
b312fc |
if (!(ioc->config_cmds.status & MPT3_CMD_COMPLETE)) {
|
|
|
b312fc |
diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
|
|
|
b312fc |
index a66c0c8..8273e8c 100644
|
|
|
b312fc |
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
|
|
|
b312fc |
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
|
|
|
b312fc |
@@ -813,9 +813,9 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
|
|
|
b312fc |
ioc->build_sg(ioc, psge, data_out_dma, data_out_sz,
|
|
|
b312fc |
data_in_dma, data_in_sz);
|
|
|
b312fc |
if (mpi_request->Function == MPI2_FUNCTION_SCSI_IO_REQUEST)
|
|
|
b312fc |
- mpt3sas_base_put_smid_scsi_io(ioc, smid, device_handle);
|
|
|
b312fc |
+ ioc->put_smid_scsi_io(ioc, smid, device_handle);
|
|
|
b312fc |
else
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
break;
|
|
|
b312fc |
}
|
|
|
b312fc |
case MPI2_FUNCTION_SCSI_TASK_MGMT:
|
|
|
b312fc |
@@ -850,7 +850,7 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
|
|
|
b312fc |
tm_request->DevHandle));
|
|
|
b312fc |
ioc->build_sg_mpi(ioc, psge, data_out_dma, data_out_sz,
|
|
|
b312fc |
data_in_dma, data_in_sz);
|
|
|
b312fc |
- mpt3sas_base_put_smid_hi_priority(ioc, smid, 0);
|
|
|
b312fc |
+ ioc->put_smid_hi_priority(ioc, smid, 0);
|
|
|
b312fc |
break;
|
|
|
b312fc |
}
|
|
|
b312fc |
case MPI2_FUNCTION_SMP_PASSTHROUGH:
|
|
|
b312fc |
@@ -881,7 +881,7 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
|
|
|
b312fc |
}
|
|
|
b312fc |
ioc->build_sg(ioc, psge, data_out_dma, data_out_sz, data_in_dma,
|
|
|
b312fc |
data_in_sz);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
break;
|
|
|
b312fc |
}
|
|
|
b312fc |
case MPI2_FUNCTION_SATA_PASSTHROUGH:
|
|
|
b312fc |
@@ -896,7 +896,7 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
|
|
|
b312fc |
}
|
|
|
b312fc |
ioc->build_sg(ioc, psge, data_out_dma, data_out_sz, data_in_dma,
|
|
|
b312fc |
data_in_sz);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
break;
|
|
|
b312fc |
}
|
|
|
b312fc |
case MPI2_FUNCTION_FW_DOWNLOAD:
|
|
|
b312fc |
@@ -904,7 +904,7 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
|
|
|
b312fc |
{
|
|
|
b312fc |
ioc->build_sg(ioc, psge, data_out_dma, data_out_sz, data_in_dma,
|
|
|
b312fc |
data_in_sz);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
break;
|
|
|
b312fc |
}
|
|
|
b312fc |
case MPI2_FUNCTION_TOOLBOX:
|
|
|
b312fc |
@@ -919,7 +919,7 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
|
|
|
b312fc |
ioc->build_sg_mpi(ioc, psge, data_out_dma, data_out_sz,
|
|
|
b312fc |
data_in_dma, data_in_sz);
|
|
|
b312fc |
}
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
break;
|
|
|
b312fc |
}
|
|
|
b312fc |
case MPI2_FUNCTION_SAS_IO_UNIT_CONTROL:
|
|
|
b312fc |
@@ -938,7 +938,7 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
|
|
|
b312fc |
default:
|
|
|
b312fc |
ioc->build_sg_mpi(ioc, psge, data_out_dma, data_out_sz,
|
|
|
b312fc |
data_in_dma, data_in_sz);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
break;
|
|
|
b312fc |
}
|
|
|
b312fc |
|
|
|
b312fc |
@@ -1533,7 +1533,7 @@ _ctl_diag_register_2(struct MPT3SAS_ADAPTER *ioc,
|
|
|
b312fc |
cpu_to_le32(ioc->product_specific[buffer_type][i]);
|
|
|
b312fc |
|
|
|
b312fc |
init_completion(&ioc->ctl_cmds.done);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
timeleft = wait_for_completion_timeout(&ioc->ctl_cmds.done,
|
|
|
b312fc |
MPT3_IOCTL_DEFAULT_TIMEOUT*HZ);
|
|
|
b312fc |
|
|
|
b312fc |
@@ -1882,7 +1882,7 @@ mpt3sas_send_diag_release(struct MPT3SAS_ADAPTER *ioc, u8 buffer_type,
|
|
|
b312fc |
mpi_request->VP_ID = 0;
|
|
|
b312fc |
|
|
|
b312fc |
init_completion(&ioc->ctl_cmds.done);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
timeleft = wait_for_completion_timeout(&ioc->ctl_cmds.done,
|
|
|
b312fc |
MPT3_IOCTL_DEFAULT_TIMEOUT*HZ);
|
|
|
b312fc |
|
|
|
b312fc |
@@ -2150,7 +2150,7 @@ _ctl_diag_read_buffer(struct MPT3SAS_ADAPTER *ioc, void __user *arg)
|
|
|
b312fc |
mpi_request->VP_ID = 0;
|
|
|
b312fc |
|
|
|
b312fc |
init_completion(&ioc->ctl_cmds.done);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
timeleft = wait_for_completion_timeout(&ioc->ctl_cmds.done,
|
|
|
b312fc |
MPT3_IOCTL_DEFAULT_TIMEOUT*HZ);
|
|
|
b312fc |
|
|
|
b312fc |
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
|
|
|
b312fc |
index 0ff2ed3..0dcf826 100644
|
|
|
b312fc |
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
|
|
|
b312fc |
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
|
|
|
b312fc |
@@ -2339,7 +2339,7 @@ mpt3sas_scsih_issue_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle, uint channel,
|
|
|
b312fc |
msix_task = scsi_lookup->msix_io;
|
|
|
b312fc |
else
|
|
|
b312fc |
msix_task = 0;
|
|
|
b312fc |
- mpt3sas_base_put_smid_hi_priority(ioc, smid, msix_task);
|
|
|
b312fc |
+ ioc->put_smid_hi_priority(ioc, smid, msix_task);
|
|
|
b312fc |
timeleft = wait_for_completion_timeout(&ioc->tm_cmds.done, timeout*HZ);
|
|
|
b312fc |
if (!(ioc->tm_cmds.status & MPT3_CMD_COMPLETE)) {
|
|
|
b312fc |
pr_err(MPT3SAS_FMT "%s: timeout\n",
|
|
|
b312fc |
@@ -3252,7 +3252,7 @@ _scsih_tm_tr_send(struct MPT3SAS_ADAPTER *ioc, u16 handle)
|
|
|
b312fc |
mpi_request->DevHandle = cpu_to_le16(handle);
|
|
|
b312fc |
mpi_request->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET;
|
|
|
b312fc |
set_bit(handle, ioc->device_remove_in_progress);
|
|
|
b312fc |
- mpt3sas_base_put_smid_hi_priority(ioc, smid, 0);
|
|
|
b312fc |
+ ioc->put_smid_hi_priority(ioc, smid, 0);
|
|
|
b312fc |
mpt3sas_trigger_master(ioc, MASTER_TRIGGER_DEVICE_REMOVAL);
|
|
|
b312fc |
|
|
|
b312fc |
out:
|
|
|
b312fc |
@@ -3351,7 +3351,7 @@ _scsih_tm_tr_complete(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
|
|
|
b312fc |
mpi_request->Function = MPI2_FUNCTION_SAS_IO_UNIT_CONTROL;
|
|
|
b312fc |
mpi_request->Operation = MPI2_SAS_OP_REMOVE_DEVICE;
|
|
|
b312fc |
mpi_request->DevHandle = mpi_request_tm->DevHandle;
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid_sas_ctrl);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid_sas_ctrl);
|
|
|
b312fc |
|
|
|
b312fc |
return _scsih_check_for_pending_tm(ioc, smid);
|
|
|
b312fc |
}
|
|
|
b312fc |
@@ -3446,7 +3446,7 @@ _scsih_tm_tr_volume_send(struct MPT3SAS_ADAPTER *ioc, u16 handle)
|
|
|
b312fc |
mpi_request->Function = MPI2_FUNCTION_SCSI_TASK_MGMT;
|
|
|
b312fc |
mpi_request->DevHandle = cpu_to_le16(handle);
|
|
|
b312fc |
mpi_request->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET;
|
|
|
b312fc |
- mpt3sas_base_put_smid_hi_priority(ioc, smid, 0);
|
|
|
b312fc |
+ ioc->put_smid_hi_priority(ioc, smid, 0);
|
|
|
b312fc |
}
|
|
|
b312fc |
|
|
|
b312fc |
/**
|
|
|
b312fc |
@@ -3538,7 +3538,7 @@ _scsih_issue_delayed_event_ack(struct MPT3SAS_ADAPTER *ioc, u16 smid, u16 event,
|
|
|
b312fc |
ack_request->EventContext = event_context;
|
|
|
b312fc |
ack_request->VF_ID = 0; /* TODO */
|
|
|
b312fc |
ack_request->VP_ID = 0;
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
}
|
|
|
b312fc |
|
|
|
b312fc |
/**
|
|
|
b312fc |
@@ -3595,7 +3595,7 @@ _scsih_issue_delayed_sas_io_unit_ctrl(struct MPT3SAS_ADAPTER *ioc,
|
|
|
b312fc |
mpi_request->Function = MPI2_FUNCTION_SAS_IO_UNIT_CONTROL;
|
|
|
b312fc |
mpi_request->Operation = MPI2_SAS_OP_REMOVE_DEVICE;
|
|
|
b312fc |
mpi_request->DevHandle = handle;
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
}
|
|
|
b312fc |
|
|
|
b312fc |
/**
|
|
|
b312fc |
@@ -4218,12 +4218,12 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
|
|
|
b312fc |
if (sas_target_priv_data->flags & MPT_TARGET_FASTPATH_IO) {
|
|
|
b312fc |
mpi_request->IoFlags = cpu_to_le16(scmd->cmd_len |
|
|
|
b312fc |
MPI25_SCSIIO_IOFLAGS_FAST_PATH);
|
|
|
b312fc |
- mpt3sas_base_put_smid_fast_path(ioc, smid, handle);
|
|
|
b312fc |
+ ioc->put_smid_fast_path(ioc, smid, handle);
|
|
|
b312fc |
} else
|
|
|
b312fc |
- mpt3sas_base_put_smid_scsi_io(ioc, smid,
|
|
|
b312fc |
+ ioc->put_smid_scsi_io(ioc, smid,
|
|
|
b312fc |
le16_to_cpu(mpi_request->DevHandle));
|
|
|
b312fc |
} else
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
return 0;
|
|
|
b312fc |
|
|
|
b312fc |
out:
|
|
|
b312fc |
@@ -4719,7 +4719,7 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
|
|
|
b312fc |
memcpy(mpi_request->CDB.CDB32, scmd->cmnd, scmd->cmd_len);
|
|
|
b312fc |
mpi_request->DevHandle =
|
|
|
b312fc |
cpu_to_le16(sas_device_priv_data->sas_target->handle);
|
|
|
b312fc |
- mpt3sas_base_put_smid_scsi_io(ioc, smid,
|
|
|
b312fc |
+ ioc->put_smid_scsi_io(ioc, smid,
|
|
|
b312fc |
sas_device_priv_data->sas_target->handle);
|
|
|
b312fc |
return 0;
|
|
|
b312fc |
}
|
|
|
b312fc |
@@ -6330,7 +6330,7 @@ _scsih_ir_fastpath(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 phys_disk_num)
|
|
|
b312fc |
handle, phys_disk_num));
|
|
|
b312fc |
|
|
|
b312fc |
init_completion(&ioc->scsih_cmds.done);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
wait_for_completion_timeout(&ioc->scsih_cmds.done, 10*HZ);
|
|
|
b312fc |
|
|
|
b312fc |
if (!(ioc->scsih_cmds.status & MPT3_CMD_COMPLETE)) {
|
|
|
b312fc |
@@ -8180,7 +8180,7 @@ _scsih_ir_shutdown(struct MPT3SAS_ADAPTER *ioc)
|
|
|
b312fc |
if (!ioc->hide_ir_msg)
|
|
|
b312fc |
pr_info(MPT3SAS_FMT "IR shutdown (sending)\n", ioc->name);
|
|
|
b312fc |
init_completion(&ioc->scsih_cmds.done);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
wait_for_completion_timeout(&ioc->scsih_cmds.done, 10*HZ);
|
|
|
b312fc |
|
|
|
b312fc |
if (!(ioc->scsih_cmds.status & MPT3_CMD_COMPLETE)) {
|
|
|
b312fc |
diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c
|
|
|
b312fc |
index a01b235..4b7c32b 100644
|
|
|
b312fc |
--- a/drivers/scsi/mpt3sas/mpt3sas_transport.c
|
|
|
b312fc |
+++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c
|
|
|
b312fc |
@@ -393,7 +393,7 @@ _transport_expander_report_manufacture(struct MPT3SAS_ADAPTER *ioc,
|
|
|
b312fc |
"report_manufacture - send to sas_addr(0x%016llx)\n",
|
|
|
b312fc |
ioc->name, (unsigned long long)sas_address));
|
|
|
b312fc |
init_completion(&ioc->transport_cmds.done);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
timeleft = wait_for_completion_timeout(&ioc->transport_cmds.done,
|
|
|
b312fc |
10*HZ);
|
|
|
b312fc |
|
|
|
b312fc |
@@ -1197,7 +1197,7 @@ _transport_get_expander_phy_error_log(struct MPT3SAS_ADAPTER *ioc,
|
|
|
b312fc |
ioc->name, (unsigned long long)phy->identify.sas_address,
|
|
|
b312fc |
phy->number));
|
|
|
b312fc |
init_completion(&ioc->transport_cmds.done);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
timeleft = wait_for_completion_timeout(&ioc->transport_cmds.done,
|
|
|
b312fc |
10*HZ);
|
|
|
b312fc |
|
|
|
b312fc |
@@ -1516,7 +1516,7 @@ _transport_expander_phy_control(struct MPT3SAS_ADAPTER *ioc,
|
|
|
b312fc |
ioc->name, (unsigned long long)phy->identify.sas_address,
|
|
|
b312fc |
phy->number, phy_operation));
|
|
|
b312fc |
init_completion(&ioc->transport_cmds.done);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
timeleft = wait_for_completion_timeout(&ioc->transport_cmds.done,
|
|
|
b312fc |
10*HZ);
|
|
|
b312fc |
|
|
|
b312fc |
@@ -2036,7 +2036,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
|
|
|
b312fc |
"%s - sending smp request\n", ioc->name, __func__));
|
|
|
b312fc |
|
|
|
b312fc |
init_completion(&ioc->transport_cmds.done);
|
|
|
b312fc |
- mpt3sas_base_put_smid_default(ioc, smid);
|
|
|
b312fc |
+ ioc->put_smid_default(ioc, smid);
|
|
|
b312fc |
timeleft = wait_for_completion_timeout(&ioc->transport_cmds.done,
|
|
|
b312fc |
10*HZ);
|
|
|
b312fc |
|
|
|
b312fc |
--
|
|
|
b312fc |
1.8.3.1
|
|
|
b312fc |
|