[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250313-pcc_fixes_updates-v3-5-019a4aa74d0f@arm.com>
Date: Thu, 13 Mar 2025 15:28:51 +0000
From: Sudeep Holla <sudeep.holla@....com>
To: linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Sudeep Holla <sudeep.holla@....com>,
Jassi Brar <jassisinghbrar@...il.com>, Huisong Li <lihuisong@...wei.com>,
Adam Young <admiyo@...amperecomputing.com>,
Robbie King <robbiek@...ghtlabs.com>
Subject: [PATCH v3 05/13] 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@...wei.com>
Tested-by: Huisong Li <lihuisong@...wei.com>
Tested-by: Adam Young <admiyo@...amperecomputing.com>
Signed-off-by: Sudeep Holla <sudeep.holla@....com>
---
drivers/mailbox/pcc.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
index 7105dd6bc2fc6b8d36cb62f7ecd1b578361f89b6..fcbf19d7472d05f3c39389d292e6c6646e4b6b24 100644
--- a/drivers/mailbox/pcc.c
+++ b/drivers/mailbox/pcc.c
@@ -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_size);
+
+ 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);
--
2.34.1
Powered by blists - more mailing lists