16 Nov, 2011

1 commit

  • The current implementation of dmi_name_in_vendors() is an invitation to
    lazy coding and false positives [1]. Searching for a string in 8 know
    what you're looking for, so you should know where to look. strstr isn't
    fast, especially when it fails, so we should avoid calling it when it
    just can't succeed.

    Looking at the current users of the function, it seems clear to me that
    they are looking for a system or board vendor name, so let's limit
    dmi_name_in_vendors to these two DMI fields. This much better matches
    the function name, BTW.

    [1] We currently have code looking for short names in DMI data, such as
    "IBM", "ASUS" or "Acer". I let you guess what will happen the day other
    vendors ship products named, for example, "SCHREIBMEISTER", "PEGASUS" or
    "Acerola".

    Signed-off-by: Jean Delvare
    Cc: Andi Kleen
    Cc: Jesse Barnes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean Delvare
     

15 Feb, 2011

1 commit

  • The "Type 2" SMBIOS record that contains Board Name is not
    strictly required and may be absent in the SMBIOS on some
    platforms.

    ( Please note that Type 2 is not listed in Table 3 in Sec 6.2
    ("Required Structures and Data") of the SMBIOS v2.7
    Specification. )

    Use the Manufacturer Name (aka System Vendor) name.
    Print Board Name only when it is present.

    Before the fix:
    (i) dmesg output: DMI: /ProLiant DL380 G6, BIOS P62 01/29/2011
    (ii) oops output: Pid: 2170, comm: bash Not tainted 2.6.38-rc4+ #3 /ProLiant DL380 G6

    After the fix:
    (i) dmesg output: DMI: HP ProLiant DL380 G6, BIOS P62 01/29/2011
    (ii) oops output: Pid: 2278, comm: bash Not tainted 2.6.38-rc4+ #4 HP ProLiant DL380 G6

    Signed-off-by: Naga Chumbalkar
    Reviewed-by: Bjorn Helgaas
    Cc: # .3x - good for debugging, please apply as far back as it applies cleanly
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Naga Chumbalkar
     

28 Oct, 2010

1 commit

  • Put basic system information in the dmesg log. There are lots of dmesg
    logs on the web, and it would be useful if they contained this information
    for debugging platform problems. "BOARD/PRODUCT" format copied from
    show_regs_common(), which is used in the oops path.

    Signed-off-by: Bjorn Helgaas
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bjorn Helgaas
     

31 Jul, 2010

1 commit

  • This patch exports SMBIOS provided firmware instance and label of
    onboard PCI devices to sysfs. New files are:
    /sys/bus/pci/devices/.../label which contains the firmware name for
    the device in question, and
    /sys/bus/pci/devices/.../index which contains the firmware device type
    instance for the given device.

    Signed-off-by: Jordan Hargrave
    Signed-off-by: Narendra K
    Signed-off-by: Jesse Barnes

    Narendra K
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

16 Dec, 2009

1 commit


05 Dec, 2009

1 commit

  • The purpose of dmi->ident is twofold - it may be used by DMI callback
    functions when composing log messages; it is also used to determine
    end of DMI table in dmi_check_system() and dmi_first_match(). However,
    in case when callbacks are not interested in using ident at all it just
    wastes memory. Let's make entries with empty first match slot serve as
    end-of-table markers instead.

    Acked-by: Jean Delvare
    Signed-off-by: Dmitry Torokhov

    Dmitry Torokhov
     

09 Sep, 2009

2 commits

  • There are cases where full date information is required instead of
    just the year. Add month and day parsing to dmi_get_year() and rename
    it to dmi_get_date().

    As the original function only required '/' followed by any number of
    parseable characters at the end of the string, keep that behavior to
    avoid upsetting existing users.

    The new function takes dates of format [mm[/dd]]/yy[yy]. Year, month
    and date are checked to be in the ranges of [1-9999], [1-12] and
    [1-31] respectively and any invalid or out-of-range component is
    returned as zero.

    The dummy implementation is updated accordingly but the return value
    is updated to indicate field not found which is consistent with how
    other dummy functions behave.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Year parsing in dmi_get_year() had the following two bugs.

    * "00" is treated as invalid instead of 2000 because zero return from
    simple_strtoul() is treated as error.

    * "0N" where N >= 8 is treated as invalid of 200N because the leading
    0 is considered to specify octal.

    Fix the above two bugs by using endptr to detect invalid number and
    forcing decimal.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

10 Jun, 2009

1 commit

  • Community reported one SB600 SATA issue(BZ #9412), which led to 64 bit
    DMA disablement for all SB600 revisions by driver maintainers with
    commits c7a42156d99bcea7f8173ba7a6034bbaa2ecb77c and
    4cde32fc4b32e96a99063af3183acdfd54c563f0.

    But the root cause is ASUS M2A-VM system BIOS bug in old revisions
    like 0901, while forcing into 32bit DMA happens to work as workaround.
    Now it's time to withdraw 4cde32fc4b32e96a99063af3183acdfd54c563f0
    so as to restore the SB600 SATA 64bit DMA capability.
    This patch is also adding the workaround for M2A-VM old BIOS revisions,
    but users are suggested to upgrade their system BIOS to the latest one
    if they meet this issue.

    Signed-off-by: Shane Huang
    Cc: Tejun Heo
    Signed-off-by: Jeff Garzik

    Shane Huang
     

31 Mar, 2009

1 commit


27 Jan, 2009

1 commit

  • Some notebooks from HP have the problem that their BIOSes attempt to
    spin down hard drives before entering ACPI system states S4 and S5.
    This leads to a yo-yo effect during system power-off shutdown and the
    last phase of hibernation when the disk is first spun down by the
    kernel and then almost immediately turned on and off by the BIOS.
    This, in turn, may result in shortening the disk's life times.

    To prevent this from happening we can blacklist the affected systems
    using DMI information. However, only the on-board controlles should
    be blacklisted and their PCI slot numbers can be used for this
    purpose. Unfortunately the existing interface for checking DMI
    information of the system is not very convenient for this purpose,
    because to use it, we would have to define special callback functions
    or create a separate struct dmi_system_id table for each blacklisted
    system.

    To overcome this difficulty introduce a new function
    dmi_first_match() returning a pointer to the first entry in an array
    of struct dmi_system_id elements that matches the system DMI
    information. Then, we can use this pointer to access the entry's
    .driver_data field containing the additional information, such as
    the PCI slot number, allowing us to do the desired blacklisting.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Jeff Garzik

    Rafael J. Wysocki
     

07 Jan, 2009

1 commit

  • Add missing kernel-doc notation:

    drivers/firmware/dmi_scan.c:475: No description found for parameter 'str'
    drivers/firmware/dmi_scan.c:592: No description found for parameter 'f'
    drivers/firmware/dmi_scan.c:592: No description found for parameter 'str'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

29 Dec, 2008

1 commit

  • Add a wrapper for testing system_info which will handle also NULL
    system infos.

    This will be used by the ata PIIX driver.

    Signed-off-by: Jiri Slaby
    Cc: Alexandru Romanescu
    Cc: Tejun Heo
    Cc: Alan Cox
    Signed-off-by: Jeff Garzik

    Jiri Slaby
     

23 Dec, 2008

1 commit

  • …86/debug', 'x86/defconfig', 'x86/detect-hyper', 'x86/doc', 'x86/dumpstack', 'x86/early-printk', 'x86/fpu', 'x86/idle', 'x86/io', 'x86/memory-corruption-check', 'x86/microcode', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/pat2', 'x86/pci-ioapic-boot-irq-quirks', 'x86/ptrace', 'x86/quirks', 'x86/reboot', 'x86/setup-memory', 'x86/signal', 'x86/sparse-fixes', 'x86/time', 'x86/uv' and 'x86/xen' into x86/core

    Ingo Molnar
     

08 Nov, 2008

1 commit


05 Nov, 2008

1 commit

  • Impact: Should permit VMware detection on older platforms where the
    vendor is changed. Could theoretically cause a regression if some
    weird serial number scheme contains the string "VMware" by pure
    chance. Seems unlikely, especially with the mixed case.

    In some user configured cases, VMware may choose not to put a VMware specific
    DMI string, but the product serial key is always there and is VMware specific.
    Add a interface to check the serial key, when checking for VMware in the DMI
    information.

    Signed-off-by: Alok N Kataria
    Signed-off-by: H. Peter Anvin

    Alok Kataria
     

18 Sep, 2008

1 commit

  • It happened to me recently that i added a dmi_check_system() quirk
    in a too early codepath, and it was silently ignored because all the
    DMI tables and strings were still empty.

    As this situation is clearly a programming error / kernel bug,
    warn when it happens, instead of silently ignoring quirks.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

25 May, 2008

1 commit


05 Apr, 2008

1 commit

  • In 2.6.14 a patch was merged which switching the order of the ipmi device
    naming from in-order-of-discovery over to reverse-order-of-discovery.

    So on systems with multiple BMC interfaces, the ipmi device names are being
    created in reverse order relative to how they are discovered on the system
    (e.g. on an IBM x3950 multinode server with N nodes, the device name for the
    BMC in the first node is /dev/ipmiN-1 and the device name for the BMC in the
    last node is /dev/ipmi0, etc.).

    The problem is caused by the list handling routines chosen in dmi_scan.c.
    Using list_add() causes the multiple ipmi devices to be added to the device
    list using a stack-paradigm and so the ipmi driver subsequently pulls them off
    during initialization in LIFO order. This patch changes the
    dmi_save_ipmi_device() list handling paradigm to a queue, thereby allowing the
    ipmi driver to build the ipmi device names in the order in which they are
    found on the system.

    Signed-off-by: Carol Hebert
    Signed-off-by: Corey Minyard
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Carol Hebert
     

24 Feb, 2008

2 commits

  • Adding the same item to a given linked list more than once is guaranteed
    to break and corrupt the list. This is however what we do in dmi_scan
    since commit 79da4721117fcf188b4b007b775738a530f574da ("x86: fix DMI out
    of memory problems").

    Given that there is absolutely no interest in saving empty OEM strings
    anyway, I propose the simple and efficient fix below: we discard the empty
    OEM strings altogether.

    Signed-off-by: Jean Delvare
    Acked-by: Parag Warudkar
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Matt Domsch
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean Delvare
     
  • Now that we gather on-board devices from both DMI types 10 and 41, there is
    a possibility that we list the same device twice. In order to not confuse
    drivers, and also to save memory, make sure that we do not add duplicate
    devices to the dmi_devices list.

    Signed-off-by: Jean Delvare
    Cc: Wim Van Sebroeck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean Delvare
     

09 Feb, 2008

1 commit

  • From version 2.6 of the SMBIOS standard, type 10 (On Board Devices
    Information) becomes obsolete. The reason for this is that no further
    fields can be added to this structure without adversely affecting existing
    software's ability to properly parse the data.

    Therefore type 41 (Onboard Devices Extended Information) was added.
    The structure is as follows:

    struct smbios_type_41 {
    u8 type;
    u8 length;
    u16 handle;
    u8 reference_designation_string;
    u8 device_type; /* same device type as in type 10 */
    u8 device_type_instance;
    u16 segment_group_number;
    u8 bus_number;
    u8 device_function_number;
    };

    For more info: http://www.dmtf.org/standards/smbios

    Signed-off-by: Wim Van Sebroeck
    Cc: Jean Delvare
    Cc: Len Brown
    Cc: Jeff Garzik
    Cc: Tejun Heo
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wim Van Sebroeck
     

08 Feb, 2008

1 commit


04 Feb, 2008

1 commit


30 Jan, 2008

3 commits

  • Signed-off-by: Yinghai Lu
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Yinghai Lu
     
  • Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Ingo Molnar
     
  • People with HP Desktops (including me) encounter couple of DMI errors
    during boot - dmi_save_oem_strings_devices: out of memory and
    dmi_string: out of memory.

    On some HP desktops the DMI data include OEM strings (type 11) out of
    which only few are meaningful and most other are empty. DMI code
    religiously creates copies of these 27 strings (65 bytes each in my
    case) and goes OOM in dmi_string().

    If DMI_MAX_DATA is bumped up a little then it goes and fails in
    dmi_save_oem_strings while allocating dmi_devices of sizeof(struct
    dmi_device) corresponding to these strings.

    On x86_64 since we cannot use alloc_bootmem this early, the code uses a
    static array of 2048 bytes (DMI_MAX_DATA) for allocating the memory DMI
    needs. It does not survive the creation of empty strings and devices.

    Fix this by detecting and not newly allocating empty strings and instead
    using a one statically defined dmi_empty_string.

    Also do not create a new struct dmi_device for each empty string - use
    one statically define dmi_device with .name=dmi_empty_string and add
    that to the dmi_devices list.

    On x64 this should stop the OOM with same current size of DMI_MAX_DATA
    and on x86 this should save a good amount of (27*65 bytes +
    27*sizeof(struct dmi_device) bootmem.

    Compile and boot tested on both 32-bit and 64-bit x86.

    Signed-off-by: Parag Warudkar
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Parag Warudkar
     

24 Jan, 2008

1 commit


10 Oct, 2007

1 commit

  • Three main sets of changes:

    1) dmi_get_system_info() return value should have been marked const,
    since callers should not be changing that data.

    2) const-ify DMI internals, since DMI firmware tables should,
    whenever possible, be marked const to ensure we never ever write to
    that data area.

    3) const-ify DMI API, to enable marking tables const where possible
    in low-level drivers.

    And if we're really lucky, this might enable some additional
    optimizations on the part of the compiler.

    The bulk of the changes are #2 and #3, which are interrelated. #1 could
    have been a separate patch, but it was so small compared to the others,
    it was easier to roll it into this changeset.

    Signed-off-by: Jeff Garzik

    Jeff Garzik
     

12 Jul, 2007

1 commit

  • The patch below adds DMI/SMBIOS based module autoloading to the Linux
    kernel. The idea is to load laptop drivers automatically (and other
    drivers which cannot be autoloaded otherwise), based on the DMI system
    identification information of the BIOS.

    Right now most distros manually try to load all available laptop
    drivers on bootup in the hope that at least one of them loads
    successfully. This patch does away with all that, and uses udev to
    automatically load matching drivers on the right machines.

    Basically the patch just exports the DMI information that has been
    parsed by the kernel anyway to userspace via a sysfs device
    /sys/class/dmi/id and makes sure that proper modalias attributes are
    available. Besides adding the "modalias" attribute it also adds
    attributes for a few other DMI fields which might be useful for
    writing udev rules.

    This patch is not an attempt to export the entire DMI/SMBIOS data to
    userspace. We already have "dmidecode" which parses the complete DMI
    info from userspace. The purpose of this patch is machine model
    identification and good udev integration.

    To take advantage of DMI based module autoloading, a driver should
    export one or more MODULE_ALIAS fields similar to these:

    MODULE_ALIAS("dmi:*:svnMICRO-STARINT'LCO.,LTD:pnMS-1013:pvr0131*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");
    MODULE_ALIAS("dmi:*:svnMicro-StarInternational:pnMS-1058:pvr0581:rvnMSI:rnMS-1058:*:ct10:*");
    MODULE_ALIAS("dmi:*:svnMicro-StarInternational:pnMS-1412:*:rvnMSI:rnMS-1412:*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");
    MODULE_ALIAS("dmi:*:svnNOTEBOOK:pnSAM2000:pvr0131*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");

    These lines are specific to my msi-laptop.c driver. They are basically
    just a concatenation of a few carefully selected DMI fields with all
    potentially bad characters stripped.

    Besides laptop drivers, modules like "hdaps", the i2c modules
    and the hwmon modules are good candidates for "dmi:" MODULE_ALIAS
    lines.

    Besides merely exporting the DMI data via sysfs the patch adds
    support for a few more DMI fields. Especially the CHASSIS fields are
    very useful to identify different laptop modules. The patch also adds
    working MODULE_ALIAS lines to my msi-laptop.c driver.

    I'd like to thank Kay Sievers for helping me to clean up this patch
    for posting it on lkml.

    Patch is against Linus' current GIT HEAD. Should probably apply to
    older kernels as well without modification.

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

    Lennart Poettering
     

22 Oct, 2006

1 commit


30 Sep, 2006

1 commit

  • This teaches dmi_decode() how to decode and save OEM Strings (type 11) DMI
    information, which is currently discarded silently. Existing code using
    DMI is not affected. Follows the "System Management BIOS (SMBIOS)
    Specification" (http://www.dmtf.org/standards/smbios), and also the
    userspace dmidecode.c code.

    OEM Strings are the only safe way to identify some hardware, e.g., the
    ThinkPad embedded controller used by the soon-to-be-submitted tp_smapi
    driver. This will also let us eliminate the long whitelist in the mainline
    hdaps driver (in a future patch).

    Signed-off-by: Shem Multinymous
    Cc: Bjorn Helgaas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shem Multinymous
     

26 Jun, 2006

1 commit


15 Apr, 2006

1 commit

  • dmi_scan.c is arch-independent and is used by i386, x86_64, and ia64.
    Currently all three arches compile it from arch/i386, which means that ia64
    and x86_64 depend on things in arch/i386 that they wouldn't otherwise care
    about.

    This is simply "mv arch/i386/kernel/dmi_scan.c drivers/firmware/" (removing
    trailing whitespace) and the associated Makefile changes. All three
    architectures already set CONFIG_DMI in their top-level Kconfig files.

    Signed-off-by: Bjorn Helgaas
    Cc: Andi Kleen
    Cc: "Luck, Tony"
    Cc: Andrey Panin
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Bjorn Helgaas