linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] mpt3sas: Few enhancements and fixes
@ 2022-08-25  7:54 Sreekanth Reddy
  2022-08-25  7:54 ` [PATCH v2 1/4] mpt3sas: Don't change dma mask while reallocating pools Sreekanth Reddy
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Sreekanth Reddy @ 2022-08-25  7:54 UTC (permalink / raw)
  To: linux-scsi; +Cc: martin.petersen, Sreekanth Reddy

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

Few enhancements and fixes of mpt3sas driver.

V2:
 Updated the patch description for patch 3/4 

Sreekanth Reddy (4):
  mpt3sas: Don't change dma mask while reallocating pools
  mpt3sas: Fix trace buffer registration failed
  mpt3sas: Increase cmd_per_lun to 128
  mpt3sas: Update driver version to 43.100.00.00

 drivers/scsi/mpt3sas/mpt3sas_base.c  | 21 ++++++++++++++-------
 drivers/scsi/mpt3sas/mpt3sas_base.h  |  4 ++--
 drivers/scsi/mpt3sas/mpt3sas_ctl.c   |  4 ++++
 drivers/scsi/mpt3sas/mpt3sas_scsih.c |  2 +-
 4 files changed, 21 insertions(+), 10 deletions(-)

-- 
2.27.0


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/4] mpt3sas: Don't change dma mask while reallocating pools
  2022-08-25  7:54 [PATCH v2 0/4] mpt3sas: Few enhancements and fixes Sreekanth Reddy
@ 2022-08-25  7:54 ` Sreekanth Reddy
  2022-08-25  7:54 ` [PATCH v2 2/4] mpt3sas: Fix trace buffer registration failed Sreekanth Reddy
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sreekanth Reddy @ 2022-08-25  7:54 UTC (permalink / raw)
  To: linux-scsi; +Cc: martin.petersen, Sreekanth Reddy

[-- Attachment #1: Type: text/plain, Size: 1756 bytes --]

When a pool crosses the 4gb boundary region then
before reallocation pools just change the coherent
dma mask to 32bit and keep the normal dma mask to 63/64 bit.

Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index eeebe80..f8a3b0d 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -2990,19 +2990,26 @@ static int
 _base_config_dma_addressing(struct MPT3SAS_ADAPTER *ioc, struct pci_dev *pdev)
 {
 	struct sysinfo s;
+	u64 coherent_dma_mask, dma_mask;
 
-	if (ioc->is_mcpu_endpoint ||
-	    sizeof(dma_addr_t) == 4 || ioc->use_32bit_dma ||
-	    dma_get_required_mask(&pdev->dev) <= 32)
+	if (ioc->is_mcpu_endpoint || sizeof(dma_addr_t) == 4 ||
+	    dma_get_required_mask(&pdev->dev) <= 32) {
 		ioc->dma_mask = 32;
+		coherent_dma_mask = dma_mask = DMA_BIT_MASK(32);
 	/* Set 63 bit DMA mask for all SAS3 and SAS35 controllers */
-	else if (ioc->hba_mpi_version_belonged > MPI2_VERSION)
+	} else if (ioc->hba_mpi_version_belonged > MPI2_VERSION) {
 		ioc->dma_mask = 63;
-	else
+		coherent_dma_mask = dma_mask = DMA_BIT_MASK(63);
+	} else {
 		ioc->dma_mask = 64;
+		coherent_dma_mask = dma_mask = DMA_BIT_MASK(64);
+	}
+
+	if (ioc->use_32bit_dma)
+		coherent_dma_mask = DMA_BIT_MASK(32);
 
-	if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(ioc->dma_mask)) ||
-	    dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(ioc->dma_mask)))
+	if (dma_set_mask(&pdev->dev, dma_mask) ||
+	    dma_set_coherent_mask(&pdev->dev, coherent_dma_mask))
 		return -ENODEV;
 
 	if (ioc->dma_mask > 32) {
-- 
2.27.0


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/4] mpt3sas: Fix trace buffer registration failed
  2022-08-25  7:54 [PATCH v2 0/4] mpt3sas: Few enhancements and fixes Sreekanth Reddy
  2022-08-25  7:54 ` [PATCH v2 1/4] mpt3sas: Don't change dma mask while reallocating pools Sreekanth Reddy
@ 2022-08-25  7:54 ` Sreekanth Reddy
  2022-08-25  7:54 ` [PATCH v2 3/4] mpt3sas: Increase cmd_per_lun to 128 Sreekanth Reddy
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sreekanth Reddy @ 2022-08-25  7:54 UTC (permalink / raw)
  To: linux-scsi; +Cc: martin.petersen, Sreekanth Reddy

[-- Attachment #1: Type: text/plain, Size: 2009 bytes --]

The ExtendedType field was set to one in the diag buffer
register command and hence MPT Endpoint firmware is
failing the request with Invalid Field IOCStatus.

So, memset the request frame to zero before framing the
diag buffer register command.

Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_ctl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
index c47da95..0d8b1e9 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
@@ -1694,6 +1694,7 @@ _ctl_diag_register_2(struct MPT3SAS_ADAPTER *ioc,
 	ioc->ctl_cmds.status = MPT3_CMD_PENDING;
 	memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz);
 	mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
+	memset(mpi_request, 0, ioc->request_sz);
 	ioc->ctl_cmds.smid = smid;
 
 	request_data = ioc->diag_buffer[buffer_type];
@@ -1795,6 +1796,7 @@ _ctl_diag_register_2(struct MPT3SAS_ADAPTER *ioc,
 	if (rc && request_data) {
 		dma_free_coherent(&ioc->pdev->dev, request_data_sz,
 		    request_data, request_data_dma);
+		ioc->diag_buffer[buffer_type] = NULL;
 		ioc->diag_buffer_status[buffer_type] &=
 		    ~MPT3_DIAG_BUFFER_IS_DRIVER_ALLOCATED;
 	}
@@ -2171,6 +2173,7 @@ mpt3sas_send_diag_release(struct MPT3SAS_ADAPTER *ioc, u8 buffer_type,
 	ioc->ctl_cmds.status = MPT3_CMD_PENDING;
 	memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz);
 	mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
+	memset(mpi_request, 0, ioc->request_sz);
 	ioc->ctl_cmds.smid = smid;
 
 	mpi_request->Function = MPI2_FUNCTION_DIAG_RELEASE;
@@ -2425,6 +2428,7 @@ _ctl_diag_read_buffer(struct MPT3SAS_ADAPTER *ioc, void __user *arg)
 	ioc->ctl_cmds.status = MPT3_CMD_PENDING;
 	memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz);
 	mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
+	memset(mpi_request, 0, ioc->request_sz);
 	ioc->ctl_cmds.smid = smid;
 
 	mpi_request->Function = MPI2_FUNCTION_DIAG_BUFFER_POST;
-- 
2.27.0


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 3/4] mpt3sas: Increase cmd_per_lun to 128
  2022-08-25  7:54 [PATCH v2 0/4] mpt3sas: Few enhancements and fixes Sreekanth Reddy
  2022-08-25  7:54 ` [PATCH v2 1/4] mpt3sas: Don't change dma mask while reallocating pools Sreekanth Reddy
  2022-08-25  7:54 ` [PATCH v2 2/4] mpt3sas: Fix trace buffer registration failed Sreekanth Reddy
@ 2022-08-25  7:54 ` Sreekanth Reddy
  2022-08-25  7:54 ` [PATCH v2 4/4] mpt3sas: Update driver version to 43.100.00.00 Sreekanth Reddy
  2022-09-01  4:19 ` [PATCH v2 0/4] mpt3sas: Few enhancements and fixes Martin K. Petersen
  4 siblings, 0 replies; 6+ messages in thread
From: Sreekanth Reddy @ 2022-08-25  7:54 UTC (permalink / raw)
  To: linux-scsi; +Cc: martin.petersen, Sreekanth Reddy

[-- Attachment #1: Type: text/plain, Size: 900 bytes --]

With cmd_per_lun value 7, a higher number of cache lines (map_nr)
are needed while allocating sdev->budget_map which is not
reasonable and hence increasing the cmd_per_lun value to 128.

Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 3507e2a..4ce1c01 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -11975,7 +11975,7 @@ static struct scsi_host_template mpt3sas_driver_template = {
 	.sg_tablesize			= MPT3SAS_SG_DEPTH,
 	.max_sectors			= 32767,
 	.max_segment_size		= 0xffffffff,
-	.cmd_per_lun			= 7,
+	.cmd_per_lun			= 128,
 	.shost_groups			= mpt3sas_host_groups,
 	.sdev_groups			= mpt3sas_dev_groups,
 	.track_queue_depth		= 1,
-- 
2.27.0


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 4/4] mpt3sas: Update driver version to 43.100.00.00
  2022-08-25  7:54 [PATCH v2 0/4] mpt3sas: Few enhancements and fixes Sreekanth Reddy
                   ` (2 preceding siblings ...)
  2022-08-25  7:54 ` [PATCH v2 3/4] mpt3sas: Increase cmd_per_lun to 128 Sreekanth Reddy
@ 2022-08-25  7:54 ` Sreekanth Reddy
  2022-09-01  4:19 ` [PATCH v2 0/4] mpt3sas: Few enhancements and fixes Martin K. Petersen
  4 siblings, 0 replies; 6+ messages in thread
From: Sreekanth Reddy @ 2022-08-25  7:54 UTC (permalink / raw)
  To: linux-scsi; +Cc: martin.petersen, Sreekanth Reddy

[-- Attachment #1: Type: text/plain, Size: 894 bytes --]

Update driver version to 43.100.00.00.

Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
index 542fb74..05364aa 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
@@ -77,8 +77,8 @@
 #define MPT3SAS_DRIVER_NAME		"mpt3sas"
 #define MPT3SAS_AUTHOR "Avago Technologies <MPT-FusionLinux.pdl@avagotech.com>"
 #define MPT3SAS_DESCRIPTION	"LSI MPT Fusion SAS 3.0 Device Driver"
-#define MPT3SAS_DRIVER_VERSION		"42.100.00.00"
-#define MPT3SAS_MAJOR_VERSION		42
+#define MPT3SAS_DRIVER_VERSION		"43.100.00.00"
+#define MPT3SAS_MAJOR_VERSION		43
 #define MPT3SAS_MINOR_VERSION		100
 #define MPT3SAS_BUILD_VERSION		0
 #define MPT3SAS_RELEASE_VERSION	00
-- 
2.27.0


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/4] mpt3sas: Few enhancements and fixes
  2022-08-25  7:54 [PATCH v2 0/4] mpt3sas: Few enhancements and fixes Sreekanth Reddy
                   ` (3 preceding siblings ...)
  2022-08-25  7:54 ` [PATCH v2 4/4] mpt3sas: Update driver version to 43.100.00.00 Sreekanth Reddy
@ 2022-09-01  4:19 ` Martin K. Petersen
  4 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2022-09-01  4:19 UTC (permalink / raw)
  To: Sreekanth Reddy; +Cc: linux-scsi, martin.petersen


Sreekanth,

> Few enhancements and fixes of mpt3sas driver.

Applied to 6.1/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-01  4:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-25  7:54 [PATCH v2 0/4] mpt3sas: Few enhancements and fixes Sreekanth Reddy
2022-08-25  7:54 ` [PATCH v2 1/4] mpt3sas: Don't change dma mask while reallocating pools Sreekanth Reddy
2022-08-25  7:54 ` [PATCH v2 2/4] mpt3sas: Fix trace buffer registration failed Sreekanth Reddy
2022-08-25  7:54 ` [PATCH v2 3/4] mpt3sas: Increase cmd_per_lun to 128 Sreekanth Reddy
2022-08-25  7:54 ` [PATCH v2 4/4] mpt3sas: Update driver version to 43.100.00.00 Sreekanth Reddy
2022-09-01  4:19 ` [PATCH v2 0/4] mpt3sas: Few enhancements and fixes Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).