2017-03-04 18:37:50 +00:00
|
|
|
From c01a3230d8cdd396dcec2619646f6cf2753481d8 Mon Sep 17 00:00:00 2001
|
2017-02-07 20:07:54 +00:00
|
|
|
From: Steve Glendinning <steve.glendinning@smsc.com>
|
|
|
|
Date: Thu, 19 Feb 2015 18:47:12 +0000
|
|
|
|
Subject: [PATCH] smsx95xx: fix crimes against truesize
|
|
|
|
|
|
|
|
smsc95xx is adjusting truesize when it shouldn't, and following a recent patch from Eric this is now triggering warnings.
|
|
|
|
|
|
|
|
This patch stops smsc95xx from changing truesize.
|
|
|
|
|
|
|
|
Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
|
|
|
|
---
|
|
|
|
drivers/net/usb/smsc95xx.c | 10 ++++++++--
|
|
|
|
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
--- a/drivers/net/usb/smsc95xx.c
|
|
|
|
+++ b/drivers/net/usb/smsc95xx.c
|
|
|
|
@@ -82,6 +82,10 @@ static bool turbo_mode = true;
|
|
|
|
module_param(turbo_mode, bool, 0644);
|
|
|
|
MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
|
|
|
|
|
|
|
|
+static bool truesize_mode = false;
|
|
|
|
+module_param(truesize_mode, bool, 0644);
|
|
|
|
+MODULE_PARM_DESC(truesize_mode, "Report larger truesize value");
|
|
|
|
+
|
|
|
|
static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
|
|
|
|
u32 *data, int in_pm)
|
|
|
|
{
|
kernel: bump 4.9 to 4.9.143
Refreshed all patches.
Altered patches:
- 950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch
- 950-0149-Update-vfpmodule.c.patch
- 201-extra_optimization.patch
New symbol:
- CONFIG_HARDEN_BRANCH_PREDICTOR
Compile-tested on: ar71xx, ar7, arc770, at91, brcm2708, brcm63xx, ixp4xx, lantiq, layerscape, mpc85xx, orion, rb532, uml
Runtime-tested on: ar71xx
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2018-11-28 11:36:15 +00:00
|
|
|
@@ -1961,7 +1965,8 @@ static int smsc95xx_rx_fixup(struct usbn
|
2017-02-07 20:07:54 +00:00
|
|
|
if (dev->net->features & NETIF_F_RXCSUM)
|
|
|
|
smsc95xx_rx_csum_offload(skb);
|
|
|
|
skb_trim(skb, skb->len - 4); /* remove fcs */
|
|
|
|
- skb->truesize = size + sizeof(struct sk_buff);
|
|
|
|
+ if (truesize_mode)
|
|
|
|
+ skb->truesize = size + sizeof(struct sk_buff);
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
kernel: bump 4.9 to 4.9.143
Refreshed all patches.
Altered patches:
- 950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch
- 950-0149-Update-vfpmodule.c.patch
- 201-extra_optimization.patch
New symbol:
- CONFIG_HARDEN_BRANCH_PREDICTOR
Compile-tested on: ar71xx, ar7, arc770, at91, brcm2708, brcm63xx, ixp4xx, lantiq, layerscape, mpc85xx, orion, rb532, uml
Runtime-tested on: ar71xx
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2018-11-28 11:36:15 +00:00
|
|
|
@@ -1979,7 +1984,8 @@ static int smsc95xx_rx_fixup(struct usbn
|
2017-02-07 20:07:54 +00:00
|
|
|
if (dev->net->features & NETIF_F_RXCSUM)
|
|
|
|
smsc95xx_rx_csum_offload(ax_skb);
|
|
|
|
skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */
|
|
|
|
- ax_skb->truesize = size + sizeof(struct sk_buff);
|
|
|
|
+ if (truesize_mode)
|
|
|
|
+ ax_skb->truesize = size + sizeof(struct sk_buff);
|
|
|
|
|
|
|
|
usbnet_skb_return(dev, ax_skb);
|
|
|
|
}
|