[0/9] staging: move greybus core out of staging
mbox series

Message ID 20190825055429.18547-1-gregkh@linuxfoundation.org
Headers show
Series
  • staging: move greybus core out of staging
Related show

Message

Greg Kroah-Hartman Aug. 25, 2019, 5:54 a.m. UTC
The Greybus code has long been "stable" but was living in the
drivers/staging/ directory to see if there really was going to be
devices using this protocol over the long-term.  With the success of
millions of phones with this hardware and code in it, and the recent
Google Summer of Code project, and a number of of new devices in the
works from various companies, it is time to finally move this code out
of staging into the "real" portion of the kernel so that people know
they can rely on it.

This series first does a little bit of checkpatch cleanups for some
basic remaining issues in the greybus files, and then moves the include
directory, the greybus core code, and the es2 greybus host controller
driver into drivers/greybus.

To come after this is the movement of the Documentation entries and a
number of the module drivers that are stable.

Greg Kroah-Hartman (9):
  staging: greybus: fix up SPDX comment in .h files
  staging: greybus: remove license "boilerplate"
  staging: greybus: hd: Fix up some alignment checkpatch issues
  staging: greybus: manifest: Fix up some alignment checkpatch issues
  staging: greybus: log: Fix up some alignment checkpatch issues
  staging: greybus: loopback: Fix up some alignment checkpatch issues
  staging: greybus: move core include files to include/linux/greybus/
  staging: greybus: move the greybus core to drivers/greybus
  staging: greybus: move es2 to drivers/greybus/

 MAINTAINERS                                   |   3 +
 drivers/Kconfig                               |   2 +
 drivers/Makefile                              |   1 +
 drivers/greybus/Kconfig                       |  32 +++++
 drivers/greybus/Makefile                      |  26 +++++
 drivers/greybus/arpc.h                        |  63 ++++++++++
 drivers/{staging => }/greybus/bundle.c        |   2 +-
 drivers/{staging => }/greybus/connection.c    |   2 +-
 drivers/{staging => }/greybus/control.c       |   2 +-
 drivers/{staging => }/greybus/core.c          |   2 +-
 drivers/{staging => }/greybus/debugfs.c       |   3 +-
 drivers/{staging => }/greybus/es2.c           |   3 +-
 drivers/{staging => }/greybus/greybus_trace.h |   2 +-
 drivers/{staging => }/greybus/hd.c            |  12 +-
 drivers/{staging => }/greybus/interface.c     |   2 +-
 drivers/{staging => }/greybus/manifest.c      |  41 ++++---
 drivers/{staging => }/greybus/module.c        |   2 +-
 drivers/{staging => }/greybus/operation.c     |   2 +-
 drivers/{staging => }/greybus/svc.c           |   3 +-
 drivers/{staging => }/greybus/svc_watchdog.c  |   2 +-
 .../Documentation/firmware/authenticate.c     |  46 --------
 .../greybus/Documentation/firmware/firmware.c |  46 --------
 drivers/staging/greybus/Kconfig               |  27 -----
 drivers/staging/greybus/Makefile              |  22 ----
 drivers/staging/greybus/arche-platform.c      |   2 +-
 drivers/staging/greybus/arpc.h                | 109 ------------------
 drivers/staging/greybus/audio_apbridgea.c     |   3 +-
 drivers/staging/greybus/audio_apbridgea.h     |  26 +----
 drivers/staging/greybus/audio_codec.h         |   4 +-
 drivers/staging/greybus/audio_gb.c            |   4 +-
 drivers/staging/greybus/authentication.c      |   3 +-
 drivers/staging/greybus/bootrom.c             |   2 +-
 drivers/staging/greybus/camera.c              |   2 +-
 drivers/staging/greybus/firmware.h            |   4 +-
 drivers/staging/greybus/fw-core.c             |   2 +-
 drivers/staging/greybus/fw-download.c         |   2 +-
 drivers/staging/greybus/fw-management.c       |   2 +-
 drivers/staging/greybus/gb-camera.h           |   2 +-
 drivers/staging/greybus/gbphy.c               |   2 +-
 drivers/staging/greybus/gbphy.h               |   2 +-
 drivers/staging/greybus/gpio.c                |   2 +-
 .../staging/greybus/greybus_authentication.h  |  48 +-------
 drivers/staging/greybus/greybus_firmware.h    |  48 +-------
 drivers/staging/greybus/hid.c                 |   3 +-
 drivers/staging/greybus/i2c.c                 |   2 +-
 drivers/staging/greybus/light.c               |   4 +-
 drivers/staging/greybus/log.c                 |   9 +-
 drivers/staging/greybus/loopback.c            |   9 +-
 drivers/staging/greybus/power_supply.c        |   3 +-
 drivers/staging/greybus/pwm.c                 |   2 +-
 drivers/staging/greybus/raw.c                 |   3 +-
 drivers/staging/greybus/sdio.c                |   2 +-
 drivers/staging/greybus/spi.c                 |   2 +-
 drivers/staging/greybus/spilib.c              |   2 +-
 drivers/staging/greybus/spilib.h              |   2 +-
 drivers/staging/greybus/tools/loopback_test.c |   2 -
 drivers/staging/greybus/uart.c                |   2 +-
 drivers/staging/greybus/usb.c                 |   2 +-
 drivers/staging/greybus/vibrator.c            |   3 +-
 .../greybus => include/linux}/greybus.h       |  26 ++---
 .../linux}/greybus/bundle.h                   |   0
 .../linux}/greybus/connection.h               |   0
 .../linux}/greybus/control.h                  |   0
 .../linux}/greybus/greybus_id.h               |   0
 .../linux}/greybus/greybus_manifest.h         |   2 +-
 .../linux}/greybus/greybus_protocols.h        |  48 +-------
 .../staging => include/linux}/greybus/hd.h    |   2 +-
 .../linux}/greybus/interface.h                |   2 +-
 .../linux}/greybus/manifest.h                 |   2 +-
 .../linux}/greybus/module.h                   |   2 +-
 .../linux}/greybus/operation.h                |   2 +-
 .../staging => include/linux}/greybus/svc.h   |   2 +-
 72 files changed, 225 insertions(+), 532 deletions(-)
 create mode 100644 drivers/greybus/Kconfig
 create mode 100644 drivers/greybus/Makefile
 create mode 100644 drivers/greybus/arpc.h
 rename drivers/{staging => }/greybus/bundle.c (99%)
 rename drivers/{staging => }/greybus/connection.c (99%)
 rename drivers/{staging => }/greybus/control.c (99%)
 rename drivers/{staging => }/greybus/core.c (99%)
 rename drivers/{staging => }/greybus/debugfs.c (94%)
 rename drivers/{staging => }/greybus/es2.c (99%)
 rename drivers/{staging => }/greybus/greybus_trace.h (99%)
 rename drivers/{staging => }/greybus/hd.c (96%)
 rename drivers/{staging => }/greybus/interface.c (99%)
 rename drivers/{staging => }/greybus/manifest.c (95%)
 rename drivers/{staging => }/greybus/module.c (99%)
 rename drivers/{staging => }/greybus/operation.c (99%)
 rename drivers/{staging => }/greybus/svc.c (99%)
 rename drivers/{staging => }/greybus/svc_watchdog.c (99%)
 delete mode 100644 drivers/staging/greybus/arpc.h
 rename {drivers/staging/greybus => include/linux}/greybus.h (88%)
 rename {drivers/staging => include/linux}/greybus/bundle.h (100%)
 rename {drivers/staging => include/linux}/greybus/connection.h (100%)
 rename {drivers/staging => include/linux}/greybus/control.h (100%)
 rename {drivers/staging => include/linux}/greybus/greybus_id.h (100%)
 rename {drivers/staging => include/linux}/greybus/greybus_manifest.h (99%)
 rename {drivers/staging => include/linux}/greybus/greybus_protocols.h (96%)
 rename {drivers/staging => include/linux}/greybus/hd.h (98%)
 rename {drivers/staging => include/linux}/greybus/interface.h (98%)
 rename {drivers/staging => include/linux}/greybus/manifest.h (87%)
 rename {drivers/staging => include/linux}/greybus/module.h (94%)
 rename {drivers/staging => include/linux}/greybus/operation.h (99%)
 rename {drivers/staging => include/linux}/greybus/svc.h (98%)

Comments

Alex Elder Aug. 27, 2019, 10:43 a.m. UTC | #1
On 8/25/19 12:54 AM, Greg Kroah-Hartman wrote:
> The Greybus code has long been "stable" but was living in the
> drivers/staging/ directory to see if there really was going to be
> devices using this protocol over the long-term.  With the success of
> millions of phones with this hardware and code in it, and the recent
> Google Summer of Code project, and a number of of new devices in the
> works from various companies, it is time to finally move this code out
> of staging into the "real" portion of the kernel so that people know
> they can rely on it.
> 
> This series first does a little bit of checkpatch cleanups for some
> basic remaining issues in the greybus files, and then moves the include
> directory, the greybus core code, and the es2 greybus host controller
> driver into drivers/greybus.
> 
> To come after this is the movement of the Documentation entries and a
> number of the module drivers that are stable.

They all look good to me.  (I don't always agree with checkpatch,
but standardization is good.)  Thanks Greg.

Acked-by: Alex Elder <elder@kernel.org>

> Greg Kroah-Hartman (9):
>   staging: greybus: fix up SPDX comment in .h files
>   staging: greybus: remove license "boilerplate"
>   staging: greybus: hd: Fix up some alignment checkpatch issues
>   staging: greybus: manifest: Fix up some alignment checkpatch issues
>   staging: greybus: log: Fix up some alignment checkpatch issues
>   staging: greybus: loopback: Fix up some alignment checkpatch issues
>   staging: greybus: move core include files to include/linux/greybus/
>   staging: greybus: move the greybus core to drivers/greybus
>   staging: greybus: move es2 to drivers/greybus/
> 
>  MAINTAINERS                                   |   3 +
>  drivers/Kconfig                               |   2 +
>  drivers/Makefile                              |   1 +
>  drivers/greybus/Kconfig                       |  32 +++++
>  drivers/greybus/Makefile                      |  26 +++++
>  drivers/greybus/arpc.h                        |  63 ++++++++++
>  drivers/{staging => }/greybus/bundle.c        |   2 +-
>  drivers/{staging => }/greybus/connection.c    |   2 +-
>  drivers/{staging => }/greybus/control.c       |   2 +-
>  drivers/{staging => }/greybus/core.c          |   2 +-
>  drivers/{staging => }/greybus/debugfs.c       |   3 +-
>  drivers/{staging => }/greybus/es2.c           |   3 +-
>  drivers/{staging => }/greybus/greybus_trace.h |   2 +-
>  drivers/{staging => }/greybus/hd.c            |  12 +-
>  drivers/{staging => }/greybus/interface.c     |   2 +-
>  drivers/{staging => }/greybus/manifest.c      |  41 ++++---
>  drivers/{staging => }/greybus/module.c        |   2 +-
>  drivers/{staging => }/greybus/operation.c     |   2 +-
>  drivers/{staging => }/greybus/svc.c           |   3 +-
>  drivers/{staging => }/greybus/svc_watchdog.c  |   2 +-
>  .../Documentation/firmware/authenticate.c     |  46 --------
>  .../greybus/Documentation/firmware/firmware.c |  46 --------
>  drivers/staging/greybus/Kconfig               |  27 -----
>  drivers/staging/greybus/Makefile              |  22 ----
>  drivers/staging/greybus/arche-platform.c      |   2 +-
>  drivers/staging/greybus/arpc.h                | 109 ------------------
>  drivers/staging/greybus/audio_apbridgea.c     |   3 +-
>  drivers/staging/greybus/audio_apbridgea.h     |  26 +----
>  drivers/staging/greybus/audio_codec.h         |   4 +-
>  drivers/staging/greybus/audio_gb.c            |   4 +-
>  drivers/staging/greybus/authentication.c      |   3 +-
>  drivers/staging/greybus/bootrom.c             |   2 +-
>  drivers/staging/greybus/camera.c              |   2 +-
>  drivers/staging/greybus/firmware.h            |   4 +-
>  drivers/staging/greybus/fw-core.c             |   2 +-
>  drivers/staging/greybus/fw-download.c         |   2 +-
>  drivers/staging/greybus/fw-management.c       |   2 +-
>  drivers/staging/greybus/gb-camera.h           |   2 +-
>  drivers/staging/greybus/gbphy.c               |   2 +-
>  drivers/staging/greybus/gbphy.h               |   2 +-
>  drivers/staging/greybus/gpio.c                |   2 +-
>  .../staging/greybus/greybus_authentication.h  |  48 +-------
>  drivers/staging/greybus/greybus_firmware.h    |  48 +-------
>  drivers/staging/greybus/hid.c                 |   3 +-
>  drivers/staging/greybus/i2c.c                 |   2 +-
>  drivers/staging/greybus/light.c               |   4 +-
>  drivers/staging/greybus/log.c                 |   9 +-
>  drivers/staging/greybus/loopback.c            |   9 +-
>  drivers/staging/greybus/power_supply.c        |   3 +-
>  drivers/staging/greybus/pwm.c                 |   2 +-
>  drivers/staging/greybus/raw.c                 |   3 +-
>  drivers/staging/greybus/sdio.c                |   2 +-
>  drivers/staging/greybus/spi.c                 |   2 +-
>  drivers/staging/greybus/spilib.c              |   2 +-
>  drivers/staging/greybus/spilib.h              |   2 +-
>  drivers/staging/greybus/tools/loopback_test.c |   2 -
>  drivers/staging/greybus/uart.c                |   2 +-
>  drivers/staging/greybus/usb.c                 |   2 +-
>  drivers/staging/greybus/vibrator.c            |   3 +-
>  .../greybus => include/linux}/greybus.h       |  26 ++---
>  .../linux}/greybus/bundle.h                   |   0
>  .../linux}/greybus/connection.h               |   0
>  .../linux}/greybus/control.h                  |   0
>  .../linux}/greybus/greybus_id.h               |   0
>  .../linux}/greybus/greybus_manifest.h         |   2 +-
>  .../linux}/greybus/greybus_protocols.h        |  48 +-------
>  .../staging => include/linux}/greybus/hd.h    |   2 +-
>  .../linux}/greybus/interface.h                |   2 +-
>  .../linux}/greybus/manifest.h                 |   2 +-
>  .../linux}/greybus/module.h                   |   2 +-
>  .../linux}/greybus/operation.h                |   2 +-
>  .../staging => include/linux}/greybus/svc.h   |   2 +-
>  72 files changed, 225 insertions(+), 532 deletions(-)
>  create mode 100644 drivers/greybus/Kconfig
>  create mode 100644 drivers/greybus/Makefile
>  create mode 100644 drivers/greybus/arpc.h
>  rename drivers/{staging => }/greybus/bundle.c (99%)
>  rename drivers/{staging => }/greybus/connection.c (99%)
>  rename drivers/{staging => }/greybus/control.c (99%)
>  rename drivers/{staging => }/greybus/core.c (99%)
>  rename drivers/{staging => }/greybus/debugfs.c (94%)
>  rename drivers/{staging => }/greybus/es2.c (99%)
>  rename drivers/{staging => }/greybus/greybus_trace.h (99%)
>  rename drivers/{staging => }/greybus/hd.c (96%)
>  rename drivers/{staging => }/greybus/interface.c (99%)
>  rename drivers/{staging => }/greybus/manifest.c (95%)
>  rename drivers/{staging => }/greybus/module.c (99%)
>  rename drivers/{staging => }/greybus/operation.c (99%)
>  rename drivers/{staging => }/greybus/svc.c (99%)
>  rename drivers/{staging => }/greybus/svc_watchdog.c (99%)
>  delete mode 100644 drivers/staging/greybus/arpc.h
>  rename {drivers/staging/greybus => include/linux}/greybus.h (88%)
>  rename {drivers/staging => include/linux}/greybus/bundle.h (100%)
>  rename {drivers/staging => include/linux}/greybus/connection.h (100%)
>  rename {drivers/staging => include/linux}/greybus/control.h (100%)
>  rename {drivers/staging => include/linux}/greybus/greybus_id.h (100%)
>  rename {drivers/staging => include/linux}/greybus/greybus_manifest.h (99%)
>  rename {drivers/staging => include/linux}/greybus/greybus_protocols.h (96%)
>  rename {drivers/staging => include/linux}/greybus/hd.h (98%)
>  rename {drivers/staging => include/linux}/greybus/interface.h (98%)
>  rename {drivers/staging => include/linux}/greybus/manifest.h (87%)
>  rename {drivers/staging => include/linux}/greybus/module.h (94%)
>  rename {drivers/staging => include/linux}/greybus/operation.h (99%)
>  rename {drivers/staging => include/linux}/greybus/svc.h (98%)
>
Dan Carpenter Aug. 27, 2019, 1:36 p.m. UTC | #2
I can't compile greybus so it's hard to run Smatch on it...  I have a
Smatch thing which ignores missing includes and just tries its best.
It mostly generates garbage output but a couple of these look like
potential issues:

drivers/staging/greybus/operation.c:379 gb_operation_message_alloc() warn: check 'message_size' for integer overflows 'kzalloc()'
drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->channels' double freed
drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->name' double freed

regards,
dan carpenter
Greg Kroah-Hartman Aug. 27, 2019, 1:45 p.m. UTC | #3
On Tue, Aug 27, 2019 at 04:36:11PM +0300, Dan Carpenter wrote:
> I can't compile greybus so it's hard to run Smatch on it...  I have a
> Smatch thing which ignores missing includes and just tries its best.
> It mostly generates garbage output but a couple of these look like
> potential issues:

Why can't you compile the code?

> drivers/staging/greybus/operation.c:379 gb_operation_message_alloc() warn: check 'message_size' for integer overflows 'kzalloc()'

That should be checked on line 368, right?

> drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->channels' double freed
> drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->name' double freed

I don't understand this warning, how are these potentially double freed?

And the light.c file isn't moving out of drivers/staging/ just yet :)

thanks,

greg k-h
Rui Miguel Silva Aug. 27, 2019, 2:30 p.m. UTC | #4
Hi,
On Tue 27 Aug 2019 at 14:45, Greg Kroah-Hartman wrote:
> On Tue, Aug 27, 2019 at 04:36:11PM +0300, Dan Carpenter wrote:
>> I can't compile greybus so it's hard to run Smatch on it...  I have a
>> Smatch thing which ignores missing includes and just tries its best.
>> It mostly generates garbage output but a couple of these look like
>> potential issues:
>
> Why can't you compile the code?
>

I think we are missing includes in some of the
greybus header files.

>
>> drivers/staging/greybus/operation.c:379 gb_operation_message_alloc() warn: check 'message_size' for integer overflows 'kzalloc()'
>
> That should be checked on line 368, right?
>
>> drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->channels' double freed
>> drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->name' double freed
>
> I don't understand this warning, how are these potentially double freed?
>
> And the light.c file isn't moving out of drivers/staging/ just yet :)
>

I will take a look at this also.

Cheers,
   Rui
Dan Carpenter Aug. 27, 2019, 2:37 p.m. UTC | #5
On Tue, Aug 27, 2019 at 03:45:57PM +0200, Greg Kroah-Hartman wrote:
> Why can't you compile the code?
> 

Now that I try to investigate the compile errors, it starts to compile
perfectly...

> > drivers/staging/greybus/operation.c:379 gb_operation_message_alloc() warn: check 'message_size' for integer overflows 'kzalloc()'
> 
> That should be checked on line 368, right?

This is a false positive.  I assumed it was related to the compile
problem...

> 
> > drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->channels' double freed
> > drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->name' double freed
> 
> I don't understand this warning, how are these potentially double freed?

I will fix these.

regards,
dan carpenter
Greg KH Aug. 27, 2019, 3:43 p.m. UTC | #6
On Tue, Aug 27, 2019 at 03:30:21PM +0100, Rui Miguel Silva wrote:
> Hi,
> On Tue 27 Aug 2019 at 14:45, Greg Kroah-Hartman wrote:
> > On Tue, Aug 27, 2019 at 04:36:11PM +0300, Dan Carpenter wrote:
> >> I can't compile greybus so it's hard to run Smatch on it...  I have a
> >> Smatch thing which ignores missing includes and just tries its best.
> >> It mostly generates garbage output but a couple of these look like
> >> potential issues:
> >
> > Why can't you compile the code?
> >
> 
> I think we are missing includes in some of the
> greybus header files.

Really?  Where?  Builds fine here and passes 0-day :)

thanks,

greg k-h
Rui Miguel Silva Aug. 27, 2019, 3:57 p.m. UTC | #7
Hi Greg,
On Tue 27 Aug 2019 at 16:43, Greg KH wrote:
> On Tue, Aug 27, 2019 at 03:30:21PM +0100, Rui Miguel Silva wrote:
>> Hi,
>> On Tue 27 Aug 2019 at 14:45, Greg Kroah-Hartman wrote:
>> > On Tue, Aug 27, 2019 at 04:36:11PM +0300, Dan Carpenter wrote:
>> >> I can't compile greybus so it's hard to run Smatch on it...  I have a
>> >> Smatch thing which ignores missing includes and just tries its best.
>> >> It mostly generates garbage output but a couple of these look like
>> >> potential issues:
>> >
>> > Why can't you compile the code?
>> >
>>
>> I think we are missing includes in some of the
>> greybus header files.
>
> Really?  Where?  Builds fine here and passes 0-day :)
>

Yeah; just sent a patch to fix it.

Cheers,
   Rui
Greg KH Aug. 27, 2019, 4:59 p.m. UTC | #8
On Tue, Aug 27, 2019 at 04:57:20PM +0100, Rui Miguel Silva wrote:
> Hi Greg,
> On Tue 27 Aug 2019 at 16:43, Greg KH wrote:
> > On Tue, Aug 27, 2019 at 03:30:21PM +0100, Rui Miguel Silva wrote:
> >> Hi,
> >> On Tue 27 Aug 2019 at 14:45, Greg Kroah-Hartman wrote:
> >> > On Tue, Aug 27, 2019 at 04:36:11PM +0300, Dan Carpenter wrote:
> >> >> I can't compile greybus so it's hard to run Smatch on it...  I have a
> >> >> Smatch thing which ignores missing includes and just tries its best.
> >> >> It mostly generates garbage output but a couple of these look like
> >> >> potential issues:
> >> >
> >> > Why can't you compile the code?
> >> >
> >>
> >> I think we are missing includes in some of the
> >> greybus header files.
> >
> > Really?  Where?  Builds fine here and passes 0-day :)
> >
> 
> Yeah; just sent a patch to fix it.

Thanks, now merged!

greg k-h
Pavel Machek Sept. 1, 2019, 5:23 p.m. UTC | #9
Hi!

> The Greybus code has long been "stable" but was living in the
> drivers/staging/ directory to see if there really was going to be
> devices using this protocol over the long-term.  With the success of
> millions of phones with this hardware and code in it, and the recent

So, what phones do have this, for example?

Does that mean that there's large choice of phones well supported by the
mainline?

Best regards,							Pavel
Greg Kroah-Hartman Sept. 2, 2019, 6:31 a.m. UTC | #10
On Sun, Sep 01, 2019 at 07:23:03PM +0200, Pavel Machek wrote:
> Hi!
> 
> > The Greybus code has long been "stable" but was living in the
> > drivers/staging/ directory to see if there really was going to be
> > devices using this protocol over the long-term.  With the success of
> > millions of phones with this hardware and code in it, and the recent
> 
> So, what phones do have this, for example?

The Motorola Z line, all of the "Moto Mods" use this interface to
communicate.

> Does that mean that there's large choice of phones well supported by the
> mainline?

I have no idea what kernel version they use, you will have to talk to
Motorola about that.

greg k-h