Skip to contentSkip to conversation

mpi3mr: Add support for Broadcom SAS5116 IO/RAID controllers

PATCH In review Sumit Saxena 1 participant 7 messages Nov 23, 2023

Subsystems (2)
lore
Share & tools
lore

Sumit Saxena

author maintainer
#0 lore raw

cover mpi3mr: Add support for Broadcom SAS5116 IO/RAID controllers

These patches add support for Broadcom's SAS5116 IO/RAID controllers in mpi3mr driver.

Sumit Saxena (5):
mpi3mr: Add support for SAS5116 PCI IDs
mpi3mr: Add PCI checks where SAS5116 diverges from SAS4116
mpi3mr: Increase maximum number of PHYs to 64 from 32
mpi3mr: Add support for status reply descriptor
mpi3mr: driver version upgrade to 8.5.0.0.50

 drivers/scsi/mpi3mr/mpi/mpi30_ioc.h    |  1 +
 drivers/scsi/mpi3mr/mpi3mr.h           |  6 +++---
 drivers/scsi/mpi3mr/mpi3mr_fw.c        |  6 +++++-
 drivers/scsi/mpi3mr/mpi3mr_os.c        | 13 ++++++++++++-
 drivers/scsi/mpi3mr/mpi3mr_transport.c | 16 ++++++++--------
 5 files changed, 29 insertions(+), 13 deletions(-)
Signature · 1 line
2.18.1
author maintainer
#1 lore raw

PATCH 1/5 mpi3mr: Add support for SAS5116 PCI IDs

Add support for Broadcom's SAS5116 IO/RAID controllers PCI IDs.

---
 drivers/scsi/mpi3mr/mpi3mr_os.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/scsi/mpi3mr/mpi3mr_os.c +8 -0
index 040031eb0c12..a8d7dbf0159a 100644
@@ -5430,6 +5430,14 @@ static const struct pci_device_id mpi3mr_pci_id_table[] = {
 		PCI_DEVICE_SUB(MPI3_MFGPAGE_VENDORID_BROADCOM,
 		    MPI3_MFGPAGE_DEVID_SAS4116, PCI_ANY_ID, PCI_ANY_ID)
 	},
+	{
+		PCI_DEVICE_SUB(MPI3_MFGPAGE_VENDORID_BROADCOM,
+		    MPI3_MFGPAGE_DEVID_SAS5116_MPI, PCI_ANY_ID, PCI_ANY_ID)
+	},
+	{
+		PCI_DEVICE_SUB(MPI3_MFGPAGE_VENDORID_BROADCOM,
+		    MPI3_MFGPAGE_DEVID_SAS5116_MPI_MGMT, PCI_ANY_ID, PCI_ANY_ID)
+	},
 	{ 0 }
 };
 MODULE_DEVICE_TABLE(pci, mpi3mr_pci_id_table);
Signature · 1 line
2.18.1
author maintainer
#2 lore raw

PATCH 2/5 mpi3mr: Add PCI checks where SAS5116 diverges from SAS4116

In reply to Sumit Saxena

Added PCI IDs checks for the cases where SAS5116 diverges from SAS4116 in behavior.

---
 drivers/scsi/mpi3mr/mpi3mr_fw.c | 3 ++-
 drivers/scsi/mpi3mr/mpi3mr_os.c | 5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/scsi/mpi3mr/mpi3mr_fw.c +2 -1
index f039f1d98647..0d148c39ebcc 100644
@@ -1892,7 +1892,8 @@ static int mpi3mr_create_op_reply_q(struct mpi3mr_ioc *mrioc, u16 qidx)
 
 	reply_qid = qidx + 1;
 	op_reply_q->num_replies = MPI3MR_OP_REP_Q_QD;
-	if (!mrioc->pdev->revision)
+	if ((mrioc->pdev->device == MPI3_MFGPAGE_DEVID_SAS4116) &&
+		!mrioc->pdev->revision)
 		op_reply_q->num_replies = MPI3MR_OP_REP_Q_QD4K;
 	op_reply_q->ci = 0;
 	op_reply_q->ephase = 1;
drivers/scsi/mpi3mr/mpi3mr_os.c +4 -1
index a8d7dbf0159a..91a22e6e5c3f 100644
@@ -5101,7 +5101,10 @@ mpi3mr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		mpi3mr_init_drv_cmd(&mrioc->evtack_cmds[i],
 				    MPI3MR_HOSTTAG_EVTACKCMD_MIN + i);
 
-	if (pdev->revision)
+	if ((pdev->device == MPI3_MFGPAGE_DEVID_SAS4116) &&
+		!pdev->revision)
+		mrioc->enable_segqueue = false;
+	else
 		mrioc->enable_segqueue = true;
 
 	init_waitqueue_head(&mrioc->reset_waitq);
Signature · 1 line
2.18.1
author maintainer
#3 lore raw

PATCH 3/5 mpi3mr: Increase maximum number of PHYs to 64 from 32

In reply to Sumit Saxena

SAS5116 controllers supports maximum 48 physical PHYs. Driver is modified to accommodate up to 64 PHYs(though current need is to support 48 PHYs).

---
 drivers/scsi/mpi3mr/mpi3mr.h           |  2 +-
 drivers/scsi/mpi3mr/mpi3mr_transport.c | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/scsi/mpi3mr/mpi3mr.h +1 -1
index ae98d15c30b1..7658e8aaadbe 100644
@@ -506,7 +506,7 @@ struct mpi3mr_sas_port {
 	u8 num_phys;
 	u8 marked_responding;
 	int lowest_phy;
-	u32 phy_mask;
+	u64 phy_mask;
 	struct mpi3mr_hba_port *hba_port;
 	struct sas_identify remote_identify;
 	struct sas_rphy *rphy;
drivers/scsi/mpi3mr/mpi3mr_transport.c +8 -8
index 82b55e955730..c0c8ab586957 100644
@@ -1587,7 +1587,7 @@ static void mpi3mr_sas_port_remove(struct mpi3mr_ioc *mrioc, u64 sas_address,
  */
 struct host_port {
 	u64	sas_address;
-	u32	phy_mask;
+	u64	phy_mask;
 	u16	handle;
 	u8	iounit_port_id;
 	u8	used;
@@ -1611,7 +1611,7 @@ mpi3mr_update_mr_sas_port(struct mpi3mr_ioc *mrioc, struct host_port *h_port,
 	struct mpi3mr_sas_port *mr_sas_port)
 {
 	struct mpi3mr_sas_phy *mr_sas_phy;
-	u32 phy_mask_xor;
+	u64 phy_mask_xor;
 	u64 phys_to_be_added, phys_to_be_removed;
 	int i;
 
@@ -1619,7 +1619,7 @@ mpi3mr_update_mr_sas_port(struct mpi3mr_ioc *mrioc, struct host_port *h_port,
 	mr_sas_port->marked_responding = 1;
 
 	dev_info(&mr_sas_port->port->dev,
-	    "sas_address(0x%016llx), old: port_id %d phy_mask 0x%x, new: port_id %d phy_mask:0x%x\n",
+	    "sas_address(0x%016llx), old: port_id %d phy_mask 0x%llx, new: port_id %d phy_mask:0x%llx\n",
 	    mr_sas_port->remote_identify.sas_address,
 	    mr_sas_port->hba_port->port_id, mr_sas_port->phy_mask,
 	    h_port->iounit_port_id, h_port->phy_mask);
@@ -1637,7 +1637,7 @@ mpi3mr_update_mr_sas_port(struct mpi3mr_ioc *mrioc, struct host_port *h_port,
 	 * if these phys are previously registered with another port
 	 * then delete these phys from that port first.
 	 */
-	for_each_set_bit(i, (ulong *) &phys_to_be_added, BITS_PER_TYPE(u32)) {
+	for_each_set_bit(i, (ulong *) &phys_to_be_added, BITS_PER_TYPE(u64)) {
 		mr_sas_phy = &mrioc->sas_hba.phy[i];
 		if (mr_sas_phy->phy_belongs_to_port)
 			mpi3mr_del_phy_from_an_existing_port(mrioc,
@@ -1649,7 +1649,7 @@ mpi3mr_update_mr_sas_port(struct mpi3mr_ioc *mrioc, struct host_port *h_port,
 	}
 
 	/* Delete the phys which are not part of current mr_sas_port's port. */
-	for_each_set_bit(i, (ulong *) &phys_to_be_removed, BITS_PER_TYPE(u32)) {
+	for_each_set_bit(i, (ulong *) &phys_to_be_removed, BITS_PER_TYPE(u64)) {
 		mr_sas_phy = &mrioc->sas_hba.phy[i];
 		if (mr_sas_phy->phy_belongs_to_port)
 			mpi3mr_del_phy_from_an_existing_port(mrioc,
@@ -1671,7 +1671,7 @@ mpi3mr_update_mr_sas_port(struct mpi3mr_ioc *mrioc, struct host_port *h_port,
 void
 mpi3mr_refresh_sas_ports(struct mpi3mr_ioc *mrioc)
 {
-	struct host_port h_port[32];
+	struct host_port h_port[64];
 	int i, j, found, host_port_count = 0, port_idx;
 	u16 sz, attached_handle, ioc_status;
 	struct mpi3_sas_io_unit_page0 *sas_io_unit_pg0 = NULL;
@@ -1742,7 +1742,7 @@ mpi3mr_refresh_sas_ports(struct mpi3mr_ioc *mrioc)
 		list_for_each_entry(mr_sas_port, &mrioc->sas_hba.sas_port_list,
 		    port_list) {
 			ioc_info(mrioc,
-			    "port_id:%d, sas_address:(0x%016llx), phy_mask:(0x%x), lowest phy id:%d\n",
+			    "port_id:%d, sas_address:(0x%016llx), phy_mask:(0x%llx), lowest phy id:%d\n",
 			    mr_sas_port->hba_port->port_id,
 			    mr_sas_port->remote_identify.sas_address,
 			    mr_sas_port->phy_mask, mr_sas_port->lowest_phy);
@@ -1751,7 +1751,7 @@ mpi3mr_refresh_sas_ports(struct mpi3mr_ioc *mrioc)
 		ioc_info(mrioc, "Host port details after reset\n");
 		for (i = 0; i < host_port_count; i++) {
 			ioc_info(mrioc,
-			    "port_id:%d, sas_address:(0x%016llx), phy_mask:(0x%x), lowest phy id:%d\n",
+			    "port_id:%d, sas_address:(0x%016llx), phy_mask:(0x%llx), lowest phy id:%d\n",
 			    h_port[i].iounit_port_id, h_port[i].sas_address,
 			    h_port[i].phy_mask, h_port[i].lowest_phy);
 		}
Signature · 1 line
2.18.1
author maintainer
#4 lore raw

PATCH 4/5 mpi3mr: Add support for status reply descriptor

In reply to Sumit Saxena

Inform controller firmware that driver supports status reply descriptor.

---
 drivers/scsi/mpi3mr/mpi/mpi30_ioc.h | 1 +
 drivers/scsi/mpi3mr/mpi3mr_fw.c     | 3 +++
 2 files changed, 4 insertions(+)
drivers/scsi/mpi3mr/mpi/mpi30_ioc.h +1 -0
index 1e4a60fc655f..0cb24fc03620 100644
@@ -28,6 +28,7 @@ struct mpi3_ioc_init_request {
 	__le64                   driver_information_address;
 };
 
+#define MPI3_IOCINIT_MSGFLAGS_SCSIIOSTATUSREPLY_SUPPORTED	(0x04)
 #define MPI3_IOCINIT_MSGFLAGS_HOSTMETADATA_MASK          (0x03)
 #define MPI3_IOCINIT_MSGFLAGS_HOSTMETADATA_NOT_USED      (0x00)
 #define MPI3_IOCINIT_MSGFLAGS_HOSTMETADATA_SEPARATED     (0x01)
drivers/scsi/mpi3mr/mpi3mr_fw.c +3 -0
index 0d148c39ebcc..1ad2f88e0528 100644
@@ -3194,6 +3194,9 @@ static int mpi3mr_issue_iocinit(struct mpi3mr_ioc *mrioc)
 	current_time = ktime_get_real();
 	iocinit_req.time_stamp = cpu_to_le64(ktime_to_ms(current_time));
 
+	iocinit_req.msg_flags |=
+	    MPI3_IOCINIT_MSGFLAGS_SCSIIOSTATUSREPLY_SUPPORTED;
+
 	init_completion(&mrioc->init_cmds.done);
 	retval = mpi3mr_admin_request_post(mrioc, &iocinit_req,
 	    sizeof(iocinit_req), 1);
Signature · 1 line
2.18.1
author maintainer
#5 lore raw

PATCH 5/5 mpi3mr: driver version upgrade to 8.5.0.0.50

In reply to Sumit Saxena

Update driver version to 8.5.0.0.50.

---
 drivers/scsi/mpi3mr/mpi3mr.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/mpi3mr/mpi3mr.h +2 -2
index 7658e8aaadbe..4f49f8396309 100644
@@ -55,8 +55,8 @@ extern struct list_head mrioc_list;
 extern int prot_mask;
 extern atomic64_t event_counter;
 
-#define MPI3MR_DRIVER_VERSION	"8.5.0.0.0"
-#define MPI3MR_DRIVER_RELDATE	"24-July-2023"
+#define MPI3MR_DRIVER_VERSION	"8.5.0.0.50"
+#define MPI3MR_DRIVER_RELDATE	"22-November-2023"
 
 #define MPI3MR_DRIVER_NAME	"mpi3mr"
 #define MPI3MR_DRIVER_LICENSE	"GPL"
Signature · 1 line
2.18.1
author maintainer
#6 lore raw
In reply to Sumit Saxena
Quoted 4 lines · Sumit Saxena

These patches add support for Broadcom's SAS5116 IO/RAID controllers in mpi3mr driver.

Please ignore this email. Copy/Paste error leads to sending with the wrong email id of Martin.
Apologies for the spamming.