22 Apr, 2016

1 commit

  • Since we are removing paravirt_enabled() replace it with a
    logical equivalent. Even though PNPBIOS is x86 specific we
    add an arch-specific type call, which can be implemented by
    any architecture to show how other legacy attribute devices
    can later be also checked for with other ACPI legacy attribute
    flags.

    This implicates the first ACPI 5.2.9.3 IA-PC Boot Architecture
    ACPI_FADT_LEGACY_DEVICES flag device, and shows how to add more.

    The reason pnpbios gets a defined structure and as such uses
    a different approach than the RTC legacy quirk is that ACPI
    has a respective RTC flag, while pnpbios does not. We fold
    the pnpbios quirk under ACPI_FADT_LEGACY_DEVICES ACPI flag
    use case, and use a struct of possible devices to enable
    future extensions of this.

    As per 0-day, this bumps the vmlinux size using i386-tinyconfig as
    follows:

    TOTAL TEXT init.text x86_early_init_platform_quirks()
    +32 +28 +28 +28

    That's 4 byte overhead total, the rest is cleared out on init
    as its all __init text.

    v2: split out subarch handlng on switch to make it easier
    later to add other subarchs. The 'fall-through' switch
    handling can be confusing and we'll remove it later
    when we add handling for X86_SUBARCH_CE4100.
    v3: document vmlinux size impact as per 0-day, and also
    explain why pnpbios is treated differently than the
    RTC legacy feature.

    Signed-off-by: Luis R. Rodriguez
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: Greg Kroah-Hartman
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: andrew.cooper3@citrix.com
    Cc: andriy.shevchenko@linux.intel.com
    Cc: bigeasy@linutronix.de
    Cc: boris.ostrovsky@oracle.com
    Cc: david.vrabel@citrix.com
    Cc: ffainelli@freebox.fr
    Cc: george.dunlap@citrix.com
    Cc: glin@suse.com
    Cc: jgross@suse.com
    Cc: jlee@suse.com
    Cc: josh@joshtriplett.org
    Cc: julien.grall@linaro.org
    Cc: konrad.wilk@oracle.com
    Cc: kozerkov@parallels.com
    Cc: lenb@kernel.org
    Cc: lguest@lists.ozlabs.org
    Cc: linux-acpi@vger.kernel.org
    Cc: lv.zheng@intel.com
    Cc: matt@codeblueprint.co.uk
    Cc: mbizon@freebox.fr
    Cc: rjw@rjwysocki.net
    Cc: robert.moore@intel.com
    Cc: rusty@rustcorp.com.au
    Cc: tiwai@suse.de
    Cc: toshi.kani@hp.com
    Cc: xen-devel@lists.xensource.com
    Link: http://lkml.kernel.org/r/1460592286-300-12-git-send-email-mcgrof@kernel.org
    Signed-off-by: Ingo Molnar

    Luis R. Rodriguez
     

19 Mar, 2015

1 commit

  • This patch introduces the module_pnp_driver macro which is a
    convenience macro for PNP driver modules similar to module_pci_driver.
    It is intended to be used by drivers which init/exit section does nothing
    but register/unregister the PNP driver. By using this macro it is
    possible to eliminate a few lines of boilerplate code per PNP driver.

    Based on work done by Lars-Peter Clausen for other
    busses (i2c and spi) and Greg KH for PCI.

    Signed-off-by: Peter Huewe
    Signed-off-by: Rafael J. Wysocki

    Peter Huewe
     

03 Feb, 2015

1 commit

  • If the serial console is an ACPI PNP device, the PNP bus always powers
    down the device at system suspend, even though the no_console_suspend
    command line parameter is specified (eg., when debugging suspend/resume).

    Add PNP_CONSOLE capability, which when set, prevents calling both the
    ->disable() and ->suspend() PNP protocol methods if console suspend
    is disabled.

    Signed-off-by: Peter Hurley
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     

10 Jun, 2011

1 commit


19 Jul, 2010

1 commit

  • This patch (as1354) adds remote-wakeup support to the pnpacpi driver.
    The new can_wakeup method also allows other PNP protocol drivers
    (pnpbios or iaspnp) to add wakeup support, but I don't know enough
    about how they work to actually do it.

    Signed-off-by: Alan Stern
    Reviewed-by: Bjorn Helgaas
    Signed-off-by: Rafael J. Wysocki

    Alan Stern
     

16 Dec, 2009

1 commit

  • Add pnp_acpi_device(pnp_dev), which takes a PNP device and returns the
    associated ACPI device (or NULL, if the device is not a PNPACPI device).

    This allows us to write a PNP driver that can manage both traditional
    PNPBIOS and ACPI devices, treating ACPI-only functionality as an optional
    extension.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Bjorn Helgaas
     

22 Sep, 2009

1 commit


05 Jun, 2009

1 commit


23 Oct, 2008

1 commit


17 Oct, 2008

1 commit

  • PnP encodes the resource type directly as its struct resource->flags value
    which is an unsigned long. Make it so...

    Signed-off-by: Rene Herman
    Cc: "H. Peter Anvin"
    Acked-by: Bjorn Helgaas
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rene Herman
     

11 Oct, 2008

1 commit

  • There are only a few remaining uses of pnp_info(), so I just
    converted them to printk and removed the pnp_err(), pnp_info(),
    pnp_warn(), and pnp_dbg() wrappers.

    I also removed a couple debug messages that don't seem useful any
    more ("driver registered", "driver unregistered", "driver attached").

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Andi Kleen
    Signed-off-by: Len Brown

    Bjorn Helgaas
     

17 Sep, 2008

1 commit

  • This fill fix the following regression list entry:

    Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=11276
    Subject : build error: CONFIG_OPTIMIZE_INLINING=y causes gcc 4.2 to do stupid things
    Submitter : Randy Dunlap
    Date : 2008-08-06 17:18 (38 days old)
    References : http://marc.info/?l=linux-kernel&m=121804329014332&w=4
    http://lkml.org/lkml/2008/7/22/353
    Handled-By : Bjorn Helgaas
    Patch : http://lkml.org/lkml/2008/7/22/364

    with what I believe is a better fix than the one referenced
    in the regression entry above.

    These PNP header interfaces try to work in such a way that
    you can reference some of them even if PNP is not enabled,
    and the compiler was expected to optimize everything away.

    Which is mostly fine, except that there was one interface
    for which there was not provided an inline "NOP" implementation.

    Once we add that, all of these compile failures cannot handle
    any more.

    pnp: Provide NOP inline implementation of pnp_get_resource() when !PNP

    Fixes kernel bugzilla #11276.

    Signed-off-by: David S. Miller
    Signed-off-by: Linus Torvalds

    David Miller
     

17 Jul, 2008

6 commits

  • ISAPNP, PNPBIOS, and ACPI describe the "possible resource settings" of
    a device, i.e., the possibilities an OS bus driver has when it assigns
    I/O port, MMIO, and other resources to the device.

    PNP used to maintain this "possible resource setting" information in
    one independent option structure and a list of dependent option
    structures for each device. Each of these option structures had lists
    of I/O, memory, IRQ, and DMA resources, for example:

    dev
    independent options
    ind-io0 -> ind-io1 ...
    ind-mem0 -> ind-mem1 ...
    ...
    dependent option set 0
    dep0-io0 -> dep0-io1 ...
    dep0-mem0 -> dep0-mem1 ...
    ...
    dependent option set 1
    dep1-io0 -> dep1-io1 ...
    dep1-mem0 -> dep1-mem1 ...
    ...
    ...

    This data structure was designed for ISAPNP, where the OS configures
    device resource settings by writing directly to configuration
    registers. The OS can write the registers in arbitrary order much
    like it writes PCI BARs.

    However, for PNPBIOS and ACPI devices, the OS uses firmware interfaces
    that perform device configuration, and it is important to pass the
    desired settings to those interfaces in the correct order. The OS
    learns the correct order by using firmware interfaces that return the
    "current resource settings" and "possible resource settings," but the
    option structures above doesn't store the ordering information.

    This patch replaces the independent and dependent lists with a single
    list of options. For example, a device might have possible resource
    settings like this:

    dev
    options
    ind-io0 -> dep0-io0 -> dep1->io0 -> ind-io1 ...

    All the possible settings are in the same list, in the order they
    come from the firmware "possible resource settings" list. Each entry
    is tagged with an independent/dependent flag. Dependent entries also
    have a "set number" and an optional priority value. All dependent
    entries must be assigned from the same set. For example, the OS can
    use all the entries from dependent set 0, or all the entries from
    dependent set 1, but it cannot mix entries from set 0 with entries
    from set 1.

    Prior to this patch PNP didn't keep track of the order of this list,
    and it assigned all independent options first, then all dependent
    ones. Using the example above, that resulted in a "desired
    configuration" list like this:

    ind->io0 -> ind->io1 -> depN-io0 ...

    instead of the list the firmware expects, which looks like this:

    ind->io0 -> depN-io0 -> ind-io1 ...

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Andi Kleen
    Acked-by: Rene Herman
    Signed-off-by: Len Brown

    Bjorn Helgaas
     
  • Nothing outside the PNP subsystem should need access to a
    device's resource options, so this patch moves the option
    structure declarations to a private header file.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Andi Kleen
    Acked-by: Rene Herman
    Signed-off-by: Len Brown

    Bjorn Helgaas
     
  • PNP previously defined PNP_PORT_FLAG_16BITADDR and PNP_PORT_FLAG_FIXED
    in a private header file, but put those flags in struct resource.flags
    fields. Better to make them IORESOURCE_IO_* flags like the existing
    IRQ, DMA, and MEM flags.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Andi Kleen
    Acked-by: Rene Herman
    Signed-off-by: Len Brown

    Bjorn Helgaas
     
  • As part of a heuristic to identify modem devices, 8250_pnp.c
    checks to see whether a device can be configured at any of the
    legacy COM port addresses.

    This patch moves the code that traverses the PNP "possible resource
    options" from 8250_pnp.c to the PNP subsystem. This encapsulation
    is important because a future patch will change the implementation
    of those resource options.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Andi Kleen
    Acked-by: Rene Herman
    Signed-off-by: Len Brown

    Bjorn Helgaas
     
  • PNP used to have a fixed-size pnp_resource_table for tracking the
    resources used by a device. This table often overflowed, so we've
    had to increase the table size, which wastes memory because most
    devices have very few resources.

    This patch replaces the table with a linked list of resources where
    the entries are allocated on demand.

    This removes messages like these:

    pnpacpi: exceeded the max number of IO resources
    00:01: too many I/O port resources

    References:

    http://bugzilla.kernel.org/show_bug.cgi?id=9535
    http://bugzilla.kernel.org/show_bug.cgi?id=9740
    http://lkml.org/lkml/2007/11/30/110

    This patch also changes the way PNP uses the IORESOURCE_UNSET,
    IORESOURCE_AUTO, and IORESOURCE_DISABLED flags.

    Prior to this patch, the pnp_resource_table entries used the flags
    like this:

    IORESOURCE_UNSET
    This table entry is unused and available for use. When this flag
    is set, we shouldn't look at anything else in the resource structure.
    This flag is set when a resource table entry is initialized.

    IORESOURCE_AUTO
    This resource was assigned automatically by pnp_assign_{io,mem,etc}().

    This flag is set when a resource table entry is initialized and
    cleared whenever we discover a resource setting by reading an ISAPNP
    config register, parsing a PNPBIOS resource data stream, parsing an
    ACPI _CRS list, or interpreting a sysfs "set" command.

    Resources marked IORESOURCE_AUTO are reinitialized and marked as
    IORESOURCE_UNSET by pnp_clean_resource_table() in these cases:

    - before we attempt to assign resources automatically,
    - if we fail to assign resources automatically,
    - after disabling a device

    IORESOURCE_DISABLED
    Set by pnp_assign_{io,mem,etc}() when automatic assignment fails.
    Also set by PNPBIOS and PNPACPI for:

    - invalid IRQs or GSI registration failures
    - invalid DMA channels
    - I/O ports above 0x10000
    - mem ranges with negative length

    After this patch, there is no pnp_resource_table, and the resource list
    entries use the flags like this:

    IORESOURCE_UNSET
    This flag is no longer used in PNP. Instead of keeping
    IORESOURCE_UNSET entries in the resource list, we remove
    entries from the list and free them.

    IORESOURCE_AUTO
    No change in meaning: it still means the resource was assigned
    automatically by pnp_assign_{port,mem,etc}(), but these functions
    now set the bit explicitly.

    We still "clean" a device's resource list in the same places,
    but rather than reinitializing IORESOURCE_AUTO entries, we
    just remove them from the list.

    Note that IORESOURCE_AUTO entries are always at the end of the
    list, so removing them doesn't reorder other list entries.
    This is because non-IORESOURCE_AUTO entries are added by the
    ISAPNP, PNPBIOS, or PNPACPI "get resources" methods and by the
    sysfs "set" command. In each of these cases, we completely free
    the resource list first.

    IORESOURCE_DISABLED
    In addition to the cases where we used to set this flag, ISAPNP now
    adds an IORESOURCE_DISABLED resource when it reads a configuration
    register with a "disabled" value.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Len Brown
    Signed-off-by: Andi Kleen

    Bjorn Helgaas
     
  • Some callers use pnp_port_start() and similar functions without
    making sure the resource is valid. This patch makes us fall
    back to returning the initial values if the resource is not
    valid or not even present.

    This mostly preserves the previous behavior, where we would just
    return the initial values set by pnp_init_resource_table(). The
    original 2.6.25 code didn't range-check the "bar", so it would
    return garbage if the bar exceeded the table size. This code
    returns sensible values instead.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Len Brown
    Signed-off-by: Andi Kleen

    Bjorn Helgaas
     

01 May, 2008

1 commit

  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (179 commits)
    ACPI: Fix acpi_processor_idle and idle= boot parameters interaction
    acpi: fix section mismatch warning in pnpacpi
    intel_menlo: fix build warning
    ACPI: Cleanup: Remove unneeded, multiple local dummy variables
    ACPI: video - fix permissions on some proc entries
    ACPI: video - properly handle errors when registering proc elements
    ACPI: video - do not store invalid entries in attached_array list
    ACPI: re-name acpi_pm_ops to acpi_suspend_ops
    ACER_WMI/ASUS_LAPTOP: fix build bug
    thinkpad_acpi: fix possible NULL pointer dereference if kstrdup failed
    ACPI: check a return value correctly in acpi_power_get_context()
    #if 0 acpi/bay.c:eject_removable_drive()
    eeepc-laptop: add hwmon fan control
    eeepc-laptop: add backlight
    eeepc-laptop: add base driver
    ACPI: thinkpad-acpi: bump up version to 0.20
    ACPI: thinkpad-acpi: fix selects in Kconfig
    ACPI: thinkpad-acpi: use a private workqueue
    ACPI: thinkpad-acpi: fluff really minor fix
    ACPI: thinkpad-acpi: use uppercase for "LED" on user documentation
    ...

    Fixed conflicts in drivers/acpi/video.c and drivers/misc/intel_menlow.c
    manually.

    Linus Torvalds
     

30 Apr, 2008

1 commit


29 Apr, 2008

11 commits


11 Apr, 2008

1 commit

  • Increase the PNP "number of devices" limit. We currently use an unsigned
    char, which limits us to 256 devices per protocol. This patch changes that to
    an unsigned int.

    Not all backends can take advantage of this: we limit ISAPNP to 10 devices in
    isapnp_cfg_begin(), and PNPBIOS is limited to 256 devices because the BIOS
    interfaces use a one-byte device node number.

    But there is no limit on the number of PNPACPI devices we may have. Large HP
    Integrity machines have more than 256, which causes the current "unsigned char
    number" to wrap around. This causes errors like this:

    pnp: PnP ACPI init
    kobject_add failed for 00:00 with -EEXIST, don't try to register things with the same name in the same directory.

    Call Trace:
    [] show_stack+0x40/0xa0
    [] dump_stack+0x30/0x60
    [] kobject_add+0x290/0x2c0
    [] device_add+0x160/0x860
    [] device_register+0x30/0x60
    [] __pnp_add_device+0x130/0x180
    [] pnp_add_device+0xb0/0xe0
    [] pnpacpi_add_device+0x510/0x5a0
    [] pnpacpi_add_device_handler+0x50/0x80

    This patch increases the limit to fix this PNPACPI problem. It should not
    have any adverse effect on ISAPNP or PNPBIOS because their limits are still
    enforced in the backends.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bjorn Helgaas
     

23 Mar, 2008

1 commit

  • Increase the number of PnP memory resources from 12 to 24.

    This removes an "exceeded the max num of mem resources" warning on boot. I
    also noticed the reservation of two more iomem ranges on the computer on
    which this was tested.

    Signed-off-by: Darren Salt
    Signed-off-by: Ingo Molnar
    Acked-by: Bjorn Helgaas
    Signed-off-by: Linus Torvalds

    Darren Salt
     

07 Feb, 2008

1 commit

  • Changed the isapnp semaphore to a mutex.

    [akpm@linux-foundation.org: no externs-in-c]
    [akpm@linux-foundation.org: build fix]
    Signed-off-by: Daniel Walker
    Cc: Bjorn Helgaas
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Walker
     

03 Feb, 2008

1 commit


28 Dec, 2007

1 commit

  • a7839e960675b549f06209d18283d5cee2ce9261
    (PNP: increase the maximum number of resources)
    increased PNP_MAX_PORT to 24 from 8.
    It also added a test and a complaint when a
    machine exceeded the limit, causing:

    pnpacpi: exceeded the max number of IO resources: 24

    http://bugzilla.kernel.org/show_bug.cgi?id=9535

    We should have been squawking about this all along,
    as this is a potentially serious issue.

    For now, simply burn some dynamic bytes and
    increase the limit by another 16 to 40.
    There is no guarantee that this will satisfy
    every system on Earth. It probably will not,
    but it should be an improvement.

    In the future, PNPACPI should allocate resource
    structures as needed, rather than max-sized arrays.

    Signed-off-by: Len Brown

    Len Brown
     

30 Nov, 2007

1 commit

  • On some systems the number of resources(IO,MEM) returnedy by PNP device is
    greater than the PNP constant, for example motherboard devices. It brings
    that some resources can't be reserved and resource confilicts. This will
    cause PCI resources are assigned wrongly in some systems, and cause hang.
    This is a regression since we deleted ACPI motherboard driver and use PNP
    system driver.

    [akpm@linux-foundation.org: fix text and coding-style a bit]
    Signed-off-by: Li Shaohua
    Signed-off-by: Zhao Yakui
    Cc: Bjorn Helgaas
    Cc: Thomas Renninger
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zhao Yakui
     

17 Oct, 2007

1 commit

  • Remove some null pointer checks. Null pointers in these areas indicate
    programming errors, and I think it's better to oops immediately rather than
    return an error that is easily ignored.

    Signed-off-by: Bjorn Helgaas
    Cc: Adam Belay
    Cc: Len Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bjorn Helgaas
     

27 Jul, 2007

2 commits

  • These are manual fixups after running Lindent. No functional change.

    Signed-off-by: Bjorn Helgaas
    Cc: Len Brown
    Cc: Adam Belay
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bjorn Helgaas
     
  • Run Lindent on all PNP source files.

    Produced by:

    $ quilt new pnp-lindent
    $ find drivers/pnp -name \*.[ch] | xargs quilt add
    $ quilt add include/linux/{pnp.h,pnpbios.h}
    $ scripts/Lindent drivers/pnp/*.c drivers/pnp/*/*.c include/linux/pnp*.h
    $ quilt refresh --sort

    Signed-off-by: Bjorn Helgaas
    Cc: Len Brown
    Cc: Adam Belay
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bjorn Helgaas