netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: mv88e6xxx: handle unknown duplex modes gracefully in mv88e6xxx_port_set_duplex
@ 2019-03-01 18:53 Heiner Kallweit
  2019-03-01 22:31 ` Andrew Lunn
  2019-03-04  5:04 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Heiner Kallweit @ 2019-03-01 18:53 UTC (permalink / raw)
  To: Vivien Didelot, Andrew Lunn, Florian Fainelli, David Miller; +Cc: netdev

When testing another issue I faced the problem that
mv88e6xxx_port_setup_mac() failed due to DUPLEX_UNKNOWN being passed
as argument to mv88e6xxx_port_set_duplex(). We should handle this case
gracefully and return -EOPNOTSUPP, like e.g. mv88e6xxx_port_set_speed()
is doing it.

Fixes: 7f1ae07b51e8 ("net: dsa: mv88e6xxx: add port duplex setter")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/dsa/mv88e6xxx/port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
index e12e0bdfc..d907c8590 100644
--- a/drivers/net/dsa/mv88e6xxx/port.c
+++ b/drivers/net/dsa/mv88e6xxx/port.c
@@ -190,7 +190,7 @@ int mv88e6xxx_port_set_duplex(struct mv88e6xxx_chip *chip, int port, int dup)
 		/* normal duplex detection */
 		break;
 	default:
-		return -EINVAL;
+		return -EOPNOTSUPP;
 	}
 
 	err = mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_MAC_CTL, reg);
-- 
2.21.0


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

* Re: [PATCH net] net: dsa: mv88e6xxx: handle unknown duplex modes gracefully in mv88e6xxx_port_set_duplex
  2019-03-01 18:53 [PATCH net] net: dsa: mv88e6xxx: handle unknown duplex modes gracefully in mv88e6xxx_port_set_duplex Heiner Kallweit
@ 2019-03-01 22:31 ` Andrew Lunn
  2019-03-04  5:04 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2019-03-01 22:31 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: Vivien Didelot, Florian Fainelli, David Miller, netdev

On Fri, Mar 01, 2019 at 07:53:57PM +0100, Heiner Kallweit wrote:
> When testing another issue I faced the problem that
> mv88e6xxx_port_setup_mac() failed due to DUPLEX_UNKNOWN being passed
> as argument to mv88e6xxx_port_set_duplex(). We should handle this case
> gracefully and return -EOPNOTSUPP, like e.g. mv88e6xxx_port_set_speed()
> is doing it.
> 
> Fixes: 7f1ae07b51e8 ("net: dsa: mv88e6xxx: add port duplex setter")
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH net] net: dsa: mv88e6xxx: handle unknown duplex modes gracefully in mv88e6xxx_port_set_duplex
  2019-03-01 18:53 [PATCH net] net: dsa: mv88e6xxx: handle unknown duplex modes gracefully in mv88e6xxx_port_set_duplex Heiner Kallweit
  2019-03-01 22:31 ` Andrew Lunn
@ 2019-03-04  5:04 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-03-04  5:04 UTC (permalink / raw)
  To: hkallweit1; +Cc: vivien.didelot, andrew, f.fainelli, netdev

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Fri, 1 Mar 2019 19:53:57 +0100

> When testing another issue I faced the problem that
> mv88e6xxx_port_setup_mac() failed due to DUPLEX_UNKNOWN being passed
> as argument to mv88e6xxx_port_set_duplex(). We should handle this case
> gracefully and return -EOPNOTSUPP, like e.g. mv88e6xxx_port_set_speed()
> is doing it.
> 
> Fixes: 7f1ae07b51e8 ("net: dsa: mv88e6xxx: add port duplex setter")
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Applied and queued up for -stable, thanks Heiner.

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

end of thread, other threads:[~2019-03-04  5:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-01 18:53 [PATCH net] net: dsa: mv88e6xxx: handle unknown duplex modes gracefully in mv88e6xxx_port_set_duplex Heiner Kallweit
2019-03-01 22:31 ` Andrew Lunn
2019-03-04  5:04 ` 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).