netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] EEE support for mv88e6172
@ 2015-03-10 22:05 Andrew Lunn
  2015-03-10 22:05 ` [PATCH 1/3] net: dsa: Centralise getting switch id Andrew Lunn
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Andrew Lunn @ 2015-03-10 22:05 UTC (permalink / raw)
  To: davem, linux; +Cc: netdev, Andrew Lunn

This patchset contains two cleanups and then adds EEE support
to the mv88e6172, using the base provided by Guenter Roeck

Tested on a WRT1900AC with mv88e6172 and DIR665 with mv88e6171.

Andrew Lunn (3):
  net: dsa: Centralise getting switch id
  net: dsa: mv6171: Add defines for switch product IDs
  net: dsa: mv88e6171: Add EEE support to the mv88e6172

 drivers/net/dsa/mv88e6171.c | 32 ++++++++++++++++++++++++++++++--
 drivers/net/dsa/mv88e6352.c |  2 --
 drivers/net/dsa/mv88e6xxx.c |  2 ++
 3 files changed, 32 insertions(+), 4 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/3] net: dsa: Centralise getting switch id
  2015-03-10 22:05 [PATCH 0/3] EEE support for mv88e6172 Andrew Lunn
@ 2015-03-10 22:05 ` Andrew Lunn
  2015-03-11  2:08   ` Guenter Roeck
  2015-03-10 22:05 ` [PATCH 2/3] net: dsa: mv6171: Add defines for switch product IDs Andrew Lunn
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Andrew Lunn @ 2015-03-10 22:05 UTC (permalink / raw)
  To: davem, linux; +Cc: netdev, Andrew Lunn

Get the switch id and save it away in the private mv88x6xxx structure
in a centralised piece of code, rather than each driver doing it itself.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/dsa/mv88e6352.c | 2 --
 drivers/net/dsa/mv88e6xxx.c | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/mv88e6352.c b/drivers/net/dsa/mv88e6352.c
index 9121e6dce267..a30e5147a3e7 100644
--- a/drivers/net/dsa/mv88e6352.c
+++ b/drivers/net/dsa/mv88e6352.c
@@ -374,8 +374,6 @@ static int mv88e6352_setup(struct dsa_switch *ds)
 
 	mutex_init(&ps->eeprom_mutex);
 
-	ps->id = REG_READ(REG_PORT(0), 0x03) & 0xfff0;
-
 	ret = mv88e6352_switch_reset(ds);
 	if (ret < 0)
 		return ret;
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index 9c9e5fa2ce70..e7e4933692cb 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -1139,6 +1139,8 @@ int mv88e6xxx_setup_common(struct dsa_switch *ds)
 	mutex_init(&ps->stats_mutex);
 	mutex_init(&ps->phy_mutex);
 
+	ps->id = REG_READ(REG_PORT(0), 0x03) & 0xfff0;
+
 	ps->fid_mask = (1 << DSA_MAX_PORTS) - 1;
 
 	INIT_WORK(&ps->bridge_work, mv88e6xxx_bridge_work);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/3] net: dsa: mv6171: Add defines for switch product IDs
  2015-03-10 22:05 [PATCH 0/3] EEE support for mv88e6172 Andrew Lunn
  2015-03-10 22:05 ` [PATCH 1/3] net: dsa: Centralise getting switch id Andrew Lunn
@ 2015-03-10 22:05 ` Andrew Lunn
  2015-03-11  2:09   ` Guenter Roeck
  2015-03-10 22:05 ` [PATCH 3/3] net: dsa: mv88e6171: Add EEE support to the mv88e6172 Andrew Lunn
  2015-03-11 20:59 ` [PATCH 0/3] EEE support for mv88e6172 David Miller
  3 siblings, 1 reply; 12+ messages in thread
From: Andrew Lunn @ 2015-03-10 22:05 UTC (permalink / raw)
  To: davem, linux; +Cc: netdev, Andrew Lunn

Make the code more readable by using defines for the switch IDs.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/dsa/mv88e6171.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c
index 339484a99bd7..4fa0614e8ff3 100644
--- a/drivers/net/dsa/mv88e6171.c
+++ b/drivers/net/dsa/mv88e6171.c
@@ -17,6 +17,10 @@
 #include <net/dsa.h>
 #include "mv88e6xxx.h"
 
+/* Switch product IDs */
+#define ID_6171	0x1710
+#define ID_6172	0x1720
+
 static char *mv88e6171_probe(struct device *host_dev, int sw_addr)
 {
 	struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev);
@@ -27,9 +31,9 @@ static char *mv88e6171_probe(struct device *host_dev, int sw_addr)
 
 	ret = __mv88e6xxx_reg_read(bus, sw_addr, REG_PORT(0), 0x03);
 	if (ret >= 0) {
-		if ((ret & 0xfff0) == 0x1710)
+		if ((ret & 0xfff0) == ID_6171)
 			return "Marvell 88E6171";
-		if ((ret & 0xfff0) == 0x1720)
+		if ((ret & 0xfff0) == ID_6172)
 			return "Marvell 88E6172";
 	}
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/3] net: dsa: mv88e6171: Add EEE support to the mv88e6172
  2015-03-10 22:05 [PATCH 0/3] EEE support for mv88e6172 Andrew Lunn
  2015-03-10 22:05 ` [PATCH 1/3] net: dsa: Centralise getting switch id Andrew Lunn
  2015-03-10 22:05 ` [PATCH 2/3] net: dsa: mv6171: Add defines for switch product IDs Andrew Lunn
@ 2015-03-10 22:05 ` Andrew Lunn
  2015-03-11  2:09   ` Guenter Roeck
  2015-03-11 20:59 ` [PATCH 0/3] EEE support for mv88e6172 David Miller
  3 siblings, 1 reply; 12+ messages in thread
From: Andrew Lunn @ 2015-03-10 22:05 UTC (permalink / raw)
  To: davem, linux; +Cc: netdev, Andrew Lunn

The mv88e6172 has support for EEE. Check for the product ID and call
the common code if applicable.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/dsa/mv88e6171.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c
index 4fa0614e8ff3..f3b5a0839e12 100644
--- a/drivers/net/dsa/mv88e6171.c
+++ b/drivers/net/dsa/mv88e6171.c
@@ -398,6 +398,28 @@ static int mv88e6171_get_sset_count(struct dsa_switch *ds)
 	return ARRAY_SIZE(mv88e6171_hw_stats);
 }
 
+static int mv88e6171_get_eee(struct dsa_switch *ds, int port,
+			     struct ethtool_eee *e)
+{
+	struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
+
+	if (ps->id == ID_6172)
+		return mv88e6xxx_get_eee(ds, port, e);
+
+	return -EOPNOTSUPP;
+}
+
+static int mv88e6171_set_eee(struct dsa_switch *ds, int port,
+			     struct phy_device *phydev, struct ethtool_eee *e)
+{
+	struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
+
+	if (ps->id == ID_6172)
+		return mv88e6xxx_set_eee(ds, port, phydev, e);
+
+	return -EOPNOTSUPP;
+}
+
 struct dsa_switch_driver mv88e6171_switch_driver = {
 	.tag_protocol		= DSA_TAG_PROTO_EDSA,
 	.priv_size		= sizeof(struct mv88e6xxx_priv_state),
@@ -410,6 +432,8 @@ struct dsa_switch_driver mv88e6171_switch_driver = {
 	.get_strings		= mv88e6171_get_strings,
 	.get_ethtool_stats	= mv88e6171_get_ethtool_stats,
 	.get_sset_count		= mv88e6171_get_sset_count,
+	.set_eee		= mv88e6171_set_eee,
+	.get_eee		= mv88e6171_get_eee,
 #ifdef CONFIG_NET_DSA_HWMON
 	.get_temp               = mv88e6xxx_get_temp,
 #endif
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] net: dsa: Centralise getting switch id
  2015-03-10 22:05 ` [PATCH 1/3] net: dsa: Centralise getting switch id Andrew Lunn
@ 2015-03-11  2:08   ` Guenter Roeck
  0 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2015-03-11  2:08 UTC (permalink / raw)
  To: Andrew Lunn, davem; +Cc: netdev

On 03/10/2015 03:05 PM, Andrew Lunn wrote:
> Get the switch id and save it away in the private mv88x6xxx structure
> in a centralised piece of code, rather than each driver doing it itself.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] net: dsa: mv6171: Add defines for switch product IDs
  2015-03-10 22:05 ` [PATCH 2/3] net: dsa: mv6171: Add defines for switch product IDs Andrew Lunn
@ 2015-03-11  2:09   ` Guenter Roeck
  0 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2015-03-11  2:09 UTC (permalink / raw)
  To: Andrew Lunn, davem; +Cc: netdev

On 03/10/2015 03:05 PM, Andrew Lunn wrote:
> Make the code more readable by using defines for the switch IDs.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] net: dsa: mv88e6171: Add EEE support to the mv88e6172
  2015-03-10 22:05 ` [PATCH 3/3] net: dsa: mv88e6171: Add EEE support to the mv88e6172 Andrew Lunn
@ 2015-03-11  2:09   ` Guenter Roeck
  0 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2015-03-11  2:09 UTC (permalink / raw)
  To: Andrew Lunn, davem; +Cc: netdev

On 03/10/2015 03:05 PM, Andrew Lunn wrote:
> The mv88e6172 has support for EEE. Check for the product ID and call
> the common code if applicable.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] EEE support for mv88e6172
  2015-03-10 22:05 [PATCH 0/3] EEE support for mv88e6172 Andrew Lunn
                   ` (2 preceding siblings ...)
  2015-03-10 22:05 ` [PATCH 3/3] net: dsa: mv88e6171: Add EEE support to the mv88e6172 Andrew Lunn
@ 2015-03-11 20:59 ` David Miller
  2015-03-12  8:46   ` Guenter Roeck
  3 siblings, 1 reply; 12+ messages in thread
From: David Miller @ 2015-03-11 20:59 UTC (permalink / raw)
  To: andrew; +Cc: linux, netdev

From: Andrew Lunn <andrew@lunn.ch>
Date: Tue, 10 Mar 2015 23:05:56 +0100

> This patchset contains two cleanups and then adds EEE support
> to the mv88e6172, using the base provided by Guenter Roeck
> 
> Tested on a WRT1900AC with mv88e6172 and DIR665 with mv88e6171.

This series does not apply cleanly to net-next.

I really want to discourage you posting patches against trees other
that net and net-next like this, without CLEARLY marking in the
Subject lines that this patch series is special and that I should
not try to review and apply it at all.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] EEE support for mv88e6172
  2015-03-11 20:59 ` [PATCH 0/3] EEE support for mv88e6172 David Miller
@ 2015-03-12  8:46   ` Guenter Roeck
  2015-03-12 12:14     ` Andrew Lunn
  0 siblings, 1 reply; 12+ messages in thread
From: Guenter Roeck @ 2015-03-12  8:46 UTC (permalink / raw)
  To: David Miller, andrew; +Cc: netdev

On 03/11/2015 01:59 PM, David Miller wrote:
> From: Andrew Lunn <andrew@lunn.ch>
> Date: Tue, 10 Mar 2015 23:05:56 +0100
>
>> This patchset contains two cleanups and then adds EEE support
>> to the mv88e6172, using the base provided by Guenter Roeck
>>
>> Tested on a WRT1900AC with mv88e6172 and DIR665 with mv88e6171.
>
> This series does not apply cleanly to net-next.
>
> I really want to discourage you posting patches against trees other
> that net and net-next like this, without CLEARLY marking in the
> Subject lines that this patch series is special and that I should
> not try to review and apply it at all.
>

Andrew,

I see two options: I can submit my entire series of HW bridging
patches for mv88e6xxx, or I submit the introductory patches of that
series (the ones refactoring the code to prepare for HW bridging)
plus your (rebased) patches on top of it.

What do you think ?

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] EEE support for mv88e6172
  2015-03-12  8:46   ` Guenter Roeck
@ 2015-03-12 12:14     ` Andrew Lunn
  2015-03-12 13:41       ` Guenter Roeck
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Lunn @ 2015-03-12 12:14 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: David Miller, netdev

On Thu, Mar 12, 2015 at 01:46:00AM -0700, Guenter Roeck wrote:
> On 03/11/2015 01:59 PM, David Miller wrote:
> >From: Andrew Lunn <andrew@lunn.ch>
> >Date: Tue, 10 Mar 2015 23:05:56 +0100
> >
> >>This patchset contains two cleanups and then adds EEE support
> >>to the mv88e6172, using the base provided by Guenter Roeck
> >>
> >>Tested on a WRT1900AC with mv88e6172 and DIR665 with mv88e6171.
> >
> >This series does not apply cleanly to net-next.
> >
> >I really want to discourage you posting patches against trees other
> >that net and net-next like this, without CLEARLY marking in the
> >Subject lines that this patch series is special and that I should
> >not try to review and apply it at all.
> >
> 
> Andrew,

Yes, i messed up :-(
 
> I see two options: I can submit my entire series of HW bridging
> patches for mv88e6xxx, or I submit the introductory patches of that
> series (the ones refactoring the code to prepare for HW bridging)
> plus your (rebased) patches on top of it.
> 
> What do you think ?

There is no rush with these patches. When you are ready, post the
whole hardware bridge patches for review. Once they are accepted, i
will try again with the EEE patches for mv88e6171.

     Andrew

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] EEE support for mv88e6172
  2015-03-12 12:14     ` Andrew Lunn
@ 2015-03-12 13:41       ` Guenter Roeck
  2015-03-12 13:48         ` Andrew Lunn
  0 siblings, 1 reply; 12+ messages in thread
From: Guenter Roeck @ 2015-03-12 13:41 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: David Miller, netdev

On 03/12/2015 05:14 AM, Andrew Lunn wrote:
> On Thu, Mar 12, 2015 at 01:46:00AM -0700, Guenter Roeck wrote:
>> On 03/11/2015 01:59 PM, David Miller wrote:
>>> From: Andrew Lunn <andrew@lunn.ch>
>>> Date: Tue, 10 Mar 2015 23:05:56 +0100
>>>
>>>> This patchset contains two cleanups and then adds EEE support
>>>> to the mv88e6172, using the base provided by Guenter Roeck
>>>>
>>>> Tested on a WRT1900AC with mv88e6172 and DIR665 with mv88e6171.
>>>
>>> This series does not apply cleanly to net-next.
>>>
>>> I really want to discourage you posting patches against trees other
>>> that net and net-next like this, without CLEARLY marking in the
>>> Subject lines that this patch series is special and that I should
>>> not try to review and apply it at all.
>>>
>>
>> Andrew,
>
> Yes, i messed up :-(
>
>> I see two options: I can submit my entire series of HW bridging
>> patches for mv88e6xxx, or I submit the introductory patches of that
>> series (the ones refactoring the code to prepare for HW bridging)
>> plus your (rebased) patches on top of it.
>>
>> What do you think ?
>
> There is no rush with these patches. When you are ready, post the
> whole hardware bridge patches for review. Once they are accepted, i
> will try again with the EEE patches for mv88e6171.
>

Ok.

Did you have time to test the bridging code ?

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] EEE support for mv88e6172
  2015-03-12 13:41       ` Guenter Roeck
@ 2015-03-12 13:48         ` Andrew Lunn
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Lunn @ 2015-03-12 13:48 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: David Miller, netdev

> Did you have time to test the bridging code ?

Yes, i plan to play with it later today or tomorrow.

     Andrew

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-03-12 13:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-10 22:05 [PATCH 0/3] EEE support for mv88e6172 Andrew Lunn
2015-03-10 22:05 ` [PATCH 1/3] net: dsa: Centralise getting switch id Andrew Lunn
2015-03-11  2:08   ` Guenter Roeck
2015-03-10 22:05 ` [PATCH 2/3] net: dsa: mv6171: Add defines for switch product IDs Andrew Lunn
2015-03-11  2:09   ` Guenter Roeck
2015-03-10 22:05 ` [PATCH 3/3] net: dsa: mv88e6171: Add EEE support to the mv88e6172 Andrew Lunn
2015-03-11  2:09   ` Guenter Roeck
2015-03-11 20:59 ` [PATCH 0/3] EEE support for mv88e6172 David Miller
2015-03-12  8:46   ` Guenter Roeck
2015-03-12 12:14     ` Andrew Lunn
2015-03-12 13:41       ` Guenter Roeck
2015-03-12 13:48         ` Andrew Lunn

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).