mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nitin Rawat <quic_nitirawa@quicinc.com>
To: Bart Van Assche <bvanassche@acm.org>, <alim.akhtar@samsung.com>,
	<avri.altman@wdc.com>, <James.Bottomley@HansenPartnership.com>,
	<huobean@gmail.com>, <mani@kernel.org>,
	<martin.petersen@oracle.com>, <beanhuo@micron.com>,
	<peter.wang@mediatek.com>, <andre.draszik@linaro.org>
Cc: <linux-arm-msm@vger.kernel.org>, <linux-scsi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Palash Kambar <quic_pkambar@quicinc.com>
Subject: Re: [PATCH V1] ufs: core: Fix interrupt handling for MCQ Mode in ufshcd_intr
Date: Tue, 29 Jul 2025 20:07:33 +0530	[thread overview]
Message-ID: <1b418968-2a53-443e-8766-9d280447bb2d@quicinc.com> (raw)
In-Reply-To: <a7cfe930-44b6-41dc-a84b-00f5ba314946@acm.org>



On 7/29/2025 5:11 AM, Bart Van Assche wrote:
> On 7/28/25 3:57 PM, Nitin Rawat wrote:
>> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
>> index fd8015ed36a4..5413464d63c8 100644
>> --- a/drivers/ufs/core/ufshcd.c
>> +++ b/drivers/ufs/core/ufshcd.c
>> @@ -7145,14 +7145,19 @@ static irqreturn_t ufshcd_threaded_intr(int 
>> irq, void *__hba)
>>   static irqreturn_t ufshcd_intr(int irq, void *__hba)
>>   {
>>       struct ufs_hba *hba = __hba;
>> +    u32 intr_status, enabled_intr_status;
>>
>>       /* Move interrupt handling to thread when MCQ & ESI are not 
>> enabled */
>>       if (!hba->mcq_enabled || !hba->mcq_esi_enabled)
>>           return IRQ_WAKE_THREAD;
>>
>> +    intr_status = ufshcd_readl(hba, REG_INTERRUPT_STATUS);
>> +    enabled_intr_status = intr_status & ufshcd_readl(hba, 
>> REG_INTERRUPT_ENABLE);
>> +
>> +    ufshcd_writel(hba, intr_status, REG_INTERRUPT_STATUS);
>> +
>>       /* Directly handle interrupts since MCQ ESI handlers does the 
>> hard job */
>> -    return ufshcd_sl_intr(hba, ufshcd_readl(hba, REG_INTERRUPT_STATUS) &
>> -                   ufshcd_readl(hba, REG_INTERRUPT_ENABLE));
>> +    return ufshcd_sl_intr(hba, enabled_intr_status);
>>   }
> 
> Hi Nitin,
> 
> Thank you for having published this patch. It seems like we both have 
> been working on a fix independently and without knowing about each 
> other's efforts. Can you please take a look at this patch and let me
> know which version you prefer?

Hi Bart,

I reviewed your patch and test it locally—it resolves the issue.

The patch looks good. Since this path handles only UIC, TM, and error 
conditions with no IO for MCQ, we still check for outstanding_reqs and 
UTP_TRANSFER_REQ_COMPL for the error case within ufshcd_threaded_intr in 
the patch. In my opinion, we can skip these additional checks.

Thanks,
Nitin

> 
> https://lore.kernel.org/linux-scsi/20250728212731.899429-1- 
> bvanassche@acm.org/
> 
> Thanks,
> 
> Bart.


  reply	other threads:[~2025-07-29 14:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-28 22:57 Nitin Rawat
2025-07-28 23:41 ` Bart Van Assche
2025-07-29 14:37   ` Nitin Rawat [this message]
2025-07-29 16:24     ` Bart Van Assche
2025-07-30  6:41       ` Peter Wang (王信友)
2025-07-30 16:04         ` Bart Van Assche
2025-07-31  9:22           ` Peter Wang (王信友)
2025-07-31  8:27 ` neil.armstrong
2025-08-06  1:54   ` Martin K. Petersen
2025-07-31 16:52 ` Bart Van Assche
2025-08-01  7:31 ` Peter Wang (王信友)

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=1b418968-2a53-443e-8766-9d280447bb2d@quicinc.com \
    --to=quic_nitirawa@quicinc.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=andre.draszik@linaro.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=huobean@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=peter.wang@mediatek.com \
    --cc=quic_pkambar@quicinc.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®