Skip to content

Commit d181ace

Browse files
sudeep-hollaJassi Brar
authored andcommitted
mailbox: pcc: Use acpi_os_ioremap() instead of ioremap()
The Platform Communication Channel (PCC) mailbox driver currently uses ioremap() to map channel shared memory regions. However it is preferred to use acpi_os_ioremap(), which is mapping function specific to EFI/ACPI defined memory regions. It ensures that the correct memory attributes are applied when mapping ACPI-provided regions. While at it, also add checks for handling any errors with the mapping. Acked-by: Huisong Li <lihuisong@huawei.com> Tested-by: Huisong Li <lihuisong@huawei.com> Tested-by: Adam Young <admiyo@os.amperecomputing.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
1 parent 4119a44 commit d181ace

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/mailbox/pcc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,12 @@ int pcc_mbox_ioremap(struct mbox_chan *chan)
419419
return -1;
420420
pchan_info = chan->con_priv;
421421
pcc_mbox_chan = &pchan_info->chan;
422-
pcc_mbox_chan->shmem = ioremap(pcc_mbox_chan->shmem_base_addr,
423-
pcc_mbox_chan->shmem_size);
422+
423+
pcc_mbox_chan->shmem = acpi_os_ioremap(pcc_mbox_chan->shmem_base_addr,
424+
pcc_mbox_chan->shmem_size);
425+
if (!pcc_mbox_chan->shmem)
426+
return -ENXIO;
427+
424428
return 0;
425429
}
426430
EXPORT_SYMBOL_GPL(pcc_mbox_ioremap);

0 commit comments

Comments
 (0)