* stmmac: GMAC_RGSMIIIS reports bogus values
@ 2016-11-03 16:17 Alexey Brodkin
2016-11-14 8:14 ` Giuseppe CAVALLARO
0 siblings, 1 reply; 8+ messages in thread
From: Alexey Brodkin @ 2016-11-03 16:17 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: manabian@gmail.com, linux-kernel@vger.kernel.org,
peppe.cavallaro@st.com, fabrice.gasnier@st.com,
linux-snps-arc@lists.infradead.org, alexandre.torgue@gmail.com,
preid@electromag.com.au, davem@davemloft.net
Hello,
I'm seeing pretty strange issue with GMAC reporting a lot of link state changes
based on bits in GMAC_RGSMIIIS. It looks like that:
-------------------------->8-----------------------
Link is Down
Link is Up - 10/Full
Link is Down
Link is Up - 10/Half
Link is Down
Link is Down
Link is Up - 10/Half
Link is Up -
1000/Half
Link is Down
Link is Down
Link is Down
Link is Down
Link is Up - 10/Half
Link is Down
Link is Down
Link is Up -
1000/Half
Link is Up - 1000/Full
-------------------------->8-----------------------
What's especially interesting my board with GMAC is connected to 100Mbit device
which means there's no chance for 1Gb mode to be set.
Also this has nothing to do with link state detected and reported by PHY via MDIO.
So obviously GMAC_RGSMIIIS bits are wrong. But given the fact that GMAC_RGSMIIIS bits
are set based on state of RXD[3:0] lines of RGMII I may only thing that it's
PHY (in my case DP83865) who's sending random data on the RXD during inter-frame gap.
Note data transferred through that networking connection is perfectly correct and
actually I haven't see those link state prints before kernel v4.8 basically
because the prints in question were implemented with pr_debug() and then with [1]
we got pr_info() that made prints visible by default.
Since I don't have any means to capture all required GMII signals to do better
analysis and my data is not corrupted in the end I'm thinking about way how to
mute these pretty senseless messages.
One thing I may think of we may disable checking of GMAC_RGSMIIIS if a particular
board uses MDIO for PHY setup. Something like that:
-------------------------->8-----------------------
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -337,7 +337,7 @@ static int dwmac1000_irq_status(struct mac_device_info *hw,
dwmac_pcs_isr(ioaddr, GMAC_PCS_BASE, intr_status, x);
- if (intr_status & PCS_RGSMIIIS_IRQ)
+ if (!priv->use_mdio && (intr_status & PCS_RGSMIIIS_IRQ))
dwmac1000_rgsmii(ioaddr, x);
return ret;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 6c85b61aaa0b..34e9de0450ba 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3356,11 +3356,13 @@ int stmmac_dvr_probe(struct device *device,
stmmac_check_pcs_mode(priv);
+ priv->use_mdio = 0;
if (priv->hw->pcs != STMMAC_PCS_RGMII &&
priv->hw->pcs != STMMAC_PCS_TBI &&
priv->hw->pcs != STMMAC_PCS_RTBI) {
/* MDIO bus Registration */
ret = stmmac_mdio_register(ndev);
+ priv->use_mdio = 1;
if (ret < 0) {
pr_debug("%s: MDIO bus (id: %d) registration failed",
__func__, priv->plat->bus_id);
-------------------------->8-----------------------
Any thoughts on that are much appreciated!
Regards,
Alexey
[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=70523e639bf8ca09b3357371c3546cee55c06351
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: stmmac: GMAC_RGSMIIIS reports bogus values
2016-11-03 16:17 stmmac: GMAC_RGSMIIIS reports bogus values Alexey Brodkin
@ 2016-11-14 8:14 ` Giuseppe CAVALLARO
2017-01-25 18:39 ` Alexey Brodkin
0 siblings, 1 reply; 8+ messages in thread
From: Giuseppe CAVALLARO @ 2016-11-14 8:14 UTC (permalink / raw)
To: Alexey Brodkin, netdev@vger.kernel.org
Cc: fabrice.gasnier@st.com, manabian@gmail.com,
linux-kernel@vger.kernel.org, preid@electromag.com.au,
alexandre.torgue@gmail.com, linux-snps-arc@lists.infradead.org,
davem@davemloft.net
Hello Alexey
Sorry for my late reply. In that case, I think that the stmmac
is using own RGMII/SGMII support (PCS) to dialog with the
transceiver. I think, from the HW capability register
this feature is present and the driver is using it as default.
I kindly ask you to verify if this is your setup or if you
do not want to use it. In that case, it is likely we need to
add some code in the driver.
Also I wonder if, other version of the stmmac worked on this platform
before.
Regards
Peppe
On 11/3/2016 5:17 PM, Alexey Brodkin wrote:
> Hello,
>
> I'm seeing pretty strange issue with GMAC reporting a lot of link state changes
> based on bits in GMAC_RGSMIIIS. It looks like that:
> -------------------------->8-----------------------
> Link is Down
> Link is Up - 10/Full
> Link is Down
> Link is Up - 10/Half
> Link is Down
> Link is Down
> Link is Up - 10/Half
> Link is Up -
> 1000/Half
> Link is Down
> Link is Down
> Link is Down
> Link is Down
> Link is Up - 10/Half
> Link is Down
> Link is Down
> Link is Up -
> 1000/Half
> Link is Up - 1000/Full
> -------------------------->8-----------------------
>
> What's especially interesting my board with GMAC is connected to 100Mbit device
> which means there's no chance for 1Gb mode to be set.
>
> Also this has nothing to do with link state detected and reported by PHY via MDIO.
> So obviously GMAC_RGSMIIIS bits are wrong. But given the fact that GMAC_RGSMIIIS bits
> are set based on state of RXD[3:0] lines of RGMII I may only thing that it's
> PHY (in my case DP83865) who's sending random data on the RXD during inter-frame gap.
>
> Note data transferred through that networking connection is perfectly correct and
> actually I haven't see those link state prints before kernel v4.8 basically
> because the prints in question were implemented with pr_debug() and then with [1]
> we got pr_info() that made prints visible by default.
>
> Since I don't have any means to capture all required GMII signals to do better
> analysis and my data is not corrupted in the end I'm thinking about way how to
> mute these pretty senseless messages.
>
> One thing I may think of we may disable checking of GMAC_RGSMIIIS if a particular
> board uses MDIO for PHY setup. Something like that:
> -------------------------->8-----------------------
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> @@ -337,7 +337,7 @@ static int dwmac1000_irq_status(struct mac_device_info *hw,
>
> dwmac_pcs_isr(ioaddr, GMAC_PCS_BASE, intr_status, x);
>
> - if (intr_status & PCS_RGSMIIIS_IRQ)
> + if (!priv->use_mdio && (intr_status & PCS_RGSMIIIS_IRQ))
> dwmac1000_rgsmii(ioaddr, x);
>
> return ret;
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 6c85b61aaa0b..34e9de0450ba 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -3356,11 +3356,13 @@ int stmmac_dvr_probe(struct device *device,
>
> stmmac_check_pcs_mode(priv);
>
> + priv->use_mdio = 0;
> if (priv->hw->pcs != STMMAC_PCS_RGMII &&
> priv->hw->pcs != STMMAC_PCS_TBI &&
> priv->hw->pcs != STMMAC_PCS_RTBI) {
> /* MDIO bus Registration */
> ret = stmmac_mdio_register(ndev);
> + priv->use_mdio = 1;
> if (ret < 0) {
> pr_debug("%s: MDIO bus (id: %d) registration failed",
> __func__, priv->plat->bus_id);
> -------------------------->8-----------------------
>
> Any thoughts on that are much appreciated!
>
> Regards,
> Alexey
>
> [1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=70523e639bf8ca09b3357371c3546cee55c06351
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: stmmac: GMAC_RGSMIIIS reports bogus values
2016-11-14 8:14 ` Giuseppe CAVALLARO
@ 2017-01-25 18:39 ` Alexey Brodkin
2017-01-25 18:47 ` Vineet Gupta
2017-01-27 10:23 ` Alexey Brodkin
0 siblings, 2 replies; 8+ messages in thread
From: Alexey Brodkin @ 2017-01-25 18:39 UTC (permalink / raw)
To: peppe.cavallaro@st.com
Cc: manabian@gmail.com, linux-kernel@vger.kernel.org,
fabrice.gasnier@st.com, linux-snps-arc@lists.infradead.org,
alexandre.torgue@gmail.com, preid@electromag.com.au,
netdev@vger.kernel.org, Vineet Gupta, davem@davemloft.net
Hi Giuseppe,
On Mon, 2016-11-14 at 09:14 +0100, Giuseppe CAVALLARO wrote:
> Hello Alexey
>
> Sorry for my late reply. In that case, I think that the stmmac
> is using own RGMII/SGMII support (PCS) to dialog with the
> transceiver. I think, from the HW capability register
> this feature is present and the driver is using it as default.
Yep looks like that.
> I kindly ask you to verify if this is your setup or if you
> do not want to use it. In that case, it is likely we need to
> add some code in the driver.
Well GMAC's databook says:
--------------------------->8--------------------------
The DWC_gmac provides an IEEE 802.3z compliant 10-bit
Physical Coding Sublayer (PCS) interface that you can use
when the MAC is configured for the TBI, RTBI, or SGMII PHY
interface.
...
You can include the optional PCS module in the DWC_gmac by
selecting the TBI, RTBI, or SGMII interface in coreConsultant
during configuration.
--------------------------->8--------------------------
But we use RGMII for communication with the PHY.
And from the quote above I would conclude that for RGMII we should
have PCS excluded from GMAC.
I just sent email to GMAC developers here in Synopsys and
hopefully will get some clarifications from them soon.
Probably correct solution is as simple as:
--------------------------->8--------------------------
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index a276a32d57f2..f4b67dc7d530 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -803,13 +803,7 @@ static void stmmac_check_pcs_mode(struct stmmac_priv *priv)
int interface = priv->plat->interface;
if (priv->dma_cap.pcs) {
- if ((interface == PHY_INTERFACE_MODE_RGMII) ||
- (interface == PHY_INTERFACE_MODE_RGMII_ID) ||
- (interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
- (interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
- netdev_dbg(priv->dev, "PCS RGMII support enabled\n");
- priv->hw->pcs = STMMAC_PCS_RGMII;
- } else if (interface == PHY_INTERFACE_MODE_SGMII) {
+ if (interface == PHY_INTERFACE_MODE_SGMII) {
netdev_dbg(priv->dev, "PCS SGMII support enabled\n");
priv->hw->pcs = STMMAC_PCS_SGMII;
}
--------------------------->8--------------------------
> Also I wonder if, other version of the stmmac worked on this platform
> before.
It did work and still works. The only problem is we're getting
a lot of noise now about bogus link status change. That's because
this info is now in pr_info() compared to being previously in pr_debug().
-Alexey
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: stmmac: GMAC_RGSMIIIS reports bogus values
2017-01-25 18:39 ` Alexey Brodkin
@ 2017-01-25 18:47 ` Vineet Gupta
2017-01-27 10:23 ` Alexey Brodkin
1 sibling, 0 replies; 8+ messages in thread
From: Vineet Gupta @ 2017-01-25 18:47 UTC (permalink / raw)
To: Alexey Brodkin, peppe.cavallaro@st.com
Cc: manabian@gmail.com, linux-kernel@vger.kernel.org,
fabrice.gasnier@st.com, linux-snps-arc@lists.infradead.org,
alexandre.torgue@gmail.com, preid@electromag.com.au,
netdev@vger.kernel.org, davem@davemloft.net
On 01/25/2017 10:39 AM, Alexey Brodkin wrote:
>> Also I wonder if, other version of the stmmac worked on this platform
>> before.
> It did work and still works. The only problem is we're getting
> a lot of noise now about bogus link status change. That's because
> this info is now in pr_info() compared to being previously in pr_debug().
While we sort out the real technical details, it is OK to go back to pr_debug
please - print_once or some such !
There is lot of useless console noise when we run any networking loads here !
echo 0 > /proc/sys/kernel/printk
only helps in that it is not printed on console but clobbers dmesg nonetheless !
Thx,
-Vineet
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: stmmac: GMAC_RGSMIIIS reports bogus values
2017-01-25 18:39 ` Alexey Brodkin
2017-01-25 18:47 ` Vineet Gupta
@ 2017-01-27 10:23 ` Alexey Brodkin
2017-01-31 9:55 ` Giuseppe CAVALLARO
1 sibling, 1 reply; 8+ messages in thread
From: Alexey Brodkin @ 2017-01-27 10:23 UTC (permalink / raw)
To: peppe.cavallaro@st.com
Cc: fabrice.gasnier@st.com, netdev@vger.kernel.org,
manabian@gmail.com, linux-kernel@vger.kernel.org,
preid@electromag.com.au, davem@davemloft.net,
alexandre.torgue@gmail.com, linux-snps-arc@lists.infradead.org,
Vineet Gupta
Hi Giuseppe,
On Wed, 2017-01-25 at 21:39 +0300, Alexey Brodkin wrote:
> Hi Giuseppe,
>
> On Mon, 2016-11-14 at 09:14 +0100, Giuseppe CAVALLARO wrote:
> >
> > Hello Alexey
> >
> > Sorry for my late reply. In that case, I think that the stmmac
> > is using own RGMII/SGMII support (PCS) to dialog with the
> > transceiver. I think, from the HW capability register
> > this feature is present and the driver is using it as default.
>
> Yep looks like that.
Hm, so I took a look at what am I reading from
"Register 22 (HW Feature Register)" in dwmac1000_get_hw_feature()
and was really surprised to see the register value = 0x100509bf.
See bit 6 "PCSSEL" is zeroed which stands for
"PCS registers (TBI, SGMII, or RTBI PHY interface)".
I.e. PCS doesn't exist in our GMAC so most of the previous comments
below should be discarded.
> > I kindly ask you to verify if this is your setup or if you
> > do not want to use it. In that case, it is likely we need to
> > add some code in the driver.
>
> Well GMAC's databook says:
> --------------------------->8--------------------------
> The DWC_gmac provides an IEEE 802.3z compliant 10-bit
> Physical Coding Sublayer (PCS) interface that you can use
> when the MAC is configured for the TBI, RTBI, or SGMII PHY
> interface.
>
> ...
>
> You can include the optional PCS module in the DWC_gmac by
> selecting the TBI, RTBI, or SGMII interface in coreConsultant
> during configuration.
> --------------------------->8--------------------------
>
> But we use RGMII for communication with the PHY.
> And from the quote above I would conclude that for RGMII we should
> have PCS excluded from GMAC.
>
> I just sent email to GMAC developers here in Synopsys and
> hopefully will get some clarifications from them soon.
>
> Probably correct solution is as simple as:
> --------------------------->8--------------------------
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index a276a32d57f2..f4b67dc7d530 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -803,13 +803,7 @@ static void stmmac_check_pcs_mode(struct stmmac_priv *priv)
> int interface = priv->plat->interface;
>
> if (priv->dma_cap.pcs) {
> - if ((interface == PHY_INTERFACE_MODE_RGMII) ||
> - (interface == PHY_INTERFACE_MODE_RGMII_ID) ||
> - (interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
> - (interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
> - netdev_dbg(priv->dev, "PCS RGMII support enabled\n");
> - priv->hw->pcs = STMMAC_PCS_RGMII;
> - } else if (interface == PHY_INTERFACE_MODE_SGMII) {
> + if (interface == PHY_INTERFACE_MODE_SGMII) {
> netdev_dbg(priv->dev, "PCS SGMII support enabled\n");
> priv->hw->pcs = STMMAC_PCS_SGMII;
> }
> --------------------------->8--------------------------
>
> >
> > Also I wonder if, other version of the stmmac worked on this platform
> > before.
>
> It did work and still works. The only problem is we're getting
> a lot of noise now about bogus link status change. That's because
> this info is now in pr_info() compared to being previously in pr_debug().
So it all really boils down to the following problem:
Link state reported via "Register 54 (SGMII/RGMII/SMII Control and Status Register)"
doesn't match status read via MDIO from the PHY.
That's why my initial proposal was to ignore whatever we read from this register
if we have MDIO bus instantiated already.
-Alexey
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: stmmac: GMAC_RGSMIIIS reports bogus values
2017-01-27 10:23 ` Alexey Brodkin
@ 2017-01-31 9:55 ` Giuseppe CAVALLARO
2017-01-31 13:24 ` Alexey Brodkin
0 siblings, 1 reply; 8+ messages in thread
From: Giuseppe CAVALLARO @ 2017-01-31 9:55 UTC (permalink / raw)
To: Alexey Brodkin
Cc: fabrice.gasnier@st.com, netdev@vger.kernel.org,
manabian@gmail.com, linux-kernel@vger.kernel.org,
preid@electromag.com.au, davem@davemloft.net,
alexandre.torgue@gmail.com, linux-snps-arc@lists.infradead.org,
Vineet Gupta
On 1/27/2017 11:23 AM, Alexey Brodkin wrote:
> That's why my initial proposal was to ignore whatever we read from this register
> if we have MDIO bus instantiated already.
sorry for my late reply, I agree with this approach, according to the
HW and platform configuration the driver has to understand and then
work to use either SMA or PCS module.
Regards
Peppe
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: stmmac: GMAC_RGSMIIIS reports bogus values
2017-01-31 9:55 ` Giuseppe CAVALLARO
@ 2017-01-31 13:24 ` Alexey Brodkin
2017-01-31 13:46 ` Giuseppe CAVALLARO
0 siblings, 1 reply; 8+ messages in thread
From: Alexey Brodkin @ 2017-01-31 13:24 UTC (permalink / raw)
To: peppe.cavallaro@st.com
Cc: netdev@vger.kernel.org, linux-snps-arc@lists.infradead.org,
linux-kernel@vger.kernel.org
Hi Giuseppe,
On Tue, 2017-01-31 at 10:55 +0100, Giuseppe CAVALLARO wrote:
> On 1/27/2017 11:23 AM, Alexey Brodkin wrote:
> >
> > That's why my initial proposal was to ignore whatever we read from this register
> > if we have MDIO bus instantiated already.
>
> sorry for my late reply, I agree with this approach, according to the
> HW and platform configuration the driver has to understand and then
> work to use either SMA or PCS module.
I already submitted another solution which IMHO is much cleaner and appropriate,
see David has it already in master tree here:
http://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=0a764db103376cf69d04449b10688f3516cc0b88
-Alexey
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: stmmac: GMAC_RGSMIIIS reports bogus values
2017-01-31 13:24 ` Alexey Brodkin
@ 2017-01-31 13:46 ` Giuseppe CAVALLARO
0 siblings, 0 replies; 8+ messages in thread
From: Giuseppe CAVALLARO @ 2017-01-31 13:46 UTC (permalink / raw)
To: Alexey Brodkin
Cc: netdev@vger.kernel.org, linux-snps-arc@lists.infradead.org,
linux-kernel@vger.kernel.org
Hello Alexey
On 1/31/2017 2:24 PM, Alexey Brodkin wrote:
> Hi Giuseppe,
>
> On Tue, 2017-01-31 at 10:55 +0100, Giuseppe CAVALLARO wrote:
>> On 1/27/2017 11:23 AM, Alexey Brodkin wrote:
>>>
>>> That's why my initial proposal was to ignore whatever we read from this register
>>> if we have MDIO bus instantiated already.
>>
>> sorry for my late reply, I agree with this approach, according to the
>> HW and platform configuration the driver has to understand and then
>> work to use either SMA or PCS module.
>
> I already submitted another solution which IMHO is much cleaner and appropriate,
> see David has it already in master tree here:
> http://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=0a764db103376cf69d04449b10688f3516cc0b88
>
it's ok, thx for that
Peppe
> -Alexey
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-01-31 13:46 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-03 16:17 stmmac: GMAC_RGSMIIIS reports bogus values Alexey Brodkin
2016-11-14 8:14 ` Giuseppe CAVALLARO
2017-01-25 18:39 ` Alexey Brodkin
2017-01-25 18:47 ` Vineet Gupta
2017-01-27 10:23 ` Alexey Brodkin
2017-01-31 9:55 ` Giuseppe CAVALLARO
2017-01-31 13:24 ` Alexey Brodkin
2017-01-31 13:46 ` Giuseppe CAVALLARO
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).