* [PATCH 1/2] SolutionEngine771x: fix Ether platform data
@ 2018-01-03 20:08 Sergei Shtylyov
2018-01-06 18:13 ` Sergei Shtylyov
2018-01-06 18:53 ` Sergei Shtylyov
0 siblings, 2 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2018-01-03 20:08 UTC (permalink / raw)
To: Yoshinori Sato, Rich Felker, linux-sh; +Cc: netdev, Sergei Shtylyov
The 'sh_eth' driver's probe() method would fail on the SolutionEngine7710
board and crash on SolutionEngine7712 board as the platform code is
hopelessly behind the driver's platform data -- it passes the PHY address
instead of 'struct sh_eth_plat_data *'; pass the latter to the driver in
order to fix the bug...
Fixes: 71557a37adb5 ("[netdrvr] sh_eth: Add SH7619 support")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
The patch is against Paul Mundt's 'linux-sh.git' repo, 'sh-latest' branch.
arch/sh/boards/mach-se/770x/setup.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Index: linux/arch/sh/boards/mach-se/770x/setup.c
=================================--- linux.orig/arch/sh/boards/mach-se/770x/setup.c
+++ linux/arch/sh/boards/mach-se/770x/setup.c
@@ -115,6 +115,11 @@ static struct platform_device heartbeat_
#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
defined(CONFIG_CPU_SUBTYPE_SH7712)
/* SH771X Ethernet driver */
+static struct sh_eth_plat_data sh_eth_plat = {
+ .phy = PHY_ID,
+ .phy_interface = PHY_INTERFACE_MODE_MII,
+};
+
static struct resource sh_eth0_resources[] = {
[0] = {
.start = SH_ETH0_BASE,
@@ -132,7 +137,7 @@ static struct platform_device sh_eth0_de
.name = "sh771x-ether",
.id = 0,
.dev = {
- .platform_data = PHY_ID,
+ .platform_data = &sh_eth_plat,
},
.num_resources = ARRAY_SIZE(sh_eth0_resources),
.resource = sh_eth0_resources,
@@ -155,7 +160,7 @@ static struct platform_device sh_eth1_de
.name = "sh771x-ether",
.id = 1,
.dev = {
- .platform_data = PHY_ID,
+ .platform_data = &sh_eth_plat,
},
.num_resources = ARRAY_SIZE(sh_eth1_resources),
.resource = sh_eth1_resources,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] SolutionEngine771x: fix Ether platform data
2018-01-03 20:08 [PATCH 1/2] SolutionEngine771x: fix Ether platform data Sergei Shtylyov
@ 2018-01-06 18:13 ` Sergei Shtylyov
2018-01-06 18:53 ` Sergei Shtylyov
1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2018-01-06 18:13 UTC (permalink / raw)
To: Yoshinori Sato, Rich Felker, linux-sh; +Cc: netdev
Hello!
On 01/03/2018 11:08 PM, Sergei Shtylyov wrote:
> The 'sh_eth' driver's probe() method would fail on the SolutionEngine7710
> board and crash on SolutionEngine7712 board as the platform code is
> hopelessly behind the driver's platform data -- it passes the PHY address
> instead of 'struct sh_eth_plat_data *'; pass the latter to the driver in
> order to fix the bug...
>
> Fixes: 71557a37adb5 ("[netdrvr] sh_eth: Add SH7619 support")
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
[...]
Now that I was finally able to build an SH kernel, I realized that I
forgot to add #include <linux/sh_eth.h>... :-/
MBR, Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] SolutionEngine771x: fix Ether platform data
2018-01-03 20:08 [PATCH 1/2] SolutionEngine771x: fix Ether platform data Sergei Shtylyov
2018-01-06 18:13 ` Sergei Shtylyov
@ 2018-01-06 18:53 ` Sergei Shtylyov
1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2018-01-06 18:53 UTC (permalink / raw)
To: Yoshinori Sato, Rich Felker, linux-sh; +Cc: netdev, Sergei Shtylyov
The 'sh_eth' driver's probe() method would fail on the SolutionEngine7710
board and crash on SolutionEngine7712 board as the platform code is
hopelessly behind the driver's platform data -- it passes the PHY address
instead of 'struct sh_eth_plat_data *'; pass the latter to the driver in
order to fix the bug...
Fixes: 71557a37adb5 ("[netdrvr] sh_eth: Add SH7619 support")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
Changes in version 2:
- added the necessary #include.
arch/sh/boards/mach-se/770x/setup.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
Index: linux/arch/sh/boards/mach-se/770x/setup.c
=================================--- linux.orig/arch/sh/boards/mach-se/770x/setup.c
+++ linux/arch/sh/boards/mach-se/770x/setup.c
@@ -9,6 +9,7 @@
*/
#include <linux/init.h>
#include <linux/platform_device.h>
+#include <linux/sh_eth.h>
#include <mach-se/mach/se.h>
#include <mach-se/mach/mrshpc.h>
#include <asm/machvec.h>
@@ -115,6 +116,11 @@ static struct platform_device heartbeat_
#if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
defined(CONFIG_CPU_SUBTYPE_SH7712)
/* SH771X Ethernet driver */
+static struct sh_eth_plat_data sh_eth_plat = {
+ .phy = PHY_ID,
+ .phy_interface = PHY_INTERFACE_MODE_MII,
+};
+
static struct resource sh_eth0_resources[] = {
[0] = {
.start = SH_ETH0_BASE,
@@ -132,7 +138,7 @@ static struct platform_device sh_eth0_de
.name = "sh771x-ether",
.id = 0,
.dev = {
- .platform_data = PHY_ID,
+ .platform_data = &sh_eth_plat,
},
.num_resources = ARRAY_SIZE(sh_eth0_resources),
.resource = sh_eth0_resources,
@@ -155,7 +161,7 @@ static struct platform_device sh_eth1_de
.name = "sh771x-ether",
.id = 1,
.dev = {
- .platform_data = PHY_ID,
+ .platform_data = &sh_eth_plat,
},
.num_resources = ARRAY_SIZE(sh_eth1_resources),
.resource = sh_eth1_resources,
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-06 18:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-03 20:08 [PATCH 1/2] SolutionEngine771x: fix Ether platform data Sergei Shtylyov
2018-01-06 18:13 ` Sergei Shtylyov
2018-01-06 18:53 ` Sergei Shtylyov
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).