mbox series

[0/3] mailbox: Allow direct registration to a channel

Message ID 20230213232537.2040976-1-quic_eberman@quicinc.com
Headers show
Series mailbox: Allow direct registration to a channel | expand

Message

Elliot Berman Feb. 13, 2023, 11:25 p.m. UTC
Two mailbox controllers have channel/client binding mechanisms that are
controller-specific and not using the devicetree binding mechanisms. Mailbox
channel/client is conceptually done in two steps: selecting the channel
and binding the selected to channel to a client. Channel selection is sometimes
controller specific (pcc and omap are examples). The channel/client binding
code is all the same.

This small series de-duplicates and refactors the channel/client binding
into a common framework function: "mbox_bind_client" which all of the
channel selection mechanisms can use.

I found this duplicate code while working on the support for Gunyah hypervisor
message queues [1]. I've only been able to compile-test omap-maiblox and pcc,
however it is a straightforward conversion here.

[1]: https://lore.kernel.org/all/20230120224627.4053418-9-quic_eberman@quicinc.com/

Elliot Berman (3):
  mailbox: Allow direct registration to a channel
  mailbox: omap: Use mbox_bind_client
  mailbox: pcc: Use mbox_bind_client

 drivers/mailbox/mailbox.c      | 96 ++++++++++++++++++++++++----------
 drivers/mailbox/omap-mailbox.c | 22 ++------
 drivers/mailbox/pcc.c          | 82 ++++++++++++++++-------------
 include/linux/mailbox_client.h |  1 +
 4 files changed, 118 insertions(+), 83 deletions(-)


base-commit: 09e41676e35ab06e4bce8870ea3bf1f191c3cb90

Comments

Sudeep Holla Feb. 15, 2023, 10:17 a.m. UTC | #1
On Mon, Feb 13, 2023 at 03:25:34PM -0800, Elliot Berman wrote:
> Two mailbox controllers have channel/client binding mechanisms that are
> controller-specific and not using the devicetree binding mechanisms. Mailbox
> channel/client is conceptually done in two steps: selecting the channel
> and binding the selected to channel to a client. Channel selection is sometimes
> controller specific (pcc and omap are examples). The channel/client binding
> code is all the same.
> 
> This small series de-duplicates and refactors the channel/client binding
> into a common framework function: "mbox_bind_client" which all of the
> channel selection mechanisms can use.
> 
> I found this duplicate code while working on the support for Gunyah hypervisor
> message queues [1]. I've only been able to compile-test omap-maiblox and pcc,
> however it is a straightforward conversion here.
> 
> [1]: https://lore.kernel.org/all/20230120224627.4053418-9-quic_eberman@quicinc.com/
> 
> Elliot Berman (3):
>   mailbox: Allow direct registration to a channel

I am unable to find the above patch either in my inbox or in lore[1].
Can you please repost the same ? I would like to test/review w.r.t PCC
driver.

--
Regards,
Sudeep

[1] https://lore.kernel.org/all/20230213232537.2040976-1-quic_eberman@quicinc.com/
Elliot Berman Feb. 15, 2023, 4:58 p.m. UTC | #2
On 2/15/2023 2:17 AM, Sudeep Holla wrote:
> On Mon, Feb 13, 2023 at 03:25:34PM -0800, Elliot Berman wrote:
>> Two mailbox controllers have channel/client binding mechanisms that are
>> controller-specific and not using the devicetree binding mechanisms. Mailbox
>> channel/client is conceptually done in two steps: selecting the channel
>> and binding the selected to channel to a client. Channel selection is sometimes
>> controller specific (pcc and omap are examples). The channel/client binding
>> code is all the same.
>>
>> This small series de-duplicates and refactors the channel/client binding
>> into a common framework function: "mbox_bind_client" which all of the
>> channel selection mechanisms can use.
>>
>> I found this duplicate code while working on the support for Gunyah hypervisor
>> message queues [1]. I've only been able to compile-test omap-maiblox and pcc,
>> however it is a straightforward conversion here.
>>
>> [1]: https://lore.kernel.org/all/20230120224627.4053418-9-quic_eberman@quicinc.com/
>>
>> Elliot Berman (3):
>>    mailbox: Allow direct registration to a channel
> 
> I am unable to find the above patch either in my inbox or in lore[1].
> Can you please repost the same ? I would like to test/review w.r.t PCC
> driver.
> 

Hi Sudeep,

Not sure why the patch didn't end up your inbox; lore seems to have 
linked it correctly and indicates you were in To:. If I missed 
something, let me know and I'll make sure you're properly included if 
future versions needed.

https://lore.kernel.org/all/20230213232537.2040976-4-quic_eberman@quicinc.com/

Thanks,
Elliot

> --
> Regards,
> Sudeep
> 
> [1] https://lore.kernel.org/all/20230213232537.2040976-1-quic_eberman@quicinc.com/
>
Sudeep Holla Feb. 16, 2023, 9:58 a.m. UTC | #3
On Wed, Feb 15, 2023 at 08:58:10AM -0800, Elliot Berman wrote:
> 
> 
> On 2/15/2023 2:17 AM, Sudeep Holla wrote:
> > On Mon, Feb 13, 2023 at 03:25:34PM -0800, Elliot Berman wrote:
> > > Two mailbox controllers have channel/client binding mechanisms that are
> > > controller-specific and not using the devicetree binding mechanisms. Mailbox
> > > channel/client is conceptually done in two steps: selecting the channel
> > > and binding the selected to channel to a client. Channel selection is sometimes
> > > controller specific (pcc and omap are examples). The channel/client binding
> > > code is all the same.
> > > 
> > > This small series de-duplicates and refactors the channel/client binding
> > > into a common framework function: "mbox_bind_client" which all of the
> > > channel selection mechanisms can use.
> > > 
> > > I found this duplicate code while working on the support for Gunyah hypervisor
> > > message queues [1]. I've only been able to compile-test omap-maiblox and pcc,
> > > however it is a straightforward conversion here.
> > > 
> > > [1]: https://lore.kernel.org/all/20230120224627.4053418-9-quic_eberman@quicinc.com/
> > > 
> > > Elliot Berman (3):
> > >    mailbox: Allow direct registration to a channel
> > 
> > I am unable to find the above patch either in my inbox or in lore[1].
> > Can you please repost the same ? I would like to test/review w.r.t PCC
> > driver.
> > 
> 
> Hi Sudeep,
> 
> Not sure why the patch didn't end up your inbox; lore seems to have linked
> it correctly and indicates you were in To:. If I missed something, let me
> know and I'll make sure you're properly included if future versions needed.
> 
> https://lore.kernel.org/all/20230213232537.2040976-4-quic_eberman@quicinc.com/

No, I do have patch 2/3 and 3/3 in my inbox along with the cover letter.
Patch 1/3 is missing in both my inbox and lore. Can you send me the lore
link for patch 1/3 if you are able to find it ? Or just repost the series
if you can't.
Elliot Berman Feb. 16, 2023, 4:41 p.m. UTC | #4
On 2/16/2023 1:58 AM, Sudeep Holla wrote:
> On Wed, Feb 15, 2023 at 08:58:10AM -0800, Elliot Berman wrote:
>>
>>
>> On 2/15/2023 2:17 AM, Sudeep Holla wrote:
>>> On Mon, Feb 13, 2023 at 03:25:34PM -0800, Elliot Berman wrote:
>>>> Two mailbox controllers have channel/client binding mechanisms that are
>>>> controller-specific and not using the devicetree binding mechanisms. Mailbox
>>>> channel/client is conceptually done in two steps: selecting the channel
>>>> and binding the selected to channel to a client. Channel selection is sometimes
>>>> controller specific (pcc and omap are examples). The channel/client binding
>>>> code is all the same.
>>>>
>>>> This small series de-duplicates and refactors the channel/client binding
>>>> into a common framework function: "mbox_bind_client" which all of the
>>>> channel selection mechanisms can use.
>>>>
>>>> I found this duplicate code while working on the support for Gunyah hypervisor
>>>> message queues [1]. I've only been able to compile-test omap-maiblox and pcc,
>>>> however it is a straightforward conversion here.
>>>>
>>>> [1]: https://lore.kernel.org/all/20230120224627.4053418-9-quic_eberman@quicinc.com/
>>>>
>>>> Elliot Berman (3):
>>>>     mailbox: Allow direct registration to a channel
>>>
>>> I am unable to find the above patch either in my inbox or in lore[1].
>>> Can you please repost the same ? I would like to test/review w.r.t PCC
>>> driver.
>>>
>>
>> Hi Sudeep,
>>
>> Not sure why the patch didn't end up your inbox; lore seems to have linked
>> it correctly and indicates you were in To:. If I missed something, let me
>> know and I'll make sure you're properly included if future versions needed.
>>
>> https://lore.kernel.org/all/20230213232537.2040976-4-quic_eberman@quicinc.com/
> 
> No, I do have patch 2/3 and 3/3 in my inbox along with the cover letter.
> Patch 1/3 is missing in both my inbox and lore. Can you send me the lore
> link for patch 1/3 if you are able to find it ? Or just repost the series
> if you can't.
> 

Huh, not sure what happened there. I got a copy of Patch 1/3 but I also 
don't see it in lore. Resent:

https://lore.kernel.org/all/20230216163804.456714-1-quic_eberman@quicinc.com/
Sudeep Holla Feb. 22, 2023, 1:59 p.m. UTC | #5
On Thu, Feb 16, 2023 at 08:41:05AM -0800, Elliot Berman wrote:
> 
> 
> On 2/16/2023 1:58 AM, Sudeep Holla wrote:
> > On Wed, Feb 15, 2023 at 08:58:10AM -0800, Elliot Berman wrote:
> > > 
> > > 
> > > On 2/15/2023 2:17 AM, Sudeep Holla wrote:
> > > > On Mon, Feb 13, 2023 at 03:25:34PM -0800, Elliot Berman wrote:
> > > > > Two mailbox controllers have channel/client binding mechanisms that are
> > > > > controller-specific and not using the devicetree binding mechanisms. Mailbox
> > > > > channel/client is conceptually done in two steps: selecting the channel
> > > > > and binding the selected to channel to a client. Channel selection is sometimes
> > > > > controller specific (pcc and omap are examples). The channel/client binding
> > > > > code is all the same.
> > > > > 
> > > > > This small series de-duplicates and refactors the channel/client binding
> > > > > into a common framework function: "mbox_bind_client" which all of the
> > > > > channel selection mechanisms can use.
> > > > > 
> > > > > I found this duplicate code while working on the support for Gunyah hypervisor
> > > > > message queues [1]. I've only been able to compile-test omap-maiblox and pcc,
> > > > > however it is a straightforward conversion here.
> > > > > 
> > > > > [1]: https://lore.kernel.org/all/20230120224627.4053418-9-quic_eberman@quicinc.com/
> > > > > 
> > > > > Elliot Berman (3):
> > > > >     mailbox: Allow direct registration to a channel
> > > > 
> > > > I am unable to find the above patch either in my inbox or in lore[1].
> > > > Can you please repost the same ? I would like to test/review w.r.t PCC
> > > > driver.
> > > > 
> > > 
> > > Hi Sudeep,
> > > 
> > > Not sure why the patch didn't end up your inbox; lore seems to have linked
> > > it correctly and indicates you were in To:. If I missed something, let me
> > > know and I'll make sure you're properly included if future versions needed.
> > > 
> > > https://lore.kernel.org/all/20230213232537.2040976-4-quic_eberman@quicinc.com/
> > 
> > No, I do have patch 2/3 and 3/3 in my inbox along with the cover letter.
> > Patch 1/3 is missing in both my inbox and lore. Can you send me the lore
> > link for patch 1/3 if you are able to find it ? Or just repost the series
> > if you can't.
> > 
> 
> Huh, not sure what happened there. I got a copy of Patch 1/3 but I also
> don't see it in lore. Resent:
> 
> https://lore.kernel.org/all/20230216163804.456714-1-quic_eberman@quicinc.com/

Thanks.

You can add(tested PCC driver)

Tested-by: Sudeep Holla <sudeep.holla@arm.com>