Skip to content

Commit 8960c45

Browse files
sudeep-hollarafaeljw
authored andcommitted
ACPI: PCC: Simplify PCC shared memory region handling
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. Tested-by: Adam Young <[email protected]> Signed-off-by: Sudeep Holla <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent b443265 commit 8960c45

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

drivers/acpi/acpi_pcc.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
struct pcc_data {
3333
struct pcc_mbox_chan *pcc_chan;
34-
void __iomem *pcc_comm_addr;
3534
struct completion done;
3635
struct mbox_client cl;
3736
struct acpi_pcc_info ctx;
@@ -81,14 +80,6 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function,
8180
ret = AE_SUPPORT;
8281
goto err_free_channel;
8382
}
84-
data->pcc_comm_addr = acpi_os_ioremap(pcc_chan->shmem_base_addr,
85-
pcc_chan->shmem_size);
86-
if (!data->pcc_comm_addr) {
87-
pr_err("Failed to ioremap PCC comm region mem for %d\n",
88-
ctx->subspace_id);
89-
ret = AE_NO_MEMORY;
90-
goto err_free_channel;
91-
}
9283

9384
*region_context = data;
9485
return AE_OK;
@@ -113,7 +104,7 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
113104
reinit_completion(&data->done);
114105

115106
/* Write to Shared Memory */
116-
memcpy_toio(data->pcc_comm_addr, (void *)value, data->ctx.length);
107+
memcpy_toio(data->pcc_chan->shmem, (void *)value, data->ctx.length);
117108

118109
ret = mbox_send_message(data->pcc_chan->mchan, NULL);
119110
if (ret < 0)
@@ -134,7 +125,7 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
134125

135126
mbox_chan_txdone(data->pcc_chan->mchan, ret);
136127

137-
memcpy_fromio(value, data->pcc_comm_addr, data->ctx.length);
128+
memcpy_fromio(value, data->pcc_chan->shmem, data->ctx.length);
138129

139130
return AE_OK;
140131
}

0 commit comments

Comments
 (0)