* [PATCH] net: stmmac: fix incorrect bit set in gmac4 mdio addr register
@ 2016-12-27 20:07 Kweh, Hock Leong
2016-12-27 12:11 ` Joao Pinto
2016-12-27 17:30 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Kweh, Hock Leong @ 2016-12-27 20:07 UTC (permalink / raw)
To: David S. Miller, Joao Pinto, Giuseppe CAVALLARO,
seraphin.bonnaffe, f.fainelli
Cc: Alexandre TORGUE, Joachim Eastwood, Niklas Cassel, Johan Hovold,
pavel, Ong Boon Leong, Kweh, Hock Leong, weifeng.voon,
lars.persson, netdev, LKML
From: "Kweh, Hock Leong" <hock.leong.kweh@intel.com>
Fixing the gmac4 mdio write access to use MII_GMAC4_WRITE only instead of
OR together with MII_WRITE.
Signed-off-by: Kweh, Hock Leong <hock.leong.kweh@intel.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index fda01f7..b0344c2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -116,7 +116,7 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg,
unsigned int mii_address = priv->hw->mii.addr;
unsigned int mii_data = priv->hw->mii.data;
- u32 value = MII_WRITE | MII_BUSY;
+ u32 value = MII_BUSY;
value |= (phyaddr << priv->hw->mii.addr_shift)
& priv->hw->mii.addr_mask;
@@ -126,6 +126,8 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg,
& priv->hw->mii.clk_csr_mask;
if (priv->plat->has_gmac4)
value |= MII_GMAC4_WRITE;
+ else
+ value |= MII_WRITE;
/* Wait until any existing MII operation is complete */
if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address))
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: stmmac: fix incorrect bit set in gmac4 mdio addr register
2016-12-27 20:07 [PATCH] net: stmmac: fix incorrect bit set in gmac4 mdio addr register Kweh, Hock Leong
@ 2016-12-27 12:11 ` Joao Pinto
2016-12-27 17:30 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Joao Pinto @ 2016-12-27 12:11 UTC (permalink / raw)
To: Kweh, Hock Leong, David S. Miller, Joao Pinto,
Giuseppe CAVALLARO, seraphin.bonnaffe, f.fainelli
Cc: Alexandre TORGUE, Joachim Eastwood, Niklas Cassel, Johan Hovold,
pavel, Ong Boon Leong, weifeng.voon, lars.persson, netdev, LKML
Às 8:07 PM de 12/27/2016, Kweh, Hock Leong escreveu:
> From: "Kweh, Hock Leong" <hock.leong.kweh@intel.com>
>
> Fixing the gmac4 mdio write access to use MII_GMAC4_WRITE only instead of
> OR together with MII_WRITE.
>
> Signed-off-by: Kweh, Hock Leong <hock.leong.kweh@intel.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> index fda01f7..b0344c2 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> @@ -116,7 +116,7 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg,
> unsigned int mii_address = priv->hw->mii.addr;
> unsigned int mii_data = priv->hw->mii.data;
>
> - u32 value = MII_WRITE | MII_BUSY;
> + u32 value = MII_BUSY;
>
> value |= (phyaddr << priv->hw->mii.addr_shift)
> & priv->hw->mii.addr_mask;
> @@ -126,6 +126,8 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg,
> & priv->hw->mii.clk_csr_mask;
> if (priv->plat->has_gmac4)
> value |= MII_GMAC4_WRITE;
> + else
> + value |= MII_WRITE;
>
> /* Wait until any existing MII operation is complete */
> if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address))
>
Acked-By: Joao Pinto <jpinto@synopsys.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: stmmac: fix incorrect bit set in gmac4 mdio addr register
2016-12-27 20:07 [PATCH] net: stmmac: fix incorrect bit set in gmac4 mdio addr register Kweh, Hock Leong
2016-12-27 12:11 ` Joao Pinto
@ 2016-12-27 17:30 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-12-27 17:30 UTC (permalink / raw)
To: hock.leong.kweh
Cc: Joao.Pinto, peppe.cavallaro, seraphin.bonnaffe, f.fainelli,
alexandre.torgue, manabian, niklas.cassel, johan, pavel,
boon.leong.ong, weifeng.voon, lars.persson, netdev, linux-kernel
From: "Kweh, Hock Leong" <hock.leong.kweh@intel.com>
Date: Wed, 28 Dec 2016 04:07:41 +0800
> From: "Kweh, Hock Leong" <hock.leong.kweh@intel.com>
>
> Fixing the gmac4 mdio write access to use MII_GMAC4_WRITE only instead of
> OR together with MII_WRITE.
>
> Signed-off-by: Kweh, Hock Leong <hock.leong.kweh@intel.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-27 17:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-27 20:07 [PATCH] net: stmmac: fix incorrect bit set in gmac4 mdio addr register Kweh, Hock Leong
2016-12-27 12:11 ` Joao Pinto
2016-12-27 17:30 ` David Miller
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).