From: Sean Wang <sean.wang@mediatek.com>
To: <john@phrozen.org>, <davem@davemloft.net>
Cc: <nbd@openwrt.org>, <netdev@vger.kernel.org>,
<linux-mediatek@lists.infradead.org>, <keyhaede@gmail.com>,
Sean Wang <sean.wang@mediatek.com>
Subject: [PATCH 2/5] net: ethernet: mediatek: fixed flow control settings on GMAC0 is not being enabled properly
Date: Mon, 15 Aug 2016 23:03:47 +0800 [thread overview]
Message-ID: <1471273430-19942-2-git-send-email-sean.wang@mediatek.com> (raw)
In-Reply-To: <1471273430-19942-1-git-send-email-sean.wang@mediatek.com>
Commit 08ef55c6f257acf3bdc6940813f80e8f0f5d90ec
("net-next: mediatek: fix gigabit and flow control advertisement")
had supported proper flow control settings for GMAC1. But for GMAC0,
1.GMAC0 shares the common logic with GMAC1 inside mtk_phy_link_adjust()
to adapt various settings for the target phy.
2.GMAC1 uses fixed-phy to connect to a builtin gigabit switch with
fixed link speed as commit 0c72c50f6f93b0c3daa9ea35d89ab3a933c7b5a0
("net-next: mediatek: add fixed-phy support") describes.
3.However, fixed-phy doesn't enable SUPPORTED_Pause & SUPPORTED_Asym_Pause
supported flag on default that would cause mtk_phy_link_adjust() not to
enable flow control setting on GMAC0 properly and cause packet dropped
when high traffic.
Due to these reasons, the patch adds SUPPORTED_Pause & SUPPORTED_Asym_Pause
supported flags on fixed-phy used by driver to have proper handling on
the both GMAC with the shared common logic.
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index f19b8b9..eb59a73 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -267,6 +267,11 @@ static int mtk_phy_connect(struct mtk_mac *mac)
mac->phy_dev->autoneg = AUTONEG_ENABLE;
mac->phy_dev->speed = 0;
mac->phy_dev->duplex = 0;
+
+ if (of_phy_is_fixed_link(mac->of_node))
+ mac->phy_dev->supported |=
+ SUPPORTED_Pause | SUPPORTED_Asym_Pause;
+
mac->phy_dev->supported &= PHY_GBIT_FEATURES | SUPPORTED_Pause |
SUPPORTED_Asym_Pause;
mac->phy_dev->advertising = mac->phy_dev->supported |
--
1.7.9.5
next prev parent reply other threads:[~2016-08-15 15:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-15 15:03 [PATCH 1/5] net: ethernet: mediatek: add REVMII and fix RMII modes supported by GMAC Sean Wang
2016-08-15 15:03 ` Sean Wang [this message]
2016-08-15 15:03 ` [PATCH 3/5] net: ethernet: mediatek: fixed runtime warning raised by inconsistent struct device pointers passed to DMA API Sean Wang
2016-08-15 15:03 ` [PATCH 4/5] net: ethernet: mediatek: enable rx path by reducing memory barrier Sean Wang
[not found] ` <1471273430-19942-4-git-send-email-sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2016-08-15 19:06 ` Sergei Shtylyov
2016-08-15 15:03 ` [PATCH 5/5] net: ethernet: mediatek: enable rx path by aggregrating more skbs Sean Wang
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=1471273430-19942-2-git-send-email-sean.wang@mediatek.com \
--to=sean.wang@mediatek.com \
--cc=davem@davemloft.net \
--cc=john@phrozen.org \
--cc=keyhaede@gmail.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=nbd@openwrt.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).