mii_bus fails to register on imx51

Bug #655641 reported by Shawn Guo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro Linux
Invalid
Low
Shawn Guo

Bug Description

The mii_bus fails to register on imx51 and gives the following trace info. Clean of CONFIG_FIXED_PHY can remove the error.

Fixed MDIO Bus: probed
FEC Ethernet Driver
------------[ cut here ]------------
WARNING: at /build/buildd/linux-linaro-2.6.35/fs/sysfs/dir.c:451 sysfs_add_one+0
x6c/0x8c()
sysfs: cannot create duplicate filename '/class/mdio_bus/0'
Modules linked in:
Backtrace:
[<c0034540>] (dump_backtrace+0x0/0xf8) from [<c0308c68>] (dump_stack+0x18/0x1c)
 r6:c03c0cef r5:000001c3 r4:df837d18 r3:f357b213
[<c0308c50>] (dump_stack+0x0/0x1c) from [<c0043d84>] (warn_slowpath_common+0x54/
0x6c)
[<c0043d30>] (warn_slowpath_common+0x0/0x6c) from [<c0043e40>] (warn_slowpath_fm
t+0x38/0x40)
 r8:00000001 r7:df837d68 r6:df3dd090 r5:df811000 r4:ffffffef
r3:00000009
[<c0043e08>] (warn_slowpath_fmt+0x0/0x40) from [<c00ef150>] (sysfs_add_one+0x6c/
0x8c)
 r3:df811000 r2:c03c0d20
[<c00ef0e4>] (sysfs_add_one+0x0/0x8c) from [<c00f00d0>] (sysfs_do_create_link+0x
fc/0x1cc)
 r7:df85aa20 r6:df3dd000 r5:df3d1648 r4:df3dd090
[<c00effd4>] (sysfs_do_create_link+0x0/0x1cc) from [<c00f01cc>] (sysfs_create_li
nk+0x14/0x18)
[<c00f01b8>] (sysfs_create_link+0x0/0x18) from [<c0206b6c>] (device_add_class_sy
mlinks+0x5c/0xd8)
[<c0206b10>] (device_add_class_symlinks+0x0/0xd8) from [<c02072c0>] (device_add+
0x110/0x2dc)
 r6:c041bda8 r5:00000000 r4:df3d1640 r3:00000000
[<c02071b0>] (device_add+0x0/0x2dc) from [<c02074a8>] (device_register+0x1c/0x20
)
 r7:df3d1604 r6:df3d1640 r5:df3fc340 r4:df3d1640
[<c020748c>] (device_register+0x0/0x20) from [<c0238d00>] (mdiobus_register+0x90
/0x178)
 r4:df3d1600 r3:00000000
[<c0238c70>] (mdiobus_register+0x0/0x178) from [<c023c51c>] (fec_enet_mii_init+0
x120/0x164)
 r8:c041bda0 r7:00000080 r6:df3d1600 r5:df3fc340 r4:df3fc000
r3:df3d3ba0
[<c023c3fc>] (fec_enet_mii_init+0x0/0x164) from [<c0308494>] (fec_probe+0x170/0x
1f4)
 r8:c041bda8 r7:df3fc340 r6:00000001 r5:c041bda0 r4:df3fc000
r3:ffc000f8
[<c0308324>] (fec_probe+0x0/0x1f4) from [<c020a840>] (platform_drv_probe+0x1c/0x
20)
[<c020a824>] (platform_drv_probe+0x0/0x20) from [<c0209754>] (really_probe+0xa0/
0x150)
[<c02096b4>] (really_probe+0x0/0x150) from [<c0209854>] (driver_probe_device+0x5
0/0x68)
 r7:00000000 r6:c043e5f4 r5:c043e5f4 r4:c041bda8
[<c0209804>] (driver_probe_device+0x0/0x68) from [<c02098d4>] (__driver_attach+0
x68/0x8c)
 r5:c041bddc r4:c041bda8
[<c020986c>] (__driver_attach+0x0/0x8c) from [<c0208ef8>] (bus_for_each_dev+0x54
/0x84)
 r6:00000000 r5:c020986c r4:c043e5f4 r3:00000000
[<c0208ea4>] (bus_for_each_dev+0x0/0x84) from [<c02095c8>] (driver_attach+0x20/0
x28)
 r6:c04369f8 r5:df3d3ae0 r4:c043e5f4
[<c02095a8>] (driver_attach+0x0/0x28) from [<c0208814>] (bus_add_driver+0xa4/0x1
9c)
[<c0208770>] (bus_add_driver+0x0/0x19c) from [<c0209c9c>] (driver_register+0xb0/
0xe4)
 r7:00000013 r6:00000000 r5:c00086ec r4:c043e5f4
[<c0209bec>] (driver_register+0x0/0xe4) from [<c020ad44>] (platform_driver_regis
ter+0x4c/0x60)
 r5:c00086ec r4:c001fa4c
[<c020acf8>] (platform_driver_register+0x0/0x60) from [<c001fa68>] (fec_enet_mod
ule_init+0x1c/0x28)
[<c001fa4c>] (fec_enet_module_init+0x0/0x28) from [<c002b340>] (do_one_initcall+
0x60/0x1c4)
[<c002b2e0>] (do_one_initcall+0x0/0x1c4) from [<c00086a4>] (do_initcalls+0x1c/0x
38)
 r9:00000000 r8:00000000 r7:00000013 r6:c0047324 r5:c00086ec
r4:c0026840
[<c0008688>] (do_initcalls+0x0/0x38) from [<c00086e8>] (do_basic_setup+0x28/0x2c
)
 r4:00000000 r3:00000000
[<c00086c0>] (do_basic_setup+0x0/0x2c) from [<c0008738>] (kernel_init+0x4c/0xec)
[<c00086ec>] (kernel_init+0x0/0xec) from [<c0047324>] (do_exit+0x0/0x258)
 r4:00000000 r3:00000000
---[ end trace 1c431abc57d885c7 ]---
mii_bus 0 failed to register

Revision history for this message
Shawn Guo (shawnguo) wrote :

I'm not sure when and how the issue was fixed, but it's gone on linux-linaro-2.6.38. Either CONFIG_FIXED_PHY is selected or not, we do not have this issue, and fec driver works on mx51 babbage board.

Changed in linux-linaro:
assignee: nobody → Shawn Guo (shawn-gsc)
milestone: none → 11.05-final
importance: Undecided → Low
status: New → Invalid
Revision history for this message
Jason Liu (r64343) wrote : Re: [Bug 655641] Re: mii_bus fails to register on imx51
Download full text (5.8 KiB)

Hi, Shawn,

On Tue, Feb 22, 2011 at 5:01 PM, Shawn Guo <email address hidden> wrote:
> I'm not sure when and how the issue was fixed, but it's gone on linux-
> linaro-2.6.38.  Either CONFIG_FIXED_PHY is selected or not, we do not
> have this issue, and fec driver works on mx51 babbage board.

Apparently, this commit fix this issue if you look at the git commit log:
and I have verified and result is that this commit did it in fact.

commit 6fcc040f02d281c7e9563127358a77ce2bbfe284
Author: Greg Ungerer <email address hidden>
Date: Mon Oct 11 21:03:05 2010 +0000

    net: allow FEC driver to use fixed PHY support

    At least one board using the FEC driver does not have a conventional
    PHY attached to it, it is directly connected to a somewhat simple
    ethernet switch (the board is the SnapGear/LITE, and the attached
    4-port ethernet switch is a RealTek RTL8305). This switch does not
    present the usual register interface of a PHY, it presents nothing.
    So a PHY scan will find nothing - it finds ID's of 0 for each PHY
    on the attached MII bus.

    After the FEC driver was changed to use phylib for supporting PHYs
    it no longer works on this particular board/switch setup.

    Add code support to use a fixed phy if no PHY is found on the MII bus.
    This is based on the way the cpmac.c driver solved this same problem.

    Signed-off-by: Greg Ungerer <email address hidden>
    Signed-off-by: David S. Miller <email address hidden>

>
> ** Changed in: linux-linaro
>     Assignee: (unassigned) => Shawn Guo (shawn-gsc)
>
> ** Changed in: linux-linaro
>    Milestone: None => 11.05-final
>
> ** Changed in: linux-linaro
>   Importance: Undecided => Low
>
> ** Changed in: linux-linaro
>       Status: New => Invalid
>
> --
> You received this bug notification because you are a member of Linaro
> Kernel Working Group, which is the registrant for Linaro Linux.
> https://bugs.launchpad.net/bugs/655641
>
> Title:
>  mii_bus fails to register on imx51
>
> Status in Linaro Linux:
>  Invalid
>
> Bug description:
>  The mii_bus fails to register on imx51 and gives the following trace info.  Clean of CONFIG_FIXED_PHY can remove the error.
>
>  Fixed MDIO Bus: probed
>  FEC Ethernet Driver
>  ------------[ cut here ]------------
>  WARNING: at /build/buildd/linux-linaro-2.6.35/fs/sysfs/dir.c:451 sysfs_add_one+0
>  x6c/0x8c()
>  sysfs: cannot create duplicate filename '/class/mdio_bus/0'
>  Modules linked in:
>  Backtrace:
>  [<c0034540>] (dump_backtrace+0x0/0xf8) from [<c0308c68>] (dump_stack+0x18/0x1c)
>   r6:c03c0cef r5:000001c3 r4:df837d18 r3:f357b213
>  [<c0308c50>] (dump_stack+0x0/0x1c) from [<c0043d84>] (warn_slowpath_common+0x54/
>  0x6c)
>  [<c0043d30>] (warn_slowpath_common+0x0/0x6c) from [<c0043e40>] (warn_slowpath_fm
>  t+0x38/0x40)
>   r8:00000001 r7:df837d68 r6:df3dd090 r5:df811000 r4:ffffffef
>  r3:00000009
>  [<c0043e08>] (warn_slowpath_fmt+0x0/0x40) from [<c00ef150>] (sysfs_add_one+0x6c/
>  0x8c)
>   r3:df811000 r2:c03c0d20
>  [<c00ef0e4>] (sysfs_add_one+0x0/0x8c) from [<c00f00d0>] (sysfs_do_create_link+0x
>  fc/0x1cc)
>   r7:df85aa20 r6:df3dd000 r5:df3d1648 r4:df3dd090
>  [<c00effd4>] (sysfs_do_create_link+0x0/0x1cc) from [<c0...

Read more...

Revision history for this message
Shawn Guo (shawnguo) wrote :

Yes, Jason. I noticed that commit. But when I rolled back the code to the version just before that commit. I did not see the trace warning show up again. So I'm not sure it's the commit that fixed the problem.

Revision history for this message
Jason Liu (r64343) wrote :
Download full text (4.7 KiB)

Hi, Shawn,

On Wed, Feb 23, 2011 at 3:27 PM, Shawn Guo <email address hidden> wrote:
> Yes, Jason.  I noticed that commit.  But when I rolled back the code to
> the version just before that commit.  I did not see the trace warning
> show up again.  So I'm not sure it's the commit that fixed the problem.

If you rolled back to the commit: fac70d51914674ce8ae742ed73441ddb4770ad20
which is one commit earlier than
6fcc040f02d281c7e9563127358a77ce2bbfe284(net: allow FEC driver to use
fixed PHY support)

you will see the error, I have tested and can confirm it.

....
>
> --
> You received this bug notification because you are a member of Linaro
> Kernel Working Group, which is the registrant for Linaro Linux.
> https://bugs.launchpad.net/bugs/655641
>
> Title:
>  mii_bus fails to register on imx51
>
> Status in Linaro Linux:
>  Invalid
>
> Bug description:
>  The mii_bus fails to register on imx51 and gives the following trace info.  Clean of CONFIG_FIXED_PHY can remove the error.
>
>  Fixed MDIO Bus: probed
>  FEC Ethernet Driver
>  ------------[ cut here ]------------
>  WARNING: at /build/buildd/linux-linaro-2.6.35/fs/sysfs/dir.c:451 sysfs_add_one+0
>  x6c/0x8c()
>  sysfs: cannot create duplicate filename '/class/mdio_bus/0'
>  Modules linked in:
>  Backtrace:
>  [<c0034540>] (dump_backtrace+0x0/0xf8) from [<c0308c68>] (dump_stack+0x18/0x1c)
>   r6:c03c0cef r5:000001c3 r4:df837d18 r3:f357b213
>  [<c0308c50>] (dump_stack+0x0/0x1c) from [<c0043d84>] (warn_slowpath_common+0x54/
>  0x6c)
>  [<c0043d30>] (warn_slowpath_common+0x0/0x6c) from [<c0043e40>] (warn_slowpath_fm
>  t+0x38/0x40)
>   r8:00000001 r7:df837d68 r6:df3dd090 r5:df811000 r4:ffffffef
>  r3:00000009
>  [<c0043e08>] (warn_slowpath_fmt+0x0/0x40) from [<c00ef150>] (sysfs_add_one+0x6c/
>  0x8c)
>   r3:df811000 r2:c03c0d20
>  [<c00ef0e4>] (sysfs_add_one+0x0/0x8c) from [<c00f00d0>] (sysfs_do_create_link+0x
>  fc/0x1cc)
>   r7:df85aa20 r6:df3dd000 r5:df3d1648 r4:df3dd090
>  [<c00effd4>] (sysfs_do_create_link+0x0/0x1cc) from [<c00f01cc>] (sysfs_create_li
>  nk+0x14/0x18)
>  [<c00f01b8>] (sysfs_create_link+0x0/0x18) from [<c0206b6c>] (device_add_class_sy
>  mlinks+0x5c/0xd8)
>  [<c0206b10>] (device_add_class_symlinks+0x0/0xd8) from [<c02072c0>] (device_add+
>  0x110/0x2dc)
>   r6:c041bda8 r5:00000000 r4:df3d1640 r3:00000000
>  [<c02071b0>] (device_add+0x0/0x2dc) from [<c02074a8>] (device_register+0x1c/0x20
>  )
>   r7:df3d1604 r6:df3d1640 r5:df3fc340 r4:df3d1640
>  [<c020748c>] (device_register+0x0/0x20) from [<c0238d00>] (mdiobus_register+0x90
>  /0x178)
>   r4:df3d1600 r3:00000000
>  [<c0238c70>] (mdiobus_register+0x0/0x178) from [<c023c51c>] (fec_enet_mii_init+0
>  x120/0x164)
>   r8:c041bda0 r7:00000080 r6:df3d1600 r5:df3fc340 r4:df3fc000
>  r3:df3d3ba0
>  [<c023c3fc>] (fec_enet_mii_init+0x0/0x164) from [<c0308494>] (fec_probe+0x170/0x
>  1f4)
>   r8:c041bda8 r7:df3fc340 r6:00000001 r5:c041bda0 r4:df3fc000
>  r3:ffc000f8
>  [<c0308324>] (fec_probe+0x0/0x1f4) from [<c020a840>] (platform_drv_probe+0x1c/0x
>  20)
>  [<c020a824>] (platform_drv_probe+0x0/0x20) from [<c0209754>] (really_probe+0xa0/
>  0x150)
>  [<c02096b4>] (really_probe+0x0/0x150) from [<c0209854>] (driver_probe_device+0x5
...

Read more...

Revision history for this message
Shawn Guo (shawnguo) wrote :

Jason,

I do not understand how "fac70d5" could be the parent commit of "6fcc040". Here are what I get from git log.

$ git log --pretty=short 6fcc040
commit 6fcc040f02d281c7e9563127358a77ce2bbfe284
Author: Greg Ungerer <email address hidden>

    net: allow FEC driver to use fixed PHY support

commit b0057c51db66c5f0f38059f242c57d61c4741d89
Author: Eric Dumazet <email address hidden>

    tg3: restore rx_dropped accounting

Or the git log on fec.c only:

$ git log --pretty=short 6fcc040 drivers/net/fec.c
commit 6fcc040f02d281c7e9563127358a77ce2bbfe284
Author: Greg Ungerer <email address hidden>

    net: allow FEC driver to use fixed PHY support

commit 03c698c93fc15d976738a853a7ccb6ea26396003
Author: Oskar Schirmer <email address hidden>

    net/fec: carrier off initially to avoid root mount failure

Revision history for this message
Jason Liu (r64343) wrote :
Download full text (8.1 KiB)

Shawn,

On Wed, Feb 23, 2011 at 8:04 PM, Shawn Guo <email address hidden> wrote:
> Jason,
>
> I do not understand how "fac70d5" could be the parent commit of
> "6fcc040".  Here are what I get from git log.

here is the output of git log of my linux-2.6 git

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*
        url = git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[branch "master"]
        remote = origin
        merge = refs/heads/master

git log

commit 85e2efbb1db9a18d218006706d6e4fbeb0216213
Author: Linus Torvalds <email address hidden>
Date: Tue Feb 15 19:23:45 2011 -0800

    Linux 2.6.38-rc5

commit 048f039f3ee39417d5a6a1eb73bf01f935e9ed3f
Merge: b90be86 86d306c
Author: Linus Torvalds <email address hidden>
Date: Tue Feb 15 17:51:18 2011 -0800

    Merge branch 'for-linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu

    * 'for-linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
      m68knommu: set flow handler for secondary interrupt controller of 5249
      m68knommu: remove use of IRQ_FLG_LOCK from 68360 platform support
      m68knommu: fix dereference of port.tty
      m68knommu: add missing linker __modver section
      m68knommu: fix mis-named variable int set_irq_chip loop
      m68knommu: add optimize memmove() function
      m68k: remove arch specific non-optimized memcmp()
      m68knommu: fix use of un-defined _TIF_WORK_MASK
      m68knommu: Rename m548x_wdt.c to m54xx_wdt.c
      m68knommu: fix m548x_wdt.c compilation after headers renaming
      m68knommu: Remove dependencies on nonexistent M68KNOMMU

....

commit 6fcc040f02d281c7e9563127358a77ce2bbfe284
Author: Greg Ungerer <email address hidden>
Date: Mon Oct 11 21:03:05 2010 +0000

    net: allow FEC driver to use fixed PHY support

    At least one board using the FEC driver does not have a conventional
    PHY attached to it, it is directly connected to a somewhat simple
    ethernet switch (the board is the SnapGear/LITE, and the attached
    4-port ethernet switch is a RealTek RTL8305). This switch does not
    present the usual register interface of a PHY, it presents nothing.
    So a PHY scan will find nothing - it finds ID's of 0 for each PHY
    on the attached MII bus.

    After the FEC driver was changed to use phylib for supporting PHYs
    it no longer works on this particular board/switch setup.

    Add code support to use a fixed phy if no PHY is found on the MII bus.
    This is based on the way the cpmac.c driver solved this same problem.

    Signed-off-by: Greg Ungerer <email address hidden>
    Signed-off-by: David S. Miller <email address hidden>

commit fac70d51914674ce8ae742ed73441ddb4770ad20
Author: Eli Cohen <email address hidden>
Date: Mon Sep 27 17:51:11 2010 -0700

    IB/mad: IBoE supports only QP1 (no QP0)

    Since IBoE is using Ethernet as its link layer, there is no central
    management entity so there is need for QP0. QP1 is still needed since
    it handles communications between CM agents. This patch wil...

Read more...

Revision history for this message
Shawn Guo (shawnguo) wrote :

Ah, there must be something wrong my last time roll back build. I just retested on commit "03c698c" which is the parent of "6fcc040" in terms of fec.c git log. And the problem does show up again.

$ git log --pretty=short 6fcc040 drivers/net/fec.c
commit 6fcc040f02d281c7e9563127358a77ce2bbfe284
Author: Greg Ungerer <email address hidden>

    net: allow FEC driver to use fixed PHY support

commit 03c698c93fc15d976738a853a7ccb6ea26396003
Author: Oskar Schirmer <email address hidden>

    net/fec: carrier off initially to avoid root mount failure

So it is 6fcc040 fixed the problem. Thanks, Jason.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.