From patchwork Thu Oct 3 15:49:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175124 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp551174ill; Thu, 3 Oct 2019 09:25:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9TL7XGfyZWZMr17/0YKBjabLgvEInmjw9zkO0nBa/+e5Lt/eWBXHPANgyYyQgf6wE6fld X-Received: by 2002:a50:ab0f:: with SMTP id s15mr10403584edc.119.1570119925965; Thu, 03 Oct 2019 09:25:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570119925; cv=none; d=google.com; s=arc-20160816; b=HNQNVVWCZM6N5wnpOR2AXjvWCsKYNijtmayQ8hnt4nAl5VNMmOxog90QGeZWItNF7V D6kGL44pY62uAKa+ddIqx13PSGAbxBfMhsw2KHXx7r3mCRauQtGjCXuwYP0RX4SnAaxa sILzdKm9SanedbRQ8BU2jRt5cod3hQZjzHVqSckUitHwVv7OInh6KR0OYscptDoeLzmT q5f3KNXLC9gg1NR+8oUNf2dcPStJSyseLtvbf9NjK95gt8pvrEVrGJHR3+ZhghOzuATj PCp1324Xald9ZFrfdNzaJz8xLCkKXKTXhPew1hNbNjFiDv0weOY3glmi0zbD3/6fiF00 s3gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zJBAVilOuhUqY84k6KrNyqAx3rbr/hoQIEzu98Wg9Zs=; b=hjYJ4jmcgL812I1TcEowxyKjW2lIW4TgqBZIHemW35lkusgrCwK+w92Ik2XzYTGdm7 JBu3x1ujmTbUAz1K0M5BPQiIbRXFhS62fT52siw7gfuoKh0B1I1xJrrPMArTqHDgrCGK qEcitPqRUb0NOB6qxdvSXod7xyM/CyiYOxw7f8Mch2egM8s4l8JLmhHYycVyYxikrjQh OB5lrlyd9pgCytphy4iSSTZaHAIp1fQDKH3rTkYA0ffh+ZCBKcGNYa7ATPdNbR/5jq30 pU2P+S3fAxUKospLKa/nO5PQ99OoV5DuQICrcbL//mRyVqc90til2o21e48PBhrYBA2V ke/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ndSzGgPK; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7si1806941edb.160.2019.10.03.09.25.25; Thu, 03 Oct 2019 09:25:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=ndSzGgPK; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728905AbfJCQZX (ORCPT + 14 others); Thu, 3 Oct 2019 12:25:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:55514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390494AbfJCQZW (ORCPT ); Thu, 3 Oct 2019 12:25:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F020A215EA; Thu, 3 Oct 2019 16:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119920; bh=3Ns8z5rPL19etrEXv+UVIEZ1HUYcfTPW144ZHogKkn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ndSzGgPKTyea8GE1tDyU1TEhV35Og5aLIK/wWXJ+LJKNGUDkz85Q8+4lGp9rcY4Tp rQQ67FnP625PueVzb/xfuc94KF1xklmrMigunm+3VAtIywsCd7dbmK70aTt6s48Q6U kyW7r3e0NEeQNtrVv6u3YQNV/43ewA8gY9MIkjD8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Jason A. Donenfeld" , Wei Wang , "David S. Miller" Subject: [PATCH 5.2 003/313] ipv6: do not free rt if FIB_LOOKUP_NOREF is set on suppress rule Date: Thu, 3 Oct 2019 17:49:41 +0200 Message-Id: <20191003154533.875309419@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: "Jason A. Donenfeld" [ Upstream commit ca7a03c4175366a92cee0ccc4fec0038c3266e26 ] Commit 7d9e5f422150 removed references from certain dsts, but accounting for this never translated down into the fib6 suppression code. This bug was triggered by WireGuard users who use wg-quick(8), which uses the "suppress-prefix" directive to ip-rule(8) for routing all of their internet traffic without routing loops. The test case added here causes the reference underflow by causing packets to evaluate a suppress rule. Fixes: 7d9e5f422150 ("ipv6: convert major tx path to use RT6_LOOKUP_F_DST_NOREF") Signed-off-by: Jason A. Donenfeld Acked-by: Wei Wang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/fib6_rules.c | 3 ++- tools/testing/selftests/net/fib_tests.sh | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c @@ -285,7 +285,8 @@ static bool fib6_rule_suppress(struct fi return false; suppress_route: - ip6_rt_put(rt); + if (!(arg->flags & FIB_LOOKUP_NOREF)) + ip6_rt_put(rt); return true; } --- a/tools/testing/selftests/net/fib_tests.sh +++ b/tools/testing/selftests/net/fib_tests.sh @@ -9,7 +9,7 @@ ret=0 ksft_skip=4 # all tests in this script. Can be overridden with -t option -TESTS="unregister down carrier nexthop ipv6_rt ipv4_rt ipv6_addr_metric ipv4_addr_metric ipv6_route_metrics ipv4_route_metrics ipv4_route_v6_gw" +TESTS="unregister down carrier nexthop suppress ipv6_rt ipv4_rt ipv6_addr_metric ipv4_addr_metric ipv6_route_metrics ipv4_route_metrics ipv4_route_v6_gw" VERBOSE=0 PAUSE_ON_FAIL=no @@ -582,6 +582,20 @@ fib_nexthop_test() cleanup } +fib_suppress_test() +{ + $IP link add dummy1 type dummy + $IP link set dummy1 up + $IP -6 route add default dev dummy1 + $IP -6 rule add table main suppress_prefixlength 0 + ping -f -c 1000 -W 1 1234::1 || true + $IP -6 rule del table main suppress_prefixlength 0 + $IP link del dummy1 + + # If we got here without crashing, we're good. + return 0 +} + ################################################################################ # Tests on route add and replace @@ -1558,6 +1572,7 @@ do fib_down_test|down) fib_down_test;; fib_carrier_test|carrier) fib_carrier_test;; fib_nexthop_test|nexthop) fib_nexthop_test;; + fib_suppress_test|suppress) fib_suppress_test;; ipv6_route_test|ipv6_rt) ipv6_route_test;; ipv4_route_test|ipv4_rt) ipv4_route_test;; ipv6_addr_metric) ipv6_addr_metric_test;; From patchwork Thu Oct 3 15:49:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175125 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp551684ill; Thu, 3 Oct 2019 09:25:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqziiQet92Ef5CRkgvNcQc04K/LeHN+5mowPoiAMFHY2lrWGQ8+2tn3/+v23mABQOcWLy00W X-Received: by 2002:aa7:d313:: with SMTP id p19mr10305263edq.197.1570119946605; Thu, 03 Oct 2019 09:25:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570119946; cv=none; d=google.com; s=arc-20160816; b=u51Iq0twO1/Dy4JE/0FR5Bk2Tqz5htLutdy5rCu9bahf6ZoDAFjBwN2cia1+O1UpVk iuhr7Q8BNoSeTKCV8+Zp8egOgkgGLB1ASoihc2QN2hWMox4SxcS2scEAQcvBwJiFDtva oAuW4jhAsgYp2AMtBJekgev3d4r4/qNWlX5UZGlQDNTy7XbreS2xI0t242XkFIdsITJP ePjf04XA3JR8ssDP3i+xGGISzoYFxuKCGkCQYcVB0522DF08jitDkMQn/zUyOE3NBp8T oilFr1gFKj6T26crXEhme63b4uFhn6CHfyLo5rkayqNQ9ZjiPfCbe+87f21C/rBBz/3K oDLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wnTM9D7gjE73iv/01ERT6DtJGUzHADOdRS2lRhk8bJU=; b=yJiC9qY5adi86J+6v3gdq81htkpGAyVtHR9sllDaQcFzISaQoGEmrrJ8MSR9e4zPx0 GDd+jyiXa7vVNQzEFg1RNzPeX2o/IMNtsZ2A1lwa/Mb40HYivCOl0PzGGnBnXBM2yaJB JIwJ6axuH8C0ONBdmmfEevkvfldeYkEGb2b0cJxKPPPF/tsRHk4m7CKP8OZPqowhm0LY PGeo8eW3hS5ZJgUKZNP2oye91QQseqpYpy6QRjdcQdiZFMxxkPZA2omKWr6Q9nADSXr/ A24A+fOqRucZENwbc+JHtECkPeXtN0ZyKC7CK0DKkWksxwlb5ZhyNbsn21ziylCXHo2K PAWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="PUh30/eW"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w14si1764581edx.197.2019.10.03.09.25.46; Thu, 03 Oct 2019 09:25:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b="PUh30/eW"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733002AbfJCQZn (ORCPT + 14 others); Thu, 3 Oct 2019 12:25:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:56112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390958AbfJCQZm (ORCPT ); Thu, 3 Oct 2019 12:25:42 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 79B4220867; Thu, 3 Oct 2019 16:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119942; bh=kvo8e6FkZ7qO+5CeiOkhJiM1oUsYCDpijb9DiyqS2Zs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PUh30/eWyVuCo3Wqxh2PoCYnVuuJE4ezug3WJfCIzrlqDM7zxZMaYmEGhSfUB1Gjb XSjCG7N1jkQt8cLxdR+DMUyZ2LuW9TX1jNV2LW6a3LTGPJZ3d0Rop+oFxdqLWu2jz6 MXkS01c4xEql6ta2KVvninDI5XzdgKpHxxkGQouM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bjorn Andersson , Jakub Kicinski Subject: [PATCH 5.2 006/313] net: qrtr: Stop rx_worker before freeing node Date: Thu, 3 Oct 2019 17:49:44 +0200 Message-Id: <20191003154534.142045176@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Bjorn Andersson [ Upstream commit 73f0c11d11329a0d6d205d4312b6e5d2512af7c5 ] As the endpoint is unregistered there might still be work pending to handle incoming messages, which will result in a use after free scenario. The plan is to remove the rx_worker, but until then (and for stable@) ensure that the work is stopped before the node is freed. Fixes: bdabad3e363d ("net: Add Qualcomm IPC router") Cc: stable@vger.kernel.org Signed-off-by: Bjorn Andersson Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/qrtr/qrtr.c | 1 + 1 file changed, 1 insertion(+) --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -150,6 +150,7 @@ static void __qrtr_node_release(struct k list_del(&node->item); mutex_unlock(&qrtr_node_lock); + cancel_work_sync(&node->work); skb_queue_purge(&node->rx_queue); kfree(node); } From patchwork Thu Oct 3 15:50:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175179 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp613607ill; Thu, 3 Oct 2019 10:15:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVCHqs9Ow7JPBQl2V/WOott99cXanl4zvkcxaCkx2k128Xkytx/gNx4MpuhTIO0pzRCDk7 X-Received: by 2002:a17:907:41db:: with SMTP id og19mr8701815ejb.307.1570122916044; Thu, 03 Oct 2019 10:15:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570122916; cv=none; d=google.com; s=arc-20160816; b=irsZOWW3/svBFBy5v/BGQGZo02ahVBM0bdBTlx7MwtBsgjAsSG1aEylWa2rkXlv8u8 +ct4B3H/T2n9QhG/SxWhvnMR3mmaTioaX+KXz/pBg+EdBY7d7+8P/W2MRzcLm63/5OIs 3T1WBmQ/Ncyr/SzWKdVEd00ps2WK/Aq1uncp1Txf7ozVKgWiQ3pWKR2fe6R/3APeuC8z QASE0NVDmw1gB4FLTtU2ZQbOUABTVZtLOxjh97Y15wTzJctmC3dyckOVfSpmCNBphHbg r7Rl3nCYDrN9MX3Y87drJdQvvyRLhXM/RX7L8urNLJoCVRBwDGXaovybUkNfvXb3IBNI zWoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=js+vsS4Cb+XSnJ107Cy/hrWEqzHWBMe9EchO7f0a5I0=; b=stxEG5pRz4zjrqhtseDFwZRu7mcq2O3kmzE62muGwFehjFQKbfxcEE3DLqODPleodw AufyPJNmyaHA2MR+ZedGFW0aViBUecmyIzFIvfNSnAVHLWpJ8xKJeqqqyem4H6q/rI/U IUvqE+Ahby2KTdSorqTS1YlFo/AJWBiRFeGWIouP2M5mwRztTNaIFYHiU/WIN3v1yMcx 4FQTGax/5KctYLc1tM7UEOHRtcOFt2EkZYyNc4Xk/O3MlzSAVOIH+WV/RxX4LSBHkacW W0T0KEz5SscHXN5ynjkQ/V9O5fglvZqki3yq21ORNMRUmxik4NOXTAy4vBL0XoYr9IUl 9f+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R4Far0rO; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s17si1552303ejz.148.2019.10.03.10.15.15; Thu, 03 Oct 2019 10:15:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=R4Far0rO; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389802AbfJCRPO (ORCPT + 14 others); Thu, 3 Oct 2019 13:15:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:57106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391032AbfJCQ0M (ORCPT ); Thu, 3 Oct 2019 12:26:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5EA4720700; Thu, 3 Oct 2019 16:26:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119971; bh=1gu4rf+5VEszUoONBv6+5oClhIK+BZ/7dqRQHE6quhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R4Far0rOJNQMqMpHlfXGOjMAaepn0sYBDtvth+vrg//rvIKt9MGNeJsFmHxpVY3dj DVbI1fE/lhCZdv/jSX0yBAtCbs9zQtRRAlfeR53PiYKhGIsPOdjquEBzVGeSkOKLsd 3xB6gO5Ja1mCMZ+gwMxfCYlxkVJcgYDlQy31ctc0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Nick Desaulniers , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.2 050/313] media: vivid: work around high stack usage with clang Date: Thu, 3 Oct 2019 17:50:28 +0200 Message-Id: <20191003154538.033733798@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 1a03f91c2c2419c3709c4554952c66695575e91c ] Building a KASAN-enabled kernel with clang ends up in a case where too much is inlined into vivid_thread_vid_cap() and the stack usage grows a lot, possibly when the register allocation fails to produce efficient code and spills a lot of temporaries to the stack. This uses more than twice the amount of stack than the sum of the individual functions when they are not inlined: drivers/media/platform/vivid/vivid-kthread-cap.c:766:12: error: stack frame size of 2208 bytes in function 'vivid_thread_vid_cap' [-Werror,-Wframe-larger-than=] Marking two of the key functions in here as 'noinline_for_stack' avoids the pathological case in clang without any apparent downside for gcc. Signed-off-by: Arnd Bergmann Acked-by: Nick Desaulniers Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/vivid/vivid-kthread-cap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/drivers/media/platform/vivid/vivid-kthread-cap.c b/drivers/media/platform/vivid/vivid-kthread-cap.c index cf6dfecf879f7..96d85cd8839f3 100644 --- a/drivers/media/platform/vivid/vivid-kthread-cap.c +++ b/drivers/media/platform/vivid/vivid-kthread-cap.c @@ -232,8 +232,8 @@ static void *plane_vaddr(struct tpg_data *tpg, struct vivid_buffer *buf, return vbuf; } -static int vivid_copy_buffer(struct vivid_dev *dev, unsigned p, u8 *vcapbuf, - struct vivid_buffer *vid_cap_buf) +static noinline_for_stack int vivid_copy_buffer(struct vivid_dev *dev, unsigned p, + u8 *vcapbuf, struct vivid_buffer *vid_cap_buf) { bool blank = dev->must_blank[vid_cap_buf->vb.vb2_buf.index]; struct tpg_data *tpg = &dev->tpg; @@ -672,7 +672,8 @@ static void vivid_cap_update_frame_period(struct vivid_dev *dev) dev->cap_frame_period = f_period; } -static void vivid_thread_vid_cap_tick(struct vivid_dev *dev, int dropped_bufs) +static noinline_for_stack void vivid_thread_vid_cap_tick(struct vivid_dev *dev, + int dropped_bufs) { struct vivid_buffer *vid_cap_buf = NULL; struct vivid_buffer *vbi_cap_buf = NULL; From patchwork Thu Oct 3 15:51:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175129 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp554297ill; Thu, 3 Oct 2019 09:27:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6Tmmp6Su6IpjYnFay89KR1kukbgpBdn/YqroG5fPSTzFXlxcIp+xfw3aG9qP9wF1wS4qC X-Received: by 2002:a50:a57d:: with SMTP id z58mr10482843edb.115.1570120073517; Thu, 03 Oct 2019 09:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120073; cv=none; d=google.com; s=arc-20160816; b=fEkiHlue8LUja7bG+Eg/P6FC22UUF9vBECS02ql8SHxCXoXiKI5breltTjX24Yz8VL oEh6Uwd1kN3ZBh4X5eiR1pqfdFG5b96huxfcvMCS7VYdxAJNDaMBrhzXTQTQNAIwP4S/ t1Bpce6IHPiF0d+MtoID4ahTDhrs5hh8zZ3BhmBLaI0zq9tyvvj2oQLRLDXjd3I//T0S v3r6JnwKiLnJU2sjxR50cot1+5JeI3/YgnyyZdf1+G2AHnr/eoJy4wh8G00hlY7Rdptl m7iXx1FHhuyEpzOnJdck0KVftQ7uc7BQbIBt6Ntcn8CzK+o7xb9OCtW7iGLhxpFoyUdD K4ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QysHqyJiNaBe1m1gUMpqTANmqSNRouVizu+qOvBPryA=; b=uopiaV/h4QdjCQ6UgPNTt9udXTSzQGHPhYyH3u0T8mhQhLQ35mZrU/DGIqFYDJYzb+ 2iykq0BDR4UNKcimGj3plJ7svOdv6M54ObrJJOQ+LHk4Udkc/9yUddoa9y3TWPFDQhZX +HEQhzsbPZoGs2Wzi7I6Y99bQ13F5K2P95MYe+QWFEtpv9WHXpG5If04Gvs6IYI+o6o6 wehTsuCIntsXlQLeTqM+MYUAhcl+hYqSIqLRKYeGyE32MT37W1UXDTDmvx8Ldy7TjRm8 aHKjN4RFNeQe7jFpfEvJjSHPrcB2RJh+TqI7jeGRy8jkIq2cVsy+qbNTIu5GD+3CjMzw wLRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hfCilLsZ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si1796653edx.168.2019.10.03.09.27.53; Thu, 03 Oct 2019 09:27:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=hfCilLsZ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391336AbfJCQ1u (ORCPT + 14 others); Thu, 3 Oct 2019 12:27:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:59992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391330AbfJCQ1t (ORCPT ); Thu, 3 Oct 2019 12:27:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4EABB2133F; Thu, 3 Oct 2019 16:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120068; bh=iupxWFpcY6/cgaLlrAWuYCcnrImMYlOV5CQiGwgF2WE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hfCilLsZ3e9kIJWIdt7dSii85vVbXL0JqMPIwg4Hdano3+lxQ3hslhIz/dE1SBeQZ Z1k3elXOM6Z4F+1SRKIaTbMcFE8dL+IUMHqkLF9Lj6B6Id1CQ8f0Ug/MVLXX1CxSWt IHSm3YjuMN7LdxQtzPmuNKFXpUnsYZmeWa9u5Pqg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jim Quinlan , Sudeep Holla , Sasha Levin Subject: [PATCH 5.2 086/313] firmware: arm_scmi: Check if platform has released shmem before using Date: Thu, 3 Oct 2019 17:51:04 +0200 Message-Id: <20191003154541.351570368@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sudeep Holla [ Upstream commit 9dc34d635c67e57051853855c43249408641a5ab ] Sometimes platfom may take too long to respond to the command and OS might timeout before platform transfer the ownership of the shared memory region to the OS with the response. Since the mailbox channel associated with the channel is freed and new commands are dispatch on the same channel, OS needs to wait until it gets back the ownership. If not, either OS may end up overwriting the platform response for the last command(which is fine as OS timed out that command) or platform might overwrite the payload for the next command with the response for the old. The latter is problematic as platform may end up interpretting the response as the payload. In order to avoid such race, let's wait until the OS gets back the ownership before we prepare the shared memory with the payload for the next command. Reported-by: Jim Quinlan Signed-off-by: Sudeep Holla Signed-off-by: Sasha Levin --- drivers/firmware/arm_scmi/driver.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.20.1 diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index b5bc4c7a8fab2..b49c9e6f4bf10 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -271,6 +271,14 @@ static void scmi_tx_prepare(struct mbox_client *cl, void *m) struct scmi_chan_info *cinfo = client_to_scmi_chan_info(cl); struct scmi_shared_mem __iomem *mem = cinfo->payload; + /* + * Ideally channel must be free by now unless OS timeout last + * request and platform continued to process the same, wait + * until it releases the shared memory, otherwise we may endup + * overwriting its response with new message payload or vice-versa + */ + spin_until_cond(ioread32(&mem->channel_status) & + SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE); /* Mark channel busy + clear error */ iowrite32(0x0, &mem->channel_status); iowrite32(t->hdr.poll_completion ? 0 : SCMI_SHMEM_FLAG_INTR_ENABLED, From patchwork Thu Oct 3 15:51:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175130 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp555158ill; Thu, 3 Oct 2019 09:28:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwP+YFvHasoSBYSXIvEEYAVhKQRupxwShTucqbmc01kXS8gVsNk/NmgvuPFKX0lpljcSVx X-Received: by 2002:a17:906:1e57:: with SMTP id i23mr8504250ejj.204.1570120112865; Thu, 03 Oct 2019 09:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120112; cv=none; d=google.com; s=arc-20160816; b=eIt0ydmyK32yM80Rog2cvb6Y2DqzUdKyl27/eKp4mbTMiYhBs4E1vncotEJv7cW4/F Ie3bh7AVjvIq1P2L/x+lltcY42J4fr5G+hK1AndkdrcKy6+OVQ1V4RQJ717q+qCQxjI9 k+zzQbDiYf+3eA3Xj6TmuGhsPeN+NLPk215yM2QnWd+Jp/yuzHr/gyTmErVOty41LT3u 5LhCq6yU5Y88ISqX+Rg3SisrOUZ8hMD10UI+hDlAXYquKPV0mHAfBxmrwJjBSL6PtqDc FJZzS7girFvm0NDZM9kXYS2/ivFmCFHxD6QHiAcFi23J6EVFA2QpmrO7L6IA94D9CCoU bOiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=819/zZRTh8U71bIwoAdqwT6T0Ho1f1Lq8jZd+HlLp/U=; b=YRefuwux4kEathvtRzXmyvJoYNJqWe6r4oHwtoDoiAZzLvQgnFkduo85HOZXrVz7PT 4FvN6+VWsWo3+liltQkGIBl8le33ViCvVfrim99MzBY/LAMdbyw67XtF0dML+CksqnhG iFEaL09iWSCxrIpVT1AkO7IjlX2oNZAf5pDzMdG4+1CBowwpDgvOmWjqVjJJ89abW4os TpORKmvd0K3ifXbkYU3PpUp2BpfP/UW0BNxGbkzRWadXkJFFPHXcOzaBfGAGpowEx09T 7Iao6zhWvvzG78uudOKiaKrJKcTr+Z61/JyPagsUPd6aFR3XGlSs6pbqxwnCReXPWqsO j7zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=my5hyzm6; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c9si1788053eda.229.2019.10.03.09.28.32; Thu, 03 Oct 2019 09:28:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=my5hyzm6; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389308AbfJCQ2b (ORCPT + 14 others); Thu, 3 Oct 2019 12:28:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:32930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730116AbfJCQ2a (ORCPT ); Thu, 3 Oct 2019 12:28:30 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BAF5B21A4C; Thu, 3 Oct 2019 16:28:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120109; bh=dmdbnGlcQ67LSvX15BeOkemg/oVzkc782wV47LPJXig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=my5hyzm6vYTIvyTwPuGN5/+GR9Ng+KHeFlPtJK0FAYwYOn5PJFVkMukBoFiv3lpMg Cjk7BVee2LRkEAmjNVSjf0oucqSCa6x/Mr+3uGQ7HElmGQ8Fxe3g8oL4s0mxLLmrrq qNmb6vC8QBvLLGpvGd6VsHLI95lkxlHm1qOL+VMM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Vinod Koul , Sasha Levin Subject: [PATCH 5.2 100/313] dmaengine: iop-adma: use correct printk format strings Date: Thu, 3 Oct 2019 17:51:18 +0200 Message-Id: <20191003154542.760274754@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 00c9755524fbaa28117be774d7c92fddb5ca02f3 ] When compile-testing on other architectures, we get lots of warnings about incorrect format strings, like: drivers/dma/iop-adma.c: In function 'iop_adma_alloc_slots': drivers/dma/iop-adma.c:307:6: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=] drivers/dma/iop-adma.c: In function 'iop_adma_prep_dma_memcpy': >> drivers/dma/iop-adma.c:518:40: warning: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'size_t {aka long unsigned int}' [-Wformat=] Use %zu for printing size_t as required, and cast the dma_addr_t arguments to 'u64' for printing with %llx. Ideally this should use the %pad format string, but that requires an lvalue argument that doesn't work here. Link: https://lore.kernel.org/r/20190809163334.489360-3-arnd@arndb.de Signed-off-by: Arnd Bergmann Acked-by: Vinod Koul Signed-off-by: Arnd Bergmann Signed-off-by: Sasha Levin --- drivers/dma/iop-adma.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 2.20.1 diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c index c6c0143670d9d..a776857d89c8f 100644 --- a/drivers/dma/iop-adma.c +++ b/drivers/dma/iop-adma.c @@ -116,9 +116,9 @@ static void __iop_adma_slot_cleanup(struct iop_adma_chan *iop_chan) list_for_each_entry_safe(iter, _iter, &iop_chan->chain, chain_node) { pr_debug("\tcookie: %d slot: %d busy: %d " - "this_desc: %#x next_desc: %#x ack: %d\n", + "this_desc: %#x next_desc: %#llx ack: %d\n", iter->async_tx.cookie, iter->idx, busy, - iter->async_tx.phys, iop_desc_get_next_desc(iter), + iter->async_tx.phys, (u64)iop_desc_get_next_desc(iter), async_tx_test_ack(&iter->async_tx)); prefetch(_iter); prefetch(&_iter->async_tx); @@ -306,9 +306,9 @@ iop_adma_alloc_slots(struct iop_adma_chan *iop_chan, int num_slots, int i; dev_dbg(iop_chan->device->common.dev, "allocated slot: %d " - "(desc %p phys: %#x) slots_per_op %d\n", + "(desc %p phys: %#llx) slots_per_op %d\n", iter->idx, iter->hw_desc, - iter->async_tx.phys, slots_per_op); + (u64)iter->async_tx.phys, slots_per_op); /* pre-ack all but the last descriptor */ if (num_slots != slots_per_op) @@ -516,7 +516,7 @@ iop_adma_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dma_dest, return NULL; BUG_ON(len > IOP_ADMA_MAX_BYTE_COUNT); - dev_dbg(iop_chan->device->common.dev, "%s len: %u\n", + dev_dbg(iop_chan->device->common.dev, "%s len: %zu\n", __func__, len); spin_lock_bh(&iop_chan->lock); @@ -549,7 +549,7 @@ iop_adma_prep_dma_xor(struct dma_chan *chan, dma_addr_t dma_dest, BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT); dev_dbg(iop_chan->device->common.dev, - "%s src_cnt: %d len: %u flags: %lx\n", + "%s src_cnt: %d len: %zu flags: %lx\n", __func__, src_cnt, len, flags); spin_lock_bh(&iop_chan->lock); @@ -582,7 +582,7 @@ iop_adma_prep_dma_xor_val(struct dma_chan *chan, dma_addr_t *dma_src, if (unlikely(!len)) return NULL; - dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %u\n", + dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %zu\n", __func__, src_cnt, len); spin_lock_bh(&iop_chan->lock); @@ -620,7 +620,7 @@ iop_adma_prep_dma_pq(struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src, BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT); dev_dbg(iop_chan->device->common.dev, - "%s src_cnt: %d len: %u flags: %lx\n", + "%s src_cnt: %d len: %zu flags: %lx\n", __func__, src_cnt, len, flags); if (dmaf_p_disabled_continue(flags)) @@ -683,7 +683,7 @@ iop_adma_prep_dma_pq_val(struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src, return NULL; BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT); - dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %u\n", + dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %zu\n", __func__, src_cnt, len); spin_lock_bh(&iop_chan->lock); From patchwork Thu Oct 3 15:51:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175177 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp611393ill; Thu, 3 Oct 2019 10:13:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxK/H0gSa6zkrpm9qxJi877pQ8czucb3GAm7mSijfnnXnwBrNPK5ZLxTWF0ZsdrpcuMzfzw X-Received: by 2002:a17:906:d0d2:: with SMTP id bq18mr8661560ejb.233.1570122818942; Thu, 03 Oct 2019 10:13:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570122818; cv=none; d=google.com; s=arc-20160816; b=uEIM8fsgmmgJTz5mqG3YuwsKNb+iVlEcqcFoY9Nw+IxQwUumIuT3Ffnl/da6rnKB2g sk7zWE5CRv/6yZwMr6FmYsnLylvAZ97yQ2OoX25zUrgw43J8VFVcwP7sArzUI4bdpnUG S1BbLpIwVzlTVi2jTo1F+PBr51XHvGZX/hl3egdPmoZVCeaO5g3elcZyjV1KlK5SkJEy 7HwKxMGldMRpxiGp+Q+RuniP/A51V1zVyWxRKUEdA4Ukflw9YK4Sz68V5NsSa0Ke0ISM rkpeduqjI5hqx0sIvkbrYyM+Is/pRXnDZ4EomU+VXNahKMbO7dFo033xicwxXCgpCLo2 DwmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=m6I3xn6EKZt4rJcOF1XQQjGGJ6TiIyyFBwU5bD4MkHg=; b=qz/YKm2iNrF/EZEi7XQ4Ps4YSSL3xB4AtF0CcVjg0YATNWLulTQpOtvwmFRLI780lL NT8+z/slX53bLSIXkxH3aEESz1lmLqWnBoC3hjEN2NVWkOc7t3shw/DfkL0h/8nfu1K8 CW16GPeM41HHa/G5XR3JXszEMJx9NEi653yNLtMBBzCRgdhrzKxvIPJ3Sis1E7+yV/eD iAfdYohXFizNTzttYpyx3VuuAlc4m1q2HOOLgc2ceXkU8UbpV6wTzTMKZM53oxOAbFYA iP2dWjWageXhBRMa8Jh78+BRpkhSXGCUReqgLRj0bpnBSzlqAJ6kcPkUYiHxkZBGB+si 9laA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NT6i6wtN; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z19si1666374ejr.244.2019.10.03.10.13.38; Thu, 03 Oct 2019 10:13:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=NT6i6wtN; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730116AbfJCQ2e (ORCPT + 14 others); Thu, 3 Oct 2019 12:28:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:33026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389346AbfJCQ2d (ORCPT ); Thu, 3 Oct 2019 12:28:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 67B822133F; Thu, 3 Oct 2019 16:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120111; bh=R84mSIxpEX1AcPIuhZJU0uwLWQyn3K4b+Mpvg9kxH0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NT6i6wtNm8SCLOgQduDjP8S0Uk7yLmvHyr1eGkSE1y8Kt0L3vdS3rq8b7ctiHE4ZC xLfysMGmm7oz9+A4NPFEIu/Ymkr+z01KIHme+jqYa7iUdSDpHYVfLbSRs64EqKimWk OLrV/h9DYSt6a5ApRxWtzSaUTm1+10AbZF+dBa/8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Sasha Levin Subject: [PATCH 5.2 101/313] ARM: xscale: fix multi-cpu compilation Date: Thu, 3 Oct 2019 17:51:19 +0200 Message-Id: <20191003154542.856795646@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit c7b68049943079550d4e6af0f10aa3aabd64131a ] Building a combined ARMv4+XScale kernel produces these and other build failures: /tmp/copypage-xscale-3aa821.s: Assembler messages: /tmp/copypage-xscale-3aa821.s:167: Error: selected processor does not support `pld [r7,#0]' in ARM mode /tmp/copypage-xscale-3aa821.s:168: Error: selected processor does not support `pld [r7,#32]' in ARM mode /tmp/copypage-xscale-3aa821.s:169: Error: selected processor does not support `pld [r1,#0]' in ARM mode /tmp/copypage-xscale-3aa821.s:170: Error: selected processor does not support `pld [r1,#32]' in ARM mode /tmp/copypage-xscale-3aa821.s:171: Error: selected processor does not support `pld [r7,#64]' in ARM mode /tmp/copypage-xscale-3aa821.s:176: Error: selected processor does not support `ldrd r4,r5,[r7],#8' in ARM mode /tmp/copypage-xscale-3aa821.s:180: Error: selected processor does not support `strd r4,r5,[r1],#8' in ARM mode Add an explict .arch armv5 in the inline assembly to allow the ARMv5 specific instructions regardless of the compiler -march= target. Link: https://lore.kernel.org/r/20190809163334.489360-5-arnd@arndb.de Signed-off-by: Arnd Bergmann Signed-off-by: Sasha Levin --- arch/arm/mm/copypage-xscale.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/arch/arm/mm/copypage-xscale.c b/arch/arm/mm/copypage-xscale.c index 61d834157bc05..382e1c2855e85 100644 --- a/arch/arm/mm/copypage-xscale.c +++ b/arch/arm/mm/copypage-xscale.c @@ -42,6 +42,7 @@ static void mc_copy_user_page(void *from, void *to) * when prefetching destination as well. (NP) */ asm volatile ("\ +.arch xscale \n\ pld [%0, #0] \n\ pld [%0, #32] \n\ pld [%1, #0] \n\ @@ -106,8 +107,9 @@ void xscale_mc_clear_user_highpage(struct page *page, unsigned long vaddr) { void *ptr, *kaddr = kmap_atomic(page); - asm volatile( - "mov r1, %2 \n\ + asm volatile("\ +.arch xscale \n\ + mov r1, %2 \n\ mov r2, #0 \n\ mov r3, #0 \n\ 1: mov ip, %0 \n\ From patchwork Thu Oct 3 15:51:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175131 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp555866ill; Thu, 3 Oct 2019 09:29:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqydx6kKhiX4zX5prF7A24dLOOOCMIX9Fs4ZFKsXdy2xn6lIMFHFizcggOgMt6eZmj88Gf9Y X-Received: by 2002:aa7:cd5a:: with SMTP id v26mr10355034edw.256.1570120148328; Thu, 03 Oct 2019 09:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120148; cv=none; d=google.com; s=arc-20160816; b=PHe1QY/lREgVXP873us1oCpQf2xGqeJPDHBdjzD6AlrUfk1jqJnVEJSuolFhUWBTHR 4T0JgymTdPY0kz+diBeowoij1Z0RZpidojaWPmACHPCs/t+ckozKsFCMFcx2FrLEPvEd 1QXxCkForiY2J5SPnETlQVfNPt7fZELpQnHheKhjWmdFSCFb7JM5JKswrmY/yuwvXLNh 2p8342ifhy5NjPBknu+yrOtXS9pl58cXvTRfI5USRoJeua7TFj5d26Gg/9XNbUWW/T8C nrjcbGzMJhkIWRhd55r1XsnLmheToX6vG8/N7m4j45O+DrpXpMZe62GT3g47hy40SPck Yk/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3htRQl954QmBuJyLQwasHk4KigwbFor2wr91rI3ejzQ=; b=qUcwMxGpdt8q97fKw1fBmYgLGXtXE8UzK6GvbTCJH2BXPHKHp4be/JYFpv0vngD/jl eoQp8Q894rpSqx7m4QAI3awlGormQSHDEfcPKCzfFf1v9oadirdWwGOgQumu4d5j6LrD TTzXs/1yK9HDmV3wtz1OE7YJjFA5aeYpEuhjAyOC1QGqeEHZURvr1OntOgh3x+s6l63r S75b2M2SQt4P7/syNaQjr+mJaWQXRYvugUxUpjVwkhXEVk3lDZSbgtY5lN0H2NUOlSER 0X6m9B6aRsuoBO3LK712YD2hTW0uMXe++/HA/E7I1HdYg+IAlaqfhKnNZBXDepk2kH0g EaHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tbiuOhcp; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c9si1788904eda.229.2019.10.03.09.29.08; Thu, 03 Oct 2019 09:29:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=tbiuOhcp; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391530AbfJCQ2w (ORCPT + 14 others); Thu, 3 Oct 2019 12:28:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:33600 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389668AbfJCQ2v (ORCPT ); Thu, 3 Oct 2019 12:28:51 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 44CD121783; Thu, 3 Oct 2019 16:28:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120130; bh=Ykb93oMr+3gztSj7HV5KYl0vXoN7XcXRQ9o4/s8Ik+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tbiuOhcpeJVUS6D/UN+I0kPopwEElWSVZovHrY+GWiiC9EAL1Z6WvLGUPyzAGhP9D T7nArGXv9rw3thDRI9+Tnh6qwTXLcuozpcolB7VACFb9fhDHkZIHvfHQ/q0kQlDMgy OMjM3Zive/byRWdaDJMZ/jPxJhI+yqtnpizTSCBA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Catalin Marinas , Mark Rutland , Andrey Ryabinin , Will Deacon , Sasha Levin Subject: [PATCH 5.2 107/313] kasan/arm64: fix CONFIG_KASAN_SW_TAGS && KASAN_INLINE Date: Thu, 3 Oct 2019 17:51:25 +0200 Message-Id: <20191003154543.398677051@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mark Rutland [ Upstream commit 34b5560db40d2941cfbe82eca1641353d5aed1a9 ] The generic Makefile.kasan propagates CONFIG_KASAN_SHADOW_OFFSET into KASAN_SHADOW_OFFSET, but only does so for CONFIG_KASAN_GENERIC. Since commit: 6bd1d0be0e97936d ("arm64: kasan: Switch to using KASAN_SHADOW_OFFSET") ... arm64 defines CONFIG_KASAN_SHADOW_OFFSET in Kconfig rather than defining KASAN_SHADOW_OFFSET in a Makefile. Thus, if CONFIG_KASAN_SW_TAGS && KASAN_INLINE are selected, we get build time splats due to KASAN_SHADOW_OFFSET not being set: | [mark@lakrids:~/src/linux]% usellvm 8.0.1 usekorg 8.1.0 make ARCH=arm64 CROSS_COMPILE=aarch64-linux- CC=clang | scripts/kconfig/conf --syncconfig Kconfig | CC scripts/mod/empty.o | clang (LLVM option parsing): for the -hwasan-mapping-offset option: '' value invalid for uint argument! | scripts/Makefile.build:273: recipe for target 'scripts/mod/empty.o' failed | make[1]: *** [scripts/mod/empty.o] Error 1 | Makefile:1123: recipe for target 'prepare0' failed | make: *** [prepare0] Error 2 Let's fix this by always propagating CONFIG_KASAN_SHADOW_OFFSET into KASAN_SHADOW_OFFSET if CONFIG_KASAN is selected, moving the existing common definition of +CFLAGS_KASAN_NOSANITIZE to the top of Makefile.kasan. Cc: Catalin Marinas Signed-off-by: Mark Rutland Acked-by: Andrey Ryabinin Tested-by Steve Capper Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- scripts/Makefile.kasan | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) -- 2.20.1 diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan index 6410bd22fe387..03757cc60e06c 100644 --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan @@ -1,4 +1,9 @@ # SPDX-License-Identifier: GPL-2.0 +ifdef CONFIG_KASAN +CFLAGS_KASAN_NOSANITIZE := -fno-builtin +KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET) +endif + ifdef CONFIG_KASAN_GENERIC ifdef CONFIG_KASAN_INLINE @@ -7,8 +12,6 @@ else call_threshold := 0 endif -KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET) - CFLAGS_KASAN_MINIMAL := -fsanitize=kernel-address cc-param = $(call cc-option, -mllvm -$(1), $(call cc-option, --param $(1))) @@ -45,7 +48,3 @@ CFLAGS_KASAN := -fsanitize=kernel-hwaddress \ $(instrumentation_flags) endif # CONFIG_KASAN_SW_TAGS - -ifdef CONFIG_KASAN -CFLAGS_KASAN_NOSANITIZE := -fno-builtin -endif From patchwork Thu Oct 3 15:51:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175133 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp557249ill; Thu, 3 Oct 2019 09:30:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMZ+sSiOMONyUTb2RnFsXvF2tnUldVSdm4bmTNRdu/Zot1igc/+txKQ49c+p34feUicSwL X-Received: by 2002:a17:906:b298:: with SMTP id q24mr8515666ejz.168.1570120214941; Thu, 03 Oct 2019 09:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120214; cv=none; d=google.com; s=arc-20160816; b=RjUYM9CD04n9Iq27v0y1V4nlyYd7+N2Bj1o6TKIwTI+fBfegaJIPKDxHOa4k9FOJnm ltKRAJkvWfZiAE74GXLLMdqcyWcW+S0Di830QhSG+CYrcdhXa9Sja8/5DzLMmH8PsIL+ X6DhhUiWP977XznUYAwdQxH78n/TVzTxbNggpoipl6KXibDdRknEr4Uf/9MDuwpKSGgN xxVm1N/9mHuWbP/V/jjWA0yfaGrAx7HishA5hOQtIh51LCN4CBa3RzaoAJBvVc5O81x1 0O1uGXW2nIe11nyIZx1H9Zh4Z1xeD1DdZ6G5pHzfCQgs/lFwXauNETBs7WNrG7iSLe3p HDHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YQLYvzko/B5yhXVIXBj5w940LD92sw7/gFWgD7OC4zk=; b=Mmh1xiaT/6TSNSGbDMSqJzKBj4FmV4/OLtt20ab0yOXntd0EQzxUm3BzRcTfRa1M32 HoFsXYcTqge6Z+hBIfumXa35dFKc6xneGhidOvHzgjT6szxMVeY3PeyzNDqI3LmUjyeu R1WjeNSFZnEmVE2XJ3uVAZSnOlv4VOIKKsznDGKELfSwO1XIHPHCLTa/GWPNmKnnPzUh ianO6+9PTh0bG1pAmsMMqRXwfKjHI/wgYfJxZYVM4s6G1fF1p4laeoFoO3/C5RL/62Z5 ITbee/JYgX6GXrzLUukFBJlcCzZebHLydgiMT+doDIcwCCwWai8ASvJknfXWr9b+jSSr nUGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1e5XnYUZ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ca7si1528034ejb.319.2019.10.03.09.30.14; Thu, 03 Oct 2019 09:30:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=1e5XnYUZ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391681AbfJCQaN (ORCPT + 14 others); Thu, 3 Oct 2019 12:30:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:36082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391678AbfJCQaM (ORCPT ); Thu, 3 Oct 2019 12:30:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2A53C2054F; Thu, 3 Oct 2019 16:30:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120211; bh=Iqq+ihm3MEyO7MocIdtefL66drtCw5MVI0GpPu7TVtI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1e5XnYUZPjyxvUN2tlPVZvkOoo7DfDuB0rm9rGyr6tb4h81a0Qh7w0mCaITWQm3bj xGyV+DWbWz3CYVWIVT8o/yt7n/t2pLV+DiTxOAputC0uFs/hTq+QI0PfC+lLNICicF GVDNlksOxypblKuWAN43J63+KooUZ85rHyRmaVzY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Keerthy , Tony Lindgren , Sasha Levin Subject: [PATCH 5.2 138/313] ARM: OMAP2+: move platform-specific asm-offset.h to arch/arm/mach-omap2 Date: Thu, 3 Oct 2019 17:51:56 +0200 Message-Id: <20191003154546.468390520@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada [ Upstream commit ccf4975dca233b1d6a74752d6ab35c239edc0d58 ] is only generated and included by arch/arm/mach-omap2/, so it does not need to reside in the globally visible include/generated/. I renamed it to arch/arm/mach-omap2/pm-asm-offsets.h since the prefix 'ti-' is just redundant in mach-omap2/. My main motivation of this change is to avoid the race condition for the parallel build (-j) when CONFIG_IKHEADERS is enabled. When it is enabled, all the headers under include/ are archived into kernel/kheaders_data.tar.xz and exposed in the sysfs. In the parallel build, we have no idea in which order files are built. - If ti-pm-asm-offsets.h is built before kheaders_data.tar.xz, the header will be included in the archive. Probably nobody will use it, but it is harmless except that it will increase the archive size needlessly. - If kheaders_data.tar.xz is built before ti-pm-asm-offsets.h, the header will not be included in the archive. However, in the next build, the archive will be re-generated to include the newly-found ti-pm-asm-offsets.h. This is not nice from the build system point of view. - If ti-pm-asm-offsets.h and kheaders_data.tar.xz are built at the same time, the corrupted header might be included in the archive, which does not look nice either. This commit fixes the race. Signed-off-by: Masahiro Yamada Tested-by: Keerthy Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin --- arch/arm/mach-omap2/.gitignore | 1 + arch/arm/mach-omap2/Makefile | 5 +++-- arch/arm/mach-omap2/sleep33xx.S | 2 +- arch/arm/mach-omap2/sleep43xx.S | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 arch/arm/mach-omap2/.gitignore -- 2.20.1 diff --git a/arch/arm/mach-omap2/.gitignore b/arch/arm/mach-omap2/.gitignore new file mode 100644 index 0000000000000..79a8d6ea71520 --- /dev/null +++ b/arch/arm/mach-omap2/.gitignore @@ -0,0 +1 @@ +pm-asm-offsets.h diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 85d1b13c9215b..26baeb6477aff 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -236,9 +236,10 @@ obj-y += omap_phy_internal.o obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o -include/generated/ti-pm-asm-offsets.h: arch/arm/mach-omap2/pm-asm-offsets.s FORCE +$(obj)/pm-asm-offsets.h: $(obj)/pm-asm-offsets.s FORCE $(call filechk,offsets,__TI_PM_ASM_OFFSETS_H__) -$(obj)/sleep33xx.o $(obj)/sleep43xx.o: include/generated/ti-pm-asm-offsets.h +$(obj)/sleep33xx.o $(obj)/sleep43xx.o: $(obj)/pm-asm-offsets.h targets += pm-asm-offsets.s +clean-files += pm-asm-offsets.h diff --git a/arch/arm/mach-omap2/sleep33xx.S b/arch/arm/mach-omap2/sleep33xx.S index 47a816468cdb4..a003769121aaa 100644 --- a/arch/arm/mach-omap2/sleep33xx.S +++ b/arch/arm/mach-omap2/sleep33xx.S @@ -6,7 +6,6 @@ * Dave Gerlach, Vaibhav Bedia */ -#include #include #include #include @@ -15,6 +14,7 @@ #include "iomap.h" #include "cm33xx.h" +#include "pm-asm-offsets.h" #define AM33XX_CM_CLKCTRL_MODULESTATE_DISABLED 0x00030000 #define AM33XX_CM_CLKCTRL_MODULEMODE_DISABLE 0x0003 diff --git a/arch/arm/mach-omap2/sleep43xx.S b/arch/arm/mach-omap2/sleep43xx.S index 0c1031442571f..27b13d47cf193 100644 --- a/arch/arm/mach-omap2/sleep43xx.S +++ b/arch/arm/mach-omap2/sleep43xx.S @@ -6,7 +6,6 @@ * Dave Gerlach, Vaibhav Bedia */ -#include #include #include #include @@ -19,6 +18,7 @@ #include "iomap.h" #include "omap-secure.h" #include "omap44xx.h" +#include "pm-asm-offsets.h" #include "prm33xx.h" #include "prcm43xx.h" From patchwork Thu Oct 3 15:52:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175139 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp561498ill; Thu, 3 Oct 2019 09:33:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjvA5oWuUJbQJxLcoSaYO/I+U6r1PExaAJk5caBwPjgZeRqQru+VbjKG6kw/Je31hHPost X-Received: by 2002:a17:906:1f12:: with SMTP id w18mr8335261ejj.224.1570120399302; Thu, 03 Oct 2019 09:33:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120399; cv=none; d=google.com; s=arc-20160816; b=YRTbHKmr5LhgP0AVSRSIKVunOOZ2TvGmQU1lMkxd2FNMC1EX+a1JIIfleyfIdjwr2n P3CmK9Jkq6vLS1nzrJ7l/3a3S1yDOX+Fvs+qO3BVeWFqgPpxUCH9swBg9q1unKeM4c1b 8S1d+MvfGhf0iYtOsWsQIKMoVjGvM1Z5aW2sbscxy1xl+CULj/MuaDM3m1UxO/Ta5wtU ZrcQE4zEaeVwF8jOY3FpBZ4jHjo55jzadvjMmq7PqWsU4LqGCzd+mqDLVbJQKbePFh9a /aL8LYJl0+xAiXiJ3Jrm7/rI11tbIQOu7bsG6JCgb5iLWdgLyo7QvomMPgzl/g0/iU+Z +pCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xy3IVWJa3oYzdcDQdIXFSvUPZOD3kSwZp7yk4A7DuYo=; b=BJ1woI+Ah2jFtTvDc0EHt0AYalszdh1uhPXOURzm71WiRTBcNphvlcZB31BI3BVpo6 M/Ft/758R+x/Oklb40iOf1CnxBDDaBSHDTlrsEVDYOZH0W2rJFotzbQiKUQmE1K4NAwf kM9rxDaB2Ts3nRPO35+X6CMqaLut5wfml/N2TRZ+HNjOC5b+hC4Nx/jV/DsPBukQX/8H oxXThGtfPfAPyZNme8Qf4+HcZ+VygBZ9NFfUqc9inhzUt31nTHwNSePX+C1oRUCiCCND zOAiXo+8i1ncN/5Bv3vGUsPFXP0V8MlZBDtkG4zfM9VUUIDtQz2BsgGygyKd5SQpBi9q 6yQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xj2RCNOx; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 20si1508226ejv.342.2019.10.03.09.33.18; Thu, 03 Oct 2019 09:33:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=xj2RCNOx; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391983AbfJCQdQ (ORCPT + 14 others); Thu, 3 Oct 2019 12:33:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:41178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391274AbfJCQdP (ORCPT ); Thu, 3 Oct 2019 12:33:15 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 68A2A2086A; Thu, 3 Oct 2019 16:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120394; bh=3iuTUPH38z8GhXhGf0ZoFLJizgr0/Dx+jX0EiSbp/nM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xj2RCNOx8xUR0JmPnUsIem2LeZ39ftM+2PufEbBvSa2+NepWEWp5no33EPaGdbjSq kZmW0vrRlV/bKSXv3uJMJx+2MixOVm1TUtGI9hznE7a1gSkctQfwcxR51gnVhQSTq+ 8ijgMJSuN0ytrNbxhUeQaeu7dq6ey1lbmWbcthds= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Krzysztof Kozlowski , Sasha Levin Subject: [PATCH 5.2 168/313] ARM: dts: exynos: Mark LDO10 as always-on on Peach Pit/Pi Chromebooks Date: Thu, 3 Oct 2019 17:52:26 +0200 Message-Id: <20191003154549.512120380@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Marek Szyprowski [ Upstream commit 5b0eeeaa37615df37a9a30929b73e9defe61ca84 ] Commit aff138bf8e37 ("ARM: dts: exynos: Add TMU nodes regulator supply for Peach boards") assigned LDO10 to Exynos Thermal Measurement Unit, but it turned out that it supplies also some other critical parts and board freezes/crashes when it is turned off. The mentioned commit made Exynos TMU a consumer of that regulator and in typical case Exynos TMU driver keeps it enabled from early boot. However there are such configurations (example is multi_v7_defconfig), in which some of the regulators are compiled as modules and are not available from early boot. In such case it may happen that LDO10 is turned off by regulator core, because it has no consumers yet (in this case consumer drivers cannot get it, because the supply regulators for it are not yet available). This in turn causes the board to crash. This patch restores 'always-on' property for the LDO10 regulator. Fixes: aff138bf8e37 ("ARM: dts: exynos: Add TMU nodes regulator supply for Peach boards") Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sasha Levin --- arch/arm/boot/dts/exynos5420-peach-pit.dts | 1 + arch/arm/boot/dts/exynos5800-peach-pi.dts | 1 + 2 files changed, 2 insertions(+) -- 2.20.1 diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts b/arch/arm/boot/dts/exynos5420-peach-pit.dts index f78db6809cca4..9eb48cabcca45 100644 --- a/arch/arm/boot/dts/exynos5420-peach-pit.dts +++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts @@ -440,6 +440,7 @@ regulator-name = "vdd_ldo10"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-always-on; regulator-state-mem { regulator-off-in-suspend; }; diff --git a/arch/arm/boot/dts/exynos5800-peach-pi.dts b/arch/arm/boot/dts/exynos5800-peach-pi.dts index e0f470fe54c81..4398f2d1fe881 100644 --- a/arch/arm/boot/dts/exynos5800-peach-pi.dts +++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts @@ -440,6 +440,7 @@ regulator-name = "vdd_ldo10"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-always-on; regulator-state-mem { regulator-off-in-suspend; }; From patchwork Thu Oct 3 15:52:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175172 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp607550ill; Thu, 3 Oct 2019 10:10:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbJAPkd7fOmpQ9QoYjk95vVAb1fkLOMbVpRtwzVsTuN8APcXlB3UvNO9PaCpDIuuoJ4px8 X-Received: by 2002:a17:906:5109:: with SMTP id w9mr8522611ejk.282.1570122643555; Thu, 03 Oct 2019 10:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570122643; cv=none; d=google.com; s=arc-20160816; b=wbw10kHkosAgAcmSkBy6L52P+mCdyOMEPFKOJXvGFEq33+33xZa4xZQMrvZP+SKI3X XIR7ZVVr7AVre80kmYYinkDOqAXg0Z8fRgg/+sEAQUPPH53btyqfd5879eIZIlyy1jot bw5tsCZST2CDbsNc+vEmn7499Q4aWKgbjwLKSmY89VrUJFsRKrBdgnXRiq2F4rBr9Co2 Y5SVaZKwUc1cs4ySi/xAgs8UmoTVkT+CpgLbeUSIttKq+JQ2ZJk66/11SC4WtE9Qyj1E KLwZgngrLr9DG3x8NhQg0YPSwYhd6XzP/IxZTbFKzRtX1sovIyWS+hakEDhKwRcQqg25 ok8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7xusYlWhFKzzWiCXxRIOQvSBsEVKu1kjtnfarMQ9cYQ=; b=m6Kaos7kIbW85GT06HkgH7kbUOMzy+yPKYab5kDIjxZ9wZAzJiHfRurthM+MNpkE3u tWgO6uNqySlpi27Dpmz3phPA7zRs0GE3VzJZvRgOrUymEV0QTY2YCwVzO+3Q6iAxDj/e ASs5fVyJLogZYyFKNJDMaQprCIzgao/1gDUotRqP9YATWDazDIQs4cObYjg1xIrou7J0 Un6eaSMI+wr19I0caIWxzr/eS28zrSBXTA/IBCuA8zNdPBTA4WpMf3hqmXr85Cm0loQA 3LC4xX/brl7tQaqJYqAVOcbKv6f1hP0Ldy7IRsqxLuKI5x0CWwSpiyhc3U3Y0RCbKe04 IYQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="eUA/a6j3"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k23si1884809ede.274.2019.10.03.10.10.43; Thu, 03 Oct 2019 10:10:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b="eUA/a6j3"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391957AbfJCQct (ORCPT + 14 others); Thu, 3 Oct 2019 12:32:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:40570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391132AbfJCQct (ORCPT ); Thu, 3 Oct 2019 12:32:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 97A662133F; Thu, 3 Oct 2019 16:32:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120368; bh=dWZQeEXELj4oPCyvPKatzqbyZkyD3e/BEQa+Mm6YXN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eUA/a6j3qT3l/QoSqU5tPdI//iQhN6/YLBRaUA4qzpM+ZHBUWHecjJGMHJzZkJu+F CqGgKip6LiXmjPP8sHEGQZik8r++W/spBWrK6IodxuAxorXEOHgl+lfafat0D1DK0n JrUDDnAAKNfGx3mvBu9SJGj0j3yfH8UlHvIqIWK0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ulf Hansson , Sasha Levin Subject: [PATCH 5.2 195/313] mmc: mtk-sd: Re-store SDIO IRQs mask at system resume Date: Thu, 3 Oct 2019 17:52:53 +0200 Message-Id: <20191003154552.181623706@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ulf Hansson [ Upstream commit 1c81d69d4c98aab56c5a7d5a810f84aefdb37e9b ] In cases when SDIO IRQs have been enabled, runtime suspend is prevented by the driver. However, this still means msdc_runtime_suspend|resume() gets called during system suspend/resume, via pm_runtime_force_suspend|resume(). This means during system suspend/resume, the register context of the mtk-sd device most likely loses its register context, even in cases when SDIO IRQs have been enabled. To re-enable the SDIO IRQs during system resume, the mtk-sd driver currently relies on the mmc core to re-enable the SDIO IRQs when it resumes the SDIO card, but this isn't the recommended solution. Instead, it's better to deal with this locally in the mtk-sd driver, so let's do that. Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/mtk-sd.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.20.1 diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 33f4b6387ef71..978c8ccce7e31 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2421,6 +2421,9 @@ static void msdc_restore_reg(struct msdc_host *host) } else { writel(host->save_para.pad_tune, host->base + tune_reg); } + + if (sdio_irq_claimed(host->mmc)) + __msdc_enable_sdio_irq(host, 1); } static int msdc_runtime_suspend(struct device *dev) From patchwork Thu Oct 3 15:53:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175142 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp565975ill; Thu, 3 Oct 2019 09:36:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1gLujfuGLO72+iIavT3ZMZpEdylEOdLKJ1d8v+JVrBSNiDk5M2mqBBuBfpbZwSBxQ2Rux X-Received: by 2002:a50:9625:: with SMTP id y34mr10343445eda.72.1570120612068; Thu, 03 Oct 2019 09:36:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120612; cv=none; d=google.com; s=arc-20160816; b=YLyaYM079FjyMhHwOvCa7nhfNsW2lzRS35rvoSlZMfPsm7sQL2UfI1hvjfPchJbKj7 0HdhuQZmf0a4MT7Uc4SbXeqjROxP99vlGwhl50DNDn4qwKNmd+e+bCqRFNlUz26xpCEF IkxrdCn2bIGW4J42ZO6xIoURkfoC0tKRDPhWbYfuN/it/YNYEfbw93XlkneQZL6Uhn/0 IQXqkBLwKgYVeAD8DBTaUAlAi0AjCQ7Z6wvDvkAjDIodQ76zkoQqLXTbehkOXKGraIhk fNFvcVzBKOKtwHhdYz/uh5YOZI7d5VEVP7wtqmkWTMf8yX3I2gg0Vq+zG29VtfN7GNpP JUHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=N9azd5mur+/EDKPw6lFppY3BpD3PWJ7DNldedf2r5o0=; b=FbOf9591bl1vmvsqF82PsPFLJWEkbZzB4gsQVN4hyk4F2YzRJOeTfTM2SDCon46sPX b9wGiqURJNDVzYtvf62j5hiYL6FRZu3st4wBCSatzLsVRk67x2CJRHQyClWOlcG5Rf6W RKODyPq72Vdbqi7GxmC+RZNlXg+Pj3aR1L2uFI81EHnj+ZGlU5L0op7uAqPdOnaAh3Xp +7uslMWttuLFCgs7xB7pnIGA7wqbMmpZGLiK+tcvhaNkzjQxVk3devZIIivZwmat1ndq xTj7WPMCgAuA4vAuIXwXhyVqbmFsLlwYc+3dF6h2SnEmal3WSNWfHi/KQ8tpVFRt8+Tm V/MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xDzgNUkR; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21si1635316edb.379.2019.10.03.09.36.51; Thu, 03 Oct 2019 09:36:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=xDzgNUkR; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404476AbfJCQgt (ORCPT + 14 others); Thu, 3 Oct 2019 12:36:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:46074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404472AbfJCQgs (ORCPT ); Thu, 3 Oct 2019 12:36:48 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7C6A32070B; Thu, 3 Oct 2019 16:36:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120608; bh=eWEvCVg3wCcSWm4Eo/WgV+HNSy43PDfiVqy2M5m3Wfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xDzgNUkR0meLqxrTyvpIVkoOwAYuo7KQtkhb3ACr9FP/Rdp/mgIFeu8jtP9UP5VWc piGBGP1l9SlnXYnZWjZ50OrCMZf6hXa3Sl679F6WL+qqNAHL0JMjGOJSydMlUW5Zem Elten4HmY6lXzvaHl6qHU+BRnWl2FO9L/h80c/B8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Max Kellermann , Wolfgang Rohdewald , Arnd Bergmann , Sean Young , Mauro Carvalho Chehab Subject: [PATCH 5.2 247/313] media: dont drop front-end reference count for ->detach Date: Thu, 3 Oct 2019 17:53:45 +0200 Message-Id: <20191003154557.370657877@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann commit 14e3cdbb00a885eedc95c0cf8eda8fe28d26d6b4 upstream. A bugfix introduce a link failure in configurations without CONFIG_MODULES: In file included from drivers/media/usb/dvb-usb/pctv452e.c:20:0: drivers/media/usb/dvb-usb/pctv452e.c: In function 'pctv452e_frontend_attach': drivers/media/dvb-frontends/stb0899_drv.h:151:36: error: weak declaration of 'stb0899_attach' being applied to a already existing, static definition The problem is that the !IS_REACHABLE() declaration of stb0899_attach() is a 'static inline' definition that clashes with the weak definition. I further observed that the bugfix was only done for one of the five users of stb0899_attach(), the other four still have the problem. This reverts the bugfix and instead addresses the problem by not dropping the reference count when calling '->detach()', instead we call this function directly in dvb_frontend_put() before dropping the kref on the front-end. I first submitted this in early 2018, and after some discussion it was apparently discarded. While there is a long-term plan in place, that plan is obviously not nearing completion yet, and the current kernel is still broken unless this patch is applied. Link: https://patchwork.kernel.org/patch/10140175/ Link: https://patchwork.linuxtv.org/patch/54831/ Cc: Max Kellermann Cc: Wolfgang Rohdewald Cc: stable@vger.kernel.org Fixes: f686c14364ad ("[media] stb0899: move code to "detach" callback") Fixes: 6cdeaed3b142 ("media: dvb_usb_pctv452e: module refcount changes were unbalanced") Signed-off-by: Arnd Bergmann Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/dvb-core/dvb_frontend.c | 4 +++- drivers/media/usb/dvb-usb/pctv452e.c | 8 -------- 2 files changed, 3 insertions(+), 9 deletions(-) --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -152,6 +152,9 @@ static void dvb_frontend_free(struct kre static void dvb_frontend_put(struct dvb_frontend *fe) { + /* call detach before dropping the reference count */ + if (fe->ops.detach) + fe->ops.detach(fe); /* * Check if the frontend was registered, as otherwise * kref was not initialized yet. @@ -3026,7 +3029,6 @@ void dvb_frontend_detach(struct dvb_fron dvb_frontend_invoke_release(fe, fe->ops.release_sec); dvb_frontend_invoke_release(fe, fe->ops.tuner_ops.release); dvb_frontend_invoke_release(fe, fe->ops.analog_ops.release); - dvb_frontend_invoke_release(fe, fe->ops.detach); dvb_frontend_put(fe); } EXPORT_SYMBOL(dvb_frontend_detach); --- a/drivers/media/usb/dvb-usb/pctv452e.c +++ b/drivers/media/usb/dvb-usb/pctv452e.c @@ -909,14 +909,6 @@ static int pctv452e_frontend_attach(stru &a->dev->i2c_adap); if (!a->fe_adap[0].fe) return -ENODEV; - - /* - * dvb_frontend will call dvb_detach for both stb0899_detach - * and stb0899_release but we only do dvb_attach(stb0899_attach). - * Increment the module refcount instead. - */ - symbol_get(stb0899_attach); - if ((dvb_attach(lnbp22_attach, a->fe_adap[0].fe, &a->dev->i2c_adap)) == NULL) err("Cannot attach lnbp22\n");