From: Dan Carpenter <dan.carpenter@oracle.com> To: Alim Akhtar <alim.akhtar@samsung.com>, Bart Van Assche <bvanassche@acm.org> Cc: Avri Altman <avri.altman@wdc.com>, Pedro Sousa <pedrom.sousa@synopsys.com>, "James E.J. Bottomley" <jejb@linux.ibm.com>, "Martin K. Petersen" <martin.petersen@oracle.com>, Bean Huo <beanhuo@micron.com>, Stanley Chu <stanley.chu@mediatek.com>, Can Guo <cang@codeaurora.org>, Venkat Gopalakrishnan <venkatg@codeaurora.org>, Tomas Winkler <tomas.winkler@intel.com>, linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/2] scsi: ufs: Unlock on a couple error paths Date: Fri, 13 Dec 2019 10:48:28 +0000 [thread overview] Message-ID: <20191213104828.7i64cpoof26rc4fw@kili.mountain> (raw) We introduced a few new error paths, but we can't return directly, we first have to unlock "hba->clk_scaling_lock" first. Fixes: a276c19e3e98 ("scsi: ufs: Avoid busy-waiting by eliminating tag conflicts") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- drivers/scsi/ufs/ufshcd.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index e5cd57e68c46..bf981f0ea74c 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2617,8 +2617,10 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, * the maximum wait time is bounded by SCSI request timeout. */ req = blk_get_request(q, REQ_OP_DRV_OUT, 0); - if (IS_ERR(req)) - return PTR_ERR(req); + if (IS_ERR(req)) { + err = PTR_ERR(req); + goto out_unlock; + } tag = req->tag; WARN_ON_ONCE(!ufshcd_valid_tag(hba, tag)); @@ -2646,6 +2648,7 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, out_put_tag: blk_put_request(req); +out_unlock: up_read(&hba->clk_scaling_lock); return err; } @@ -5854,8 +5857,10 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba, down_read(&hba->clk_scaling_lock); req = blk_get_request(q, REQ_OP_DRV_OUT, 0); - if (IS_ERR(req)) - return PTR_ERR(req); + if (IS_ERR(req)) { + err = PTR_ERR(req); + goto out_unlock; + } tag = req->tag; WARN_ON_ONCE(!ufshcd_valid_tag(hba, tag)); @@ -5934,6 +5939,7 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba, } blk_put_request(req); +out_unlock: up_read(&hba->clk_scaling_lock); return err; } -- 2.11.0
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com> To: Alim Akhtar <alim.akhtar@samsung.com>, Bart Van Assche <bvanassche@acm.org> Cc: Avri Altman <avri.altman@wdc.com>, Pedro Sousa <pedrom.sousa@synopsys.com>, "James E.J. Bottomley" <jejb@linux.ibm.com>, "Martin K. Petersen" <martin.petersen@oracle.com>, Bean Huo <beanhuo@micron.com>, Stanley Chu <stanley.chu@mediatek.com>, Can Guo <cang@codeaurora.org>, Venkat Gopalakrishnan <venkatg@codeaurora.org>, Tomas Winkler <tomas.winkler@intel.com>, linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/2] scsi: ufs: Unlock on a couple error paths Date: Fri, 13 Dec 2019 13:48:28 +0300 [thread overview] Message-ID: <20191213104828.7i64cpoof26rc4fw@kili.mountain> (raw) We introduced a few new error paths, but we can't return directly, we first have to unlock "hba->clk_scaling_lock" first. Fixes: a276c19e3e98 ("scsi: ufs: Avoid busy-waiting by eliminating tag conflicts") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- drivers/scsi/ufs/ufshcd.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index e5cd57e68c46..bf981f0ea74c 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2617,8 +2617,10 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, * the maximum wait time is bounded by SCSI request timeout. */ req = blk_get_request(q, REQ_OP_DRV_OUT, 0); - if (IS_ERR(req)) - return PTR_ERR(req); + if (IS_ERR(req)) { + err = PTR_ERR(req); + goto out_unlock; + } tag = req->tag; WARN_ON_ONCE(!ufshcd_valid_tag(hba, tag)); @@ -2646,6 +2648,7 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, out_put_tag: blk_put_request(req); +out_unlock: up_read(&hba->clk_scaling_lock); return err; } @@ -5854,8 +5857,10 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba, down_read(&hba->clk_scaling_lock); req = blk_get_request(q, REQ_OP_DRV_OUT, 0); - if (IS_ERR(req)) - return PTR_ERR(req); + if (IS_ERR(req)) { + err = PTR_ERR(req); + goto out_unlock; + } tag = req->tag; WARN_ON_ONCE(!ufshcd_valid_tag(hba, tag)); @@ -5934,6 +5939,7 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba, } blk_put_request(req); +out_unlock: up_read(&hba->clk_scaling_lock); return err; } -- 2.11.0
next reply other threads:[~2019-12-13 10:48 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-12-13 10:48 Dan Carpenter [this message] 2019-12-13 10:48 ` [PATCH 1/2] scsi: ufs: Unlock on a couple error paths Dan Carpenter 2019-12-13 10:49 ` [PATCH 2/2] scsi: ufs: Simplify a condition Dan Carpenter 2019-12-13 10:49 ` Dan Carpenter 2019-12-13 20:05 ` Bart Van Assche 2019-12-13 20:05 ` Bart Van Assche 2019-12-14 4:28 ` Dan Carpenter 2019-12-14 4:28 ` Dan Carpenter 2019-12-15 6:06 ` Avri Altman 2019-12-13 20:04 ` [PATCH 1/2] scsi: ufs: Unlock on a couple error paths Bart Van Assche 2019-12-13 20:04 ` Bart Van Assche 2019-12-17 3:04 ` Martin K. Petersen 2019-12-17 3:04 ` Martin K. Petersen
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20191213104828.7i64cpoof26rc4fw@kili.mountain \ --to=dan.carpenter@oracle.com \ --cc=alim.akhtar@samsung.com \ --cc=avri.altman@wdc.com \ --cc=beanhuo@micron.com \ --cc=bvanassche@acm.org \ --cc=cang@codeaurora.org \ --cc=jejb@linux.ibm.com \ --cc=kernel-janitors@vger.kernel.org \ --cc=linux-scsi@vger.kernel.org \ --cc=martin.petersen@oracle.com \ --cc=pedrom.sousa@synopsys.com \ --cc=stanley.chu@mediatek.com \ --cc=tomas.winkler@intel.com \ --cc=venkatg@codeaurora.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.