diff mbox series

[v2] net: bcmgenet: Fix attaching to PYH failed on RPi 4B

Message ID 20210623032802.3377-1-jhp@endlessos.org (mailing list archive)
State Accepted
Commit b2ac9800cfe0f8da16abc4e74e003440361c112e
Delegated to: Netdev Maintainers
Headers show
Series [v2] net: bcmgenet: Fix attaching to PYH failed on RPi 4B | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers warning 2 maintainers not CCed: davem@davemloft.net kuba@kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 4 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Jian-Hong Pan June 23, 2021, 3:28 a.m. UTC
The Broadcom UniMAC MDIO bus from mdio-bcm-unimac module comes too late.
So, GENET cannot find the ethernet PHY on UniMAC MDIO bus. This leads
GENET fail to attach the PHY as following log:

bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000
...
could not attach to PHY
bcmgenet fd580000.ethernet eth0: failed to connect to PHY
uart-pl011 fe201000.serial: no DMA platform data
libphy: bcmgenet MII bus: probed
...
unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus

This patch adds the soft dependency to load mdio-bcm-unimac module
before genet module to avoid the issue.

Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=213485
Signed-off-by: Jian-Hong Pan <jhp@endlessos.org>
---
v2: Load mdio-bcm-unimac before genet module instead of trying to
    connect the PHY in a loop.

 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Florian Fainelli June 23, 2021, 4 a.m. UTC | #1
The subject should be fixed s/PYH/PHY/ and also probably reworded to be:

net: bcmgenet: Add mdio-bcm-unimac soft dependency

On 6/22/2021 8:28 PM, Jian-Hong Pan wrote:
> The Broadcom UniMAC MDIO bus from mdio-bcm-unimac module comes too late.

It is not just coming too late, there is also no way for the module 
loader to figure out the dependency between GENET and its MDIO bus 
driver unless we provide this MODULE_SOFTDEP hint.

> So, GENET cannot find the ethernet PHY on UniMAC MDIO bus. This leads
> GENET fail to attach the PHY as following log:
> 
> bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000
> ...
> could not attach to PHY
> bcmgenet fd580000.ethernet eth0: failed to connect to PHY
> uart-pl011 fe201000.serial: no DMA platform data
> libphy: bcmgenet MII bus: probed
> ...
> unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus
> 
> This patch adds the soft dependency to load mdio-bcm-unimac module
> before genet module to avoid the issue.
> 
> Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=213485
> Signed-off-by: Jian-Hong Pan <jhp@endlessos.org>

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Fixes: 9a4e79697009 ("net: bcmgenet: utilize generic Broadcom UniMAC 
MDIO controller driver")

> ---
> v2: Load mdio-bcm-unimac before genet module instead of trying to
>      connect the PHY in a loop.
> 
>   drivers/net/ethernet/broadcom/genet/bcmgenet.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index fcca023f22e5..41f7f078cd27 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> @@ -4296,3 +4296,4 @@ MODULE_AUTHOR("Broadcom Corporation");
>   MODULE_DESCRIPTION("Broadcom GENET Ethernet controller driver");
>   MODULE_ALIAS("platform:bcmgenet");
>   MODULE_LICENSE("GPL");
> +MODULE_SOFTDEP("pre: mdio-bcm-unimac");
>
patchwork-bot+netdevbpf@kernel.org June 23, 2021, 8:50 p.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Wed, 23 Jun 2021 11:28:03 +0800 you wrote:
> The Broadcom UniMAC MDIO bus from mdio-bcm-unimac module comes too late.
> So, GENET cannot find the ethernet PHY on UniMAC MDIO bus. This leads
> GENET fail to attach the PHY as following log:
> 
> bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000
> ...
> could not attach to PHY
> bcmgenet fd580000.ethernet eth0: failed to connect to PHY
> uart-pl011 fe201000.serial: no DMA platform data
> libphy: bcmgenet MII bus: probed
> ...
> unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus
> 
> [...]

Here is the summary with links:
  - [v2] net: bcmgenet: Fix attaching to PYH failed on RPi 4B
    https://git.kernel.org/netdev/net/c/b2ac9800cfe0

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Florian Fainelli June 23, 2021, 9:19 p.m. UTC | #3
On 6/23/21 1:50 PM, patchwork-bot+netdevbpf@kernel.org wrote:
> Hello:
> 
> This patch was applied to netdev/net.git (refs/heads/master):
> 
> On Wed, 23 Jun 2021 11:28:03 +0800 you wrote:
>> The Broadcom UniMAC MDIO bus from mdio-bcm-unimac module comes too late.
>> So, GENET cannot find the ethernet PHY on UniMAC MDIO bus. This leads
>> GENET fail to attach the PHY as following log:
>>
>> bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000
>> ...
>> could not attach to PHY
>> bcmgenet fd580000.ethernet eth0: failed to connect to PHY
>> uart-pl011 fe201000.serial: no DMA platform data
>> libphy: bcmgenet MII bus: probed
>> ...
>> unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus
>>
>> [...]
> 
> Here is the summary with links:
>   - [v2] net: bcmgenet: Fix attaching to PYH failed on RPi 4B
>     https://git.kernel.org/netdev/net/c/b2ac9800cfe0

There was feedback given that could have deserved a v3, if nothing else
to fix the typo in the subject, I suppose that would do though.
Jian-Hong Pan June 24, 2021, 2:47 a.m. UTC | #4
Florian Fainelli <f.fainelli@gmail.com> 於 2021年6月24日 週四 上午5:19寫道:
>
> On 6/23/21 1:50 PM, patchwork-bot+netdevbpf@kernel.org wrote:
> > Hello:
> >
> > This patch was applied to netdev/net.git (refs/heads/master):
> >
> > On Wed, 23 Jun 2021 11:28:03 +0800 you wrote:
> >> The Broadcom UniMAC MDIO bus from mdio-bcm-unimac module comes too late.
> >> So, GENET cannot find the ethernet PHY on UniMAC MDIO bus. This leads
> >> GENET fail to attach the PHY as following log:
> >>
> >> bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000
> >> ...
> >> could not attach to PHY
> >> bcmgenet fd580000.ethernet eth0: failed to connect to PHY
> >> uart-pl011 fe201000.serial: no DMA platform data
> >> libphy: bcmgenet MII bus: probed
> >> ...
> >> unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus
> >>
> >> [...]
> >
> > Here is the summary with links:
> >   - [v2] net: bcmgenet: Fix attaching to PYH failed on RPi 4B
> >     https://git.kernel.org/netdev/net/c/b2ac9800cfe0

This bot is interesting!!!  Good feature! :)

> There was feedback given that could have deserved a v3, if nothing else
> to fix the typo in the subject, I suppose that would do though.

I can prepare the v3 patch with Florian's suggestion!

Jian-Hong Pan
Florian Fainelli June 24, 2021, 3:27 a.m. UTC | #5
On 6/23/2021 7:47 PM, Jian-Hong Pan wrote:
> Florian Fainelli <f.fainelli@gmail.com> 於 2021年6月24日 週四 上午5:19寫道:
>>
>> On 6/23/21 1:50 PM, patchwork-bot+netdevbpf@kernel.org wrote:
>>> Hello:
>>>
>>> This patch was applied to netdev/net.git (refs/heads/master):
>>>
>>> On Wed, 23 Jun 2021 11:28:03 +0800 you wrote:
>>>> The Broadcom UniMAC MDIO bus from mdio-bcm-unimac module comes too late.
>>>> So, GENET cannot find the ethernet PHY on UniMAC MDIO bus. This leads
>>>> GENET fail to attach the PHY as following log:
>>>>
>>>> bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000
>>>> ...
>>>> could not attach to PHY
>>>> bcmgenet fd580000.ethernet eth0: failed to connect to PHY
>>>> uart-pl011 fe201000.serial: no DMA platform data
>>>> libphy: bcmgenet MII bus: probed
>>>> ...
>>>> unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus
>>>>
>>>> [...]
>>>
>>> Here is the summary with links:
>>>    - [v2] net: bcmgenet: Fix attaching to PYH failed on RPi 4B
>>>      https://git.kernel.org/netdev/net/c/b2ac9800cfe0
> 
> This bot is interesting!!!  Good feature! :)
> 
>> There was feedback given that could have deserved a v3, if nothing else
>> to fix the typo in the subject, I suppose that would do though.
> 
> I can prepare the v3 patch with Florian's suggestion!

Too late, once it's merged only fixups can be accepted, and that does 
not include commit messages, it's alright.
Jian-Hong Pan June 24, 2021, 3:28 a.m. UTC | #6
Ok, thanks!

Florian Fainelli <f.fainelli@gmail.com> 於 2021年6月24日 週四 上午11:27寫道:
>
>
>
> On 6/23/2021 7:47 PM, Jian-Hong Pan wrote:
> > Florian Fainelli <f.fainelli@gmail.com> 於 2021年6月24日 週四 上午5:19寫道:
> >>
> >> On 6/23/21 1:50 PM, patchwork-bot+netdevbpf@kernel.org wrote:
> >>> Hello:
> >>>
> >>> This patch was applied to netdev/net.git (refs/heads/master):
> >>>
> >>> On Wed, 23 Jun 2021 11:28:03 +0800 you wrote:
> >>>> The Broadcom UniMAC MDIO bus from mdio-bcm-unimac module comes too late.
> >>>> So, GENET cannot find the ethernet PHY on UniMAC MDIO bus. This leads
> >>>> GENET fail to attach the PHY as following log:
> >>>>
> >>>> bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000
> >>>> ...
> >>>> could not attach to PHY
> >>>> bcmgenet fd580000.ethernet eth0: failed to connect to PHY
> >>>> uart-pl011 fe201000.serial: no DMA platform data
> >>>> libphy: bcmgenet MII bus: probed
> >>>> ...
> >>>> unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus
> >>>>
> >>>> [...]
> >>>
> >>> Here is the summary with links:
> >>>    - [v2] net: bcmgenet: Fix attaching to PYH failed on RPi 4B
> >>>      https://git.kernel.org/netdev/net/c/b2ac9800cfe0
> >
> > This bot is interesting!!!  Good feature! :)
> >
> >> There was feedback given that could have deserved a v3, if nothing else
> >> to fix the typo in the subject, I suppose that would do though.
> >
> > I can prepare the v3 patch with Florian's suggestion!
>
> Too late, once it's merged only fixups can be accepted, and that does
> not include commit messages, it's alright.
> --
> Florian
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index fcca023f22e5..41f7f078cd27 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -4296,3 +4296,4 @@  MODULE_AUTHOR("Broadcom Corporation");
 MODULE_DESCRIPTION("Broadcom GENET Ethernet controller driver");
 MODULE_ALIAS("platform:bcmgenet");
 MODULE_LICENSE("GPL");
+MODULE_SOFTDEP("pre: mdio-bcm-unimac");