* Re: (Linus, please respond!) Re: Roadmap to restoring working usb module autoloading?
@ 2001-01-21 2:36 Keith Owens
2001-01-21 4:53 ` Keith Owens
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Keith Owens @ 2001-01-21 2:36 UTC (permalink / raw)
To: linux-hotplug
On Sat, 20 Jan 2001 17:57:30 -0800,
Miles Lane <miles@megapathdsl.net> wrote:
>"Adam J. Richter" wrote:
>>
>> I am concerned that the situation with usb module autoloading
>> seems to be deadlocked and so I want to propose a roadmap for
>> getting to the point where usb module autoloading works when a
>> user installs the latest versions of everything and does not
>> make any additional modifications.
>
>I agree that we are deadlocked. However, I think we should continue
>to try to get Linus to accept Kieth's patch, at least until he gives
>us a solid reason for rejecting the patch.
For the record. The addition of match_flags in struct usb_device_id
highlighted an ABI problem between the kernel and depmod. It proved
that relying on the table size to detect format changes was a bad
idea(TM), adding a field will not always change the table size. The
table version numbers added in my patch (appended) are _required_ for
depmod to reliably detect that a format has changed.
Checking kernel version will not work. That method requires users to
upgrade to a new modutils that knows about the changes from one kernel
version to another. Users do not upgrade when told to, relying on
kernel version guarantees that some users will try to read new table
formats with old modutils and get random errors. The ABI exporter must
define the interface version, not the ABI consumer.
Index: 0.1/include/linux/usb.h
--- 0.1/include/linux/usb.h Fri, 05 Jan 2001 13:42:29 +1100 kaos (linux-2.4/Z/38_usb.h 1.1 644)
+++ 0.1(w)/include/linux/usb.h Sun, 07 Jan 2001 22:36:31 +1100 kaos (linux-2.4/Z/38_usb.h 1.1 644)
@@ -344,12 +344,18 @@ struct usb_device;
#define USB_INTERFACE_INFO(cl,sc,pr) \
match_flags: USB_DEVICE_ID_MATCH_INT_INFO, bInterfaceClass: (cl), bInterfaceSubClass: (sc), bInterfaceProtocol: (pr)
-struct usb_device_id {
- /* This bitmask is used to determine which of the following fields
- * are to be used for matching.
- */
- __u16 match_flags;
+/* match_flags added in 2.4.0 but at the start which messed up depmod.
+ * match_flags moved to before driver_info in 2.4.1 by KAO, you also need
+ * modutils 2.4.1. USB modules cannot be supported in kernel 2.4.0,
+ * insufficient data to detect which table format is being used.
+ *
+ * Do NOT change this table format without checking with the modutils
+ * maintainer. This is an ABI visible structure.
+ */
+
+#define usb_device_id_ver 2 /* Version 2 table */
+struct usb_device_id {
/*
* vendor/product codes are checked, if vendor is nonzero
* Range is for device revision (bcdDevice), inclusive;
@@ -374,6 +380,11 @@ struct usb_device_id {
__u8 bInterfaceClass;
__u8 bInterfaceSubClass;
__u8 bInterfaceProtocol;
+
+ /* This bitmask is used to determine which of the preceding fields
+ * are to be used for matching.
+ */
+ __u16 match_flags; /* New in version 2 */
/*
* for driver's use; not involved in driver matching.
Index: 0.1/include/linux/isapnp.h
--- 0.1/include/linux/isapnp.h Fri, 05 Jan 2001 13:42:29 +1100 kaos (linux-2.4/b/b/11_isapnp.h 1.1 644)
+++ 0.1(w)/include/linux/isapnp.h Sun, 07 Jan 2001 22:36:40 +1100 kaos (linux-2.4/b/b/11_isapnp.h 1.1 644)
@@ -142,6 +142,16 @@ struct isapnp_resources {
#define ISAPNP_CARD_TABLE(name) \
MODULE_GENERIC_TABLE(isapnp_card, name)
+/* Do NOT change the format of struct isapnp_card_id, struct isapnp_device_id or
+ * the value of ISAPNP_CARD_DEVS without checking with the modutils maintainer.
+ * These are ABI visible structures and defines.
+ *
+ * isapnp_device_id_ver is a single version number for the combination of
+ * struct isapnp_card_id and struct isapnp_device_id.
+ */
+
+#define isapnp_device_id_ver 1 /* Version 1 tables */
+
struct isapnp_card_id {
unsigned long driver_data; /* data private to the driver */
unsigned short card_vendor, card_device;
Index: 0.1/include/linux/module.h
--- 0.1/include/linux/module.h Fri, 05 Jan 2001 13:42:29 +1100 kaos (linux-2.4/c/b/46_module.h 1.1 644)
+++ 0.1(w)/include/linux/module.h Sun, 07 Jan 2001 22:07:49 +1100 kaos (linux-2.4/c/b/46_module.h 1.1 644)
@@ -242,19 +242,17 @@ __attribute__((section(".modinfo"))) =
* isapnp - struct isapnp_device_id - List of ISA PnP ids supported by this module
* usb - struct usb_device_id - List of USB ids supported by this module
*/
-#define MODULE_GENERIC_TABLE(gtype,name) \
-static const unsigned long __module_##gtype##_size \
- __attribute__ ((unused)) = sizeof(struct gtype##_id); \
-static const struct gtype##_id * __module_##gtype##_table \
- __attribute__ ((unused)) = name
-#define MODULE_DEVICE_TABLE(type,name) \
- MODULE_GENERIC_TABLE(type##_device,name)
-/* not put to .modinfo section to avoid section type conflicts */
-/* The attributes of a section are set the first time the section is
- seen; we want .modinfo to not be allocated. */
+#define MODULE_GENERIC_TABLE(gtype,name) \
+static const unsigned long __module_##gtype##_size \
+ __attribute__ ((unused)) = sizeof(struct gtype##_id); \
+static const unsigned long __module_##gtype##_ver \
+ __attribute__ ((unused)) = gtype##_id_ver; \
+static const struct gtype##_id * __module_##gtype##_table \
+ __attribute__ ((unused)) = name
-__asm__(".section .modinfo\n\t.previous");
+#define MODULE_DEVICE_TABLE(type,name) \
+ MODULE_GENERIC_TABLE(type##_device,name)
/* Define the module variable, and usage macros. */
extern struct module __this_module;
Index: 0.1/include/linux/pci.h
--- 0.1/include/linux/pci.h Fri, 05 Jan 2001 13:42:29 +1100 kaos (linux-2.4/f/b/12_pci.h 1.1 644)
+++ 0.1(w)/include/linux/pci.h Sun, 07 Jan 2001 22:36:09 +1100 kaos (linux-2.4/f/b/12_pci.h 1.1 644)
@@ -439,6 +439,12 @@ struct pbus_set_ranges_data
unsigned long mem_start, mem_end;
};
+/* Do NOT change this table format without checking with the modutils
+ * maintainer. This is an ABI visible structure.
+ */
+
+#define pci_device_id_ver 1 /* Version 1 table */
+
struct pci_device_id {
unsigned int vendor, device; /* Vendor and device ID or PCI_ANY_ID */
unsigned int subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */
Index: 0.1/Documentation/Changes
--- 0.1/Documentation/Changes Fri, 05 Jan 2001 13:42:29 +1100 kaos (linux-2.4/Z/c/26_Changes 1.1 644)
+++ 0.4(w)/Documentation/Changes Tue, 09 Jan 2001 02:43:44 +1100 kaos (linux-2.4/Z/c/26_Changes 1.1 644)
@@ -52,7 +52,7 @@ o Gnu C 2.91.66
o Gnu make 3.77 # make --version
o binutils 2.9.1.0.25 # ld -v
o util-linux 2.10o # fdformat --version
-o modutils 2.4.0 # insmod -V
+o modutils 2.4.1 # insmod -V
o e2fsprogs 1.19 # tune2fs --version
o pcmcia-cs 3.1.21 # cardmgr -V
o PPP 2.4.0 # pppd --version
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: (Linus, please respond!) Re: Roadmap to restoring working usb module autoloading?
2001-01-21 2:36 (Linus, please respond!) Re: Roadmap to restoring working usb module autoloading? Keith Owens
@ 2001-01-21 4:53 ` Keith Owens
2001-01-21 6:06 ` Keith Owens
2001-01-21 18:07 ` Johannes Erdfelt
2 siblings, 0 replies; 4+ messages in thread
From: Keith Owens @ 2001-01-21 4:53 UTC (permalink / raw)
To: linux-hotplug
On Sat, 20 Jan 2001 20:39:31 -0800 (PST),
Linus Torvalds <torvalds@transmeta.com> wrote:
>On Sun, 21 Jan 2001, Keith Owens wrote:
>>
>> For the record. The addition of match_flags in struct usb_device_id
>> highlighted an ABI problem between the kernel and depmod. It proved
>> that relying on the table size to detect format changes was a bad
>> idea(TM), adding a field will not always change the table size. The
>> table version numbers added in my patch (appended) are _required_ for
>> depmod to reliably detect that a format has changed.
>
>I'd much rather just have the 2.4.0 behaviour, and no versioning. Tell
>people that 2.4.0-test kernels won't work. They'll notice on their own.
>
>This problem won't be a problem in a few months if we just kill it _now_,
>rather than try to work around it.
>
> Linus
Fine, until the next time any of the table formats have to be changed.
The version number on the kernel tables that depmod reads are there for
future changes, not just for the current usb mess. Without a version
number we will have exactly the same problems on the next ABI change.
Whether we should support the 2.4.0-test format for usb is a separate
question and has nothing to do with whether depmod needs version
numbers at all. My patch is to future proof the kernel/depmod interface.
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: (Linus, please respond!) Re: Roadmap to restoring working usb module autoloading?
2001-01-21 2:36 (Linus, please respond!) Re: Roadmap to restoring working usb module autoloading? Keith Owens
2001-01-21 4:53 ` Keith Owens
@ 2001-01-21 6:06 ` Keith Owens
2001-01-21 18:07 ` Johannes Erdfelt
2 siblings, 0 replies; 4+ messages in thread
From: Keith Owens @ 2001-01-21 6:06 UTC (permalink / raw)
To: linux-hotplug
On Sat, 20 Jan 2001 21:31:40 -0800 (PST),
Linus Torvalds <torvalds@transmeta.com> wrote:
>
>
>On Sun, 21 Jan 2001, Keith Owens wrote:
>>
>> Fine, until the next time any of the table formats have to be changed.
>
>Oh, agreed. We want to fix this eventually, but I really feel that it's a
>2.5.x issue.
>
>It turns into a 2.4.x issue only if somebody can show that 2.4.0 _cannot_
>work. Which is not the case, as far as I know.
Yes, I can change modutils 2.4.2 to only support the kernel 2.4.0
format for usb, but I do not see that as the main issue. To me, future
proofing is the main issue, to prevent the same mess again.
>(Side note: when 2.5.x does do this and adds proper versioning, and it is
>found to be good, and the improved modutils spread out, we may end up
>back-porting the stuff later. And I would certainly not mind modutils
>already getting the hooks in it to support versioning - I do see that it's
>a good idea. It' sjust that I'd rather not make what I consider to be just
>cleanups when they actually change behaviour).
If it is guaranteed that 2.4 will never change the formats of any of
the kernel/depmod tables, even when code is back ported from 2.5 to
2.4, then I agree with you that we do not need version numbers in 2.4.
But if there is any chance that the table formats will change in 2.4
then I want the version numbers added now to define the base support
level and to detect future problems before they occur.
Since usb is the only table that has multiple versions at the moment,
it is the only one to worry about. Version 1 usb is 2.4.0-prerelease
and earlier, this works with all modutils. I want to support this
earlier version because I know of at least one group that is still
using 2.4.0-test12 for IA64 hardware reasons. Version 2 usb is for
2.4.0 with my kernel patch, this works with modutils 2.4.1 onwards.
Nothing supports the stock 2.4.0 kernel usb table format. Not because
I am being perverse but because adding the match_flags field to the
start of the structure really messes up modutils, it has to support two
completely different structure layouts. My patch moves match_flags to
the middle of the structure, replacing padding bytes and simplifying
modutils. This does not change kernel behaviour because nothing works
with the 2.4.0 usb table format, it is already broken.
Modutils and hotplug scripts are all ready for kernel 2.4.1, they just
needs the kernel patch. There is no change to kernel behaviour, the
patch fixes a bug.
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: (Linus, please respond!) Re: Roadmap to restoring working usb module autoloading?
2001-01-21 2:36 (Linus, please respond!) Re: Roadmap to restoring working usb module autoloading? Keith Owens
2001-01-21 4:53 ` Keith Owens
2001-01-21 6:06 ` Keith Owens
@ 2001-01-21 18:07 ` Johannes Erdfelt
2 siblings, 0 replies; 4+ messages in thread
From: Johannes Erdfelt @ 2001-01-21 18:07 UTC (permalink / raw)
To: linux-hotplug
On Sat, Jan 20, 2001, Miles Lane <miles@megapathdsl.net> wrote:
> Keith Owens wrote:
>
> > Since usb is the only table that has multiple versions at the
> > moment, it is the only one to worry about. Version 1 usb is
> > 2.4.0-prerelease and earlier, this works with all modutils.
> > I want to support this earlier version because I know of at
> > least one group that is still using 2.4.0-test12 for IA64
> > hardware reasons.
>
> I would like to know more about this. Does anyone have specifics
> about this IA64 issue? Kieth, would you research this?
I don't know of anyone using 2.4.0-test12. 2.4.0 is much more stable since
it has some important stability fixes for ia64.
If they can't use 2.4.0 kernels, that means they're running an old
stepping of the CPU's, and autoloading of the USB modules are the least
of their concerns.
> David Brownell has already dropped all support for the
> pre-2.4.0 versions of hotplugging. People who want to use
> the USB backport can simply continue using the usb.rc and USB
> policy scripts, can't they?
Exactly. If they REALLY must use pre 2.4 kernels, they have other issues
to worry about. They can manually load the modules or patch themselves.
Keith, please, let it go.
JE
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-01-21 18:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-21 2:36 (Linus, please respond!) Re: Roadmap to restoring working usb module autoloading? Keith Owens
2001-01-21 4:53 ` Keith Owens
2001-01-21 6:06 ` Keith Owens
2001-01-21 18:07 ` Johannes Erdfelt
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).