kernel: bump 4.9 to 4.9.143
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.9 / 950-0001-smsx95xx-fix-crimes-against-truesize.patch
1 From c01a3230d8cdd396dcec2619646f6cf2753481d8 Mon Sep 17 00:00:00 2001
2 From: Steve Glendinning <steve.glendinning@smsc.com>
3 Date: Thu, 19 Feb 2015 18:47:12 +0000
4 Subject: [PATCH] smsx95xx: fix crimes against truesize
5
6 smsc95xx is adjusting truesize when it shouldn't, and following a recent patch from Eric this is now triggering warnings.
7
8 This patch stops smsc95xx from changing truesize.
9
10 Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
11 ---
12 drivers/net/usb/smsc95xx.c | 10 ++++++++--
13 1 file changed, 8 insertions(+), 2 deletions(-)
14
15 --- a/drivers/net/usb/smsc95xx.c
16 +++ b/drivers/net/usb/smsc95xx.c
17 @@ -82,6 +82,10 @@ static bool turbo_mode = true;
18 module_param(turbo_mode, bool, 0644);
19 MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
20
21 +static bool truesize_mode = false;
22 +module_param(truesize_mode, bool, 0644);
23 +MODULE_PARM_DESC(truesize_mode, "Report larger truesize value");
24 +
25 static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
26 u32 *data, int in_pm)
27 {
28 @@ -1961,7 +1965,8 @@ static int smsc95xx_rx_fixup(struct usbn
29 if (dev->net->features & NETIF_F_RXCSUM)
30 smsc95xx_rx_csum_offload(skb);
31 skb_trim(skb, skb->len - 4); /* remove fcs */
32 - skb->truesize = size + sizeof(struct sk_buff);
33 + if (truesize_mode)
34 + skb->truesize = size + sizeof(struct sk_buff);
35
36 return 1;
37 }
38 @@ -1979,7 +1984,8 @@ static int smsc95xx_rx_fixup(struct usbn
39 if (dev->net->features & NETIF_F_RXCSUM)
40 smsc95xx_rx_csum_offload(ax_skb);
41 skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */
42 - ax_skb->truesize = size + sizeof(struct sk_buff);
43 + if (truesize_mode)
44 + ax_skb->truesize = size + sizeof(struct sk_buff);
45
46 usbnet_skb_return(dev, ax_skb);
47 }