12 Jun, 2008
3 commits
-
When configuring the resources of an ACPI device, we first evaluate _CRS
to get a template of resource descriptors, then fill in the specific
resource values we want, and finally evaluate _SRS to actually configure
the device.Some resources have optional fields, so the size of encoded descriptors
varies depending on the specific values. For example, IRQ descriptors can
be either two or three bytes long. The third byte contains triggering
information and can be omitted if the IRQ is edge-triggered and active
high.The BIOS often assumes that IRQ descriptors in the _SRS buffer use the
same format as those in the _CRS buffer, so this patch enforces that
constraint.The "Start Dependent Function" descriptor also has an optional byte, but
we don't currently encode those descriptors, so I didn't do anything for
those.I have tested this patch on a Toshiba Portege 4000. Without the patch,
parport_pc claims the parallel port only if I use "pnpacpi=off". This
patch makes it work with PNPACPI.This is an extension of a patch by Tom Jaeger:
http://bugzilla.kernel.org/show_bug.cgi?id=9487#c42References:
http://bugzilla.kernel.org/show_bug.cgi?id=5832 Enabling ACPI Plug and Play in kernels >2.6.9 kills Parallel support
http://bugzilla.kernel.org/show_bug.cgi?id=9487 buggy firmware expects four-byte IRQ resource descriptor (was: Serial port disappears after Suspend on Toshiba R25)
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=1d5b285da1893b90507b081664ac27f1a8a3dc5b related ACPICA fixSigned-off-by: Bjorn Helgaas
Signed-off-by: Andrew Morton
Signed-off-by: Len Brown -
When we encode IRQ resources, we should use the "shareable" flag we got
from _PRS rather than guessing based on the IRQ trigger mode.This is based on a patch by Tom Jaeger:
http://bugzilla.kernel.org/show_bug.cgi?id=9487#c32Signed-off-by: Bjorn Helgaas
Signed-off-by: Andrew Morton
Signed-off-by: Len Brown -
When decoding IRQ trigger mode and polarity, it is not enough to mask by
IORESOURCE_BITS because there are now additional bits defined. For
example, if IORESOURCE_IRQ_SHAREABLE was set, we failed to set *triggering
and *polarity at all.I can't point to a failure that this patch fixes, but
bugs in this area have caused problems when resuming after
suspend, for example:http://bugzilla.kernel.org/show_bug.cgi?id=6316
http://bugzilla.kernel.org/show_bug.cgi?id=9487
https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.22/+bug/152187This is based on a patch by Tom Jaeger:
http://bugzilla.kernel.org/show_bug.cgi?id=9487#c32[rene.herman@keyaccess.nl: fix comment]
Signed-off-by: Bjorn Helgaas
Signed-off-by: Andrew Morton
Signed-off-by: Len Brown
06 Jun, 2008
1 commit
-
We don't need to reserve "unset" resources. Trying to reserve
them results in messages like this, which are ugly but harmless:system 00:08: iomem range 0x0-0x0 could not be reserved
Future PNP patches will remove use of IORESOURCE_UNSET, but
we still need it for now.Signed-off-by: Bjorn Helgaas
Signed-off-by: Linus Torvalds
03 Jun, 2008
1 commit
-
Both the PNP/PCI conflict detection quirk and the PNP system
driver must use the same mechanism to mark resources as disabled.I think it's best to keep the resource and to keep the type bit
(IORESOURCE_MEM, etc), so that we match the list from firmware
as closely as possible.Fixes this regression from 2.6.25: http://lkml.org/lkml/2008/6/1/82
Signed-off-by: Bjorn Helgaas
Tested-by: Avuton Olrich
Signed-off-by: Linus Torvalds
16 May, 2008
1 commit
-
Everybody wants to pass it a function pointer, and in fact, that is what
you _must_ pass it for it to make sense (since it knows that ia64 and
ppc64 use descriptors for function pointers and fetches the actual
address from there).So don't make the argument be a 'unsigned long' and force everybody to
add a cast.Signed-off-by: Linus Torvalds
15 May, 2008
4 commits
-
Add a common hex array in hexdump.c so everyone can use it.
Add a common hi/lo helper to avoid the shifting masking that is
done to get the upper and lower nibbles of a byte value.Pull the pack_hex_byte helper from kgdb as it is opencoded many
places in the tree that will be consolidated.Signed-off-by: Harvey Harrison
Acked-by: Paul Mundt
Cc: Jason Wessel
Cc: Ingo Molnar
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The AD181x and AZT230 chips don't support an IRQ-less MPU401 option but
work fine without one. This adds (priority functional) IRQ-less options
for each port option to help systems with few available IRQs.The AD1815 quirk can't use pnp_register_irq_resource() due to doubly
penalizing the IRQ. Also, while not a practical issue due to no IRQ
option being present for the dependents, this needs to add in front, not
back.Doesn't use pnp_register_port_resource() for symetry with above.
This does not delete the AD1815 independent option even though it should
be empty after the IRQ transfer due to AD1816 coming with an empty but
still present independent option by default.Was tested on AD1815, AD1816 and AZT2320. The ALSA snd-ad1818a driver
also support the AZT2002 ID for MPU401 but this doesn't as I was unable to
test it.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 -
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 -
Make it look a bit more like pci_fixup_device/pci_do_fixups. Also print
the PnP ID and delete the () from the "foo+0x0/0x1234()".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
13 May, 2008
1 commit
-
We have to set the ISAPNP register index when setting an IRQ via the sysfs
interface. We already do it for IO, MEM, and DMA resources; I just missed the
IRQ one.Signed-off-by: Bjorn Helgaas
Cc: Len Brown
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
01 May, 2008
4 commits
-
next-20080430/drivers/pnp/pnpbios/rsparser.c:594: warning: format '%d' expects type 'int', but argument 4 has type 'resource_size_t'
next-20080430/drivers/pnp/pnpbios/rsparser.c:605: warning: format '%d' expects type 'int', but argument 4 has type 'resource_size_t'[joe@perches.com: fix it]
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Randy Dunlap
Cc: Bjorn Helgaas
Signed-off-by: Joe PerchesSigned-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
* '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. -
Fix following section mismatch warning:
WARNING: vmlinux.o(.text+0x153d69): Section mismatch in reference from the function is_exclusive_device() to the variable .init.data:excluded_id_listis_exclusive_device is only used from __init context so document
this with the __init annotation and get rid of the warning.Signed-off-by: Sam Ravnborg
Signed-off-by: Len Brown
29 Apr, 2008
25 commits
-
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.Signed-off-by: Denis V. Lunev
Cc: Greg Kroah-Hartman
Cc: Alexey Dobriyan
Cc: "Eric W. Biederman"
Cc: Peter Osterlund
Cc: Bartlomiej Zolnierkiewicz
Cc: Dmitry Torokhov
Cc: Neil Brown
Cc: Mauro Carvalho Chehab
Cc: Bjorn Helgaas
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Remove proc_bus export and variable itself. Using pathnames works fine
and is slightly more understandable and greppable.Signed-off-by: Alexey Dobriyan
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The contents of include/linux/pnpbios.h are used only inside the PNPBIOS
backend, so this file doesn't need to be visible outside PNP.This patch moves the contents into an existing PNPBIOS-specific file,
drivers/pnp/pnpbios/pnpbios.h.Signed-off-by: Bjorn Helgaas
Acked-By: Rene Herman
Signed-off-by: Len Brown -
The "regs" field in struct pnp_dev is set but never read, so remove it.
Signed-off-by: Bjorn Helgaas
Acked-By: Rene Herman
Signed-off-by: Len Brown -
The interfaces for registering protocols, devices, cards,
and resource options should only be used inside the PNP core.Signed-off-by: Bjorn Helgaas
Acked-By: Rene Herman
Signed-off-by: Len Brown -
Move warnings about _CRS and _PRS problems to the place where we
actually make the ACPI calls. Then we don't have to pass around
acpi_status values any more than necessary.Signed-off-by: Bjorn Helgaas
Acked-By: Rene Herman
Signed-off-by: Len Brown -
isapnp_get_resources() does very little besides call
isapnp_read_resources(), so just fold them back together.Based on a patch by Rene Herman
Signed-off-by: Bjorn Helgaas
Signed-off-by: Len Brown -
Add a pnp_add_mem_resource() that can be used by all the PNP
backends. This consolidates a little more pnp_resource_table
knowledge into one place.Signed-off-by: Bjorn Helgaas
Signed-off-by: Len Brown -
Add a pnp_add_io_resource() that can be used by all the PNP
backends. This consolidates a little more pnp_resource_table
knowledge into one place.Signed-off-by: Bjorn Helgaas
Signed-off-by: Len Brown -
Add a pnp_add_dma_resource() that can be used by all the PNP
backends. This consolidates a little more pnp_resource_table
knowledge into one place.Signed-off-by: Bjorn Helgaas
Signed-off-by: Len Brown -
Add a pnp_add_irq_resource() that can be used by all the PNP
backends. This consolidates a little more pnp_resource_table
knowledge into one place.Signed-off-by: Bjorn Helgaas
Signed-off-by: Len Brown -
This encapsulates the code to locate a new pnp_resource of the
desired type. Currently this uses the pnp_resource_table, but
it will soon change to find a resource in a linked list.Signed-off-by: Bjorn Helgaas
Signed-off-by: Len Brown -
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
Signed-off-by: Len Brown -
In some places, we need to get the struct pnp_resource, not just
the struct resource, because ISAPNP needs to store the register
index in the pnp_resource.I don't like pnp_get_pnp_resource() and hope that it is temporary,
but we need it for a little while.Signed-off-by: Bjorn Helgaas
Signed-off-by: Len Brown -
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
Signed-off-by: Len Brown -
This removes a few more references to the pnp_resource_table.
No functional change.Signed-off-by: Bjorn Helgaas
Signed-off-by: Len Brown -
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
Signed-off-by: Len Brown -
Remove some PNP_MAX_* uses. The pnp_resource_table isn't
dynamic yet, but with pnp_get_resource(), we can start moving
away from the table size constants.Signed-off-by: Bjorn Helgaas
Signed-off-by: Len Brown -
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
Signed-off-by: Len Brown -
This removes more direct references to pnp_resource_table. This
path is used when telling a device what resources it should use.This doesn't convert ISAPNP because ISA needs to know the config
register index in addition to the resource itself.Signed-off-by: Bjorn Helgaas
Acked-By: Rene Herman
Signed-off-by: Len Brown -
This removes more direct references to pnp_resource_table.
Signed-off-by: Bjorn Helgaas
Acked-By: Rene Herman
Signed-off-by: Len Brown -
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
Acked-By: Rene Herman
Signed-off-by: Len Brown -
This patch removes a use of "idx" in pnp_check_port() and similar
functions, in preparation for replacing idx with a pointer to the
resource itself.I split this out because it changes the behavior slightly: we used
to check for conflicts only with earlier resources, e.g., we checked
resource 2 against resources 0 and 1 but not against 3, 4, etc. Now
we will check against all resources except 2.Since resources are assigned in ascending order, the old behavior
was probably safe, but I don't like to depend on that ordering.Signed-off-by: Bjorn Helgaas
Acked-By: Rene Herman
Signed-off-by: Len Brown -
Use a temporary "res" pointer to replace repeated lookups in
the pnp resource tables.Signed-off-by: Bjorn Helgaas
Acked-By: Rene Herman
Signed-off-by: Len Brown -
Use a temporary "res" pointer to replace repeated lookups in
the pnp resource tables.Signed-off-by: Bjorn Helgaas
Acked-By: Rene Herman
Signed-off-by: Len Brown