Commit d181acea authored by Sudeep Holla's avatar Sudeep Holla Committed by Jassi Brar
Browse files

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: default avatarHuisong Li <lihuisong@huawei.com>
Tested-by: default avatarHuisong Li <lihuisong@huawei.com>
Tested-by: default avatarAdam Young <admiyo@os.amperecomputing.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: default avatarJassi Brar <jassisinghbrar@gmail.com>
parent 4119a44c
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -419,8 +419,12 @@ int pcc_mbox_ioremap(struct mbox_chan *chan)
		return -1;
	pchan_info = chan->con_priv;
	pcc_mbox_chan = &pchan_info->chan;
	pcc_mbox_chan->shmem = ioremap(pcc_mbox_chan->shmem_base_addr,

	pcc_mbox_chan->shmem = acpi_os_ioremap(pcc_mbox_chan->shmem_base_addr,
					       pcc_mbox_chan->shmem_size);
	if (!pcc_mbox_chan->shmem)
		return -ENXIO;

	return 0;
}
EXPORT_SYMBOL_GPL(pcc_mbox_ioremap);