kernel: update kernel 4.1 to version 4.1.20
authorHauke Mehrtens <hauke@hauke-m.de>
Fri, 18 Mar 2016 23:41:21 +0000 (23:41 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 18 Mar 2016 23:41:21 +0000 (23:41 +0000)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
SVN-Revision: 49035

32 files changed:
include/kernel-version.mk
target/linux/ar71xx/patches-4.1/910-unaligned_access_hacks.patch
target/linux/bcm53xx/patches-4.1/191-usb-xhci-add-Broadcom-specific-fake-doorbell.patch
target/linux/bcm53xx/patches-4.1/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch
target/linux/brcm63xx/patches-4.1/803-jffs2-work-around-unaligned-accesses-failing-on-bcm6.patch
target/linux/generic/patches-4.1/040-fs-overlay-fix-stacking.patch
target/linux/generic/patches-4.1/080-ipv6-ip6_fragment-fix-headroom-tests-and-skb-leak.patch
target/linux/generic/patches-4.1/190-cdc_ncm_add_support_for_moving_ndp_to_end_of_ncm_frame.patch
target/linux/generic/patches-4.1/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch
target/linux/generic/patches-4.1/532-jffs2_eofdetect.patch
target/linux/generic/patches-4.1/650-pppoe_header_pad.patch
target/linux/generic/patches-4.1/655-increase_skb_pad.patch
target/linux/generic/patches-4.1/656-skb_reduce_truesize-helper.patch
target/linux/generic/patches-4.1/662-use_fq_codel_by_default.patch
target/linux/generic/patches-4.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
target/linux/generic/patches-4.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
target/linux/generic/patches-4.1/721-phy_packets.patch
target/linux/generic/patches-4.1/902-debloat_proc.patch
target/linux/ixp4xx/patches-4.1/600-skb_avoid_dmabounce.patch
target/linux/mediatek/patches/0010-thermal-consistently-use-int-for-temperatures.patch
target/linux/mediatek/patches/0011-thermal-trivial-fix-typo-in-comment.patch
target/linux/mediatek/patches/0012-thermal-remove-useless-call-to-thermal_zone_device_s.patch
target/linux/mediatek/patches/0013-thermal-Use-IS_ENABLED-instead-of-ifdef.patch
target/linux/mediatek/patches/0014-thermal-Add-comment-explaining-test-for-critical-tem.patch
target/linux/mediatek/patches/0015-thermal-inline-only-once-used-function.patch
target/linux/mediatek/patches/0016-thermal-streamline-get_trend-callbacks.patch
target/linux/mediatek/patches/0017-thermal-Allow-sensor-ops-to-fail-with-ENOSYS.patch
target/linux/mediatek/patches/0019-thermal-Make-struct-thermal_zone_device_ops-const.patch
target/linux/mediatek/patches/0020-thermal-thermal-Add-support-for-hardware-tracked-tri.patch
target/linux/mediatek/patches/0021-thermal-of-implement-.set_trips-for-device-tree-ther.patch
target/linux/mediatek/patches/0047-xhci-mediatek-support-MTK-xHCI-host-controller.patch
target/linux/oxnas/patches-4.1/800-oxnas-ehci.patch

index 6fcd81eaecddb1e0909afd2379c1491ec87e7e17..6080ed6aca0a2d9a196f1c83016c2147e5ca4615 100644 (file)
@@ -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
 
index e39eac3982b58dc514c453bd6f1e23fd5613fe1c..ea66f9ab675663e30b07e52bdb6dde31968bfecb 100644 (file)
  #include <linux/uaccess.h>
  #include <linux/ipv6.h>
  #include <linux/icmpv6.h>
-@@ -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) {
   */
 --- 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 {
                                               &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) {
        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;
  
  #include <linux/netdevice.h>
 --- 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)
  {
index c2cbe2cc09eeeaf346e433ba2cdd923492b0977a..535bc697034d622692f7f964f53ad2a6390731e8 100644 (file)
@@ -115,11 +115,11 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  /*
 --- 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 */
index dfc422ee3ef4251fc6f09f97558d967a285e6ec8..53cc4527987e1a7b8688a07addcae660ad593d85 100644 (file)
@@ -21,7 +21,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
  
  #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;
        }
  
index 8b603e8b66c6f1a3922e3604b6625e07696ad3e8..7a3c2f01c259d8a781628950813cb2fe35372e42 100644 (file)
@@ -15,7 +15,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
 
 --- 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;
index b3bb5c7e8a89cc63c47c8b352afe32cb0508ee6a..6c13e5ff419be757b53d29cd75ed8d78fba4ac0f 100644 (file)
@@ -21,7 +21,7 @@ Cc: <stable@vger.kernel.org> # 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);
        }
  
index 7de89879476aa025af4d104018131574a8f9324e..629731c2c2e55bc3f13b00c257bdb78695bf39fe 100644 (file)
@@ -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;
index 09cbe0c485a7847b7b11ad78b5fddeec3fe37873..bd0718d7f94a127c14f0c3c6fdbfa662f0683df3 100644 (file)
@@ -47,7 +47,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
 --- 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 <davem@davemloft.net>
        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 <davem@davemloft.net>
        /* 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 <davem@davemloft.net>
  
        /*
         * 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 <davem@davemloft.net>
        /* 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 <davem@davemloft.net>
  
        /* 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 <davem@davemloft.net>
        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 <davem@davemloft.net>
  
        /* 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 <davem@davemloft.net>
                        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 <davem@davemloft.net>
  
        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);
index 935c731d0f6fb89852b4068defd865ff1c5a1501..2cd5a046d38ef2fa325e8f56519798acc6cfb3ab 100644 (file)
@@ -48,7 +48,7 @@ Signed-off-by: Petr Štetiar <ynezz@true.cz>
 
 --- 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 <ynezz@true.cz>
        {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 <ynezz@true.cz>
  
        /* 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;
        }
  
index 9cbe183138889dc558857d2d565562acfcbd7afa..8ce53d8bed54ce225da77dc65e150d89dcf93301 100644 (file)
@@ -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);
  
index adba206c089f1d40c1797232e8b8e25be3c21f48..409de58c2879ba5c4177464b5ad835d07db4a23a 100644 (file)
@@ -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. */
index c4aee0701ee8e50d0800bb6c6ee5ce653fdfde75..ad872ff87ab92cf37851d9ba3c3b9263af437319 100644 (file)
@@ -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
index 72e5c26d80ffd4946a576dfcf1fc66ad2c4d3879..762ba25d4b96c3f0cd68fe7c892898ed8fbaf256 100644 (file)
@@ -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);
  }
  
index 3cbbae31146e4e5a31977c9b6eaa868879e84029..7e42cdd3d0fcd0a276f5ff1b68463e7358677ed1 100644 (file)
@@ -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,
index 0c453ff7d919dfef4f4e67172bd5a3e57351cb96..2892109837038a0ef37187555d946a2a16ebe987 100644 (file)
@@ -143,7 +143,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
  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 <jogo@openwrt.org>
                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 <jogo@openwrt.org>
  /*
   *    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 <jogo@openwrt.org>
                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 <jogo@openwrt.org>
                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 <jogo@openwrt.org>
                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 <jogo@openwrt.org>
  #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 <jogo@openwrt.org>
  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 <jogo@openwrt.org>
  #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);
index fb6a35523d371fc5d4bec00b9b4ee852aff7fad9..716fb95d50cb03b751133d4eefe55dd34b7cdcfc 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
 
 --- 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 <nbd@openwrt.org>
        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 <nbd@openwrt.org>
  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 <nbd@openwrt.org>
        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 <nbd@openwrt.org>
        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 <nbd@openwrt.org>
  #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;
index a511c66d2f2e8c37e782d95ad34929fa54f08531..3a963b5d69620540612d042faeb7b515e38fb704 100644 (file)
@@ -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);
  
  
  #include <net/protocol.h>
  #include <net/dst.h>
-@@ -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);
  
index b6883a689ff069595e4c0a3e9986ce6b8f997cf1..b0dce818b507e095792fb4e4e416d2ea94606978 100644 (file)
@@ -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)
  {
  
 --- 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)
  {
index 5d6809d5e49c3107e3122b179a955b559b112533..271f6c99454f58a748cbef8034e37460bfe7c9f2 100644 (file)
@@ -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();
  
index 88aa72553cb9e418aa7cb418dfe10e4cf73cda98..26276aff7a3edba96478193da736dd555b6c6526 100644 (file)
@@ -746,7 +746,7 @@ Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
        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 <s.hauer@pengutronix.de>
        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 <s.hauer@pengutronix.de>
        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 <s.hauer@pengutronix.de>
  
        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 <s.hauer@pengutronix.de>
        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 <s.hauer@pengutronix.de>
  
        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 <s.hauer@pengutronix.de>
  }
  
  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 <s.hauer@pengutronix.de>
  
        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 <s.hauer@pengutronix.de>
  }
  
  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 <s.hauer@pengutronix.de>
  
        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 <s.hauer@pengutronix.de>
                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 <s.hauer@pengutronix.de>
  
        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 <s.hauer@pengutronix.de>
        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 <s.hauer@pengutronix.de>
        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 <s.hauer@pengutronix.de>
  };
  
  /**
-@@ -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 <s.hauer@pengutronix.de>
  
  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(
index db06362a75681fc6cb5ddbd3b1ef1ba5f05fb116..3c0dca68cc65ec1f962e5f040a5346e8b189bf0d 100644 (file)
@@ -11,7 +11,7 @@ Acked-by: Eduardo Valentin <edubezval@gmail.com>
 
 --- 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
  }
  
  /**
index f4e237f36918cc85498e19fb330942f44fa666c5..7bdff5538412136b34a95a70a7e8fc79569de703 100644 (file)
@@ -17,13 +17,13 @@ Acked-by: Eduardo Valentin <edubezval@gmail.com>
 
 --- 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))
index f0cbdb380b630e2bdfa42915aef19051c38a3317..6f4ca5a24b77ea12cf3308e2d3bf41b98c3f9791 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
 
 --- 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 <s.hauer@pengutronix.de>
  
        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 <s.hauer@pengutronix.de>
        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 <s.hauer@pengutronix.de>
  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 <s.hauer@pengutronix.de>
  
  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;
        }
  
index 8f7ee00cae3df8b830f4a1a9c35405e96ada85b9..4d3581283b6e5481175da504b66ea492908720ed 100644 (file)
@@ -15,7 +15,7 @@ Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
 
 --- 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
                        }
                }
  
index e3ffb330f5b7c6ca03d314fa209aabbd74b33068..0ac3aa95f07b4250db08446a0fde13ff48b9c434 100644 (file)
@@ -14,7 +14,7 @@ Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
 
 --- 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 <mperttunen@nvidia.com>
 -      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
index 3ee345e688a50a3cc8ffb8ff412abb0dccda1eea..37c580ac82f1349fb33038296d7ae76cae94738f 100644 (file)
@@ -103,7 +103,7 @@ Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
                                    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 *);
index 65c76c3a260a1f44faef5d119b427021899f10cd..5a4c1da2b17ee6f29471d1026b51dbdc0e9b43cc 100644 (file)
@@ -22,7 +22,7 @@ Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
 
 --- 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 <s.hauer@pengutronix.de>
  
        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 <s.hauer@pengutronix.de>
        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 <s.hauer@pengutronix.de>
        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;
  
index 36f7ccf1eaeeb894be5710b6895216ec9f3881ab..c91f6c8b3121a1552f66d65e76707e4c3ddeee21 100644 (file)
@@ -220,7 +220,7 @@ Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
        .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 <s.hauer@pengutronix.de>
        .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 <s.hauer@pengutronix.de>
                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,
index d492a0683f29df8c982061c76a97fbb568492a18..ab305e73a9b1bd11510ece729db0288a6fbde0a2 100644 (file)
@@ -32,7 +32,7 @@ Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
 
 --- 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 <s.hauer@pengutronix.de>
  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 <s.hauer@pengutronix.de>
        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;
index 149ba000af229a33019ac9f2a5d780aa54cb9989..09c9f24a4de0fad04681f912eb867113f3aaf8c9 100644 (file)
@@ -40,7 +40,7 @@ Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
  
 --- 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.
index 55e340d74f98ad405a802b181e24a69efe3ddc78..54c5bfc09822caaaca7ad350b5c9fcd9f8ba80c4 100644 (file)
@@ -709,71 +709,42 @@ Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
  
  /*
   * 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 <chunfeng.yun@mediatek.com>
        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 <chunfeng.yun@mediatek.com>
        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 <chunfeng.yun@mediatek.com>
  
 --- 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 */
index b283bbd3f66a9395b3f247ea0402bfbadd84f9c2..87377e7cad2d248789a03816c17d2807fbe1583f 100644 (file)
@@ -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