* [PATCH] sh_eth: fix SH7757 GEther initialization
@ 2018-01-04 18:06 Sergei Shtylyov
2018-01-05 18:59 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2018-01-04 18:06 UTC (permalink / raw)
To: netdev; +Cc: linux-renesas-soc, linux-sh, Sergei Shtylyov
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: 150647fb2c31 ("net: sh_eth: change the condition of initialization")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
The patch is against DaveM's 'net.git' repo.
drivers/net/ethernet/renesas/sh_eth.c | 4 ++--
include/linux/sh_eth.h | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
Index: net/drivers/net/ethernet/renesas/sh_eth.c
=================================--- net.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net/drivers/net/ethernet/renesas/sh_eth.c
@@ -3254,8 +3254,8 @@ static int sh_eth_drv_probe(struct platf
ndev->features = NETIF_F_HW_VLAN_CTAG_FILTER;
}
- /* initialize first or needed device */
- if (!devno || pd->needs_init) {
+ /* Need to init only the first port of the two sharing a TSU */
+ if (devno % 2 = 0) {
if (mdp->cd->chip_reset)
mdp->cd->chip_reset(ndev);
Index: net/include/linux/sh_eth.h
=================================--- net.orig/include/linux/sh_eth.h
+++ net/include/linux/sh_eth.h
@@ -17,7 +17,6 @@ struct sh_eth_plat_data {
unsigned char mac_addr[ETH_ALEN];
unsigned no_ether_link:1;
unsigned ether_link_active_low:1;
- unsigned needs_init:1;
};
#endif
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] sh_eth: fix SH7757 GEther initialization
2018-01-04 18:06 [PATCH] sh_eth: fix SH7757 GEther initialization Sergei Shtylyov
@ 2018-01-05 18:59 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-01-05 18:59 UTC (permalink / raw)
To: sergei.shtylyov; +Cc: netdev, linux-renesas-soc, linux-sh
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Thu, 04 Jan 2018 21:06:49 +0300
> 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: 150647fb2c31 ("net: sh_eth: change the condition of initialization")
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Applied and queued up for -stable.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-05 18:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-04 18:06 [PATCH] sh_eth: fix SH7757 GEther initialization Sergei Shtylyov
2018-01-05 18:59 ` 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).