Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'acpi-3.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:

- Fix for a regression causing a failure to turn on some devices on
some systems during initialization introduced by a recent revert of
an ACPI PM change that broke something else. Fortunately, we know
exactly what devices are affected, so we can add a fix just for them
leaving everyone else alone.

- ACPI power resources initialization fix preventing a NULL pointer
from being dereferenced in the acpi_add_power_resource() error code
path.

- ACPI dock station driver fix that adds missing locking to
write_undock().

- ACPI resources allocation fix changing the scope of an old workaround
so that it doesn't affect systems that aren't actually buggy. This
was reported a couple of days ago to fix DMA problems on some new
platforms so we need it in -stable. From Mika Westerberg.

* tag 'acpi-3.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / LPSS: Power up LPSS devices during enumeration
ACPI / PM: Fix error code path for power resources initialization
ACPI / dock: Take ACPI scan lock in write_undock()
ACPI / resources: call acpi_get_override_irq() only for legacy IRQ resources

+50 -11
+15 -6
drivers/acpi/acpi_lpss.c
··· 164 164 if (dev_desc->clk_required) { 165 165 ret = register_device_clock(adev, pdata); 166 166 if (ret) { 167 - /* 168 - * Skip the device, but don't terminate the namespace 169 - * scan. 170 - */ 171 - kfree(pdata); 172 - return 0; 167 + /* Skip the device, but continue the namespace scan. */ 168 + ret = 0; 169 + goto err_out; 173 170 } 171 + } 172 + 173 + /* 174 + * This works around a known issue in ACPI tables where LPSS devices 175 + * have _PS0 and _PS3 without _PSC (and no power resources), so 176 + * acpi_bus_init_power() will assume that the BIOS has put them into D0. 177 + */ 178 + ret = acpi_device_fix_up_power(adev); 179 + if (ret) { 180 + /* Skip the device, but continue the namespace scan. */ 181 + ret = 0; 182 + goto err_out; 174 183 } 175 184 176 185 adev->driver_data = pdata;
+20
drivers/acpi/device_pm.c
··· 290 290 return 0; 291 291 } 292 292 293 + /** 294 + * acpi_device_fix_up_power - Force device with missing _PSC into D0. 295 + * @device: Device object whose power state is to be fixed up. 296 + * 297 + * Devices without power resources and _PSC, but having _PS0 and _PS3 defined, 298 + * are assumed to be put into D0 by the BIOS. However, in some cases that may 299 + * not be the case and this function should be used then. 300 + */ 301 + int acpi_device_fix_up_power(struct acpi_device *device) 302 + { 303 + int ret = 0; 304 + 305 + if (!device->power.flags.power_resources 306 + && !device->power.flags.explicit_get 307 + && device->power.state == ACPI_STATE_D0) 308 + ret = acpi_dev_pm_explicit_set(device, ACPI_STATE_D0); 309 + 310 + return ret; 311 + } 312 + 293 313 int acpi_bus_update_power(acpi_handle handle, int *state_p) 294 314 { 295 315 struct acpi_device *device;
+2
drivers/acpi/dock.c
··· 868 868 if (!count) 869 869 return -EINVAL; 870 870 871 + acpi_scan_lock_acquire(); 871 872 begin_undock(dock_station); 872 873 ret = handle_eject_request(dock_station, ACPI_NOTIFY_EJECT_REQUEST); 874 + acpi_scan_lock_release(); 873 875 return ret ? ret: count; 874 876 } 875 877 static DEVICE_ATTR(undock, S_IWUSR, NULL, write_undock);
+1
drivers/acpi/power.c
··· 885 885 ACPI_STA_DEFAULT); 886 886 mutex_init(&resource->resource_lock); 887 887 INIT_LIST_HEAD(&resource->dependent); 888 + INIT_LIST_HEAD(&resource->list_node); 888 889 resource->name = device->pnp.bus_id; 889 890 strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); 890 891 strcpy(acpi_device_class(device), ACPI_POWER_CLASS);
+11 -5
drivers/acpi/resource.c
··· 304 304 } 305 305 306 306 static void acpi_dev_get_irqresource(struct resource *res, u32 gsi, 307 - u8 triggering, u8 polarity, u8 shareable) 307 + u8 triggering, u8 polarity, u8 shareable, 308 + bool legacy) 308 309 { 309 310 int irq, p, t; 310 311 ··· 318 317 * In IO-APIC mode, use overrided attribute. Two reasons: 319 318 * 1. BIOS bug in DSDT 320 319 * 2. BIOS uses IO-APIC mode Interrupt Source Override 320 + * 321 + * We do this only if we are dealing with IRQ() or IRQNoFlags() 322 + * resource (the legacy ISA resources). With modern ACPI 5 devices 323 + * using extended IRQ descriptors we take the IRQ configuration 324 + * from _CRS directly. 321 325 */ 322 - if (!acpi_get_override_irq(gsi, &t, &p)) { 326 + if (legacy && !acpi_get_override_irq(gsi, &t, &p)) { 323 327 u8 trig = t ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE; 324 328 u8 pol = p ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH; 325 329 326 330 if (triggering != trig || polarity != pol) { 327 331 pr_warning("ACPI: IRQ %d override to %s, %s\n", gsi, 328 - t ? "edge" : "level", p ? "low" : "high"); 332 + t ? "level" : "edge", p ? "low" : "high"); 329 333 triggering = trig; 330 334 polarity = pol; 331 335 } ··· 379 373 } 380 374 acpi_dev_get_irqresource(res, irq->interrupts[index], 381 375 irq->triggering, irq->polarity, 382 - irq->sharable); 376 + irq->sharable, true); 383 377 break; 384 378 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: 385 379 ext_irq = &ares->data.extended_irq; ··· 389 383 } 390 384 acpi_dev_get_irqresource(res, ext_irq->interrupts[index], 391 385 ext_irq->triggering, ext_irq->polarity, 392 - ext_irq->sharable); 386 + ext_irq->sharable, false); 393 387 break; 394 388 default: 395 389 return false;
+1
include/acpi/acpi_bus.h
··· 382 382 int acpi_device_get_power(struct acpi_device *device, int *state); 383 383 int acpi_device_set_power(struct acpi_device *device, int state); 384 384 int acpi_bus_init_power(struct acpi_device *device); 385 + int acpi_device_fix_up_power(struct acpi_device *device); 385 386 int acpi_bus_update_power(acpi_handle handle, int *state_p); 386 387 bool acpi_bus_power_manageable(acpi_handle handle); 387 388