* [PATCH v4 0/8] sh_eth: deal with #ifdef'fery
@ 2013-06-05 21:06 Sergei Shtylyov
2013-06-05 21:09 ` [PATCH v4 1/8] sh_eth: remove #ifdef around EDSR and GECMR bit definitions Sergei Shtylyov
` (9 more replies)
0 siblings, 10 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2013-06-05 21:06 UTC (permalink / raw)
To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh
Hello.
This series deals mostly with excess #ifdef'fery in the 'sh_eth' driver.
It doesn't yet get rid of all the #ifdef'fery but that's a matter of another
patchset. The last patch (it was almost in the middle of the series before),
contrarywise, adds one missing #ifdef...
[1/8] sh_eth: remove #ifdef around EDSR and GECMR bit definitions
[2/8] sh_eth: use EDSR_ENALL to set EDSR
[3/8] sh_eth: remove duplicate sh_eth_set_duplex() definitions
[4/8] sh_eth: remove SH_ETH_HAS_TSU
[5/8] sh_eth: add IRQ flags to 'struct sh_eth_cpu_data'
[6/8] sh_eth: remove #ifdef around sh_eth_select_mii()
[7/8] sh_eth: consolidate sh_eth_reset()
[8/8] sh_eth: enclose PM code into #ifdef CONFIG_PM
WBR, Sergei
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v4 1/8] sh_eth: remove #ifdef around EDSR and GECMR bit definitions
2013-06-05 21:06 [PATCH v4 0/8] sh_eth: deal with #ifdef'fery Sergei Shtylyov
@ 2013-06-05 21:09 ` Sergei Shtylyov
2013-06-05 21:11 ` [PATCH v4 2/8] sh_eth: use EDSR_ENALL to set EDSR Sergei Shtylyov
` (8 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2013-06-05 21:09 UTC (permalink / raw)
To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
SH7757 also has EDSR, so add a comment about it to 'enum EDSR_BIT'.
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
[Sergei: folded in the former patch #2, updated the changelog, reworded the
subject, changing the prefix.]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
Changes in version 4:
- folded in the former patch #2, updated the changelog accordingly;
- reworded the subject, changing the prefix.
Changes in version 3:
- fix comment.
drivers/net/ethernet/renesas/sh_eth.h | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
Index: net-next/drivers/net/ethernet/renesas/sh_eth.h
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h
+++ net-next/drivers/net/ethernet/renesas/sh_eth.h
@@ -166,19 +166,16 @@ enum {
/*
* Register's bits
*/
-#if defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763) ||\
- defined(CONFIG_ARCH_R8A7740)
-/* EDSR */
+/* EDSR : sh7734, sh7757, sh7763, and r8a7740 only */
enum EDSR_BIT {
EDSR_ENT = 0x01, EDSR_ENR = 0x02,
};
#define EDSR_ENALL (EDSR_ENT|EDSR_ENR)
-/* GECMR */
+/* GECMR : sh7734, sh7763 and r8a7740 only */
enum GECMR_BIT {
GECMR_10 = 0x0, GECMR_100 = 0x04, GECMR_1000 = 0x01,
};
-#endif
/* EDMR */
enum DMAC_M_BIT {
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v4 2/8] sh_eth: use EDSR_ENALL to set EDSR
2013-06-05 21:06 [PATCH v4 0/8] sh_eth: deal with #ifdef'fery Sergei Shtylyov
2013-06-05 21:09 ` [PATCH v4 1/8] sh_eth: remove #ifdef around EDSR and GECMR bit definitions Sergei Shtylyov
@ 2013-06-05 21:11 ` Sergei Shtylyov
2013-06-05 21:12 ` [PATCH v4 3/8] sh_eth: remove duplicate sh_eth_set_duplex() definitions Sergei Shtylyov
` (7 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2013-06-05 21:11 UTC (permalink / raw)
To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Use now always available EDSR_ENALL instead of the bare number to set EDSR.
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
[Sergei: added the changelog, reworded the subject, changing the prefix.]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
Changes in version 4:
- added the changelog;
- reworded the subject, changing the prefix.
drivers/net/ethernet/renesas/sh_eth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -523,7 +523,7 @@ static int sh_eth_reset(struct net_devic
int ret = 0;
if (sh_eth_is_gether(mdp)) {
- sh_eth_write(ndev, 0x03, EDSR);
+ sh_eth_write(ndev, EDSR_ENALL, EDSR);
sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_GETHER,
EDMR);
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v4 3/8] sh_eth: remove duplicate sh_eth_set_duplex() definitions
2013-06-05 21:06 [PATCH v4 0/8] sh_eth: deal with #ifdef'fery Sergei Shtylyov
2013-06-05 21:09 ` [PATCH v4 1/8] sh_eth: remove #ifdef around EDSR and GECMR bit definitions Sergei Shtylyov
2013-06-05 21:11 ` [PATCH v4 2/8] sh_eth: use EDSR_ENALL to set EDSR Sergei Shtylyov
@ 2013-06-05 21:12 ` Sergei Shtylyov
2013-06-05 21:14 ` [PATCH v4 4/8] sh_eth: remove SH_ETH_HAS_TSU Sergei Shtylyov
` (6 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2013-06-05 21:12 UTC (permalink / raw)
To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Remove all the duplicate definitions of sh_eth_set_duplex() under different
#ifdef's, leaving only one outside the #ifdef's. We have to annotate it with
'__maybe_unused' since it's called not from all SoC #ifdef blocks.
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
[Sergei: annotated sh_eth_set_duplex() as '__maybe_unused', added the changelog,
reworded the subject, changing the prefix.]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
Changes in version 4:
- annotated sh_eth_set_duplex() as '__maybe_unused';
- refreshed the patch;
- added the changelog;
- reworded the subject, changing the prefix.
Changes in version 3:
- remove empty sh_eth_set_duplex() for SH7619, SH7710 and SH7712 cases.
drivers/net/ethernet/renesas/sh_eth.c | 59 ++--------------------------------
1 file changed, 5 insertions(+), 54 deletions(-)
Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -341,10 +341,7 @@ static void sh_eth_select_mii(struct net
}
#endif
-/* There is CPU dependent code */
-#if defined(CONFIG_ARCH_R8A7778) || defined(CONFIG_ARCH_R8A7779)
-#define SH_ETH_RESET_DEFAULT 1
-static void sh_eth_set_duplex(struct net_device *ndev)
+static void __maybe_unused sh_eth_set_duplex(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -354,6 +351,9 @@ static void sh_eth_set_duplex(struct net
sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
}
+/* There is CPU dependent code */
+#if defined(CONFIG_ARCH_R8A7778) || defined(CONFIG_ARCH_R8A7779)
+#define SH_ETH_RESET_DEFAULT 1
static void sh_eth_set_rate(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -391,15 +391,6 @@ static struct sh_eth_cpu_data sh_eth_my_
};
#elif defined(CONFIG_CPU_SUBTYPE_SH7724)
#define SH_ETH_RESET_DEFAULT 1
-static void sh_eth_set_duplex(struct net_device *ndev)
-{
- struct sh_eth_private *mdp = netdev_priv(ndev);
-
- if (mdp->duplex) /* Full */
- sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
- else /* Half */
- sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
-}
static void sh_eth_set_rate(struct net_device *ndev)
{
@@ -443,16 +434,6 @@ static struct sh_eth_cpu_data sh_eth_my_
#define SH_ETH_HAS_TSU 1
static int sh_eth_check_reset(struct net_device *ndev);
-static void sh_eth_set_duplex(struct net_device *ndev)
-{
- struct sh_eth_private *mdp = netdev_priv(ndev);
-
- if (mdp->duplex) /* Full */
- sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
- else /* Half */
- sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
-}
-
static void sh_eth_set_rate(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -552,16 +533,6 @@ out:
return ret;
}
-static void sh_eth_set_duplex_giga(struct net_device *ndev)
-{
- struct sh_eth_private *mdp = netdev_priv(ndev);
-
- if (mdp->duplex) /* Full */
- sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
- else /* Half */
- sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
-}
-
static void sh_eth_set_rate_giga(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -584,7 +555,7 @@ static void sh_eth_set_rate_giga(struct
/* SH7757(GETHERC) */
static struct sh_eth_cpu_data sh_eth_my_cpu_data_giga = {
.chip_reset = sh_eth_chip_reset_giga,
- .set_duplex = sh_eth_set_duplex_giga,
+ .set_duplex = sh_eth_set_duplex,
.set_rate = sh_eth_set_rate_giga,
.ecsr_value = ECSR_ICD | ECSR_MPD,
@@ -634,16 +605,6 @@ static void sh_eth_chip_reset(struct net
mdelay(1);
}
-static void sh_eth_set_duplex(struct net_device *ndev)
-{
- struct sh_eth_private *mdp = netdev_priv(ndev);
-
- if (mdp->duplex) /* Full */
- sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
- else /* Half */
- sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
-}
-
static void sh_eth_set_rate(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -771,16 +732,6 @@ out:
return ret;
}
-static void sh_eth_set_duplex(struct net_device *ndev)
-{
- struct sh_eth_private *mdp = netdev_priv(ndev);
-
- if (mdp->duplex) /* Full */
- sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_DM, ECMR);
- else /* Half */
- sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_DM, ECMR);
-}
-
static void sh_eth_set_rate(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v4 4/8] sh_eth: remove SH_ETH_HAS_TSU
2013-06-05 21:06 [PATCH v4 0/8] sh_eth: deal with #ifdef'fery Sergei Shtylyov
` (2 preceding siblings ...)
2013-06-05 21:12 ` [PATCH v4 3/8] sh_eth: remove duplicate sh_eth_set_duplex() definitions Sergei Shtylyov
@ 2013-06-05 21:14 ` Sergei Shtylyov
2013-06-05 21:15 ` [PATCH v4 5/8] sh_eth: add IRQ flags to 'struct sh_eth_cpu_data' Sergei Shtylyov
` (5 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2013-06-05 21:14 UTC (permalink / raw)
To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Remove SH_ETH_HAS_TSU #define's and #ifdef's. Set three 'struct net_device_ops'
methods that depend on the presence of TSU basing on the 'tsu' field of 'struct
sh_eth_cpu_data'.
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
[Sergei: made two method assignments one-liners, added the changelog, reworded
the subject, changing the prefix.]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
Changes in version 4:
- made two method assignments one-liners;
- refreshed the patch;
- added the changelog;
- reworded the subject, changing the prefix.
drivers/net/ethernet/renesas/sh_eth.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -431,7 +431,6 @@ static struct sh_eth_cpu_data sh_eth_my_
};
#elif defined(CONFIG_CPU_SUBTYPE_SH7757)
#define SH_ETH_HAS_BOTH_MODULES 1
-#define SH_ETH_HAS_TSU 1
static int sh_eth_check_reset(struct net_device *ndev);
static void sh_eth_set_rate(struct net_device *ndev)
@@ -592,7 +591,6 @@ static struct sh_eth_cpu_data *sh_eth_ge
}
#elif defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763)
-#define SH_ETH_HAS_TSU 1
static int sh_eth_check_reset(struct net_device *ndev);
static void sh_eth_reset_hw_crc(struct net_device *ndev);
@@ -693,7 +691,6 @@ static void sh_eth_reset_hw_crc(struct n
}
#elif defined(CONFIG_ARCH_R8A7740)
-#define SH_ETH_HAS_TSU 1
static int sh_eth_check_reset(struct net_device *ndev);
static void sh_eth_chip_reset(struct net_device *ndev)
@@ -791,7 +788,6 @@ static struct sh_eth_cpu_data sh_eth_my_
};
#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
#define SH_ETH_RESET_DEFAULT 1
-#define SH_ETH_HAS_TSU 1
static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
.eesipr_value = DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff,
.tsu = 1,
@@ -2105,7 +2101,6 @@ static int sh_eth_do_ioctl(struct net_de
return phy_mii_ioctl(phydev, rq, cmd);
}
-#if defined(SH_ETH_HAS_TSU)
/* For TSU_POSTn. Please refer to the manual about this (strange) bitfields */
static void *sh_eth_tsu_get_post_reg_offset(struct sh_eth_private *mdp,
int entry)
@@ -2448,7 +2443,6 @@ static int sh_eth_vlan_rx_kill_vid(struc
return 0;
}
-#endif /* SH_ETH_HAS_TSU */
/* SuperH's TSU register init function */
static void sh_eth_tsu_init(struct sh_eth_private *mdp)
@@ -2587,16 +2581,11 @@ static const u16 *sh_eth_get_register_of
return reg_offset;
}
-static const struct net_device_ops sh_eth_netdev_ops = {
+static struct net_device_ops sh_eth_netdev_ops = {
.ndo_open = sh_eth_open,
.ndo_stop = sh_eth_close,
.ndo_start_xmit = sh_eth_start_xmit,
.ndo_get_stats = sh_eth_get_stats,
-#if defined(SH_ETH_HAS_TSU)
- .ndo_set_rx_mode = sh_eth_set_multicast_list,
- .ndo_vlan_rx_add_vid = sh_eth_vlan_rx_add_vid,
- .ndo_vlan_rx_kill_vid = sh_eth_vlan_rx_kill_vid,
-#endif
.ndo_tx_timeout = sh_eth_tx_timeout,
.ndo_do_ioctl = sh_eth_do_ioctl,
.ndo_validate_addr = eth_validate_addr,
@@ -2677,6 +2666,13 @@ static int sh_eth_drv_probe(struct platf
sh_eth_set_default_cpu_data(mdp->cd);
/* set function */
+ if (mdp->cd->tsu) {
+ sh_eth_netdev_ops.ndo_set_rx_mode = sh_eth_set_multicast_list;
+ sh_eth_netdev_ops.ndo_vlan_rx_add_vid = sh_eth_vlan_rx_add_vid;
+ sh_eth_netdev_ops.ndo_vlan_rx_kill_vid =
+ sh_eth_vlan_rx_kill_vid;
+ }
+
ndev->netdev_ops = &sh_eth_netdev_ops;
SET_ETHTOOL_OPS(ndev, &sh_eth_ethtool_ops);
ndev->watchdog_timeo = TX_TIMEOUT;
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v4 5/8] sh_eth: add IRQ flags to 'struct sh_eth_cpu_data'
2013-06-05 21:06 [PATCH v4 0/8] sh_eth: deal with #ifdef'fery Sergei Shtylyov
` (3 preceding siblings ...)
2013-06-05 21:14 ` [PATCH v4 4/8] sh_eth: remove SH_ETH_HAS_TSU Sergei Shtylyov
@ 2013-06-05 21:15 ` Sergei Shtylyov
2013-06-05 21:16 ` [PATCH v4 6/8] sh_eth: remove #ifdef around sh_eth_select_mii() Sergei Shtylyov
` (4 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2013-06-05 21:15 UTC (permalink / raw)
To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
The driver supports some SH and SH-Mobile SOCs. There are SOCs with two or more
Ethernet devices, for these we need to pass IRQF_SHARED to request_irq(). Add
the 'irq_flags' field to the 'struct sh_eth_cpu_data' instead of #ifdef'fery.
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
[Sergei: properly aligned request_irq() call continuation line, reworded the
changelog, reworded the subject, changing the prefix.]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
Changes in version 4:
- resolved reject;
- properly aligned request_irq() call continuation line;
- reworded the changelog;
- reworded the subject, changing the prefix.
Changes in version 3:
- remove 'irq_flags' from 'struct sh_eth_private';
- fix indentation.
drivers/net/ethernet/renesas/sh_eth.c | 13 +++++--------
drivers/net/ethernet/renesas/sh_eth.h | 1 +
2 files changed, 6 insertions(+), 8 deletions(-)
Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -462,6 +462,7 @@ static struct sh_eth_cpu_data sh_eth_my_
EESR_RFRMER | EESR_TFE | EESR_TDE | EESR_ECI,
.tx_error_check = EESR_TWB | EESR_TABT | EESR_TDE | EESR_TFE,
+ .irq_flags = IRQF_SHARED,
.apr = 1,
.mpr = 1,
.tpauser = 1,
@@ -570,6 +571,7 @@ static struct sh_eth_cpu_data sh_eth_my_
.fdr_value = 0x0000072f,
.rmcr_value = 0x00000001,
+ .irq_flags = IRQF_SHARED,
.apr = 1,
.mpr = 1,
.tpauser = 1,
@@ -650,6 +652,8 @@ static struct sh_eth_cpu_data sh_eth_my_
#if defined(CONFIG_CPU_SUBTYPE_SH7734)
.hw_crc = 1,
.select_mii = 1,
+#else
+ .irq_flags = IRQF_SHARED,
#endif
};
@@ -1908,14 +1912,7 @@ static int sh_eth_open(struct net_device
pm_runtime_get_sync(&mdp->pdev->dev);
ret = request_irq(ndev->irq, sh_eth_interrupt,
-#if defined(CONFIG_CPU_SUBTYPE_SH7763) || \
- defined(CONFIG_CPU_SUBTYPE_SH7764) || \
- defined(CONFIG_CPU_SUBTYPE_SH7757)
- IRQF_SHARED,
-#else
- 0,
-#endif
- ndev->name, ndev);
+ mdp->cd->irq_flags, ndev->name, ndev);
if (ret) {
dev_err(&ndev->dev, "Can not assign IRQ number\n");
return ret;
Index: net-next/drivers/net/ethernet/renesas/sh_eth.h
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h
+++ net-next/drivers/net/ethernet/renesas/sh_eth.h
@@ -463,6 +463,7 @@ struct sh_eth_cpu_data {
unsigned long tx_error_check;
/* hardware features */
+ unsigned long irq_flags; /* IRQ configuration flags */
unsigned no_psr:1; /* EtherC DO NOT have PSR */
unsigned apr:1; /* EtherC have APR */
unsigned mpr:1; /* EtherC have MPR */
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v4 6/8] sh_eth: remove #ifdef around sh_eth_select_mii()
2013-06-05 21:06 [PATCH v4 0/8] sh_eth: deal with #ifdef'fery Sergei Shtylyov
` (4 preceding siblings ...)
2013-06-05 21:15 ` [PATCH v4 5/8] sh_eth: add IRQ flags to 'struct sh_eth_cpu_data' Sergei Shtylyov
@ 2013-06-05 21:16 ` Sergei Shtylyov
2013-06-05 21:19 ` [PATCH v4 7/8] sh_eth: consolidate sh_eth_reset() Sergei Shtylyov
` (3 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2013-06-05 21:16 UTC (permalink / raw)
To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
We can simply remove #ifdef'fery around sh_eth_select_mii(). We have to annotate
it with '__maybe_unused' then.
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
[Sergei: added the changelog, reworded the subject, changing the prefix.]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
Changes in version 4:
- refreshed the patch;
- added the changelog;
- reworded the subject, changing the prefix.
Changes in version 3:
- annotated sh_eth_select_mii() with '__maybe_unused'.
drivers/net/ethernet/renesas/sh_eth.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -313,10 +313,7 @@ static const u16 sh_eth_offset_fast_sh3_
[TSU_ADRL31] = 0x01fc,
};
-#if defined(CONFIG_CPU_SUBTYPE_SH7734) || \
- defined(CONFIG_CPU_SUBTYPE_SH7763) || \
- defined(CONFIG_ARCH_R8A7740)
-static void sh_eth_select_mii(struct net_device *ndev)
+static void __maybe_unused sh_eth_select_mii(struct net_device *ndev)
{
u32 value = 0x0;
struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -339,7 +336,6 @@ static void sh_eth_select_mii(struct net
sh_eth_write(ndev, value, RMII_MII);
}
-#endif
static void __maybe_unused sh_eth_set_duplex(struct net_device *ndev)
{
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v4 7/8] sh_eth: consolidate sh_eth_reset()
2013-06-05 21:06 [PATCH v4 0/8] sh_eth: deal with #ifdef'fery Sergei Shtylyov
` (5 preceding siblings ...)
2013-06-05 21:16 ` [PATCH v4 6/8] sh_eth: remove #ifdef around sh_eth_select_mii() Sergei Shtylyov
@ 2013-06-05 21:19 ` Sergei Shtylyov
2013-06-05 22:50 ` Sergei Shtylyov
2013-06-05 21:20 ` [PATCH v4 8/8] sh_eth: enclose PM code into #ifdef CONFIG_PM Sergei Shtylyov
` (2 subsequent siblings)
9 siblings, 1 reply; 15+ messages in thread
From: Sergei Shtylyov @ 2013-06-05 21:19 UTC (permalink / raw)
To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
This driver has sh_eth_reset() function for each SoC and this function is almost
always the same, except for the several a bit different variations for Gigabit
Ethernet. Consolidate every variation into a single function -- which allows
us to get rid of some more #ifdef'fery.
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
[Sergei: moved the new sh_eth_reset() upper to decrease the patch size, fixed
function call continuation lines' indentation, reworded the changelog, reworded
the subject, changing the prefix.]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
Changes in version 4:
- moved the new sh_eth_reset() upper to desrease the patch size;
- fixed function call continuation lines' indentation;
- refreshed the patch;
- reworded the summary;
- reworded the subject, changing the prefix.
drivers/net/ethernet/renesas/sh_eth.c | 158 +++++++++-------------------------
1 file changed, 43 insertions(+), 115 deletions(-)
Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -349,7 +349,6 @@ static void __maybe_unused sh_eth_set_du
/* There is CPU dependent code */
#if defined(CONFIG_ARCH_R8A7778) || defined(CONFIG_ARCH_R8A7779)
-#define SH_ETH_RESET_DEFAULT 1
static void sh_eth_set_rate(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -386,7 +385,6 @@ static struct sh_eth_cpu_data sh_eth_my_
.hw_swap = 1,
};
#elif defined(CONFIG_CPU_SUBTYPE_SH7724)
-#define SH_ETH_RESET_DEFAULT 1
static void sh_eth_set_rate(struct net_device *ndev)
{
@@ -427,7 +425,6 @@ static struct sh_eth_cpu_data sh_eth_my_
};
#elif defined(CONFIG_CPU_SUBTYPE_SH7757)
#define SH_ETH_HAS_BOTH_MODULES 1
-static int sh_eth_check_reset(struct net_device *ndev);
static void sh_eth_set_rate(struct net_device *ndev)
{
@@ -494,40 +491,6 @@ static void sh_eth_chip_reset_giga(struc
}
static int sh_eth_is_gether(struct sh_eth_private *mdp);
-static int sh_eth_reset(struct net_device *ndev)
-{
- struct sh_eth_private *mdp = netdev_priv(ndev);
- int ret = 0;
-
- if (sh_eth_is_gether(mdp)) {
- sh_eth_write(ndev, EDSR_ENALL, EDSR);
- sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_GETHER,
- EDMR);
-
- ret = sh_eth_check_reset(ndev);
- if (ret)
- goto out;
-
- /* Table Init */
- sh_eth_write(ndev, 0x0, TDLAR);
- sh_eth_write(ndev, 0x0, TDFAR);
- sh_eth_write(ndev, 0x0, TDFXR);
- sh_eth_write(ndev, 0x0, TDFFR);
- sh_eth_write(ndev, 0x0, RDLAR);
- sh_eth_write(ndev, 0x0, RDFAR);
- sh_eth_write(ndev, 0x0, RDFXR);
- sh_eth_write(ndev, 0x0, RDFFR);
- } else {
- sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_ETHER,
- EDMR);
- mdelay(3);
- sh_eth_write(ndev, sh_eth_read(ndev, EDMR) & ~EDMR_SRST_ETHER,
- EDMR);
- }
-
-out:
- return ret;
-}
static void sh_eth_set_rate_giga(struct net_device *ndev)
{
@@ -589,8 +552,6 @@ static struct sh_eth_cpu_data *sh_eth_ge
}
#elif defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763)
-static int sh_eth_check_reset(struct net_device *ndev);
-static void sh_eth_reset_hw_crc(struct net_device *ndev);
static void sh_eth_chip_reset(struct net_device *ndev)
{
@@ -653,45 +614,8 @@ static struct sh_eth_cpu_data sh_eth_my_
#endif
};
-static int sh_eth_reset(struct net_device *ndev)
-{
- int ret = 0;
-
- sh_eth_write(ndev, EDSR_ENALL, EDSR);
- sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_GETHER, EDMR);
-
- ret = sh_eth_check_reset(ndev);
- if (ret)
- goto out;
-
- /* Table Init */
- sh_eth_write(ndev, 0x0, TDLAR);
- sh_eth_write(ndev, 0x0, TDFAR);
- sh_eth_write(ndev, 0x0, TDFXR);
- sh_eth_write(ndev, 0x0, TDFFR);
- sh_eth_write(ndev, 0x0, RDLAR);
- sh_eth_write(ndev, 0x0, RDFAR);
- sh_eth_write(ndev, 0x0, RDFXR);
- sh_eth_write(ndev, 0x0, RDFFR);
-
- /* Reset HW CRC register */
- sh_eth_reset_hw_crc(ndev);
-
- /* Select MII mode */
- if (sh_eth_my_cpu_data.select_mii)
- sh_eth_select_mii(ndev);
-out:
- return ret;
-}
-
-static void sh_eth_reset_hw_crc(struct net_device *ndev)
-{
- if (sh_eth_my_cpu_data.hw_crc)
- sh_eth_write(ndev, 0x0, CSMR);
-}
#elif defined(CONFIG_ARCH_R8A7740)
-static int sh_eth_check_reset(struct net_device *ndev);
static void sh_eth_chip_reset(struct net_device *ndev)
{
@@ -704,31 +628,6 @@ static void sh_eth_chip_reset(struct net
sh_eth_select_mii(ndev);
}
-static int sh_eth_reset(struct net_device *ndev)
-{
- int ret = 0;
-
- sh_eth_write(ndev, EDSR_ENALL, EDSR);
- sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_GETHER, EDMR);
-
- ret = sh_eth_check_reset(ndev);
- if (ret)
- goto out;
-
- /* Table Init */
- sh_eth_write(ndev, 0x0, TDLAR);
- sh_eth_write(ndev, 0x0, TDFAR);
- sh_eth_write(ndev, 0x0, TDFXR);
- sh_eth_write(ndev, 0x0, TDFFR);
- sh_eth_write(ndev, 0x0, RDLAR);
- sh_eth_write(ndev, 0x0, RDFAR);
- sh_eth_write(ndev, 0x0, RDFXR);
- sh_eth_write(ndev, 0x0, RDFFR);
-
-out:
- return ret;
-}
-
static void sh_eth_set_rate(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -777,7 +676,6 @@ static struct sh_eth_cpu_data sh_eth_my_
};
#elif defined(CONFIG_CPU_SUBTYPE_SH7619)
-#define SH_ETH_RESET_DEFAULT 1
static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
.eesipr_value = DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff,
@@ -787,7 +685,6 @@ static struct sh_eth_cpu_data sh_eth_my_
.hw_swap = 1,
};
#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
-#define SH_ETH_RESET_DEFAULT 1
static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
.eesipr_value = DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff,
.tsu = 1,
@@ -822,17 +719,6 @@ static void sh_eth_set_default_cpu_data(
cd->tx_error_check = DEFAULT_TX_ERROR_CHECK;
}
-#if defined(SH_ETH_RESET_DEFAULT)
-/* Chip Reset */
-static int sh_eth_reset(struct net_device *ndev)
-{
- sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_ETHER, EDMR);
- mdelay(3);
- sh_eth_write(ndev, sh_eth_read(ndev, EDMR) & ~EDMR_SRST_ETHER, EDMR);
-
- return 0;
-}
-#else
static int sh_eth_check_reset(struct net_device *ndev)
{
int ret = 0;
@@ -850,7 +736,49 @@ static int sh_eth_check_reset(struct net
}
return ret;
}
-#endif
+
+static int sh_eth_reset(struct net_device *ndev)
+{
+ struct sh_eth_private *mdp = netdev_priv(ndev);
+ int ret = 0;
+
+ if (sh_eth_is_gether(mdp)) {
+ sh_eth_write(ndev, EDSR_ENALL, EDSR);
+ sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_GETHER,
+ EDMR);
+
+ ret = sh_eth_check_reset(ndev);
+ if (ret)
+ goto out;
+
+ /* Table Init */
+ sh_eth_write(ndev, 0x0, TDLAR);
+ sh_eth_write(ndev, 0x0, TDFAR);
+ sh_eth_write(ndev, 0x0, TDFXR);
+ sh_eth_write(ndev, 0x0, TDFFR);
+ sh_eth_write(ndev, 0x0, RDLAR);
+ sh_eth_write(ndev, 0x0, RDFAR);
+ sh_eth_write(ndev, 0x0, RDFXR);
+ sh_eth_write(ndev, 0x0, RDFFR);
+
+ /* Reset HW CRC register */
+ if (mdp->cd->hw_crc)
+ sh_eth_write(ndev, 0x0, CSMR);
+
+ /* Select MII mode */
+ if (mdp->cd->select_mii)
+ sh_eth_select_mii(ndev);
+ } else {
+ sh_eth_write(ndev, sh_eth_read(ndev, EDMR) | EDMR_SRST_ETHER,
+ EDMR);
+ mdelay(3);
+ sh_eth_write(ndev, sh_eth_read(ndev, EDMR) & ~EDMR_SRST_ETHER,
+ EDMR);
+ }
+
+out:
+ return ret;
+}
#if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE)
static void sh_eth_set_receive_align(struct sk_buff *skb)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v4 8/8] sh_eth: enclose PM code into #ifdef CONFIG_PM
2013-06-05 21:06 [PATCH v4 0/8] sh_eth: deal with #ifdef'fery Sergei Shtylyov
` (6 preceding siblings ...)
2013-06-05 21:19 ` [PATCH v4 7/8] sh_eth: consolidate sh_eth_reset() Sergei Shtylyov
@ 2013-06-05 21:20 ` Sergei Shtylyov
2013-06-05 22:50 ` [PATCH v4 0/8] sh_eth: deal with #ifdef'fery Sergei Shtylyov
2013-06-06 3:25 ` Magnus Damm
9 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2013-06-05 21:20 UTC (permalink / raw)
To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Put '#ifdef CONFIG_PM' around sh_eth_runtime_nop() and 'sh_eth_dev_pm_ops'.
Add '#define SH_ETH_PM_OPS' to facilitate initialization of driver's 'pm' field
depending on whether CONFIG_PM is enabled.
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
[Sergei: added the changelog, reworded the subject, changing the prefix.]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
Changes in version 4:
- refreshed the patch;
- added the changelog;
- reworded the subject, changing the prefix.
Changes in version 3:
- fixed "ERROR: Macros with complex values should be enclosed in parenthesis" by
scripts/checkpatch.pl.
drivers/net/ethernet/renesas/sh_eth.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -2675,6 +2675,7 @@ static int sh_eth_drv_remove(struct plat
return 0;
}
+#ifdef CONFIG_PM
static int sh_eth_runtime_nop(struct device *dev)
{
/*
@@ -2688,17 +2689,21 @@ static int sh_eth_runtime_nop(struct dev
return 0;
}
-static struct dev_pm_ops sh_eth_dev_pm_ops = {
+static const struct dev_pm_ops sh_eth_dev_pm_ops = {
.runtime_suspend = sh_eth_runtime_nop,
.runtime_resume = sh_eth_runtime_nop,
};
+#define SH_ETH_PM_OPS (&sh_eth_dev_pm_ops)
+#else
+#define SH_ETH_PM_OPS NULL
+#endif
static struct platform_driver sh_eth_driver = {
.probe = sh_eth_drv_probe,
.remove = sh_eth_drv_remove,
.driver = {
.name = CARDNAME,
- .pm = &sh_eth_dev_pm_ops,
+ .pm = SH_ETH_PM_OPS,
},
};
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 0/8] sh_eth: deal with #ifdef'fery
2013-06-05 21:06 [PATCH v4 0/8] sh_eth: deal with #ifdef'fery Sergei Shtylyov
` (7 preceding siblings ...)
2013-06-05 21:20 ` [PATCH v4 8/8] sh_eth: enclose PM code into #ifdef CONFIG_PM Sergei Shtylyov
@ 2013-06-05 22:50 ` Sergei Shtylyov
2013-06-06 3:25 ` Magnus Damm
9 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2013-06-05 22:50 UTC (permalink / raw)
To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh
Hello.
On 06/06/2013 01:06 AM, Sergei Shtylyov wrote:
> Hello.
>
> This series deals mostly with excess #ifdef'fery in the 'sh_eth' driver.
> It doesn't yet get rid of all the #ifdef'fery but that's a matter of another
> patchset. The last patch (it was almost in the middle of the series before),
> contrarywise, adds one missing #ifdef...
Gah, forgot to note that the patchset is against the 'net-next' repo.
I still suck at writing cover letters. :-/
WBR, Sergei
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 7/8] sh_eth: consolidate sh_eth_reset()
2013-06-05 21:19 ` [PATCH v4 7/8] sh_eth: consolidate sh_eth_reset() Sergei Shtylyov
@ 2013-06-05 22:50 ` Sergei Shtylyov
0 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2013-06-05 22:50 UTC (permalink / raw)
To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh
Hello.
On 06/06/2013 01:19 AM, Sergei Shtylyov wrote:
> From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
>
> This driver has sh_eth_reset() function for each SoC and this function is almost
> always the same, except for the several a bit different variations for Gigabit
> Ethernet. Consolidate every variation into a single function -- which allows
> us to get rid of some more #ifdef'fery.
>
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
> [Sergei: moved the new sh_eth_reset() upper to decrease the patch size, fixed
> function call continuation lines' indentation, reworded the changelog, reworded
> the subject, changing the prefix.]
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> ---
> Changes in version 4:
> - moved the new sh_eth_reset() upper to desrease the patch size;
Oops, I forgot to test-compile this change:
drivers/net/ethernet/renesas/sh_eth.c: In function ‘sh_eth_reset’:
drivers/net/ethernet/renesas/sh_eth.c:745:2: error: implicit declaration
of function ‘sh_eth_is_gether’ [-Werror=implicit-function-declaration]
drivers/net/ethernet/renesas/sh_eth.c: At top level:
drivers/net/ethernet/renesas/sh_eth.c:857:12: error: static declaration
of ‘sh_eth_is_gether’ follows non-static declaration
drivers/net/ethernet/renesas/sh_eth.c:745:6: note: previous implicit
declaration of ‘sh_eth_is_gether’ was here
cc1: some warnings being treated as errors
make[1]: *** [drivers/net/ethernet/renesas/sh_eth.o] Error 1
make: *** [drivers/net/ethernet/renesas/sh_eth.o] Error 2
I guess I have to repost the whole series now? :-(
WBR, Sergei
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 0/8] sh_eth: deal with #ifdef'fery
2013-06-05 21:06 [PATCH v4 0/8] sh_eth: deal with #ifdef'fery Sergei Shtylyov
` (8 preceding siblings ...)
2013-06-05 22:50 ` [PATCH v4 0/8] sh_eth: deal with #ifdef'fery Sergei Shtylyov
@ 2013-06-06 3:25 ` Magnus Damm
2013-06-06 14:36 ` Sergei Shtylyov
2013-06-15 0:00 ` Sergei Shtylyov
9 siblings, 2 replies; 15+ messages in thread
From: Magnus Damm @ 2013-06-06 3:25 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: netdev, Nobuhiro Iwamatsu, SH-Linux
Hi Sergei,
On Thu, Jun 6, 2013 at 6:06 AM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Hello.
>
> This series deals mostly with excess #ifdef'fery in the 'sh_eth' driver.
> It doesn't yet get rid of all the #ifdef'fery but that's a matter of another
> patchset. The last patch (it was almost in the middle of the series before),
> contrarywise, adds one missing #ifdef...
>
> [1/8] sh_eth: remove #ifdef around EDSR and GECMR bit definitions
> [2/8] sh_eth: use EDSR_ENALL to set EDSR
> [3/8] sh_eth: remove duplicate sh_eth_set_duplex() definitions
> [4/8] sh_eth: remove SH_ETH_HAS_TSU
> [5/8] sh_eth: add IRQ flags to 'struct sh_eth_cpu_data'
> [6/8] sh_eth: remove #ifdef around sh_eth_select_mii()
> [7/8] sh_eth: consolidate sh_eth_reset()
> [8/8] sh_eth: enclose PM code into #ifdef CONFIG_PM
Thanks for your work on this. I'm looking forward to a sh-eth driver
without #ifdef hell.
It may be just me misunderstanding, but the other day I noticed that
external PHY handling seems broken in the sh-eth driver. I tried to
enable a micron PHY driver but could not make the pieces fit together.
I also wanted to use an external IRQ for the PHY link notification,
but since I couldn't even get the micron PHY driver going in polling
mode I decided to give up. Do you know the status of external PHY
support in the sh-eth driver?
Cheers,
/ magnus
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 0/8] sh_eth: deal with #ifdef'fery
2013-06-06 3:25 ` Magnus Damm
@ 2013-06-06 14:36 ` Sergei Shtylyov
2013-06-15 0:00 ` Sergei Shtylyov
1 sibling, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2013-06-06 14:36 UTC (permalink / raw)
To: Magnus Damm; +Cc: netdev, Nobuhiro Iwamatsu, SH-Linux
Hello.
On 06-06-2013 7:25, Magnus Damm wrote:
>> This series deals mostly with excess #ifdef'fery in the 'sh_eth' driver.
>> It doesn't yet get rid of all the #ifdef'fery but that's a matter of another
>> patchset. The last patch (it was almost in the middle of the series before),
>> contrarywise, adds one missing #ifdef...
>> [1/8] sh_eth: remove #ifdef around EDSR and GECMR bit definitions
>> [2/8] sh_eth: use EDSR_ENALL to set EDSR
>> [3/8] sh_eth: remove duplicate sh_eth_set_duplex() definitions
>> [4/8] sh_eth: remove SH_ETH_HAS_TSU
>> [5/8] sh_eth: add IRQ flags to 'struct sh_eth_cpu_data'
>> [6/8] sh_eth: remove #ifdef around sh_eth_select_mii()
>> [7/8] sh_eth: consolidate sh_eth_reset()
>> [8/8] sh_eth: enclose PM code into #ifdef CONFIG_PM
> Thanks for your work on this.
In this case it's mostly Iwamatsu-san's work.
> I'm looking forward to a sh-eth driver without #ifdef hell.
I've started the next patch series with exactly this purpose.
> It may be just me misunderstanding, but the other day I noticed that
> external PHY handling seems broken in the sh-eth driver. I tried to
> enable a micron PHY driver but could not make the pieces fit together.
> I also wanted to use an external IRQ for the PHY link notification,
> but since I couldn't even get the micron PHY driver going in polling
> mode I decided to give up. Do you know the status of external PHY
> support in the sh-eth driver?
Works for me on the BOCK-W board. As for PHY IRQs, driver forces
polling on all PHYs.
> Cheers,
> / magnus
WBR, Sergei
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 0/8] sh_eth: deal with #ifdef'fery
2013-06-06 3:25 ` Magnus Damm
2013-06-06 14:36 ` Sergei Shtylyov
@ 2013-06-15 0:00 ` Sergei Shtylyov
2013-06-15 0:02 ` Sergei Shtylyov
1 sibling, 1 reply; 15+ messages in thread
From: Sergei Shtylyov @ 2013-06-15 0:00 UTC (permalink / raw)
To: Magnus Damm; +Cc: netdev, Nobuhiro Iwamatsu, SH-Linux
On 06/06/2013 07:25 AM, Magnus Damm wrote:
>> This series deals mostly with excess #ifdef'fery in the 'sh_eth' driver.
>> It doesn't yet get rid of all the #ifdef'fery but that's a matter of another
>> patchset. The last patch (it was almost in the middle of the series before),
>> contrarywise, adds one missing #ifdef...
>> [1/8] sh_eth: remove #ifdef around EDSR and GECMR bit definitions
>> [2/8] sh_eth: use EDSR_ENALL to set EDSR
>> [3/8] sh_eth: remove duplicate sh_eth_set_duplex() definitions
>> [4/8] sh_eth: remove SH_ETH_HAS_TSU
>> [5/8] sh_eth: add IRQ flags to 'struct sh_eth_cpu_data'
>> [6/8] sh_eth: remove #ifdef around sh_eth_select_mii()
>> [7/8] sh_eth: consolidate sh_eth_reset()
>> [8/8] sh_eth: enclose PM code into #ifdef CONFIG_PM
> Thanks for your work on this. I'm looking forward to a sh-eth driver
> without #ifdef hell.
> It may be just me misunderstanding, but the other day I noticed that
> external PHY handling seems broken in the sh-eth driver. I tried to
> enable a micron PHY driver but could not make the pieces fit together.
What kernel you were using, net-next? It seems that the PHY support
is indeed broken after this series. The phylib simply reports that it
didn't find a PHY at the specified address. :-/
I'll continue to investigate this on the weekend...
> Cheers,
> / magnus
WBR, Sergei
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 0/8] sh_eth: deal with #ifdef'fery
2013-06-15 0:00 ` Sergei Shtylyov
@ 2013-06-15 0:02 ` Sergei Shtylyov
0 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2013-06-15 0:02 UTC (permalink / raw)
To: Magnus Damm; +Cc: netdev, Nobuhiro Iwamatsu, SH-Linux
On 06/15/2013 04:00 AM, Sergei Shtylyov wrote:
>>> This series deals mostly with excess #ifdef'fery in the 'sh_eth'
>>> driver.
>>> It doesn't yet get rid of all the #ifdef'fery but that's a matter of
>>> another
>>> patchset. The last patch (it was almost in the middle of the series
>>> before),
>>> contrarywise, adds one missing #ifdef...
>>> [1/8] sh_eth: remove #ifdef around EDSR and GECMR bit definitions
>>> [2/8] sh_eth: use EDSR_ENALL to set EDSR
>>> [3/8] sh_eth: remove duplicate sh_eth_set_duplex() definitions
>>> [4/8] sh_eth: remove SH_ETH_HAS_TSU
>>> [5/8] sh_eth: add IRQ flags to 'struct sh_eth_cpu_data'
>>> [6/8] sh_eth: remove #ifdef around sh_eth_select_mii()
>>> [7/8] sh_eth: consolidate sh_eth_reset()
>>> [8/8] sh_eth: enclose PM code into #ifdef CONFIG_PM
>> Thanks for your work on this. I'm looking forward to a sh-eth driver
>> without #ifdef hell.
>> It may be just me misunderstanding, but the other day I noticed that
>> external PHY handling seems broken in the sh-eth driver. I tried to
>> enable a micron PHY driver but could not make the pieces fit together.
> What kernel you were using, net-next? It seems that the PHY support
> is indeed broken after this series.
Oh, I mixed it up. It's broken by the next series, which moved most
of the SoC specific code out of #ifdef's.
> The phylib simply reports that it didn't find a PHY at the specified address. :-/
> I'll continue to investigate this on the weekend...
>> Cheers,
>> / magnus
WBR, Sergei
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2013-06-15 0:02 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-05 21:06 [PATCH v4 0/8] sh_eth: deal with #ifdef'fery Sergei Shtylyov
2013-06-05 21:09 ` [PATCH v4 1/8] sh_eth: remove #ifdef around EDSR and GECMR bit definitions Sergei Shtylyov
2013-06-05 21:11 ` [PATCH v4 2/8] sh_eth: use EDSR_ENALL to set EDSR Sergei Shtylyov
2013-06-05 21:12 ` [PATCH v4 3/8] sh_eth: remove duplicate sh_eth_set_duplex() definitions Sergei Shtylyov
2013-06-05 21:14 ` [PATCH v4 4/8] sh_eth: remove SH_ETH_HAS_TSU Sergei Shtylyov
2013-06-05 21:15 ` [PATCH v4 5/8] sh_eth: add IRQ flags to 'struct sh_eth_cpu_data' Sergei Shtylyov
2013-06-05 21:16 ` [PATCH v4 6/8] sh_eth: remove #ifdef around sh_eth_select_mii() Sergei Shtylyov
2013-06-05 21:19 ` [PATCH v4 7/8] sh_eth: consolidate sh_eth_reset() Sergei Shtylyov
2013-06-05 22:50 ` Sergei Shtylyov
2013-06-05 21:20 ` [PATCH v4 8/8] sh_eth: enclose PM code into #ifdef CONFIG_PM Sergei Shtylyov
2013-06-05 22:50 ` [PATCH v4 0/8] sh_eth: deal with #ifdef'fery Sergei Shtylyov
2013-06-06 3:25 ` Magnus Damm
2013-06-06 14:36 ` Sergei Shtylyov
2013-06-15 0:00 ` Sergei Shtylyov
2013-06-15 0:02 ` 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).