Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4467693ybz; Tue, 28 Apr 2020 11:47:50 -0700 (PDT) X-Google-Smtp-Source: APiQypKTF9pPBQFSVcSCHIoAt6oaOpxP9iS6jDxp/RgQXkpnk/3b7iKFQ6pWOuag7Pl0ugV9PRj2 X-Received: by 2002:a17:907:447f:: with SMTP id oo23mr9207790ejb.274.1588099669920; Tue, 28 Apr 2020 11:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588099669; cv=none; d=google.com; s=arc-20160816; b=VWW6IqNfq08FMKHSPXIJ7ab4ArcsK1w7H4oKz/y3qh0ErSRlvzNHK2f/51LAxHciZd Eyg2FVczACjlQbCc78UclOTp3FYs9U2j9HPoBeCkgiXQM8U4c4rxaKBriebYpPJBFf2d ETm5b2dhXpzxLpj5zgggskmmmTFmU3RuHBeCRDFr9682J1W3GSHc+ej4RWlydEWGiM1m Rfi+PAptFkTcc6j1bLcrasLyzVOR/yUyKylSJl5KwMV0/dW1TAFkB6zHSeH59UFXtg8a GU6mT2XmCLyUardPyS8FT3dnJqJMB8xyRLwU0mGikDweaYJ146s+Ajng+ShiI2DMGuZs uxog== 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=qwtd11d7kbKLeyeaqNETy4rARCwlz3KH/XHht9zRZXU=; b=wX7mpfbJyH+qTVzBFQE5kxT7t2nCafbGpNvGztUIlfYyua6m/pNXpWKMvB/QnVGHoG C0kIlvDWdi5lkpIQ7ACg8OXMzPSUlJs6KDRqcV0Xh2KbMvytW1aVw2bTT3qIVP2qXoUc R3CCdkvGxLxfpwqraoCB7BP7omuGUaTyG7BciZquHZUmd5dvtF7Rg4AgMrVHDfJ2f0F2 +lO7zuKgTKl8oR3KOQQ39n8hOii3+IAxF7EPqOorM30bQf9oFnKcBZ/mYA6cCYT+E6Sx Pb5DxbZzEf/YEzpTfdG5WaCE2fH+YTuX01PHWe72EDnkCIz3IqRg2ZU1pUfYrKTm02yv SJKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z46NhfxX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz15si2504864ejb.24.2020.04.28.11.47.26; Tue, 28 Apr 2020 11:47:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z46NhfxX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731240AbgD1Sn2 (ORCPT + 99 others); Tue, 28 Apr 2020 14:43:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:35820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730977AbgD1Sn0 (ORCPT ); Tue, 28 Apr 2020 14:43:26 -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 3358A2076A; Tue, 28 Apr 2020 18:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588099405; bh=aIqj5blt3YU3OyUrxguvMvJPhrjWHMfgcQxf3TQ6lPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z46NhfxXFlt0AXdwz0E3x9guAzErL/24xVL4KQF7xOEyuzQK9nUC1kkvUMv9luO6i kbGcAZ3PnuhtjtP9X/eI7A/SynghHLu8ou4UMGpCdvbFCPSPyvIMhjBPGRPGkvah7N tFHeshscY82JAlpxLdQgLvGXK15Uvr+/kQ1ySafE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Packham , Qian Cai , Michael Ellerman Subject: [PATCH 5.4 135/168] powerpc/setup_64: Set cache-line-size based on cache-block-size Date: Tue, 28 Apr 2020 20:25:09 +0200 Message-Id: <20200428182249.013948869@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200428182231.704304409@linuxfoundation.org> References: <20200428182231.704304409@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Packham commit 94c0b013c98583614e1ad911e8795ca36da34a85 upstream. If {i,d}-cache-block-size is set and {i,d}-cache-line-size is not, use the block-size value for both. Per the devicetree spec cache-line-size is only needed if it differs from the block size. Originally the code would fallback from block size to line size. An error message was printed if both properties were missing. Later the code was refactored to use clearer names and logic but it inadvertently made line size a required property, meaning on systems without a line size property we fall back to the default from the cputable. On powernv (OPAL) platforms, since the introduction of device tree CPU features (5a61ef74f269 ("powerpc/64s: Support new device tree binding for discovering CPU features")), that has led to the wrong value being used, as the fallback value is incorrect for Power8/Power9 CPUs. The incorrect values flow through to the VDSO and also to the sysconf values, SC_LEVEL1_ICACHE_LINESIZE etc. Fixes: bd067f83b084 ("powerpc/64: Fix naming of cache block vs. cache line") Cc: stable@vger.kernel.org # v4.11+ Signed-off-by: Chris Packham Reported-by: Qian Cai [mpe: Add even more detail to change log] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200416221908.7886-1-chris.packham@alliedtelesis.co.nz Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/setup_64.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -541,6 +541,8 @@ static bool __init parse_cache_info(stru lsizep = of_get_property(np, propnames[3], NULL); if (bsizep == NULL) bsizep = lsizep; + if (lsizep == NULL) + lsizep = bsizep; if (lsizep != NULL) lsize = be32_to_cpu(*lsizep); if (bsizep != NULL)