From patchwork Sun Oct 6 17:21:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175291 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3302764ill; Sun, 6 Oct 2019 10:36:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2Z70WkKayoAfl0UGkOYgloIcI4SBVvlZLYcY7JpZ3q3XmIeQ1u2U9jyxWJ0EhF9FM7cpS X-Received: by 2002:a05:6402:32f:: with SMTP id q15mr25518095edw.143.1570383379678; Sun, 06 Oct 2019 10:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570383379; cv=none; d=google.com; s=arc-20160816; b=mCHLlmmtgGOI3ux/pz9zaRk9BGRISi/K0iHrpYrafhqmikNZCNMvEsTa02SOVe1KVz 1giU94mozye/dWYQfnl8FkCYHLpqiUvubgj7BR9zTJ3oed7kfdOiLEG84hHfmkvM+Fdt t36jq1pAPoDWR9r/hpnP0fDzg1lfnq5sHRlrLBENILJKi878nHV4ZvwoVvT7Myx7uQHk Vj5Fh/LLGCSEIRl8Fjl9l/1+z344Ha3FgUZeS1FHJR5rhS43hFu2JJZ7VXtRCxkemXKa aLHAuKTAfD6HJmSrrO5i6UdqgwwB8qn+a8cOjsIbHY3LAFpSZ76XRtBOcQ0v+aZUZhaT aEXw== 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=Wm8do8uUkgpxPUlaWaQ3vx1rSMZzH4JTTST8FZ541WU=; b=qeCWYhq7beOhEB56pb/qYXq2+Rpsvx2MKPEPFiOXlk7ouH6DdfLMY6iu9w3dIjKp7Z gGRuPFhcLlkjT+CJlFRFvgokWsKGx3PhZkb/kVhCxxla1nPqeLHRJM9hVarHjFQMxXG8 B220CCSqEloAw8B4v9SvzUhSvirSQzGyClMtAHauYHqLBebkAaS1qHt3YGs8tNLeXdkn olQF7Inrj5DwdzTwYNxMYtOCemWJRVoMuLmjzzQE1KNueuwCELfuehJfoRBnPKpsXAYg SxnLLyToQuL78PmkGzrMuUCECJQ4R8d0ciQEa+STInt1VeYdwsC1e3C24M/zb/3ZTmLd NQeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="NU/XdnpA"; 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 v14si7760814ede.424.2019.10.06.10.36.19; Sun, 06 Oct 2019 10:36: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="NU/XdnpA"; 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 S1728609AbfJFRgQ (ORCPT + 14 others); Sun, 6 Oct 2019 13:36:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:34976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730250AbfJFRgO (ORCPT ); Sun, 6 Oct 2019 13:36:14 -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 BFD622064A; Sun, 6 Oct 2019 17:36:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383373; bh=OykuoBvG7eWAabm6JjGpW/J91pGbkUxRh6yTEZjST08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NU/XdnpA3XiYmiym6v9Ak3hj/7JexOktWTQCUxd4URjgVapHIXzxHpz7LPXdUWDKd hbnoCT91Ckr1G3kxIJs5r9AqXJ9NZSQEIp3oSw5by7z1xXdDSfks4etSea4w6bImiP 0SAf39M+hR3eBNXkiFoPSY/o7aMrYt3RqpKoqM9U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nick Desaulniers , Nathan Chancellor , Andrew Murray , Arnd Bergmann , Will Deacon , Sasha Levin Subject: [PATCH 5.2 078/137] arm64: fix unreachable code issue with cmpxchg Date: Sun, 6 Oct 2019 19:21:02 +0200 Message-Id: <20191006171215.465566322@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171209.403038733@linuxfoundation.org> References: <20191006171209.403038733@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 920fdab7b3ce98c14c840261e364f490f3679a62 ] On arm64 build with clang, sometimes the __cmpxchg_mb is not inlined when CONFIG_OPTIMIZE_INLINING is set. Clang then fails a compile-time assertion, because it cannot tell at compile time what the size of the argument is: mm/memcontrol.o: In function `__cmpxchg_mb': memcontrol.c:(.text+0x1a4c): undefined reference to `__compiletime_assert_175' memcontrol.c:(.text+0x1a4c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `__compiletime_assert_175' Mark all of the cmpxchg() style functions as __always_inline to ensure that the compiler can see the result. Acked-by: Nick Desaulniers Reported-by: Nathan Chancellor Link: https://github.com/ClangBuiltLinux/linux/issues/648 Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Reviewed-by: Andrew Murray Tested-by: Andrew Murray Signed-off-by: Arnd Bergmann Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/include/asm/cmpxchg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/arch/arm64/include/asm/cmpxchg.h b/arch/arm64/include/asm/cmpxchg.h index 7a299a20f6dcc..7a8b8bc69e8d1 100644 --- a/arch/arm64/include/asm/cmpxchg.h +++ b/arch/arm64/include/asm/cmpxchg.h @@ -63,7 +63,7 @@ __XCHG_CASE( , , mb_, 64, dmb ish, nop, , a, l, "memory") #undef __XCHG_CASE #define __XCHG_GEN(sfx) \ -static inline unsigned long __xchg##sfx(unsigned long x, \ +static __always_inline unsigned long __xchg##sfx(unsigned long x, \ volatile void *ptr, \ int size) \ { \ @@ -105,7 +105,7 @@ __XCHG_GEN(_mb) #define arch_xchg(...) __xchg_wrapper( _mb, __VA_ARGS__) #define __CMPXCHG_GEN(sfx) \ -static inline unsigned long __cmpxchg##sfx(volatile void *ptr, \ +static __always_inline unsigned long __cmpxchg##sfx(volatile void *ptr, \ unsigned long old, \ unsigned long new, \ int size) \ @@ -212,7 +212,7 @@ __CMPWAIT_CASE( , , 64); #undef __CMPWAIT_CASE #define __CMPWAIT_GEN(sfx) \ -static inline void __cmpwait##sfx(volatile void *ptr, \ +static __always_inline void __cmpwait##sfx(volatile void *ptr, \ unsigned long val, \ int size) \ { \ From patchwork Sun Oct 6 17:21:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175292 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3302892ill; Sun, 6 Oct 2019 10:36:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzl9iZm84JqdfV/YjY1xAepeS2v8OyE14AMtKCVjboeG+UU5vdpWFymA09OTOjsMX1KEL2N X-Received: by 2002:a17:906:5c07:: with SMTP id e7mr20518767ejq.127.1570383388750; Sun, 06 Oct 2019 10:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570383388; cv=none; d=google.com; s=arc-20160816; b=lhybttvJOFHoaswSDZn4Hd9aVTJa3z7BDwn71qOrXYOhkfOXmy1xSjfoTwLgMdaTe+ 6HZlaEPwecaoh3Y8h4UNeXxT7UbnIm/WqaWVZAlseICdrbG16He+hJt89SFTPHCnsM65 Xl7V36ZGLKbPXgJGLPHcc0iMsqg3jTmiL2rdZ/zG6xDaEaQpsvEkSuzj3WYnrD3+m2SD TZVti0yqEV6tvhE0pfvdoVOMXkLdhKGJku7TjeL+AS62ueA1GdTjB8THHVOqp6OyHOcC UWJaDB6clwOol8EsXUrg8TEAdNoPGpINTFR0br/K8CnxP/QKkLhRXALPkh/rV0d5PlYB BotQ== 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=jg63KspyeJk2a89gWB5DrfnOVHvgXMuY3XbBdh1A/tk=; b=YCm29bfyoqu+maDrgGwqfv0McNM7MKo+UUNwvLOAnu5zpsTgTjXimplmy79L3ZT+cf RVxrDNXmbBTO5cGW0KyJIH+YLn+r/8rGeDLcZZ4tQ6Ffa7TAYd9PZqEhq1hkeTqteMtA QZPcb/gzuf72GWMkK2DwgumRoMjG6Xt46UXZ6WKHe8JRZxqILAitLs3J8b4l98aR4b7n Moq5gvmIbtVIRbVbgt0/t/0ZZ/wcRyqZLTR0YlJMy6i15QV+smzzG8hzvOXWBZbKDggH r/kgsg5mREN8BlklPhGp6ZQ5V1Pb5e6W9hDVrHUm6+/c4KhMqL13LrS+G1PZ3dpHmHqk J+MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PIK2fuFq; 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 t10si7128280edd.447.2019.10.06.10.36.28; Sun, 06 Oct 2019 10:36:28 -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=PIK2fuFq; 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 S1727963AbfJFRgZ (ORCPT + 14 others); Sun, 6 Oct 2019 13:36:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:35194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730276AbfJFRgY (ORCPT ); Sun, 6 Oct 2019 13:36:24 -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 831E520700; Sun, 6 Oct 2019 17:36:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383384; bh=2w4J4EU+vkn9b/OZxn8whPVPfDR0AZ6c1hgoTTdibcM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PIK2fuFqxAcXcoM2h0PGzfBMDUruIgWl/xdnYP2RqjIPTWSXYWBjdEFdvhZjzT3V0 /MWtVGVtvznS9oe2D76/I6FNA8ojLlDcm78atZhmnYgP1o/lrgZjOzKjaISt7XmNh9 3v31d4qZGdv9umUtR+LW//qTfoByyfmr7prCcyfM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dong Aisheng , Jordan Crouse , Bjorn Andersson , Stephen Boyd , Sasha Levin Subject: [PATCH 5.2 082/137] clk: Make clk_bulk_get_all() return a valid "id" Date: Sun, 6 Oct 2019 19:21:06 +0200 Message-Id: <20191006171215.695568055@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171209.403038733@linuxfoundation.org> References: <20191006171209.403038733@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 7f81c2426587b34bf73e643c1a6d080dfa14cf8a ] The adreno driver expects the "id" field of the returned clk_bulk_data to be filled in with strings from the clock-names property. But due to the use of kmalloc_array() in of_clk_bulk_get_all() it receives a list of bogus pointers instead. Zero-initialize the "id" field and attempt to populate with strings from the clock-names property to resolve both these issues. Fixes: 616e45df7c4a ("clk: add new APIs to operate on all available clocks") Fixes: 8e3e791d20d2 ("drm/msm: Use generic bulk clock function") Cc: Dong Aisheng Cc: Jordan Crouse Signed-off-by: Bjorn Andersson Link: https://lkml.kernel.org/r/20190913024029.2640-1-bjorn.andersson@linaro.org Reviewed-by: Jordan Crouse Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/clk-bulk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c index 06499568cf076..db5096fa9a170 100644 --- a/drivers/clk/clk-bulk.c +++ b/drivers/clk/clk-bulk.c @@ -18,10 +18,13 @@ static int __must_check of_clk_bulk_get(struct device_node *np, int num_clks, int ret; int i; - for (i = 0; i < num_clks; i++) + for (i = 0; i < num_clks; i++) { + clks[i].id = NULL; clks[i].clk = NULL; + } for (i = 0; i < num_clks; i++) { + of_property_read_string_index(np, "clock-names", i, &clks[i].id); clks[i].clk = of_clk_get(np, i); if (IS_ERR(clks[i].clk)) { ret = PTR_ERR(clks[i].clk);