Message ID | 20250303-pcc_fixes_updates-v1-7-3b44f3d134b1@arm.com |
---|---|
State | New |
Headers | show |
Series | mailbox: pcc: Fixes and cleanup/refactoring | expand |
在 2025/3/3 18:51, Sudeep Holla 写道: > In order to add support of mapping the generic communication shared > memory region in the PCC mailbox driver when the PCC channel is requested, > we need to move pcc_mbox_ioremap() before pcc_mbox_request_channel(). This patch is supposed to merge into patch 8/14 because it depend on this moving. > > No functional change. > > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> > --- > drivers/mailbox/pcc.c | 38 +++++++++++++++++++------------------- > 1 file changed, 19 insertions(+), 19 deletions(-) > > diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c > index e693675ce1fbd8d01d0640b3053a5c1882bdbce7..f230e512c29b79fc03e429145180ff049a250d2d 100644 > --- a/drivers/mailbox/pcc.c > +++ b/drivers/mailbox/pcc.c > @@ -357,6 +357,25 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) > return IRQ_HANDLED; > } > > +int pcc_mbox_ioremap(struct mbox_chan *chan) > +{ > + struct pcc_chan_info *pchan_info; > + struct pcc_mbox_chan *pcc_mbox_chan; > + > + if (!chan || !chan->cl) > + return -1; > + pchan_info = chan->con_priv; > + pcc_mbox_chan = &pchan_info->chan; > + > + 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); > + > /** > * pcc_mbox_request_channel - PCC clients call this function to > * request a pointer to their PCC subspace, from which they > @@ -419,25 +438,6 @@ void pcc_mbox_free_channel(struct pcc_mbox_chan *pchan) > } > EXPORT_SYMBOL_GPL(pcc_mbox_free_channel); > > -int pcc_mbox_ioremap(struct mbox_chan *chan) > -{ > - struct pcc_chan_info *pchan_info; > - struct pcc_mbox_chan *pcc_mbox_chan; > - > - if (!chan || !chan->cl) > - return -1; > - pchan_info = chan->con_priv; > - pcc_mbox_chan = &pchan_info->chan; > - > - 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); > - > /** > * pcc_send_data - Called from Mailbox Controller code. Used > * here only to ring the channel doorbell. The PCC client >
On Wed, Mar 05, 2025 at 02:48:13PM +0800, lihuisong (C) wrote: > > 在 2025/3/3 18:51, Sudeep Holla 写道: > > In order to add support of mapping the generic communication shared > > memory region in the PCC mailbox driver when the PCC channel is requested, > > we need to move pcc_mbox_ioremap() before pcc_mbox_request_channel(). > This patch is supposed to merge into patch 8/14 because it depend on this > moving. Not sure what exactly you mean. This is 7/14 and 8/14 depends on it which falls in natural order. Or do you mean just merge the patch into one. I can do that as well, just kept it separate to easy the review. Let me know. I thought keeping it separate is good for bisectibility in case I break anything with these change 😉.
On Wed, Mar 05, 2025 at 10:56:57AM +0000, Sudeep Holla wrote: > On Wed, Mar 05, 2025 at 02:48:13PM +0800, lihuisong (C) wrote: > > > > 在 2025/3/3 18:51, Sudeep Holla 写道: > > > In order to add support of mapping the generic communication shared > > > memory region in the PCC mailbox driver when the PCC channel is requested, > > > we need to move pcc_mbox_ioremap() before pcc_mbox_request_channel(). > > This patch is supposed to merge into patch 8/14 because it depend on this > > moving. > > Not sure what exactly you mean. This is 7/14 and 8/14 depends on it which > falls in natural order. Or do you mean just merge the patch into one. I > can do that as well, just kept it separate to easy the review. Let me > know. I thought keeping it separate is good for bisectibility in case > I break anything with these change 😉. > Scratch that, after reworking 8/14 as per your suggestion made me realise what you meant. Sorry for that. Dropping this patch entirely now.
diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index e693675ce1fbd8d01d0640b3053a5c1882bdbce7..f230e512c29b79fc03e429145180ff049a250d2d 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -357,6 +357,25 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) return IRQ_HANDLED; } +int pcc_mbox_ioremap(struct mbox_chan *chan) +{ + struct pcc_chan_info *pchan_info; + struct pcc_mbox_chan *pcc_mbox_chan; + + if (!chan || !chan->cl) + return -1; + pchan_info = chan->con_priv; + pcc_mbox_chan = &pchan_info->chan; + + 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); + /** * pcc_mbox_request_channel - PCC clients call this function to * request a pointer to their PCC subspace, from which they @@ -419,25 +438,6 @@ void pcc_mbox_free_channel(struct pcc_mbox_chan *pchan) } EXPORT_SYMBOL_GPL(pcc_mbox_free_channel); -int pcc_mbox_ioremap(struct mbox_chan *chan) -{ - struct pcc_chan_info *pchan_info; - struct pcc_mbox_chan *pcc_mbox_chan; - - if (!chan || !chan->cl) - return -1; - pchan_info = chan->con_priv; - pcc_mbox_chan = &pchan_info->chan; - - 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); - /** * pcc_send_data - Called from Mailbox Controller code. Used * here only to ring the channel doorbell. The PCC client
In order to add support of mapping the generic communication shared memory region in the PCC mailbox driver when the PCC channel is requested, we need to move pcc_mbox_ioremap() before pcc_mbox_request_channel(). No functional change. Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> --- drivers/mailbox/pcc.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-)