lkml.org 
[lkml]   [2000]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ISA PnP (2.4.0-test9)
On Mon, 9 Oct 2000, Keith Owens wrote:

> On Mon, 9 Oct 2000 12:29:19 +0200 (MEST),
> Jaroslav Kysela <perex@suse.cz> wrote:
> >On Mon, 9 Oct 2000, Keith Owens wrote:
> >> Modutils and the kernel are compiled from different headers, none of
> >> this #include <linux/xxx.h> business in modutils. So you must never
> >> assume that the structures in modutils and in the kernel have the same
> >> specification. Since ISAPNP_CARD_DEVS is #defined and can be changed,
> >> that value must be exported to user space.
> >
> >Although ISAPNP_CARD_DEVS is #defined, we may take this value as
> >a constant. I've never seen the cards with more than five logical
> >devices. I can add a comment that a change of the constant will
> >cause compatibility problems with modutils.
>
> "compatibility problems" is putting it mildly. The moment you change
> the size of that structure, all the people using older modutils will
> start getting errors and they will blame me, not the person who changed
> the structure size.
>
> Either ISAPNP_CARD_DEVS is set in concrete and *never* changed or the
> value is exported to user space right from the start. "Export it
> later" is not an acceptable option because all the old modutils which
> do not know about the newly exported variable will fail when the
> structure changes. People are still running modutils 2.1.121 on 2.4
> kernels, they just will not upgrade. Any mismatch between kernel and
> modutils structures is a disaster waiting to happen, we must preserve a
> compatible userspace ABI for modules.
>
> >Another solution is to change ISAPNP_CARD_TABLE to:
> >
> >#define ISAPNP_CARD_TABLE(name) \
> > const int __module_isapnp_card_devs = ISAPNP_CARD_DEVS; \
> > MODULE_GENERIC_TABLE(isapnp_card, name)
> >
> >But, I think that we don't need this change at the time. If the situation
> >arises (we found an ISA PnP card with more than eight logical devices), we
> >may add a global variable to determine the structure change as well. The
> >change may be also determined with checking of the kernel version.
>
> That only works for people who upgrade to newer modutils. It does
> nothing for the 50%+ of the population who keep running old modutils on
> new kernels, they will now fail.

I fully understand your point, but I don't want to have a special
case for ISA PnP. What about this change:

#define MODULE_GENERIC_TABLE(gtype,name) \
const struct gtype##_id * __module_##gtype##_table = name

to

#define MODULE_GENERIC_TABLE(gtype,name) \
const unsigned long __module_##gtype_size = sizeof(struct gtype##_id); \
const struct gtype##_id * __module_##gtype##_table = name

This simple change allows runtime checking for size of the used
structures. It's not only related for ISA PnP IDs, but also for PCI IDs.
All structures may be freely enhanced in future. The modutils binaries may
ignore the new contents and/or recommend upgrade.

Comments?

Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
SuSE Linux http://www.suse.com
ALSA project http://www.alsa-project.org

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:45    [W:0.071 / U:2.876 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site