From: Adam Young <admiyo@amperemail.onmicrosoft.com>
To: Sudeep Holla <sudeep.holla@kernel.org>,
Adam Young <admiyo@os.amperecomputing.com>
Cc: jassisinghbrar@gmail.com, lihuisong@huawei.com,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] mailbox: pcc: Fix command timeout due to missed interrupt
Date: Thu, 23 Jul 2026 11:57:58 -0400 [thread overview]
Message-ID: <18d7ecb3-c0a1-4d10-9b26-1f287e2de4bb@amperemail.onmicrosoft.com> (raw)
In-Reply-To: <20260723-mastodon-of-simple-criticism-2bdcc9@sudeepholla>
On 7/23/26 05:16, Sudeep Holla wrote:
> On Wed, Jul 22, 2026 at 11:10:51PM -0400, Adam Young wrote:
>>
>> + /*
>> + * Set chan_in_use before ringing the doorbell so a fast completion
>> + * interrupt is not mistaken for a shared interrupt from another
>> + * subspace. Use WRITE_ONCE() for the lockless flag update. The
>> + * ordered MMIO accessor used to ring the doorbell keeps this store
>> + * visible before the platform is notified.
>> + */
>> + if (pchan->plat_irq > 0)
>> + WRITE_ONCE(pchan->chan_in_use, true);
>> ret = pcc_chan_reg_read_modify_write(&pchan->db);
>> if (!ret && pchan->plat_irq > 0)
>> - pchan->chan_in_use = true;
>> + WRITE_ONCE(pchan->chan_in_use, false);
>>
>> return ret;
>> }
>> --
>> 2.43.0
>> iAt the end of the above code,
>> WRITE_ONCE(pchan->chan_in_use, false);
>> should be
>> WRITE_ONCE(pchan->chan_in_use, true);
>>
>> In order to keep the original semantics. The flag is cleared when the
>> messages is ACKed, not here. This version causes a hang.
>>
> Did you run and seeing hang or just code inspection. If latter, have you
> considered that modified code sets it true before doorbell is rung and
> set to false only if there is a failure to ring the doorbell ?
>
Yes, I saw the hang, and debugged to see this line semantically
different. I changed it to true and things resumed working. !ret is 0
so that happens in the success case.
next prev parent reply other threads:[~2026-07-23 15:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 7:56 [PATCH 0/3] mailbox: pcc: Improve completion handling and validation Sudeep Holla
2026-07-17 7:56 ` [PATCH 1/3] mailbox: pcc: Notify clients on polled completion Sudeep Holla
2026-07-23 16:03 ` Adam Young
2026-07-23 19:45 ` Sudeep Holla
2026-07-24 17:11 ` Adam Young
2026-07-24 18:06 ` Sudeep Holla
2026-07-17 7:56 ` [PATCH 2/3] mailbox: pcc: Check shared memory signature on request Sudeep Holla
2026-07-20 11:20 ` lihuisong (C)
2026-07-20 14:58 ` Alexey Klimov
2026-07-23 15:47 ` Adam Young
2026-07-17 7:56 ` [PATCH 3/3] mailbox: pcc: Fix command timeout due to missed interrupt Sudeep Holla
2026-07-23 3:10 ` Adam Young
2026-07-23 9:16 ` Sudeep Holla
2026-07-23 9:47 ` lihuisong (C)
2026-07-23 10:19 ` Sudeep Holla
2026-07-23 15:57 ` Adam Young [this message]
2026-07-23 19:52 ` Sudeep Holla
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=18d7ecb3-c0a1-4d10-9b26-1f287e2de4bb@amperemail.onmicrosoft.com \
--to=admiyo@amperemail.onmicrosoft.com \
--cc=admiyo@os.amperecomputing.com \
--cc=jassisinghbrar@gmail.com \
--cc=lihuisong@huawei.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sudeep.holla@kernel.org \
/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®