From: Bart Van Assche <bvanassche@acm.org>
To: naomi.chu@mediatek.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>
Cc: wsd_upstream@mediatek.com, peter.wang@mediatek.com,
alice.chao@mediatek.com, chun-hung.wu@mediatek.com,
cc.chou@mediatek.com, yi-fan.peng@mediatek.com
Subject: Re: [PATCH 1/1] ufs: core: add fatal errors check for LINERESET
Date: Fri, 23 May 2025 09:14:17 -0700 [thread overview]
Message-ID: <c2608cd6-8c77-48f2-bc50-2ff087b0d48f@acm.org> (raw)
In-Reply-To: <20250523101041.3615819-1-naomi.chu@mediatek.com>
On 5/23/25 3:10 AM, naomi.chu@mediatek.com wrote:
> +static bool ufshcd_is_linereset_fatal(struct ufs_hba *hba)
> +{
> + bool needs_reset = true;
> + unsigned long flags;
> + int err;
> +
> + spin_lock_irqsave(hba->host->host_lock, flags);
> +
> + if (ufshcd_is_saved_err_fatal(hba)) {
> + spin_unlock_irqrestore(hba->host->host_lock, flags);
> + goto out;
> + }
> +
> + /*
> + * Wait for 100ms to ensure the PA_INIT flow is complete,
> + * and check for PA_INIT_ERR or other fatal errors.
> + */
> + spin_unlock_irqrestore(hba->host->host_lock, flags);
Please use scoped_guard(spinlock_irqsave) instead of calling
spin_lock_irqsave() and spin_unlock_irqrestore() directly.
> + msleep(100);
Can ufshcd_is_linereset_fatal() be called from IRQ context? If so,
calling msleep() is not allowed. If it can't be called from IRQ
context, saving and restoring 'flags' is not necessary.
Bart.
prev parent reply other threads:[~2025-05-23 16:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-23 10:10 naomi.chu
2025-05-23 16:14 ` 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=c2608cd6-8c77-48f2-bc50-2ff087b0d48f@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=alice.chao@mediatek.com \
--cc=alim.akhtar@samsung.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=avri.altman@wdc.com \
--cc=cc.chou@mediatek.com \
--cc=chun-hung.wu@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=naomi.chu@mediatek.com \
--cc=peter.wang@mediatek.com \
--cc=wsd_upstream@mediatek.com \
--cc=yi-fan.peng@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®