All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: dmitry.bezrukov@aquantia.com, igor.russkikh@aquantia.com,
	netdev@vger.kernel.org
Cc: Oliver Neukum <oneukum@suse.com>
Subject: [PATCH 1/3] aqc111: fix endianness issue in aqc111_change_mtu
Date: Thu,  9 May 2019 11:08:16 +0200	[thread overview]
Message-ID: <20190509090818.9257-1-oneukum@suse.com> (raw)

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


             reply	other threads:[~2019-05-09  9:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09  9:08 Oliver Neukum [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190509090818.9257-1-oneukum@suse.com \
    --to=oneukum@suse.com \
    --cc=dmitry.bezrukov@aquantia.com \
    --cc=igor.russkikh@aquantia.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.