From: cang@codeaurora.org
To: "Bean Huo (beanhuo)" <beanhuo@micron.com>
Cc: asutoshd@codeaurora.org, nguyenb@codeaurora.org,
rnayak@codeaurora.org, linux-scsi@vger.kernel.org,
kernel-team@android.com, saravanak@google.com,
salyzyn@google.com, Alim Akhtar <alim.akhtar@samsung.com>,
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>,
Stanley Chu <stanley.chu@mediatek.com>,
Subhash Jadavani <subhashj@codeaurora.org>,
Tomas Winkler <tomas.winkler@intel.com>,
open list <linux-kernel@vger.kernel.org>,
Can Guo <cang@codeaurora.org>
Subject: Re: [EXT] [PATCH v1 5/5] scsi: ufs: Complete pending requests in host reset and restore path
Date: Thu, 14 Nov 2019 09:18:16 +0800 [thread overview]
Message-ID: <760d101a874e934f205701d282b3cc6f@codeaurora.org> (raw)
In-Reply-To: <0dc202a1decb6bbc103253b8c3c8c8ce@codeaurora.org>
On 2019-11-14 09:03, cang@codeaurora.org wrote:
> On 2019-11-14 06:04, Bean Huo (beanhuo) wrote:
>>>
>>> In UFS host reset and restore path, before probe, we stop and start
>>> the host
>>> controller once. After host controller is stopped, the pending
>>> requests, if any,
>>> are cleared from the doorbell, but no completion IRQ would be raised
>>> due to the
>>> hba is stopped.
>>> These pending requests shall be completed along with the first
>>> NOP_OUT
>>> command(as it is the first command which can raise a transfer
>>> completion
>>> IRQ) sent during probe.
>>
>> Hi, Can
>> I am not sure for this point, because there is HW/SW device reset
>> before or after host reset/restore.
>> Device HW/SW reset also will clear the pended tasks in device side.
>> That will be better.
>> I think Qcom platform already enabled HW reset.
>>
>> //Bean
>>
>
> Hi Bean,
>
> By pending tasks here, it means the requests sent down from scsi/block
> layer,
> but have not yet been handled by ufs driver(cmd->scsi_done() have not
> been called yet for these requests).
> For these requests, although removed by host and UFS device in their
> HW queues(doorbell),
> UFS driver still needs to complete them from SW side(call
> cmd->scsi_done() for each one of them) to
> let upper layer know that they are finished(although not successfully)
> to avoid hitting
> timeout of these pending tasks. I hope I make my explanation clearly.
>
> Best Regards,
> Can Guo.
>
Hi Bean,
Just want to add up more phrases. We do have HW/SW reset.
Sorry about below lines which make you confused. Here I am just
describing what
is like with previous code. Since these pending requests does not have
a chance to be handled in their IRQ handler after hba is stopped, and as
they have been cleared from doorbell already, then once there is an
available
transfer completion IRQ, these requests will be handled in the IRQ
handler,
no matter what is the transfer completion IRQ fired for. And NOP_OUT is
just
the first command that can fire a transer completion IRQ.
Can Guo.
These pending requests shall be completed along with the first NOP_OUT
command(as it is the first command which can raise a transfer completion
IRQ) sent during probe.
>>> Since the OCSs of these pending requests are not SUCCESS(because they
>>> are not
>>> yet literally finished), their UPIUs shall be dumped. When there are
>>> multiple
>>> pending requests, the UPIU dump can be overwhelming and may lead to
>>> stability
>>> issues because it is in atomic context.
>>> Therefore, before probe, complete these pending requests right after
>>> host
>>> controller is stopped.
next prev parent reply other threads:[~2019-11-14 1:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-08 8:15 [PATCH v1 0/5] UFS driver general fixes bundle 5 Can Guo
2019-11-08 8:15 ` [PATCH v1 1/5] scsi: ufs: Recheck bkops level if bkops is disabled Can Guo
2019-11-12 7:10 ` Avri Altman
2019-11-13 21:35 ` [EXT] " Bean Huo (beanhuo)
2019-11-08 8:15 ` [PATCH v1 2/5] scsi: ufs: Add new bit field PA_INIT to UECDL register Can Guo
2019-11-12 7:53 ` Avri Altman
2019-11-13 0:41 ` cang
2019-11-08 8:15 ` [PATCH v1 3/5] scsi: ufs: Update VCCQ2 and VCCQ min voltage hard codes Can Guo
2019-11-12 7:56 ` Avri Altman
2019-11-13 2:56 ` cang
2019-11-08 8:15 ` [PATCH v1 4/5] scsi: ufs: Avoid messing up the compl_time_stamp of lrbs Can Guo
2019-11-12 8:06 ` Avri Altman
2019-11-08 8:15 ` [PATCH v1 5/5] scsi: ufs: Complete pending requests in host reset and restore path Can Guo
2019-11-13 2:24 ` Alim Akhtar
2019-11-13 3:01 ` cang
2019-11-13 22:04 ` [EXT] " Bean Huo (beanhuo)
2019-11-14 1:03 ` cang
2019-11-14 1:18 ` cang [this message]
2019-11-14 13:03 ` Bean Huo (beanhuo)
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=760d101a874e934f205701d282b3cc6f@codeaurora.org \
--to=cang@codeaurora.org \
--cc=alim.akhtar@samsung.com \
--cc=asutoshd@codeaurora.org \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=jejb@linux.ibm.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=nguyenb@codeaurora.org \
--cc=pedrom.sousa@synopsys.com \
--cc=rnayak@codeaurora.org \
--cc=salyzyn@google.com \
--cc=saravanak@google.com \
--cc=stanley.chu@mediatek.com \
--cc=subhashj@codeaurora.org \
--cc=tomas.winkler@intel.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).