From patchwork Thu Oct 3 15:51:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175101 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp528014ill; Thu, 3 Oct 2019 09:09:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuKQd6hQ3TO4NLF5VOnsbNs1836WEvzywgpQfGRxXtF/4mK9drIZ3Oum785us5Wl/+WiaS X-Received: by 2002:a17:907:411d:: with SMTP id nw21mr8231021ejb.8.1570118812985; Thu, 03 Oct 2019 09:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570118812; cv=none; d=google.com; s=arc-20160816; b=x36fNwBZciy/V4u9ivYfPiPSIMkRmyBY200XwAQd4cG80QgZHMAYnoHNYYV14szpFd Z6DscVkdyq5WxBUNWv/iZ3+vsVBk/KIeB2zzUYy0Rw1TJeDzXv0BbupHN4jh53fEtEpI SkuzE0aat6BDqJJCBaYKuRenIHHoLGJqwSHBLYG5AAm2yxXsOQ+l7jOTXzbWCmQXRvFT XOzqttT4I//+Lxf0M4+WvKmcqizXav/c63Da63VEBqmCXbivR+INNM6R5gbWawYlbW63 Ui97ScOAEFNNxdjEXVO+FIMTSSlob6Y+xyI+M2HoqXr53cIpPk9Ma026KBDoePerMPqi FsXQ== 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=NCJzVWiFrrjV0qmVUbCYk0qoM5YkKiN80l6PyyKbPkQ=; b=V/i0uNDfawVvUv20VpyHDKVvWyDdn1GkTr8J0yV+mNNNhNz51PEKTHoViWjD6W1BcL B5kt6C0y7Sscz2tWcUS2f+8JvchYjqiGsLa6WWdnbNfIVmo2TM/Dn5cvZ3ekwBdfmgyN 75hRN9RtpKMXC2Z+Lb0ImabbdetYYMGwTpUEwy8FDyyzaN98dNj6tlm0Um87YhG01h/G RVTLCEnkpm5lHXUMVB78Vr/bqv/ltAr4pjnYrBedyDsWm0wjnbZujFOh1RkEIKOFX3RT DhfNvb3RYeyivfLVZnOWlIc9f3qjjKUOS4HlSh24OsgwxtRO2dLKUkaYdv/xZIa1/TKQ s//Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ATwvV+Hl; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6si1512117ejc.399.2019.10.03.09.06.52; Thu, 03 Oct 2019 09:06:52 -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=@kernel.org header.s=default header.b=ATwvV+Hl; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732806AbfJCQGm (ORCPT + 27 others); Thu, 3 Oct 2019 12:06:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:54044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732795AbfJCQGj (ORCPT ); Thu, 3 Oct 2019 12:06:39 -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 95A61207FF; Thu, 3 Oct 2019 16:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118799; bh=Qr5EGmTQNR2o9tv56lUO1BpJvOjnhnOrG5GY8KDWsgs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ATwvV+HlCSUsS7q7ijz59TBANNbs/9zOj70LpwSyB6qbt5aXF4w+H4NKHm5LDKRpQ dgtMXjDXCbtCkS6lUytRstV3HrBK32dH1BwjyeJTk4MMaAZ11Uc+owrzKWRxH/NrIG lW/zE8K+IBYFVbQFZd7cM+O+q0H1cve3bcvRQDNY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Will Deacon , Niklas Cassel Subject: [PATCH 4.14 014/185] arm64: kpti: Whitelist Cortex-A CPUs that dont implement the CSV3 field Date: Thu, 3 Oct 2019 17:51:32 +0200 Message-Id: <20191003154440.681273301@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Will Deacon commit 2a355ec25729053bb9a1a89b6c1d1cdd6c3b3fb1 upstream. While the CSV3 field of the ID_AA64_PFR0 CPU ID register can be checked to see if a CPU is susceptible to Meltdown and therefore requires kpti to be enabled, existing CPUs do not implement this field. We therefore whitelist all unaffected Cortex-A CPUs that do not implement the CSV3 field. Signed-off-by: Will Deacon Signed-off-by: Niklas Cassel Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/cpufeature.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -838,6 +838,11 @@ static bool unmap_kernel_at_el0(const st switch (read_cpuid_id() & MIDR_CPU_MODEL_MASK) { case MIDR_CAVIUM_THUNDERX2: case MIDR_BRCM_VULCAN: + case MIDR_CORTEX_A53: + case MIDR_CORTEX_A55: + case MIDR_CORTEX_A57: + case MIDR_CORTEX_A72: + case MIDR_CORTEX_A73: return false; } From patchwork Thu Oct 3 15:52:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175102 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp528325ill; Thu, 3 Oct 2019 09:09:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwE0LKJGXbKst09op2NWq6imL0/g5bIBAXJ4HqsTGW4fVzcDLHPE6qEMxQ0nEzPEu0gxclY X-Received: by 2002:a05:6402:32f:: with SMTP id q15mr10285617edw.143.1570118954673; Thu, 03 Oct 2019 09:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570118954; cv=none; d=google.com; s=arc-20160816; b=L27vYu4jNs2FD+7FG6f79L6Mism1G2F1Y+BUfSUUn0a3Y19uWI0kYS11PgTqISGiZ5 JPSeY68MJd6NH+yCx3V8YC6vEVmbn242ZFd0gweIBdSodjBHXFgPZhlVvHTmbKmekgcH FbhhDAKvNswNSgxtaiwfWjaKLPGgukLvA1X5tVBnODILywuudGAdOfnNkSyxn4bt+ZYE i7AXRi+DUE/P75b74ei8lH0mVGdhC6tKmqLaz2udPfbMfXyNMgXeAXX4/J6IrFSOni7H ZRzF/0rPegdlM0nytZIDEkEfPWGoTpoa3aImH9GRelMWqLD3LBcTFRA0RC29uKgqgXxq Qgbw== 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=h6cY9aMAMEeatSETVtKVMIkHdX7aqZnGVr7gIza3IE0=; b=ALWnVQsghsiBfhFMmUTnwWqk185r5uUqKxELN5i2bbFcIEblb4k9Eb0JUdY7PxPPvp KlLYVeWhgWrZQw4+W6v+EV3Tvo1sXW0UVhkKTdn+ijNVbVGlNzw541+n3wlfyd4jm5Tc aBbbuyU6op7A1zxwxbvUChhphR6wCnNltZ180MMk8jdrA/amv9ODl5gJYzVjWoyVIlc5 AwIPoVylGd6KRWMlbIPjORJuLkLs2W0NB8Tr9udG1sXHrwhG2T1cWEhzdWbZOvAJWMZp 38VHig8Mh4lOs1Z9jQdku98LWViMw20eLE7Z0yY1fWohqzzQqLy8sc1WdJQjOU6r1p4S NNIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eogvt0xL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si1512665ejr.29.2019.10.03.09.09.14; Thu, 03 Oct 2019 09:09:14 -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=@kernel.org header.s=default header.b=eogvt0xL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732733AbfJCQJN (ORCPT + 27 others); Thu, 3 Oct 2019 12:09:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:57844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733078AbfJCQJM (ORCPT ); Thu, 3 Oct 2019 12:09: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 BA052207FF; Thu, 3 Oct 2019 16:09:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118951; bh=q7MH5xjL57lYshgLlsRFQ3lgZeENdcd5LR0JjZVkFok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eogvt0xLu2N0RzVWDBH3iISmxmo1Oy3cYBIRHQqYRJPBTOgzXZ4ZmEaPI3k/g2dTv RfX4ofd9OODlKbr3Y4X/RVMgvDAgXPhJUSkwsVS87M9z7PL/YE3yVhxM6Voyqon9U/ 2fSpgoqyis0AF+syOScmyHntv34OjvgzxB2pbig0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robert Richter , Borislav Petkov , "linux-edac@vger.kernel.org" , James Morse , Mauro Carvalho Chehab , Tony Luck , Sasha Levin Subject: [PATCH 4.14 069/185] EDAC/mc: Fix grain_bits calculation Date: Thu, 3 Oct 2019 17:52:27 +0200 Message-Id: <20191003154453.150860539@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robert Richter [ Upstream commit 3724ace582d9f675134985727fd5e9811f23c059 ] The grain in EDAC is defined as "minimum granularity for an error report, in bytes". The following calculation of the grain_bits in edac_mc is wrong: grain_bits = fls_long(e->grain) + 1; Where grain_bits is defined as: grain = 1 << grain_bits Example: grain = 8 # 64 bit (8 bytes) grain_bits = fls_long(8) + 1 grain_bits = 4 + 1 = 5 grain = 1 << grain_bits grain = 1 << 5 = 32 Replace it with the correct calculation: grain_bits = fls_long(e->grain - 1); The example gives now: grain_bits = fls_long(8 - 1) grain_bits = fls_long(7) grain_bits = 3 grain = 1 << 3 = 8 Also, check if the hardware reports a reasonable grain != 0 and fallback with a warning to 1 byte granularity otherwise. [ bp: massage a bit. ] Signed-off-by: Robert Richter Signed-off-by: Borislav Petkov Cc: "linux-edac@vger.kernel.org" Cc: James Morse Cc: Mauro Carvalho Chehab Cc: Tony Luck Link: https://lkml.kernel.org/r/20190624150758.6695-2-rrichter@marvell.com Signed-off-by: Sasha Levin --- drivers/edac/edac_mc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 80801c616395e..f7fa05fee45a1 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -1240,9 +1240,13 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type, if (p > e->location) *(p - 1) = '\0'; - /* Report the error via the trace interface */ - grain_bits = fls_long(e->grain) + 1; + /* Sanity-check driver-supplied grain value. */ + if (WARN_ON_ONCE(!e->grain)) + e->grain = 1; + + grain_bits = fls_long(e->grain - 1); + /* Report the error via the trace interface */ if (IS_ENABLED(CONFIG_RAS)) trace_mc_event(type, e->msg, e->label, e->error_count, mci->mc_idx, e->top_layer, e->mid_layer, From patchwork Thu Oct 3 15:52:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175103 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp528473ill; Thu, 3 Oct 2019 09:09:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYQtpdOT+WaNz99eu9YCUEki1Ub5boU8cki8BrARSw4XHZhKIF03V5vSi/HrVjaNp3JiIn X-Received: by 2002:a05:6402:78b:: with SMTP id d11mr10550955edy.14.1570118960317; Thu, 03 Oct 2019 09:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570118960; cv=none; d=google.com; s=arc-20160816; b=t/c8aHv7Q24tXJmOhqE80HfxePu9iTOo1YoKqhXQN2fN2gtTlbRv748rzOFegV5ZK2 uQxWf7xJjMc7l3lsdp6x5dHmisiqnl2rmKbl7JTFHK85zdbRSWqCtUFHIYNFNHasnlGi SovBgh4t0UYlblS5XCxoDt0aPtRK5MQa+FFZmChnA9minwAYkXS0hjowyVRfjj8YKTk6 qA1sZ2psAdfTGRMp31FmCnc2iThYKy98POgOFmkZXTVSfo/3S/xPqVYwn9m0ZhET3wHu qaLzIZMqpnHeHpSTmpf/u4OSNsbHqen+UwTpGjV+H2LIYGrSDNBMUmWp4e3+tDuBN0uQ rkjg== 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=VodwR7u5u5Ic90PgAKcqxlcz9Sz2HGUZ6h4blioVvok=; b=H8iGIBqqDFQNTJFXZYDg4cty/OmD2+lctl73TtdwmgGhMwb2/COVefcB8gYfKWSwoF Ty2s2DSkw/+u3AzrklpW3qqhncOH5eYy84DSM1UnKsDWUXjG/wcWOID/ExLcWcLtpgBC 6N7H3LKmHK72+WQNPPp+JTIgAjtbKvP6hAehFAtXTbSihFKntjdW+/JUYqZ9zD2iz9TC xx+WabZedjJ8MKflSB7LboIG5VZhKBlB4PAVYJbfjRziFgnTrHFdkUvBuU/yU+u55/E2 WsZ91a0Q5+wHK5ayNX6CLGZc0gsYpbEdi/Afm48IkeksLDOKAagNh7VyQJiMyaIx9V+p FlmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Wv80tF32; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h53si1859065edh.147.2019.10.03.09.09.20; Thu, 03 Oct 2019 09:09:20 -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=@kernel.org header.s=default header.b=Wv80tF32; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731479AbfJCQJT (ORCPT + 27 others); Thu, 3 Oct 2019 12:09:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:57992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733108AbfJCQJR (ORCPT ); Thu, 3 Oct 2019 12:09:17 -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 0C12E21D81; Thu, 3 Oct 2019 16:09:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118956; bh=Das1zxPJh8NGGhzUtOWS3C9EoRTDQpOlYXIBY9sFkxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wv80tF327RRUnf3dh/Rv06z7HPqrMPLbGrEQXabr6QaAZSWXcRpMloGeszja1Ks68 mGcR25st696dKQqXjIn1pFB3Lsulwa+mgp/lqsBUxBP6lZxfXIOfCGEvdDXCW7sKnh RM43Ql2Mg+1augfWqqMxuilLbkqTCPvYIBAd7u+U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinod Koul , Vaishali Thakkar , Stephen Boyd , Bjorn Andersson , Sasha Levin Subject: [PATCH 4.14 071/185] base: soc: Export soc_device_register/unregister APIs Date: Thu, 3 Oct 2019 17:52:29 +0200 Message-Id: <20191003154453.667362010@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vinod Koul [ Upstream commit f7ccc7a397cf2ef64aebb2f726970b93203858d2 ] Qcom Socinfo driver can be built as a module, so export these two APIs. Tested-by: Vinod Koul Signed-off-by: Vinod Koul Signed-off-by: Vaishali Thakkar Reviewed-by: Greg Kroah-Hartman Reviewed-by: Stephen Boyd Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- drivers/base/soc.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.20.1 diff --git a/drivers/base/soc.c b/drivers/base/soc.c index 909dedae4c4e1..1242b2d2e01a2 100644 --- a/drivers/base/soc.c +++ b/drivers/base/soc.c @@ -155,6 +155,7 @@ struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr out1: return ERR_PTR(ret); } +EXPORT_SYMBOL_GPL(soc_device_register); /* Ensure soc_dev->attr is freed prior to calling soc_device_unregister. */ void soc_device_unregister(struct soc_device *soc_dev) @@ -164,6 +165,7 @@ void soc_device_unregister(struct soc_device *soc_dev) device_unregister(&soc_dev->dev); early_soc_dev_attr = NULL; } +EXPORT_SYMBOL_GPL(soc_device_unregister); static int __init soc_bus_register(void) { From patchwork Thu Oct 3 15:52:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175106 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp532284ill; Thu, 3 Oct 2019 09:11:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaWrWWXaCTnTETHaPDakaWGnT8oxi3FGmc20Qr/XHzL+TF1l7Um4FIi0QZiksg9bL66Gat X-Received: by 2002:a17:906:fad6:: with SMTP id lu22mr8134931ejb.98.1570119112851; Thu, 03 Oct 2019 09:11:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570119112; cv=none; d=google.com; s=arc-20160816; b=IWRi2UJBQUg1juII8LzLiXzcXGhLCzD/m6F5+JuPd/wr8ePA+/MTI3i3+j5friaiOv JzomEyXYOqbcYrBLku54OjHnyR7TiX53L+vvHYJevQrMlbjxdu6cWljGBlokQ+n8/Oty x0xPLhwGiuInttCKVqzYwocsVdCsyMHEju1lweHIGxQVIKyknL8ktjKB0q0fLlHvtV0I W6ImeKWinHr9WgOBdZU07qTwvtrkUea05HCz39yzUlr2IrlOC32PWuXyYcMxdU7/N+jp 1dloSqjGXM51arCiDe1zAoM2FiwJ378gvKtm2XFF/kbk6exG452qDb/hXhP496RxSnN/ MVCw== 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=5R13D3I3AaMwlb+m81wivDuZHa5HsF2F5a1qRkuyBvg=; b=BwlAOou2F0UCNe+JG7hxOI3hURiV/C+rFZA9gBcHPDSZctGIVfpBRyuYjgszqvwxpy EiGvClXxK9oItEMRxfZct6o+PUcqvk4Eq7zFrHbSNPvcht43N86SJ1ZSg6P6u50CmDy/ H8vfppRGXnYheG4qfY/mYoD+CKplWv1LBc/nbfNCQj+h2VG7zv+7pfpYXBwWJ92we8q0 y1qHXou+4gJpsv1495ZFI334/WrHuSI4NUNfE0HlWAeELAbS1+rvBY3pu1lH0VOHWZWU +gdua9LyBzYcpMLu19EzZLFe51zaJ9/1maruNYBRZ3q1NxexIQ0DXk7H5ZEDrspstnoe a3xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ydGAcXZI; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c48si1793563edc.169.2019.10.03.09.11.52; Thu, 03 Oct 2019 09:11:52 -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=@kernel.org header.s=default header.b=ydGAcXZI; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387910AbfJCQLu (ORCPT + 27 others); Thu, 3 Oct 2019 12:11:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:33614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732058AbfJCQLo (ORCPT ); Thu, 3 Oct 2019 12:11:44 -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 DE91E2054F; Thu, 3 Oct 2019 16:11:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119104; bh=d4ncFyiCsd77a457JAwmaPtaDLK0wuqOVsHZty0nllA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ydGAcXZICFKvbA4VGGSHX5So3BAWRc1dFQkf1v0ZzqUdNG0Y91ID5REGxBvjf4MXk N08kb2q8kxFTQJaik45pvWtnZJk7P8HNylcbnNLBwnnswiqjQU/L7ENPtfiIIuWXMW 1uUVDq68eD+wkJAqmXoaUfbvICTv6KWwf6Z2dOoU= 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 4.14 089/185] dmaengine: iop-adma: use correct printk format strings Date: Thu, 3 Oct 2019 17:52:47 +0200 Message-Id: <20191003154458.411745147@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 a410657f7bcd6..012584cf3c17b 100644 --- a/drivers/dma/iop-adma.c +++ b/drivers/dma/iop-adma.c @@ -125,9 +125,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); @@ -315,9 +315,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) @@ -525,7 +525,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); @@ -558,7 +558,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); @@ -591,7 +591,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); @@ -629,7 +629,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)) @@ -692,7 +692,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:53:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175110 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp534477ill; Thu, 3 Oct 2019 09:13:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwByl23gIdA6HhErF+7YlEdxsz0uHk+JRGvam7UaCGfNLxE6HZgb0Sjg8iJU6V1hzFhh07w X-Received: by 2002:a50:95c1:: with SMTP id x1mr10299867eda.180.1570119075126; Thu, 03 Oct 2019 09:11:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570119075; cv=none; d=google.com; s=arc-20160816; b=tBsIdTGGCRz22xxo+9ODe916uio1eRz0fqlO2O0Um+h3N3teoP6VV6/I6N2H0p7nAe tqX41FP55S91WjNDrXuWec+C02tO7qIblVi6Rk35TysWKRiJX/Dgguyc9l7v7rOnZh12 4MewSOCqjNxJhwNL6yTSpmoyIGWDrukz6AkLX841smV1V3/U1lVspUJp9BCeFATAPWQa 2c8grQ5GkTs1WxobbpfwYKPaDNr6SwrnSRzzFerhq6DbsA3aWmA+1EFNY6HhviOxH+39 ipteiTixxO0Go12igW+uqZYLlF3QtHw/IJUwTXKcrVp4AaGjVlsftDS9LRSGKQbtHuvi FM9g== 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=E3W8vCNdF/GOv6NjmiAbd7KtJvRt4G2fImedtxaRKZI=; b=sjYUmIegJlzp2HuLx/UHfIrdUp5maFiK+/33tDvNKRgeX5xA1Yp60T9R3Zx6Yx74FL QvYui2fM6V+YF6MUryd+uguJAMpiN+T+NGTfa+O3mKvm2sxd5YBlKbT4NyFCkIi+LG87 dxp06/mq+QU8CDQVRVVE4tIkzL460AnIs6xJeuCc+dOgiJYkyafP6uFAWlIrgnD0lTHU HMoSC6Ihw4TC1myX0+dZh9ZjQ5mEeaNvhJ9WAFo6r5DKOou0umLKIjROE/9iOEnidTr2 bxoE9pwlV9rN6c+Y7XfclXq8FQepudGZB61qpj+lXIm3yRd3I4GrU3CIMKsVVhEUAK74 VI7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J8iGZupt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id me23si1499594ejb.344.2019.10.03.09.11.14; Thu, 03 Oct 2019 09:11:15 -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=@kernel.org header.s=default header.b=J8iGZupt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387794AbfJCQLN (ORCPT + 27 others); Thu, 3 Oct 2019 12:11:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:60916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387769AbfJCQLJ (ORCPT ); Thu, 3 Oct 2019 12:11:09 -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 B35C120700; Thu, 3 Oct 2019 16:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119069; bh=/LpltrAgNejfjNwAl2+uhOAMJdYtq16InXFtN/oWKtc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J8iGZuptbkta6pFDD6mdZfXP8K40PHG9zdeoSpZ76QXXXdf6IYq8WIvyVQRZwHUrX Vg+FPOXcaJpD1A8AdLFZKQkqR8/QrLdi7engL6eaz9zbOE0hEd+NL85D2d9CAENnp7 yb6DpYmE26ke4iB6k4E6zLnychHPYLY0LaeKSqGU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Rutland , Catalin Marinas , James Morse , Will Deacon , Sasha Levin Subject: [PATCH 4.14 113/185] arm64: kpti: ensure patched kernel text is fetched from PoU Date: Thu, 3 Oct 2019 17:53:11 +0200 Message-Id: <20191003154504.138415870@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Rutland [ Upstream commit f32c7a8e45105bd0af76872bf6eef0438ff12fb2 ] While the MMUs is disabled, I-cache speculation can result in instructions being fetched from the PoC. During boot we may patch instructions (e.g. for alternatives and jump labels), and these may be dirty at the PoU (and stale at the PoC). Thus, while the MMU is disabled in the KPTI pagetable fixup code we may load stale instructions into the I-cache, potentially leading to subsequent crashes when executing regions of code which have been modified at runtime. Similarly to commit: 8ec41987436d566f ("arm64: mm: ensure patched kernel text is fetched from PoU") ... we can invalidate the I-cache after enabling the MMU to prevent such issues. The KPTI pagetable fixup code itself should be clean to the PoC per the boot protocol, so no maintenance is required for this code. Signed-off-by: Mark Rutland Cc: Catalin Marinas Reviewed-by: James Morse Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/mm/proc.S | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.20.1 diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index 034a3a2a38ee8..65b0401521846 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -280,6 +280,15 @@ skip_pgd: msr sctlr_el1, x18 isb + /* + * Invalidate the local I-cache so that any instructions fetched + * speculatively from the PoC are discarded, since they may have + * been dynamically patched at the PoU. + */ + ic iallu + dsb nsh + isb + /* Set the flag to zero to indicate that we're all done */ str wzr, [flag_ptr] ret From patchwork Thu Oct 3 15:53:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175105 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp531719ill; Thu, 3 Oct 2019 09:11:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxthlMKbsQkFmQEWuPnMrQbOPoxl75q/bWrYOUzp/jM2gWjrX4ezUOuYIMCMUE/cOk8UQhx X-Received: by 2002:a50:aa8e:: with SMTP id q14mr10469489edc.155.1570119088531; Thu, 03 Oct 2019 09:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570119088; cv=none; d=google.com; s=arc-20160816; b=LujtYC93QhJGPWCVLvzstjleg4jsgAIRR6iuYz7ZbBORPekaLGIVL/6sz1SbV4olzK GPZoPx2/fja9Qj1jjNiRf7NSCSjPH+vtxcULSyUKPG5lqXQkTUHUjOy3rG3WiHJYYGnA gwhz7OqX9aPqkEVm0FJqNY6onwgaxK83Ek6mMeU9sTt1v+6WxkGdWtP+f7XRjaZK1jVx Q+w8o26TSp9TCWndJ+26aC6stfFIrIcpeEAnlgxUBap3T8Ff6wJQk8dzKd6m7QrTS9xc U8ERMclnca+x9iTc+4jHQN31RBXc1w5UMZz/nMRMnHIGMKK7HC11djnC1mDaNJSUk6bn Mg4A== 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=PSBCYUxdBz74bHpw5+XoXxGCYktb3e0Vih37cLLMri8=; b=KcsMfOBrF5Fv7MN70Xlo4WUEAvGIfGwuRQsz2BN+Y8ZFimWt0DFtxsk1yJF0vXl87K H7AnC68x2gD0e6vYpmffEI83lWC1cGd7IfsprD9Rj9LmeMQgfZd7zhsSl3YYJ6LscMhV dDHSPo3JKi2mnstOTwJ9gbhhC5Po1cdRy45bmLS5IGEbPW8rjAHj5uyZy8GmGvxrrYiW JmKb1ozi1uqhzsdhoY/idj6b6lOXFVYydaJLYfvaHp8yX4DucGrz7VOjC+rjv3cUYNfJ 9EPfUTSWj2t1FlZaIaoKw0bazumEZ/h3fcMO6E0WbAO1VaXxY+F1jb5sRP6kyJCbPeRu MoGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=urZ2X1xz; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l2si1508150ejh.389.2019.10.03.09.11.28; Thu, 03 Oct 2019 09:11:28 -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=@kernel.org header.s=default header.b=urZ2X1xz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387839AbfJCQL0 (ORCPT + 27 others); Thu, 3 Oct 2019 12:11:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:33100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732680AbfJCQLX (ORCPT ); Thu, 3 Oct 2019 12:11:23 -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 2C03620865; Thu, 3 Oct 2019 16:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119082; bh=O45hS1XFtek78qi/yy2DUdGSAsD3n7PiKl6lfkTw7f8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=urZ2X1xzq0suIy7+WiADftNJbpyqXBACpev52zTrUuq3j+Hh9mkftkqZTdQkFaSsF kShEegMqQG83mVWsv8iTiWjAOAc69KCtulSBGMpb7uGaY3Z7DoGMEOnJzwVBgV2+Pv quTWNZcr5PYAz9qKPgCL80gG30MV0g4VJk1lxnfQ= 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 4.14 118/185] ARM: dts: exynos: Mark LDO10 as always-on on Peach Pit/Pi Chromebooks Date: Thu, 3 Oct 2019 17:53:16 +0200 Message-Id: <20191003154504.880906309@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 c91eff8475a87..7ccee2cfe4812 100644 --- a/arch/arm/boot/dts/exynos5420-peach-pit.dts +++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts @@ -426,6 +426,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 daad5d425cf5c..0900b38f60b4f 100644 --- a/arch/arm/boot/dts/exynos5800-peach-pi.dts +++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts @@ -426,6 +426,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:53:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175108 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp534513ill; Thu, 3 Oct 2019 09:13:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqysV0HFBZgr1o9NaiGfE9+oqmdb5oVESjvz8FhVEHtiwKVsx/THxGvJMT/t09UaUeVHSVUO X-Received: by 2002:a17:906:5284:: with SMTP id c4mr8585980ejm.39.1570119205867; Thu, 03 Oct 2019 09:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570119205; cv=none; d=google.com; s=arc-20160816; b=ifUYrANG6eFrJvCUqCP+udVlFH3z0m0RJspDNDSmZy71yhLhW/hfw6GhOGFNcNRWFo h78RsAUraxN38vHZqELB6i2Ja2RnPNMjMlW5aop5A1S72LbxDaWKnCAfnerI5aQJM6s8 4NnGJN+geyA4mVJDoxmoSWfHiX+JE32Sb8kbH4rL7PQZGyxrSt4mcjHxsha4NR4ytqAw UsYuJvCD4ioXgXlRQszSwz4Z4Xd5OXXZW3HEVqGxI51w+kdzmcCPqemGMNX3TMRZknL6 00tYkR+lO9JE9lPQ5vmsmOwU0VciXq7j3gsq46WJkmVtZqjdYX9lzO0dF+f49lDLc7mn v/3g== 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=BEU6QeIKzl0vKlHeLIblsMfcYhssiP7hdL5yZcFFGs8=; b=ywCJZDQVjd75WGxhzmxNWL+eM+gxZxjs7VHmeO7DgrJtSL0ZXa+13/jks8zFHnK1sF yzPT9W7Fn95lWKZGMkCaPhOQigRbQlYI2vWIYoW4E4BFAfs/ZHWskkK/DKT38qUSx6gI nKFMMoYSqpyhrKlprdKKs1ZmVmC44wTXouimD873SobuMrV9/e0LGRY/hKeqOD7Cw5vf 1AB6nswrPxf7dvccwlf+w71UV+3L87365UoDJMHcp94RHSuYFdGs5HnQl1Xs4yEm5vvw cjjhFRYblMEtTdpMZwjnYbAYOhzmnMWRZ93FTSy/Ls4t6R2nwPcSBcokkSl35m2Q95Bx bA9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wmMEQRT5; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gh3si1390390ejb.306.2019.10.03.09.13.25; Thu, 03 Oct 2019 09:13:25 -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=@kernel.org header.s=default header.b=wmMEQRT5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388300AbfJCQNY (ORCPT + 27 others); Thu, 3 Oct 2019 12:13:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:36038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388261AbfJCQNW (ORCPT ); Thu, 3 Oct 2019 12:13: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 A923121783; Thu, 3 Oct 2019 16:13:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119201; bh=DK+VYKzLxLOxqlDf2LOXe0BiTUa7g4axbqL/DscNXnE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wmMEQRT5h034JiiEFKvIsiO5Ju3liOAd0/xozrXXx3SdpeVxAxzGOeRxw+C9SFwBQ eIVb91KqjFsNMwyF9e/M1xUokVPlu6QhFvq1l9dsidXTttK4PkXmlXkhGGGvK0phyd hkZAO+2mRHMj78Y0ZyZ53zfQGLnWK7bCwgOWj3YQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Ujfalusi , Arthur She , Mark Brown , Sasha Levin Subject: [PATCH 4.14 126/185] ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set Date: Thu, 3 Oct 2019 17:53:24 +0200 Message-Id: <20191003154506.356128880@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Ujfalusi [ Upstream commit 2ec42f3147e1610716f184b02e65d7f493eed925 ] Some tools use the snd_pcm_info_get_name() to try to identify PCMs or for other purposes. Currently it is left empty with the dmaengine-pcm, in this case copy the pcm->id string as pcm->name. For example IGT is using this to find the HDMI PCM for testing audio on it. Signed-off-by: Peter Ujfalusi Reported-by: Arthur She Link: https://lore.kernel.org/r/20190906055524.7393-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-generic-dmaengine-pcm.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.20.1 diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index d53786498b612..052778c6afad6 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -311,6 +311,12 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd) if (!dmaengine_pcm_can_report_residue(dev, pcm->chan[i])) pcm->flags |= SND_DMAENGINE_PCM_FLAG_NO_RESIDUE; + + if (rtd->pcm->streams[i].pcm->name[0] == '\0') { + strncpy(rtd->pcm->streams[i].pcm->name, + rtd->pcm->streams[i].pcm->id, + sizeof(rtd->pcm->streams[i].pcm->name)); + } } return 0;