Skip to content

Commit 72810bd

Browse files
committed
Merge: mpt3sas: Driver update
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6743 JIRA: https://issues.redhat.com/browse/RHEL-81907 scsi: mpt3sas driver update Upstream Status: Accepted Tested: Compiled and tested on Local Development Setup Signed-off-by: Chandrakanth Patil <chanpati@redhat.com> Approved-by: Tomas Henzl <thenzl@redhat.com> Approved-by: Ewan D. Milne <emilne@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents ce052ea + 6e93f1e commit 72810bd

File tree

17 files changed

+436
-116
lines changed

17 files changed

+436
-116
lines changed

drivers/scsi/aacraid/linit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2023,7 +2023,7 @@ static void aac_pci_resume(struct pci_dev *pdev)
20232023
dev_err(&pdev->dev, "aacraid: PCI error - resume\n");
20242024
}
20252025

2026-
static struct pci_error_handlers aac_pci_err_handler = {
2026+
static const struct pci_error_handlers aac_pci_err_handler = {
20272027
.error_detected = aac_pci_error_detected,
20282028
.mmio_enabled = aac_pci_mmio_enabled,
20292029
.slot_reset = aac_pci_slot_reset,

drivers/scsi/be2iscsi/be_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5775,7 +5775,7 @@ static void beiscsi_remove(struct pci_dev *pcidev)
57755775
}
57765776

57775777

5778-
static struct pci_error_handlers beiscsi_eeh_handlers = {
5778+
static const struct pci_error_handlers beiscsi_eeh_handlers = {
57795779
.error_detected = beiscsi_eeh_err_detected,
57805780
.slot_reset = beiscsi_eeh_reset,
57815781
.resume = beiscsi_eeh_resume,

drivers/scsi/bfa/bfad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,7 @@ MODULE_DEVICE_TABLE(pci, bfad_id_table);
16681668
/*
16691669
* PCI error recovery handlers.
16701670
*/
1671-
static struct pci_error_handlers bfad_err_handler = {
1671+
static const struct pci_error_handlers bfad_err_handler = {
16721672
.error_detected = bfad_pci_error_detected,
16731673
.slot_reset = bfad_pci_slot_reset,
16741674
.mmio_enabled = bfad_pci_mmio_enabled,

drivers/scsi/csiostor/csio_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ csio_pci_resume(struct pci_dev *pdev)
11611161
dev_err(&pdev->dev, "resume of device failed: %d\n", rv);
11621162
}
11631163

1164-
static struct pci_error_handlers csio_err_handler = {
1164+
static const struct pci_error_handlers csio_err_handler = {
11651165
.error_detected = csio_pci_error_detected,
11661166
.slot_reset = csio_pci_slot_reset,
11671167
.resume = csio_pci_resume,

drivers/scsi/elx/efct/efct_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ efct_pci_io_resume(struct pci_dev *pdev)
739739

740740
MODULE_DEVICE_TABLE(pci, efct_pci_table);
741741

742-
static struct pci_error_handlers efct_pci_err_handler = {
742+
static const struct pci_error_handlers efct_pci_err_handler = {
743743
.error_detected = efct_pci_io_error_detected,
744744
.slot_reset = efct_pci_io_slot_reset,
745745
.resume = efct_pci_io_resume,

drivers/scsi/mpi3mr/mpi3mr_os.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5935,7 +5935,7 @@ static const struct pci_device_id mpi3mr_pci_id_table[] = {
59355935
};
59365936
MODULE_DEVICE_TABLE(pci, mpi3mr_pci_id_table);
59375937

5938-
static struct pci_error_handlers mpi3mr_err_handler = {
5938+
static const struct pci_error_handlers mpi3mr_err_handler = {
59395939
.error_detected = mpi3mr_pcierr_error_detected,
59405940
.mmio_enabled = mpi3mr_pcierr_mmio_enabled,
59415941
.slot_reset = mpi3mr_pcierr_slot_reset,

drivers/scsi/mpt3sas/mpi/mpi2.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@
125125
* 06-24-19 02.00.55 Bumped MPI2_HEADER_VERSION_UNIT
126126
* 08-01-19 02.00.56 Bumped MPI2_HEADER_VERSION_UNIT
127127
* 10-02-19 02.00.57 Bumped MPI2_HEADER_VERSION_UNIT
128+
* 07-20-20 02.00.58 Bumped MPI2_HEADER_VERSION_UNIT
129+
* 03-30-21 02.00.59 Bumped MPI2_HEADER_VERSION_UNIT
130+
* 06-03-22 02.00.60 Bumped MPI2_HEADER_VERSION_UNIT
131+
* 09-20-23 02.00.61 Bumped MPI2_HEADER_VERSION_UNIT
132+
* 09-13-24 02.00.62 Bumped MPI2_HEADER_VERSION_UNIT
133+
* Added MPI2_FUNCTION_MCTP_PASSTHROUGH
128134
* --------------------------------------------------------------------------
129135
*/
130136

@@ -165,7 +171,7 @@
165171

166172

167173
/* Unit and Dev versioning for this MPI header set */
168-
#define MPI2_HEADER_VERSION_UNIT (0x39)
174+
#define MPI2_HEADER_VERSION_UNIT (0x3E)
169175
#define MPI2_HEADER_VERSION_DEV (0x00)
170176
#define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00)
171177
#define MPI2_HEADER_VERSION_UNIT_SHIFT (8)
@@ -669,6 +675,7 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UNION {
669675
#define MPI2_FUNCTION_PWR_MGMT_CONTROL (0x30)
670676
#define MPI2_FUNCTION_SEND_HOST_MESSAGE (0x31)
671677
#define MPI2_FUNCTION_NVME_ENCAPSULATED (0x33)
678+
#define MPI2_FUNCTION_MCTP_PASSTHROUGH (0x34)
672679
#define MPI2_FUNCTION_MIN_PRODUCT_SPECIFIC (0xF0)
673680
#define MPI2_FUNCTION_MAX_PRODUCT_SPECIFIC (0xFF)
674681

drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@
251251
* 12-17-18 02.00.47 Swap locations of Slotx2 and Slotx4 in ManPage 7.
252252
* 08-01-19 02.00.49 Add MPI26_MANPAGE7_FLAG_X2_X4_SLOT_INFO_VALID
253253
* Add MPI26_IOUNITPAGE1_NVME_WRCACHE_SHIFT
254+
* 09-13-24 02.00.50 Added PCIe 32 GT/s link rate
254255
*/
255256

256257
#ifndef MPI2_CNFG_H
@@ -606,7 +607,7 @@ typedef struct _MPI2_CONFIG_REPLY {
606607

607608
typedef struct _MPI2_CONFIG_PAGE_MAN_0 {
608609
MPI2_CONFIG_PAGE_HEADER Header; /*0x00 */
609-
U8 ChipName[16]; /*0x04 */
610+
U8 ChipName[16] __nonstring; /*0x04 */
610611
U8 ChipRevision[8]; /*0x14 */
611612
U8 BoardName[16]; /*0x1C */
612613
U8 BoardAssembly[16]; /*0x2C */
@@ -1121,6 +1122,7 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_7 {
11211122
#define MPI2_IOUNITPAGE7_PCIE_SPEED_5_0_GBPS (0x01)
11221123
#define MPI2_IOUNITPAGE7_PCIE_SPEED_8_0_GBPS (0x02)
11231124
#define MPI2_IOUNITPAGE7_PCIE_SPEED_16_0_GBPS (0x03)
1125+
#define MPI2_IOUNITPAGE7_PCIE_SPEED_32_0_GBPS (0x04)
11241126

11251127
/*defines for IO Unit Page 7 ProcessorState field */
11261128
#define MPI2_IOUNITPAGE7_PSTATE_MASK_SECOND (0x0000000F)
@@ -2301,6 +2303,7 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_1 {
23012303
#define MPI2_SASIOUNIT1_CONTROL_CLEAR_AFFILIATION (0x0001)
23022304

23032305
/*values for SAS IO Unit Page 1 AdditionalControlFlags */
2306+
#define MPI2_SASIOUNIT1_ACONTROL_PROD_SPECIFIC_1 (0x8000)
23042307
#define MPI2_SASIOUNIT1_ACONTROL_DA_PERSIST_CONNECT (0x0100)
23052308
#define MPI2_SASIOUNIT1_ACONTROL_MULTI_PORT_DOMAIN_ILLEGAL (0x0080)
23062309
#define MPI2_SASIOUNIT1_ACONTROL_SATA_ASYNCHROUNOUS_NOTIFICATION (0x0040)
@@ -3591,6 +3594,7 @@ typedef struct _MPI2_CONFIG_PAGE_EXT_MAN_PS {
35913594
#define MPI26_PCIE_NEG_LINK_RATE_5_0 (0x03)
35923595
#define MPI26_PCIE_NEG_LINK_RATE_8_0 (0x04)
35933596
#define MPI26_PCIE_NEG_LINK_RATE_16_0 (0x05)
3597+
#define MPI26_PCIE_NEG_LINK_RATE_32_0 (0x06)
35943598

35953599

35963600
/****************************************************************************
@@ -3700,6 +3704,7 @@ typedef struct _MPI26_CONFIG_PAGE_PIOUNIT_1 {
37003704
#define MPI26_PCIEIOUNIT1_MAX_RATE_5_0 (0x30)
37013705
#define MPI26_PCIEIOUNIT1_MAX_RATE_8_0 (0x40)
37023706
#define MPI26_PCIEIOUNIT1_MAX_RATE_16_0 (0x50)
3707+
#define MPI26_PCIEIOUNIT1_MAX_RATE_32_0 (0x60)
37033708

37043709
/*values for PCIe IO Unit Page 1 DMDReportPCIe */
37053710
#define MPI26_PCIEIOUNIT1_DMDRPT_UNIT_MASK (0x80)

drivers/scsi/mpt3sas/mpi/mpi2_ioc.h

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
* Added MPI26_IOCFACTS_CAPABILITY_COREDUMP_ENABLED
180180
* Added MPI2_FW_DOWNLOAD_ITYPE_COREDUMP
181181
* Added MPI2_FW_UPLOAD_ITYPE_COREDUMP
182+
* 9-13-24 02.00.39 Added MPI26_MCTP_PASSTHROUGH messages
182183
* --------------------------------------------------------------------------
183184
*/
184185

@@ -382,6 +383,7 @@ typedef struct _MPI2_IOC_FACTS_REPLY {
382383
/*ProductID field uses MPI2_FW_HEADER_PID_ */
383384

384385
/*IOCCapabilities */
386+
#define MPI26_IOCFACTS_CAPABILITY_MCTP_PASSTHRU (0x00800000)
385387
#define MPI26_IOCFACTS_CAPABILITY_COREDUMP_ENABLED (0x00200000)
386388
#define MPI26_IOCFACTS_CAPABILITY_PCIE_SRIOV (0x00100000)
387389
#define MPI26_IOCFACTS_CAPABILITY_ATOMIC_REQ (0x00080000)
@@ -1798,5 +1800,57 @@ typedef struct _MPI26_IOUNIT_CONTROL_REPLY {
17981800
Mpi26IoUnitControlReply_t,
17991801
*pMpi26IoUnitControlReply_t;
18001802

1803+
/****************************************************************************
1804+
* MCTP Passthrough messages (MPI v2.6 and later only.)
1805+
****************************************************************************/
1806+
1807+
/* MCTP Passthrough Request Message */
1808+
typedef struct _MPI26_MCTP_PASSTHROUGH_REQUEST {
1809+
U8 MsgContext; /* 0x00 */
1810+
U8 Reserved1[2]; /* 0x01 */
1811+
U8 Function; /* 0x03 */
1812+
U8 Reserved2[3]; /* 0x04 */
1813+
U8 MsgFlags; /* 0x07 */
1814+
U8 VP_ID; /* 0x08 */
1815+
U8 VF_ID; /* 0x09 */
1816+
U16 Reserved3; /* 0x0A */
1817+
U32 Reserved4; /* 0x0C */
1818+
U8 Flags; /* 0x10 */
1819+
U8 Reserved5[3]; /* 0x11 */
1820+
U32 Reserved6; /* 0x14 */
1821+
U32 H2DLength; /* 0x18 */
1822+
U32 D2HLength; /* 0x1C */
1823+
MPI25_SGE_IO_UNION H2DSGL; /* 0x20 */
1824+
MPI25_SGE_IO_UNION D2HSGL; /* 0x30 */
1825+
} MPI26_MCTP_PASSTHROUGH_REQUEST,
1826+
*PTR_MPI26_MCTP_PASSTHROUGH_REQUEST,
1827+
Mpi26MctpPassthroughRequest_t,
1828+
*pMpi26MctpPassthroughRequest_t;
1829+
1830+
/* values for the MsgContext field */
1831+
#define MPI26_MCTP_MSG_CONEXT_UNUSED (0x00)
1832+
1833+
/* values for the Flags field */
1834+
#define MPI26_MCTP_FLAGS_MSG_FORMAT_MPT (0x01)
1835+
1836+
/* MCTP Passthrough Reply Message */
1837+
typedef struct _MPI26_MCTP_PASSTHROUGH_REPLY {
1838+
U8 MsgContext; /* 0x00 */
1839+
U8 Reserved1; /* 0x01 */
1840+
U8 MsgLength; /* 0x02 */
1841+
U8 Function; /* 0x03 */
1842+
U8 Reserved2[3]; /* 0x04 */
1843+
U8 MsgFlags; /* 0x07 */
1844+
U8 VP_ID; /* 0x08 */
1845+
U8 VF_ID; /* 0x09 */
1846+
U16 Reserved3; /* 0x0A */
1847+
U16 Reserved4; /* 0x0C */
1848+
U16 IOCStatus; /* 0x0E */
1849+
U32 IOCLogInfo; /* 0x10 */
1850+
U32 ResponseDataLength; /* 0x14 */
1851+
} MPI26_MCTP_PASSTHROUGH_REPLY,
1852+
*PTR_MPI26_MCTP_PASSTHROUGH_REPLY,
1853+
Mpi26MctpPassthroughReply_t,
1854+
*pMpi26MctpPassthroughReply_t;
18011855

18021856
#endif

drivers/scsi/mpt3sas/mpt3sas_base.c

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,11 @@ _base_sas_ioc_info(struct MPT3SAS_ADAPTER *ioc, MPI2DefaultReply_t *mpi_reply,
12021202
ioc->sge_size;
12031203
func_str = "nvme_encapsulated";
12041204
break;
1205+
case MPI2_FUNCTION_MCTP_PASSTHROUGH:
1206+
frame_sz = sizeof(Mpi26MctpPassthroughRequest_t) +
1207+
ioc->sge_size;
1208+
func_str = "mctp_passthru";
1209+
break;
12051210
default:
12061211
frame_sz = 32;
12071212
func_str = "unknown";
@@ -4874,6 +4879,12 @@ _base_display_ioc_capabilities(struct MPT3SAS_ADAPTER *ioc)
48744879
i++;
48754880
}
48764881

4882+
if (ioc->facts.IOCCapabilities &
4883+
MPI26_IOCFACTS_CAPABILITY_MCTP_PASSTHRU) {
4884+
pr_cont("%sMCTP Passthru", i ? "," : "");
4885+
i++;
4886+
}
4887+
48774888
iounit_pg1_flags = le32_to_cpu(ioc->iounit_pg1.Flags);
48784889
if (!(iounit_pg1_flags & MPI2_IOUNITPAGE1_NATIVE_COMMAND_Q_DISABLE)) {
48794890
pr_cont("%sNCQ", i ? "," : "");
@@ -5627,10 +5638,9 @@ _base_static_config_pages(struct MPT3SAS_ADAPTER *ioc)
56275638
if (rc)
56285639
return rc;
56295640
if (!ioc->is_gen35_ioc && ioc->manu_pg11.EEDPTagMode == 0) {
5630-
pr_err("%s: overriding NVDATA EEDPTagMode setting\n",
5641+
pr_err("%s: overriding NVDATA EEDPTagMode setting from 0 to 1\n",
56315642
ioc->name);
5632-
ioc->manu_pg11.EEDPTagMode &= ~0x3;
5633-
ioc->manu_pg11.EEDPTagMode |= 0x1;
5643+
ioc->manu_pg11.EEDPTagMode = 0x1;
56345644
mpt3sas_config_set_manufacturing_pg11(ioc, &mpi_reply,
56355645
&ioc->manu_pg11);
56365646
}
@@ -7041,11 +7051,12 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes,
70417051
int i;
70427052
u8 failed;
70437053
__le32 *mfp;
7054+
int ret_val;
70447055

70457056
/* make sure doorbell is not in use */
70467057
if ((ioc->base_readl_ext_retry(&ioc->chip->Doorbell) & MPI2_DOORBELL_USED)) {
70477058
ioc_err(ioc, "doorbell is in use (line=%d)\n", __LINE__);
7048-
return -EFAULT;
7059+
goto doorbell_diag_reset;
70497060
}
70507061

70517062
/* clear pending doorbell interrupts from previous state changes */
@@ -7135,6 +7146,10 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes,
71357146
le32_to_cpu(mfp[i]));
71367147
}
71377148
return 0;
7149+
7150+
doorbell_diag_reset:
7151+
ret_val = _base_diag_reset(ioc);
7152+
return ret_val;
71387153
}
71397154

71407155
/**
@@ -8014,7 +8029,7 @@ _base_diag_reset(struct MPT3SAS_ADAPTER *ioc)
80148029

80158030
mutex_lock(&ioc->hostdiag_unlock_mutex);
80168031
if (mpt3sas_base_unlock_and_get_host_diagnostic(ioc, &host_diagnostic))
8017-
goto out;
8032+
goto unlock;
80188033

80198034
hcb_size = ioc->base_readl(&ioc->chip->HCBSize);
80208035
drsprintk(ioc, ioc_info(ioc, "diag reset: issued\n"));
@@ -8034,7 +8049,7 @@ _base_diag_reset(struct MPT3SAS_ADAPTER *ioc)
80348049
ioc_info(ioc,
80358050
"Invalid host diagnostic register value\n");
80368051
_base_dump_reg_set(ioc);
8037-
goto out;
8052+
goto unlock;
80388053
}
80398054
if (!(host_diagnostic & MPI2_DIAG_RESET_ADAPTER))
80408055
break;
@@ -8070,17 +8085,19 @@ _base_diag_reset(struct MPT3SAS_ADAPTER *ioc)
80708085
ioc_err(ioc, "%s: failed going to ready state (ioc_state=0x%x)\n",
80718086
__func__, ioc_state);
80728087
_base_dump_reg_set(ioc);
8073-
goto out;
8088+
goto fail;
80748089
}
80758090

80768091
pci_cfg_access_unlock(ioc->pdev);
80778092
ioc_info(ioc, "diag reset: SUCCESS\n");
80788093
return 0;
80798094

8080-
out:
8095+
unlock:
8096+
mutex_unlock(&ioc->hostdiag_unlock_mutex);
8097+
8098+
fail:
80818099
pci_cfg_access_unlock(ioc->pdev);
80828100
ioc_err(ioc, "diag reset: FAILED\n");
8083-
mutex_unlock(&ioc->hostdiag_unlock_mutex);
80848101
return -EFAULT;
80858102
}
80868103

0 commit comments

Comments
 (0)