The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Adam Young <admiyo@amperemail.onmicrosoft.com>
To: Breno Leitao <leitao@debian.org>
Cc: Sudeep Holla <sudeep.holla@kernel.org>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Adam Young <admiyo@os.amperecomputing.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	rmikey@meta.com, kernel-team@meta.com
Subject: Re: [PATCH] mailbox: pcc: Free the channel before unmapping the shared memory
Date: Mon, 17 Aug 2026 13:06:37 -0400	[thread overview]
Message-ID: <6901c700-d19f-4e63-b23d-c5f746ec0898@amperemail.onmicrosoft.com> (raw)
In-Reply-To: <aoLVnCqlj3ffTd-e@gmail.com>


On 8/17/26 05:42, Breno Leitao wrote:
> Hello Adam,
>
> On Sat, Aug 15, 2026 at 11:58:16PM -0400, Adam Young wrote:
>> On 8/12/26 08:36, Breno Leitao wrote:
>>> Free the channel first, before the memory unmap. mbox_free_channel()
>>> calls pcc_shutdown(), which frees the platform interrupt, and then unmap
>>> shared memory.
>> I posted a related fix undere the MCTP PCC Driver changes.
>>
>> This fix is necessary but not sufficient to deal with the race conditions.
>> Take a look at the series of patches under here:
>>
>> https://lore.kernel.org/all/20260721175258.87600-1-admiyo@os.amperecomputing.com/
> That looks like a much bigger series, with new features, open discussions,
> Nacks, and already 45 revisions.
>
> This curent fix is only meant to address a real problem (user after
> free) I am hitting in production systems.
>
> My suggestion is that we get this real issue unblocked, even if not
> complete, while you keep working on your larger series.
>
> Thanks,
> --breno

There are two patches that address this issue from that series:

This one is, I believe, a superset of the fix you put in.

https://lore.kernel.org/all/20260721175258.87600-2-admiyo@os.amperecomputing.com/

Note that the unmap is moved to the mailbox teardown function, which 
happens immediately after the IRQ unregister.  Those two operatations 
need to happen atomically to avoid the issue you saw. Thus, I think your 
patch is insufficient to actually deal with the race condition:  it 
needs to happen in pcc_shutdown.


      parent reply	other threads:[~2026-08-17 17:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 12:36 [PATCH] mailbox: pcc: Free the channel before unmapping the shared memory Breno Leitao
2026-08-13  2:57 ` Sudeep Holla
2026-08-13  8:18   ` Breno Leitao
2026-08-13 10:45     ` Sudeep Holla
2026-08-13 10:54 ` Sudeep Holla
2026-08-16  3:58 ` Adam Young
2026-08-17  9:42   ` Breno Leitao
2026-08-17 16:59     ` Adam Young
2026-08-17 17:06     ` Adam Young [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=6901c700-d19f-4e63-b23d-c5f746ec0898@amperemail.onmicrosoft.com \
    --to=admiyo@amperemail.onmicrosoft.com \
    --cc=admiyo@os.amperecomputing.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=leitao@debian.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmikey@meta.com \
    --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