From: Sudeep Holla <sudeep.holla@arm.com>
To: Adam Young <admiyo@amperemail.onmicrosoft.com>
Cc: Adam Young <admiyo@os.amperecomputing.com>,
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 20:52:55 +0100 [thread overview]
Message-ID: <20260723-electric-dynamic-oriole-e79b33@sudeepholla> (raw)
In-Reply-To: <18d7ecb3-c0a1-4d10-9b26-1f287e2de4bb@amperemail.onmicrosoft.com>
On Thu, Jul 23, 2026 at 11:57:58AM -0400, Adam Young wrote:
>
> 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.
>
My mistake, I must pay more attention 🙁. I wanted it to be error case
and always read it as if(ret..) instead of if(!ret..), sorry for that.
--
Regards,
Sudeep
prev parent reply other threads:[~2026-07-23 19:54 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
2026-07-23 19:52 ` Sudeep Holla [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=20260723-electric-dynamic-oriole-e79b33@sudeepholla \
--to=sudeep.holla@arm.com \
--cc=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 \
/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