linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] ACPI / PCI:  Fix "Operation not permitted" error reading sysfs acpi_index and label files.
@ 2014-06-18 14:51 Simone Gotti
  2014-06-18 14:55 ` [PATCH 1/1] " Simone Gotti
  0 siblings, 1 reply; 4+ messages in thread
From: Simone Gotti @ 2014-06-18 14:51 UTC (permalink / raw)
  To: linux-pci; +Cc: linux-acpi, Jiang Liu, Narendra_K

Hi everyone,

starting from kernel 3.14 I noticed that the on board interfaces names on a Dell
PowerEdge E420 where renamed (by udev net_id internal) from eno1/eno2 to
enp2s0f0/enp2s0f1.

The root cause is that reading from the exported sysfs informations (acpi_index
and label) from drivers/pci/pci-label.c returns an "Operation not permitted"
error.

This machine supports PCI firmware specification 3.1 so the acpi methods are
preferred over the smbios one.

Debugging the problem I noticed that the call to the _DSM method returned the
second element with ACPI_TYPE_BUFFER type instead of ACPI_TYPE_STRING as
expected. The commit that forced this check is:

commit 1d0fcef732832432aee47cb75bf4a2cb3107be64 Author: Jiang Liu
<jiang.liu@linux.intel.com> Date:   Thu Dec 19 20:38:13 2013 +0800

    ACPI / PCI: replace open-coded _DSM code with helper functions

Previously the elements' types weren't checked and an ACPI_TYPE_BUFFER for the
second element was accepted.

The disassembled _DSM acpi method uses the ASL Unicode() macro that returns an
unicode string contained in a buffer.

Additionaly I noticed that an ascii string (as it should be the one of type
ACPI_TYPE_STRING) will be wrongly converted to utf8 from
dsm_label_utf16s_to_utf8s as it expects an utf16 string (I reproduced this
problem with a modified DSDT that returned an acpi string as label).

I don't have the PCI firmware specification so I don't know if an Unicode string
is correct or the bios is not compliant but I'm assuming this is possible. If
so, the following patch tries to fix this.


Thanks a lot.


Simone Gotti (1):
  Fix "Operation not permitted" error reading sysfs acpi_index and label
    files.

 drivers/pci/pci-label.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

-- 
2.0.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-02 22:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-18 14:51 [PATCH 0/1] ACPI / PCI: Fix "Operation not permitted" error reading sysfs acpi_index and label files Simone Gotti
2014-06-18 14:55 ` [PATCH 1/1] " Simone Gotti
2014-06-18 16:22   ` Jiang Liu
2014-07-02 22:19   ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).