Netdev List
 help / color / mirror / Atom feed
From: Javen <javen_xu@realsil.com.cn>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "hkallweit1@gmail.com" <hkallweit1@gmail.com>,
	"nic_swsd@realtek.com" <nic_swsd@realtek.com>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"maxime.chevallier@bootlin.com" <maxime.chevallier@bootlin.com>,
	"horms@kernel.org" <horms@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"daniel@makrotopia.org" <daniel@makrotopia.org>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"enelsonmoore@gmail.com" <enelsonmoore@gmail.com>,
	"daniel@thingy.jp" <daniel@thingy.jp>
Subject: RE: [PATCH net-next v8 3/7] r8169: add support for phylink
Date: Mon, 3 Aug 2026 03:32:12 +0000	[thread overview]
Message-ID: <4338caa7b5d244e1b0d9a6713ed8fce3@realsil.com.cn> (raw)
In-Reply-To: <cfcf87aa-3d4d-411a-9af0-5a5b78c9ae89@lunn.ch>

>
>> +static void rtl_mac_link_up(struct phylink_config *config, struct phy_device
>*phydev,
>> +                         unsigned int mode, phy_interface_t interface,
>> +                         int speed, int duplex, bool tx_pause, bool
>> +rx_pause) {
>> +     struct rtl8169_private *tp = container_of(config, struct rtl8169_private,
>phylink_config);
>> +     struct device *d = tp_to_dev(tp);
>> +
>> +     tp->speed = speed;
>> +     rtl_link_chg_patch(tp, speed);
>> +
>> +     pm_request_resume(d);
>
>This does nothing with rx_pause and tx_pause. How is the MAC getting
>configured for flow control?

To actually generate pause frames, the MAC needs Rx FIFO "Near Full" and "Near Empty" thresholds. The driver configures these statically during hardware initialization (rtl_hw_start_xxx) by writing to ERI registers 0xCC (RFIFONFULL_TH) and 0xD0 (RFIFOEMPTY_TH) via rtl8168g_set_pause_thresholds().

Software enables/disables flow control by setting the Local PHY registers phy_set_asym_pause(). After auto-negotiation with the Link Partner, the PHY resolves the flow control capabilities. Once the link is up and flow control is negotiated, the integrated Realtek MAC hardware automatically reads the PHY result.

Therefore, we don't need to do anything with tx_pause and rx_pause in mac_link_up.

Thanks,
Javen
>
>    Andrew
>
>---
>pw-bot: cr

  reply	other threads:[~2026-08-03  3:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30  6:50 [PATCH net-next v8 0/7] r8169: add support for phylink javen
2026-07-30  6:50 ` [PATCH net-next v8 1/7] r8169: add speed in private struct javen
2026-07-30  6:50 ` [PATCH net-next v8 2/7] net: phy: phylink: add helper to modify pause javen
2026-07-30  6:50 ` [PATCH net-next v8 3/7] r8169: add support for phylink javen
2026-08-02 14:55   ` Andrew Lunn
2026-08-03  3:32     ` Javen [this message]
2026-08-03  3:45       ` Andrew Lunn
2026-07-30  6:50 ` [PATCH net-next v8 4/7] r8169: add support for RTL8116af javen
2026-07-30  6:50 ` [PATCH net-next v8 5/7] r8169: add support for RTL8127atf javen
2026-07-30  6:50 ` [PATCH net-next v8 6/7] r8169: add ltr support for RTL8117 series javen
2026-07-30  6:50 ` [PATCH net-next v8 7/7] r8169: fix RTL8116af can not enter s0idle and c10 javen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4338caa7b5d244e1b0d9a6713ed8fce3@realsil.com.cn \
    --to=javen_xu@realsil.com.cn \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=daniel@makrotopia.org \
    --cc=daniel@thingy.jp \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=enelsonmoore@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox