2004-09-25 03:43:04

by Patrick Mochel

[permalink] [raw]
Subject: [BK] Changing driver core/sysfs/kobject symbol exports to GPL only


What's life without a little controversey once in a while?

The attached patch and referenced BK tree changes all the symbol exports
in the driver core, sysfs, and the kobject core to EXPORT_SYMBOL_GPL [1].

While I derive a certain amount of pleasure from being cantankerous, the
justification is more pragmatic. The users of these functions are all, in
most cases, other subsystems, which provide a layer of abstraction for the
downstream users (drivers, etc). The exportation of these wrappers is of
course under the control of that subsystem.

Many of those subsystems cannot be built modularly [2]. I have no idea,
and it is impossible to tell, if and how many out-of-tree subsystems (a)
there are and (b) use any of these functions.

What's more is that if anything is to change in these functions, either in
form or in semantics, it will have a direct effect on the users. and in
the absence of auditing could cause obscure bugs. Throughout the course of
development, we've tried to make sure that nothing broke when core changes
were made. Of course mistakes have been made, but not nearly so many if
any of the subsystems we were effecting had been out of the tree.

In short, being able to audit all of the users of these functions is
necessary to their continued evolution (whatever that may entail). It
would make the most sense if all users were part of the kernel, and it
makes little sense to suppor their use by any unknown or binary modules.

So, my question is - does this make sense to others? Are there are any
technical reasons for not doing this? If not, then please apply/pull.

Thanks,


Pat


[1] - Well, it at least changes the files that I originally created. Some
of those include functions that Greg actually wrote, but I figure he'll
accept/reject them with the rest..

[2] - It would be good to remove the symbols that are not used by any
known modules, but that's fodder for another set of patches.


Please pull from

bk://kernel.bkbits.net:/home/mochel/linux-2.6-core

This will update the following files:

drivers/base/bus.c | 28 ++++++++++++++--------------
drivers/base/class.c | 34 +++++++++++++++++-----------------
drivers/base/core.c | 22 +++++++++++-----------
drivers/base/driver.c | 14 +++++++-------
drivers/base/firmware.c | 4 ++--
drivers/base/platform.c | 16 ++++++++--------
drivers/base/power/main.c | 2 +-
drivers/base/power/resume.c | 4 ++--
drivers/base/power/suspend.c | 4 ++--
drivers/base/sys.c | 16 ++++++++--------
fs/sysfs/bin.c | 4 ++--
fs/sysfs/dir.c | 6 +++---
fs/sysfs/file.c | 6 +++---
fs/sysfs/group.c | 4 ++--
fs/sysfs/symlink.c | 4 ++--
15 files changed, 84 insertions(+), 84 deletions(-)

through these ChangeSets:

<[email protected]> (04/09/24 1.1946.5.15)
[driver core] Change symbol exports to GPL only in power/suspend.c.

Signed-of-by Patrick Mochel <[email protected]>

<[email protected]> (04/09/24 1.1946.5.14)
[driver core] Change symbol exports to GPL only in power/resume.c

Signed-of-by Patrick Mochel <[email protected]>

<[email protected]> (04/09/24 1.1946.5.13)
[driver core] Change symbol exports to GPL only in power/main.c

Signed-of-by Patrick Mochel <[email protected]>

<[email protected]> (04/09/24 1.1946.5.12)
[sysfs] Change symbol exports to GPL only in symlink.c.

Signed-of-by Patrick Mochel <[email protected]>

<[email protected]> (04/09/24 1.1946.5.11)
[sysfs] Change symbol exports to GPL only in group.c.

Signed-of-by Patrick Mochel <[email protected]>

<[email protected]> (04/09/24 1.1946.5.10)
[sysfs] Change symbol exports to GPL only in file.c.

Signed-of-by Patrick Mochel <[email protected]>

<[email protected]> (04/09/24 1.1946.5.9)
[sysfs] Change symbol exports to GPL only in dir.c

Signed-of-by Patrick Mochel <[email protected]>

<[email protected]> (04/09/24 1.1946.5.8)
[sysfs] Change symbol exports to GPL only in bin.c

Signed-of-by Patrick Mochel <[email protected]>

<[email protected]> (04/09/24 1.1946.5.7)
[driver model] Change symbol exports to GPL only in sys.c

Signed-of-by Patrick Mochel <[email protected]>

<[email protected]> (04/09/24 1.1946.5.6)
[driver model] Change symbol exports to GPL only in platform.c.

Signed-of-by Patrick Mochel <[email protected]>

<[email protected]> (04/09/24 1.1946.5.5)
[driver model] Change symbol exports to GPL only in firmware.c

Signed-of-by Patrick Mochel <[email protected]>

<[email protected]> (04/09/24 1.1946.5.4)
[driver model] Change symbol exports to GPL only in driver.c

Signed-of-by Patrick Mochel <[email protected]>

<[email protected]> (04/09/24 1.1946.5.3)
[driver model] Change symbol exports to GPL only in core.c

Signed-of-by Patrick Mochel <[email protected]>

<[email protected]> (04/09/24 1.1946.5.2)
[driver model] Change sybmols exports to GPL only in class.c

Signed-of-by Patrick Mochel <[email protected]>

<[email protected]> (04/09/24 1.1946.5.1)
[driver model] Change symbol exports to GPL only in drivers/base/bus.c.

Signed-of-by Patrick Mochel <[email protected]>


Attachments:
export-symbol-gpl.diff (12.80 kB)

2004-09-25 03:56:28

by Greg KH

[permalink] [raw]
Subject: Re: [BK] Changing driver core/sysfs/kobject symbol exports to GPL only

On Fri, Sep 24, 2004 at 08:42:31PM -0700, Patrick Mochel wrote:
>
> What's life without a little controversey once in a while?

Boring :)

> Many of those subsystems cannot be built modularly [2].

Hey, some of them can. Like i2c and usb for example. And one of these
days we'll get pci modular just because it's a fun thing to attempt.

> So, my question is - does this make sense to others?

Yes, I completely agree with this change.

> Are there are any technical reasons for not doing this?

Nope.

> If not, then please apply/pull.

I will do so in a few minutes, thanks for the patches.

greg k-h

2004-09-25 04:24:43

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [BK] Changing driver core/sysfs/kobject symbol exports to GPL only

On Friday 24 September 2004 10:42 pm, Patrick Mochel wrote:
> What's life without a little controversey once in a while?
>
> The attached patch and referenced BK tree changes all the symbol exports
> in the driver core, sysfs, and the kobject core to EXPORT_SYMBOL_GPL [1].

May I ask to keep class_simple and maybe platform_device_register_simple
available to non-GPL modules. These functions offer limited and documented
semantic and while it is impossible to build entire new subsystem around
them it will allow non-GPL stuff still be somewhat integrated - standard
hotplug mostly I think...

--
Dmitry

2004-09-25 04:36:16

by Patrick Mochel

[permalink] [raw]
Subject: Re: [BK] Changing driver core/sysfs/kobject symbol exports to GPL only


On Fri, 24 Sep 2004, Dmitry Torokhov wrote:

> On Friday 24 September 2004 10:42 pm, Patrick Mochel wrote:
> > What's life without a little controversey once in a while?
> >
> > The attached patch and referenced BK tree changes all the symbol exports
> > in the driver core, sysfs, and the kobject core to EXPORT_SYMBOL_GPL [1].
>
> May I ask to keep class_simple and maybe platform_device_register_simple
> available to non-GPL modules. These functions offer limited and documented
> semantic and while it is impossible to build entire new subsystem around
> them it will allow non-GPL stuff still be somewhat integrated - standard
> hotplug mostly I think...

I didn't touch class_simple. Are there really external modules that use
platform_device_register_simple(), or you speaking hypothetically?

IOW, this is a call to anyone that has external modules (that aren't GPL)
to step up and claim usage and make arguments for their non-GPL
exportability.


Pat

2004-09-25 04:57:57

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [BK] Changing driver core/sysfs/kobject symbol exports to GPL only

On Friday 24 September 2004 11:36 pm, Patrick Mochel wrote:
>
> On Fri, 24 Sep 2004, Dmitry Torokhov wrote:
>
> > On Friday 24 September 2004 10:42 pm, Patrick Mochel wrote:
> > > What's life without a little controversey once in a while?
> > >
> > > The attached patch and referenced BK tree changes all the symbol exports
> > > in the driver core, sysfs, and the kobject core to EXPORT_SYMBOL_GPL [1].
> >
> > May I ask to keep class_simple and maybe platform_device_register_simple
> > available to non-GPL modules. These functions offer limited and documented
> > semantic and while it is impossible to build entire new subsystem around
> > them it will allow non-GPL stuff still be somewhat integrated - standard
> > hotplug mostly I think...
>
> I didn't touch class_simple.

OOps, my bad. I thought I've seen it there... Must be my tired eyes playing
tricks on me.

> Are there really external modules that use
> platform_device_register_simple(), or you speaking hypothetically?

Since I just recently added it (for serio sysfs benefits mostly) I highly
doubt that anyone else uses it. On the other hand it is very very limited
and may be suited for "wierd" cases that do not use existing subsystems.
But then I doubt that any non-GPL would do anything besides PCI/USB/1394
Now that I gave it some more thought I am sure that
platform_device_register_simple can be safely switched to EXPORT_SYMBOL_GPL

Sorry for the noise.

--
Dmitry