diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-01-07 19:17:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-01-07 19:17:18 -0500 |
commit | 2a893f91f57314c593f36cee689ad6e353af9daf (patch) | |
tree | 6c8287371612ddc9070991cd5c6b6c011c7d5dc1 /drivers/pnp/manager.c | |
parent | 127aa93066261c2b8f03cb38e7165de8cd71736e (diff) | |
parent | f67ffa95836b31be5d8fe336aee3bfc6412c5696 (diff) |
Merge tag 'pm+acpi-for-3.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI and power management fixes from Rafael Wysocki:
- Removal of some ACPICA code that the kernel will never use from Lv
Zheng.
- APEI fix from Adrian Huang.
- Removal of unnecessary ACPI memory hotplug driver code from Liu
Jinsong.
- Minor ACPI power management fixes.
- ACPI debug code fix from Joe Perches.
- ACPI fix to make system bus device nodes get the right names.
- PNP resources handling fixes from Witold Szczeponik.
- cpuidle fix for a recent regression stalling boot on systems with
great numbers of CPUs from Daniel Lezcano.
- cpuidle fixes from Sivaram Nair.
- intel_idle debug message fix from Youquan Song.
- cpufreq build regression fix from Larry Finger.
- cpufreq fix for an obscure initialization race related to statistics
from Konstantin Khlebnikov.
- cpufreq change disabling the Longhaul driver by default from RafaĆ
Bilski.
- PM core fix preventing device suspend errors from happening during
system suspend due to obscure race conditions.
- PM QoS local variable name cleanup.
* tag 'pm+acpi-for-3.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
PM: Move disabling/enabling runtime PM to late suspend/early resume
PM / QoS: Rename local variable in dev_pm_qos_add_ancestor_request()
ACPI / scan: Do not use dummy HID for system bus ACPI nodes
cpufreq / governor: Fix problem with cpufreq_ondemand or cpufreq_conservative
cpufreq / Longhaul: Disable driver by default
cpufreq / stats: fix race between stats allocation and first usage
cpuidle: fix lock contention in the idle path
intel_idle: pr_debug information need separated
cpuidle / coupled: fix ready counter decrement
cpuidle: Fix finding state with min power_usage
PNP: Handle IORESOURCE_BITS in resource allocation
PNP: Simplify setting of resources
ACPI / power: Remove useless message from device registering routine
ACPI / glue: Update DBG macro to include KERN_DEBUG
ACPI / PM: Do not apply ACPI_SUCCESS() to acpi_bus_get_device() result
ACPI / memhotplug: remove redundant logic of acpi memory hotadd
ACPI / APEI: Fix the returned value in erst_dbg_read
ACPICA: Remove useless mini-C library.
Diffstat (limited to 'drivers/pnp/manager.c')
-rw-r--r-- | drivers/pnp/manager.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c index ed9ce507149a..95cebf0185de 100644 --- a/drivers/pnp/manager.c +++ b/drivers/pnp/manager.c | |||
@@ -18,11 +18,27 @@ | |||
18 | 18 | ||
19 | DEFINE_MUTEX(pnp_res_mutex); | 19 | DEFINE_MUTEX(pnp_res_mutex); |
20 | 20 | ||
21 | static struct resource *pnp_find_resource(struct pnp_dev *dev, | ||
22 | unsigned char rule, | ||
23 | unsigned long type, | ||
24 | unsigned int bar) | ||
25 | { | ||
26 | struct resource *res = pnp_get_resource(dev, type, bar); | ||
27 | |||
28 | /* when the resource already exists, set its resource bits from rule */ | ||
29 | if (res) { | ||
30 | res->flags &= ~IORESOURCE_BITS; | ||
31 | res->flags |= rule & IORESOURCE_BITS; | ||
32 | } | ||
33 | |||
34 | return res; | ||
35 | } | ||
36 | |||
21 | static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx) | 37 | static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx) |
22 | { | 38 | { |
23 | struct resource *res, local_res; | 39 | struct resource *res, local_res; |
24 | 40 | ||
25 | res = pnp_get_resource(dev, IORESOURCE_IO, idx); | 41 | res = pnp_find_resource(dev, rule->flags, IORESOURCE_IO, idx); |
26 | if (res) { | 42 | if (res) { |
27 | pnp_dbg(&dev->dev, " io %d already set to %#llx-%#llx " | 43 | pnp_dbg(&dev->dev, " io %d already set to %#llx-%#llx " |
28 | "flags %#lx\n", idx, (unsigned long long) res->start, | 44 | "flags %#lx\n", idx, (unsigned long long) res->start, |
@@ -65,7 +81,7 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx) | |||
65 | { | 81 | { |
66 | struct resource *res, local_res; | 82 | struct resource *res, local_res; |
67 | 83 | ||
68 | res = pnp_get_resource(dev, IORESOURCE_MEM, idx); | 84 | res = pnp_find_resource(dev, rule->flags, IORESOURCE_MEM, idx); |
69 | if (res) { | 85 | if (res) { |
70 | pnp_dbg(&dev->dev, " mem %d already set to %#llx-%#llx " | 86 | pnp_dbg(&dev->dev, " mem %d already set to %#llx-%#llx " |
71 | "flags %#lx\n", idx, (unsigned long long) res->start, | 87 | "flags %#lx\n", idx, (unsigned long long) res->start, |
@@ -78,6 +94,7 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx) | |||
78 | res->start = 0; | 94 | res->start = 0; |
79 | res->end = 0; | 95 | res->end = 0; |
80 | 96 | ||
97 | /* ??? rule->flags restricted to 8 bits, all tests bogus ??? */ | ||
81 | if (!(rule->flags & IORESOURCE_MEM_WRITEABLE)) | 98 | if (!(rule->flags & IORESOURCE_MEM_WRITEABLE)) |
82 | res->flags |= IORESOURCE_READONLY; | 99 | res->flags |= IORESOURCE_READONLY; |
83 | if (rule->flags & IORESOURCE_MEM_CACHEABLE) | 100 | if (rule->flags & IORESOURCE_MEM_CACHEABLE) |
@@ -123,7 +140,7 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx) | |||
123 | 5, 10, 11, 12, 9, 14, 15, 7, 3, 4, 13, 0, 1, 6, 8, 2 | 140 | 5, 10, 11, 12, 9, 14, 15, 7, 3, 4, 13, 0, 1, 6, 8, 2 |
124 | }; | 141 | }; |
125 | 142 | ||
126 | res = pnp_get_resource(dev, IORESOURCE_IRQ, idx); | 143 | res = pnp_find_resource(dev, rule->flags, IORESOURCE_IRQ, idx); |
127 | if (res) { | 144 | if (res) { |
128 | pnp_dbg(&dev->dev, " irq %d already set to %d flags %#lx\n", | 145 | pnp_dbg(&dev->dev, " irq %d already set to %d flags %#lx\n", |
129 | idx, (int) res->start, res->flags); | 146 | idx, (int) res->start, res->flags); |
@@ -182,7 +199,7 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx) | |||
182 | 1, 3, 5, 6, 7, 0, 2, 4 | 199 | 1, 3, 5, 6, 7, 0, 2, 4 |
183 | }; | 200 | }; |
184 | 201 | ||
185 | res = pnp_get_resource(dev, IORESOURCE_DMA, idx); | 202 | res = pnp_find_resource(dev, rule->flags, IORESOURCE_DMA, idx); |
186 | if (res) { | 203 | if (res) { |
187 | pnp_dbg(&dev->dev, " dma %d already set to %d flags %#lx\n", | 204 | pnp_dbg(&dev->dev, " dma %d already set to %d flags %#lx\n", |
188 | idx, (int) res->start, res->flags); | 205 | idx, (int) res->start, res->flags); |