Patchwork fhc led registration warnings

login
register
mail settings
Submitter David Miller
Date Jan. 19, 2009, 6:41 a.m.
Message ID <20090118.224148.24684099.davem@davemloft.net>
Download mbox | patch
Permalink /patch/19251/
State Accepted
Delegated to: David Miller
Headers show

Comments

David Miller - Jan. 19, 2009, 6:41 a.m.
From: Meelis Roos <mroos@linux.ee>
Date: Fri, 16 Jan 2009 13:02:33 +0200 (EET)

> While booting todays 2.6.29-rc1+git on E3500, these warning about FHC 
> LEDs sysfs registration appeared in the logs. I sent the previous mail 
> away and decided to send this one separately, but now I see that the 
> location of platform-specific device registrations js the same where CPU 
> detection problem were, so maybe they are related afterall.
> 
> [  136.437166] WARNING: at fs/sysfs/dir.c:462 sysfs_add_one+0x44/0x60()
> [  136.437226] sysfs: duplicate filename 'sunfire-fhc-leds.0' can not be created

Does this patch fix the problem?

sparc64: Initialize FHC/CLOCK LED platform_device 'id' field correctly.

There is only one clock board, so use -1 as the 'id' so we get just
the base name as the LED device name string.

There are multiple FHC boards potentially in a system so use the board
number as the 'id' value for that case.

Based upon a bug report from Meelis Roos.

Signed-off-by: David S. Miller <davem@davemloft.net>

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Meelis Roos - Jan. 19, 2009, 7:49 a.m.
> Does this patch fix the problem?
> 
> sparc64: Initialize FHC/CLOCK LED platform_device 'id' field correctly.

Yes, than you very much!

[  135.931836] fhc: Board #1, Version[1] PartID[fa0] Manuf[3e] (Central)
[  135.932612] fhc: Board #3, Version[1] PartID[fa0] Manuf[3e] (JTAG Master)
[  135.933390] fhc: Board #1, Version[1] PartID[fa0] Manuf[3e]
[  135.934172] fhc: Board #7, Version[1] PartID[fa0] Manuf[3e]
[  135.935570] clock_board: Detected 5 slot Enterprise system.

$ ls -l /sys/bus/platform/devices/
total 0
lrwxrwxrwx 1 root root 0 2009-01-19 09:04 rtc-m48t59.0 -> ../../../devices/platform/rtc-m48t59.0
lrwxrwxrwx 1 root root 0 2009-01-19 09:04 sunfire-clockboard- -> ../../../devices/root/f005da70/f005db8c/f005e05c/sunfire-clockboard-
lrwxrwxrwx 1 root root 0 2009-01-19 09:04 sunfire-fhc-leds.1 -> ../../../devices/root/f0071c1c/sunfire-fhc-leds.1
lrwxrwxrwx 1 root root 0 2009-01-19 09:04 sunfire-fhc-leds.3 -> ../../../devices/root/f00df7bc/sunfire-fhc-leds.3
lrwxrwxrwx 1 root root 0 2009-01-19 09:04 sunfire-fhc-leds.7 -> ../../../devices/root/f01c923c/sunfire-fhc-leds.7


With Sams 2 patches and this path, my E3500 seems to work fine again.
David Miller - Jan. 19, 2009, 9:26 p.m.
From: Meelis Roos <mroos@linux.ee>
Date: Mon, 19 Jan 2009 09:49:54 +0200 (EET)

> > Does this patch fix the problem?
> > 
> > sparc64: Initialize FHC/CLOCK LED platform_device 'id' field correctly.
> 
> Yes, than you very much!
> 
> [  135.931836] fhc: Board #1, Version[1] PartID[fa0] Manuf[3e] (Central)
> [  135.932612] fhc: Board #3, Version[1] PartID[fa0] Manuf[3e] (JTAG Master)
> [  135.933390] fhc: Board #1, Version[1] PartID[fa0] Manuf[3e]
> [  135.934172] fhc: Board #7, Version[1] PartID[fa0] Manuf[3e]
> [  135.935570] clock_board: Detected 5 slot Enterprise system.
 ...
> With Sams 2 patches and this path, my E3500 seems to work fine again.

Thank you for testing.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c
index 05f1c91..f3b5466 100644
--- a/arch/sparc/kernel/central.c
+++ b/arch/sparc/kernel/central.c
@@ -103,6 +103,7 @@  static int __devinit clock_board_probe(struct of_device *op,
 	p->leds_resource.name = "leds";
 
 	p->leds_pdev.name = "sunfire-clockboard-leds";
+	p->leds_pdev.id = -1;
 	p->leds_pdev.resource = &p->leds_resource;
 	p->leds_pdev.num_resources = 1;
 	p->leds_pdev.dev.parent = &op->dev;
@@ -197,6 +198,7 @@  static int __devinit fhc_probe(struct of_device *op,
 		p->leds_resource.name = "leds";
 
 		p->leds_pdev.name = "sunfire-fhc-leds";
+		p->leds_pdev.id = p->board_num;
 		p->leds_pdev.resource = &p->leds_resource;
 		p->leds_pdev.num_resources = 1;
 		p->leds_pdev.dev.parent = &op->dev;