All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] mpt3sas: Few enhancements and fixes
@ 2022-08-01 12:41 Sreekanth Reddy
  2022-08-01 12:41 ` [PATCH 1/4] mpt3sas: Don't change dma mask while reallocating pools Sreekanth Reddy
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Sreekanth Reddy @ 2022-08-01 12:41 UTC (permalink / raw)
  To: linux-scsi; +Cc: martin.petersen, Sreekanth Reddy

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

Few enhancements and fixes of mpt3sas driver.

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] 8+ messages in thread

* [PATCH 1/4] mpt3sas: Don't change dma mask while reallocating pools
  2022-08-01 12:41 [PATCH 0/4] mpt3sas: Few enhancements and fixes Sreekanth Reddy
@ 2022-08-01 12:41 ` Sreekanth Reddy
  2022-08-01 12:41 ` [PATCH 2/4] mpt3sas: Fix trace buffer registration failed Sreekanth Reddy
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Sreekanth Reddy @ 2022-08-01 12:41 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 565339a..e257e0d 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] 8+ messages in thread

* [PATCH 2/4] mpt3sas: Fix trace buffer registration failed
  2022-08-01 12:41 [PATCH 0/4] mpt3sas: Few enhancements and fixes Sreekanth Reddy
  2022-08-01 12:41 ` [PATCH 1/4] mpt3sas: Don't change dma mask while reallocating pools Sreekanth Reddy
@ 2022-08-01 12:41 ` Sreekanth Reddy
  2022-08-01 12:41 ` [PATCH 3/4] mpt3sas: Increase cmd_per_lun to 128 Sreekanth Reddy
  2022-08-01 12:41 ` [PATCH 4/4] mpt3sas: Update driver version to 43.100.00.00 Sreekanth Reddy
  3 siblings, 0 replies; 8+ messages in thread
From: Sreekanth Reddy @ 2022-08-01 12:41 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 84c87c2..df00deb 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
@@ -1686,6 +1686,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];
@@ -1787,6 +1788,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;
 	}
@@ -2163,6 +2165,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;
@@ -2417,6 +2420,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] 8+ messages in thread

* [PATCH 3/4] mpt3sas: Increase cmd_per_lun to 128
  2022-08-01 12:41 [PATCH 0/4] mpt3sas: Few enhancements and fixes Sreekanth Reddy
  2022-08-01 12:41 ` [PATCH 1/4] mpt3sas: Don't change dma mask while reallocating pools Sreekanth Reddy
  2022-08-01 12:41 ` [PATCH 2/4] mpt3sas: Fix trace buffer registration failed Sreekanth Reddy
@ 2022-08-01 12:41 ` Sreekanth Reddy
  2022-08-01 17:58   ` Christoph Hellwig
  2022-08-01 12:41 ` [PATCH 4/4] mpt3sas: Update driver version to 43.100.00.00 Sreekanth Reddy
  3 siblings, 1 reply; 8+ messages in thread
From: Sreekanth Reddy @ 2022-08-01 12:41 UTC (permalink / raw)
  To: linux-scsi; +Cc: martin.petersen, Sreekanth Reddy

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

Increase cmd_per_lun 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 f321733..e54747a 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -11974,7 +11974,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] 8+ messages in thread

* [PATCH 4/4] mpt3sas: Update driver version to 43.100.00.00
  2022-08-01 12:41 [PATCH 0/4] mpt3sas: Few enhancements and fixes Sreekanth Reddy
                   ` (2 preceding siblings ...)
  2022-08-01 12:41 ` [PATCH 3/4] mpt3sas: Increase cmd_per_lun to 128 Sreekanth Reddy
@ 2022-08-01 12:41 ` Sreekanth Reddy
  3 siblings, 0 replies; 8+ messages in thread
From: Sreekanth Reddy @ 2022-08-01 12:41 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 e584cf0..9ce89f5 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] 8+ messages in thread

* Re: [PATCH 3/4] mpt3sas: Increase cmd_per_lun to 128
  2022-08-01 12:41 ` [PATCH 3/4] mpt3sas: Increase cmd_per_lun to 128 Sreekanth Reddy
@ 2022-08-01 17:58   ` Christoph Hellwig
  2022-08-02  8:43     ` Sreekanth Reddy
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2022-08-01 17:58 UTC (permalink / raw)
  To: Sreekanth Reddy; +Cc: linux-scsi, martin.petersen

On Mon, Aug 01, 2022 at 06:11:43PM +0530, Sreekanth Reddy wrote:
> Increase cmd_per_lun to 128

Why?

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

* Re: [PATCH 3/4] mpt3sas: Increase cmd_per_lun to 128
  2022-08-01 17:58   ` Christoph Hellwig
@ 2022-08-02  8:43     ` Sreekanth Reddy
  2022-08-02 13:33       ` Christoph Hellwig
  0 siblings, 1 reply; 8+ messages in thread
From: Sreekanth Reddy @ 2022-08-02  8:43 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-scsi, Martin K. Petersen

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

On Mon, Aug 1, 2022 at 11:28 PM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Mon, Aug 01, 2022 at 06:11:43PM +0530, Sreekanth Reddy wrote:
> > Increase cmd_per_lun to 128
>
> Why?

In one of the earlier thread (mpt3sas fails to allocate budget_map and
detects no devices -
https://lore.kernel.org/all/YdcZwVUFGUPgkbLn@T590/T/) it has been
mentioned that cmd_per_lun with value 7 is so small and hence we
thought it is better to increase it to 128.

Thanks,
Sreekanth

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

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

* Re: [PATCH 3/4] mpt3sas: Increase cmd_per_lun to 128
  2022-08-02  8:43     ` Sreekanth Reddy
@ 2022-08-02 13:33       ` Christoph Hellwig
  0 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2022-08-02 13:33 UTC (permalink / raw)
  To: Sreekanth Reddy; +Cc: Christoph Hellwig, linux-scsi, Martin K. Petersen

On Tue, Aug 02, 2022 at 02:13:42PM +0530, Sreekanth Reddy wrote:
> On Mon, Aug 1, 2022 at 11:28 PM Christoph Hellwig <hch@infradead.org> wrote:
> >
> > On Mon, Aug 01, 2022 at 06:11:43PM +0530, Sreekanth Reddy wrote:
> > > Increase cmd_per_lun to 128
> >
> > Why?
> 
> In one of the earlier thread (mpt3sas fails to allocate budget_map and
> detects no devices -
> https://lore.kernel.org/all/YdcZwVUFGUPgkbLn@T590/T/) it has been
> mentioned that cmd_per_lun with value 7 is so small and hence we
> thought it is better to increase it to 128.

Well, that is what the commit log is for.  I can see all by myself that
you are increasing it, so you need to explain why.

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

end of thread, other threads:[~2022-08-02 13:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-01 12:41 [PATCH 0/4] mpt3sas: Few enhancements and fixes Sreekanth Reddy
2022-08-01 12:41 ` [PATCH 1/4] mpt3sas: Don't change dma mask while reallocating pools Sreekanth Reddy
2022-08-01 12:41 ` [PATCH 2/4] mpt3sas: Fix trace buffer registration failed Sreekanth Reddy
2022-08-01 12:41 ` [PATCH 3/4] mpt3sas: Increase cmd_per_lun to 128 Sreekanth Reddy
2022-08-01 17:58   ` Christoph Hellwig
2022-08-02  8:43     ` Sreekanth Reddy
2022-08-02 13:33       ` Christoph Hellwig
2022-08-01 12:41 ` [PATCH 4/4] mpt3sas: Update driver version to 43.100.00.00 Sreekanth Reddy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.