diff mbox series

mpt3sas: Fix timeout issue in ioctl commands.

Message ID 20201125094838.4340-1-suganath-prabu.subramani@broadcom.com (mailing list archive)
State Accepted
Headers show
Series mpt3sas: Fix timeout issue in ioctl commands. | expand

Commit Message

Suganath Prabu S Nov. 25, 2020, 9:48 a.m. UTC
Description of issue:
Patch with commit id "c1a6c5ac4278d406c112cc2f038e6e506feadff9"
has modified ioctl path 'timeout' variable type to u8 from
unsigned long. With this maximum timeout value that the driver
can support is 255 seconds. But for some commands application is
providing the higher timeout value (512 seconds as default), so
it will be round off to zero value. Hence timeout is observed
immediately and the IOCTL request fails.

Fix:
Inorder to accommodate higher timeout value change datatype back to
unsigned long.

Cc: <stable@vger.kernel.org> #v4.18+
Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen Dec. 1, 2020, 6:06 a.m. UTC | #1
On Wed, 25 Nov 2020 15:18:38 +0530, Suganath Prabu S wrote:

> Description of issue:
> Patch with commit id "c1a6c5ac4278d406c112cc2f038e6e506feadff9"
> has modified ioctl path 'timeout' variable type to u8 from
> unsigned long. With this maximum timeout value that the driver
> can support is 255 seconds. But for some commands application is
> providing the higher timeout value (512 seconds as default), so
> it will be round off to zero value. Hence timeout is observed
> immediately and the IOCTL request fails.
> 
> [...]

Applied to 5.10/scsi-fixes, thanks!

[1/1] mpt3sas: Fix timeout issue in ioctl commands.
      https://git.kernel.org/mkp/scsi/c/42f687038bcc
diff mbox series

Patch

diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
index b21aa55..c8a0ce1 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
@@ -664,7 +664,7 @@  _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
 	Mpi26NVMeEncapsulatedRequest_t *nvme_encap_request = NULL;
 	struct _pcie_device *pcie_device = NULL;
 	u16 smid;
-	u8 timeout;
+	unsigned long timeout;
 	u8 issue_reset;
 	u32 sz, sz_arg;
 	void *psge;