From: Bart Van Assche <bvanassche@acm.org>
To: Stanley Chu <stanley.chu@mediatek.com>,
linux-scsi@vger.kernel.org, martin.petersen@oracle.com,
avri.altman@wdc.com, alim.akhtar@samsung.com,
pedrom.sousa@synopsys.com, jejb@linux.ibm.com,
matthias.bgg@gmail.com
Cc: beanhuo@micron.com, cang@codeaurora.org,
linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, kuohong.wang@mediatek.com,
peter.wang@mediatek.com, chun-hung.wu@mediatek.com,
andy.teng@mediatek.com
Subject: Re: [PATCH v1 1/2] scsi: ufs: unify scsi_block_requests usage
Date: Tue, 24 Dec 2019 07:46:21 -0800 [thread overview]
Message-ID: <e9a8fbc0-5f08-75f5-b23b-2bbaa28a6222@acm.org> (raw)
In-Reply-To: <1577192466-20762-2-git-send-email-stanley.chu@mediatek.com>
On 2019-12-24 05:01, Stanley Chu wrote:
> Currently UFS driver has ufshcd_scsi_block_requests() with
> reference counter mechanism to avoid possible racing of blocking and
> unblocking requests flow. Unify all users in UFS driver to use the
> same function.
>
> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
> ---
> drivers/scsi/ufs/ufshcd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index ed02a70..b6b9665 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -5177,7 +5177,7 @@ static void ufshcd_exception_event_handler(struct work_struct *work)
> hba = container_of(work, struct ufs_hba, eeh_work);
>
> pm_runtime_get_sync(hba->dev);
> - scsi_block_requests(hba->host);
> + ufshcd_scsi_block_requests(hba);
> err = ufshcd_get_ee_status(hba, &status);
> if (err) {
> dev_err(hba->dev, "%s: failed to get exception status %d\n",
> @@ -5191,7 +5191,7 @@ static void ufshcd_exception_event_handler(struct work_struct *work)
> ufshcd_bkops_exception_event_handler(hba);
>
> out:
> - scsi_unblock_requests(hba->host);
> + ufshcd_scsi_unblock_requests(hba);
> pm_runtime_put_sync(hba->dev);
> return;
> }
Hi Stanley,
From the SCSI core:
void scsi_block_requests(struct Scsi_Host *shost)
{
shost->host_self_blocked = 1;
}
In other words, neither scsi_block_requests() nor
ufshcd_scsi_block_requests() wait for ongoing ufshcd_queuecommand()
calls to finish. Is it required to wait for these calls to finish before
exceptions are handled? If not, can the scsi_block_requests() and
scsi_unblock_requests() calls be left out? If it is required to wait for
ongoing ufshcd_queuecommand() calls to finish then I think the
scsi_block_requests() and scsi_unblock_requests() will have to be
changed into something else.
Thanks,
Bart.
next prev parent reply other threads:[~2019-12-24 15:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-24 13:01 [PATCH v1 0/2] scsi: ufs: use existed well-defined functions Stanley Chu
2019-12-24 13:01 ` [PATCH v1 1/2] scsi: ufs: unify scsi_block_requests usage Stanley Chu
2019-12-24 15:46 ` Bart Van Assche [this message]
2019-12-25 4:07 ` Stanley Chu
2019-12-25 8:21 ` Can Guo
2019-12-26 17:38 ` Bart Van Assche
2019-12-24 13:01 ` [PATCH v1 2/2] scsi: ufs: use ufshcd_vops_dbg_register_dump for vendor specific dumps Stanley Chu
2019-12-24 15:47 ` Bart Van Assche
2019-12-25 8:18 ` Can Guo
2019-12-27 1:33 ` [PATCH v1 0/2] scsi: ufs: use existed well-defined functions Alim Akhtar
2020-01-03 2:58 ` 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=e9a8fbc0-5f08-75f5-b23b-2bbaa28a6222@acm.org \
--to=bvanassche@acm.org \
--cc=alim.akhtar@samsung.com \
--cc=andy.teng@mediatek.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=cang@codeaurora.org \
--cc=chun-hung.wu@mediatek.com \
--cc=jejb@linux.ibm.com \
--cc=kuohong.wang@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=matthias.bgg@gmail.com \
--cc=pedrom.sousa@synopsys.com \
--cc=peter.wang@mediatek.com \
--cc=stanley.chu@mediatek.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;
as well as URLs for NNTP newsgroup(s).