19 Mar, 2015

1 commit


17 Oct, 2013

1 commit


15 Nov, 2012

1 commit


23 Mar, 2011

1 commit

  • IORESOURCE_DMA cannot be assigned without utilizing the interface
    provided by CONFIG_ISA_DMA_API, specifically request_dma() and
    free_dma(). Thus, there's a strict dependency on the config option and
    limits IORESOURCE_DMA only to architectures that support ISA-style DMA.

    ia64 is not one of those architectures, so pnp_check_dma() no longer
    needs to be special-cased for that architecture.

    pnp_assign_resources() will now return -EINVAL if IORESOURCE_DMA is
    attempted on such a kernel.

    Signed-off-by: David Rientjes
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Thomas Gleixner
    Cc: Bjorn Helgaas
    Cc: Russell King
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     

02 Oct, 2010

1 commit


15 Mar, 2010

1 commit


23 Oct, 2008

1 commit


17 Oct, 2008

3 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (46 commits)
    UIO: Fix mapping of logical and virtual memory
    UIO: add automata sercos3 pci card support
    UIO: Change driver name of uio_pdrv
    UIO: Add alignment warnings for uio-mem
    Driver core: add bus_sort_breadthfirst() function
    NET: convert the phy_device file to use bus_find_device_by_name
    kobject: Cleanup kobject_rename and !CONFIG_SYSFS
    kobject: Fix kobject_rename and !CONFIG_SYSFS
    sysfs: Make dir and name args to sysfs_notify() const
    platform: add new device registration helper
    sysfs: use ilookup5() instead of ilookup5_nowait()
    PNP: create device attributes via default device attributes
    Driver core: make bus_find_device_by_name() more robust
    usb: turn dev_warn+WARN_ON combos into dev_WARN
    debug: use dev_WARN() rather than WARN_ON() in device_pm_add()
    debug: Introduce a dev_WARN() function
    sysfs: fix deadlock
    device model: Do a quickcheck for driver binding before doing an expensive check
    Driver core: Fix cleanup in device_create_vargs().
    Driver core: Clarify device cleanup.
    ...

    Linus Torvalds
     
  • 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
     
  • This creates the attributes before the uevent is sent.

    Signed-off-by: Drew Moseley
    Acked-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Drew Moseley
     

11 Oct, 2008

1 commit


27 Jul, 2008

1 commit


17 Jul, 2008

9 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
     
  • This patch moves all the option allocations (pnp_mem, pnp_port, etc)
    into the pnp_register_{mem,port,irq,dma}_resource() functions. This
    will make it easier to rework the option data structures.

    The non-trivial part of this patch is the IRQ handling. The backends
    have to allocate a local pnp_irq_mask_t bitmap, populate it, and pass
    a pointer to pnp_register_irq_resource().

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

    Bjorn Helgaas
     
  • ACPI Address Space Descriptors can be up to 64 bits wide.
    We should keep track of the whole thing when parsing resource
    options, so this patch changes PNP port and mem option
    fields from "unsigned short" and "unsigned int" to
    "resource_size_t".

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

    Bjorn Helgaas
     
  • This adds a typedef for the IRQ bitmap, which should cause
    no functional change, but will make it easier to pass a
    pointer to a bitmap to pnp_register_irq_resource().

    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 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
     
  • This patch adds a "pnp_resource_type_name(struct resource *)" that
    returns the string resource type. This will be used by the sysfs
    "show resources" function and the debug resource dump function.

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

    Bjorn Helgaas
     
  • Given a struct resource, this returns the type (IO, MEM, IRQ, DMA).

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

    Bjorn Helgaas
     
  • We used pnp_resource.index to keep track of which ISAPNP configuration
    register a resource should be written to. We needed this only to
    handle the case where a register is disabled but a subsequent register
    in the same set is enabled.

    Rather than explicitly maintaining the pnp_resource.index, this patch
    adds a resource every time we read an ISAPNP configuration register
    and marks the resource as IORESOURCE_DISABLED when appropriate. This
    makes the position in the pnp_resource_table always correspond to the
    config register index.

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

    Bjorn Helgaas
     

15 May, 2008

1 commit

  • The subsequent AD181x quirk patch would like this as part of the API.
    pnp_register_dependent_option() adds to the same dependent chain the quirk is
    walking which is fairly unclean. This enables a private option chain build
    which it can then just add onto the end when done.

    Signed-off-by: Rene Herman
    Tested-by: Uwe Bugla
    Acked-by: Uwe Bugla
    Acked-by: Bjorn Helgaas
    Cc: Takashi Iwai
    Cc: Len Brown
    Signed-off-by: Linus Torvalds

    Rene Herman
     

29 Apr, 2008

18 commits