mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Mason Zhang <mason.zhang@mediatek.com>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Avri Altman <avri.altman@wdc.com>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Bean Huo <beanhuo@micron.com>,
	Stanley Chu <stanley.chu@mediatek.com>,
	Jinyoung Choi <j-young.choi@samsung.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	Peter Wang <peter.wang@mediatek.com>,
	Peng Zhou <peng.zhou@mediatek.com>,
	wsd_upstream@mediatek.com
Subject: Re: [PATCH v4 1/1] scsi: ufs: core: fix device management cmd timeout flow
Date: Wed, 18 Jan 2023 13:59:36 -0800	[thread overview]
Message-ID: <4bedb8bf-241f-03d8-9f84-1e070ab4c3d8@acm.org> (raw)
In-Reply-To: <20221216032532.1280-1-mason.zhang@mediatek.com>

On 12/15/22 19:25, Mason Zhang wrote:
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index b1f59a5fe632..fa86ce80f350 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -3008,6 +3008,22 @@ static int ufshcd_wait_for_dev_cmd(struct ufs_hba *hba,
>   		} else {
>   			dev_err(hba->dev, "%s: failed to clear tag %d\n",
>   				__func__, lrbp->task_tag);
> +
> +			spin_lock_irqsave(&hba->outstanding_lock, flags);
> +			pending = test_bit(lrbp->task_tag,
> +					   &hba->outstanding_reqs);
> +			if (pending)
> +				hba->dev_cmd.complete = NULL;
> +			spin_unlock_irqrestore(&hba->outstanding_lock, flags);
> +
> +			if (!pending) {
> +				/*
> +				 * The completion handler ran while we tried to
> +				 * clear the command.
> +				 */
> +				time_left = 1;
> +				goto retry;
> +			}
>   		}
>   	}

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

      reply	other threads:[~2023-01-18 21:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16  3:25 Mason Zhang
2023-01-18 21:59 ` Bart Van Assche [this message]

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=4bedb8bf-241f-03d8-9f84-1e070ab4c3d8@acm.org \
    --to=bvanassche@acm.org \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=j-young.choi@samsung.com \
    --cc=jejb@linux.ibm.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=mason.zhang@mediatek.com \
    --cc=matthias.bgg@gmail.com \
    --cc=peng.zhou@mediatek.com \
    --cc=peter.wang@mediatek.com \
    --cc=stanley.chu@mediatek.com \
    --cc=wsd_upstream@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

all inboxes | Powered by JetHome®