This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

dual MAC -> phy dependancy



Hi,

I'v a platform with 2 RMII interfaces connected to 2 micrel phy's KSZ8021; kernel is configured to work with 2 independant MAC.

If only the first phy (address 0:00) is attached, everything is working fine. micrel phy driver is working as expected.

If I attach the 2 phy's, the second phy (address 0:03) influences the behaviour of the first.

If both ethernet interfaces are connected to a network; both interfaces are brought up 'Link is Up'.

When the ethternet cable of the 2nd phy is detached, both interfaces are going down:

[ 2138.737304] PHY: 0:00 - Link is Down

[ 2139.897186] PHY: 0:03 - Link is Down

Of course, only the second interface should go down.

In this situation, the first phy is not reacting anymore when I (dis)connect the cable!

Of the second jack is inserted again, both interfaces are going up!!!

If both cables are plugged in, and I disconnect the first (and leave the second in); than the first phy is reacting correctly.

The state of the second interface influences the first!

Anyone seeing this also? Anyone who can help?

Best regards,

Wim

  • I'm rather sure that the state machines for both interfaces are interfering.

    With the current cpsw driver it is possible that the state machines become out of sync with the real phy state.

    Can someone reproduce these problems?

    Regards,

    Wim

  • In att. I added a patch, which looks like fixing the problem (printk used for debug)

    Still further testing to do.

    Someone seeing a problem with this fix?

    Regards,

    Wim

  • Wim

    I have tested the same scenario as yours in EVMsk and it worked fine for me.
    Did you tested whether you both interface is up?
    The diff you have attached make MDIO phy polling for both the interface regardless from which interface the MDIO poll is called we it is in switch mode.

    Can you copy paste the "ifconfig" and "ifconfig -a" command without your patch to understand your issue clearly.

    Regards
    Mugunthan V N

  • Hello Mugunthan,

    the fact that you say it's working fine in your setup, was really helpfull.

    This means it had something to do with the Micrel phy's KSZ8021.

    In the micrel phy driver, there is a bit set during init. But along the way, it was resetted again.

    This bit disables broadcast (undocumented bit 9 in register 16).

    Now, I set this bit via a phy_register_fixup_for_uid callback.

    It looks working correctly now (I disabled my previous patch in the cpsw driver)

    Best regards

    Wim