Skip to content

Commit e5e11f6

Browse files
Merge patch series "mpi3mr: bug fixes and minor updates"
Chandrakanth Patil <chandrakanth.patil@broadcom.com> says: This series contains mpi3mr driver fixes and minor updates. Link: https://lore.kernel.org/r/20250820084138.228471-1-chandrakanth.patil@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2 parents 00f4699 + 80a4034 commit e5e11f6

8 files changed

Lines changed: 88 additions & 15 deletions

File tree

drivers/scsi/mpi3mr/mpi/mpi30_cnfg.h

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ struct mpi3_man6_gpio_entry {
322322
#define MPI3_MAN6_GPIO_EXTINT_PARAM1_FLAGS_TRIGGER_MASK (0x01)
323323
#define MPI3_MAN6_GPIO_EXTINT_PARAM1_FLAGS_TRIGGER_EDGE (0x00)
324324
#define MPI3_MAN6_GPIO_EXTINT_PARAM1_FLAGS_TRIGGER_LEVEL (0x01)
325+
#define MPI3_MAN6_GPIO_OVER_TEMP_PARAM1_LEVEL_WARNING (0x00)
326+
#define MPI3_MAN6_GPIO_OVER_TEMP_PARAM1_LEVEL_CRITICAL (0x01)
327+
#define MPI3_MAN6_GPIO_OVER_TEMP_PARAM1_LEVEL_FATAL (0x02)
325328
#define MPI3_MAN6_GPIO_PORT_GREEN_PARAM1_PHY_STATUS_ALL_UP (0x00)
326329
#define MPI3_MAN6_GPIO_PORT_GREEN_PARAM1_PHY_STATUS_ONE_OR_MORE_UP (0x01)
327330
#define MPI3_MAN6_GPIO_CABLE_MGMT_PARAM1_INTERFACE_MODULE_PRESENT (0x00)
@@ -1250,6 +1253,37 @@ struct mpi3_io_unit_page17 {
12501253
__le32 current_key[];
12511254
};
12521255
#define MPI3_IOUNIT17_PAGEVERSION (0x00)
1256+
struct mpi3_io_unit_page18 {
1257+
struct mpi3_config_page_header header;
1258+
u8 flags;
1259+
u8 poll_interval;
1260+
__le16 reserved0a;
1261+
__le32 reserved0c;
1262+
};
1263+
1264+
#define MPI3_IOUNIT18_PAGEVERSION (0x00)
1265+
#define MPI3_IOUNIT18_FLAGS_DIRECTATTACHED_ENABLE (0x01)
1266+
#define MPI3_IOUNIT18_POLLINTERVAL_DISABLE (0x00)
1267+
#ifndef MPI3_IOUNIT19_DEVICE_MAX
1268+
#define MPI3_IOUNIT19_DEVICE_MAX (1)
1269+
#endif
1270+
struct mpi3_iounit19_device {
1271+
__le16 temperature;
1272+
__le16 dev_handle;
1273+
__le16 persistent_id;
1274+
__le16 reserved06;
1275+
};
1276+
1277+
#define MPI3_IOUNIT19_DEVICE_TEMPERATURE_UNAVAILABLE (0x8000)
1278+
struct mpi3_io_unit_page19 {
1279+
struct mpi3_config_page_header header;
1280+
__le16 num_devices;
1281+
__le16 reserved0a;
1282+
__le32 reserved0c;
1283+
struct mpi3_iounit19_device device[MPI3_IOUNIT19_DEVICE_MAX];
1284+
};
1285+
1286+
#define MPI3_IOUNIT19_PAGEVERSION (0x00)
12531287
struct mpi3_ioc_page0 {
12541288
struct mpi3_config_page_header header;
12551289
__le32 reserved08;
@@ -2356,7 +2390,9 @@ struct mpi3_device0_vd_format {
23562390
__le16 io_throttle_group;
23572391
__le16 io_throttle_group_low;
23582392
__le16 io_throttle_group_high;
2359-
__le32 reserved0c;
2393+
u8 vd_abort_to;
2394+
u8 vd_reset_to;
2395+
__le16 reserved0e;
23602396
};
23612397
#define MPI3_DEVICE0_VD_STATE_OFFLINE (0x00)
23622398
#define MPI3_DEVICE0_VD_STATE_PARTIALLY_DEGRADED (0x01)

drivers/scsi/mpi3mr/mpi/mpi30_pci.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
#define MPI3_NVME_ENCAP_CMD_MAX (1)
1010
#endif
1111
#define MPI3_NVME_FLAGS_FORCE_ADMIN_ERR_REPLY_MASK (0x0002)
12+
#define MPI3_NVME_FLAGS_FORCE_ADMIN_ERR_REPLY_SHIFT (1)
1213
#define MPI3_NVME_FLAGS_FORCE_ADMIN_ERR_REPLY_FAIL_ONLY (0x0000)
1314
#define MPI3_NVME_FLAGS_FORCE_ADMIN_ERR_REPLY_ALL (0x0002)
1415
#define MPI3_NVME_FLAGS_SUBMISSIONQ_MASK (0x0001)
16+
#define MPI3_NVME_FLAGS_SUBMISSIONQ_SHIFT (0)
1517
#define MPI3_NVME_FLAGS_SUBMISSIONQ_IO (0x0000)
1618
#define MPI3_NVME_FLAGS_SUBMISSIONQ_ADMIN (0x0001)
1719

drivers/scsi/mpi3mr/mpi/mpi30_sas.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define MPI3_SAS_DEVICE_INFO_STP_INITIATOR (0x00000010)
1212
#define MPI3_SAS_DEVICE_INFO_SMP_INITIATOR (0x00000008)
1313
#define MPI3_SAS_DEVICE_INFO_DEVICE_TYPE_MASK (0x00000007)
14+
#define MPI3_SAS_DEVICE_INFO_DEVICE_TYPE_SHIFT (0)
1415
#define MPI3_SAS_DEVICE_INFO_DEVICE_TYPE_NO_DEVICE (0x00000000)
1516
#define MPI3_SAS_DEVICE_INFO_DEVICE_TYPE_END_DEVICE (0x00000001)
1617
#define MPI3_SAS_DEVICE_INFO_DEVICE_TYPE_EXPANDER (0x00000002)

drivers/scsi/mpi3mr/mpi/mpi30_transport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ union mpi3_version_union {
1818

1919
#define MPI3_VERSION_MAJOR (3)
2020
#define MPI3_VERSION_MINOR (0)
21-
#define MPI3_VERSION_UNIT (35)
21+
#define MPI3_VERSION_UNIT (37)
2222
#define MPI3_VERSION_DEV (0)
2323
#define MPI3_DEVHANDLE_INVALID (0xffff)
2424
struct mpi3_sysif_oper_queue_indexes {

drivers/scsi/mpi3mr/mpi3mr.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ extern struct list_head mrioc_list;
5656
extern int prot_mask;
5757
extern atomic64_t event_counter;
5858

59-
#define MPI3MR_DRIVER_VERSION "8.14.0.5.50"
60-
#define MPI3MR_DRIVER_RELDATE "27-June-2025"
59+
#define MPI3MR_DRIVER_VERSION "8.15.0.5.50"
60+
#define MPI3MR_DRIVER_RELDATE "12-August-2025"
6161

6262
#define MPI3MR_DRIVER_NAME "mpi3mr"
6363
#define MPI3MR_DRIVER_LICENSE "GPL"
@@ -697,6 +697,8 @@ struct tgt_dev_vd {
697697
u16 tg_id;
698698
u32 tg_high;
699699
u32 tg_low;
700+
u8 abort_to;
701+
u8 reset_to;
700702
struct mpi3mr_throttle_group_info *tg;
701703
};
702704

@@ -738,6 +740,8 @@ enum mpi3mr_dev_state {
738740
* @wwid: World wide ID
739741
* @enclosure_logical_id: Enclosure logical identifier
740742
* @dev_spec: Device type specific information
743+
* @abort_to: Timeout for abort TM
744+
* @reset_to: Timeout for Target/LUN reset TM
741745
* @ref_count: Reference count
742746
* @state: device state
743747
*/

drivers/scsi/mpi3mr/mpi3mr_fw.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2353,6 +2353,8 @@ static int mpi3mr_create_op_queues(struct mpi3mr_ioc *mrioc)
23532353
{
23542354
int retval = 0;
23552355
u16 num_queues = 0, i = 0, msix_count_op_q = 1;
2356+
u32 ioc_status;
2357+
enum mpi3mr_iocstate ioc_state;
23562358

23572359
num_queues = min_t(int, mrioc->facts.max_op_reply_q,
23582360
mrioc->facts.max_op_req_q);
@@ -2408,6 +2410,14 @@ static int mpi3mr_create_op_queues(struct mpi3mr_ioc *mrioc)
24082410
retval = -1;
24092411
goto out_failed;
24102412
}
2413+
ioc_status = readl(&mrioc->sysif_regs->ioc_status);
2414+
ioc_state = mpi3mr_get_iocstate(mrioc);
2415+
if ((ioc_status & MPI3_SYSIF_IOC_STATUS_RESET_HISTORY) ||
2416+
ioc_state != MRIOC_STATE_READY) {
2417+
mpi3mr_print_fault_info(mrioc);
2418+
retval = -1;
2419+
goto out_failed;
2420+
}
24112421
mrioc->num_op_reply_q = mrioc->num_op_req_q = i;
24122422
ioc_info(mrioc,
24132423
"successfully created %d operational queue pairs(default/polled) queue = (%d/%d)\n",
@@ -5420,6 +5430,7 @@ int mpi3mr_soft_reset_handler(struct mpi3mr_ioc *mrioc,
54205430
mpi3mr_reset_rc_name(reset_reason));
54215431

54225432
mrioc->device_refresh_on = 0;
5433+
scsi_block_requests(mrioc->shost);
54235434
mrioc->reset_in_progress = 1;
54245435
mrioc->stop_bsgs = 1;
54255436
mrioc->prev_reset_result = -1;
@@ -5528,6 +5539,7 @@ int mpi3mr_soft_reset_handler(struct mpi3mr_ioc *mrioc,
55285539
if (!retval) {
55295540
mrioc->diagsave_timeout = 0;
55305541
mrioc->reset_in_progress = 0;
5542+
scsi_unblock_requests(mrioc->shost);
55315543
mrioc->pel_abort_requested = 0;
55325544
if (mrioc->pel_enabled) {
55335545
mrioc->pel_cmds.retry_count = 0;
@@ -5552,6 +5564,7 @@ int mpi3mr_soft_reset_handler(struct mpi3mr_ioc *mrioc,
55525564
mrioc->device_refresh_on = 0;
55535565
mrioc->unrecoverable = 1;
55545566
mrioc->reset_in_progress = 0;
5567+
scsi_unblock_requests(mrioc->shost);
55555568
mrioc->stop_bsgs = 0;
55565569
retval = -1;
55575570
mpi3mr_flush_cmds_for_unrecovered_controller(mrioc);

drivers/scsi/mpi3mr/mpi3mr_os.c

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,12 @@ static void mpi3mr_update_tgtdev(struct mpi3mr_ioc *mrioc,
13081308
if (vdinf->vd_state == MPI3_DEVICE0_VD_STATE_OFFLINE)
13091309
tgtdev->is_hidden = 1;
13101310
tgtdev->non_stl = 1;
1311+
tgtdev->dev_spec.vd_inf.reset_to =
1312+
max_t(u8, vdinf->vd_reset_to,
1313+
MPI3MR_INTADMCMD_TIMEOUT);
1314+
tgtdev->dev_spec.vd_inf.abort_to =
1315+
max_t(u8, vdinf->vd_abort_to,
1316+
MPI3MR_INTADMCMD_TIMEOUT);
13111317
tgtdev->dev_spec.vd_inf.tg_id = vdinf_io_throttle_group;
13121318
tgtdev->dev_spec.vd_inf.tg_high =
13131319
le16_to_cpu(vdinf->io_throttle_group_high) * 2048;
@@ -2049,8 +2055,8 @@ static void mpi3mr_fwevt_bh(struct mpi3mr_ioc *mrioc,
20492055
if (!fwevt->process_evt)
20502056
goto evt_ack;
20512057

2052-
dprint_event_bh(mrioc, "processing event(0x%02x) in the bottom half handler\n",
2053-
fwevt->event_id);
2058+
dprint_event_bh(mrioc, "processing event(0x%02x) -(0x%08x) in the bottom half handler\n",
2059+
fwevt->event_id, fwevt->evt_ctx);
20542060

20552061
switch (fwevt->event_id) {
20562062
case MPI3_EVENT_DEVICE_ADDED:
@@ -2866,12 +2872,14 @@ static void mpi3mr_preparereset_evt_th(struct mpi3mr_ioc *mrioc,
28662872
"prepare for reset event top half with rc=start\n");
28672873
if (mrioc->prepare_for_reset)
28682874
return;
2875+
scsi_block_requests(mrioc->shost);
28692876
mrioc->prepare_for_reset = 1;
28702877
mrioc->prepare_for_reset_timeout_counter = 0;
28712878
} else if (evtdata->reason_code == MPI3_EVENT_PREPARE_RESET_RC_ABORT) {
28722879
dprint_event_th(mrioc,
28732880
"prepare for reset top half with rc=abort\n");
28742881
mrioc->prepare_for_reset = 0;
2882+
scsi_unblock_requests(mrioc->shost);
28752883
mrioc->prepare_for_reset_timeout_counter = 0;
28762884
}
28772885
if ((event_reply->msg_flags & MPI3_EVENT_NOTIFY_MSGFLAGS_ACK_MASK)
@@ -3076,8 +3084,8 @@ void mpi3mr_os_handle_events(struct mpi3mr_ioc *mrioc,
30763084
}
30773085
if (process_evt_bh || ack_req) {
30783086
dprint_event_th(mrioc,
3079-
"scheduling bottom half handler for event(0x%02x),ack_required=%d\n",
3080-
evt_type, ack_req);
3087+
"scheduling bottom half handler for event(0x%02x) - (0x%08x), ack_required=%d\n",
3088+
evt_type, le32_to_cpu(event_reply->event_context), ack_req);
30813089
sz = event_reply->event_data_length * 4;
30823090
fwevt = mpi3mr_alloc_fwevt(sz);
30833091
if (!fwevt) {
@@ -3915,11 +3923,13 @@ int mpi3mr_issue_tm(struct mpi3mr_ioc *mrioc, u8 tm_type,
39153923
if (scsi_tgt_priv_data)
39163924
atomic_inc(&scsi_tgt_priv_data->block_io);
39173925

3918-
if (tgtdev && (tgtdev->dev_type == MPI3_DEVICE_DEVFORM_PCIE)) {
3919-
if (cmd_priv && tgtdev->dev_spec.pcie_inf.abort_to)
3920-
timeout = tgtdev->dev_spec.pcie_inf.abort_to;
3921-
else if (!cmd_priv && tgtdev->dev_spec.pcie_inf.reset_to)
3922-
timeout = tgtdev->dev_spec.pcie_inf.reset_to;
3926+
if (tgtdev) {
3927+
if (tgtdev->dev_type == MPI3_DEVICE_DEVFORM_PCIE)
3928+
timeout = cmd_priv ? tgtdev->dev_spec.pcie_inf.abort_to
3929+
: tgtdev->dev_spec.pcie_inf.reset_to;
3930+
else if (tgtdev->dev_type == MPI3_DEVICE_DEVFORM_VD)
3931+
timeout = cmd_priv ? tgtdev->dev_spec.vd_inf.abort_to
3932+
: tgtdev->dev_spec.vd_inf.reset_to;
39233933
}
39243934

39253935
init_completion(&drv_cmd->done);

drivers/scsi/mpi3mr/mpi3mr_transport.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,11 @@ static void mpi3mr_remove_device_by_sas_address(struct mpi3mr_ioc *mrioc,
413413
sas_address, hba_port);
414414
if (tgtdev) {
415415
if (!list_empty(&tgtdev->list)) {
416-
list_del_init(&tgtdev->list);
417416
was_on_tgtdev_list = 1;
418-
mpi3mr_tgtdev_put(tgtdev);
417+
if (tgtdev->state == MPI3MR_DEV_REMOVE_HS_STARTED) {
418+
list_del_init(&tgtdev->list);
419+
mpi3mr_tgtdev_put(tgtdev);
420+
}
419421
}
420422
}
421423
spin_unlock_irqrestore(&mrioc->tgtdev_lock, flags);
@@ -2079,6 +2081,8 @@ int mpi3mr_expander_add(struct mpi3mr_ioc *mrioc, u16 handle)
20792081
link_rate = (expander_pg1.negotiated_link_rate &
20802082
MPI3_SAS_NEG_LINK_RATE_LOGICAL_MASK) >>
20812083
MPI3_SAS_NEG_LINK_RATE_LOGICAL_SHIFT;
2084+
if (link_rate < MPI3_SAS_NEG_LINK_RATE_1_5)
2085+
link_rate = MPI3_SAS_NEG_LINK_RATE_1_5;
20822086
mpi3mr_update_links(mrioc, sas_address_parent,
20832087
handle, i, link_rate, hba_port);
20842088
}
@@ -2388,6 +2392,9 @@ int mpi3mr_report_tgtdev_to_sas_transport(struct mpi3mr_ioc *mrioc,
23882392

23892393
link_rate = mpi3mr_get_sas_negotiated_logical_linkrate(mrioc, tgtdev);
23902394

2395+
if (link_rate < MPI3_SAS_NEG_LINK_RATE_1_5)
2396+
link_rate = MPI3_SAS_NEG_LINK_RATE_1_5;
2397+
23912398
mpi3mr_update_links(mrioc, sas_address_parent, tgtdev->dev_handle,
23922399
parent_phy_number, link_rate, hba_port);
23932400

0 commit comments

Comments
 (0)