2011-03-24 12:10:48

by Jeff Chua

[permalink] [raw]
Subject: Commit 9661e92c10a9775243c1ecb73373528ed8725a10: sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/device'



Commit 9661e92c10a9775243c1ecb73373528ed8725a10 causes this bug. Reverting it solves the problem.

Notebook is Lenovo X201s.

Thanks,
Jeff



------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:455 sysfs_add_one+0x8c/0x9e()
Hardware name: 5413FGA
sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/device'
Modules linked in: i915(+) drm_kms_helper
Pid: 2010, comm: modprobe Not tainted 2.6.38 #15
Call Trace:
[<ffffffff81032548>] ? warn_slowpath_common+0x78/0x8c
[<ffffffff810325fb>] ? warn_slowpath_fmt+0x45/0x4a
[<ffffffff810f70bc>] ? sysfs_add_one+0x8c/0x9e
[<ffffffff810f7e21>] ? sysfs_do_create_link+0x100/0x1a7
[<ffffffff8123c054>] ? acpi_video_device_lcd_get_level_current+0x47/0x10e
[<ffffffff8123d076>] ? acpi_video_bus_add+0x961/0xc5b
[<ffffffff810f7798>] ? sysfs_addrm_finish+0x29/0xc2
[<ffffffff81219b7d>] ? acpi_device_probe+0x42/0x10d
[<ffffffff8128a83a>] ? driver_probe_device+0xa8/0x138
[<ffffffff8128a919>] ? __driver_attach+0x4f/0x6f
[<ffffffff8128a8ca>] ? __driver_attach+0x0/0x6f
[<ffffffff8128a0a4>] ? bus_for_each_dev+0x44/0x78
[<ffffffff81289a52>] ? bus_add_driver+0xb9/0x201
[<ffffffff8128ae45>] ? driver_register+0x90/0xf8
[<ffffffff8123c698>] ? acpi_video_register+0x1b/0x34
[<ffffffffa00104e0>] ? i915_driver_load+0xcb9/0xd99 [i915]
[<ffffffff8127a112>] ? drm_get_minor+0x209/0x25b
[<ffffffff8127bb79>] ? drm_get_pci_dev+0x14f/0x259
[<ffffffff811f6ce8>] ? local_pci_probe+0x49/0x93
[<ffffffff811f79ef>] ? pci_device_probe+0xbf/0xec
[<ffffffff8128a6f9>] ? driver_sysfs_add+0x66/0x8d
[<ffffffff8128a83a>] ? driver_probe_device+0xa8/0x138
[<ffffffff8128a919>] ? __driver_attach+0x4f/0x6f
[<ffffffff8128a8ca>] ? __driver_attach+0x0/0x6f
[<ffffffff8128a0a4>] ? bus_for_each_dev+0x44/0x78
[<ffffffff81289a52>] ? bus_add_driver+0xb9/0x201
[<ffffffff8128ae45>] ? driver_register+0x90/0xf8
[<ffffffff811f7c41>] ? __pci_register_driver+0x4e/0xc0
[<ffffffffa0051000>] ? i915_init+0x0/0x8d [i915]
[<ffffffffa0051000>] ? i915_init+0x0/0x8d [i915]
[<ffffffff81000208>] ? do_one_initcall+0x78/0x131
[<ffffffff8105bc32>] ? sys_init_module+0x97/0x1d5
[<ffffffff814b8592>] ? system_call_fastpath+0x16/0x1b
---[ end trace 7ad4522ea6dca630 ]---



commit 9661e92c10a9775243c1ecb73373528ed8725a10
Author: Matthew Garrett <[email protected]>
Date: Tue Mar 22 16:30:25 2011 -0700

acpi: tie ACPI backlight devices to PCI devices if possible

Dual-GPU machines may provide more than one ACPI backlight interface. Tie
the backlight device to the GPU in order to allow userspace to identify
the correct interface.

Signed-off-by: Matthew Garrett <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: Ben Skeggs <[email protected]>
Cc: Zhang Rui <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Jesse Barnes <[email protected]>
Tested-by: Sedat Dilek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index a9eec8c..a18e497 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -782,6 +782,9 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)

if (acpi_video_backlight_support()) {
struct backlight_properties props;
+ struct pci_dev *pdev;
+ acpi_handle acpi_parent;
+ struct device *parent = NULL;
int result;
static int count = 0;
char *name;
@@ -794,10 +797,20 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
return;
count++;

+ acpi_get_parent(device->dev->handle, &acpi_parent);
+
+ pdev = acpi_get_pci_dev(acpi_parent);
+ if (pdev) {
+ parent = &pdev->dev;
+ pci_dev_put(pdev);
+ }
+
memset(&props, 0, sizeof(struct backlight_properties));
props.type = BACKLIGHT_FIRMWARE;
props.max_brightness = device->brightness->count - 3;
- device->backlight = backlight_device_register(name, NULL, device,
+ device->backlight = backlight_device_register(name,
+ parent,
+ device,
&acpi_backlight_ops,
&props);
kfree(name);


2011-03-24 12:15:17

by Alessandro Suardi

[permalink] [raw]
Subject: Re: Commit 9661e92c10a9775243c1ecb73373528ed8725a10: sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/device'

On Thu, Mar 24, 2011 at 1:10 PM, Jeff Chua <[email protected]> wrote:
>
>
> Commit 9661e92c10a9775243c1ecb73373528ed8725a10 causes this bug. Reverting
> it solves the problem.
>
> Notebook is Lenovo X201s.
>
> Thanks,
> Jeff
>
>
>
> ------------[ cut here ]------------
> WARNING: at fs/sysfs/dir.c:455 sysfs_add_one+0x8c/0x9e()
> Hardware name: 5413FGA
> sysfs: cannot create duplicate filename
> '/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/device'
> Modules linked in: i915(+) drm_kms_helper
> Pid: 2010, comm: modprobe Not tainted 2.6.38 #15
> Call Trace:
> [<ffffffff81032548>] ? warn_slowpath_common+0x78/0x8c
> [<ffffffff810325fb>] ? warn_slowpath_fmt+0x45/0x4a
> [<ffffffff810f70bc>] ? sysfs_add_one+0x8c/0x9e
> [<ffffffff810f7e21>] ? sysfs_do_create_link+0x100/0x1a7
> [<ffffffff8123c054>] ? acpi_video_device_lcd_get_level_current+0x47/0x10e
> [<ffffffff8123d076>] ? acpi_video_bus_add+0x961/0xc5b
> [<ffffffff810f7798>] ? sysfs_addrm_finish+0x29/0xc2
> [<ffffffff81219b7d>] ? acpi_device_probe+0x42/0x10d
> [<ffffffff8128a83a>] ? driver_probe_device+0xa8/0x138
> [<ffffffff8128a919>] ? __driver_attach+0x4f/0x6f
> [<ffffffff8128a8ca>] ? __driver_attach+0x0/0x6f
> [<ffffffff8128a0a4>] ? bus_for_each_dev+0x44/0x78
> [<ffffffff81289a52>] ? bus_add_driver+0xb9/0x201
> [<ffffffff8128ae45>] ? driver_register+0x90/0xf8
> [<ffffffff8123c698>] ? acpi_video_register+0x1b/0x34
> [<ffffffffa00104e0>] ? i915_driver_load+0xcb9/0xd99 [i915]
> [<ffffffff8127a112>] ? drm_get_minor+0x209/0x25b
> [<ffffffff8127bb79>] ? drm_get_pci_dev+0x14f/0x259
> [<ffffffff811f6ce8>] ? local_pci_probe+0x49/0x93
> [<ffffffff811f79ef>] ? pci_device_probe+0xbf/0xec
> [<ffffffff8128a6f9>] ? driver_sysfs_add+0x66/0x8d
> [<ffffffff8128a83a>] ? driver_probe_device+0xa8/0x138
> [<ffffffff8128a919>] ? __driver_attach+0x4f/0x6f
> [<ffffffff8128a8ca>] ? __driver_attach+0x0/0x6f
> [<ffffffff8128a0a4>] ? bus_for_each_dev+0x44/0x78
> [<ffffffff81289a52>] ? bus_add_driver+0xb9/0x201
> [<ffffffff8128ae45>] ? driver_register+0x90/0xf8
> [<ffffffff811f7c41>] ? __pci_register_driver+0x4e/0xc0
> [<ffffffffa0051000>] ? i915_init+0x0/0x8d [i915]
> [<ffffffffa0051000>] ? i915_init+0x0/0x8d [i915]
> [<ffffffff81000208>] ? do_one_initcall+0x78/0x131
> [<ffffffff8105bc32>] ? sys_init_module+0x97/0x1d5
> [<ffffffff814b8592>] ? system_call_fastpath+0x16/0x1b
> ---[ end trace 7ad4522ea6dca630 ]---
>
>
>
> commit 9661e92c10a9775243c1ecb73373528ed8725a10
> Author: Matthew Garrett <[email protected]>
> Date: ? Tue Mar 22 16:30:25 2011 -0700
>
> ? ?acpi: tie ACPI backlight devices to PCI devices if possible
>
> ? ?Dual-GPU machines may provide more than one ACPI backlight interface.
> ?Tie
> ? ?the backlight device to the GPU in order to allow userspace to identify
> ? ?the correct interface.
>
> ? ?Signed-off-by: Matthew Garrett <[email protected]>
> ? ?Cc: Richard Purdie <[email protected]>
> ? ?Cc: Chris Wilson <[email protected]>
> ? ?Cc: David Airlie <[email protected]>
> ? ?Cc: Alex Deucher <[email protected]>
> ? ?Cc: Ben Skeggs <[email protected]>
> ? ?Cc: Zhang Rui <[email protected]>
> ? ?Cc: Len Brown <[email protected]>
> ? ?Cc: Jesse Barnes <[email protected]>
> ? ?Tested-by: Sedat Dilek <[email protected]>
> ? ?Signed-off-by: Andrew Morton <[email protected]>
> ? ?Signed-off-by: Linus Torvalds <[email protected]>
>
> diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
> index a9eec8c..a18e497 100644
> --- a/drivers/acpi/video.c
> +++ b/drivers/acpi/video.c
> @@ -782,6 +782,9 @@ static void acpi_video_device_find_cap(struct
> acpi_video_device *device)
>
> ? ? ? ?if (acpi_video_backlight_support()) {
> ? ? ? ? ? ? ? ?struct backlight_properties props;
> + ? ? ? ? ? ? ? struct pci_dev *pdev;
> + ? ? ? ? ? ? ? acpi_handle acpi_parent;
> + ? ? ? ? ? ? ? struct device *parent = NULL;
> ? ? ? ? ? ? ? ?int result;
> ? ? ? ? ? ? ? ?static int count = 0;
> ? ? ? ? ? ? ? ?char *name;
> @@ -794,10 +797,20 @@ static void acpi_video_device_find_cap(struct
> acpi_video_device *device)
> ? ? ? ? ? ? ? ? ? ? ? ?return;
> ? ? ? ? ? ? ? ?count++;
>
> + ? ? ? ? ? ? ? acpi_get_parent(device->dev->handle, &acpi_parent);
> +
> + ? ? ? ? ? ? ? pdev = acpi_get_pci_dev(acpi_parent);
> + ? ? ? ? ? ? ? if (pdev) {
> + ? ? ? ? ? ? ? ? ? ? ? parent = &pdev->dev;
> + ? ? ? ? ? ? ? ? ? ? ? pci_dev_put(pdev);
> + ? ? ? ? ? ? ? }
> +
> ? ? ? ? ? ? ? ?memset(&props, 0, sizeof(struct backlight_properties));
> ? ? ? ? ? ? ? ?props.type = BACKLIGHT_FIRMWARE;
> ? ? ? ? ? ? ? ?props.max_brightness = device->brightness->count - 3;
> - ? ? ? ? ? ? ? device->backlight = backlight_device_register(name, NULL,
> device,
> + ? ? ? ? ? ? ? device->backlight = backlight_device_register(name,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? parent,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? device,
>
> ?&acpi_backlight_ops,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?&props);
> ? ? ? ? ? ? ? ?kfree(name);

Same in -git14 for my E6400 with a GM45 integrated chipset. Mine though has
always printed out the following warning

[Firmware Bug]: Duplicate ACPI video bus devices for the same VGA
controller, please try module parameter "video.allow_duplicates=1"if
the current driver doesn't work.

which seems to have been previously discussed here

https://lkml.org/lkml/2011/3/4/1

--alessandro

?"There's always a siren singing you to shipwreck"

?? (Radiohead, "There There")

2011-03-24 12:24:27

by Matthew Garrett

[permalink] [raw]
Subject: Re: Commit 9661e92c10a9775243c1ecb73373528ed8725a10: sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/device'

Odd, this shouldn't register anything that wasn't previously registered.
Can you attach the output of acpidump, dmesg and lspci?

--
Matthew Garrett | [email protected]

2011-03-24 12:40:09

by Jeff Chua

[permalink] [raw]
Subject: Re: Commit 9661e92c10a9775243c1ecb73373528ed8725a10: sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/device'

On Thu, Mar 24, 2011 at 8:24 PM, Matthew Garrett <[email protected]> wrote:
> Odd, this shouldn't register anything that wasn't previously registered.
> Can you attach the output of acpidump, dmesg and lspci?

All files attached.

# git log
commit 4bbba111d94781d34081c37856bbc5eb33f6c72a
Merge: 2130781 ce24f58
Author: Linus Torvalds <[email protected]>
Date: Wed Mar 23 07:58:09 2011 -0700

# gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/usr --enable-shared
--disable-static --with-local-prefix=/usr
--with-gxx-include-dir=/usr/include/g++ --with-system-zlib
--enable-multilib
Thread model: posix
gcc version 4.4.6 20110314 (prerelease) (GCC)

# glibc
GNU C Library stable release version 2.13, by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.4.6 20110314 (prerelease).
Compiled on a Linux 2.6.38 system on 2011-03-14.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.


Thanks,
Jeff


Attachments:
dmesg (33.09 kB)
lspci (2.03 kB)
lspci.vv (20.82 kB)
acpidump (296.05 kB)
Xorg.0.log (18.84 kB)
Download all attachments

2011-03-28 12:47:49

by Alessandro Suardi

[permalink] [raw]
Subject: Re: Commit 9661e92c10a9775243c1ecb73373528ed8725a10: sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/device'

On Thu, Mar 24, 2011 at 1:40 PM, Jeff Chua <[email protected]> wrote:
> On Thu, Mar 24, 2011 at 8:24 PM, Matthew Garrett <[email protected]> wrote:
>> Odd, this shouldn't register anything that wasn't previously registered.
>> Can you attach the output of acpidump, dmesg and lspci?
>
> All files attached.
>
> # git log
> commit 4bbba111d94781d34081c37856bbc5eb33f6c72a
> Merge: 2130781 ce24f58
> Author: Linus Torvalds <[email protected]>
> Date: ? Wed Mar 23 07:58:09 2011 -0700
>
> # gcc -v
> Using built-in specs.
> Target: x86_64-unknown-linux-gnu
> Configured with: ../configure --prefix=/usr --enable-shared
> --disable-static --with-local-prefix=/usr
> --with-gxx-include-dir=/usr/include/g++ --with-system-zlib
> --enable-multilib
> Thread model: posix
> gcc version 4.4.6 20110314 (prerelease) (GCC)
>
> # glibc
> GNU C Library stable release version 2.13, by Roland McGrath et al.
> Copyright (C) 2011 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.
> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
> PARTICULAR PURPOSE.
> Compiled by GNU CC version 4.4.6 20110314 (prerelease).
> Compiled on a Linux 2.6.38 system on 2011-03-14.
> Available extensions:
> ? ? ? ?crypt add-on version 2.1 by Michael Glad and others
> ? ? ? ?Native POSIX Threads Library by Ulrich Drepper et al
> ? ? ? ?BIND-8.2.3-T5B
> libc ABIs: UNIQUE IFUNC
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/libc/bugs.html>.
>
>
> Thanks,
> Jeff
>

Hi all,

did this go anywhere ?

I'm attaching the output for my Dell E6400 which suffers the same issue,
under 2.6.38-git18 + Chris Wilson's LVDS detection patch.

Thanks,

--alessandro

?"There's always a siren singing you to shipwreck"

?? (Radiohead, "There There")


Attachments:
acpidump-2638git18.out (137.34 kB)
dmesg-2638git18.out (51.88 kB)
lspci.vv.out (28.50 kB)
Xorg.0.log-2638git18 (116.65 kB)
Download all attachments

2011-03-28 15:22:44

by Linus Torvalds

[permalink] [raw]
Subject: Re: Commit 9661e92c10a9775243c1ecb73373528ed8725a10: sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/device'

On Mon, Mar 28, 2011 at 5:53 AM, Matthew Garrett <[email protected]> wrote:
>
> I just sent a patch to fix this.

Grr. Any more details, please? Who to? What's the fix? Actual patch
for reporters to validate?

Linus

2011-03-28 16:03:06

by Matthew Garrett

[permalink] [raw]
Subject: Re: Commit 9661e92c10a9775243c1ecb73373528ed8725a10: sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/device'

On Mon, Mar 28, 2011 at 08:22:05AM -0700, Linus Torvalds wrote:
> On Mon, Mar 28, 2011 at 5:53 AM, Matthew Garrett <[email protected]> wrote:
> >
> > I just sent a patch to fix this.
>
> Grr. Any more details, please? Who to? What's the fix? Actual patch
> for reporters to validate?

Sorry, yes - https://patchwork.kernel.org/patch/668351/

--
Matthew Garrett | [email protected]

2011-03-28 17:25:45

by Alessandro Suardi

[permalink] [raw]
Subject: Re: Commit 9661e92c10a9775243c1ecb73373528ed8725a10: sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/device'

On Mon, Mar 28, 2011 at 6:02 PM, Matthew Garrett <[email protected]> wrote:
> On Mon, Mar 28, 2011 at 08:22:05AM -0700, Linus Torvalds wrote:
>> On Mon, Mar 28, 2011 at 5:53 AM, Matthew Garrett <[email protected]> wrote:
>> >
>> > I just sent a patch to fix this.
>>
>> Grr. Any more details, please? Who to? What's the fix? Actual patch
>> for reporters to validate?
>
> Sorry, yes - https://patchwork.kernel.org/patch/668351/

Works on top of my -git18 + (unrelated) LVDS detection patch, thanks.

Tested-by: Alessandro Suardi <[email protected]>

--alessandro

?"There's always a siren singing you to shipwreck"

?? (Radiohead, "There There")

2011-03-28 17:48:52

by Linus Torvalds

[permalink] [raw]
Subject: Re: Commit 9661e92c10a9775243c1ecb73373528ed8725a10: sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/device'

On Mon, Mar 28, 2011 at 10:25 AM, Alessandro Suardi
<[email protected]> wrote:
>>
>> Sorry, yes - https://patchwork.kernel.org/patch/668351/
>
> Works on top of my -git18 + (unrelated) LVDS detection patch, thanks.
>
> Tested-by: Alessandro Suardi <[email protected]>

Ok, which tree should this go through? I see from patchworks that it
was sent to linux-acpi and lkml, but the commit it fixes actually came
through Andrew.

Should I just take it directly?

Linus

2011-03-28 20:00:35

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: Commit 9661e92c10a9775243c1ecb73373528ed8725a10: sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/device'

On Monday, March 28, 2011, Linus Torvalds wrote:
> On Mon, Mar 28, 2011 at 10:25 AM, Alessandro Suardi
> <[email protected]> wrote:
> >>
> >> Sorry, yes - https://patchwork.kernel.org/patch/668351/
> >
> > Works on top of my -git18 + (unrelated) LVDS detection patch, thanks.
> >
> > Tested-by: Alessandro Suardi <[email protected]>
>
> Ok, which tree should this go through? I see from patchworks that it
> was sent to linux-acpi and lkml, but the commit it fixes actually came
> through Andrew.
>
> Should I just take it directly?

Formally, it's an ACPI patch, but I guess Len wouldn't mind if you took it.
I've just acked it FWIW.

Rafael