Merge branch 'renesas-eth-fixes'

Sergei Shtylyov says:

====================
Fix some dubious code in the Renesas Ethernet drivers

   Here's a set of 2 patches against DaveM's 'net.git' repo. While initializing
EMAC the code tries to respect the duplex mode both programmed into ECMR and
stored in its own private data -- this just can't be right.

[1/2] ravb: stop reading ECMR in ravb_emac_init()
[2/2] sh_eth: stop reading ECMR in sh_eth_dev_init()
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2016-01-11 17:31:10 -05:00
commit 366f293111
2 changed files with 4 additions and 10 deletions

View File

@ -338,16 +338,13 @@ error:
static void ravb_emac_init(struct net_device *ndev)
{
struct ravb_private *priv = netdev_priv(ndev);
u32 ecmr;
/* Receive frame limit set register */
ravb_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN, RFLR);
/* PAUSE prohibition */
ecmr = ravb_read(ndev, ECMR);
ecmr &= ECMR_DM;
ecmr |= ECMR_ZPF | (priv->duplex ? ECMR_DM : 0) | ECMR_TE | ECMR_RE;
ravb_write(ndev, ecmr, ECMR);
ravb_write(ndev, ECMR_ZPF | (priv->duplex ? ECMR_DM : 0) |
ECMR_TE | ECMR_RE, ECMR);
ravb_set_rate(ndev);

View File

@ -1289,7 +1289,6 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
{
int ret = 0;
struct sh_eth_private *mdp = netdev_priv(ndev);
u32 val;
/* Soft Reset */
ret = sh_eth_reset(ndev);
@ -1342,10 +1341,8 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
}
/* PAUSE Prohibition */
val = (sh_eth_read(ndev, ECMR) & ECMR_DM) |
ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) | ECMR_TE | ECMR_RE;
sh_eth_write(ndev, val, ECMR);
sh_eth_write(ndev, ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) |
ECMR_TE | ECMR_RE, ECMR);
if (mdp->cd->set_rate)
mdp->cd->set_rate(ndev);