lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 8 Jun 2021 13:54:55 -0700
From:   Matthias Kaehlcke <mka@...omium.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     kernel test robot <lkp@...el.com>,
        Alan Stern <stern@...land.harvard.edu>,
        Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>,
        Mathias Nyman <mathias.nyman@...el.com>,
        kbuild-all@...ts.01.org, Michal Simek <monstr@...str.eu>,
        Ravi Chandra Sadineni <ravisadineni@...omium.org>,
        linux-usb@...r.kernel.org, Bastien Nocera <hadess@...ess.net>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v11 2/5] USB: misc: Add onboard_usb_hub driver

On Tue, Jun 08, 2021 at 10:56:08AM +0200, Greg Kroah-Hartman wrote:
> On Mon, Jun 07, 2021 at 11:32:31AM -0700, Matthias Kaehlcke wrote:
> > On Mon, Jun 07, 2021 at 08:23:43PM +0200, Greg Kroah-Hartman wrote:
> > > On Mon, Jun 07, 2021 at 10:51:57AM -0700, Matthias Kaehlcke wrote:
> > > > On Sat, Jun 05, 2021 at 07:18:38AM +0800, kernel test robot wrote:
> > > > > Hi Matthias,
> > > > > 
> > > > > I love your patch! Perhaps something to improve:
> > > > > 
> > > > > [auto build test WARNING on next-20210604]
> > > > > [also build test WARNING on v5.13-rc4]
> > > > > [cannot apply to usb/usb-testing robh/for-next char-misc/char-misc-testing driver-core/driver-core-testing linus/master v5.13-rc4 v5.13-rc3 v5.13-rc2]
> > > > > [If your patch is applied to the wrong git tree, kindly drop us a note.
> > > > > And when submitting patch, we suggest to use '--base' as documented in
> > > > > https://git-scm.com/docs/git-format-patch]
> > > > > 
> > > > > url:    https://github.com/0day-ci/linux/commits/Matthias-Kaehlcke/USB-misc-Add-onboard_usb_hub-driver/20210605-054213
> > > > > base:    ccc252d2e818f6a479441119ad453c3ce7c7c461
> > > > > config: arc-allyesconfig (attached as .config)
> > > > > compiler: arceb-elf-gcc (GCC) 9.3.0
> > > > > reproduce (this is a W=1 build):
> > > > >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > > > >         chmod +x ~/bin/make.cross
> > > > >         # https://github.com/0day-ci/linux/commit/7107f99a12058b7147342c6f763d026102bd6606
> > > > >         git remote add linux-review https://github.com/0day-ci/linux
> > > > >         git fetch --no-tags linux-review Matthias-Kaehlcke/USB-misc-Add-onboard_usb_hub-driver/20210605-054213
> > > > >         git checkout 7107f99a12058b7147342c6f763d026102bd6606
> > > > >         # save the attached .config to linux build tree
> > > > >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc 
> > > > > 
> > > > > If you fix the issue, kindly add following tag as appropriate
> > > > > Reported-by: kernel test robot <lkp@...el.com>
> > > > > 
> > > > > All warnings (new ones prefixed by >>):
> > > > > 
> > > > > >> drivers/usb/misc/onboard_usb_hub.c:400:6: warning: no previous prototype for 'onboard_hub_create_pdevs' [-Wmissing-prototypes]
> > > > >      400 | void onboard_hub_create_pdevs(struct usb_device *parent_hub, struct list_head *pdev_list)
> > > > >          |      ^~~~~~~~~~~~~~~~~~~~~~~~
> > > > > >> drivers/usb/misc/onboard_usb_hub.c:458:6: warning: no previous prototype for 'onboard_hub_destroy_pdevs' [-Wmissing-prototypes]
> > > > >      458 | void onboard_hub_destroy_pdevs(struct list_head *pdev_list)
> > > > >          |      ^~~~~~~~~~~~~~~~~~~~~~~~~
> > > > 
> > > > Oh, I wasn't aware that prototypes are required for public functions.
> > > 
> > > How else can they be called?
> > 
> > Well, there are prototypes in include/linux/usb/onboard_hub.h, however this
> > header isn't included (anymore) by the driver itself to avoid conflicts
> > when COMPILE_TEST=y (see https://lkml.org/lkml/2021/5/25/975).
> 
> Then that needs to be resolved please.

I already sent at least two versions exclusively to deal with related
issues, but there are still configurations that cause trouble, I
would appreciate some guidance here.

The latest issue was:

> I get a build error when I apply this series to my tree:
> 
> drivers/usb/misc/onboard_usb_hub.c:273:6: error: redefinition of ‘of_is_onboard_usb_hub’
>   273 | bool of_is_onboard_usb_hub(const struct device_node *np)
>       |      ^~~~~~~~~~~~~~~~~~~~~
> In file included from drivers/usb/misc/onboard_usb_hub.c:21:
> ./include/linux/usb/onboard_hub.h:9:20: note: previous definition of ‘of_is_onboard_usb_hub’ with type ‘bool(const struct device_node *)’ {aka ‘_Bool(const struct device_node *)’}
>     9 | static inline bool of_is_onboard_usb_hub(const struct device_node *np)
>       |                    ^~~~~~~~~~~~~~~~~~~~~

This was with the following declaration in the header:

  #ifdef CONFIG_USB_ONBOARD_HUB
  bool of_is_onboard_usb_hub(const struct device_node *np);
  #else
  static inline bool of_is_onboard_usb_hub(const struct device_node *np)
  {
    return false;
  }
  #endif

My initial assumption was that in this case the configuration was
COMPILE_TEST=y and USB_ONBOARD_HUB=n, however should onboard_usb_hub.c
even be compiled with USB_ONBOARD_HUB=n? IIUC COMPILE_TEST=y allows
to compile certain drivers even when they couldn't actually run/be
loaded on the target platform, but the config option would still need
to be enabled.

Then again, there was apparently an attempt to compile onboard_usb_hub.c,
however the static inline from the header was picked, which suggests
CONFIG_USB_ONBOARD_HUB=n.

Also please let me know if you have other comments besides the prototype
question, I'd prefer to avoid version churn if possible, this series
already had a bit of that primarily due to the prototype issue.

Thanks

Matthias

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ