14 Jul, 2008

1 commit

  • Add modalias and subchannel type attributes for all subchannels.
    I/O subchannel specific attributes are now created in
    io_subchannel_probe(). modalias and subchannel type are also
    added to the uevent for the css bus. Also make the css modalias
    known.

    Signed-off-by: Cornelia Huck
    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Heiko Carstens

    Cornelia Huck
     

12 Jun, 2008

1 commit

  • Kumar Gala wrote:
    We have a case in powerpc in which we want to link some library
    routines with all module objects. The routines are intended for
    handling out-of-line function call register save/restore so having
    them as EXPORT_SYMBOL() is counter productive (we do also need to
    link the same "library" code into the kernel).

    Without this patch a powerpc build would error out and fail
    to build modules with the added register save/restore module.

    There were two obvious solutions:
    1) To link the .o file before the modpost stage
    2) To ignore the symbols in modpost

    Option 1) was ruled out because we do not have any separate
    linking stage for single file modules.

    This patch implements option 2 - and do so only for powerpc.

    The symbols we ignore are all undefined symbols named:
    _restgpr_*, _savegpr_*, _rest32gpr_*, _save32gpr_*

    Signed-off-by: Sam Ravnborg
    Cc: Kumar Gala
    Cc: Paul Mackerras

    Sam Ravnborg
     

11 May, 2008

1 commit

  • Disable modpost warnings for linkonce sections

    My build gives lots of warnings like

    WARNING: sound/core/snd.o (.gnu.linkonce.wi.mpspec_def.h.30779716): unexpected section name.
    The (.[number]+) following section name are ld generated and not expected.
    Did you forget to use "ax"/"aw" in a .S file?
    Note that for example contains
    section definitions for use in .S files.

    But for .linkonce. duplicated sections are actually ok and expected.
    So just disable the warning for this case.

    Signed-off-by: Andi Kleen
    Signed-off-by: Sam Ravnborg

    Andi Kleen
     

04 May, 2008

1 commit

  • Not all device types need a wildcard at the end of their module
    aliases. In particular, for i2c module aliases, the trailing wildcard
    is not only unneeded, it could also cause the wrong driver to be
    loaded.

    As I2C devices have no IDs, i2c module aliases are simple, arbitrary
    device names. For example:

    $ /sbin/modinfo lm90
    filename: /lib/modules/2.6.25-git18/kernel/drivers/hwmon/lm90.ko
    author: Jean Delvare
    description: LM90/ADM1032 driver
    license: GPL
    vermagic: 2.6.25-git18 mod_unload
    depends: hwmon
    alias: i2c:lm90*
    alias: i2c:adm1032*
    alias: i2c:lm99*
    alias: i2c:lm86*
    alias: i2c:max6657*
    alias: i2c:adt7461*
    alias: i2c:max6680*
    $

    This would cause trouble if one I2C chip name matches the beginning of
    another I2C chip name and both chips are supported by different
    drivers. For example, an i2c device named lm9042 would cause the lm90
    driver to be loaded, while it doesn't support that device. This case
    has yet to be seen in practice, but still, I'd like to fix it now. The
    cleanest fix is to remove the trailing wildcard from i2c module aliases.

    Here's a patch doing this.

    Not all device type aliases need a trailing wildcard, in particular
    the i2c aliases don't. Don't add a wildcard by default in do_table(),
    instead let each device type handler add it if needed.

    I have tested types acpi, dmi, eisa, i2c, ide, ieee1394, input, pci,
    pcmcia, platform, pnp, scsi, serio, ssb and usb. Other types (ccw, of,
    vio, parisc, sdio and virtio) are untested.
    Signed-off-by: Jean Delvare
    Acked-by: Jochen Friedrich
    Signed-off-by: Sam Ravnborg

    Jean Delvare
     

30 Apr, 2008

1 commit

  • Based on earlier work by Jon Smirl and Jochen Friedrich.

    This patch allows new-style i2c chip drivers to have alias names using
    the official kernel aliasing system and MODULE_DEVICE_TABLE(). At this
    point, the old i2c driver binding scheme (driver_name/type) is still
    supported.

    Signed-off-by: Jean Delvare
    Cc: Jochen Friedrich
    Cc: Jon Smirl
    Cc: Kay Sievers

    Jean Delvare
     

27 Apr, 2008

1 commit


26 Apr, 2008

2 commits

  • This patch adds a new command line option -E to modpost, expecting a symbol
    file as an argument which is read prior to symbol processing. -E can be
    supplied multiple times for as many files as is needed.

    When building kernel modules that depend on other modules not in the main
    kernel tree, modpost complains about undefined symbols:
    # make -C /path/to/linux/kernel M=/path/to/my/module
    ...
    Building modules, stage 2.
    ....
    WARNING: "rt_copy_buf" [/home/rich/osc_etl_rtw/osc_kmod.ko] undefined!
    ...etc

    This situation occurs when modpost processes the new module's symbols. When
    it finds symbols not exported by the mainline kernel, it issues this warning.

    The patch adds a new command line option -e to modpost which expects a symbol
    file as an argument. The symbols listed in this file are added to modpost's
    symbol tables during startup. -e can be supplied as often as required.

    This patch works together with the second patch. It introduces a new make
    variable, KBUILD_EXTRA_SYMBOLS, which is used when calling modpost.

    Signed-off-by: Richard Hacker
    Signed-off-by: Sam Ravnborg

    Richard Hacker
     
  • Adrian Bunk suggested a build time check for
    missing MODULE_LICENSE annotation in modules.
    The build time check is fatal as we really
    want this fixed for all modules.
    In-tree modules should all have been fixed up by now.

    Signed-off-by: Sam Ravnborg
    Cc: Adrian Bunk

    Sam Ravnborg
     

20 Apr, 2008

1 commit

  • The current PNP combined card + devices module aliase can
    never ever match anything, because these values are not available
    all at the same time to request a module.

    Instead of adding the combined alias, we add the device id's
    all as individual aliases. Device id's are exported by the PNP
    bus and can now properly used to request the loading of a
    matching module.

    The module snd-sbawe currently exports aliases, which can never
    match anything:
    alias: pnp:cCTLXXXXdCTL0045dCTL0022*
    alias: pnp:cCTLXXXXdCTL0044dCTL0023*
    alias: pnp:cCTLXXXXdCTL0042dCTL0022*
    alias: pnp:cCTLXXXXdCTL0041dCTL0021*
    alias: pnp:cCTLXXXXdCTL0031dCTL0021*
    alias: pnp:cCTL00eddCTL0041dCTL0070*
    alias: pnp:cCTL00e9dCTL0045dCTL0022*
    alias: pnp:cCTL00e4dCTL0045dCTL0022*
    alias: pnp:cCTL00c7dCTL0045dCTL0022*
    alias: pnp:cCTL00c5dCTL0045dCTL0022*
    alias: pnp:cCTL00c3dCTL0045dCTL0022*
    alias: pnp:cCTL00c1dCTL0042dCTL0022*
    alias: pnp:cCTL00b2dCTL0044dCTL0023*
    alias: pnp:cCTL009edCTL0044dCTL0023*
    alias: pnp:cCTL009ddCTL0042dCTL0022*
    alias: pnp:cCTL009fdCTL0041dCTL0021*
    alias: pnp:cCTL009cdCTL0041dCTL0021*
    alias: pnp:cCTL009adCTL0041dCTL0021*
    alias: pnp:cCTL0054dCTL0031dCTL0021*
    alias: pnp:cCTL0048dCTL0031dCTL0021*
    alias: pnp:cCTL0047dCTL0031dCTL0021*
    alias: pnp:cCTL0046dCTL0031dCTL0021*
    alias: pnp:cCTL0045dCTL0031dCTL0021*
    alias: pnp:cCTL0044dCTL0031dCTL0021*
    alias: pnp:cCTL0043dCTL0031dCTL0021*
    alias: pnp:cCTL0042dCTL0031dCTL0021*
    alias: pnp:cCTL0039dCTL0031dCTL0021*
    alias: pnp:cCTL0035dCTL0031dCTL0021*

    With this patch it exports only the device id's, as properly
    matchable aliases:
    alias: pnp:dCTL0070*
    alias: pnp:dCTL0045*
    alias: pnp:dCTL0023*
    alias: pnp:dCTL0044*
    alias: pnp:dCTL0022*
    alias: pnp:dCTL0042*
    alias: pnp:dCTL0041*
    alias: pnp:dCTL0021*
    alias: pnp:dCTL0031*

    Now, the exported value of the PNP bus can be used to autoload
    a matching module:
    $ modprobe --first-time -n -v pnp:dCTL0045
    insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/core/snd-rawmidi.ko
    insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/drivers/mpu401/snd-mpu401-uart.ko
    insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/core/snd-hwdep.ko
    insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb-common.ko
    insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb16-csp.ko
    insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb16-dsp.ko
    insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/drivers/opl3/snd-opl3-lib.ko
    insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sbawe.ko

    $ grep CTL0045 /sys/bus/pnp/devices/*/id
    /sys/bus/pnp/devices/01:01.00/id:CTL0045

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

24 Mar, 2008

1 commit

  • The module alias support in the kernel have a consistency
    check where it is checked that the size of a structure
    in the kernel and on the build host are the same.
    For cross builds this check does not make sense so detect
    when we do cross builds and silently skip the check in these
    situations.
    This fixes a build bug for a wireless driver when cross building
    for arm.

    Acked-by: Michael Buesch
    Tested-by: Gordon Farquharson
    Signed-off-by: Sam Ravnborg
    Cc: stable@kernel.org

    Sam Ravnborg
     

20 Feb, 2008

1 commit

  • XXXINIT_TO_INIT and XXXEXIT_TO_EXIT warnings use the reversed symbol name order
    in the suggestion, e.g.:

    WARNING: vmlinux.o(.meminit.text+0x36c): Section mismatch in reference from the function free_area_init_core() to the function .init.text:setup_usemap()
    The function __meminit free_area_init_core() references
    a function __init setup_usemap().
    If free_area_init_core is only used by setup_usemap then
    annotate free_area_init_core with a matching annotation.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Sam Ravnborg

    Geert Uytterhoeven
     

14 Feb, 2008

1 commit

  • This adds some new magic in the MODPOST phase for CONFIG_MARKERS. Analogous
    to the Module.symvers file, the build will now write a Module.markers file
    when CONFIG_MARKERS=y is set. This file lists the name, defining module, and
    format string of each marker, separated by \t characters. This simple text
    file can be used by offline build procedures for instrumentation code,
    analogous to how System.map and Module.symvers can be useful to have for
    kernels other than the one you are running right now.

    The strings are made easy to extract by having the __trace_mark macro define
    the name and format together in a single array called __mstrtab_* in the
    __markers_strings section. This is straightforward and reliable as long as
    the marker structs are always defined by this macro. It is an unreasonable
    amount of hairy work to extract the string pointers from the __markers section
    structs, which entails handling a relocation type for every machine under the
    sun.

    Mathieu :
    - Ran through checkpatch.pl

    Signed-off-by: Roland McGrath
    Signed-off-by: Mathieu Desnoyers
    Cc: David Smith
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     

09 Feb, 2008

2 commits


03 Feb, 2008

2 commits


02 Feb, 2008

1 commit

  • Some crazy devices in the wild have a vendor id of 0x0000. If we try to
    add a module alias with this id, we just can't do it due to a check in
    the file2alias.c file. Change the test to verify that both the vendor
    and product ids are 0x0000 to show a real "blank" module alias.

    Note, the module-init-tools package also needs to be changed to properly
    generate the depmod tables.

    Cc: Janusz
    Cc: stable
    Cc: Jon Masters
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

29 Jan, 2008

16 commits

  • If there is a mixture of specifying sections for code in gcc
    and assembler then if the assembler code do not add
    the "ax" flags the linker will see this as two different sections
    and generate unique sections for each. ld does so by adding a dot
    and a number.
    Teach modpost to warn if a section shows up that match this
    pattern - but do this only for non-debug sections.

    It will result in warnings like this:

    WARNING: vmlinux.o (.sched.text.1): unexpected section name.
    The (.[number]+) following section name are ld generated and not expected.
    Did you forget to use "ax"/"aw" in a .S file?
    Note that for example contains
    section definitions for use in .S files.

    All warnings seen with a defconfig build for:
    x86 (32+64bit) and sparc64 has been fixed (via respective maintainers).

    arm, powerpc (64 bit), s390 (32 bit), ia64, alpha, sh4 checked - no
    warnings seen with a defconfig build.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • If the config option CONFIG_SECTION_MISMATCH is not set and
    we see a Section mismatch present the following to the user:

    modpost: Found 1 section mismatch(es).
    To see additional details select "Enable full Section mismatch analysis"
    in the Kernel Hacking menu (CONFIG_SECTION_MISMATCH).

    If the option CONFIG_SECTION_MISMATCH is selected
    then be verbose in the Section mismatch reporting from mdopost.
    Sample outputs:

    WARNING: o-x86_64/vmlinux.o(.text+0x7396): Section mismatch in reference from the function discover_ebda() to the variable .init.data:ebda_addr
    The function discover_ebda() references
    the variable __initdata ebda_addr.
    This is often because discover_ebda lacks a __initdata
    annotation or the annotation of ebda_addr is wrong.

    WARNING: o-x86_64/vmlinux.o(.data+0x74d58): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:pci_plx9050_exit()
    The variable pci_serial_quirks references
    the function __devexit pci_plx9050_exit()
    If the reference is valid then annotate the
    variable with __exit* (see linux/init.h) or name the variable:
    *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

    WARNING: o-x86_64/vmlinux.o(__ksymtab+0x630): Section mismatch in reference from the variable __ksymtab_arch_register_cpu to the function .cpuinit.text:arch_register_cpu()
    The symbol arch_register_cpu is exported and annotated __cpuinit
    Fix this by removing the __cpuinit annotation of arch_register_cpu or drop the export.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • Remove the deprecated __attribute_used__.

    [Introduce __section in a few places to silence checkpatch /sam]

    Signed-off-by: Adrian Bunk
    Signed-off-by: Sam Ravnborg

    Adrian Bunk
     
  • Refactor code so the warning report function
    does nothing else than reporting warnings.
    As a side effect some other code paths were cleaned
    up by this.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • Introducing helpers to retreive symbol and section
    names cleaned up the code a bit.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • The typical layout is now:
    WARNING: vmlinux.o(.text+0x372ec): Section mismatch: reference to .devinit.text:pci_scan_one_pbm in 'psycho_scan_bus'

    This is first step towards more readable warnings.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • Introducing separate sections for __dev* (HOTPLUG),
    __cpu* (HOTPLUG_CPU) and __mem* (MEMORY_HOTPLUG)
    allows us to do a much more reliable Section mismatch
    check in modpost. We are no longer dependent on the actual
    configuration of for example HOTPLUG.

    This has the effect that all users see much more
    Section mismatch warnings than before because they
    were almost all hidden when HOTPLUG was enabled.
    The advantage of this is that when building a piece
    of code then it is much more likely that the Section
    mismatch errors are spotted and the warnings will be
    felt less random of nature.

    Signed-off-by: Sam Ravnborg
    Cc: Greg KH
    Cc: Randy Dunlap
    Cc: Adrian Bunk

    Sam Ravnborg
     
  • Now that match() is introduced use it consistently so
    we can share the section name definitions.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • Change the logic in modpost so we identify all the
    bad combinations of sections that refer to other
    sections.
    Compared to the previous approach we are much less
    dependent on knowledge of what additional sections
    the tool chain uses and thus we can keep the false
    positives low.

    The implmentation is changed to use a table based
    lookup and we now check all combinations in first
    pass so we no longer need separate passes for init
    and exit sections.

    Tested that the same warnings are generated for
    an allyesconfig build without CONFIG_HOTPLUG.

    Signed-off-by: Sam Ravnborg
    Cc: Randy Dunlap
    Cc: Adrian Bunk

    Sam Ravnborg
     
  • Split a too long function up in smaller bits to make
    prgram logic easier to follow.
    A few related changes done due to parameter
    changes.

    No functional changes.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • The relocation record sometimes contained an address
    which was not an exactly match for a symbol.

    Implment some simple logic such that if there
    is a symbol within 20 bytes of the address contained
    in the relocation record then print the name of this
    symbol.

    With this change modpost could find symbol names
    for the remaining .init.text symbols in my
    allyesconfig build for x86_64.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • It is very convinient to say:
    scripts/mod/modpost mm/built-in.o

    to check if any section mismatch errors occured
    in mm/ (as an example).
    Fix it so this is possible again.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • akpm complained about overly long lines in modpost.c and
    when started additional style issues were fixed:

    o Updated my copyright
    o Removed unneeded {}
    o Drop assignments in if ()
    o Spaces around operators
    o Break long lines
    o locate * near variable not type
    o Fix a format specifier for sizeof()
    o Corrected placement of '{' and '}'
    o spaces to tabs (but use tabs only for indention)

    modpost.c is not checkpatch clean. Readability were favoured
    on top of checkpatch compliance.
    But checkpatch were used to find additional stuff to clean up.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • When passing an file name > 1k the stack could be overflowed.
    Not really a security issue, but still better plugged.
    Signed-off-by: Andi Kleen
    Signed-off-by: Sam Ravnborg

    Andi Kleen
     
  • Fix wrong format strings in modpost exposed by the previous patch.
    Including one missing argument -- some random data was printed instead.
    Signed-off-by: Andi Kleen
    Signed-off-by: Sam Ravnborg

    Andi Kleen
     
  • This way gcc can warn for wrong format strings
    Signed-off-by: Andi Kleen
    Signed-off-by: Sam Ravnborg

    Andi Kleen
     

23 Oct, 2007

1 commit


18 Oct, 2007

1 commit

  • When part of build an external module tree, modpost first reads in the
    kernel's and then the external tree's Module.symvers files. From these files
    it establishes a symbol => module mapping. When it later reads in each module
    built and processes the symbols it finds, it discovers the symbol=>module
    mapping from Module.symvers and leaves it as it is.

    The problem comes with a module has been re-named or a symbol has moved from
    one module to another, since the Module.symvers file was generated. modpost
    does not update the symbol=>module mapping when it finds the new location of
    the symbol when scanning the newly built modules. This results in the module
    containing incorrect dependency information and the new Module.symvers file
    written by modpost will also contain the incorrect mappings, perpetuating the
    problem to the next build, and so on.

    When building the out of kernel development tree for kernel subsystem, like
    v4l-dvb or ALSA, deleting the external Module.symvers file before building
    (which the kernel build system doesn't do and shouldn't be necessary anyway),
    won't fix the problem. modpost still reads the kernel's Module.symvers, and
    since we a building a kernel subsystem, it will define the same symbols as the
    external modules.

    Signed-off-by: Trent Piepho
    Signed-off-by: Sam Ravnborg

    Trent Piepho
     

17 Oct, 2007

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild: (40 commits)
    kbuild: introduce ccflags-y, asflags-y and ldflags-y
    kbuild: enable 'make CPPFLAGS=...' to add additional options to CPP
    kbuild: enable use of AFLAGS and CFLAGS on commandline
    kbuild: enable 'make AFLAGS=...' to add additional options to AS
    kbuild: fix AFLAGS use in h8300 and m68knommu
    kbuild: check for wrong use of CFLAGS
    kbuild: enable 'make CFLAGS=...' to add additional options to CC
    kbuild: fix up CFLAGS usage
    kbuild: make modpost detect unterminated device id lists
    kbuild: call export_report from the Makefile
    kbuild: move Kai Germaschewski to CREDITS
    kconfig/menuconfig: distinguish between selected-by-another options and comments
    kconfig: tristate choices with mixed tristate and boolean values
    include/linux/Kbuild: remove duplicate entries
    kbuild: kill backward compatibility checks
    kbuild: kill EXTRA_ARFLAGS
    kbuild: fix documentation in makefiles.txt
    kbuild: call make once for all targets when O=.. is used
    kbuild: pass -g to assembler under CONFIG_DEBUG_INFO
    kbuild: update _shipped files for kconfig syntax cleanup
    ...

    Fix up conflicts in arch/um/sys-{x86_64,i386}/Makefile manually.

    Linus Torvalds
     

14 Oct, 2007

1 commit

  • I2C devices do not have any form of ID as PCI or USB devices have.
    No driver uses "MODULE_DEVICE_TABLE(i2c, ...)" because it doesn't
    make sense. So we can get rid of struct i2c_device_id and the
    associated support code.

    Signed-off-by: Jean Delvare
    Cc: Greg KH

    Jean Delvare
     

13 Oct, 2007

3 commits

  • Cause modpost to fail if any device id lists are incorrectly terminated,
    after reporting the offender.
    Improved reporting by akpm

    Signed-off-by: Kees Cook
    Cc: Greg KH
    Cc: Alexey Dobriyan
    Cc: Jeff Garzik
    Cc: Ben Collins
    Cc: Michael Wu
    Cc: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Sam Ravnborg

    Kees Cook
     
  • Fix modpost segfault.

    Before:
    -------
    ynezz@ntbk:~/linux-2.6.git$ scripts/mod/modpost vmlinux ath_pci.o
    Segmentation fault

    After:
    ------
    ynezz@ntbk:~/linux-2.6.git$ scripts/mod/modpost vmlinux ath_pci.o
    FATAL: section header offset=815726848 in file 'ath_pci.o' is bigger then filesize=153968

    Sam: This seems to warn for a binutils issue. Anyway modpost should not
    segfault.

    Signed-off-by: Petr Stetiar
    Signed-off-by: Sam Ravnborg

    Petr Stetiar
     
  • The Elfnn_Section is not available on all platforms,
    noteworthy are cygwin.
    Use the safe replacement _Half.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg