From: Hauke Mehrtens Date: Fri, 18 Mar 2016 23:41:21 +0000 (+0000) Subject: kernel: update kernel 4.1 to version 4.1.20 X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;hb=8f4f84896519f34fe5fc90fae18bb792752fc6f4 kernel: update kernel 4.1 to version 4.1.20 Signed-off-by: Hauke Mehrtens SVN-Revision: 49035 --- diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 6fcd81eaec..6080ed6aca 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,12 +3,12 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .27 -LINUX_VERSION-4.1 = .16 +LINUX_VERSION-4.1 = .20 LINUX_VERSION-4.3 = .4 LINUX_VERSION-4.4 = .6 LINUX_KERNEL_MD5SUM-3.18.27 = 015a01bf84e7c6bc9952551b4da45044 -LINUX_KERNEL_MD5SUM-4.1.16 = e4bf22fed49b476b47acffc00c03267a +LINUX_KERNEL_MD5SUM-4.1.20 = 075c38a3a23ca5bc80437b13606df00a LINUX_KERNEL_MD5SUM-4.3.4 = 5275d02132107c28b85f986bad576d91 LINUX_KERNEL_MD5SUM-4.4.6 = efc822dad2149e40cc908718a4fea1d3 diff --git a/target/linux/ar71xx/patches-4.1/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.1/910-unaligned_access_hacks.patch index e39eac3982..ea66f9ab67 100644 --- a/target/linux/ar71xx/patches-4.1/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.1/910-unaligned_access_hacks.patch @@ -214,7 +214,7 @@ #include #include #include -@@ -774,10 +775,10 @@ static void tcp_v6_send_response(struct +@@ -776,10 +777,10 @@ static void tcp_v6_send_response(struct topt = (__be32 *)(t1 + 1); if (tsecr) { @@ -241,7 +241,7 @@ */ --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c -@@ -426,7 +426,7 @@ int ipv6_recv_error(struct sock *sk, str +@@ -429,7 +429,7 @@ int ipv6_recv_error(struct sock *sk, str ipv6_iface_scope_id(&sin->sin6_addr, IP6CB(skb)->iif); } else { @@ -250,7 +250,7 @@ &sin->sin6_addr); sin->sin6_scope_id = 0; } -@@ -763,12 +763,12 @@ int ip6_datagram_send_ctl(struct net *ne +@@ -766,12 +766,12 @@ int ip6_datagram_send_ctl(struct net *ne } if (fl6->flowlabel&IPV6_FLOWINFO_MASK) { @@ -359,7 +359,7 @@ for (p = *head; p; p = p->next) { --- a/net/ipv4/route.c +++ b/net/ipv4/route.c -@@ -453,7 +453,7 @@ static struct neighbour *ipv4_neigh_look +@@ -454,7 +454,7 @@ static struct neighbour *ipv4_neigh_look else if (skb) pkey = &ip_hdr(skb)->daddr; @@ -632,14 +632,19 @@ #include --- a/include/net/inet_ecn.h +++ b/include/net/inet_ecn.h -@@ -115,13 +115,13 @@ static inline int IP6_ECN_set_ce(struct - { +@@ -124,9 +124,9 @@ static inline int IP6_ECN_set_ce(struct if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph))) return 0; -- *(__be32*)iph |= htonl(INET_ECN_CE << 20); -+ net_hdr_word(iph) |= htonl(INET_ECN_CE << 20); + +- from = *(__be32 *)iph; ++ from = net_hdr_word(iph); + to = from | htonl(INET_ECN_CE << 20); +- *(__be32 *)iph = to; ++ net_hdr_word(iph) = to; + if (skb->ip_summed == CHECKSUM_COMPLETE) + skb->csum = csum_add(csum_sub(skb->csum, from), to); return 1; - } +@@ -134,7 +134,7 @@ static inline int IP6_ECN_set_ce(struct static inline void IP6_ECN_clear(struct ipv6hdr *iph) { diff --git a/target/linux/bcm53xx/patches-4.1/191-usb-xhci-add-Broadcom-specific-fake-doorbell.patch b/target/linux/bcm53xx/patches-4.1/191-usb-xhci-add-Broadcom-specific-fake-doorbell.patch index c2cbe2cc09..535bc69703 100644 --- a/target/linux/bcm53xx/patches-4.1/191-usb-xhci-add-Broadcom-specific-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-4.1/191-usb-xhci-add-Broadcom-specific-fake-doorbell.patch @@ -115,11 +115,11 @@ Signed-off-by: Hauke Mehrtens /* --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1568,6 +1568,7 @@ struct xhci_hcd { - /* For controllers with a broken beyond repair streams implementation */ +@@ -1571,6 +1571,7 @@ struct xhci_hcd { #define XHCI_BROKEN_STREAMS (1 << 19) #define XHCI_PME_STUCK_QUIRK (1 << 20) -+#define XHCI_FAKE_DOORBELL (1 << 21) + #define XHCI_SSIC_PORT_UNUSED (1 << 22) ++#define XHCI_FAKE_DOORBELL (1 << 23) unsigned int num_active_eps; unsigned int limit_active_eps; /* There are two roothubs to keep track of bus suspend info for */ diff --git a/target/linux/bcm53xx/patches-4.1/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch b/target/linux/bcm53xx/patches-4.1/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch index dfc422ee3e..53cc452798 100644 --- a/target/linux/bcm53xx/patches-4.1/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch +++ b/target/linux/bcm53xx/patches-4.1/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch @@ -21,7 +21,7 @@ Signed-off-by: Rafał Miłecki #include "b53_regs.h" #include "b53_priv.h" -@@ -1313,6 +1314,18 @@ static int b53_switch_init(struct b53_de +@@ -1370,6 +1371,18 @@ static int b53_switch_init(struct b53_de sw_dev->cpu_port = 5; } diff --git a/target/linux/brcm63xx/patches-4.1/803-jffs2-work-around-unaligned-accesses-failing-on-bcm6.patch b/target/linux/brcm63xx/patches-4.1/803-jffs2-work-around-unaligned-accesses-failing-on-bcm6.patch index 8b603e8b66..7a3c2f01c2 100644 --- a/target/linux/brcm63xx/patches-4.1/803-jffs2-work-around-unaligned-accesses-failing-on-bcm6.patch +++ b/target/linux/brcm63xx/patches-4.1/803-jffs2-work-around-unaligned-accesses-failing-on-bcm6.patch @@ -15,7 +15,7 @@ Signed-off-by: Jonas Gorski --- a/fs/jffs2/nodelist.h +++ b/fs/jffs2/nodelist.h -@@ -255,7 +255,7 @@ struct jffs2_full_dirent +@@ -259,7 +259,7 @@ struct jffs2_full_dirent uint32_t ino; /* == zero for unlink */ unsigned int nhash; unsigned char type; diff --git a/target/linux/generic/patches-4.1/040-fs-overlay-fix-stacking.patch b/target/linux/generic/patches-4.1/040-fs-overlay-fix-stacking.patch index b3bb5c7e8a..6c13e5ff41 100644 --- a/target/linux/generic/patches-4.1/040-fs-overlay-fix-stacking.patch +++ b/target/linux/generic/patches-4.1/040-fs-overlay-fix-stacking.patch @@ -21,7 +21,7 @@ Cc: # v4.2+ --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c -@@ -362,6 +362,9 @@ struct inode *ovl_d_select_inode(struct +@@ -375,6 +375,9 @@ struct inode *ovl_d_select_inode(struct ovl_path_upper(dentry, &realpath); } diff --git a/target/linux/generic/patches-4.1/080-ipv6-ip6_fragment-fix-headroom-tests-and-skb-leak.patch b/target/linux/generic/patches-4.1/080-ipv6-ip6_fragment-fix-headroom-tests-and-skb-leak.patch index 7de8987947..629731c2c2 100644 --- a/target/linux/generic/patches-4.1/080-ipv6-ip6_fragment-fix-headroom-tests-and-skb-leak.patch +++ b/target/linux/generic/patches-4.1/080-ipv6-ip6_fragment-fix-headroom-tests-and-skb-leak.patch @@ -44,7 +44,7 @@ Closes 20532 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c -@@ -584,20 +584,22 @@ int ip6_fragment(struct sock *sk, struct +@@ -587,20 +587,22 @@ int ip6_fragment(struct sock *sk, struct } mtu -= hlen + sizeof(struct frag_hdr); @@ -69,7 +69,7 @@ Closes 20532 goto slow_path_clean; /* Partially cloned skb? */ -@@ -614,8 +616,6 @@ int ip6_fragment(struct sock *sk, struct +@@ -617,8 +619,6 @@ int ip6_fragment(struct sock *sk, struct err = 0; offset = 0; @@ -78,7 +78,7 @@ Closes 20532 /* BUILD HEADER */ *prevhdr = NEXTHDR_FRAGMENT; -@@ -623,8 +623,11 @@ int ip6_fragment(struct sock *sk, struct +@@ -626,8 +626,11 @@ int ip6_fragment(struct sock *sk, struct if (!tmp_hdr) { IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_FRAGFAILS); @@ -91,7 +91,7 @@ Closes 20532 __skb_pull(skb, hlen); fh = (struct frag_hdr *)__skb_push(skb, sizeof(struct frag_hdr)); -@@ -722,7 +725,6 @@ slow_path: +@@ -725,7 +728,6 @@ slow_path: */ *prevhdr = NEXTHDR_FRAGMENT; diff --git a/target/linux/generic/patches-4.1/190-cdc_ncm_add_support_for_moving_ndp_to_end_of_ncm_frame.patch b/target/linux/generic/patches-4.1/190-cdc_ncm_add_support_for_moving_ndp_to_end_of_ncm_frame.patch index 09cbe0c485..bd0718d7f9 100644 --- a/target/linux/generic/patches-4.1/190-cdc_ncm_add_support_for_moving_ndp_to_end_of_ncm_frame.patch +++ b/target/linux/generic/patches-4.1/190-cdc_ncm_add_support_for_moving_ndp_to_end_of_ncm_frame.patch @@ -47,7 +47,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c -@@ -684,10 +684,12 @@ static void cdc_ncm_free(struct cdc_ncm_ +@@ -685,6 +685,8 @@ static void cdc_ncm_free(struct cdc_ncm_ ctx->tx_curr_skb = NULL; } @@ -56,12 +56,16 @@ Signed-off-by: David S. Miller kfree(ctx); } +@@ -715,7 +717,7 @@ static const struct net_device_ops cdc_n + .ndo_validate_addr = eth_validate_addr, + }; + -int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting) +int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting, int drvflags) { const struct usb_cdc_union_desc *union_desc = NULL; struct cdc_ncm_ctx *ctx; -@@ -855,6 +857,17 @@ advance: +@@ -883,6 +885,17 @@ advance: /* finish setting up the device specific data */ cdc_ncm_setup(dev); @@ -79,7 +83,7 @@ Signed-off-by: David S. Miller /* override ethtool_ops */ dev->net->ethtool_ops = &cdc_ncm_ethtool_ops; -@@ -954,8 +967,11 @@ static int cdc_ncm_bind(struct usbnet *d +@@ -985,8 +998,11 @@ static int cdc_ncm_bind(struct usbnet *d if (cdc_ncm_select_altsetting(intf) != CDC_NCM_COMM_ALTSETTING_NCM) return -ENODEV; @@ -93,7 +97,7 @@ Signed-off-by: David S. Miller /* * We should get an event when network connection is "connected" or -@@ -986,6 +1002,14 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm +@@ -1017,6 +1033,14 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm struct usb_cdc_ncm_nth16 *nth16 = (void *)skb->data; size_t ndpoffset = le16_to_cpu(nth16->wNdpIndex); @@ -108,7 +112,7 @@ Signed-off-by: David S. Miller /* follow the chain of NDPs, looking for a match */ while (ndpoffset) { ndp16 = (struct usb_cdc_ncm_ndp16 *)(skb->data + ndpoffset); -@@ -995,7 +1019,8 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm +@@ -1026,7 +1050,8 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm } /* align new NDP */ @@ -118,7 +122,7 @@ Signed-off-by: David S. Miller /* verify that there is room for the NDP and the datagram (reserve) */ if ((ctx->tx_max - skb->len - reserve) < ctx->max_ndp_size) -@@ -1008,7 +1033,11 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm +@@ -1039,7 +1064,11 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm nth16->wNdpIndex = cpu_to_le16(skb->len); /* push a new empty NDP */ @@ -131,7 +135,7 @@ Signed-off-by: David S. Miller ndp16->dwSignature = sign; ndp16->wLength = cpu_to_le16(sizeof(struct usb_cdc_ncm_ndp16) + sizeof(struct usb_cdc_ncm_dpe16)); return ndp16; -@@ -1023,6 +1052,15 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev +@@ -1054,6 +1083,15 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev struct sk_buff *skb_out; u16 n = 0, index, ndplen; u8 ready2send = 0; @@ -147,7 +151,7 @@ Signed-off-by: David S. Miller /* if there is a remaining skb, it gets priority */ if (skb != NULL) { -@@ -1077,7 +1115,7 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev +@@ -1108,7 +1146,7 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev cdc_ncm_align_tail(skb_out, ctx->tx_modulus, ctx->tx_remainder, ctx->tx_max); /* check if we had enough room left for both NDP and frame */ @@ -156,7 +160,7 @@ Signed-off-by: David S. Miller if (n == 0) { /* won't fit, MTU problem? */ dev_kfree_skb_any(skb); -@@ -1150,6 +1188,17 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev +@@ -1181,6 +1219,17 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev /* variables will be reset at next call */ } @@ -217,10 +221,10 @@ Signed-off-by: David S. Miller u32 tx_timer_pending; u32 tx_curr_frame_num; -@@ -133,7 +138,7 @@ struct cdc_ncm_ctx { - }; +@@ -134,7 +139,7 @@ struct cdc_ncm_ctx { u8 cdc_ncm_select_altsetting(struct usb_interface *intf); + int cdc_ncm_change_mtu(struct net_device *net, int new_mtu); -int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); +int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting, int drvflags); void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); diff --git a/target/linux/generic/patches-4.1/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch b/target/linux/generic/patches-4.1/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch index 935c731d0f..2cd5a046d3 100644 --- a/target/linux/generic/patches-4.1/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch +++ b/target/linux/generic/patches-4.1/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch @@ -48,7 +48,7 @@ Signed-off-by: Petr Štetiar --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c -@@ -820,6 +820,7 @@ static const struct usb_device_id produc +@@ -821,6 +821,7 @@ static const struct usb_device_id produc {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */ {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */ {QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */ @@ -56,7 +56,7 @@ Signed-off-by: Petr Štetiar {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */ {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */ {QMI_GOBI_DEVICE(0x05c6, 0x9275)}, /* iRex Technologies Gobi 2000 Modem device (VR307) */ -@@ -851,10 +852,24 @@ static const struct usb_device_id produc +@@ -852,10 +853,24 @@ static const struct usb_device_id produc }; MODULE_DEVICE_TABLE(usb, products); @@ -81,7 +81,7 @@ Signed-off-by: Petr Štetiar /* Workaround to enable dynamic IDs. This disables usbnet * blacklisting functionality. Which, if required, can be -@@ -866,6 +881,12 @@ static int qmi_wwan_probe(struct usb_int +@@ -867,6 +882,12 @@ static int qmi_wwan_probe(struct usb_int id->driver_info = (unsigned long)&qmi_wwan_info; } diff --git a/target/linux/generic/patches-4.1/532-jffs2_eofdetect.patch b/target/linux/generic/patches-4.1/532-jffs2_eofdetect.patch index 9cbe183138..8ce53d8bed 100644 --- a/target/linux/generic/patches-4.1/532-jffs2_eofdetect.patch +++ b/target/linux/generic/patches-4.1/532-jffs2_eofdetect.patch @@ -1,6 +1,6 @@ --- a/fs/jffs2/build.c +++ b/fs/jffs2/build.c -@@ -114,6 +114,16 @@ static int jffs2_build_filesystem(struct +@@ -116,6 +116,16 @@ static int jffs2_build_filesystem(struct dbg_fsbuild("scanned flash completely\n"); jffs2_dbg_dump_block_lists_nolock(c); diff --git a/target/linux/generic/patches-4.1/650-pppoe_header_pad.patch b/target/linux/generic/patches-4.1/650-pppoe_header_pad.patch index adba206c08..409de58c28 100644 --- a/target/linux/generic/patches-4.1/650-pppoe_header_pad.patch +++ b/target/linux/generic/patches-4.1/650-pppoe_header_pad.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ppp/pppoe.c +++ b/drivers/net/ppp/pppoe.c -@@ -877,7 +877,7 @@ static int pppoe_sendmsg(struct socket * +@@ -879,7 +879,7 @@ static int pppoe_sendmsg(struct socket * goto end; @@ -9,7 +9,7 @@ 0, GFP_KERNEL); if (!skb) { error = -ENOMEM; -@@ -885,7 +885,7 @@ static int pppoe_sendmsg(struct socket * +@@ -887,7 +887,7 @@ static int pppoe_sendmsg(struct socket * } /* Reserve space for headers. */ diff --git a/target/linux/generic/patches-4.1/655-increase_skb_pad.patch b/target/linux/generic/patches-4.1/655-increase_skb_pad.patch index c4aee0701e..ad872ff87a 100644 --- a/target/linux/generic/patches-4.1/655-increase_skb_pad.patch +++ b/target/linux/generic/patches-4.1/655-increase_skb_pad.patch @@ -1,6 +1,6 @@ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2027,7 +2027,7 @@ static inline int pskb_network_may_pull( +@@ -2028,7 +2028,7 @@ static inline int pskb_network_may_pull( * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD diff --git a/target/linux/generic/patches-4.1/656-skb_reduce_truesize-helper.patch b/target/linux/generic/patches-4.1/656-skb_reduce_truesize-helper.patch index 72e5c26d80..762ba25d4b 100644 --- a/target/linux/generic/patches-4.1/656-skb_reduce_truesize-helper.patch +++ b/target/linux/generic/patches-4.1/656-skb_reduce_truesize-helper.patch @@ -14,7 +14,7 @@ when needed. --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2072,6 +2072,24 @@ static inline void pskb_trim_unique(stru +@@ -2073,6 +2073,24 @@ static inline void pskb_trim_unique(stru BUG_ON(err); } diff --git a/target/linux/generic/patches-4.1/662-use_fq_codel_by_default.patch b/target/linux/generic/patches-4.1/662-use_fq_codel_by_default.patch index 3cbbae3114..7e42cdd3d0 100644 --- a/target/linux/generic/patches-4.1/662-use_fq_codel_by_default.patch +++ b/target/linux/generic/patches-4.1/662-use_fq_codel_by_default.patch @@ -42,7 +42,7 @@ struct Qdisc_class_common { --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c -@@ -737,7 +737,7 @@ static void attach_one_default_qdisc(str +@@ -739,7 +739,7 @@ static void attach_one_default_qdisc(str if (dev->tx_queue_len) { qdisc = qdisc_create_dflt(dev_queue, diff --git a/target/linux/generic/patches-4.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/patches-4.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 0c453ff7d9..2892109837 100644 --- a/target/linux/generic/patches-4.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/patches-4.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -143,7 +143,7 @@ Signed-off-by: Jonas Gorski static const struct rt6_info ip6_blk_hole_entry_template = { .dst = { .__refcnt = ATOMIC_INIT(1), -@@ -1634,6 +1651,11 @@ int ip6_route_info_create(struct fib6_co +@@ -1632,6 +1649,11 @@ int ip6_route_info_create(struct fib6_co rt->dst.output = ip6_pkt_prohibit_out; rt->dst.input = ip6_pkt_prohibit; break; @@ -155,7 +155,7 @@ Signed-off-by: Jonas Gorski case RTN_THROW: default: rt->dst.error = (cfg->fc_type == RTN_THROW) ? -EAGAIN -@@ -2225,6 +2247,17 @@ static int ip6_pkt_prohibit_out(struct s +@@ -2223,6 +2245,17 @@ static int ip6_pkt_prohibit_out(struct s return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); } @@ -173,7 +173,7 @@ Signed-off-by: Jonas Gorski /* * Allocate a dst for local (unicast / anycast) address. */ -@@ -2451,7 +2484,8 @@ static int rtm_to_fib6_config(struct sk_ +@@ -2449,7 +2482,8 @@ static int rtm_to_fib6_config(struct sk_ if (rtm->rtm_type == RTN_UNREACHABLE || rtm->rtm_type == RTN_BLACKHOLE || rtm->rtm_type == RTN_PROHIBIT || @@ -183,7 +183,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -2793,6 +2827,9 @@ static int rt6_fill_node(struct net *net +@@ -2791,6 +2825,9 @@ static int rt6_fill_node(struct net *net case -EACCES: rtm->rtm_type = RTN_PROHIBIT; break; @@ -193,7 +193,7 @@ Signed-off-by: Jonas Gorski case -EAGAIN: rtm->rtm_type = RTN_THROW; break; -@@ -3050,6 +3087,8 @@ static int ip6_route_dev_notify(struct n +@@ -3048,6 +3085,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -3266,6 +3305,17 @@ static int __net_init ip6_route_net_init +@@ -3264,6 +3303,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -220,7 +220,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -3284,6 +3334,8 @@ out: +@@ -3282,6 +3332,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -229,7 +229,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -3301,6 +3353,7 @@ static void __net_exit ip6_route_net_exi +@@ -3299,6 +3351,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -237,7 +237,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -3397,6 +3450,9 @@ int __init ip6_route_init(void) +@@ -3395,6 +3448,9 @@ int __init ip6_route_init(void) init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/patches-4.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/patches-4.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index fb6a35523d..716fb95d50 100644 --- a/target/linux/generic/patches-4.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/patches-4.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4036,6 +4036,9 @@ static enum gro_result dev_gro_receive(s +@@ -4041,6 +4041,9 @@ static enum gro_result dev_gro_receive(s enum gro_result ret; int grow; @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau if (!(skb->dev->features & NETIF_F_GRO)) goto normal; -@@ -5185,6 +5188,48 @@ static void __netdev_adjacent_dev_unlink +@@ -5190,6 +5193,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *private) -@@ -5245,6 +5290,7 @@ static int __netdev_upper_dev_link(struc +@@ -5250,6 +5295,7 @@ static int __netdev_upper_dev_link(struc goto rollback_lower_mesh; } @@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers(NETDEV_CHANGEUPPER, dev); return 0; -@@ -5362,6 +5408,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -5367,6 +5413,7 @@ void netdev_upper_dev_unlink(struct net_ list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) __netdev_adjacent_dev_unlink(dev, i->dev); @@ -92,7 +92,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers(NETDEV_CHANGEUPPER, dev); } EXPORT_SYMBOL(netdev_upper_dev_unlink); -@@ -5901,6 +5948,7 @@ int dev_set_mac_address(struct net_devic +@@ -5906,6 +5953,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; @@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau #endif --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -615,7 +615,8 @@ struct sk_buff { +@@ -616,7 +616,8 @@ struct sk_buff { __u8 ipvs_property:1; __u8 inner_protocol_type:1; __u8 remcsum_offload:1; diff --git a/target/linux/generic/patches-4.1/721-phy_packets.patch b/target/linux/generic/patches-4.1/721-phy_packets.patch index a511c66d2f..3a963b5d69 100644 --- a/target/linux/generic/patches-4.1/721-phy_packets.patch +++ b/target/linux/generic/patches-4.1/721-phy_packets.patch @@ -41,7 +41,7 @@ */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2058,6 +2058,10 @@ static inline int pskb_trim(struct sk_bu +@@ -2059,6 +2059,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -52,7 +52,7 @@ /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -2184,16 +2188,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -2185,16 +2189,6 @@ static inline struct sk_buff *dev_alloc_ } @@ -86,7 +86,7 @@ help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2645,10 +2645,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -2650,10 +2650,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) dev_queue_xmit_nit(skb, dev); @@ -121,7 +121,7 @@ #include #include -@@ -568,6 +569,22 @@ struct sk_buff *__napi_alloc_skb(struct +@@ -570,6 +571,22 @@ struct sk_buff *__napi_alloc_skb(struct } EXPORT_SYMBOL(__napi_alloc_skb); diff --git a/target/linux/generic/patches-4.1/902-debloat_proc.patch b/target/linux/generic/patches-4.1/902-debloat_proc.patch index b6883a689f..b0dce818b5 100644 --- a/target/linux/generic/patches-4.1/902-debloat_proc.patch +++ b/target/linux/generic/patches-4.1/902-debloat_proc.patch @@ -1,6 +1,6 @@ --- a/fs/locks.c +++ b/fs/locks.c -@@ -2674,6 +2674,8 @@ static const struct file_operations proc +@@ -2683,6 +2683,8 @@ static const struct file_operations proc static int __init proc_locks_init(void) { @@ -239,7 +239,7 @@ --- a/net/ipv4/route.c +++ b/net/ipv4/route.c -@@ -415,6 +415,9 @@ static struct pernet_operations ip_rt_pr +@@ -416,6 +416,9 @@ static struct pernet_operations ip_rt_pr static int __init ip_rt_proc_init(void) { diff --git a/target/linux/ixp4xx/patches-4.1/600-skb_avoid_dmabounce.patch b/target/linux/ixp4xx/patches-4.1/600-skb_avoid_dmabounce.patch index 5d6809d5e4..271f6c9945 100644 --- a/target/linux/ixp4xx/patches-4.1/600-skb_avoid_dmabounce.patch +++ b/target/linux/ixp4xx/patches-4.1/600-skb_avoid_dmabounce.patch @@ -1,6 +1,6 @@ --- a/net/core/skbuff.c +++ b/net/core/skbuff.c -@@ -212,6 +212,9 @@ struct sk_buff *__alloc_skb(unsigned int +@@ -214,6 +214,9 @@ struct sk_buff *__alloc_skb(unsigned int if (sk_memalloc_socks() && (flags & SKB_ALLOC_RX)) gfp_mask |= __GFP_MEMALLOC; @@ -10,7 +10,7 @@ /* Get the HEAD */ skb = kmem_cache_alloc_node(cache, gfp_mask & ~__GFP_DMA, node); -@@ -1192,6 +1195,10 @@ int pskb_expand_head(struct sk_buff *skb +@@ -1194,6 +1197,10 @@ int pskb_expand_head(struct sk_buff *skb if (skb_shared(skb)) BUG(); diff --git a/target/linux/mediatek/patches/0010-thermal-consistently-use-int-for-temperatures.patch b/target/linux/mediatek/patches/0010-thermal-consistently-use-int-for-temperatures.patch index 88aa72553c..26276aff7a 100644 --- a/target/linux/mediatek/patches/0010-thermal-consistently-use-int-for-temperatures.patch +++ b/target/linux/mediatek/patches/0010-thermal-consistently-use-int-for-temperatures.patch @@ -746,7 +746,7 @@ Signed-off-by: Sascha Hauer struct device *dev = sensor->dev; --- a/drivers/thermal/step_wise.c +++ b/drivers/thermal/step_wise.c -@@ -113,7 +113,7 @@ static void update_passive_instance(stru +@@ -126,7 +126,7 @@ static void update_passive_instance(stru static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip) { @@ -755,7 +755,7 @@ Signed-off-by: Sascha Hauer enum thermal_trip_type trip_type; enum thermal_trend trend; struct thermal_instance *instance; -@@ -135,7 +135,7 @@ static void thermal_zone_trip_update(str +@@ -148,7 +148,7 @@ static void thermal_zone_trip_update(str trace_thermal_zone_trip(tz, trip, trip_type); } @@ -786,7 +786,7 @@ Signed-off-by: Sascha Hauer u32 val; --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c -@@ -363,7 +363,7 @@ static void handle_non_critical_trips(st +@@ -366,7 +366,7 @@ static void handle_non_critical_trips(st static void handle_critical_trips(struct thermal_zone_device *tz, int trip, enum thermal_trip_type trip_type) { @@ -795,7 +795,7 @@ Signed-off-by: Sascha Hauer tz->ops->get_trip_temp(tz, trip, &trip_temp); -@@ -411,12 +411,12 @@ static void handle_thermal_trip(struct t +@@ -414,12 +414,12 @@ static void handle_thermal_trip(struct t * * Return: On success returns 0, an error code otherwise */ @@ -810,7 +810,7 @@ Signed-off-by: Sascha Hauer enum thermal_trip_type type; #endif -@@ -453,8 +453,7 @@ EXPORT_SYMBOL_GPL(thermal_zone_get_temp) +@@ -456,8 +456,7 @@ EXPORT_SYMBOL_GPL(thermal_zone_get_temp) static void update_temperature(struct thermal_zone_device *tz) { @@ -820,7 +820,7 @@ Signed-off-by: Sascha Hauer ret = thermal_zone_get_temp(tz, &temp); if (ret) { -@@ -514,15 +513,14 @@ static ssize_t +@@ -534,15 +533,14 @@ static ssize_t temp_show(struct device *dev, struct device_attribute *attr, char *buf) { struct thermal_zone_device *tz = to_thermal_zone(dev); @@ -838,7 +838,7 @@ Signed-off-by: Sascha Hauer } static ssize_t -@@ -626,7 +624,7 @@ trip_point_temp_show(struct device *dev, +@@ -646,7 +644,7 @@ trip_point_temp_show(struct device *dev, { struct thermal_zone_device *tz = to_thermal_zone(dev); int trip, ret; @@ -847,7 +847,7 @@ Signed-off-by: Sascha Hauer if (!tz->ops->get_trip_temp) return -EPERM; -@@ -639,7 +637,7 @@ trip_point_temp_show(struct device *dev, +@@ -659,7 +657,7 @@ trip_point_temp_show(struct device *dev, if (ret) return ret; @@ -856,7 +856,7 @@ Signed-off-by: Sascha Hauer } static ssize_t -@@ -648,7 +646,7 @@ trip_point_hyst_store(struct device *dev +@@ -668,7 +666,7 @@ trip_point_hyst_store(struct device *dev { struct thermal_zone_device *tz = to_thermal_zone(dev); int trip, ret; @@ -865,7 +865,7 @@ Signed-off-by: Sascha Hauer if (!tz->ops->set_trip_hyst) return -EPERM; -@@ -656,7 +654,7 @@ trip_point_hyst_store(struct device *dev +@@ -676,7 +674,7 @@ trip_point_hyst_store(struct device *dev if (!sscanf(attr->attr.name, "trip_point_%d_hyst", &trip)) return -EINVAL; @@ -874,7 +874,7 @@ Signed-off-by: Sascha Hauer return -EINVAL; /* -@@ -675,7 +673,7 @@ trip_point_hyst_show(struct device *dev, +@@ -695,7 +693,7 @@ trip_point_hyst_show(struct device *dev, { struct thermal_zone_device *tz = to_thermal_zone(dev); int trip, ret; @@ -883,7 +883,7 @@ Signed-off-by: Sascha Hauer if (!tz->ops->get_trip_hyst) return -EPERM; -@@ -685,7 +683,7 @@ trip_point_hyst_show(struct device *dev, +@@ -705,7 +703,7 @@ trip_point_hyst_show(struct device *dev, ret = tz->ops->get_trip_hyst(tz, trip, &temperature); @@ -1031,7 +1031,7 @@ Signed-off-by: Sascha Hauer struct phy_dev_entry *phy_dev_entry; --- a/include/linux/thermal.h +++ b/include/linux/thermal.h -@@ -86,23 +86,19 @@ struct thermal_zone_device_ops { +@@ -89,23 +89,19 @@ struct thermal_zone_device_ops { struct thermal_cooling_device *); int (*unbind) (struct thermal_zone_device *, struct thermal_cooling_device *); @@ -1062,7 +1062,7 @@ Signed-off-by: Sascha Hauer int (*get_trend) (struct thermal_zone_device *, int, enum thermal_trend *); int (*notify) (struct thermal_zone_device *, int, -@@ -272,9 +268,9 @@ struct thermal_genl_event { +@@ -277,9 +273,9 @@ struct thermal_genl_event { * temperature. */ struct thermal_zone_of_device_ops { @@ -1074,7 +1074,7 @@ Signed-off-by: Sascha Hauer }; /** -@@ -335,7 +331,7 @@ thermal_of_cooling_device_register(struc +@@ -340,7 +336,7 @@ thermal_of_cooling_device_register(struc const struct thermal_cooling_device_ops *); void thermal_cooling_device_unregister(struct thermal_cooling_device *); struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name); @@ -1083,7 +1083,7 @@ Signed-off-by: Sascha Hauer int get_tz_trend(struct thermal_zone_device *, int); struct thermal_instance *get_thermal_instance(struct thermal_zone_device *, -@@ -378,7 +374,7 @@ static inline struct thermal_zone_device +@@ -383,7 +379,7 @@ static inline struct thermal_zone_device const char *name) { return ERR_PTR(-ENODEV); } static inline int thermal_zone_get_temp( diff --git a/target/linux/mediatek/patches/0011-thermal-trivial-fix-typo-in-comment.patch b/target/linux/mediatek/patches/0011-thermal-trivial-fix-typo-in-comment.patch index db06362a75..3c0dca68cc 100644 --- a/target/linux/mediatek/patches/0011-thermal-trivial-fix-typo-in-comment.patch +++ b/target/linux/mediatek/patches/0011-thermal-trivial-fix-typo-in-comment.patch @@ -11,7 +11,7 @@ Acked-by: Eduardo Valentin --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c -@@ -402,7 +402,7 @@ static void handle_thermal_trip(struct t +@@ -405,7 +405,7 @@ static void handle_thermal_trip(struct t } /** diff --git a/target/linux/mediatek/patches/0012-thermal-remove-useless-call-to-thermal_zone_device_s.patch b/target/linux/mediatek/patches/0012-thermal-remove-useless-call-to-thermal_zone_device_s.patch index f4e237f369..7bdff55384 100644 --- a/target/linux/mediatek/patches/0012-thermal-remove-useless-call-to-thermal_zone_device_s.patch +++ b/target/linux/mediatek/patches/0012-thermal-remove-useless-call-to-thermal_zone_device_s.patch @@ -17,13 +17,13 @@ Acked-by: Eduardo Valentin --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c -@@ -1571,9 +1571,6 @@ struct thermal_zone_device *thermal_zone +@@ -1601,9 +1601,6 @@ struct thermal_zone_device *thermal_zone INIT_DELAYED_WORK(&(tz->poll_queue), thermal_zone_device_check); - if (!tz->ops->get_temp) - thermal_zone_device_set_polling(tz, 0); - - thermal_zone_device_update(tz); - - return tz; + thermal_zone_device_reset(tz); + /* Update the new thermal zone and mark it as already updated. */ + if (atomic_cmpxchg(&tz->need_update, 1, 0)) diff --git a/target/linux/mediatek/patches/0013-thermal-Use-IS_ENABLED-instead-of-ifdef.patch b/target/linux/mediatek/patches/0013-thermal-Use-IS_ENABLED-instead-of-ifdef.patch index f0cbdb380b..6f4ca5a24b 100644 --- a/target/linux/mediatek/patches/0013-thermal-Use-IS_ENABLED-instead-of-ifdef.patch +++ b/target/linux/mediatek/patches/0013-thermal-Use-IS_ENABLED-instead-of-ifdef.patch @@ -14,7 +14,7 @@ Signed-off-by: Sascha Hauer --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c -@@ -414,11 +414,9 @@ static void handle_thermal_trip(struct t +@@ -417,11 +417,9 @@ static void handle_thermal_trip(struct t int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp) { int ret = -EINVAL; @@ -26,7 +26,7 @@ Signed-off-by: Sascha Hauer if (!tz || IS_ERR(tz) || !tz->ops->get_temp) goto exit; -@@ -426,25 +424,21 @@ int thermal_zone_get_temp(struct thermal +@@ -429,25 +427,21 @@ int thermal_zone_get_temp(struct thermal mutex_lock(&tz->lock); ret = tz->ops->get_temp(tz, temp); @@ -65,7 +65,7 @@ Signed-off-by: Sascha Hauer mutex_unlock(&tz->lock); exit: return ret; -@@ -780,7 +774,6 @@ policy_show(struct device *dev, struct d +@@ -800,7 +794,6 @@ policy_show(struct device *dev, struct d return sprintf(buf, "%s\n", tz->governor->name); } @@ -73,7 +73,7 @@ Signed-off-by: Sascha Hauer static ssize_t emul_temp_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) -@@ -806,7 +799,6 @@ emul_temp_store(struct device *dev, stru +@@ -826,7 +819,6 @@ emul_temp_store(struct device *dev, stru return ret ? ret : count; } static DEVICE_ATTR(emul_temp, S_IWUSR, NULL, emul_temp_store); @@ -81,7 +81,7 @@ Signed-off-by: Sascha Hauer static DEVICE_ATTR(type, 0444, type_show, NULL); static DEVICE_ATTR(temp, 0444, temp_show, NULL); -@@ -1536,11 +1528,12 @@ struct thermal_zone_device *thermal_zone +@@ -1566,11 +1558,12 @@ struct thermal_zone_device *thermal_zone goto unregister; } diff --git a/target/linux/mediatek/patches/0014-thermal-Add-comment-explaining-test-for-critical-tem.patch b/target/linux/mediatek/patches/0014-thermal-Add-comment-explaining-test-for-critical-tem.patch index 8f7ee00cae..4d3581283b 100644 --- a/target/linux/mediatek/patches/0014-thermal-Add-comment-explaining-test-for-critical-tem.patch +++ b/target/linux/mediatek/patches/0014-thermal-Add-comment-explaining-test-for-critical-tem.patch @@ -15,7 +15,7 @@ Reviewed-by: Mikko Perttunen --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c -@@ -435,6 +435,11 @@ int thermal_zone_get_temp(struct thermal +@@ -438,6 +438,11 @@ int thermal_zone_get_temp(struct thermal } } diff --git a/target/linux/mediatek/patches/0015-thermal-inline-only-once-used-function.patch b/target/linux/mediatek/patches/0015-thermal-inline-only-once-used-function.patch index e3ffb330f5..0ac3aa95f0 100644 --- a/target/linux/mediatek/patches/0015-thermal-inline-only-once-used-function.patch +++ b/target/linux/mediatek/patches/0015-thermal-inline-only-once-used-function.patch @@ -14,7 +14,7 @@ Reviewed-by: Mikko Perttunen --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c -@@ -450,9 +450,12 @@ exit: +@@ -453,9 +453,15 @@ exit: } EXPORT_SYMBOL_GPL(thermal_zone_get_temp); @@ -24,25 +24,47 @@ Reviewed-by: Mikko Perttunen - int temp, ret; + int temp, ret, count; + ++ if (atomic_read(&in_suspend)) ++ return; ++ + if (!tz->ops->get_temp) + return; ret = thermal_zone_get_temp(tz, &temp); if (ret) { -@@ -471,16 +474,6 @@ static void update_temperature(struct th - trace_thermal_temperature(tz); - dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n", - tz->last_temperature, tz->temperature); --} -- +@@ -478,7 +484,11 @@ static void update_temperature(struct th + else + dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n", + tz->last_temperature, tz->temperature); ++ ++ for (count = 0; count < tz->trips; count++) ++ handle_thermal_trip(tz, count); + } ++EXPORT_SYMBOL_GPL(thermal_zone_device_update); + + static void thermal_zone_device_reset(struct thermal_zone_device *tz) + { +@@ -490,23 +500,6 @@ static void thermal_zone_device_reset(st + pos->initialized = false; + } + -void thermal_zone_device_update(struct thermal_zone_device *tz) -{ - int count; - +- if (atomic_read(&in_suspend)) +- return; +- - if (!tz->ops->get_temp) - return; - - update_temperature(tz); - - for (count = 0; count < tz->trips; count++) - handle_thermal_trip(tz, count); +- +- for (count = 0; count < tz->trips; count++) +- handle_thermal_trip(tz, count); +-} +-EXPORT_SYMBOL_GPL(thermal_zone_device_update); +- + static void thermal_zone_device_check(struct work_struct *work) + { + struct thermal_zone_device *tz = container_of(work, struct diff --git a/target/linux/mediatek/patches/0016-thermal-streamline-get_trend-callbacks.patch b/target/linux/mediatek/patches/0016-thermal-streamline-get_trend-callbacks.patch index 3ee345e688..37c580ac82 100644 --- a/target/linux/mediatek/patches/0016-thermal-streamline-get_trend-callbacks.patch +++ b/target/linux/mediatek/patches/0016-thermal-streamline-get_trend-callbacks.patch @@ -103,7 +103,7 @@ Signed-off-by: Sascha Hauer int *temp) --- a/include/linux/thermal.h +++ b/include/linux/thermal.h -@@ -269,7 +269,7 @@ struct thermal_genl_event { +@@ -274,7 +274,7 @@ struct thermal_genl_event { */ struct thermal_zone_of_device_ops { int (*get_temp)(void *, int *); diff --git a/target/linux/mediatek/patches/0017-thermal-Allow-sensor-ops-to-fail-with-ENOSYS.patch b/target/linux/mediatek/patches/0017-thermal-Allow-sensor-ops-to-fail-with-ENOSYS.patch index 65c76c3a26..5a4c1da2b1 100644 --- a/target/linux/mediatek/patches/0017-thermal-Allow-sensor-ops-to-fail-with-ENOSYS.patch +++ b/target/linux/mediatek/patches/0017-thermal-Allow-sensor-ops-to-fail-with-ENOSYS.patch @@ -22,7 +22,7 @@ Signed-off-by: Sascha Hauer --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c -@@ -413,13 +413,16 @@ static void handle_thermal_trip(struct t +@@ -416,13 +416,16 @@ static void handle_thermal_trip(struct t */ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp) { @@ -42,7 +42,7 @@ Signed-off-by: Sascha Hauer mutex_lock(&tz->lock); -@@ -445,7 +448,7 @@ int thermal_zone_get_temp(struct thermal +@@ -448,7 +451,7 @@ int thermal_zone_get_temp(struct thermal } mutex_unlock(&tz->lock); @@ -51,9 +51,9 @@ Signed-off-by: Sascha Hauer return ret; } EXPORT_SYMBOL_GPL(thermal_zone_get_temp); -@@ -454,10 +457,11 @@ void thermal_zone_device_update(struct t - { - int temp, ret, count; +@@ -460,10 +463,11 @@ void thermal_zone_device_update(struct t + if (atomic_read(&in_suspend)) + return; - if (!tz->ops->get_temp) + ret = thermal_zone_get_temp(tz, &temp); @@ -65,7 +65,7 @@ Signed-off-by: Sascha Hauer if (ret) { if (ret != -EAGAIN) dev_warn(&tz->device, -@@ -783,10 +787,16 @@ emul_temp_store(struct device *dev, stru +@@ -803,10 +807,16 @@ emul_temp_store(struct device *dev, stru if (kstrtoul(buf, 10, &temperature)) return -EINVAL; diff --git a/target/linux/mediatek/patches/0019-thermal-Make-struct-thermal_zone_device_ops-const.patch b/target/linux/mediatek/patches/0019-thermal-Make-struct-thermal_zone_device_ops-const.patch index 36f7ccf1ea..c91f6c8b31 100644 --- a/target/linux/mediatek/patches/0019-thermal-Make-struct-thermal_zone_device_ops-const.patch +++ b/target/linux/mediatek/patches/0019-thermal-Make-struct-thermal_zone_device_ops-const.patch @@ -220,7 +220,7 @@ Signed-off-by: Sascha Hauer .get_trip_temp = st_thermal_get_trip_temp, --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c -@@ -1451,7 +1451,7 @@ static void remove_trip_attrs(struct the +@@ -1479,7 +1479,7 @@ static void remove_trip_attrs(struct the */ struct thermal_zone_device *thermal_zone_device_register(const char *type, int trips, int mask, void *devdata, @@ -253,16 +253,16 @@ Signed-off-by: Sascha Hauer .get_trip_type = sys_get_trip_type, --- a/include/linux/thermal.h +++ b/include/linux/thermal.h -@@ -181,7 +181,7 @@ struct thermal_zone_device { - int emul_temperature; +@@ -186,7 +186,7 @@ struct thermal_zone_device { int passive; unsigned int forced_passive; + atomic_t need_update; - struct thermal_zone_device_ops *ops; + const struct thermal_zone_device_ops *ops; const struct thermal_zone_params *tzp; struct thermal_governor *governor; struct list_head thermal_instances; -@@ -313,7 +313,7 @@ void thermal_zone_of_sensor_unregister(s +@@ -318,7 +318,7 @@ void thermal_zone_of_sensor_unregister(s #if IS_ENABLED(CONFIG_THERMAL) struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, @@ -271,7 +271,7 @@ Signed-off-by: Sascha Hauer const struct thermal_zone_params *, int, int); void thermal_zone_device_unregister(struct thermal_zone_device *); -@@ -341,7 +341,7 @@ void thermal_notify_framework(struct the +@@ -346,7 +346,7 @@ void thermal_notify_framework(struct the #else static inline struct thermal_zone_device *thermal_zone_device_register( const char *type, int trips, int mask, void *devdata, diff --git a/target/linux/mediatek/patches/0020-thermal-thermal-Add-support-for-hardware-tracked-tri.patch b/target/linux/mediatek/patches/0020-thermal-thermal-Add-support-for-hardware-tracked-tri.patch index d492a0683f..ab305e73a9 100644 --- a/target/linux/mediatek/patches/0020-thermal-thermal-Add-support-for-hardware-tracked-tri.patch +++ b/target/linux/mediatek/patches/0020-thermal-thermal-Add-support-for-hardware-tracked-tri.patch @@ -32,7 +32,7 @@ Signed-off-by: Sascha Hauer --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c -@@ -453,6 +453,45 @@ int thermal_zone_get_temp(struct thermal +@@ -456,6 +456,45 @@ int thermal_zone_get_temp(struct thermal } EXPORT_SYMBOL_GPL(thermal_zone_get_temp); @@ -78,27 +78,27 @@ Signed-off-by: Sascha Hauer void thermal_zone_device_update(struct thermal_zone_device *tz) { int temp, ret, count; -@@ -479,6 +518,8 @@ void thermal_zone_device_update(struct t - dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n", - tz->last_temperature, tz->temperature); +@@ -489,6 +528,8 @@ void thermal_zone_device_update(struct t + dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n", + tz->last_temperature, tz->temperature); + thermal_zone_set_trips(tz); + for (count = 0; count < tz->trips; count++) handle_thermal_trip(tz, count); } -@@ -1494,6 +1535,8 @@ struct thermal_zone_device *thermal_zone +@@ -1522,6 +1563,8 @@ struct thermal_zone_device *thermal_zone tz->trips = trips; tz->passive_delay = passive_delay; tz->polling_delay = polling_delay; + tz->prev_low_trip = INT_MAX; + tz->prev_high_trip = -INT_MAX; + /* A new thermal zone needs to be updated anyway. */ + atomic_set(&tz->need_update, 1); - dev_set_name(&tz->device, "thermal_zone%d", tz->id); - result = device_register(&tz->device); --- a/include/linux/thermal.h +++ b/include/linux/thermal.h -@@ -87,6 +87,7 @@ struct thermal_zone_device_ops { +@@ -90,6 +90,7 @@ struct thermal_zone_device_ops { int (*unbind) (struct thermal_zone_device *, struct thermal_cooling_device *); int (*get_temp) (struct thermal_zone_device *, int *); @@ -106,12 +106,12 @@ Signed-off-by: Sascha Hauer int (*get_mode) (struct thermal_zone_device *, enum thermal_device_mode *); int (*set_mode) (struct thermal_zone_device *, -@@ -180,6 +181,8 @@ struct thermal_zone_device { +@@ -184,6 +185,8 @@ struct thermal_zone_device { int last_temperature; int emul_temperature; int passive; + int prev_low_trip; + int prev_high_trip; unsigned int forced_passive; + atomic_t need_update; const struct thermal_zone_device_ops *ops; - const struct thermal_zone_params *tzp; diff --git a/target/linux/mediatek/patches/0021-thermal-of-implement-.set_trips-for-device-tree-ther.patch b/target/linux/mediatek/patches/0021-thermal-of-implement-.set_trips-for-device-tree-ther.patch index 149ba000af..09c9f24a4d 100644 --- a/target/linux/mediatek/patches/0021-thermal-of-implement-.set_trips-for-device-tree-ther.patch +++ b/target/linux/mediatek/patches/0021-thermal-of-implement-.set_trips-for-device-tree-ther.patch @@ -40,7 +40,7 @@ Signed-off-by: Sascha Hauer --- a/include/linux/thermal.h +++ b/include/linux/thermal.h -@@ -267,12 +267,15 @@ struct thermal_genl_event { +@@ -272,12 +272,15 @@ struct thermal_genl_event { * * Optional: * @get_trend: a pointer to a function that reads the sensor temperature trend. diff --git a/target/linux/mediatek/patches/0047-xhci-mediatek-support-MTK-xHCI-host-controller.patch b/target/linux/mediatek/patches/0047-xhci-mediatek-support-MTK-xHCI-host-controller.patch index 55e340d74f..54c5bfc098 100644 --- a/target/linux/mediatek/patches/0047-xhci-mediatek-support-MTK-xHCI-host-controller.patch +++ b/target/linux/mediatek/patches/0047-xhci-mediatek-support-MTK-xHCI-host-controller.patch @@ -709,71 +709,42 @@ Signed-off-by: Chunfeng Yun /* * Returns zero if the TRB isn't in this segment, otherwise it returns the DMA -@@ -3173,9 +3174,14 @@ static int queue_bulk_sg_tx(struct xhci_ +@@ -3026,17 +3027,22 @@ static u32 xhci_td_remainder(struct xhci + { + u32 maxp, total_packet_count; - /* Set the TRB length, TD size, and interrupter fields. */ - if (xhci->hci_version < 0x100) { -- remainder = xhci_td_remainder( -+ if (xhci->quirks & XHCI_MTK_HOST) { -+ remainder = xhci_mtk_td_remainder_quirk( -+ running_total, trb_buff_len, urb); -+ } else { -+ remainder = xhci_td_remainder( - urb->transfer_buffer_length - - running_total); -+ } - } else { - remainder = xhci_v1_0_td_remainder(running_total, - trb_buff_len, total_packet_count, urb, -@@ -3346,9 +3352,14 @@ int xhci_queue_bulk_tx(struct xhci_hcd * +- if (xhci->hci_version < 0x100) ++ /* MTK xHCI is mostly 0.97 but contains some features from 1.0 */ ++ if (xhci->hci_version < 0x100 && !(xhci->quirks & XHCI_MTK_HOST)) + return ((td_total_len - transferred) >> 10); - /* Set the TRB length, TD size, and interrupter fields. */ - if (xhci->hci_version < 0x100) { -- remainder = xhci_td_remainder( -+ if (xhci->quirks & XHCI_MTK_HOST) { -+ remainder = xhci_mtk_td_remainder_quirk( -+ running_total, trb_buff_len, urb); -+ } else { -+ remainder = xhci_td_remainder( - urb->transfer_buffer_length - - running_total); -+ } - } else { - remainder = xhci_v1_0_td_remainder(running_total, - trb_buff_len, total_packet_count, urb, -@@ -3467,8 +3478,14 @@ int xhci_queue_ctrl_tx(struct xhci_hcd * - field = TRB_TYPE(TRB_DATA); +- maxp = GET_MAX_PACKET(usb_endpoint_maxp(&urb->ep->desc)); +- total_packet_count = DIV_ROUND_UP(td_total_len, maxp); +- + /* One TRB with a zero-length data packet. */ + if (num_trbs_left == 0 || (transferred == 0 && trb_buff_len == 0) || + trb_buff_len == td_total_len) + return 0; - length_field = TRB_LEN(urb->transfer_buffer_length) | -- xhci_td_remainder(urb->transfer_buffer_length) | - TRB_INTR_TARGET(0); -+ ++ /* for MTK xHCI, TD size doesn't include this TRB */ + if (xhci->quirks & XHCI_MTK_HOST) -+ length_field |= xhci_mtk_td_remainder_quirk(0, -+ urb->transfer_buffer_length, urb); -+ else -+ length_field |= xhci_td_remainder(urb->transfer_buffer_length); ++ trb_buff_len = 0; + - if (urb->transfer_buffer_length > 0) { - if (setup->bRequestType & USB_DIR_IN) - field |= TRB_DIR_IN; -@@ -3692,8 +3709,14 @@ static int xhci_queue_isoc_tx(struct xhc ++ maxp = GET_MAX_PACKET(usb_endpoint_maxp(&urb->ep->desc)); ++ total_packet_count = DIV_ROUND_UP(td_total_len, maxp); ++ + /* Queueing functions don't count the current TRB into transferred */ + return (total_packet_count - ((transferred + trb_buff_len) / maxp)); + } +@@ -3424,7 +3430,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd * + field |= 0x1; - /* Set the TRB length, TD size, & interrupter fields. */ - if (xhci->hci_version < 0x100) { -- remainder = xhci_td_remainder( -- td_len - running_total); -+ if (xhci->quirks & XHCI_MTK_HOST) { -+ remainder = xhci_mtk_td_remainder_quirk( -+ running_total, trb_buff_len, -+ urb); -+ } else { -+ remainder = xhci_td_remainder( -+ td_len - running_total); -+ } - } else { - remainder = xhci_v1_0_td_remainder( - running_total, trb_buff_len, + /* xHCI 1.0/1.1 6.4.1.2.1: Transfer Type field */ +- if (xhci->hci_version >= 0x100) { ++ if ((xhci->hci_version >= 0x100) || (xhci->quirks & XHCI_MTK_HOST)) { + if (urb->transfer_buffer_length > 0) { + if (setup->bRequestType & USB_DIR_IN) + field |= TRB_TX_TYPE(TRB_DATA_IN); --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -31,6 +31,7 @@ @@ -797,7 +768,7 @@ Signed-off-by: Chunfeng Yun writel(temp, &xhci->ir_set->irq_control); /* Set the HCD state before we enable the irqs */ -@@ -1708,6 +1713,9 @@ int xhci_drop_endpoint(struct usb_hcd *h +@@ -1710,6 +1715,9 @@ int xhci_drop_endpoint(struct usb_hcd *h xhci_endpoint_zero(xhci, xhci->devs[udev->slot_id], ep); @@ -807,7 +778,7 @@ Signed-off-by: Chunfeng Yun xhci_dbg(xhci, "drop ep 0x%x, slot id %d, new drop flags = %#x, new add flags = %#x\n", (unsigned int) ep->desc.bEndpointAddress, udev->slot_id, -@@ -1803,6 +1811,12 @@ int xhci_add_endpoint(struct usb_hcd *hc +@@ -1805,6 +1813,12 @@ int xhci_add_endpoint(struct usb_hcd *hc return -ENOMEM; } @@ -822,11 +793,11 @@ Signed-off-by: Chunfeng Yun --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1568,6 +1568,7 @@ struct xhci_hcd { +@@ -1570,6 +1570,7 @@ struct xhci_hcd { /* For controllers with a broken beyond repair streams implementation */ #define XHCI_BROKEN_STREAMS (1 << 19) #define XHCI_PME_STUCK_QUIRK (1 << 20) +#define XHCI_MTK_HOST (1 << 21) + #define XHCI_SSIC_PORT_UNUSED (1 << 22) unsigned int num_active_eps; unsigned int limit_active_eps; - /* There are two roothubs to keep track of bus suspend info for */ diff --git a/target/linux/oxnas/patches-4.1/800-oxnas-ehci.patch b/target/linux/oxnas/patches-4.1/800-oxnas-ehci.patch index b283bbd3f6..87377e7cad 100644 --- a/target/linux/oxnas/patches-4.1/800-oxnas-ehci.patch +++ b/target/linux/oxnas/patches-4.1/800-oxnas-ehci.patch @@ -16,7 +16,7 @@ config USB_OXU210HP_HCD --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile -@@ -42,6 +42,7 @@ obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci- +@@ -39,6 +39,7 @@ obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci- obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o obj-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o obj-$(CONFIG_USB_W90X900_EHCI) += ehci-w90x900.o