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

Merge tag 'pm+acpi-4.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management and ACPI fixes from Rafael Wysocki:
"These include three regression fixes (PCI resources management,
ACPI/PNP device enumeration, ACPI SBS on MacBook) and two ACPI
documentation fixes related to GPIO.

Specifics:

- Fix for a PCI resources management regression introduced during the
4.0 cycle and related to the handling of ACPI resources'
Producer/Consumer flags that turn out to be useless (Jiang Liu)

- Fix for a MacBook regression related to the Smart Battery Subsystem
(SBS) driver causing various problems (stalls on boot, failure to
detect or report battery) to happen and introduced during the 3.18
cycle (Chris Bainbridge)

- Fix for an ACPI/PNP device enumeration regression introduced during
the 3.16 cycle caused by failing to include two PNP device IDs into
the list of IDs that PNP device objects need to be created for
(Witold Szczeponik)

- Fixes for two minor mistakes in the ACPI GPIO properties
documentation (Antonio Ospite, Rafael J Wysocki)"

* tag 'pm+acpi-4.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / PNP: add two IDs to list for PNPACPI device enumeration
ACPI / documentation: Fix ambiguity in the GPIO properties document
ACPI / documentation: fix a sentence about GPIO resources
ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook
x86/PCI/ACPI: Make all resources except [io 0xcf8-0xcff] available on PCI bus

+51 -7
+1 -1
Documentation/acpi/enumeration.txt
··· 253 253 GPIO support 254 254 ~~~~~~~~~~~~ 255 255 ACPI 5 introduced two new resources to describe GPIO connections: GpioIo 256 - and GpioInt. These resources are used be used to pass GPIO numbers used by 256 + and GpioInt. These resources can be used to pass GPIO numbers used by 257 257 the device to the driver. ACPI 5.1 extended this with _DSD (Device 258 258 Specific Data) which made it possible to name the GPIOs among other things. 259 259
+3 -3
Documentation/acpi/gpio-properties.txt
··· 1 1 _DSD Device Properties Related to GPIO 2 2 -------------------------------------- 3 3 4 - With the release of ACPI 5.1 and the _DSD configuration objecte names 5 - can finally be given to GPIOs (and other things as well) returned by 6 - _CRS. Previously, we were only able to use an integer index to find 4 + With the release of ACPI 5.1, the _DSD configuration object finally 5 + allows names to be given to GPIOs (and other things as well) returned 6 + by _CRS. Previously, we were only able to use an integer index to find 7 7 the corresponding GPIO, which is pretty error prone (it depends on 8 8 the _CRS output ordering, for example). 9 9
+22 -2
arch/x86/pci/acpi.c
··· 325 325 kfree(info); 326 326 } 327 327 328 + /* 329 + * An IO port or MMIO resource assigned to a PCI host bridge may be 330 + * consumed by the host bridge itself or available to its child 331 + * bus/devices. The ACPI specification defines a bit (Producer/Consumer) 332 + * to tell whether the resource is consumed by the host bridge itself, 333 + * but firmware hasn't used that bit consistently, so we can't rely on it. 334 + * 335 + * On x86 and IA64 platforms, all IO port and MMIO resources are assumed 336 + * to be available to child bus/devices except one special case: 337 + * IO port [0xCF8-0xCFF] is consumed by the host bridge itself 338 + * to access PCI configuration space. 339 + * 340 + * So explicitly filter out PCI CFG IO ports[0xCF8-0xCFF]. 341 + */ 342 + static bool resource_is_pcicfg_ioport(struct resource *res) 343 + { 344 + return (res->flags & IORESOURCE_IO) && 345 + res->start == 0xCF8 && res->end == 0xCFF; 346 + } 347 + 328 348 static void probe_pci_root_info(struct pci_root_info *info, 329 349 struct acpi_device *device, 330 350 int busnum, int domain, ··· 366 346 "no IO and memory resources present in _CRS\n"); 367 347 else 368 348 resource_list_for_each_entry_safe(entry, tmp, list) { 369 - if ((entry->res->flags & IORESOURCE_WINDOW) == 0 || 370 - (entry->res->flags & IORESOURCE_DISABLED)) 349 + if ((entry->res->flags & IORESOURCE_DISABLED) || 350 + resource_is_pcicfg_ioport(entry->res)) 371 351 resource_list_destroy_entry(entry); 372 352 else 373 353 entry->res->name = info->name;
+2
drivers/acpi/acpi_pnp.c
··· 304 304 {"PNPb006"}, 305 305 /* cs423x-pnpbios */ 306 306 {"CSC0100"}, 307 + {"CSC0103"}, 308 + {"CSC0110"}, 307 309 {"CSC0000"}, 308 310 {"GIM0100"}, /* Guillemot Turtlebeach something appears to be cs4232 compatible */ 309 311 /* es18xx-pnpbios */
+1 -1
drivers/acpi/resource.c
··· 573 573 * @ares: Input ACPI resource object. 574 574 * @types: Valid resource types of IORESOURCE_XXX 575 575 * 576 - * This is a hepler function to support acpi_dev_get_resources(), which filters 576 + * This is a helper function to support acpi_dev_get_resources(), which filters 577 577 * ACPI resource objects according to resource types. 578 578 */ 579 579 int acpi_dev_filter_resource_type(struct acpi_resource *ares,
+22
drivers/acpi/sbshc.c
··· 14 14 #include <linux/delay.h> 15 15 #include <linux/module.h> 16 16 #include <linux/interrupt.h> 17 + #include <linux/dmi.h> 17 18 #include "sbshc.h" 18 19 19 20 #define PREFIX "ACPI: " ··· 88 87 ACPI_SMB_ALARM_DATA = 0x26, /* 2 bytes alarm data */ 89 88 }; 90 89 90 + static bool macbook; 91 + 91 92 static inline int smb_hc_read(struct acpi_smb_hc *hc, u8 address, u8 *data) 92 93 { 93 94 return ec_read(hc->offset + address, data); ··· 135 132 } 136 133 137 134 mutex_lock(&hc->lock); 135 + if (macbook) 136 + udelay(5); 138 137 if (smb_hc_read(hc, ACPI_SMB_PROTOCOL, &temp)) 139 138 goto end; 140 139 if (temp) { ··· 262 257 acpi_handle handle, acpi_ec_query_func func, 263 258 void *data); 264 259 260 + static int macbook_dmi_match(const struct dmi_system_id *d) 261 + { 262 + pr_debug("Detected MacBook, enabling workaround\n"); 263 + macbook = true; 264 + return 0; 265 + } 266 + 267 + static struct dmi_system_id acpi_smbus_dmi_table[] = { 268 + { macbook_dmi_match, "Apple MacBook", { 269 + DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), 270 + DMI_MATCH(DMI_PRODUCT_NAME, "MacBook") }, 271 + }, 272 + { }, 273 + }; 274 + 265 275 static int acpi_smbus_hc_add(struct acpi_device *device) 266 276 { 267 277 int status; 268 278 unsigned long long val; 269 279 struct acpi_smb_hc *hc; 280 + 281 + dmi_check_system(acpi_smbus_dmi_table); 270 282 271 283 if (!device) 272 284 return -EINVAL;