From patchwork Tue Sep 3 06:55:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 172777 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp5273775ily; Mon, 2 Sep 2019 23:56:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwHMOv4enhDBcoB+K3XlJLi3iYAIfUVNWuN2DIoetjkZyjcEqRnkuOBtvrcGp8RQmB1V3i X-Received: by 2002:a17:902:5ac3:: with SMTP id g3mr35570721plm.25.1567493771223; Mon, 02 Sep 2019 23:56:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567493771; cv=none; d=google.com; s=arc-20160816; b=bbnT+G0XLwr1BZWmdyJTAMWudu43uJ03G3nKR+4v9221ScwXhG0sWgxIlCKJixCL+3 zs07rzioQGV22FgmvS+Ub/yRktECqJR2DT8cmkfTGCkh1WzueyzLdl27AB14MCuSRayr PyvZFis8p31Gd19JwlbVizYRGN2PdkGkjcDavaGEG0PY+w5W/ub35W3fZwu7hVfQsQPc gZSEHKWyUqWVJ7H9R6loxKwmn02319nLJwJX1w/58vI6m7fvwEFnpBOstCiBvTr2pn5C 5qL+AlJbfGD43QzE30W1APqdSGey4EKkTsv5Pq9Z47it2EnErhv7uPxdtVOhwQr3XtJQ QUkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=63naJTzVpAIq0B9AEz7oC56daTv5sIo3itON2f7HCdg=; b=f3GFYaKxetsTV6vId9rsujpTCRK38GJTvsFUPtrcdNiFi3CAtQoij02+6aaJuthM7v 3oP7zpDCwLiffGIxyvs3TDQYCnkqhMrvhA0Hn/UKDEuqyT5tRxLshBbfHsajjrjLVMPc 2iK9FFk92C9qzKf7itLKHKQFn478cd3xL0Q2b57/SmPe1nBGYJmPy2y2Z0nqSASW8OPu RTDC8GRSfBPNuq8iFoTbic0R8bBOJ82O0B5JYBSmo7kARCYu2i5bcirzXcZMbC25HJ1b 59pw/t2UTMg8VRJ4eLuAaLTWB+RWXV554JGNDrwLEH6aIcJUQ7WOOi/kaOC2z0I2Wdhm uAbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qlIc1kZN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 98si13929598plb.345.2019.09.02.23.56.10; Mon, 02 Sep 2019 23:56:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qlIc1kZN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727555AbfICG4K (ORCPT + 28 others); Tue, 3 Sep 2019 02:56:10 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45078 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbfICG4I (ORCPT ); Tue, 3 Sep 2019 02:56:08 -0400 Received: by mail-pf1-f195.google.com with SMTP id y72so2587965pfb.12 for ; Mon, 02 Sep 2019 23:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=63naJTzVpAIq0B9AEz7oC56daTv5sIo3itON2f7HCdg=; b=qlIc1kZNUSEis4xPtAe2vGproYxzVQ4Sqyq9xvpjUKmmWltJv/1g/l4c/k7azDOSF7 TMiWaxjoVaBFuIyIWWMpBTRxRQl2QSgi1TXErgRIgFS0/quWdUWJ06sEgwHatwbuZtzc ZppTe4/4kpyRpaSlYbExx9j+3L1X8gCS7TPK5bylEI6r/Y+5T/VG01xhyA65NM4pMuIH i1QwXYW0nH87NZWZNoULz9kv2StEte877lqujLvYnEK0MXiFMYBUBoLYVskwqkTwQwn8 h+65MVd3gQ6oTiTiEnZzBJfMHswIF6ccifNGBiqmqFgMjq5ICFomUz3SdBVD6xeHpf47 9QNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=63naJTzVpAIq0B9AEz7oC56daTv5sIo3itON2f7HCdg=; b=gjxDzCPQTZBWGYlWvbsyz7vGMCWojPitJG0fUuLtWYFOrunaQUxt6bMCEk70xEnF31 oxXjk811pr2cw/sM/OuoXHH65VJ6F42074Eyj5P2km1LYVl1fJTDinwluRGVN1C0+Z9P qSdRe5x9ZngBZ8we+kWCPhvbOuoofaQF/gLhMThJc9+QDyE8Yl+E/wBpJl+CfVjnOUnE DFi65AZSKwCP5VYQvbA4o1PQG8jkd0n93u+vr3c54VSVRYr03N9He17HSW487adNoNFE fUwst/OKj1XiOq76bMBPUi57+GxOQCfW8wnk51dP4fLzMpWjvEJwaYBNHshNYFVU7w85 QdXQ== X-Gm-Message-State: APjAAAVIihsjC4Pr9f1bLUXP2lPbNPb8K9cTQfdQ1f7DvP/+TBV6L7Ur pFim4fxurcOloF02p6EMtWAL/Q== X-Received: by 2002:a17:90a:b108:: with SMTP id z8mr17183365pjq.108.1567493767618; Mon, 02 Sep 2019 23:56:07 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id e189sm19370762pgc.15.2019.09.02.23.56.03 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Sep 2019 23:56:07 -0700 (PDT) From: Baolin Wang To: stable@vger.kernel.org, chris@chris-wilson.co.uk, airlied@linux.ie Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, arnd@arndb.de, baolin.wang@linaro.org, orsonzhai@gmail.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.14.y 1/8] drm/i915/fbdev: Actually configure untiled displays Date: Tue, 3 Sep 2019 14:55:26 +0800 Message-Id: <5723d9006de706582fb46f9e1e3eb8ce168c2126.1567492316.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Wilson If we skipped all the connectors that were not part of a tile, we would leave conn_seq=0 and conn_configured=0, convincing ourselves that we had stagnated in our configuration attempts. Avoid this situation by starting conn_seq=ALL_CONNECTORS, and repeating until we find no more connectors to configure. Fixes: 754a76591b12 ("drm/i915/fbdev: Stop repeating tile configuration on stagnation") Reported-by: Maarten Lankhorst Signed-off-by: Chris Wilson Cc: Maarten Lankhorst Reviewed-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20190215123019.32283-1-chris@chris-wilson.co.uk Cc: # v3.19+ Signed-off-by: Baolin Wang --- drivers/gpu/drm/i915/intel_fbdev.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -- 1.7.9.5 diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c index da2d309..14eb8a0 100644 --- a/drivers/gpu/drm/i915/intel_fbdev.c +++ b/drivers/gpu/drm/i915/intel_fbdev.c @@ -326,8 +326,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, bool *enabled, int width, int height) { struct drm_i915_private *dev_priv = to_i915(fb_helper->dev); - unsigned long conn_configured, conn_seq, mask; unsigned int count = min(fb_helper->connector_count, BITS_PER_LONG); + unsigned long conn_configured, conn_seq; int i, j; bool *save_enabled; bool fallback = true, ret = true; @@ -345,10 +345,9 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, drm_modeset_backoff(&ctx); memcpy(save_enabled, enabled, count); - mask = GENMASK(count - 1, 0); + conn_seq = GENMASK(count - 1, 0); conn_configured = 0; retry: - conn_seq = conn_configured; for (i = 0; i < count; i++) { struct drm_fb_helper_connector *fb_conn; struct drm_connector *connector; @@ -361,7 +360,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, if (conn_configured & BIT(i)) continue; - if (conn_seq == 0 && !connector->has_tile) + /* First pass, only consider tiled connectors */ + if (conn_seq == GENMASK(count - 1, 0) && !connector->has_tile) continue; if (connector->status == connector_status_connected) @@ -465,8 +465,10 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, conn_configured |= BIT(i); } - if ((conn_configured & mask) != mask && conn_configured != conn_seq) + if (conn_configured != conn_seq) { /* repeat until no more are found */ + conn_seq = conn_configured; goto retry; + } /* * If the BIOS didn't enable everything it could, fall back to have the From patchwork Tue Sep 3 06:56:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 172778 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp5274758ily; Mon, 2 Sep 2019 23:57:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzn7I99IBvdQZie15/PGpQrLujFKIu6Cehqu1WzJtGlt/iFhYs3ig1TCDHlTTBod1xNqed X-Received: by 2002:a63:5f95:: with SMTP id t143mr28594850pgb.304.1567493831118; Mon, 02 Sep 2019 23:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567493831; cv=none; d=google.com; s=arc-20160816; b=u+vA/034Ao2/rLryz1Oom+0NlGVELHMmqzEN+EtIKawilYpTFpEVDrgqxYxODVzaY2 89sVjCW4xt1FpUEOJ5LV6sKgW8iobfk2w1EhGHSlyQl+NglCpI0aqpjj8gmb9SGXlEVk MA7EUJgfgWCNSh7bVnGiyI4LB43uLmHTviR5WVN3Kd7dvWTi2ff8OsrQNBWCMWqRa2jr tUX3RQM2sQqV9+o/g3JnlN35AxMULE/umOEYTYZPRwFx7Rp4PhFa11szWILeyL6gcDOE TaAWkU/RJjM6kE1onwlw9ENwt2zU1cEckvQywjf2RQbJDbA5Vmws0+nLdK/3u7Bu4VcD xUsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=KB/V8KmhO87QpU2qi6NuMt+cmKaMtWbc3N1EFYpdy18=; b=cxYa8di2OVmnXMmS7dZhoY9wYB8zIcD/Tjy8py5LHEXcIDL7N8btxQeNXoxdEVnqUw C3ExB4FOAasfS95rnSOGgswakAeM4BSF6cbxI5EKXTLSFcPMo0XF1uY2FlFn1Xuou1iV PTShVkvmoV42CPf3G3qJXoCIy4tdw/C9fb+4iEQFTlGCdNppqhv77/RvU+/QVtgvVpjB sn7IkEYSJOACkfO84Hihf8x5O2Yv6uoLsOn4P2zITpVXpAKOUBYsAePUD/4dmOkr1OHG oHpsRPUZw7mkRax5H917cP5LNOiH/yFUmUA22tEqJ02vvsNOY8vIRa6yJ1tX9+SW9wnH DFhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A8hMB12r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15si13243388pgm.413.2019.09.02.23.57.10; Mon, 02 Sep 2019 23:57:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A8hMB12r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727602AbfICG5J (ORCPT + 28 others); Tue, 3 Sep 2019 02:57:09 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40111 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbfICG5J (ORCPT ); Tue, 3 Sep 2019 02:57:09 -0400 Received: by mail-pl1-f195.google.com with SMTP id y10so1551198pll.7 for ; Mon, 02 Sep 2019 23:57:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KB/V8KmhO87QpU2qi6NuMt+cmKaMtWbc3N1EFYpdy18=; b=A8hMB12rzSIXxfNLfvQpaXb05wViyP2+l2zkaePY3jY9xLsOYXyLQWNvuXoUjKYdYN aVEdikjHvxlsATSHPqByhDsXFeMegocbBJZB6BrUKuSUM34tMIYiSBRSOaRBDDLzzOOm 4c+lh19B+smCdveQxL5zxCOCRiNP2ssUIM4XuQXxl+Iqi4niG/BblKaKI5fdu9kf1tPA qJUgEXWDofovWWdVES/7abXnZRPNKx2VnEVI5u0ABQB5rCFFlAxLrBUP5Xcr5i1z0xWD gAbEPtvR5qlXbdBe+KvwSmpz/tPGBjcIKTp/Hw8T+bZmD7g+tXwXPBt0n1YU+wMO8iZZ ePxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KB/V8KmhO87QpU2qi6NuMt+cmKaMtWbc3N1EFYpdy18=; b=iKGJ/b6dm5FL3vneaWe0flkST73KGvAXal6T0S+xNwpJYg3E9RNHTQSIeP21gICwH+ k+3Tj18+nbzPzIiMDwsDosS+WUTr4K6ttdh1OafnlLY/FHTZcxXlYlvKnS1Af4QN5z/C LPhIF6wYuSYB4dxC5WLmCz+3u8b4QvJ+zOKR4XKLshOSVy06Qutu5riYRmPpkwdZL9tp M8xQrm4cFjStok42nb2IQ6zrlMqx1/lkVudh1IPyvfFzrGe7jT3HL1VJeagF3RdgvXrZ qXSSNT6UjLUYPz0Z4dURFukPNecsrcPRDa8bJ3iUDDAV50gL3NDKSTxQwIVUHt4ZWhyX Ay0A== X-Gm-Message-State: APjAAAV07BQUy+5b2CvzyFH1Dv9cIURDXSMejMW7Awg2fY3cSsP+jpep 0nro8M4IMoivQ+aWesZhWBrLBA== X-Received: by 2002:a17:902:d886:: with SMTP id b6mr8606471plz.149.1567493828795; Mon, 02 Sep 2019 23:57:08 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id p20sm17786228pgi.81.2019.09.02.23.57.04 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Sep 2019 23:57:08 -0700 (PDT) From: Baolin Wang To: stable@vger.kernel.org, davem@davemloft.net, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, edumazet@google.com Cc: netdev@vger.kernel.org, arnd@arndb.de, baolin.wang@linaro.org, orsonzhai@gmail.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.14.y 2/8] ip6: fix skb leak in ip6frag_expire_frag_queue() Date: Tue, 3 Sep 2019 14:56:42 +0800 Message-Id: <3cf0695f42e8f1b4172b68ad145a5d2afae39a0e.1567492316.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Dumazet Since ip6frag_expire_frag_queue() now pulls the head skb from frag queue, we should no longer use skb_get(), since this leads to an skb leak. Stefan Bader initially reported a problem in 4.4.stable [1] caused by the skb_get(), so this patch should also fix this issue. 296583.091021] kernel BUG at /build/linux-6VmqmP/linux-4.4.0/net/core/skbuff.c:1207! [296583.091734] Call Trace: [296583.091749] [] __pskb_pull_tail+0x50/0x350 [296583.091764] [] _decode_session6+0x26a/0x400 [296583.091779] [] __xfrm_decode_session+0x39/0x50 [296583.091795] [] icmpv6_route_lookup+0xf0/0x1c0 [296583.091809] [] icmp6_send+0x5e1/0x940 [296583.091823] [] ? __netif_receive_skb+0x18/0x60 [296583.091838] [] ? netif_receive_skb_internal+0x32/0xa0 [296583.091858] [] ? ixgbe_clean_rx_irq+0x594/0xac0 [ixgbe] [296583.091876] [] ? nf_ct_net_exit+0x50/0x50 [nf_defrag_ipv6] [296583.091893] [] icmpv6_send+0x21/0x30 [296583.091906] [] ip6_expire_frag_queue+0xe0/0x120 [296583.091921] [] nf_ct_frag6_expire+0x1f/0x30 [nf_defrag_ipv6] [296583.091938] [] call_timer_fn+0x37/0x140 [296583.091951] [] ? nf_ct_net_exit+0x50/0x50 [nf_defrag_ipv6] [296583.091968] [] run_timer_softirq+0x234/0x330 [296583.091982] [] __do_softirq+0x109/0x2b0 Fixes: d4289fcc9b16 ("net: IP6 defrag: use rbtrees for IPv6 defrag") Signed-off-by: Eric Dumazet Reported-by: Stefan Bader Cc: Peter Oskolkov Cc: Florian Westphal Signed-off-by: David S. Miller Signed-off-by: Baolin Wang --- include/net/ipv6_frag.h | 1 - 1 file changed, 1 deletion(-) -- 1.7.9.5 diff --git a/include/net/ipv6_frag.h b/include/net/ipv6_frag.h index 28aa9b3..1f77fb4 100644 --- a/include/net/ipv6_frag.h +++ b/include/net/ipv6_frag.h @@ -94,7 +94,6 @@ static inline u32 ip6frag_obj_hashfn(const void *data, u32 len, u32 seed) goto out; head->dev = dev; - skb_get(head); spin_unlock(&fq->q.lock); icmpv6_send(head, ICMPV6_TIME_EXCEED, ICMPV6_EXC_FRAGTIME, 0); From patchwork Tue Sep 3 06:57:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 172779 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp5275412ily; Mon, 2 Sep 2019 23:57:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5wFtPDy3EzjBZsRGYlyc62VMWoX8HZEgnnLrN/vIkw9f/h9Wb+Pq26yJnI7J/IU1lpsCg X-Received: by 2002:a63:e901:: with SMTP id i1mr28201014pgh.451.1567493875481; Mon, 02 Sep 2019 23:57:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567493875; cv=none; d=google.com; s=arc-20160816; b=PShsUGiiKbCgNIOq+6puYn6go4hUpVz7YNj2jsFnEbXqlrMHEL3jfJNjDI42bJ2Uvv 4gYGD9P87I3lHi99kAihsHvoBuUuHTNIo0zi+j5nhDlrERaVld5s1fSPIxgMjLA2jpVg RlLeYaXW/ocB3Nu/AFQ6vO3vyxAof6cu0v/juGvnLBOwAfnMwFiKfOkZX3nMOoe1xDnn 1FD1YXMKkwaWaTPyODHeEQXjPTFXNCWd0uVO69/gt7K4b0QyOPiZwovGM5BF2SkUglpR NTKUSi1D5YVql5aGYyKbve6RoVIc1PEer71ezmipeIplrazt/pM6sIIL/eCOo+tTdJhp 2ktg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=AeeV14OyLBTF7KaAD5jDBEtXBCp8zTp9/udCZix5Xks=; b=EhFjsjzPkHTD4u6L5enz7ssr2bYfLr+z3mZgfDpXsuATDBoi/6y2YM1KBB7y89iyE7 jScPM6MYAEsBPZf3wpGLLLG0ptfkhC5C9E1zmuvNkvPRIi3Df2mYU0uRuhPemNGbd8UQ kklAjWih2yrKy8EExM0QiibgHVBwEhfRqLJFuBWh0ySVyqq1YuKMHU+ObYK97pRsmodI szFvf+U58B2HDrDpf4V8vVf2p+B9HtIKGvPLWD61Dp9F0nYa605yhMswOeHyKd+aVisx Ku8YKNwS//hV8juedTuD5fcdU/60zp1xG0/KB1kMCO4/oOXOL6mj9KoEEyag+xinwV7R Jw5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p9W6jfMk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si10112032pfj.104.2019.09.02.23.57.55; Mon, 02 Sep 2019 23:57:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p9W6jfMk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727413AbfICG5y (ORCPT + 28 others); Tue, 3 Sep 2019 02:57:54 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:38464 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbfICG5y (ORCPT ); Tue, 3 Sep 2019 02:57:54 -0400 Received: by mail-pg1-f196.google.com with SMTP id d10so4028592pgo.5 for ; Mon, 02 Sep 2019 23:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AeeV14OyLBTF7KaAD5jDBEtXBCp8zTp9/udCZix5Xks=; b=p9W6jfMk6gjNMTcRQ3sw84ltehgzUrnBrlh77posPmyU5yfQhoe+6buCNhGW0ouOGj fLnPvg2yonl4VXRxfOkrpbcSHkZHd5RiscvSIOx0ZOJ1y1Mw2BDydU+Tq8i/qIRcBIZx +kx/N9qbHhYCGyQIec7LgW6gKOBQYvgFJt2UMX6odCHU2GQWEMxkr04++3zHyCeXc34L 7eZJiEuJTgcyNT/uahiEanGfJOlJFyMwu44Dr5DfitUxj8zsp5SQ7BWzq2z52GmNkFUl 3SedRw8KmftQPXKutX0FC5A5QVg0B13e2mT1t0uKzT/BB0taIQEJma/91cTQ5vfguCNO LMhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AeeV14OyLBTF7KaAD5jDBEtXBCp8zTp9/udCZix5Xks=; b=P3pWl2MBJw6G+tbv7b6Epuk4nv9IBd4xc0g5IGYdWATiHG4t1FTa5Ljb3WN3bvbPBH 9x2911aYufLLpHuEQOBXZFVhVRiH7CzScGo3AWhvX3rWRf1jPXGdg1nVk8fObNfdIwB6 sBld/ab7JQIZ1OSjENE7gpFofJqkFGE2WpuTNVEcSEwb+nmrNS62jmlKTQ+Q/5b3b5KN +2deTcvE53Zmc8XyzfzKYWOlR74BGugD3SnduiA8IctFaIAX6Pqwa+FZOGiBnxnZKCTT trCfzjrcOQdhtl+NcXbpjmAlc9LMEoNae7e7/YGk5dmQYvISi3BJ71mk8BAhZMIucLX5 WoqQ== X-Gm-Message-State: APjAAAXI0OYpEM4tmlT+nmWGs+knTOOEDywjyWpKuuY+vPu4L/BL4L0H N0Unhw19X3Bt6R7SnrN5s1uD6Q== X-Received: by 2002:a17:90a:b781:: with SMTP id m1mr16250972pjr.141.1567493873489; Mon, 02 Sep 2019 23:57:53 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id n66sm307197pfn.90.2019.09.02.23.57.50 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Sep 2019 23:57:53 -0700 (PDT) From: Baolin Wang To: stable@vger.kernel.org, peterz@infradead.org, mingo@redhat.com Cc: longman@redhat.com, arnd@arndb.de, baolin.wang@linaro.org, orsonzhai@gmail.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.14.y 3/8] locking/lockdep: Add debug_locks check in __lock_downgrade() Date: Tue, 3 Sep 2019 14:57:21 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Waiman Long Tetsuo Handa had reported he saw an incorrect "downgrading a read lock" warning right after a previous lockdep warning. It is likely that the previous warning turned off lock debugging causing the lockdep to have inconsistency states leading to the lock downgrade warning. Fix that by add a check for debug_locks at the beginning of __lock_downgrade(). Reported-by: Tetsuo Handa Reported-by: syzbot+53383ae265fb161ef488@syzkaller.appspotmail.com Signed-off-by: Waiman Long Signed-off-by: Peter Zijlstra (Intel) Cc: Andrew Morton Cc: Linus Torvalds Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Link: https://lkml.kernel.org/r/1547093005-26085-1-git-send-email-longman@redhat.com Signed-off-by: Ingo Molnar Signed-off-by: Baolin Wang --- kernel/locking/lockdep.c | 3 +++ 1 file changed, 3 insertions(+) -- 1.7.9.5 diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 565005a..5c370c6 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -3650,6 +3650,9 @@ static int reacquire_held_locks(struct task_struct *curr, unsigned int depth, unsigned int depth; int i; + if (unlikely(!debug_locks)) + return 0; + depth = curr->lockdep_depth; /* * This function is about (re)setting the class of a held lock, From patchwork Tue Sep 3 06:58:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 172780 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp5276378ily; Mon, 2 Sep 2019 23:58:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFbI8eEOD0uiEkQzjTJhRTvmNGaRwfJ5kvBUuYsa+7ghaVr3xvYAYNU0dEHg+MwK4hjP9b X-Received: by 2002:a62:1685:: with SMTP id 127mr39080408pfw.122.1567493934591; Mon, 02 Sep 2019 23:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567493934; cv=none; d=google.com; s=arc-20160816; b=WB5pH+Ff9lztfrVZ+QBakXQZ2gNi4nTgz2Vx5Km0wMocjsc77kS0dVXveaD+z1sJno SFaYxB9fOTATV7aFUrqJ9kuiPji0N/OmrnBOdga4LvWdrJeGQS382IDVjBsbHnJ1xCzO GN3YFjvUuyIuYPdsOEFjtqpAvBBfTE9bvai8sW8J0SlVYAd4C2pkWopwOoLG0xSc6hjM PT8jvfOF9biAgbIWuB0YSMAAe+V1YqxS3UELBugbi0fF0wLazwK8JgiMUqgTRRAYRT42 9kkkoTZmJFwVDnI0FT90tJ8Mhkva3UyLzOWoLIigv8xF+rS0Wbef6FBaAsfnIfP2GkQ2 +WFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=uoHHEgFr/r/SO8I5nMCow7X4j/JyWHdeMkJD+GMFPiE=; b=UcIy31LoiPuehNE7dqxQHNdIGPHlPJIdw3+bVc9fXHxRlTOja8R/R+F+RkKfBErlpC zvdCkRFpS3WPuKYUUFlbPATRSzI9fV6ppgBg01fWWlW+k4uOA4v7VUWdnhA9f/Jjomme dAQssLWNUN1k2lPFQ0XiU+B312aQaM+K5PUbJfLa+l2pLzfoDf+KHdIYoojBLJw+T9vY eeOfp0scH+AZFtQNCEL60F5AeQDHkapVBc6frDO8HKjQbna1gBN3EKC/0HSCgLrBegaf S+1TvJxL9yOdgFFDeYyqTqQ/IFlGyMFHwX3hriqSfmjxJzw/qH1XbZ97SZ01YtzsjOEw 9iVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PdwDeQPp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d23si9592462pfr.274.2019.09.02.23.58.54; Mon, 02 Sep 2019 23:58:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PdwDeQPp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727497AbfICG6x (ORCPT + 28 others); Tue, 3 Sep 2019 02:58:53 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:35481 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726698AbfICG6w (ORCPT ); Tue, 3 Sep 2019 02:58:52 -0400 Received: by mail-pf1-f195.google.com with SMTP id 205so7723414pfw.2 for ; Mon, 02 Sep 2019 23:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uoHHEgFr/r/SO8I5nMCow7X4j/JyWHdeMkJD+GMFPiE=; b=PdwDeQPp9bRkpVyUB8ZnEfizHOBfcvi+IexgeYYfm0/QujYrw17S3BbX9Astr2LmOX zwkG55XZnK9eNPTmFKugnMZRQotzoCWVW/1vV7dTgHOAKn7mRI//mOOmY75xG/yd1G74 7tJ8WqV0Qm29EjB6IVpudwwyrsqXRmoSAJHKGqWL2lb/Es9uH3EwFA1ft99E5+x6bXkF WfEt4tpdpy0HSafEI6XChqqIrkgf6i4nx+wPTt+WNJ0l26isH8+dgP/mZ5wr1RHRs9Dz TdI4Z3cuNxAQcAMWmuTOZIxy20vEqn+feb17ZRe4whsQKVXDRHYc8O28bz5bnVYEJDtd H05Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uoHHEgFr/r/SO8I5nMCow7X4j/JyWHdeMkJD+GMFPiE=; b=NZhUje/1tA3uY4fooyUzWo5ikrumgul7RBByc2U2HHBTFgEa6LLG5+f36Zc3BAkZtD J2E8faTFb1veDL5zJ2o1gyhfc0XB2iCXqftGahasPLKOZTcMSvjWG4LSEWoUkL4dsAfI 87JSZn5435+WT5KfO07BUU95Ottn0RzL/4x1azBygfCMPNbP0csJHJs7YfFIj6r3xDS0 m4BobvEAGh2pIRlaTU9hAzFh2Qn4M4FRvDbgYrW9gnHYtPp+pqDLo/wyF04BZATT9pD5 0eNNDLddum/bL2UMKjypA418ViHAxP9oPaMIFbfs8H8LGYNgrAUaCqRDJv1pZq1zfTZ9 P18A== X-Gm-Message-State: APjAAAVB3CYU2pBafHiudtg4O2JNY3r/O36Y57n0L39rw+tzA7yTz3TP R4BCYijSu2LEUpb0X13j/H93uQ== X-Received: by 2002:a63:1f1f:: with SMTP id f31mr26065616pgf.353.1567493932285; Mon, 02 Sep 2019 23:58:52 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id b126sm36847718pfa.177.2019.09.02.23.58.48 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Sep 2019 23:58:51 -0700 (PDT) From: Baolin Wang To: stable@vger.kernel.org, vyasevich@gmail.com, nhorman@tuxdriver.com, davem@davemloft.net Cc: hariprasad.kelam@gmail.com, linux-sctp@vger.kernel.org, netdev@vger.kernel.org, arnd@arndb.de, baolin.wang@linaro.org, orsonzhai@gmail.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.14.y 4/8] net: sctp: fix warning "NULL check before some freeing functions is not needed" Date: Tue, 3 Sep 2019 14:58:16 +0800 Message-Id: <0e71732006c11f119826b3be9c1a9ccd102742d8.1567492316.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hariprasad Kelam This patch removes NULL checks before calling kfree. fixes below issues reported by coccicheck net/sctp/sm_make_chunk.c:2586:3-8: WARNING: NULL check before some freeing functions is not needed. net/sctp/sm_make_chunk.c:2652:3-8: WARNING: NULL check before some freeing functions is not needed. net/sctp/sm_make_chunk.c:2667:3-8: WARNING: NULL check before some freeing functions is not needed. net/sctp/sm_make_chunk.c:2684:3-8: WARNING: NULL check before some freeing functions is not needed. Signed-off-by: Hariprasad Kelam Acked-by: Marcelo Ricardo Leitner Acked-by: Neil Horman Signed-off-by: David S. Miller Signed-off-by: Baolin Wang --- net/sctp/sm_make_chunk.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) -- 1.7.9.5 diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index f67df16..6dac492 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -2586,8 +2586,7 @@ static int sctp_process_param(struct sctp_association *asoc, case SCTP_PARAM_STATE_COOKIE: asoc->peer.cookie_len = ntohs(param.p->length) - sizeof(struct sctp_paramhdr); - if (asoc->peer.cookie) - kfree(asoc->peer.cookie); + kfree(asoc->peer.cookie); asoc->peer.cookie = kmemdup(param.cookie->body, asoc->peer.cookie_len, gfp); if (!asoc->peer.cookie) retval = 0; @@ -2652,8 +2651,7 @@ static int sctp_process_param(struct sctp_association *asoc, goto fall_through; /* Save peer's random parameter */ - if (asoc->peer.peer_random) - kfree(asoc->peer.peer_random); + kfree(asoc->peer.peer_random); asoc->peer.peer_random = kmemdup(param.p, ntohs(param.p->length), gfp); if (!asoc->peer.peer_random) { @@ -2667,8 +2665,7 @@ static int sctp_process_param(struct sctp_association *asoc, goto fall_through; /* Save peer's HMAC list */ - if (asoc->peer.peer_hmacs) - kfree(asoc->peer.peer_hmacs); + kfree(asoc->peer.peer_hmacs); asoc->peer.peer_hmacs = kmemdup(param.p, ntohs(param.p->length), gfp); if (!asoc->peer.peer_hmacs) { @@ -2684,8 +2681,7 @@ static int sctp_process_param(struct sctp_association *asoc, if (!ep->auth_enable) goto fall_through; - if (asoc->peer.peer_chunks) - kfree(asoc->peer.peer_chunks); + kfree(asoc->peer.peer_chunks); asoc->peer.peer_chunks = kmemdup(param.p, ntohs(param.p->length), gfp); if (!asoc->peer.peer_chunks) From patchwork Tue Sep 3 07:00:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 172783 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp5278734ily; Tue, 3 Sep 2019 00:01:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIAMXS3fCmJkxWr4ZPgkDrkeUqwX5NVFhG5V3dw5ghdO+3FtvzWJbeNwWNYFWkUeNRnG+g X-Received: by 2002:a62:3681:: with SMTP id d123mr38321058pfa.147.1567494072196; Tue, 03 Sep 2019 00:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567494072; cv=none; d=google.com; s=arc-20160816; b=SKbU2gBxYJbZvfVCK+MbdUG55EnPmzX+2gJod9ieX3qplFVWKjzTx8HzYBQVPOV6dX nqV/Pn2wuI2WVAXQqFRsc3WTW45YpVzUBojfTJ2CWVtcr/vxW7sk3t5diXkPB5V6Y8EX M/SeC0czJphJ9XZ3eG+ocr+L2ZL4DUBm22LHSZFuwQL+QpNs3GgF8F3GFdoz1O3nTfVA NTVuheZRzg9e09BDeBhW2ozAa+KrOEUdiRh+op+y8HANuHpDFBvV8DloMVV//f0wdrQt JMg0TImamcgai4Oovgb+K/lAPgqNf8vX/qmiQfb+v6p+AEdNZ35m5TolGDp6Wn8D8ZuI Aekg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=NagLdWBO+mVhn30698+wliEZ00FrD+Sqb7vGzKlD9Rw=; b=kiITKpiisieWtuL5Ftgt9z8LMzEyykeLh9bOZAFoF8+G+5uGyYi9O70PE9VflEcNYr P+xjTvxx/ggUD8X5cK9z2gXr7CJk4rf5dVJPy5mKq9RhkYStg7TjAuVKGteuGDE5RLUh 9GH7e4xBP+63m9GDH613ppMfJfeM7XLlrReLyVhMNYp/Sefr4dtwL72/y+tSyINSILOH IOJhQhNP+ONal9z9Vk0j77lUzMk5HNJFFj07+CzCB7TZfr6diaXQdjsS1U6bu8+fj7av AbrtwMajOMVOqc7co97u5C6DJC4NS0BD4gSOiJWnmokJR5ZBNkQxUyKJfJpIRCFiwxGj ET+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZGril3dA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3si16308609pfo.1.2019.09.03.00.01.11; Tue, 03 Sep 2019 00:01:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZGril3dA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727573AbfICHBK (ORCPT + 28 others); Tue, 3 Sep 2019 03:01:10 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36433 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726864AbfICHBJ (ORCPT ); Tue, 3 Sep 2019 03:01:09 -0400 Received: by mail-pf1-f195.google.com with SMTP id y22so4545132pfr.3 for ; Tue, 03 Sep 2019 00:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NagLdWBO+mVhn30698+wliEZ00FrD+Sqb7vGzKlD9Rw=; b=ZGril3dAsuGwTavstK9zZ3BJG6PEETVIA/v8TKVQX6K6+iX0Zx9DFKW67oPSqKs0v8 V6eN3iypDFAfzPfF5kwk2Bx1xR+ZmGLyADXVtKN2r0AdE7sZAiNg6s5CZ1skw9uk5SL6 CiIDzSIqNerBAgl0+GLmQi/+gl9BrdRCJ5I1hrv+b4Ku2GVOFju2wK07C4ygA25YOe+S yEj2KCIBtqsB0WxIr+VItYXU0nuhoP5ERMFbR1mEjPbIU45ywPByWD6gUNi3h9aMsWBo 8gdyS3znC6ekRkcNQ2q6pXY1d8TXng5msBequzeGcHgr8ozAPLmABOR49tnjehtQWsjm LR7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NagLdWBO+mVhn30698+wliEZ00FrD+Sqb7vGzKlD9Rw=; b=tG16LUqLztvPUlfpt8XXxMrPuT8+M6VmX+FyEH2rQTxWqAd4CTRZ0GxykfXNykfUpS YMIJmSGj3lzzIS2up5A312g9aqfU455jNc+n62VhGzvn48zpsgU8LJoDSj35Ne1bjDQ1 C80PzEqkCqWPbqREtpicBn3Piv/1r/gZ6RssTNXCjb5xcUUpG259rN+z75n/D/8kAm1x 5M9PtkqGMuVJfWLUnNxNRaR2FtAaJDaFid2Oze6l9FABrJvZl6wKDqP8ZtpXUw0nEVrv MfbcNTNGeF//PG7m2eZB4ndCfnah1untJqrld+kRsj/ad+o2FDXKPb50NbRwDxzanKn5 z+XQ== X-Gm-Message-State: APjAAAVSgRmdWIMAF0n4CGiX6TWC17dqaKRfSZnqXqlrTsckgp9A62Kn k8D3I10eieTHHHMOfRGZJxRYBg== X-Received: by 2002:a65:6859:: with SMTP id q25mr28225218pgt.181.1567494069011; Tue, 03 Sep 2019 00:01:09 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id l72sm26377107pjb.7.2019.09.03.00.01.06 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Sep 2019 00:01:08 -0700 (PDT) From: Baolin Wang To: stable@vger.kernel.org, paulus@samba.org Cc: ebiggers@google.com, linux-ppp@vger.kernel.org, netdev@vger.kernel.org, arnd@arndb.de, baolin.wang@linaro.org, orsonzhai@gmail.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.14.y 7/8] ppp: mppe: Revert "ppp: mppe: Add softdep to arc4" Date: Tue, 3 Sep 2019 15:00:38 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Biggers Commit 0e5a610b5ca5 ("ppp: mppe: switch to RC4 library interface"), which was merged through the crypto tree for v5.3, changed ppp_mppe.c to use the new arc4_crypt() library function rather than access RC4 through the dynamic crypto_skcipher API. Meanwhile commit aad1dcc4f011 ("ppp: mppe: Add softdep to arc4") was merged through the net tree and added a module soft-dependency on "arc4". The latter commit no longer makes sense because the code now uses the "libarc4" module rather than "arc4", and also due to the direct use of arc4_crypt(), no module soft-dependency is required. So revert the latter commit. Cc: Takashi Iwai Cc: Ard Biesheuvel Signed-off-by: Eric Biggers Signed-off-by: David S. Miller Signed-off-by: Baolin Wang --- drivers/net/ppp/ppp_mppe.c | 1 - 1 file changed, 1 deletion(-) -- 1.7.9.5 diff --git a/drivers/net/ppp/ppp_mppe.c b/drivers/net/ppp/ppp_mppe.c index d9eda7c..6c7fd98 100644 --- a/drivers/net/ppp/ppp_mppe.c +++ b/drivers/net/ppp/ppp_mppe.c @@ -63,7 +63,6 @@ MODULE_DESCRIPTION("Point-to-Point Protocol Microsoft Point-to-Point Encryption support"); MODULE_LICENSE("Dual BSD/GPL"); MODULE_ALIAS("ppp-compress-" __stringify(CI_MPPE)); -MODULE_SOFTDEP("pre: arc4"); MODULE_VERSION("1.0.2"); static unsigned int From patchwork Tue Sep 3 07:01:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 172784 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp5279700ily; Tue, 3 Sep 2019 00:01:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqznMBOU2SrvzahkF3Ol5ilAThIUnfpo3om1mSdEHQVORec2jswYXMa5JiK403N503ZuXomE X-Received: by 2002:a62:ac0e:: with SMTP id v14mr8122933pfe.14.1567494116612; Tue, 03 Sep 2019 00:01:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567494116; cv=none; d=google.com; s=arc-20160816; b=U+5tWE1ysDSAlCBvZa4yzy7mN0OGMWivU5SpPPs70QNUk3tamg3TdULHplliGao+AW CY3SExm7ERrnxDCJhhPcaf+xxY2WRTm1afqWHIQ0UpmCWbjR+ycogl4jkDcwbmQs3OYy UwHsKgnIks+jW0sTYJROr4neXi5ZGdVI/LLkxnUJfKvOrhg68Gp21LYq3bYdOd6cNT4I +WJbMSFYz2/RXs9IykQWVTUTaKnqCaWYmLEK2KscCPkb2If/orj+CA2YtnZv1mL47ecx CRlYOpanHviJexDInLvh9yKh0W7gVzToUlSeypzTo5A6kJkM7mlzdE9kWCDOLTcYuTmP ASxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=ATcsitRpTyb5wI6PMkB6H6IJliZcFvf7R0g9NfFMg9A=; b=JiXpxKmH2m93VjQ1aCpYI9ATzYJ6Gaw6KO24/5IXI2/GwsgKaDJLCfyueW2Gjenmz5 YQT9URCIKj46UvQdbRhARi4N6YPc8h2xsb4rbD8+GCaVp55FLGcP5ecnduz27/G0Z3G6 F0Iy4EhroH+txUSb0RgcOaAW8bhkB4iuz2gF9WiDlurwDtyFj/bYSJ1F3R5TmRbDEQJf jRVppX/B3fdRoJ+ggWZNzWvvpePCPPJKHIiPdR2jMWx60UpunFGQwCoM9ExoZY0eXS71 OMBWo/hxq9fzUXwxbQMuW1RzQo7EeZfrk0Dhv8bi8KL4CSaKFig3LPnQUbsVumDQT7bN mKJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EHgBr9Kf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q12si13822364pgt.447.2019.09.03.00.01.56; Tue, 03 Sep 2019 00:01:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EHgBr9Kf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727541AbfICHBz (ORCPT + 28 others); Tue, 3 Sep 2019 03:01:55 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:41108 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726980AbfICHBz (ORCPT ); Tue, 3 Sep 2019 03:01:55 -0400 Received: by mail-pg1-f195.google.com with SMTP id x15so8587944pgg.8 for ; Tue, 03 Sep 2019 00:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ATcsitRpTyb5wI6PMkB6H6IJliZcFvf7R0g9NfFMg9A=; b=EHgBr9KfYik5R6FusPDhu53l+J3bX9l8zy+rd7KHjP5eJpWMJBDrvwknS9Pt9RsCsr 1AhNQzcmCHH9hqmZxFEi9bKhZfz9UiEgVdHOCOBb26fxtUWMRm90Wpehtn/bqoHFE7bB goOWVwvsODaia2BAUb32k0QYR4cWSFXHHeaHp4RuK6nDFMiUZQTYFCPSUBW3MDWQApv+ Y9SP5AXKkI1/kJsVfCFyEsbDGeymtrlHCMxAg8nB/8sVoLY/KFIw1Gm2GH7Q42O2mWqv I0cFnHbxAmjHo51uvaqpSr6CFedJhzS1ZJp8PYutClpWHQYPWbz8ASS6WgRUtQJyZchn SUEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ATcsitRpTyb5wI6PMkB6H6IJliZcFvf7R0g9NfFMg9A=; b=H1eR4k3RuOD6+njHnSx7/tZTdiEmPyAyVRKMXcp6kBAShPSR39YTBA+T3ct12cG94c KbmP5l9bEY6R+O0CH4xTtg0A2TJNVf6NNDHFbYej3NdR52HNwga/Pt3g0auMSNL7bsck G+jiWSdsgiCZlnte2ldM5kPMbAruFRoAn40hSoR/5gyufBBVExIr7QEGqcYKAVDDDC5N EftT6bGnHALieC4ZOPnsFArk2Nmijnp3mk+pfKgbGDzeqhuMTZ4F+sKssr2kLkZ25PkY pvb7LAh5BrKaXRwBVcXdfFezXLjtXSQr4VjEKlg0RXn/MToLbF81df5OsYjOfeCZkz1x p7eg== X-Gm-Message-State: APjAAAWyJFVdBW2w4pu7tK+qN0+2aDBJiRg+YXJ0PJvd7PeJQlSgYwWW yzkaBCHwfoIlXV8KnYNZaoCqFg== X-Received: by 2002:a65:690f:: with SMTP id s15mr27939370pgq.432.1567494114841; Tue, 03 Sep 2019 00:01:54 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id 19sm16471892pjc.25.2019.09.03.00.01.50 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Sep 2019 00:01:54 -0700 (PDT) From: Baolin Wang To: stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: lanqing.liu@unisoc.com, linux-serial@vger.kernel.org, arnd@arndb.de, baolin.wang@linaro.org, orsonzhai@gmail.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.14.y 8/8] serial: sprd: Modify the baud rate calculation formula Date: Tue, 3 Sep 2019 15:01:25 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lanqing Liu When the source clock is not divisible by the expected baud rate and the remainder is not less than half of the expected baud rate, the old formular will round up the frequency division coefficient. This will make the actual baud rate less than the expected value and can not meet the external transmission requirements. Thus this patch modifies the baud rate calculation formula to support the serial controller output the maximum baud rate. Signed-off-by: Lanqing Liu Signed-off-by: Baolin Wang Signed-off-by: Greg Kroah-Hartman Signed-off-by: Baolin Wang --- drivers/tty/serial/sprd_serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.7.9.5 diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index e902494..72e96ab8 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -380,7 +380,7 @@ static void sprd_set_termios(struct uart_port *port, /* ask the core to calculate the divisor for us */ baud = uart_get_baud_rate(port, termios, old, 0, SPRD_BAUD_IO_LIMIT); - quot = (unsigned int)((port->uartclk + baud / 2) / baud); + quot = port->uartclk / baud; /* set data length */ switch (termios->c_cflag & CSIZE) {