[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c2608cd6-8c77-48f2-bc50-2ff087b0d48f@acm.org>
Date: Fri, 23 May 2025 09:14:17 -0700
From: Bart Van Assche <bvanassche@....org>
To: naomi.chu@...iatek.com, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, Alim Akhtar <alim.akhtar@...sung.com>,
Avri Altman <avri.altman@....com>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
Cc: wsd_upstream@...iatek.com, peter.wang@...iatek.com,
alice.chao@...iatek.com, chun-hung.wu@...iatek.com, cc.chou@...iatek.com,
yi-fan.peng@...iatek.com
Subject: Re: [PATCH 1/1] ufs: core: add fatal errors check for LINERESET
On 5/23/25 3:10 AM, naomi.chu@...iatek.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.
Powered by blists - more mailing lists