mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierluigi Passaro <pierluigi.p@variscite.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Arnd Bergmann <arnd@arndb.de>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Linux-Arch <linux-arch@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v1 1/5] gpiolib: fix linker errors when GPIOLIB is disabled
Date: Thu, 26 Jan 2023 13:41:45 +0000	[thread overview]
Message-ID: <AM6PR08MB4376030EDCFAD7F5FD5313D2FFCF9@AM6PR08MB4376.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <Y9KAPge5zy0cIqi8@smile.fi.intel.com>

On Thu, Jan 26, 2023 at 02:29PM +0100, Arnd Bergmann wrote:
> On Thu, Jan 26, 2023 at 01:56:26PM +0100, Arnd Bergmann wrote:
> > On Thu, Jan 26, 2023, at 13:44, Christophe Leroy wrote:
> > > Le 26/01/2023 à 11:19, Andy Shevchenko a écrit :
> > >> On Thu, Jan 26, 2023 at 08:14:49AM +0000, Christophe Leroy wrote:
> > >>> Le 25/01/2023 à 21:10, Andy Shevchenko a écrit :
> > >>>> From: Pierluigi Passaro <pierluigi.p@variscite.com>
> > >>>>
> > >>>> Both the functions gpiochip_request_own_desc and
> > >>>> gpiochip_free_own_desc are exported from
> > >>>>       drivers/gpio/gpiolib.c
> > >>>> but this file is compiled only when CONFIG_GPIOLIB is enabled.
> > >>>> Move the prototypes under "#ifdef CONFIG_GPIOLIB" and provide
> > >>>> reasonable definitions and includes in the "#else" branch.
> > >>>
> > >>> Can you give more details on when and why link fails ?
> > >>>
> > >>> You are adding a WARN(), I understand it mean the function should never
> > >>> ever be called. Shouldn't it be dropped completely by the compiler ? In
> > >>> that case, no call to gpiochip_request_own_desc() should be emitted and
> > >>> so link should be ok.
> > >>>
> > >>> If link fails, it means we still have unexpected calls to
> > >>> gpiochip_request_own_desc() or gpiochip_free_own_desc(), and we should
> > >>> fix the root cause instead of hiding it with a WARN().
> > >> 
> > >> I agree, but what do you suggest exactly? I think the calls to that functions
> > >> shouldn't be in the some drivers as it's layering violation (they are not a
> > >> GPIO chips to begin with). Simply adding a dependency not better than this one.
> > >> 
> > >
> > > My suggestion is to go step by step. First step is to explicitely list 
> > > drivers that call those functions without selecting GPIOLIB.
> > 
> > I tried that and sent the list of the drivers that call these functions,
> > but as I wrote, all of them already require GPIOLIB to be set.
> > 
> > This means either I made a mistake in my search, or the problem
> > has already been fixed. Either way, I think Andy should provide
> > the exact build failure he observed so we know what caller caused
> > the issue.
> 
> I believe it's not me, who first reported it. So, Pierluigi, can you point
> out to the LKP message that reported the issue?
> 
> P.S> LKP sometimes finds a really twisted configurations to probe on.
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
I've received the following messages:
- https://lore.kernel.org/all/202301240409.tZdm0o0a-lkp@intel.com/
- https://lore.kernel.org/all/202301240439.wYz6uU0k-lkp@intel.com/
- https://lore.kernel.org/all/20230124075600.649bd7bb@canb.auug.org.au/
Please let me know if you need further details.
Regards
Pier

  reply	other threads:[~2023-01-26 13:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25 20:10 [PATCH v1 0/5] gpio: First attempt to clean up headers Andy Shevchenko
2023-01-25 20:10 ` [PATCH v1 1/5] gpiolib: fix linker errors when GPIOLIB is disabled Andy Shevchenko
2023-01-26  8:14   ` Christophe Leroy
2023-01-26  8:40     ` Arnd Bergmann
2023-01-26 10:17       ` Andy Shevchenko
2023-01-26 10:27         ` Arnd Bergmann
2023-01-26 12:14           ` Andy Shevchenko
2023-01-26 10:19     ` Andy Shevchenko
2023-01-26 12:44       ` Christophe Leroy
2023-01-26 12:56         ` Arnd Bergmann
2023-01-26 13:29           ` Andy Shevchenko
2023-01-26 13:41             ` Pierluigi Passaro [this message]
2023-01-26 14:10               ` Arnd Bergmann
2023-01-25 20:10 ` [PATCH v1 2/5] gpio: Drop unused forward declaration from driver.h Andy Shevchenko
2023-01-25 20:10 ` [PATCH v1 3/5] gpio: Deduplicate forward declarations in consumer.h Andy Shevchenko
2023-01-25 20:10 ` [PATCH v1 4/5] gpio: Group " Andy Shevchenko
2023-01-25 20:10 ` [PATCH v1 5/5] gpio: Clean up headers Andy Shevchenko
2023-01-26  8:42   ` Arnd Bergmann
2023-01-26 10:16     ` Andy Shevchenko
2023-01-26 13:08       ` Arnd Bergmann
2023-01-26 10:22   ` Linus Walleij
2023-01-26 12:16     ` Andy Shevchenko
2023-01-26 12:29       ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM6PR08MB4376030EDCFAD7F5FD5313D2FFCF9@AM6PR08MB4376.eurprd08.prod.outlook.com \
    --to=pierluigi.p@variscite.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=christophe.leroy@csgroup.eu \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®