From a1383655cfaa71609d6236ae0fcf3b6047462b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sat, 29 Feb 2020 09:25:20 +0100 Subject: bcm27xx: add linux 5.4 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tested on bcm2710 (Raspberry Pi 3B). Signed-off-by: Álvaro Fernández Rojas --- ...0003-smsx95xx-fix-crimes-against-truesize.patch | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 target/linux/bcm27xx/patches-5.4/950-0003-smsx95xx-fix-crimes-against-truesize.patch (limited to 'target/linux/bcm27xx/patches-5.4/950-0003-smsx95xx-fix-crimes-against-truesize.patch') diff --git a/target/linux/bcm27xx/patches-5.4/950-0003-smsx95xx-fix-crimes-against-truesize.patch b/target/linux/bcm27xx/patches-5.4/950-0003-smsx95xx-fix-crimes-against-truesize.patch new file mode 100644 index 0000000000..16a9bcd22a --- /dev/null +++ b/target/linux/bcm27xx/patches-5.4/950-0003-smsx95xx-fix-crimes-against-truesize.patch @@ -0,0 +1,47 @@ +From bb137167247980c89005d607e5e89417f8f59634 Mon Sep 17 00:00:00 2001 +From: Steve Glendinning +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 +--- + 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 +@@ -70,6 +70,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) + { +@@ -1957,7 +1961,8 @@ static int smsc95xx_rx_fixup(struct usbn + 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; + } +@@ -1975,7 +1980,8 @@ static int smsc95xx_rx_fixup(struct usbn + 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); + } -- cgit v1.2.3