History log of /drivers/pnp/manager.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
586f83e2b4c080073b115c1a0fcc2757f52839b8 23-Mar-2011 David Rientjes <rientjes@google.com> pnp: only assign IORESOURCE_DMA if CONFIG_ISA_DMA_API is enabled

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 <rientjes@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/pnp/manager.c
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit 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>
/drivers/pnp/manager.c
2f53432c2aedbe79020e44525eb069d9138a01dd 20-Aug-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: convert to using pnp_dbg()

pnp_dbg() is equivalent to dev_dbg() except that we can turn it
on at boot-time with the "pnp.debug" kernel parameter, so we don't
have to build a new kernel image.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
1f32ca31e7409d37c1b25e5f81840fb184380cdf 28-Jun-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: convert resource options to single linked list

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 <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
d5ebde6ef5c2d51828f975a81d7d0e58bccfd833 28-Jun-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: support optional IRQ resources

This patch adds an IORESOURCE_IRQ_OPTIONAL flag for use when
assigning resources to a device. If the flag is set and we are
unable to assign an IRQ to the device, we can leave the IRQ
disabled but allow the overall resource allocation to succeed.

Some devices request an IRQ, but can run without an IRQ
(possibly with degraded performance). This flag lets us run
the device without the IRQ instead of just leaving the
device disabled.

This is a reimplementation of this previous change by Rene
Herman <rene.herman@gmail.com>:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3b73a223661ed137c5d3d2635f954382e94f5a43

I reimplemented this for two reasons:
- to prepare for converting all resource options into a single linked
list, as opposed to the per-resource-type lists we have now, and
- to preserve the order and number of resource options.

In PNPBIOS and ACPI, we configure a device by giving firmware a
list of resource assignments. It is important that this list
has exactly the same number of resources, in the same order,
as the "template" list we got from the firmware in the first
place.

The problem of a sound card MPU401 being left disabled for want of
an IRQ was reported by Uwe Bugla <uwe.bugla@gmx.de>.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
b08395e5038e3337bb85c7246a635a3be6d5a29c 28-Jun-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: remove redundant pnp_can_configure() check

pnp_assign_resources() is static and the only caller checks
pnp_can_configure() before calling it, so no need to do it
again.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
6e906f0e1c8633ed357a64e9861f1822789bee3d 28-Jun-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: make resource assignment functions return 0 (success) or -EBUSY (failure)

This patch doesn't change any behavior; it just makes the return
values more conventional.

This changes pnp_assign_dma() from a void function to one that
returns an int, just like the other assignment functions. For
now, at least, pnp_assign_dma() always returns 0 (success), so
it appears to never fail, just like before.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
fcfb7ce3d688d5c15fc9bc0a2a48e1ededdb046f 28-Jun-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: improve resource assignment debug

When we fail to assign an I/O or MEM resource, include the min/max
in the debug output to help match it with the options.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
7aefff51854ccd33599c40b4e360d94cb2b7622f 28-Jun-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: introduce pnp_irq_mask_t typedef

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 <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
aee3ad815dd291a7193ab01da0f1a30c84d00061 28-Jun-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: replace pnp_resource_table with dynamically allocated resources

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 <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
/drivers/pnp/manager.c
87e4acf3ebc02c9d0a2f7a37b655c49176c4d765 28-Jun-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: remove pnp_resource.index

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 <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
/drivers/pnp/manager.c
21855d69d1e3ace3efdb8159a4a7ab1ab98a6f19 29-Apr-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: add pnp_resource index for ISAPNP

Save the ISAPNP config register index in the struct pnp_resource.

We need this because it is important to write ISAPNP configuration
back to the same registers we read it from. For example, if we
read valid regions from memory descriptors 0, 1, and 3, we'd
better write them back to the same registers, without compressing
them to descriptors 0, 1, and 2.

This was previously guaranteed by using the index into the
pnp_resource_table array as the ISAPNP config register index.
However, I am removing those fixed-size arrays, so we need to
save the ISAPNP register index elsewhere.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
784f01d5bdeae7d7005ede17305306b042ba2617 29-Apr-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: add struct pnp_resource

This patch adds a "struct pnp_resource". This currently
contains only a struct resource, but we will soon need
additional PNP-specific information.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
02d83b5da3efa3c278ce87db2637f3dd6837166d 29-Apr-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: make pnp_resource_table private to PNP core

There are no remaining references to the PNP_MAX_* constants or
the pnp_resource_table structure outside of the PNP core. Make
them private to the PNP core.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
f6505fef18644557f732468c1f22f84560d8a819 29-Apr-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: convert assign, interface to use pnp_get_resource(), not pnp_resource_table

This removes more direct references to pnp_resource_table from the
pnp_assign_resources() path and the /sys user interface path.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
f5d94ff014cb7e6212f40fc6644f3fd68507df33 29-Apr-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: pass resources, not indexes, to pnp_check_port(), et al

The caller already has the struct resource pointer, so no need for
pnp_check_port(), pnp_check_mem(), etc., to look it up again.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
28ccffcf028777e830cbdc30bc54ba8a37e2fc23 29-Apr-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: reduce redundancy in pnp_assign_port() and others

Use a temporary "res" pointer to replace repeated lookups in
the pnp resource tables.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
d948a8daa059cf5b3e7f002e7b92acf00fc70c49 29-Apr-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: factor pnp_init_resource_table() and pnp_clean_resource_table()

Move the common part of pnp_init_resource_table() and
pnp_clean_resource_table() into a new pnp_init_resource().
This reduces a little code duplication and will be
useful later to initialize an individual resource.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
2cd1393098073426256cb4543c897f8c340d0b93 29-Apr-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: remove unused interfaces using pnp_resource_table

Rene Herman <rene.herman@gmail.com> recently removed the only in-tree
driver uses of:

pnp_init_resource_table()
pnp_manual_config_dev()
pnp_resource_change()

in this change:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=109c53f840e551d6e99ecfd8b0131a968332c89f

These are no longer used in the PNP core either, so we can just remove
them completely.

It's possible that there are out-of-tree drivers that use these
interfaces. They should be changed to either (1) use PNP quirks
to work around broken hardware or firmware, or (2) use the sysfs
interfaces to control resource usage from userspace.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
6969c7ed558cf5e9eff01734be0174a296938092 29-Apr-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: remove pnp_resource_table from internal pnp_clean_resource_table interface

This changes pnp_clean_resource_table() to take a pnp_dev pointer
rather than a pnp_resource_table pointer. This reduces the visibility
of pnp_resource_table and removes an opportunity for error in the
caller.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
f44900020926b2cb06b87f0f52643d6285514fc3 29-Apr-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: add pnp_init_resources(struct pnp_dev *) interface

Add pnp_init_resources(struct pnp_dev *) to replace
pnp_init_resource_table(), which takes a pointer to the
pnp_resource_table itself. Passing only the pnp_dev * reduces
the possibility for error in the caller and removes the
pnp_resource_table implementation detail from the interface.

Even though pnp_init_resource_table() is exported, I did not
export pnp_init_resources() because it is used only by the PNP
core.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
81b5c75f0ed22a93c3da00650d0898eec56e1d62 29-Apr-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: add debug when assigning PNP resources

This patch adds code to dump PNP resources before and after
assigning resources and before writing them to the device.

This is enabled by CONFIG_PNP_DEBUG=y.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
59284cb4099411bc6f4915a5a4cb76414440c447 29-Apr-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: remove pnp_resource_table from internal get/set interfaces

When we call protocol->get() and protocol->set() methods, we currently
supply pointers to both the pnp_dev and the pnp_resource_table even
though the pnp_resource_table should always be the one associated with
the pnp_dev.

This removes the pnp_resource_table arguments to make it clear that
these methods only operate on the specified pnp_dev.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
b3bd86e2fdce01d6b49271a553d2a18b3e0510f3 06-Feb-2008 Daniel Walker <dwalker@mvista.com> isapnp driver semaphore to mutex

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 <dwalker@mvista.com>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/pnp/manager.c
cc8259a6666de456460bacdd5637f5e2d71790ea 06-Feb-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> simplify pnp_activate_dev() and pnp_disable_dev() return values

Make pnp_activate_dev() and pnp_disable_dev() return only 0 (success) or a
negative error value, as pci_enable_device() and pci_disable_device() do.

Previously they returned:

0: device was already active (or disabled)
1: we just activated (or disabled) device
<0: -EBUSY or error from pnp_start_dev() (or pnp_stop_dev())

Now we return only 0 (device is active or disabled) or <0 (error).

All in-tree callers either ignore the return values or check only for
errors (negative values).

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/pnp/manager.c
a05d0781695566296e74a3670dd5bbd3daf24ae2 17-Oct-2007 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: use dev_info(), dev_err(), etc in core

If we have the struct pnp_dev available, we can use dev_info(), dev_err(),
etc., to give a little more information and consistency.

[akpm@linux-foundation.org: fix warning]
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/pnp/manager.c
7ef36390fabe2168fe31f245e49eb4e5f3762622 17-Oct-2007 Jan Beulich <jbeulich@novell.com> PNP: don't fail device init if no DMA channel available

Most drivers for devices supporting ISA DMA can operate without DMA as well
(falling back zo PIO). Thus it seems inappropriate for PNP to fail device
initialization in case none of the possible DMA channels are available.
Instead, it should be left to the driver to decide what to do if
request_dma() fails.

The patch at once adjusts the code to account for the fact that
pnp_assign_dma() now doesn't need to report failure anymore.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/pnp/manager.c
c1017a4cdb68ae5368fbc9ee42c77f1f5dca8916 15-Oct-2007 Jaroslav Kysela <perex@perex.cz> [ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz


Signed-off-by: Jaroslav Kysela <perex@perex.cz>
/drivers/pnp/manager.c
b173491339b9ae7f1322241ce6228c1268513a39 15-Aug-2007 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: remove null pointer checks

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 <bjorn.helgaas@hp.com>
Acked-by: Adam Belay <abelay@novell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
1e0aa9ad721349781b728ec4226876247e3fd431 15-Aug-2007 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: fix up after Lindent

More manual fixups after Lindent. No functional change.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Adam Belay <abelay@novell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
/drivers/pnp/manager.c
07d4e9af109221ab731c5aaf832e89776c64b013 26-Jul-2007 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: fix up after Lindent

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

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/pnp/manager.c
9dd78466c956ac4b4f38e12032dc4249ccf57ad1 26-Jul-2007 Bjorn Helgaas <bjorn.helgaas@hp.com> PNP: Lindent all source files

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 <bjorn.helgaas@hp.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/pnp/manager.c
48670a1e018a9c0b83dc78e3b71ffb26391ee4b6 16-Mar-2007 David Brownell <david-b@pacbell.net> [PATCH] reduce pnp syslog spam

Make some normal code paths in PNP stop issuing syslog spam. Since PNP
issues calls regardless of device capablities, it's no surprise when some
of those devices don't support those calls!

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/pnp/manager.c
6ab3d5624e172c553004ecc862bfeac16d9d68b7 30-Jun-2006 Jörn Engel <joern@wohnheim.fh-wedel.de> Remove obsolete #include <linux/config.h>

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
/drivers/pnp/manager.c
b60ba8343b78b182c03cf239d4342785376c1ad1 13-Jun-2006 Greg Kroah-Hartman <gregkh@suse.de> [PATCH] 64bit resource: change pnp core to use resource_size_t

Based on a patch series originally from Vivek Goyal <vgoyal@in.ibm.com>

Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/pnp/manager.c
c640be26f7f8b7a826529baa72fad76bd4f6f5a2 19-Apr-2006 Jan Engelhardt <jengelh@gmx.de> [PATCH] pnp: fix two messages in manager.c

The wording of two messages in drivers/pnp/manager.c is incorrect. Fix that.

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/pnp/manager.c
68094e3251a664ee1389fcf179497237cbf78331 29-Nov-2005 Pierre Ossman <drzeus-list@drzeus.cx> [ALSA] [PATCH] alsa: Improved PnP suspend support

Also use the PnP functions to start/stop the devices during the suspend so
that drivers will not have to duplicate this code.

Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
/drivers/pnp/manager.c
b449f63c8ce4a517cb91f237cc3d68d083ec2dd3 07-Nov-2005 Adrian Bunk <bunk@stusta.de> [PATCH] drivers/pnp/: cleanups

This patch contains the following possible cleanups:
- make needlessly global code static
- #if 0 the following unused global function:
- core.c: pnp_remove_device
- #if 0 the following unneeded EXPORT_SYMBOL's:
- card.c: pnp_add_card
- card.c: pnp_remove_card
- card.c: pnp_add_card_device
- card.c: pnp_remove_card_device
- card.c: pnp_add_card_id
- core.c: pnp_register_protocol
- core.c: pnp_unregister_protocol
- core.c: pnp_add_device
- core.c: pnp_remove_device
- pnpacpi/core.c: pnpacpi_protocol
- driver.c: pnp_add_id
- isapnp/core.c: isapnp_read_byte
- manager.c: pnp_auto_config_dev
- resource.c: pnp_register_dependent_option
- resource.c: pnp_register_independent_option
- resource.c: pnp_register_irq_resource
- resource.c: pnp_register_dma_resource
- resource.c: pnp_register_port_resource
- resource.c: pnp_register_mem_resource

Note that this patch #if 0's exactly one functions and removes no
functions. Most it does is the #if 0 of EXPORT_SYMBOL's, so if any modular
code will use any of them, re-adding will be trivial.

Modular ISAPnP might be interesting in some cases, but this is more legacy
code. If someone would work on it to sort all the issues out (starting
with the point that most users of __ISAPNP__ will have to be fixed)
re-enabling the required EXPORT_SYMBOL's won't be hard for him.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/pnp/manager.c
4e57b6817880946a3a78d5d8cad1ace363f7e449 31-Oct-2005 Tim Schmielau <tim@physik3.uni-rostock.de> [PATCH] fix missing includes

I recently picked up my older work to remove unnecessary #includes of
sched.h, starting from a patch by Dave Jones to not include sched.h
from module.h. This reduces the number of indirect includes of sched.h
by ~300. Another ~400 pointless direct includes can be removed after
this disentangling (patch to follow later).
However, quite a few indirect includes need to be fixed up for this.

In order to feed the patches through -mm with as little disturbance as
possible, I've split out the fixes I accumulated up to now (complete for
i386 and x86_64, more archs to follow later) and post them before the real
patch. This way this large part of the patch is kept simple with only
adding #includes, and all hunks are independent of each other. So if any
hunk rejects or gets in the way of other patches, just drop it. My scripts
will pick it up again in the next round.

Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/pnp/manager.c
e139aa595c5d3bd01699530cbe017dec75fdb07f 07-Sep-2005 Bjorn Helgaas <bjorn.helgaas@hp.com> [PATCH] PNP: make pnp_dbg conditional directly on CONFIG_PNP_DEBUG

Seems pointless to require .c files to test CONFIG_PNP_DEBUG and
conditionally define DEBUG before including <linux/pnp.h>. Just test
CONFIG_PNP_DEBUG directly in pnp.h.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/pnp/manager.c
3d41088fa327782b14b5659dbcfff62ec704c23c 24-Jun-2005 Martin Waitz <tali@admingilde.org> [PATCH] DocBook: update comments

This patch updates some comments to match code changes.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/pnp/manager.c
67be2dd1bace0ec7ce2dbc1bba3f8df3d7be597e 01-May-2005 Martin Waitz <tali@admingilde.org> [PATCH] DocBook: fix some descriptions

Some KernelDoc descriptions are updated to match the current code.
No code changes.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/pnp/manager.c
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
/drivers/pnp/manager.c