From patchwork Wed Nov 25 09:48:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suganath Prabu S X-Patchwork-Id: 332905 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_NO_TEXT, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7230C5519F for ; Wed, 25 Nov 2020 09:50:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 657922083E for ; Wed, 25 Nov 2020 09:50:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="MijfPr0D" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726250AbgKYJu6 (ORCPT ); Wed, 25 Nov 2020 04:50:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726049AbgKYJu5 (ORCPT ); Wed, 25 Nov 2020 04:50:57 -0500 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE19FC0613D4 for ; Wed, 25 Nov 2020 01:50:57 -0800 (PST) Received: by mail-pf1-x443.google.com with SMTP id q10so1829763pfn.0 for ; Wed, 25 Nov 2020 01:50:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:mime-version; bh=WSbPmJHzTFOGsF0fvseSh4eHXTib2TGlWcXCkZBbNX8=; b=MijfPr0D3/rUsKm/fyqjmkCwm5oc+6g4gVEN62L5/ixIhCTg02fJH+U3Iusd5jE3Bs y4Ls5a048xYSTfS8joP7y/nR7408gUBdSpSu2Z/MFVF9Mhm9wtyQ/APHXFZF4bmuDdn1 lfWSsLu7k6EzDe1TkubQsNSvyS7XRQpxnV63g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=WSbPmJHzTFOGsF0fvseSh4eHXTib2TGlWcXCkZBbNX8=; b=WTGg4Aqn6hHtI6dAi/kzigYA0LnD9EF2W26/od0/IJR+f74tkVC2ydgUEsDRCGh35I P8c5t/movyFXU6VZrAjb0kYLh4ih1x2t1NZplNeYhkriCM9My5TA6KMGaPbqN3/sXchl V9iDdHbANKCwLUqaeTBZwzGGvRqlx7oMQ/TFLTjDqPVEcSlqhG3nYZuSwrQkwZp+tlC+ wkepwGppe9FkPYqGNUT5yG/QEsCF62MlWxclHmyWGIf+GVVWf3bDncedvwWQgbtFdllx U8xmY5lDjXi3luYnUtEvY+B45OgGKlGzOyydx0ES/Ore9Qv4JUgkbsIGltNLk9hAe+3z nv9A== X-Gm-Message-State: AOAM5324piT0/Isj6JMvxpwWqfu9YD8gtzeTfT6qxxPPpaOKpZmoEHk5 lUcg5zbjaaUMQEJyJNuYCim6JN9mPNiJdkjVZk5phPt19e7b9sQQb5R/YW4uwUIFhntlmY+V7WZ KeFUJoDVsqv9T72GfE2Xo1KCl4ET1k3ctrQ54lf6Bbk8lw0y2n+FLk7EZ35xg+GA398sN8yKy5E gFTXpnQ8JEB4wcwmafOQ== X-Google-Smtp-Source: ABdhPJyFmMUb8SChWbEB98AZ2AZMskrvpL9TnZSDJ8HSEe2qSwsA5ZbsLQ9pB0vlV/M+zl6mgSMleQ== X-Received: by 2002:a63:d110:: with SMTP id k16mr2383578pgg.284.1606297856261; Wed, 25 Nov 2020 01:50:56 -0800 (PST) Received: from dhcp-10-123-20-14.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id q21sm1742858pgk.3.2020.11.25.01.50.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 01:50:55 -0800 (PST) From: Suganath Prabu S To: stable@vger.kernel.org, linux-scsi@vger.kernel.org Cc: Sathya.Prakash@broadcom.com, sreekanth.reddy@broadcom.com, Suganath Prabu S Subject: [PATCH] mpt3sas: Fix timeout issue in ioctl commands. Date: Wed, 25 Nov 2020 15:18:38 +0530 Message-Id: <20201125094838.4340-1-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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: #v4.18+ Signed-off-by: Suganath Prabu S --- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;