Skip to content

Commit 5133550

Browse files
Sergei Shtylyovdavem330
authored andcommitted
sh_eth: fix SH7757 GEther initialization
Renesas SH7757 has 2 Fast and 2 Gigabit Ether controllers, while the 'sh_eth' driver can only reset and initialize TSU of the first controller pair. Shimoda-san tried to solve that adding the 'needs_init' member to the 'struct sh_eth_plat_data', however the platform code still never sets this flag. I think that we can infer this information from the 'devno' variable (set to 'platform_device::id') and reset/init the Ether controller pair only for an even 'devno'; therefore 'sh_eth_plat_data::needs_init' can be removed... Fixes: 150647f ("net: sh_eth: change the condition of initialization") Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3e6e867 commit 5133550

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

drivers/net/ethernet/renesas/sh_eth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3254,8 +3254,8 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
32543254
ndev->features = NETIF_F_HW_VLAN_CTAG_FILTER;
32553255
}
32563256

3257-
/* initialize first or needed device */
3258-
if (!devno || pd->needs_init) {
3257+
/* Need to init only the first port of the two sharing a TSU */
3258+
if (devno % 2 == 0) {
32593259
if (mdp->cd->chip_reset)
32603260
mdp->cd->chip_reset(ndev);
32613261

include/linux/sh_eth.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ struct sh_eth_plat_data {
1717
unsigned char mac_addr[ETH_ALEN];
1818
unsigned no_ether_link:1;
1919
unsigned ether_link_active_low:1;
20-
unsigned needs_init:1;
2120
};
2221

2322
#endif

0 commit comments

Comments
 (0)