Commit 366f2931 authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 66530bdf bffa731f
......@@ -338,16 +338,13 @@ static int ravb_ring_init(struct net_device *ndev, int q)
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);
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment