[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <da7f134c-3a2a-e3b9-72a1-56a19f720c70@acm.org>
Date: Thu, 24 Jun 2021 09:57:39 -0700
From: Bart Van Assche <bvanassche@....org>
To: Can Guo <cang@...eaurora.org>
Cc: asutoshd@...eaurora.org, nguyenb@...eaurora.org,
hongwus@...eaurora.org, ziqichen@...eaurora.org,
linux-scsi@...r.kernel.org, kernel-team@...roid.com,
Alim Akhtar <alim.akhtar@...sung.com>,
Avri Altman <avri.altman@....com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Stanley Chu <stanley.chu@...iatek.com>,
Bean Huo <beanhuo@...ron.com>,
Jaegeuk Kim <jaegeuk@...nel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 09/10] scsi: ufs: Update the fast abort path in
ufshcd_abort() for PM requests
On 6/23/21 9:16 PM, Can Guo wrote:
> On 2021-06-24 05:33, Bart Van Assche wrote:
>> On 6/23/21 12:35 AM, Can Guo wrote:
>>> @@ -2737,7 +2737,7 @@ static int ufshcd_queuecommand(struct Scsi_Host
>>> *host, struct scsi_cmnd *cmd)
>>> * err handler blocked for too long. So, just fail the scsi cmd
>>> * sent from PM ops, err handler can recover PM error anyways.
>>> */
>>> - if (hba->wlu_pm_op_in_progress) {
>>> + if (cmd->request->rq_flags & RQF_PM) {
>>> hba->force_reset = true;
>>> set_host_byte(cmd, DID_BAD_TARGET);
>>> cmd->scsi_done(cmd);
>>
>> I'm still concerned that the above code may trigger data corruption. I
>> prefer that the above code is removed instead of being modified.
>
> Removing the change will lead to deadlock when error handling prepare
> calls pm_runtime_get_sync().
>
> RQF_PM is only given to requests sent from power management operations,
> during which the specific device/LU is suspending/resuming, meaning no
> data transaction is ongoing. How can fast failing a PM request trigger
> data corruption?
Right, the above code only affects power management requests so there is
no risk for data corruption.
Thanks,
Bart.
Powered by blists - more mailing lists