[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0gOCX5GGS8F6HidNM46wuKmUE5CdSGtxAm2v3-a-s80Og@mail.gmail.com>
Date: Wed, 30 Apr 2025 21:53:12 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Sudeep Holla <sudeep.holla@....com>
Cc: linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
"Rafael J. Wysocki" <rafael@...nel.org>, Adam Young <admiyo@...amperecomputing.com>
Subject: Re: [PATCH 1/2] ACPI: PCC: Simplify PCC shared memory region handling
On Fri, Apr 11, 2025 at 1:31 PM Sudeep Holla <sudeep.holla@....com> wrote:
>
> The PCC driver now handles mapping and unmapping of shared memory
> areas as part of pcc_mbox_{request,free}_channel(). Without these before,
> this ACPI PCC opregion driver did handling of those mappings like several
> other PCC mailbox client drivers.
>
> There were redundant operations, leading to unnecessary code. Maintaining
> the consistency across these driver was harder due to scattered handling
> of shmem.
>
> Just use the mapped shmem and remove all redundant operations from this
> driver.
>
> Cc: "Rafael J. Wysocki" <rafael@...nel.org>
> Tested-by: Adam Young <admiyo@...amperecomputing.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@....com>
> ---
> drivers/acpi/acpi_pcc.c | 13 ++-----------
> 1 file changed, 2 insertions(+), 11 deletions(-)
>
> Hi Rafael,
>
> This is just resend of the couple of patches that was part of a series [1][2].
> Only core PCC mailbox changes were merged during v6.15 merge window.
> So dropping all the maintainer acks and reposting it so that it can
> be picked up for v6.16 via maintainers tree.
>
> [1] https://lore.kernel.org/all/20250313-pcc_fixes_updates-v3-12-019a4aa74d0f@arm.com/
> [2] https://lore.kernel.org/all/20250313-pcc_fixes_updates-v3-13-019a4aa74d0f@arm.com/
Both applied as 6.16 material, thanks!
> diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c
> index 07a034a53aca..97064e943768 100644
> --- a/drivers/acpi/acpi_pcc.c
> +++ b/drivers/acpi/acpi_pcc.c
> @@ -31,7 +31,6 @@
>
> struct pcc_data {
> struct pcc_mbox_chan *pcc_chan;
> - void __iomem *pcc_comm_addr;
> struct completion done;
> struct mbox_client cl;
> struct acpi_pcc_info ctx;
> @@ -81,14 +80,6 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function,
> ret = AE_SUPPORT;
> goto err_free_channel;
> }
> - data->pcc_comm_addr = acpi_os_ioremap(pcc_chan->shmem_base_addr,
> - pcc_chan->shmem_size);
> - if (!data->pcc_comm_addr) {
> - pr_err("Failed to ioremap PCC comm region mem for %d\n",
> - ctx->subspace_id);
> - ret = AE_NO_MEMORY;
> - goto err_free_channel;
> - }
>
> *region_context = data;
> return AE_OK;
> @@ -113,7 +104,7 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
> reinit_completion(&data->done);
>
> /* Write to Shared Memory */
> - memcpy_toio(data->pcc_comm_addr, (void *)value, data->ctx.length);
> + memcpy_toio(data->pcc_chan->shmem, (void *)value, data->ctx.length);
>
> ret = mbox_send_message(data->pcc_chan->mchan, NULL);
> if (ret < 0)
> @@ -134,7 +125,7 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
>
> mbox_chan_txdone(data->pcc_chan->mchan, ret);
>
> - memcpy_fromio(value, data->pcc_comm_addr, data->ctx.length);
> + memcpy_fromio(value, data->pcc_chan->shmem, data->ctx.length);
>
> return AE_OK;
> }
> --
> 2.34.1
>
Powered by blists - more mailing lists