mbox series

[v4,0/5] vchiq: Patch to separate platform and cdev code

Message ID cover.1626882325.git.ojaswin98@gmail.com (mailing list archive)
Headers show
Series vchiq: Patch to separate platform and cdev code | expand

Message

Ojaswin Mujoo July 21, 2021, 4:20 p.m. UTC
Hello,

This patchset adderesses the TODO item number 10 specified at:

    drivers/staging/vc04-services/interface/TODO

For reference, the task is:

    10) Reorganize file structure: Move char driver to it's own file and join
    both platform files

    The cdev is defined alongside with the platform code in vchiq_arm.c. It
    would be nice to completely decouple it from the actual core code. For
    instance to be able to use bcm2835-audio without having /dev/vchiq created.
    One could argue it's better for security reasons or general cleanliness. It
    could even be interesting to create two different kernel modules, something
    the likes of vchiq-core.ko and vchiq-dev.ko. This would also ease the
    upstreaming process.

A summary of the patches is as follows:

- Patch 1: Move cdev init code into a function
- Patch 2: Shift some devlarations from vchiq_arm.c to vchiq_arm.h for
           sharing
- Patch 3: Move vchiq cdev init code from vchiq_arm.c into vchiq_dev.c
- Patch 4: Decouple cdev code by defining a Kconfig entry to allow
           optional compilation of it.
- Patch 5: Merge code in vchiq_2835_arm.c to vchiq_arm.c

Changes since v3 [2]:

* In Patch 5, replace forward declarations of some of the functions with
  function definition 

Changes since v2 [1]:

* In Patch 1, as suggested, I have added error handling code back to
  ensure the driver exits when there is an error in creating vchiq cdev
  
* I have built this patch against the right kernel (gregkh/staging,
  staging-next branch) to avoid introducing any unwanted inconsistencies
  like whitespace changes

I have tested the patch using vchiq_test utility on RPi 3B+.

Regards,
Ojaswin

[1] v2: https://lore.kernel.org/patchwork/cover/1449117/
[2] v3: https://lore.kernel.org/patchwork/cover/1453915/

Ojaswin Mujoo (5):
  staging: vchiq: Refactor vchiq cdev code
  staging: vchiq: Move certain declarations to vchiq_arm.h
  staging: vchiq: Move vchiq char driver to its own file
  staging: vchiq: Make creation of vchiq cdev optional
  staging: vchiq: Combine vchiq platform code into single file

 drivers/staging/vc04_services/Kconfig         |   10 +
 drivers/staging/vc04_services/Makefile        |    5 +-
 .../interface/vchiq_arm/vchiq_2835_arm.c      |  564 ----
 .../interface/vchiq_arm/vchiq_arm.c           | 2330 +++++------------
 .../interface/vchiq_arm/vchiq_arm.h           |   82 +
 .../interface/vchiq_arm/vchiq_dev.c           | 1440 ++++++++++
 6 files changed, 2251 insertions(+), 2180 deletions(-)
 delete mode 100644 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
 create mode 100644 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c

Comments

Greg KH July 23, 2021, 11:02 a.m. UTC | #1
On Wed, Jul 21, 2021 at 09:50:48PM +0530, Ojaswin Mujoo wrote:
> Hello,
> 
> This patchset adderesses the TODO item number 10 specified at:
> 
>     drivers/staging/vc04-services/interface/TODO
> 
> For reference, the task is:
> 
>     10) Reorganize file structure: Move char driver to it's own file and join
>     both platform files
> 
>     The cdev is defined alongside with the platform code in vchiq_arm.c. It
>     would be nice to completely decouple it from the actual core code. For
>     instance to be able to use bcm2835-audio without having /dev/vchiq created.
>     One could argue it's better for security reasons or general cleanliness. It
>     could even be interesting to create two different kernel modules, something
>     the likes of vchiq-core.ko and vchiq-dev.ko. This would also ease the
>     upstreaming process.
> 
> A summary of the patches is as follows:
> 
> - Patch 1: Move cdev init code into a function
> - Patch 2: Shift some devlarations from vchiq_arm.c to vchiq_arm.h for
>            sharing
> - Patch 3: Move vchiq cdev init code from vchiq_arm.c into vchiq_dev.c
> - Patch 4: Decouple cdev code by defining a Kconfig entry to allow
>            optional compilation of it.
> - Patch 5: Merge code in vchiq_2835_arm.c to vchiq_arm.c
> 
> Changes since v3 [2]:
> 
> * In Patch 5, replace forward declarations of some of the functions with
>   function definition 

You dropped the reviews of others, so now I need to wait for them again
:(
Ojaswin Mujoo July 23, 2021, 12:59 p.m. UTC | #2
On Fri, Jul 23, 2021 at 01:02:41PM +0200, Greg KH wrote:
> On Wed, Jul 21, 2021 at 09:50:48PM +0530, Ojaswin Mujoo wrote:
> > Hello,
> > 
> > This patchset adderesses the TODO item number 10 specified at:
> > 
> >     drivers/staging/vc04-services/interface/TODO
> > 
> > For reference, the task is:
> > 
> >     10) Reorganize file structure: Move char driver to it's own file and join
> >     both platform files
> > 
> >     The cdev is defined alongside with the platform code in vchiq_arm.c. It
> >     would be nice to completely decouple it from the actual core code. For
> >     instance to be able to use bcm2835-audio without having /dev/vchiq created.
> >     One could argue it's better for security reasons or general cleanliness. It
> >     could even be interesting to create two different kernel modules, something
> >     the likes of vchiq-core.ko and vchiq-dev.ko. This would also ease the
> >     upstreaming process.
> > 
> > A summary of the patches is as follows:
> > 
> > - Patch 1: Move cdev init code into a function
> > - Patch 2: Shift some devlarations from vchiq_arm.c to vchiq_arm.h for
> >            sharing
> > - Patch 3: Move vchiq cdev init code from vchiq_arm.c into vchiq_dev.c
> > - Patch 4: Decouple cdev code by defining a Kconfig entry to allow
> >            optional compilation of it.
> > - Patch 5: Merge code in vchiq_2835_arm.c to vchiq_arm.c
> > 
> > Changes since v3 [2]:
> > 
> > * In Patch 5, replace forward declarations of some of the functions with
> >   function definition 
> 
> You dropped the reviews of others, so now I need to wait for them again
> :(
> 
Hello Greg,

Apologies for that, I was under the impression that a new version
needed a separate review :(

If its okay, I can alternately resubmit this (as v5?) with Stefan's
Reviewed-By tags on unchanged commits intact. Let me know if that's okay
or if its better to wait out.

Thank you!
Ojaswin
Stefan Wahren July 23, 2021, 1:31 p.m. UTC | #3
Am 23.07.21 um 14:59 schrieb Ojaswin Mujoo:
> On Fri, Jul 23, 2021 at 01:02:41PM +0200, Greg KH wrote:
>> On Wed, Jul 21, 2021 at 09:50:48PM +0530, Ojaswin Mujoo wrote:
>>> Hello,
>>>
>>> This patchset adderesses the TODO item number 10 specified at:
>>>
>>>     drivers/staging/vc04-services/interface/TODO
>>>
>>> For reference, the task is:
>>>
>>>     10) Reorganize file structure: Move char driver to it's own file and join
>>>     both platform files
>>>
>>>     The cdev is defined alongside with the platform code in vchiq_arm.c. It
>>>     would be nice to completely decouple it from the actual core code. For
>>>     instance to be able to use bcm2835-audio without having /dev/vchiq created.
>>>     One could argue it's better for security reasons or general cleanliness. It
>>>     could even be interesting to create two different kernel modules, something
>>>     the likes of vchiq-core.ko and vchiq-dev.ko. This would also ease the
>>>     upstreaming process.
>>>
>>> A summary of the patches is as follows:
>>>
>>> - Patch 1: Move cdev init code into a function
>>> - Patch 2: Shift some devlarations from vchiq_arm.c to vchiq_arm.h for
>>>            sharing
>>> - Patch 3: Move vchiq cdev init code from vchiq_arm.c into vchiq_dev.c
>>> - Patch 4: Decouple cdev code by defining a Kconfig entry to allow
>>>            optional compilation of it.
>>> - Patch 5: Merge code in vchiq_2835_arm.c to vchiq_arm.c
>>>
>>> Changes since v3 [2]:
>>>
>>> * In Patch 5, replace forward declarations of some of the functions with
>>>   function definition 
>> You dropped the reviews of others, so now I need to wait for them again
>> :(
>>
> Hello Greg,
>
> Apologies for that, I was under the impression that a new version
> needed a separate review :(
No, just the patches which had functional changes.
> If its okay, I can alternately resubmit this (as v5?) with Stefan's
> Reviewed-By tags on unchanged commits intact. Let me know if that's okay
> or if its better to wait out.

No, please don't resubmit. I will do the review soon.

Regards
Stefan

>
> Thank you!
> Ojaswin
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Stefan Wahren July 24, 2021, 9:38 a.m. UTC | #4
Am 21.07.21 um 18:20 schrieb Ojaswin Mujoo:
> Hello,
>
> This patchset adderesses the TODO item number 10 specified at:
>
>     drivers/staging/vc04-services/interface/TODO
>
> For reference, the task is:
>
>     10) Reorganize file structure: Move char driver to it's own file and join
>     both platform files
>
>     The cdev is defined alongside with the platform code in vchiq_arm.c. It
>     would be nice to completely decouple it from the actual core code. For
>     instance to be able to use bcm2835-audio without having /dev/vchiq created.
>     One could argue it's better for security reasons or general cleanliness. It
>     could even be interesting to create two different kernel modules, something
>     the likes of vchiq-core.ko and vchiq-dev.ko. This would also ease the
>     upstreaming process.
>
> A summary of the patches is as follows:
>
> - Patch 1: Move cdev init code into a function
> - Patch 2: Shift some devlarations from vchiq_arm.c to vchiq_arm.h for
>            sharing
> - Patch 3: Move vchiq cdev init code from vchiq_arm.c into vchiq_dev.c
> - Patch 4: Decouple cdev code by defining a Kconfig entry to allow
>            optional compilation of it.
> - Patch 5: Merge code in vchiq_2835_arm.c to vchiq_arm.c
>
> Changes since v3 [2]:
>
> * In Patch 5, replace forward declarations of some of the functions with
>   function definition 
>
The whole series is:

Reviewed-by: Stefan Wahren <stefan.wahren@i2se.com>

Thanks
Ojaswin Mujoo July 24, 2021, 10:44 a.m. UTC | #5
On Fri, Jul 23, 2021 at 03:31:58PM +0200, Stefan Wahren wrote:
> Am 23.07.21 um 14:59 schrieb Ojaswin Mujoo:
> > On Fri, Jul 23, 2021 at 01:02:41PM +0200, Greg KH wrote:
> >> On Wed, Jul 21, 2021 at 09:50:48PM +0530, Ojaswin Mujoo wrote:
> >>> Hello,
> >>>
> >>> This patchset adderesses the TODO item number 10 specified at:
> >>>
> >>>     drivers/staging/vc04-services/interface/TODO
> >>>
> >>> For reference, the task is:
> >>>
> >>>     10) Reorganize file structure: Move char driver to it's own file and join
> >>>     both platform files
> >>>
> >>>     The cdev is defined alongside with the platform code in vchiq_arm.c. It
> >>>     would be nice to completely decouple it from the actual core code. For
> >>>     instance to be able to use bcm2835-audio without having /dev/vchiq created.
> >>>     One could argue it's better for security reasons or general cleanliness. It
> >>>     could even be interesting to create two different kernel modules, something
> >>>     the likes of vchiq-core.ko and vchiq-dev.ko. This would also ease the
> >>>     upstreaming process.
> >>>
> >>> A summary of the patches is as follows:
> >>>
> >>> - Patch 1: Move cdev init code into a function
> >>> - Patch 2: Shift some devlarations from vchiq_arm.c to vchiq_arm.h for
> >>>            sharing
> >>> - Patch 3: Move vchiq cdev init code from vchiq_arm.c into vchiq_dev.c
> >>> - Patch 4: Decouple cdev code by defining a Kconfig entry to allow
> >>>            optional compilation of it.
> >>> - Patch 5: Merge code in vchiq_2835_arm.c to vchiq_arm.c
> >>>
> >>> Changes since v3 [2]:
> >>>
> >>> * In Patch 5, replace forward declarations of some of the functions with
> >>>   function definition 
> >> You dropped the reviews of others, so now I need to wait for them again
> >> :(
> >>
> > Hello Greg,
> >
> > Apologies for that, I was under the impression that a new version
> > needed a separate review :(
> No, just the patches which had functional changes.
Ohh, noted.
> > If its okay, I can alternately resubmit this (as v5?) with Stefan's
> > Reviewed-By tags on unchanged commits intact. Let me know if that's okay
> > or if its better to wait out.
> 
> No, please don't resubmit. I will do the review soon.

Thanks for the review and all the help, Stefan. It is much appreciated
:)

Regards,
Ojaswin