From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linux-kernel@vger.kernel.org
Cc: Anton Vorontsov <cbou@mail.ru>,
Linus Torvalds <torvalds@linux-foundation.org>,
Woodhouse <dwmw2@infradead.org>,
dri-devel@lists.freedesktop.org, David@freedesktop.org
Subject: Re: broken nouveau dependency on power supply
Date: Mon, 02 Apr 2012 13:53:23 +1000 [thread overview]
Message-ID: <1333338803.30734.37.camel@pasglop> (raw)
In-Reply-To: <1333328762.30734.24.camel@pasglop>
On Mon, 2012-04-02 at 11:06 +1000, Benjamin Herrenschmidt wrote:
> Hi folks !
>
> With CONFIG_POWER_SUPPLY=m & nouveau built-in we get a build failure:
>
> drivers/built-in.o: In function `.nouveau_pm_trigger':
> (.text+0xa56e8): undefined reference to `.power_supply_is_system_supplied'
>
> nouveau probably needs to depends on CONFIG_POWER_SUPPLY to force a module
> build with the latter is =m
Ok, not that trivial...
The problem is more like POWER_SUPPLY should be a bool, not a tristate.
If you think about it: you don't want things like nouveau to depend on a
random subsystem like that, people will never get it. In fact,
POWER_SUPPLY provides empty inline stubs when not enabled, so that's
really designed to not have depends...
However that -cannot- work if POWER_SUPPLY is modular and the drivers
who use it are not. The only fixes here that make sense I can think of
that don't also involve Kconfig horrors are:
- Ugly: in power_supply.h, use the extern variant if
defined(CONFIG_POWER_SUPPLY) ||
(defined(CONFIG_POWER_SUPPLY_MODULE) && defined(MODULE))
IE. use the stub if power supply is a module and what is being built is
built-in. Of course that's not only ugly, it somewhat sucks from a user
perspective as the subsystem now exists but can't be used by some
drivers...
- Better: Just make the bloody thing a bool :-) The power supply
framework itself is small enough, just make it a boolean option and
avoid the problem entirely. The actual power supply sub drivers can
remain modular of course.
Cheers,
Ben.
WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linux-kernel@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Anton Vorontsov <cbou@mail.ru>,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: broken nouveau dependency on power supply
Date: Mon, 02 Apr 2012 13:53:23 +1000 [thread overview]
Message-ID: <1333338803.30734.37.camel@pasglop> (raw)
In-Reply-To: <1333328762.30734.24.camel@pasglop>
On Mon, 2012-04-02 at 11:06 +1000, Benjamin Herrenschmidt wrote:
> Hi folks !
>
> With CONFIG_POWER_SUPPLY=m & nouveau built-in we get a build failure:
>
> drivers/built-in.o: In function `.nouveau_pm_trigger':
> (.text+0xa56e8): undefined reference to `.power_supply_is_system_supplied'
>
> nouveau probably needs to depends on CONFIG_POWER_SUPPLY to force a module
> build with the latter is =m
Ok, not that trivial...
The problem is more like POWER_SUPPLY should be a bool, not a tristate.
If you think about it: you don't want things like nouveau to depend on a
random subsystem like that, people will never get it. In fact,
POWER_SUPPLY provides empty inline stubs when not enabled, so that's
really designed to not have depends...
However that -cannot- work if POWER_SUPPLY is modular and the drivers
who use it are not. The only fixes here that make sense I can think of
that don't also involve Kconfig horrors are:
- Ugly: in power_supply.h, use the extern variant if
defined(CONFIG_POWER_SUPPLY) ||
(defined(CONFIG_POWER_SUPPLY_MODULE) && defined(MODULE))
IE. use the stub if power supply is a module and what is being built is
built-in. Of course that's not only ugly, it somewhat sucks from a user
perspective as the subsystem now exists but can't be used by some
drivers...
- Better: Just make the bloody thing a bool :-) The power supply
framework itself is small enough, just make it a boolean option and
avoid the problem entirely. The actual power supply sub drivers can
remain modular of course.
Cheers,
Ben.
next prev parent reply other threads:[~2012-04-02 3:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-02 1:06 broken nouveau dependency on power supply Benjamin Herrenschmidt
2012-04-02 3:53 ` Benjamin Herrenschmidt [this message]
2012-04-02 3:53 ` Benjamin Herrenschmidt
2012-04-02 9:00 ` David Airlie
2012-04-02 9:00 ` David Airlie
2012-04-02 9:48 ` Benjamin Herrenschmidt
2012-04-02 9:48 ` Benjamin Herrenschmidt
2012-05-05 4:29 ` Anton Vorontsov
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=1333338803.30734.37.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=David@freedesktop.org \
--cc=cbou@mail.ru \
--cc=dri-devel@lists.freedesktop.org \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.