alistair23-linux/drivers/pci
Simone Gotti dcfa9be838 ACPI / PCI: Fix sysfs acpi_index and label errors
Fix errors in handling "device label" _DSM return values.

If _DSM returns a Unicode string, the ACPI type is ACPI_TYPE_BUFFER, not
ACPI_TYPE_STRING.  Fix dsm_label_utf16s_to_utf8s() to convert UTF-16 from
acpi_object->buffer instead of acpi_object->string.

Prior to v3.14, we accepted Unicode labels (ACPI_TYPE_BUFFER return
values).  But after 1d0fcef732, we accepted only ASCII (ACPI_TYPE_STRING)
(and we incorrectly tried to convert those ASCII labels from UTF-16 to
UTF-8).

Rejecting Unicode labels made us return -EPERM when reading sysfs
"acpi_index" or "label" files, which in turn caused on-board network
interfaces on a Dell PowerEdge E420 to be renamed (by udev net_id internal)
from eno1/eno2 to enp2s0f0/enp2s0f1.

Fix this by accepting either ACPI_TYPE_STRING (and treating it as ASCII) or
ACPI_TYPE_BUFFER (and converting from UTF-16 to UTF-8).

[bhelgaas: changelog]
Fixes: 1d0fcef732 ("ACPI / PCI: replace open-coded _DSM code with helper functions")
Signed-off-by: Simone Gotti <simone.gotti@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Jiang Liu <jiang.liu@linux.intel.com>
CC: stable@vger.kernel.org	# v3.14+
2014-07-02 15:27:08 -06:00
..
host PCI: Merge multi-line quoted strings 2014-06-10 20:20:42 -06:00
hotplug PCI changes for the v3.16 merge window (part 2): 2014-06-12 13:20:24 -07:00
pcie PCI/portdrv: Remove warning about invalid IRQ for hot-added PCIe ports 2014-07-02 15:14:34 -06:00
access.c PCI: Merge multi-line quoted strings 2014-06-10 20:20:42 -06:00
ats.c PCI: Removed unused parts of Page Request Interface support 2014-01-10 14:00:47 -07:00
bus.c PCI: Move EXPORT_SYMBOL so it immediately follows function/variable 2014-06-10 13:36:10 -06:00
host-bridge.c PCI: Remove unnecessary includes of <linux/init.h> 2014-04-14 16:12:37 -06:00
hotplug-pci.c PCI: Remove unnecessary __ref annotations 2014-04-29 17:36:44 -06:00
htirq.c PCI changes for the v3.16 merge window (part 2): 2014-06-12 13:20:24 -07:00
ioapic.c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
iov.c PCI: Make pci_bus_add_device() void 2014-05-30 09:34:27 -06:00
irq.c PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
Kconfig PCI: Convert ioapic to be builtin only, not modular 2014-01-03 14:31:38 -07:00
Makefile Merge branch 'x86-nuke-platforms-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-04-02 13:15:58 -07:00
msi.c Merge branches 'pci/msi', 'pci/iommu' and 'pci/cleanup' into next 2014-06-11 14:38:25 -06:00
of.c
pci-acpi.c PCI: Use pci_is_bridge() to simplify code 2014-05-27 14:53:41 -06:00
pci-driver.c PCI: Whitespace cleanup 2014-06-10 20:20:19 -06:00
pci-label.c ACPI / PCI: Fix sysfs acpi_index and label errors 2014-07-02 15:27:08 -06:00
pci-stub.c PCI: Whitespace cleanup 2014-06-10 20:20:19 -06:00
pci-sysfs.c PCI: Merge multi-line quoted strings 2014-06-10 20:20:42 -06:00
pci.c PCI changes for the v3.16 merge window (part 2): 2014-06-12 13:20:24 -07:00
pci.h Merge branches 'pci/hotplug', 'pci/pci_is_bridge' and 'pci/virtualization' into next 2014-05-28 16:21:07 -06:00
probe.c PCI: Merge multi-line quoted strings 2014-06-10 20:20:42 -06:00
proc.c PCI: Whitespace cleanup 2014-06-10 20:20:19 -06:00
quirks.c Merge branches 'pci/msi', 'pci/iommu' and 'pci/cleanup' into next 2014-06-11 14:38:25 -06:00
remove.c Revert "PCI: Remove from bus_list and release resources in pci_release_dev()" 2014-02-01 10:24:31 -08:00
rom.c PCI: Whitespace cleanup 2014-06-10 20:20:19 -06:00
search.c PCI: Whitespace cleanup 2014-06-10 20:20:19 -06:00
setup-bus.c PCI: Merge multi-line quoted strings 2014-06-10 20:20:42 -06:00
setup-irq.c PCI: Whitespace cleanup 2014-06-10 20:20:19 -06:00
setup-res.c PCI: Merge multi-line quoted strings 2014-06-10 20:20:42 -06:00
slot.c VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms. 2014-03-24 12:21:00 +10:30
syscall.c PCI: Whitespace cleanup 2014-06-10 20:20:19 -06:00
vc.c PCI: Rename PCI_VC_PORT_REG1/2 to PCI_VC_PORT_CAP1/2 2013-12-17 17:49:39 -07:00
vpd.c
xen-pcifront.c arch: Mass conversion of smp_mb__*() 2014-04-18 14:20:48 +02:00