netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* phylink: flow control on fixed-link not working.
@ 2019-07-17 21:31 René van Dorst
  2019-07-17 21:51 ` Russell King - ARM Linux admin
  0 siblings, 1 reply; 5+ messages in thread
From: René van Dorst @ 2019-07-17 21:31 UTC (permalink / raw)
  To: netdev; +Cc: Russell King

Hi,

I am trying to enable flow control/pause on PHYLINK and fixed-link.

My setup SOC mac (mt7621) <-> RGMII <-> SWITCH mac (mt7530).

It seems that in fixed-link mode all the flow control/pause bits are  
cleared in
phylink_parse_fixedlink(). If I read phylink_parse_fixedlink() [0] correctly,
I see that pl->link_config.advertising is AND with pl->supprted which has only
the PHY_SETTING() modes bits set. pl->link_config.advertising is losing Pause
bits. pl->link_config.advertising is used in phylink_resolve_flow() to set the
MLO_PAUSE_RX/TX BITS.

I think this is an error.
Because in phylink_start() see this part [1].

  /* Apply the link configuration to the MAC when starting. This allows
   * a fixed-link to start with the correct parameters, and also
   * ensures that we set the appropriate advertisement for Serdes links.
   */
  phylink_resolve_flow(pl, &pl->link_config);
  phylink_mac_config(pl, &pl->link_config);


If I add a this hacky patch below, flow control is enabled on the fixed-link.
         if (s) {
                 __set_bit(s->bit, pl->supported);
+               if (phylink_test(pl->link_config.advertising, Pause))
+                       phylink_set(pl->supported, Pause);
         } else {

So is phylink_parse_fixedlink() broken or should it handled in a other way?

Greats,

René

[0]:  
https://elixir.bootlin.com/linux/latest/source/drivers/net/phy/phylink.c#L196
[1]:  
https://elixir.bootlin.com/linux/latest/source/drivers/net/phy/phylink.c#L897


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-26 21:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-17 21:31 phylink: flow control on fixed-link not working René van Dorst
2019-07-17 21:51 ` Russell King - ARM Linux admin
2019-07-17 22:58   ` René van Dorst
2019-07-19 19:52     ` René van Dorst
2019-07-26 21:28       ` Russell King - ARM Linux admin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).