2005-05-19 16:43:29

by Tom Rini

[permalink] [raw]
Subject: [PATCH 2.6.12-rc4] Add EXPORT_SYMBOL for hotplug_path

If CONFIG_INPUT is set as a module, it will not load as hotplug_path is
not a defined symbol. Trivial fix is to EXPORT_SYMBOL hotplug_path.

Signed-off-by: Tom Rini <[email protected]>

Index: lib/kobject_uevent.c
===================================================================
--- c7d7a187a2125518e655dfeadffd38156239ffc3/lib/kobject_uevent.c (mode:100644)
+++ uncommitted/lib/kobject_uevent.c (mode:100644)
@@ -21,6 +21,7 @@
#include <linux/string.h>
#include <linux/kobject_uevent.h>
#include <linux/kobject.h>
+#include <linux/module.h>
#include <net/sock.h>

#define BUFFER_SIZE 1024 /* buffer for the hotplug env */
@@ -178,6 +179,7 @@

#ifdef CONFIG_HOTPLUG
char hotplug_path[HOTPLUG_PATH_LEN] = "/sbin/hotplug";
+EXPORT_SYMBOL(hotplug_path);
u64 hotplug_seqnum;
static DEFINE_SPINLOCK(sequence_lock);


--
Tom Rini
http://gate.crashing.org/~trini/


2005-05-19 17:41:58

by Arjan van de Ven

[permalink] [raw]
Subject: Re: [PATCH 2.6.12-rc4] Add EXPORT_SYMBOL for hotplug_path

On Thu, 2005-05-19 at 09:43 -0700, Tom Rini wrote:
> If CONFIG_INPUT is set as a module, it will not load as hotplug_path is
> not a defined symbol. Trivial fix is to EXPORT_SYMBOL hotplug_path.

shouldn't this be a _GPL export since it's quite internal to linux...


2005-05-19 18:17:15

by Tom Rini

[permalink] [raw]
Subject: Re: [PATCH 2.6.12-rc4] Add EXPORT_SYMBOL for hotplug_path

On Thu, May 19, 2005 at 07:40:29PM +0200, Arjan van de Ven wrote:
> On Thu, 2005-05-19 at 09:43 -0700, Tom Rini wrote:
> > If CONFIG_INPUT is set as a module, it will not load as hotplug_path is
> > not a defined symbol. Trivial fix is to EXPORT_SYMBOL hotplug_path.
>
> shouldn't this be a _GPL export since it's quite internal to linux...

Doesn't matter to me.

Signed-off-by: Tom Rini <[email protected]>

Index: lib/kobject_uevent.c
===================================================================
--- c7d7a187a2125518e655dfeadffd38156239ffc3/lib/kobject_uevent.c (mode:100644)
+++ uncommitted/lib/kobject_uevent.c (mode:100644)
@@ -21,6 +21,7 @@
#include <linux/string.h>
#include <linux/kobject_uevent.h>
#include <linux/kobject.h>
+#include <linux/module.h>
#include <net/sock.h>

#define BUFFER_SIZE 1024 /* buffer for the hotplug env */
@@ -178,6 +179,7 @@

#ifdef CONFIG_HOTPLUG
char hotplug_path[HOTPLUG_PATH_LEN] = "/sbin/hotplug";
+EXPORT_SYMBOL_GPL(hotplug_path);
u64 hotplug_seqnum;
static DEFINE_SPINLOCK(sequence_lock);


--
Tom Rini
http://gate.crashing.org/~trini/

2005-05-19 18:29:58

by Dave Jones

[permalink] [raw]
Subject: Re: [PATCH 2.6.12-rc4] Add EXPORT_SYMBOL for hotplug_path

On Thu, May 19, 2005 at 11:16:21AM -0700, Tom Rini wrote:
> On Thu, May 19, 2005 at 07:40:29PM +0200, Arjan van de Ven wrote:
> > On Thu, 2005-05-19 at 09:43 -0700, Tom Rini wrote:
> > > If CONFIG_INPUT is set as a module, it will not load as hotplug_path is
> > > not a defined symbol. Trivial fix is to EXPORT_SYMBOL hotplug_path.
> >
> > shouldn't this be a _GPL export since it's quite internal to linux...
>
> Doesn't matter to me.
>
> Signed-off-by: Tom Rini <[email protected]>
>
> Index: lib/kobject_uevent.c
> ===================================================================
> --- c7d7a187a2125518e655dfeadffd38156239ffc3/lib/kobject_uevent.c (mode:100644)
> +++ uncommitted/lib/kobject_uevent.c (mode:100644)
> @@ -21,6 +21,7 @@
> #include <linux/string.h>
> #include <linux/kobject_uevent.h>
> #include <linux/kobject.h>
> +#include <linux/module.h>
> #include <net/sock.h>
>
> #define BUFFER_SIZE 1024 /* buffer for the hotplug env */
> @@ -178,6 +179,7 @@
>
> #ifdef CONFIG_HOTPLUG
> char hotplug_path[HOTPLUG_PATH_LEN] = "/sbin/hotplug";
> +EXPORT_SYMBOL_GPL(hotplug_path);
> u64 hotplug_seqnum;
> static DEFINE_SPINLOCK(sequence_lock);

ACK, I hit this a few days ago too, and did an identical patch
for the Fedora kernel. In addition, there was also this one..

Signed-off-by: Dave Jones <davejredhat.com>



WARNING:
/usr/src/build/566509-ppc64iseries/install/lib/modules/2.6.11-1.1311_FC4/kernel/drivers/input/input.ko
needs unknown symbol add_input_randomness

--- linux-2.6.11/drivers/char/random.c~ 2005-05-14 16:42:24.000000000 -0400
+++ linux-2.6.11/drivers/char/random.c 2005-05-14 16:42:46.000000000 -0400
@@ -646,6 +646,7 @@ extern void add_input_randomness(unsigne
add_timer_randomness(&input_timer_state,
(type << 4) ^ code ^ (code >> 4) ^ value);
}
+EXPORT_SYMBOL_GPL(add_input_randomness);

void add_interrupt_randomness(int irq)
{



2005-05-20 05:12:10

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 2.6.12-rc4] Add EXPORT_SYMBOL for hotplug_path

On Thu, May 19, 2005 at 09:43:23AM -0700, Tom Rini wrote:
> If CONFIG_INPUT is set as a module, it will not load as hotplug_path is
> not a defined symbol. Trivial fix is to EXPORT_SYMBOL hotplug_path.
>
> Signed-off-by: Tom Rini <[email protected]>

Ick, no, I thought we got rid of that usage. no one should be calling
hotplug on their own, lots of bad things happen to udevd and HAL if they
do.

What caused the input code to be added back into the kernel? I'll try
to go track that down...

thanks,

greg k-h

2005-05-20 05:18:36

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 2.6.12-rc4] Add EXPORT_SYMBOL for hotplug_path

On Friday 20 May 2005 00:18, Greg KH wrote:
> On Thu, May 19, 2005 at 09:43:23AM -0700, Tom Rini wrote:
> > If CONFIG_INPUT is set as a module, it will not load as hotplug_path is
> > not a defined symbol. Trivial fix is to EXPORT_SYMBOL hotplug_path.
> >
> > Signed-off-by: Tom Rini <[email protected]>
>
> Ick, no, I thought we got rid of that usage. no one should be calling
> hotplug on their own, lots of bad things happen to udevd and HAL if they
> do.
>
> What caused the input code to be added back into the kernel? I'll try
> to go track that down...
>

The change never made it into the kernel. And I need to finish proper
input_dev sysfs conversion...

--
Dmitry

2005-05-20 06:25:55

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 2.6.12-rc4] Add EXPORT_SYMBOL for hotplug_path

On Fri, May 20, 2005 at 12:18:23AM -0500, Dmitry Torokhov wrote:
> On Friday 20 May 2005 00:18, Greg KH wrote:
> > On Thu, May 19, 2005 at 09:43:23AM -0700, Tom Rini wrote:
> > > If CONFIG_INPUT is set as a module, it will not load as hotplug_path is
> > > not a defined symbol. Trivial fix is to EXPORT_SYMBOL hotplug_path.
> > >
> > > Signed-off-by: Tom Rini <[email protected]>
> >
> > Ick, no, I thought we got rid of that usage. no one should be calling
> > hotplug on their own, lots of bad things happen to udevd and HAL if they
> > do.
> >
> > What caused the input code to be added back into the kernel? I'll try
> > to go track that down...
> >
>
> The change never made it into the kernel. And I need to finish proper
> input_dev sysfs conversion...

Ah, ok, thanks. So I'll ACK the EXPORT_SYMBOL_GPL() version of this
patch for now.

thanks,

greg k-h

2005-05-20 07:13:27

by Kay Sievers

[permalink] [raw]
Subject: Re: [PATCH 2.6.12-rc4] Add EXPORT_SYMBOL for hotplug_path

On Thu, 2005-05-19 at 09:43 -0700, Tom Rini wrote:
> If CONFIG_INPUT is set as a module, it will not load as hotplug_path is
> not a defined symbol. Trivial fix is to EXPORT_SYMBOL hotplug_path.
>
> Signed-off-by: Tom Rini <[email protected]>
>
> Index: lib/kobject_uevent.c
> ===================================================================
> --- c7d7a187a2125518e655dfeadffd38156239ffc3/lib/kobject_uevent.c (mode:100644)
> +++ uncommitted/lib/kobject_uevent.c (mode:100644)
> @@ -21,6 +21,7 @@
> #include <linux/string.h>
> #include <linux/kobject_uevent.h>
> #include <linux/kobject.h>
> +#include <linux/module.h>
> #include <net/sock.h>
>
> #define BUFFER_SIZE 1024 /* buffer for the hotplug env */
> @@ -178,6 +179,7 @@
>
> #ifdef CONFIG_HOTPLUG
> char hotplug_path[HOTPLUG_PATH_LEN] = "/sbin/hotplug";
> +EXPORT_SYMBOL(hotplug_path);
> u64 hotplug_seqnum;
> static DEFINE_SPINLOCK(sequence_lock);

Please don't export it again. We're on the way to make it private.
Nobody should ever have access to it outside of the driver core. The
input layer event stuff is completely broken and we are already working
on fixing this to use the driver core instead of calling /sbin/hotplug,
which is completely nonsense these days.

Thanks,
Kay

2005-05-20 17:18:20

by Tom Rini

[permalink] [raw]
Subject: Re: [PATCH 2.6.12-rc4] Add EXPORT_SYMBOL for hotplug_path

On Fri, May 20, 2005 at 09:12:55AM +0200, Kay Sievers wrote:
> On Thu, 2005-05-19 at 09:43 -0700, Tom Rini wrote:
> > If CONFIG_INPUT is set as a module, it will not load as hotplug_path is
> > not a defined symbol. Trivial fix is to EXPORT_SYMBOL hotplug_path.
> >
> > Signed-off-by: Tom Rini <[email protected]>
> >
> > Index: lib/kobject_uevent.c
> > ===================================================================
> > --- c7d7a187a2125518e655dfeadffd38156239ffc3/lib/kobject_uevent.c (mode:100644)
> > +++ uncommitted/lib/kobject_uevent.c (mode:100644)
> > @@ -21,6 +21,7 @@
> > #include <linux/string.h>
> > #include <linux/kobject_uevent.h>
> > #include <linux/kobject.h>
> > +#include <linux/module.h>
> > #include <net/sock.h>
> >
> > #define BUFFER_SIZE 1024 /* buffer for the hotplug env */
> > @@ -178,6 +179,7 @@
> >
> > #ifdef CONFIG_HOTPLUG
> > char hotplug_path[HOTPLUG_PATH_LEN] = "/sbin/hotplug";
> > +EXPORT_SYMBOL(hotplug_path);
> > u64 hotplug_seqnum;
> > static DEFINE_SPINLOCK(sequence_lock);
>
> Please don't export it again. We're on the way to make it private.
> Nobody should ever have access to it outside of the driver core. The
> input layer event stuff is completely broken and we are already working
> on fixing this to use the driver core instead of calling /sbin/hotplug,
> which is completely nonsense these days.

So Greg said he's ACK this since the "make it private" stuff isn't done
yet. Will this go in or no?

--
Tom Rini
http://gate.crashing.org/~trini/

2005-05-20 17:57:22

by Kay Sievers

[permalink] [raw]
Subject: Re: [PATCH 2.6.12-rc4] Add EXPORT_SYMBOL for hotplug_path

On Fri, 2005-05-20 at 10:18 -0700, Tom Rini wrote:
> On Fri, May 20, 2005 at 09:12:55AM +0200, Kay Sievers wrote:
> > On Thu, 2005-05-19 at 09:43 -0700, Tom Rini wrote:
> > > If CONFIG_INPUT is set as a module, it will not load as hotplug_path is
> > > not a defined symbol. Trivial fix is to EXPORT_SYMBOL hotplug_path.
> > >
> > > Signed-off-by: Tom Rini <[email protected]>
> > >
> > > Index: lib/kobject_uevent.c
> > > ===================================================================
> > > --- c7d7a187a2125518e655dfeadffd38156239ffc3/lib/kobject_uevent.c (mode:100644)
> > > +++ uncommitted/lib/kobject_uevent.c (mode:100644)
> > > @@ -21,6 +21,7 @@
> > > #include <linux/string.h>
> > > #include <linux/kobject_uevent.h>
> > > #include <linux/kobject.h>
> > > +#include <linux/module.h>
> > > #include <net/sock.h>
> > >
> > > #define BUFFER_SIZE 1024 /* buffer for the hotplug env */
> > > @@ -178,6 +179,7 @@
> > >
> > > #ifdef CONFIG_HOTPLUG
> > > char hotplug_path[HOTPLUG_PATH_LEN] = "/sbin/hotplug";
> > > +EXPORT_SYMBOL(hotplug_path);
> > > u64 hotplug_seqnum;
> > > static DEFINE_SPINLOCK(sequence_lock);
> >
> > Please don't export it again. We're on the way to make it private.
> > Nobody should ever have access to it outside of the driver core. The
> > input layer event stuff is completely broken and we are already working
> > on fixing this to use the driver core instead of calling /sbin/hotplug,
> > which is completely nonsense these days.
>
> So Greg said he's ACK this since the "make it private" stuff isn't done
> yet. Will this go in or no?

Well, it doesn't depend on "make it private" it depends on Dimitry, who
wanted to tweak our patch for the input layer. But we wait for weeeks
for that. The SUSE kernel already ships a driver-core input layer
without the /sbin/hotplug stuff.

Kay

2005-05-20 19:07:58

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 2.6.12-rc4] Add EXPORT_SYMBOL for hotplug_path

On 5/20/05, Kay Sievers <[email protected]> wrote:
>
> Well, it doesn't depend on "make it private" it depends on Dimitry, who
> wanted to tweak our patch for the input layer. But we wait for weeeks
> for that. The SUSE kernel already ships a driver-core input layer
> without the /sbin/hotplug stuff.
>

Kay,

I am sorry for being slow with these patches but I really do spend all
time that I can on kernel. Unfortunately, there are also other input
problems (KVMs causing mice lose sync), and since BK is gone and there
is a big backlog of input patches in Vojtech's tree I am unable to get
patches easily in mm. I was thinking about creating a git tree or a
quilt export but I don't have a place to host them ;(

--
Dmitry

2005-05-20 19:48:38

by Kay Sievers

[permalink] [raw]
Subject: Re: [PATCH 2.6.12-rc4] Add EXPORT_SYMBOL for hotplug_path

On Fri, 2005-05-20 at 14:07 -0500, Dmitry Torokhov wrote:
> On 5/20/05, Kay Sievers <[email protected]> wrote:
> >
> > Well, it doesn't depend on "make it private" it depends on Dimitry, who
> > wanted to tweak our patch for the input layer. But we wait for weeeks
> > for that. The SUSE kernel already ships a driver-core input layer
> > without the /sbin/hotplug stuff.
> >
>
> Kay,
>
> I am sorry for being slow with these patches but I really do spend all
> time that I can on kernel.

Oh well, I know that problem. :) We need to move completely away from
unmanaged kernel-forked processes in the hotplug area. SUSE 9.3 already
ships a udevd that listens only on netlink for hotplug messages
and /proc/sys/kernel/hotplug is set to "".
Hannes converted the input layer to a input_device class to get the
event through netlink. Maybe you can have a second look at it, so that
we can get that thing upstream soon to fix the last broken hotplug-user
and make hotplug_path finally private.

Thanks,
Kay


2005-05-20 20:11:11

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 2.6.12-rc4] Add EXPORT_SYMBOL for hotplug_path

On 5/20/05, Kay Sievers <[email protected]> wrote:
> On Fri, 2005-05-20 at 14:07 -0500, Dmitry Torokhov wrote:
> > On 5/20/05, Kay Sievers <[email protected]> wrote:
> > >
> > > Well, it doesn't depend on "make it private" it depends on Dimitry, who
> > > wanted to tweak our patch for the input layer. But we wait for weeeks
> > > for that. The SUSE kernel already ships a driver-core input layer
> > > without the /sbin/hotplug stuff.
> > >
> >
> > Kay,
> >
> > I am sorry for being slow with these patches but I really do spend all
> > time that I can on kernel.
>
> Oh well, I know that problem. :) We need to move completely away from
> unmanaged kernel-forked processes in the hotplug area. SUSE 9.3 already
> ships a udevd that listens only on netlink for hotplug messages
> and /proc/sys/kernel/hotplug is set to "".
> Hannes converted the input layer to a input_device class to get the
> event through netlink. Maybe you can have a second look at it, so that
> we can get that thing upstream soon to fix the last broken hotplug-user
> and make hotplug_path finally private.
>

Could you send me the tlatest version, please? Lats time I think there
were some concerns about lifetime rules...

--
Dmitry