From: Adrian Hunter <adrian.hunter@intel.com>
To: Bart Van Assche <bvanassche@acm.org>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Avri Altman <avri.altman@wdc.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
Bean Huo <beanhuo@micron.com>,
Jinyoung Choi <j-young.choi@samsung.com>
Subject: Re: [PATCH v6 6/8] scsi: ufs: Simplify ufshcd_set_dev_pwr_mode()
Date: Mon, 3 Oct 2022 09:28:32 +0300 [thread overview]
Message-ID: <eb9eae96-f9fc-2c5b-4caf-6b5efc00d931@intel.com> (raw)
In-Reply-To: <20220929224421.587465-7-bvanassche@acm.org>
On 30/09/22 01:44, Bart Van Assche wrote:
> Simplify the code for incrementing the SCSI device reference count in
> ufshcd_set_dev_pwr_mode(). This patch removes one scsi_device_put() call
> that happens from atomic context.
>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Avri Altman <avri.altman@wdc.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Not sure what patch set "v6 6/8" refers to, nevertheless:
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> drivers/ufs/core/ufshcd.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 7c15cbc737b4..6e61372fe027 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -8753,15 +8753,10 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
>
> spin_lock_irqsave(hba->host->host_lock, flags);
> sdp = hba->ufs_device_wlun;
> - if (sdp) {
> + if (sdp && scsi_device_online(sdp))
> ret = scsi_device_get(sdp);
> - if (!ret && !scsi_device_online(sdp)) {
> - ret = -ENODEV;
> - scsi_device_put(sdp);
> - }
> - } else {
> + else
> ret = -ENODEV;
> - }
> spin_unlock_irqrestore(hba->host->host_lock, flags);
>
> if (ret)
next prev parent reply other threads:[~2022-10-03 6:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-29 22:44 [PATCH v6 0/8] Prepare for constifying SCSI host templates Bart Van Assche
2022-09-29 22:44 ` [PATCH v6 1/8] scsi: esas2r: Initialize two host template members implicitly Bart Van Assche
2022-09-29 22:44 ` [PATCH v6 2/8] scsi: esas2r: Introduce scsi_template_proc_dir() Bart Van Assche
2022-09-29 22:44 ` [PATCH v6 3/8] scsi: core: Fail host creation if creating the proc directory fails Bart Van Assche
2022-09-29 22:44 ` [PATCH v6 4/8] scsi: core: Introduce a new list for SCSI proc directory entries Bart Van Assche
2022-09-29 22:44 ` [PATCH v6 5/8] scsi: core: Rework scsi_single_lun_run() Bart Van Assche
2022-09-29 22:44 ` [PATCH v6 6/8] scsi: ufs: Simplify ufshcd_set_dev_pwr_mode() Bart Van Assche
2022-10-03 6:28 ` Adrian Hunter [this message]
2022-10-03 16:23 ` Bart Van Assche
2022-09-29 22:44 ` [PATCH v6 7/8] scsi: core: Remove the put_device() call from scsi_device_get() Bart Van Assche
2022-09-29 22:44 ` [PATCH v6 8/8] scsi: core: Release SCSI devices synchronously Bart Van Assche
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=eb9eae96-f9fc-2c5b-4caf-6b5efc00d931@intel.com \
--to=adrian.hunter@intel.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=j-young.choi@samsung.com \
--cc=jejb@linux.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox