Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1320339 > unrolled thread
| Started by | Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> |
|---|---|
| First post | 2016-01-28 07:40 +0100 |
| Last post | 2016-02-05 03:10 +0100 |
| Articles | 11 — 4 participants |
Back to article view | Back to linux.kernel
[mpt3sas driver patches 00/10] mpt3sas driver enhancements and Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> - 2016-01-28 07:40 +0100
[mpt3sas driver 03/10] mpt3sas: Fix static analyzer(coverity) tool identified defects Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> - 2016-01-28 07:40 +0100
Re: [mpt3sas driver 03/10] mpt3sas: Fix static analyzer(coverity) tool identified defects Tomas Henzl <thenzl@redhat.com> - 2016-02-04 15:20 +0100
[mpt3sas driver 05/10] mpt3sas: Make use of additional HighPriority credit message frames for sending SCSI IO's Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> - 2016-01-28 07:40 +0100
[mpt3sas driver 02/10] mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP Passthrough request message. Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> - 2016-01-28 07:50 +0100
Re: [mpt3sas driver 02/10] mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP Passthrough request message. Christoph Hellwig <hch@infradead.org> - 2016-01-28 10:20 +0100
Re: [mpt3sas driver 02/10] mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP Passthrough request message. Tomas Henzl <thenzl@redhat.com> - 2016-02-04 15:20 +0100
[mpt3sas driver 04/10] mpt3sas: Never block the Enclosure device Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> - 2016-01-28 07:50 +0100
Re: [mpt3sas driver 04/10] mpt3sas: Never block the Enclosure device Tomas Henzl <thenzl@redhat.com> - 2016-02-04 15:40 +0100
Re: [mpt3sas driver 01/10] mpt3sas: Added support for high port count HBA variants. Tomas Henzl <thenzl@redhat.com> - 2016-02-04 15:20 +0100
Re: [mpt3sas driver patches 00/10] mpt3sas driver enhancements and "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-02-05 03:10 +0100
| From | Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> |
|---|---|
| Date | 2016-01-28 07:40 +0100 |
| Subject | [mpt3sas driver patches 00/10] mpt3sas driver enhancements and |
| Message-ID | <qVOpj-7Sk-3@gated-at.bofh.it> |
From: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Here is the change list:
Posting 10 patches for mpt3sas driver enhancements and few fixes.
* Updated hardware description headers with MPI v2.6 and
mpt3sas_pci_table[] with vendor_ids,device_ids of Cutlass and
Intruder HBA which has support for 4 ports.
* Static analyzer(coverity) tool identified defects.
* Never block the SEP device even for the delay not
responding events. Blocking the SEP device will create a deadlock while
adding any device to the OS.
* Modified host queue algorithm to treat global credits and
highPriority credits as two different values.
* Module parameter to enable/disable configuring
affinity hint for msix vector.
* Added support for configurable Chain Frame Size for
SAS 3.0 HBA'S.
* Updated MPI version and MPI header files.
* Fix for Asynchronous completion of timedout IO and task abort
of timedout IO.
* Updated driver version to 12.100.00.00
Suganath prabu Subramani (10):
mpt3sas: Added support for high port count HBA variants.
mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP
Passthrough request message.
mpt3sas: Fix static analyzer(coverity) tool identified defects
mpt3sas: Never block the Enclosure device
mpt3sas: Make use of additional HighPriority credit message frames for
sending SCSI IO's
mpt3sas: Added smp_affinity_enable module parameter.
mpt3sas: Add support for configurable Chain Frame Size
mpt3sas: Updated MPI Header to 2.00.42
mpt3sas: Fix for Asynchronous completion of timedout IO and task abort
of timedout IO.
mpt3sas: Updating mpt3sas driver version to 12.100.00.00
drivers/scsi/mpt3sas/mpi/mpi2.h | 82 +++++++++-
drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h | 127 +++++++++++++--
drivers/scsi/mpt3sas/mpi/mpi2_init.h | 22 ++-
drivers/scsi/mpt3sas/mpi/mpi2_ioc.h | 117 ++++++++++++-
drivers/scsi/mpt3sas/mpi/mpi2_raid.h | 5 +-
drivers/scsi/mpt3sas/mpi/mpi2_sas.h | 10 +-
drivers/scsi/mpt3sas/mpi/mpi2_tool.h | 5 +-
drivers/scsi/mpt3sas/mpi/mpi2_type.h | 5 +-
drivers/scsi/mpt3sas/mpt3sas_base.c | 149 ++++++++++++-----
drivers/scsi/mpt3sas/mpt3sas_base.h | 47 +++++-
drivers/scsi/mpt3sas/mpt3sas_ctl.c | 37 ++++-
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 272 ++++++++++++++++++++++++++++---
drivers/scsi/mpt3sas/mpt3sas_transport.c | 25 +--
13 files changed, 769 insertions(+), 134 deletions(-)
Thanks,
Suganath prabu S
--
1.8.3.1
[toc] | [next] | [standalone]
| From | Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> |
|---|---|
| Date | 2016-01-28 07:40 +0100 |
| Subject | [mpt3sas driver 03/10] mpt3sas: Fix static analyzer(coverity) tool identified defects |
| Message-ID | <qVOpl-7Sk-35@gated-at.bofh.it> |
| In reply to | #1320339 |
From: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> 1.Wrong size of argument is being passed The size of struct being passed as an argument to memset func and area of memory being pointed by an instance of struct in memset func should be of same structure type. 2.Dereference null return value 3.Array compared against '0' Check whether value pointed by particular index of an array is null or not in "if" statement. Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com> --- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 3 ++- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 ++-- drivers/scsi/mpt3sas/mpt3sas_transport.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c index ef9971e..d872587 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c @@ -401,7 +401,8 @@ mpt3sas_ctl_event_callback(struct MPT3SAS_ADAPTER *ioc, u8 msix_index, Mpi2EventNotificationReply_t *mpi_reply; mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply); - mpt3sas_ctl_add_to_event_log(ioc, mpi_reply); + if (mpi_reply) + mpt3sas_ctl_add_to_event_log(ioc, mpi_reply); return 1; } diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 0fb4ccd..686a46a 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -2399,7 +2399,7 @@ _scsih_tm_display_info(struct MPT3SAS_ADAPTER *ioc, struct scsi_cmnd *scmd) (unsigned long long) sas_device->enclosure_logical_id, sas_device->slot); - if (sas_device->connector_name) + if (sas_device->connector_name[0] != '\0') starget_printk(KERN_INFO, starget, "enclosure level(0x%04x),connector name(%s)\n", sas_device->enclosure_level, @@ -3134,7 +3134,7 @@ _scsih_tm_tr_send(struct MPT3SAS_ADAPTER *ioc, u16 handle) " slot(%d)\n", ioc->name, (unsigned long long) sas_device->enclosure_logical_id, sas_device->slot)); - if (sas_device->connector_name) + if (sas_device->connector_name[0] != '\0') dewtprintk(ioc, pr_info(MPT3SAS_FMT "setting delete flag: enclosure level(0x%04x)," " connector name( %s)\n", ioc->name, diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c index df08aeb..6a84b82 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_transport.c +++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c @@ -1600,7 +1600,7 @@ _transport_phy_reset(struct sas_phy *phy, int hard_reset) SMP_PHY_CONTROL_LINK_RESET); /* handle hba phys */ - memset(&mpi_request, 0, sizeof(Mpi2SasIoUnitControlReply_t)); + memset(&mpi_request, 0, sizeof(Mpi2SasIoUnitControlRequest_t)); mpi_request.Function = MPI2_FUNCTION_SAS_IO_UNIT_CONTROL; mpi_request.Operation = hard_reset ? MPI2_SAS_OP_PHY_HARD_RESET : MPI2_SAS_OP_PHY_LINK_RESET; -- 1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | Tomas Henzl <thenzl@redhat.com> |
|---|---|
| Date | 2016-02-04 15:20 +0100 |
| Subject | Re: [mpt3sas driver 03/10] mpt3sas: Fix static analyzer(coverity) tool identified defects |
| Message-ID | <qYsVk-1nc-29@gated-at.bofh.it> |
| In reply to | #1320344 |
On 28.1.2016 07:37, Suganath prabu Subaramani wrote: > From: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> > > 1.Wrong size of argument is being passed > The size of struct being passed as an argument to memset func and area of > memory being pointed by an instance of struct in memset func should be of > same structure type. > 2.Dereference null return value > 3.Array compared against '0' > Check whether value pointed by particular index of an array is null or not > in "if" statement. > > Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> > Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Tomas
[toc] | [prev] | [next] | [standalone]
| From | Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> |
|---|---|
| Date | 2016-01-28 07:40 +0100 |
| Subject | [mpt3sas driver 05/10] mpt3sas: Make use of additional HighPriority credit message frames for sending SCSI IO's |
| Message-ID | <qVOpl-7Sk-43@gated-at.bofh.it> |
| In reply to | #1320339 |
From: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Driver assumes HighPriority credit as part of Global credit. But,
Firmware treats HighPriority credit value and global cedits as two
different values. Changed host queue algorithm to treat global credits and
highPriority credits as two different values.
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
---
drivers/scsi/mpt3sas/mpt3sas_base.c | 63 +++++++++++---
drivers/scsi/mpt3sas/mpt3sas_base.h | 27 ++++++
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 154 ++++++++++++++++++++++++++++++++++-
3 files changed, 228 insertions(+), 16 deletions(-)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index f59495b..31838d9a 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -775,7 +775,7 @@ mpt3sas_base_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply);
if (mpi_reply && mpi_reply->Function == MPI2_FUNCTION_EVENT_ACK)
- return 1;
+ return mpt3sas_check_for_pending_internal_cmds(ioc, smid);
if (ioc->base_cmds.status == MPT3_CMD_NOT_USED)
return 1;
@@ -806,6 +806,7 @@ _base_async_event(struct MPT3SAS_ADAPTER *ioc, u8 msix_index, u32 reply)
Mpi2EventNotificationReply_t *mpi_reply;
Mpi2EventAckRequest_t *ack_request;
u16 smid;
+ struct _event_ack_list *delayed_event_ack;
mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply);
if (!mpi_reply)
@@ -819,8 +820,18 @@ _base_async_event(struct MPT3SAS_ADAPTER *ioc, u8 msix_index, u32 reply)
goto out;
smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx);
if (!smid) {
- pr_err(MPT3SAS_FMT "%s: failed obtaining a smid\n",
- ioc->name, __func__);
+ delayed_event_ack = kzalloc(sizeof(*delayed_event_ack),
+ GFP_ATOMIC);
+ if (!delayed_event_ack)
+ goto out;
+ INIT_LIST_HEAD(&delayed_event_ack->list);
+ delayed_event_ack->Event = mpi_reply->Event;
+ delayed_event_ack->EventContext = mpi_reply->EventContext;
+ list_add_tail(&delayed_event_ack->list,
+ &ioc->delayed_event_ack_list);
+ dewtprintk(ioc, pr_info(MPT3SAS_FMT
+ "DELAYED: EVENT ACK: event (0x%04x)\n",
+ ioc->name, le16_to_cpu(mpi_reply->Event)));
goto out;
}
@@ -3189,20 +3200,35 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc, int sleep_flag)
}
ioc->shost->sg_tablesize = sg_tablesize;
- ioc->hi_priority_depth = facts->HighPriorityCredit;
- ioc->internal_depth = ioc->hi_priority_depth + (5);
+ ioc->internal_depth = min_t(int, (facts->HighPriorityCredit + (5)),
+ (facts->RequestCredit / 4));
+ if (ioc->internal_depth < INTERNAL_CMDS_COUNT) {
+ if (facts->RequestCredit <= (INTERNAL_CMDS_COUNT +
+ INTERNAL_SCSIIO_CMDS_COUNT)) {
+ pr_err(MPT3SAS_FMT "IOC doesn't have enough Request \
+ Credits, it has just %d number of credits\n",
+ ioc->name, facts->RequestCredit);
+ return -ENOMEM;
+ }
+ ioc->internal_depth = 10;
+ }
+
+ ioc->hi_priority_depth = ioc->internal_depth - (5);
/* command line tunables for max controller queue depth */
if (max_queue_depth != -1 && max_queue_depth != 0) {
max_request_credit = min_t(u16, max_queue_depth +
- ioc->hi_priority_depth + ioc->internal_depth,
- facts->RequestCredit);
+ ioc->internal_depth, facts->RequestCredit);
if (max_request_credit > MAX_HBA_QUEUE_DEPTH)
max_request_credit = MAX_HBA_QUEUE_DEPTH;
} else
max_request_credit = min_t(u16, facts->RequestCredit,
MAX_HBA_QUEUE_DEPTH);
- ioc->hba_queue_depth = max_request_credit;
+ /* Firmware maintains additional facts->HighPriorityCredit number of
+ * credits for HiPriprity Request messages, so hba queue depth will be
+ * sum of max_request_credit and high priority queue depth.
+ */
+ ioc->hba_queue_depth = max_request_credit + ioc->hi_priority_depth;
/* request frame size */
ioc->request_sz = facts->IOCRequestFrameSize * 4;
@@ -3249,7 +3275,6 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc, int sleep_flag)
ioc->reply_post_queue_depth += 16 -
(ioc->reply_post_queue_depth % 16);
-
if (ioc->reply_post_queue_depth >
facts->MaxReplyDescriptorPostQueueDepth) {
ioc->reply_post_queue_depth =
@@ -3331,7 +3356,7 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc, int sleep_flag)
/* set the scsi host can_queue depth
* with some internal commands that could be outstanding
*/
- ioc->shost->can_queue = ioc->scsiio_depth;
+ ioc->shost->can_queue = ioc->scsiio_depth - INTERNAL_SCSIIO_CMDS_COUNT;
dinitprintk(ioc, pr_info(MPT3SAS_FMT
"scsi host: can_queue depth (%d)\n",
ioc->name, ioc->shost->can_queue));
@@ -3358,8 +3383,8 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc, int sleep_flag)
ioc->chains_needed_per_io, ioc->request_sz, sz/1024);
if (ioc->scsiio_depth < MPT3SAS_SAS_QUEUE_DEPTH)
goto out;
- retry_sz += 64;
- ioc->hba_queue_depth = max_request_credit - retry_sz;
+ retry_sz = 64;
+ ioc->hba_queue_depth -= retry_sz;
goto retry_allocation;
}
@@ -4977,6 +5002,8 @@ _base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc, int sleep_flag)
u32 reply_address;
u16 smid;
struct _tr_list *delayed_tr, *delayed_tr_next;
+ struct _sc_list *delayed_sc, *delayed_sc_next;
+ struct _event_ack_list *delayed_event_ack, *delayed_event_ack_next;
u8 hide_flag;
struct adapter_reply_queue *reply_q;
long reply_post_free;
@@ -4999,6 +5026,18 @@ _base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc, int sleep_flag)
kfree(delayed_tr);
}
+ list_for_each_entry_safe(delayed_sc, delayed_sc_next,
+ &ioc->delayed_sc_list, list) {
+ list_del(&delayed_sc->list);
+ kfree(delayed_sc);
+ }
+
+ list_for_each_entry_safe(delayed_event_ack, delayed_event_ack_next,
+ &ioc->delayed_event_ack_list, list) {
+ list_del(&delayed_event_ack->list);
+ kfree(delayed_event_ack);
+ }
+
/* initialize the scsi lookup free list */
spin_lock_irqsave(&ioc->scsi_lookup_lock, flags);
INIT_LIST_HEAD(&ioc->free_list);
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 2786222..4b52a07 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -122,6 +122,8 @@
#define NO_SLEEP 0
#define INTERNAL_CMDS_COUNT 10 /* reserved cmds */
+/* reserved for issuing internally framed scsi io cmds */
+#define INTERNAL_SCSIIO_CMDS_COUNT 3
#define MPI3_HIM_MASK 0xFFFFFFFF /* mask every bit*/
@@ -677,6 +679,25 @@ struct _tr_list {
u16 state;
};
+/**
+ * struct _sc_list - delayed SAS_IO_UNIT_CONTROL message list
+ * @handle: device handle
+ */
+struct _sc_list {
+ struct list_head list;
+ u16 handle;
+};
+
+/**
+ * struct _event_ack_list - delayed event acknowledgment list
+ * @Event: Event ID
+ * @EventContext: used to track the event uniquely
+ */
+struct _event_ack_list {
+ struct list_head list;
+ u16 Event;
+ u32 EventContext;
+};
/**
* struct adapter_reply_queue - the reply queue struct
@@ -922,6 +943,8 @@ typedef void (*MPT3SAS_FLUSH_RUNNING_CMDS)(struct MPT3SAS_ADAPTER *ioc);
* @replyPostRegisterIndex: index of next position in Reply Desc Post Queue
* @delayed_tr_list: target reset link list
* @delayed_tr_volume_list: volume target reset link list
+ * @delayed_sc_list:
+ * @delayed_event_ack_list:
* @temp_sensors_count: flag to carry the number of temperature sensors
* @pci_access_mutex: Mutex to synchronize ioctl,sysfs show path and
* pci resource handling. PCI resource freeing will lead to free
@@ -1143,6 +1166,8 @@ struct MPT3SAS_ADAPTER {
struct list_head delayed_tr_list;
struct list_head delayed_tr_volume_list;
+ struct list_head delayed_sc_list;
+ struct list_head delayed_event_ack_list;
u8 temp_sensors_count;
struct mutex pci_access_mutex;
@@ -1260,6 +1285,8 @@ void mpt3sas_scsih_clear_tm_flag(struct MPT3SAS_ADAPTER *ioc, u16 handle);
void mpt3sas_expander_remove(struct MPT3SAS_ADAPTER *ioc, u64 sas_address);
void mpt3sas_device_remove_by_sas_address(struct MPT3SAS_ADAPTER *ioc,
u64 sas_address);
+u8 mpt3sas_check_for_pending_internal_cmds(struct MPT3SAS_ADAPTER *ioc,
+ u16 smid);
struct _sas_node *mpt3sas_scsih_expander_find_by_handle(
struct MPT3SAS_ADAPTER *ioc, u16 handle);
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index dcb4c18..b12cada 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -3222,6 +3222,7 @@ _scsih_tm_tr_complete(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
Mpi2SasIoUnitControlRequest_t *mpi_request;
u16 smid_sas_ctrl;
u32 ioc_state;
+ struct _sc_list *delayed_sc;
if (ioc->remove_host) {
dewtprintk(ioc, pr_info(MPT3SAS_FMT
@@ -3264,9 +3265,16 @@ _scsih_tm_tr_complete(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
smid_sas_ctrl = mpt3sas_base_get_smid(ioc, ioc->tm_sas_control_cb_idx);
if (!smid_sas_ctrl) {
- pr_err(MPT3SAS_FMT "%s: failed obtaining a smid\n",
- ioc->name, __func__);
- return 1;
+ delayed_sc = kzalloc(sizeof(*delayed_sc), GFP_ATOMIC);
+ if (!delayed_sc)
+ return _scsih_check_for_pending_tm(ioc, smid);
+ INIT_LIST_HEAD(&delayed_sc->list);
+ delayed_sc->handle = mpi_request_tm->DevHandle;
+ list_add_tail(&delayed_sc->list, &ioc->delayed_sc_list);
+ dewtprintk(ioc, pr_info(MPT3SAS_FMT
+ "DELAYED:sc:handle(0x%04x), (open)\n",
+ ioc->name, handle));
+ return _scsih_check_for_pending_tm(ioc, smid);
}
dewtprintk(ioc, pr_info(MPT3SAS_FMT
@@ -3317,7 +3325,7 @@ _scsih_sas_control_complete(struct MPT3SAS_ADAPTER *ioc, u16 smid,
pr_err(MPT3SAS_FMT "mpi_reply not valid at %s:%d/%s()!\n",
ioc->name, __FILE__, __LINE__, __func__);
}
- return 1;
+ return mpt3sas_check_for_pending_internal_cmds(ioc, smid);
}
/**
@@ -3424,6 +3432,142 @@ _scsih_tm_volume_tr_complete(struct MPT3SAS_ADAPTER *ioc, u16 smid,
return _scsih_check_for_pending_tm(ioc, smid);
}
+/**
+ * _scsih_issue_delayed_event_ack - issue delayed Event ACK messages
+ * @ioc: per adapter object
+ * @smid: system request message index
+ * @event: Event ID
+ * @event_context: used to track events uniquely
+ *
+ * Context - processed in interrupt context.
+ */
+void
+_scsih_issue_delayed_event_ack(struct MPT3SAS_ADAPTER *ioc, u16 smid, u16 event,
+ u32 event_context)
+{
+ Mpi2EventAckRequest_t *ack_request;
+ int i = smid - ioc->internal_smid;
+ unsigned long flags;
+
+ /* Without releasing the smid just update the
+ * call back index and reuse the same smid for
+ * processing this delayed request
+ */
+ spin_lock_irqsave(&ioc->scsi_lookup_lock, flags);
+ ioc->internal_lookup[i].cb_idx = ioc->base_cb_idx;
+ spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags);
+
+ dewtprintk(ioc, pr_info(MPT3SAS_FMT
+ "EVENT ACK: event(0x%04x), smid(%d), cb(%d)\n",
+ ioc->name, le16_to_cpu(event), smid,
+ ioc->base_cb_idx));
+ ack_request = mpt3sas_base_get_msg_frame(ioc, smid);
+ memset(ack_request, 0, sizeof(Mpi2EventAckRequest_t));
+ ack_request->Function = MPI2_FUNCTION_EVENT_ACK;
+ ack_request->Event = event;
+ ack_request->EventContext = event_context;
+ ack_request->VF_ID = 0; /* TODO */
+ ack_request->VP_ID = 0;
+ mpt3sas_base_put_smid_default(ioc, smid);
+}
+
+/**
+ * _scsih_issue_delayed_sas_io_unit_ctrl - issue delayed
+ * sas_io_unit_ctrl messages
+ * @ioc: per adapter object
+ * @smid: system request message index
+ * @handle: device handle
+ *
+ * Context - processed in interrupt context.
+ */
+void
+_scsih_issue_delayed_sas_io_unit_ctrl(struct MPT3SAS_ADAPTER *ioc,
+ u16 smid, u16 handle)
+ {
+ Mpi2SasIoUnitControlRequest_t *mpi_request;
+ u32 ioc_state;
+ int i = smid - ioc->internal_smid;
+ unsigned long flags;
+
+ if (ioc->remove_host) {
+ dewtprintk(ioc, pr_info(MPT3SAS_FMT
+ "%s: host has been removed\n",
+ __func__, ioc->name));
+ return;
+ } else if (ioc->pci_error_recovery) {
+ dewtprintk(ioc, pr_info(MPT3SAS_FMT
+ "%s: host in pci error recovery\n",
+ __func__, ioc->name));
+ return;
+ }
+ ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
+ if (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
+ dewtprintk(ioc, pr_info(MPT3SAS_FMT
+ "%s: host is not operational\n",
+ __func__, ioc->name));
+ return;
+ }
+
+ /* Without releasing the smid just update the
+ * call back index and reuse the same smid for
+ * processing this delayed request
+ */
+ spin_lock_irqsave(&ioc->scsi_lookup_lock, flags);
+ ioc->internal_lookup[i].cb_idx = ioc->tm_sas_control_cb_idx;
+ spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags);
+
+ dewtprintk(ioc, pr_info(MPT3SAS_FMT
+ "sc_send:handle(0x%04x), (open), smid(%d), cb(%d)\n",
+ ioc->name, le16_to_cpu(handle), smid,
+ ioc->tm_sas_control_cb_idx));
+ mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
+ memset(mpi_request, 0, sizeof(Mpi2SasIoUnitControlRequest_t));
+ mpi_request->Function = MPI2_FUNCTION_SAS_IO_UNIT_CONTROL;
+ mpi_request->Operation = MPI2_SAS_OP_REMOVE_DEVICE;
+ mpi_request->DevHandle = handle;
+ mpt3sas_base_put_smid_default(ioc, smid);
+}
+
+/**
+ * _scsih_check_for_pending_internal_cmds - check for pending internal messages
+ * @ioc: per adapter object
+ * @smid: system request message index
+ *
+ * Context: Executed in interrupt context
+ *
+ * This will check delayed internal messages list, and process the
+ * next request.
+ *
+ * Return 1 meaning mf should be freed from _base_interrupt
+ * 0 means the mf is freed from this function.
+ */
+u8
+mpt3sas_check_for_pending_internal_cmds(struct MPT3SAS_ADAPTER *ioc, u16 smid)
+{
+ struct _sc_list *delayed_sc;
+ struct _event_ack_list *delayed_event_ack;
+
+ if (!list_empty(&ioc->delayed_event_ack_list)) {
+ delayed_event_ack = list_entry(ioc->delayed_event_ack_list.next,
+ struct _event_ack_list, list);
+ _scsih_issue_delayed_event_ack(ioc, smid,
+ delayed_event_ack->Event, delayed_event_ack->EventContext);
+ list_del(&delayed_event_ack->list);
+ kfree(delayed_event_ack);
+ return 0;
+ }
+
+ if (!list_empty(&ioc->delayed_sc_list)) {
+ delayed_sc = list_entry(ioc->delayed_sc_list.next,
+ struct _sc_list, list);
+ _scsih_issue_delayed_sas_io_unit_ctrl(ioc, smid,
+ delayed_sc->handle);
+ list_del(&delayed_sc->list);
+ kfree(delayed_sc);
+ return 0;
+ }
+ return 1;
+}
/**
* _scsih_check_for_pending_tm - check for pending task management
@@ -8589,6 +8733,8 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
INIT_LIST_HEAD(&ioc->raid_device_list);
INIT_LIST_HEAD(&ioc->sas_hba.sas_port_list);
INIT_LIST_HEAD(&ioc->delayed_tr_list);
+ INIT_LIST_HEAD(&ioc->delayed_sc_list);
+ INIT_LIST_HEAD(&ioc->delayed_event_ack_list);
INIT_LIST_HEAD(&ioc->delayed_tr_volume_list);
INIT_LIST_HEAD(&ioc->reply_queue_list);
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> |
|---|---|
| Date | 2016-01-28 07:50 +0100 |
| Subject | [mpt3sas driver 02/10] mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP Passthrough request message. |
| Message-ID | <qVOyZ-7VI-1@gated-at.bofh.it> |
| In reply to | #1320339 |
From: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> As driver was using MPI SGL while framing the SMP Passthrough request message due to which firmware unable to post the Reply Data in the host memory and timeout is observed for this SMP Passthrough request message and so unable to perform phy disable operation. Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com> --- drivers/scsi/mpt3sas/mpt3sas_transport.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c index ca36d7e..df08aeb 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_transport.c +++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c @@ -1418,7 +1418,6 @@ _transport_expander_phy_control(struct MPT3SAS_ADAPTER *ioc, u32 ioc_state; unsigned long timeleft; void *psge; - u32 sgl_flags; u8 issue_reset = 0; void *data_out = NULL; dma_addr_t data_out_dma; @@ -1507,24 +1506,10 @@ _transport_expander_phy_control(struct MPT3SAS_ADAPTER *ioc, cpu_to_le16(sizeof(struct phy_error_log_request)); psge = &mpi_request->SGL; - /* WRITE sgel first */ - sgl_flags = (MPI2_SGE_FLAGS_SIMPLE_ELEMENT | - MPI2_SGE_FLAGS_END_OF_BUFFER | MPI2_SGE_FLAGS_HOST_TO_IOC); - sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; - ioc->base_add_sg_single(psge, sgl_flags | - sizeof(struct phy_control_request), data_out_dma); - - /* incr sgel */ - psge += ioc->sge_size; - - /* READ sgel last */ - sgl_flags = (MPI2_SGE_FLAGS_SIMPLE_ELEMENT | - MPI2_SGE_FLAGS_LAST_ELEMENT | MPI2_SGE_FLAGS_END_OF_BUFFER | - MPI2_SGE_FLAGS_END_OF_LIST); - sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; - ioc->base_add_sg_single(psge, sgl_flags | - sizeof(struct phy_control_reply), data_out_dma + - sizeof(struct phy_control_request)); + ioc->build_sg(ioc, psge, data_out_dma, + sizeof(struct phy_control_request), + data_out_dma + sizeof(struct phy_control_request), + sizeof(struct phy_control_reply)); dtransportprintk(ioc, pr_info(MPT3SAS_FMT "phy_control - send to sas_addr(0x%016llx), phy(%d), opcode(%d)\n", -- 1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | Christoph Hellwig <hch@infradead.org> |
|---|---|
| Date | 2016-01-28 10:20 +0100 |
| Subject | Re: [mpt3sas driver 02/10] mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP Passthrough request message. |
| Message-ID | <qVQUb-1eY-27@gated-at.bofh.it> |
| In reply to | #1320347 |
On Thu, Jan 28, 2016 at 12:06:59PM +0530, Suganath prabu Subaramani wrote: > From: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> > > As driver was using MPI SGL while framing the SMP Passthrough request > message due to which firmware unable to post the Reply Data in the host > memory and timeout is observed for this SMP Passthrough request message > and so unable to perform phy disable operation. Does this also do the right thing for MPT2 HBAs?
[toc] | [prev] | [next] | [standalone]
| From | Tomas Henzl <thenzl@redhat.com> |
|---|---|
| Date | 2016-02-04 15:20 +0100 |
| Subject | Re: [mpt3sas driver 02/10] mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP Passthrough request message. |
| Message-ID | <qYsVk-1nc-37@gated-at.bofh.it> |
| In reply to | #1320347 |
On 28.1.2016 07:36, Suganath prabu Subaramani wrote: > From: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> > > As driver was using MPI SGL while framing the SMP Passthrough request > message due to which firmware unable to post the Reply Data in the host > memory and timeout is observed for this SMP Passthrough request message > and so unable to perform phy disable operation. > > Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> > Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com> (when Christopher's question is answered) Reviewed-by: Tomas Henzl <thenzl@redhat.com> Tomas
[toc] | [prev] | [next] | [standalone]
| From | Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> |
|---|---|
| Date | 2016-01-28 07:50 +0100 |
| Subject | [mpt3sas driver 04/10] mpt3sas: Never block the Enclosure device |
| Message-ID | <qVOz0-7VI-19@gated-at.bofh.it> |
| In reply to | #1320339 |
From: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Never block the SEP device (i.e. Never invoke the
scsi_internal_device_block() API for SEP device) even for the delay not
responding events. Blocking the SEP device will create a deadlock while
adding any device to the OS.
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
---
drivers/scsi/mpt3sas/mpt3sas_base.h | 1 +
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 22 +++++++++++++++++++++-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 5ad271e..2786222 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -398,6 +398,7 @@ struct MPT3SAS_DEVICE {
u8 configured_lun;
u8 block;
u8 tlr_snoop_check;
+ u8 ignore_delay_remove;
};
#define MPT3_CMD_NOT_USED 0x8000 /* free */
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 686a46a..dcb4c18 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -1953,7 +1953,15 @@ scsih_slave_configure(struct scsi_device *sdev)
if (sas_device->device_info & MPI2_SAS_DEVICE_INFO_SSP_TARGET) {
qdepth = MPT3SAS_SAS_QUEUE_DEPTH;
ssp_target = 1;
- ds = "SSP";
+ if (sas_device->device_info &
+ MPI2_SAS_DEVICE_INFO_SEP) {
+ sdev_printk(KERN_WARNING, sdev,
+ "set ignore_delay_remove for handle(0x%04x)\n",
+ sas_device_priv_data->sas_target->handle);
+ sas_device_priv_data->ignore_delay_remove = 1;
+ ds = "SES";
+ } else
+ ds = "SSP";
} else {
qdepth = MPT3SAS_SATA_QUEUE_DEPTH;
if (sas_device->device_info & MPI2_SAS_DEVICE_INFO_STP_TARGET)
@@ -2943,6 +2951,12 @@ _scsih_block_io_all_device(struct MPT3SAS_ADAPTER *ioc)
continue;
if (sas_device_priv_data->block)
continue;
+ if (sas_device_priv_data->ignore_delay_remove) {
+ sdev_printk(KERN_INFO, sdev,
+ "%s skip device_block for SES handle(0x%04x)\n",
+ __func__, sas_device_priv_data->sas_target->handle);
+ continue;
+ }
_scsih_internal_device_block(sdev, sas_device_priv_data);
}
}
@@ -2975,6 +2989,12 @@ _scsih_block_io_device(struct MPT3SAS_ADAPTER *ioc, u16 handle)
continue;
if (sas_device->pend_sas_rphy_add)
continue;
+ if (sas_device_priv_data->ignore_delay_remove) {
+ sdev_printk(KERN_INFO, sdev,
+ "%s skip device_block for SES handle(0x%04x)\n",
+ __func__, sas_device_priv_data->sas_target->handle);
+ continue;
+ }
_scsih_internal_device_block(sdev, sas_device_priv_data);
}
--
1.8.3.1
[toc] | [prev] | [next] | [standalone]
| From | Tomas Henzl <thenzl@redhat.com> |
|---|---|
| Date | 2016-02-04 15:40 +0100 |
| Subject | Re: [mpt3sas driver 04/10] mpt3sas: Never block the Enclosure device |
| Message-ID | <qYteG-3bN-13@gated-at.bofh.it> |
| In reply to | #1320351 |
On 28.1.2016 07:37, Suganath prabu Subaramani wrote: > From: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> > > Never block the SEP device (i.e. Never invoke the > scsi_internal_device_block() API for SEP device) even for the delay not > responding events. Blocking the SEP device will create a deadlock while > adding any device to the OS. > > Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> > Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Tomas
[toc] | [prev] | [next] | [standalone]
| From | Tomas Henzl <thenzl@redhat.com> |
|---|---|
| Date | 2016-02-04 15:20 +0100 |
| Subject | Re: [mpt3sas driver 01/10] mpt3sas: Added support for high port count HBA variants. |
| Message-ID | <qYsVj-1nc-3@gated-at.bofh.it> |
| In reply to | #1320339 |
On 28.1.2016 07:36, Suganath prabu Subaramani wrote: > From: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> > > Updated hardware description headers with MPI v2.6 and mpt3sas_pci_table[] > with vendor_ids,device_ids of Cutlass and Intruder HBA which has support > for 4 ports > > Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> > Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Tomas
[toc] | [prev] | [next] | [standalone]
| From | "Martin K. Petersen" <martin.petersen@oracle.com> |
|---|---|
| Date | 2016-02-05 03:10 +0100 |
| Message-ID | <qYE0q-24P-1@gated-at.bofh.it> |
| In reply to | #1320339 |
>>>>> "Suganath" == Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> writes: Suganath> Posting 10 patches for mpt3sas driver enhancements and few Suganath> fixes. Please address Tomas' comments to patches 6 and 7 and resubmit. Thank you! -- Martin K. Petersen Oracle Linux Engineering
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web