@@ -357,7 +357,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p)
return IRQ_HANDLED;
}
-int pcc_mbox_ioremap(struct mbox_chan *chan)
+static int pcc_mbox_ioremap(struct mbox_chan *chan)
{
struct pcc_chan_info *pchan_info;
struct pcc_mbox_chan *pcc_mbox_chan;
@@ -374,7 +374,6 @@ int pcc_mbox_ioremap(struct mbox_chan *chan)
return 0;
}
-EXPORT_SYMBOL_GPL(pcc_mbox_ioremap);
/**
* pcc_mbox_request_channel - PCC clients call this function to
@@ -409,7 +408,12 @@ pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id)
if (rc)
return ERR_PTR(rc);
- return &pchan->chan;
+ rc = pcc_mbox_ioremap(chan);
+ if (!rc)
+ return &pchan->chan;
+
+ mbox_free_channel(chan);
+ return ERR_PTR(rc);
}
EXPORT_SYMBOL_GPL(pcc_mbox_request_channel);
@@ -38,7 +38,6 @@ struct pcc_mbox_chan {
extern struct pcc_mbox_chan *
pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id);
extern void pcc_mbox_free_channel(struct pcc_mbox_chan *chan);
-extern int pcc_mbox_ioremap(struct mbox_chan *chan);
#else
static inline struct pcc_mbox_chan *
pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id)
@@ -46,10 +45,6 @@ pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id)
return ERR_PTR(-ENODEV);
}
static inline void pcc_mbox_free_channel(struct pcc_mbox_chan *chan) { }
-static inline int pcc_mbox_ioremap(struct mbox_chan *chan)
-{
- return 0;
-};
#endif
#endif /* _PCC_H */
Currently the shared memory communication address was mapped by the mailbox client drivers leading to all sorts of inconsistencies. It also has resulted in the inconsistent attributes used while mapping the shared memory regions. In order to remove/eliminate any issues, let us ensures the shared memory address is always mapped and unmapped when the PCC channels are requested and release. We need to map them as the ACPI PCCT associates these shared memory with each channel subspace and may need use the headers in those memory to manage the transport. Since there are no users of pcc_chan_ioremap() and also it is mapped by default, we can stop exporting it and make it static function. Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> --- drivers/mailbox/pcc.c | 10 +++++++--- include/acpi/pcc.h | 5 ----- 2 files changed, 7 insertions(+), 8 deletions(-)