netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] aqc111: fix endianness issue in aqc111_change_mtu
@ 2019-05-09  9:08 Oliver Neukum
  2019-05-09  9:08 ` [PATCH 2/3] aqc111: fix writing to the phy on BE Oliver Neukum
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Oliver Neukum @ 2019-05-09  9:08 UTC (permalink / raw)
  To: dmitry.bezrukov, igor.russkikh, netdev; +Cc: Oliver Neukum

If the MTU is large enough, the first write to the device
is just repeated. On BE architectures, however, the first
word of the command will be swapped a second time and garbage
will be written. Avoid that.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/net/usb/aqc111.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c
index aff995be2a31..408df2d335e3 100644
--- a/drivers/net/usb/aqc111.c
+++ b/drivers/net/usb/aqc111.c
@@ -453,6 +453,8 @@ static int aqc111_change_mtu(struct net_device *net, int new_mtu)
 		reg16 = 0x1420;
 	else if (dev->net->mtu <= 16334)
 		reg16 = 0x1A20;
+	else
+		return 0;
 
 	aqc111_write16_cmd(dev, AQ_ACCESS_MAC, SFR_PAUSE_WATERLVL_LOW,
 			   2, &reg16);
-- 
2.16.4


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

end of thread, other threads:[~2019-05-15 14:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09  9:08 [PATCH 1/3] aqc111: fix endianness issue in aqc111_change_mtu Oliver Neukum
2019-05-09  9:08 ` [PATCH 2/3] aqc111: fix writing to the phy on BE Oliver Neukum
2019-05-09 16:37   ` David Miller
2019-05-14 12:11   ` Igor Russkikh
2019-05-14 13:14     ` Oliver Neukum
2019-05-15 14:16       ` Igor Russkikh
2019-05-09  9:08 ` [PATCH 3/3] aqc111: fix double endianness swap " Oliver Neukum
2019-05-09 16:37   ` David Miller
2019-05-09 16:37 ` [PATCH 1/3] aqc111: fix endianness issue in aqc111_change_mtu David Miller
2019-05-14 12:37 ` Igor Russkikh

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