netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] CONFIG_TR/CONFIG_LLC: work around the problem with select
@ 2012-02-05  6:31 Al Viro
  2012-02-06 13:51 ` Ben Hutchings
  2012-02-07 18:06 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Al Viro @ 2012-02-05  6:31 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, David Miller

As it is, with PCI/ISA/MCA/CCW all set to n and PCMCIA set to m
setting TR to y will set LLC to m, with very unpleasant results -
net/802/psnap gets picked into obj-y, resulting in the kernel
that won't link - psnap calls functions from llc.  The cause,
AFAICS, is that kconfig gets rev_dep for LLC containing
|| TR && (deps for TR)
and even though TR is boolean, both LLC and PCMCIA are tristate
and that thing becomes || y && (n || m), i.e. || m.  The reason
for dependency on PCMCIA is that when none of PCI, ISA, MCA, CCW
or PCMCIA is set there'll be no tokenring drivers, so there's no
point building tokenring core.  Proper fix probably belongs in
kconfig (we need strict and, such that y <strict_and> m would be
y, so that rev_deps added for tristate selected by bool would
use that instead of &&; we'd have || TR <strict_and> (deps for TR)
in this case), but it's a rather intrusive change.  There's an
easy workaround in case of TR -> LLC select, namely to have a def_bool y
symbol sitting under if TR and have that symbol selecting LLC.
Kudos to johill for suggesting that one...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

diff --git a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig
index c7e0149..45550d4 100644
--- a/drivers/net/tokenring/Kconfig
+++ b/drivers/net/tokenring/Kconfig
@@ -7,7 +7,6 @@ menuconfig TR
 	bool "Token Ring driver support"
 	depends on NETDEVICES && !UML
 	depends on (PCI || ISA || MCA || CCW || PCMCIA)
-	select LLC
 	help
 	  Token Ring is IBM's way of communication on a local network; the
 	  rest of the world uses Ethernet. To participate on a Token Ring
@@ -20,6 +19,10 @@ menuconfig TR
 
 if TR
 
+config WANT_LLC
+	def_bool y
+	select LLC
+
 config PCMCIA_IBMTR
 	tristate "IBM PCMCIA tokenring adapter support"
 	depends on IBMTR!=y && PCMCIA

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] CONFIG_TR/CONFIG_LLC: work around the problem with select
  2012-02-05  6:31 [PATCH] CONFIG_TR/CONFIG_LLC: work around the problem with select Al Viro
@ 2012-02-06 13:51 ` Ben Hutchings
  2012-02-07 18:06 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Ben Hutchings @ 2012-02-06 13:51 UTC (permalink / raw)
  To: Al Viro; +Cc: Jeff Garzik, netdev, David Miller

On Sun, 2012-02-05 at 06:31 +0000, Al Viro wrote:
> As it is, with PCI/ISA/MCA/CCW all set to n and PCMCIA set to m
> setting TR to y will set LLC to m, with very unpleasant results -
> net/802/psnap gets picked into obj-y, resulting in the kernel
> that won't link - psnap calls functions from llc.  The cause,
> AFAICS, is that kconfig gets rev_dep for LLC containing
> || TR && (deps for TR)
> and even though TR is boolean, both LLC and PCMCIA are tristate
> and that thing becomes || y && (n || m), i.e. || m.  The reason
> for dependency on PCMCIA is that when none of PCI, ISA, MCA, CCW
> or PCMCIA is set there'll be no tokenring drivers, so there's no
> point building tokenring core.  Proper fix probably belongs in
> kconfig (we need strict and, such that y <strict_and> m would be
> y, so that rev_deps added for tristate selected by bool would
> use that instead of &&; we'd have || TR <strict_and> (deps for TR)
> in this case), but it's a rather intrusive change.  There's an
> easy workaround in case of TR -> LLC select, namely to have a def_bool y
> symbol sitting under if TR and have that symbol selecting LLC.
> Kudos to johill for suggesting that one...
[...]

This is pretty subtle; maybe it warrants a comment above WANT_LLC?

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] CONFIG_TR/CONFIG_LLC: work around the problem with select
  2012-02-05  6:31 [PATCH] CONFIG_TR/CONFIG_LLC: work around the problem with select Al Viro
  2012-02-06 13:51 ` Ben Hutchings
@ 2012-02-07 18:06 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2012-02-07 18:06 UTC (permalink / raw)
  To: viro; +Cc: jgarzik, netdev

From: Al Viro <viro@ZenIV.linux.org.uk>
Date: Sun, 5 Feb 2012 06:31:39 +0000

> As it is, with PCI/ISA/MCA/CCW all set to n and PCMCIA set to m
> setting TR to y will set LLC to m, with very unpleasant results -
> net/802/psnap gets picked into obj-y, resulting in the kernel
> that won't link - psnap calls functions from llc.  The cause,
> AFAICS, is that kconfig gets rev_dep for LLC containing
> || TR && (deps for TR)
> and even though TR is boolean, both LLC and PCMCIA are tristate
> and that thing becomes || y && (n || m), i.e. || m.  The reason
> for dependency on PCMCIA is that when none of PCI, ISA, MCA, CCW
> or PCMCIA is set there'll be no tokenring drivers, so there's no
> point building tokenring core.  Proper fix probably belongs in
> kconfig (we need strict and, such that y <strict_and> m would be
> y, so that rev_deps added for tristate selected by bool would
> use that instead of &&; we'd have || TR <strict_and> (deps for TR)
> in this case), but it's a rather intrusive change.  There's an
> easy workaround in case of TR -> LLC select, namely to have a def_bool y
> symbol sitting under if TR and have that symbol selecting LLC.
> Kudos to johill for suggesting that one...
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-07 18:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-05  6:31 [PATCH] CONFIG_TR/CONFIG_LLC: work around the problem with select Al Viro
2012-02-06 13:51 ` Ben Hutchings
2012-02-07 18:06 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).