Re: [PATCH 3/4] ACPI: PCC: Free channel on OpRegion deactivation

Sudeep Holla <[email protected]> Wed, 22 Jul 2026 09:45:48 +0100
Newsgroups dev.linux.lists.acpica-devel,org.kernel.vger.linux-acpi,org.kernel.vger.linux-kernel
Message-ID <20260722-advanced-economic-tench-aa8a08@sudeepholla>
On Wed, Jul 22, 2026 at 09:15:40AM +0800, lihuisong (C) wrote:
> 
> On 7/17/2026 4:10 PM, Sudeep Holla wrote:
> > ACPICA calls the address space setup callback with
> > ACPI_REGION_DEACTIVATE when a PCC OperationRegion is torn down.
> > 
> > The PCC setup callback currently allocates a fresh pcc_data and requests
> > the mailbox channel before looking at the function argument. If ACPICA
> > deactivates a region, this can leave the existing region context and
> > mailbox channel unreleased, and may also request a channel during
> > teardown.
> > 
> > Handle ACPI_REGION_DEACTIVATE before allocation. Free the PCC mailbox
> > channel, release the region context and clear the context pointer.
> > 
> > Fixes: 77e2a04745ff ("ACPI: PCC: Implement OperationRegion handler for the PCC Type 3 subtype")
> > Signed-off-by: Sudeep Holla <[email protected]>
> > ---
> How to trigger this region deactivate at runtime?
> 

I haven't tried it myself. I wasn't even aware of ACPI_REGION_DEACTIVATE
until sashiko pointed it out and then did some digging in the code.

> Overall looks good to me.
> Reviewed-by: Huisong Li <[email protected]>

Thanks!

-- 
Regards,
Sudeep