Skip to contentSkip to conversation

pm80xx updates

PATCH Applied Ajish Koshy 2 participants 4 messages Apr 11, 2022 – Apr 12, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v4 cover pm80xx updates

This patchset includes bugfixes for pm80xx driver

Changes from v3 to v4:
- For upper interrupt vector patch
- Removed unrequired comments
- For upper inbound outbound patch
- Added comments for msleep(500)

Changes from v2 to v3:
- For upper interrupt vector patch
- Removed 'mask' and 'vec' variables
- For upper inbound outbound queues patch
- Added a space before '*/'

Changes from v1 to v2:
- For upper interrupt vectors patch
- Removed unrequired casts u32
- Removed '& 0xFFFFFFFF' operation
- Removed 'vec_u' variable
- Added 'Fixes' tag.
- For upper inbound outbound queues patch
- Removed brackets
- Removed comments about msleep
- Added 'Fixes' tag.

Ajish Koshy (2):
scsi: pm80xx: mask and unmask upper interrupt vectors 32-63
scsi: pm80xx: enable upper inbound, outbound queues

 drivers/scsi/pm8001/pm80xx_hwi.c | 33 +++++++++++++++++++++++---------
 1 file changed, 24 insertions(+), 9 deletions(-)
Signature · 1 line
2.31.1
#1 lore raw

PATCH v4 1/2 scsi: pm80xx: mask and unmask upper interrupt vectors 32-63

When upper inbound and outbound queues 32-63 are enabled, we see upper vectors 32-63 in interrupt service routine. We need corresponding registers to handle masking and unmasking of these upper interrupts.

To achieve this, we use registers MSGU_ODMR_U(0x34) to mask and MSGU_ODMR_CLR_U(0x3C) to unmask the interrupts. In these registers bit 0-31 represents interrupt vectors 32-63.

Fixes 05c6c029a44d ("scsi: pm80xx: Increase number of supported queues")
---
 drivers/scsi/pm8001/pm80xx_hwi.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
drivers/scsi/pm8001/pm80xx_hwi.c +13 -9
index 9bb31f66db85..a331a8ad0558 100644
@@ -1727,10 +1727,11 @@ static void
 pm80xx_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec)
 {
 #ifdef PM8001_USE_MSIX
-	u32 mask;
-	mask = (u32)(1 << vec);
-
-	pm8001_cw32(pm8001_ha, 0, MSGU_ODMR_CLR, (u32)(mask & 0xFFFFFFFF));
+	if (vec < 32)
+		pm8001_cw32(pm8001_ha, 0, MSGU_ODMR_CLR, 1U << vec);
+	else
+		pm8001_cw32(pm8001_ha, 0, MSGU_ODMR_CLR_U,
+			    1U << (vec - 32));
 	return;
 #endif
 	pm80xx_chip_intx_interrupt_enable(pm8001_ha);
@@ -1746,12 +1747,15 @@ static void
 pm80xx_chip_interrupt_disable(struct pm8001_hba_info *pm8001_ha, u8 vec)
 {
 #ifdef PM8001_USE_MSIX
-	u32 mask;
-	if (vec == 0xFF)
-		mask = 0xFFFFFFFF;
+	if (vec == 0xFF) {
+		/* disable all vectors 0-31, 32-63 */
+		pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, 0xFFFFFFFF);
+		pm8001_cw32(pm8001_ha, 0, MSGU_ODMR_U, 0xFFFFFFFF);
+	} else if (vec < 32)
+		pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, 1U << vec);
 	else
-		mask = (u32)(1 << vec);
-	pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, (u32)(mask & 0xFFFFFFFF));
+		pm8001_cw32(pm8001_ha, 0, MSGU_ODMR_U,
+			    1U << (vec - 32));
 	return;
 #endif
 	pm80xx_chip_intx_interrupt_disable(pm8001_ha);
Signature · 1 line
2.31.1
#2 lore raw

PATCH v4 2/2 scsi: pm80xx: enable upper inbound, outbound queues

In reply to Ajish Koshy

Executing driver on servers with more than 32 CPUs were faced with command timeouts. This is because we were not geting completions for commands submitted on IQ32 - IQ63.

Set E64Q bit to enable upper inbound and outbound queues 32 to 63 in the MPI main configuration table.

Added 500ms delay after successful MPI initialization as mentioned in controller datasheet.

Fixes 05c6c029a44d ("scsi: pm80xx: Increase number of supported queues")
---
 drivers/scsi/pm8001/pm80xx_hwi.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/scsi/pm8001/pm80xx_hwi.c +11 -0
index a331a8ad0558..575d0f2a2d40 100644
@@ -766,6 +766,10 @@ static void init_default_table_values(struct pm8001_hba_info *pm8001_ha)
 	pm8001_ha->main_cfg_tbl.pm80xx_tbl.pcs_event_log_severity	= 0x01;
 	pm8001_ha->main_cfg_tbl.pm80xx_tbl.fatal_err_interrupt		= 0x01;
 
+	/* Enable higher IQs and OQs, 32 to 63, bit 16 */
+	if (pm8001_ha->max_q_num > 32)
+		pm8001_ha->main_cfg_tbl.pm80xx_tbl.fatal_err_interrupt |=
+							1 << 16;
 	/* Disable end to end CRC checking */
 	pm8001_ha->main_cfg_tbl.pm80xx_tbl.crc_core_dump = (0x1 << 16);
 
@@ -1027,6 +1031,13 @@ static int mpi_init_check(struct pm8001_hba_info *pm8001_ha)
 	if (0x0000 != gst_len_mpistate)
 		return -EBUSY;
 
+	/*
+	 *  As per controller datasheet, after successful MPI
+	 *  initialization minimum 500ms delay is required before
+	 *  issuing commands.
+	 */
+	msleep(500);
+
 	return 0;
 }
 
Signature · 1 line
2.31.1
#3 lore raw
In reply to Ajish Koshy
Quoted 9 lines · Ajish Koshy

This patchset includes bugfixes for pm80xx driver

Changes from v3 to v4:
- For upper interrupt vector patch
- Removed unrequired comments
- For upper inbound outbound patch
- Added comments for msleep(500)

[...]

Applied to 5.18/scsi-fixes, thanks!

[1/2] scsi: pm80xx: mask and unmask upper interrupt vectors 32-63

      https://git.kernel.org/mkp/scsi/c/294080eacf92
[2/2] scsi: pm80xx: enable upper inbound, outbound queues
      https://git.kernel.org/mkp/scsi/c/bcd8a4522347
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering