From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796387578; b=B/pYiFwmdWESR5NxD73Aef/kWl+7dngFc5BmGq0SbBiFq/JmEMMDYDcifIKaQt/5a+k2 AZ2UbFhX/dgz/xMzd98ioWBOzLZmBQ9++3J7bIdi4N++Ck5d8X4ubqyDzuPAFcIPGjEQv 0c7EziEOD4xfaIFzGvWRLRYFBlkPaN+oXOqa8TrbKadiKXqjV8PHi2AAy6PoZ/GHRDihL 5eRP/U5I9XuRKwqphP3rKy87+cLxJxNghYx6wWJUfZ5j95wbRigwYdNgbDVN/wOAW6A39 6jjSmQR3qZvuLnqurlqOkOSZHSVQvKcwb+QNKtGedwYmEopVyf4ieEnIkq6Gj3dS/zA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387578; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=3T7lvDtESeQoHCtv138tHyVTFuey0V9kkzuSAwXlls0=; b=qujAiszT31AZ+BeJ8AHn3/K92cUHWQSbV/u8Mple4TOQUCyJi3TJe//x+++fIytGtRP+ nyvDAa/lHD0c7Qg/i9XEb+ePOF5qtyp8Bxhgs4gC1BdWXjX9O9thGahinpIVGLUIAvZgx n8BT7jcxgRUz1pLn4HZ7vkC1YJdocJd4+6fXxBuVaaf4/MmgO4rJEyDT9q89ZlSQMOH3p XSy/WIZYEwVgX6GY+9W8IkH4lWFBdg4tg9dkh7xhRsu1d55e2s82jNZqCHjiitITY3kl4 mZiGnZdkmcmo541JLPqAb+HYTBPmEfvBacRU76LhRx9SAEgUwP+dUu5dE7b3ccGbs2g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=2PVbfcGy; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49283606A322; Fri, 4 Dec 2026 12:32:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=2PVbfcGy Received: by smtp.kernel.org (Postfix) with ESMTPSA id B46BE1F000C2; Fri, 4 Dec 2026 12:32:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387578; bh=3T7lvDtESeQoHCtv138tHyVTFuey0V9kkzuSAwXlls0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=2PVbfcGyl2agJbHjhpmFQwwpSsLID6SJFXRQ93E7ANTVA4YZkguGQYDnw65iJ4A/z QrKcAjPZTgUV1E/RivvdBMGcKZ8CLlVuHXL/ot8GbIivjxmXkliZo/e5+a6jsISnCY E8eGakjFB77Y0iLiz50wmIZqphiMMSuV0MZaCsCQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Huisong Li , Sudeep Holla , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 6.1 0303/1059] ACPI: PCC: Free channel on OpRegion deactivation Date: Fri, 4 Dec 2026 18:57:14 +0900 Message-ID: <20261204100652.121533704@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sudeep Holla [ Upstream commit fa9c7ee692988edddc1da74bc5257d53dd3c7130 ] 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") Reviewed-by: Huisong Li Signed-off-by: Sudeep Holla Link: https://patch.msgid.link/20260922144302.3847593-4-sudeep.holla@kernel.org Signed-off-by: Rafael J. Wysocki [ sashal: Replaced kzalloc_obj(*data) with this branch's kzalloc(sizeof(*data), GFP_KERNEL) in the context line, since the kzalloc_obj() helper is missing here. ] Signed-off-by: Sasha Levin --- drivers/acpi/acpi_pcc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c index 683924a708ba0..04bb232603965 100644 --- a/drivers/acpi/acpi_pcc.c +++ b/drivers/acpi/acpi_pcc.c @@ -55,6 +55,19 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function, struct pcc_mbox_chan *pcc_chan; acpi_status ret; + if (function == ACPI_REGION_DEACTIVATE) { + data = *region_context; + if (data) { + pcc_mbox_free_channel(data->pcc_chan); + kfree(data); + *region_context = NULL; + } + return AE_OK; + } + + if (function != ACPI_REGION_ACTIVATE) + return AE_BAD_PARAMETER; + data = kzalloc(sizeof(*data), GFP_KERNEL); if (!data) return AE_NO_MEMORY; -- 2.53.0