* Re: [PATCH] arch/sh: fix Ethernet clock for SH7786
2017-12-04 14:30 [PATCH] arch/sh: fix Ethernet clock for SH7786 Thomas Petazzoni
@ 2017-12-04 14:58 ` Geert Uytterhoeven
2017-12-04 15:23 ` Thomas Petazzoni
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2017-12-04 14:58 UTC (permalink / raw)
To: linux-sh
Hi Thomas,
On Mon, Dec 4, 2017 at 3:30 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> The sh_eth driver (used for the Ethernet controller on SH7786) uses
> devm_clk_get(&pdev->dev, NULL) to get its clock. It means that con_id
> = NULL, and therefore a clock lookup made on the con_id doesn't work.
>
> In order to make sure that the sh_eth driver is able to find its clock
> on SH7786, we switch from using a con_id to a dev_id in the clock
> lookup table for this SoC.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
The clock is optional, right? Do you need it? It's "needed" for WoL only,
but that dependency is planned to be removed, cfr. "sh_eth: Remove obsolete
explicit clock handling for WoL".
Regardless:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] arch/sh: fix Ethernet clock for SH7786
2017-12-04 14:30 [PATCH] arch/sh: fix Ethernet clock for SH7786 Thomas Petazzoni
2017-12-04 14:58 ` Geert Uytterhoeven
@ 2017-12-04 15:23 ` Thomas Petazzoni
2017-12-04 15:31 ` Geert Uytterhoeven
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2017-12-04 15:23 UTC (permalink / raw)
To: linux-sh
Hello,
On Mon, 4 Dec 2017 15:58:42 +0100, Geert Uytterhoeven wrote:
> The clock is optional, right? Do you need it? It's "needed" for WoL only,
> but that dependency is planned to be removed, cfr. "sh_eth: Remove obsolete
> explicit clock handling for WoL".
Hm, that's a good point what you raise here. Indeed looking at the
code, the clock isn't enabled unless you go in suspend() and WoL
support is enabled. I don't go into suspend, and I don't have WoL
enabled, but if I revert my patch, the kernel hangs at:
Generic PHY sh7786-ether-0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=sh7786-ether-0:00, irq=POLL)
Waiting up to 110 more seconds for network.
(I booting over NFS, so the kernel tries to get an IP address over DHCP
at boot time)
With my patch applied:
Generic PHY sh7786-ether-0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=sh7786-ether-0:00, irq=POLL)
sh-eth sh7786-ether.0 eth0: Link is Up - 100Mbps/Full - flow control rx/tx
Sending DHCP requests ., OK
IP-Config: Got DHCP answer from 192.168.0.254, my address is 192.168.0.202
IP-Config: Complete:
device=eth0, hwaddrÔ:81:d7:45:df:5a, ipaddr\x192.168.0.202, mask%5.255.255.0, gw\x192.168.0.254
host\x192.168.0.202, domain=lan, nis-domain=(none)
bootserver\x192.168.0.254, rootserver\x192.168.0.11, rootpath= nameserver0\x192.168.0.254
VFS: Mounted root (nfs filesystem) on device 0:13.
devtmpfs: mounted
Freeing unused kernel memory: 132K
So it seems like getting the reference to the clock has some
side-effect. I guess this needs more debugging :-)
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] arch/sh: fix Ethernet clock for SH7786
2017-12-04 14:30 [PATCH] arch/sh: fix Ethernet clock for SH7786 Thomas Petazzoni
2017-12-04 14:58 ` Geert Uytterhoeven
2017-12-04 15:23 ` Thomas Petazzoni
@ 2017-12-04 15:31 ` Geert Uytterhoeven
2018-01-09 14:57 ` Thomas Petazzoni
2018-02-26 13:50 ` Thomas Petazzoni
4 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2017-12-04 15:31 UTC (permalink / raw)
To: linux-sh
Hi Thomas,
On Mon, Dec 4, 2017 at 4:23 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> On Mon, 4 Dec 2017 15:58:42 +0100, Geert Uytterhoeven wrote:
>> The clock is optional, right? Do you need it? It's "needed" for WoL only,
>> but that dependency is planned to be removed, cfr. "sh_eth: Remove obsolete
>> explicit clock handling for WoL".
>
> Hm, that's a good point what you raise here. Indeed looking at the
> code, the clock isn't enabled unless you go in suspend() and WoL
> support is enabled. I don't go into suspend, and I don't have WoL
> enabled, but if I revert my patch, the kernel hangs at:
>
> Generic PHY sh7786-ether-0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=sh7786-ether-0:00, irq=POLL)
> Waiting up to 110 more seconds for network.
>
> (I booting over NFS, so the kernel tries to get an IP address over DHCP
> at boot time)
>
> With my patch applied:
>
> Generic PHY sh7786-ether-0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=sh7786-ether-0:00, irq=POLL)
> sh-eth sh7786-ether.0 eth0: Link is Up - 100Mbps/Full - flow control rx/tx
> Sending DHCP requests ., OK
> IP-Config: Got DHCP answer from 192.168.0.254, my address is 192.168.0.202
> IP-Config: Complete:
> device=eth0, hwaddrÔ:81:d7:45:df:5a, ipaddr\x192.168.0.202, mask%5.255.255.0, gw\x192.168.0.254
> host\x192.168.0.202, domain=lan, nis-domain=(none)
> bootserver\x192.168.0.254, rootserver\x192.168.0.11, rootpath= nameserver0\x192.168.0.254
> VFS: Mounted root (nfs filesystem) on device 0:13.
> devtmpfs: mounted
> Freeing unused kernel memory: 132K
>
> So it seems like getting the reference to the clock has some
> side-effect. I guess this needs more debugging :-)
Ah, it makes sure the legacy clock domain code in drivers/sh/pm_runtime.c
finds the clock, and enables it when pm_runtime_get_sync() is called.
So yes, you do need the patch ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] arch/sh: fix Ethernet clock for SH7786
2017-12-04 14:30 [PATCH] arch/sh: fix Ethernet clock for SH7786 Thomas Petazzoni
` (2 preceding siblings ...)
2017-12-04 15:31 ` Geert Uytterhoeven
@ 2018-01-09 14:57 ` Thomas Petazzoni
2018-02-26 13:50 ` Thomas Petazzoni
4 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2018-01-09 14:57 UTC (permalink / raw)
To: linux-sh
Hello,
On Mon, 4 Dec 2017 15:30:49 +0100, Thomas Petazzoni wrote:
> The sh_eth driver (used for the Ethernet controller on SH7786) uses
> devm_clk_get(&pdev->dev, NULL) to get its clock. It means that con_id
> = NULL, and therefore a clock lookup made on the con_id doesn't work.
>
> In order to make sure that the sh_eth driver is able to find its clock
> on SH7786, we switch from using a con_id to a dev_id in the clock
> lookup table for this SoC.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Is it possible to get this patch merged? It has a Reviewed-by from
Geert.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] arch/sh: fix Ethernet clock for SH7786
2017-12-04 14:30 [PATCH] arch/sh: fix Ethernet clock for SH7786 Thomas Petazzoni
` (3 preceding siblings ...)
2018-01-09 14:57 ` Thomas Petazzoni
@ 2018-02-26 13:50 ` Thomas Petazzoni
4 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2018-02-26 13:50 UTC (permalink / raw)
To: linux-sh
Hello,
On Mon, 4 Dec 2017 15:30:49 +0100, Thomas Petazzoni wrote:
> The sh_eth driver (used for the Ethernet controller on SH7786) uses
> devm_clk_get(&pdev->dev, NULL) to get its clock. It means that con_id
> = NULL, and therefore a clock lookup made on the con_id doesn't work.
>
> In order to make sure that the sh_eth driver is able to find its clock
> on SH7786, we switch from using a con_id to a dev_id in the clock
> lookup table for this SoC.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Here as well: patch sent almost 3 months ago, it has a Reviewed-by from
Geert.
Is it possible to apply this patch ?
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
^ permalink raw reply [flat|nested] 6+ messages in thread