From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BE3CC54FD2 for ; Wed, 25 Mar 2020 03:21:29 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78DE72074D for ; Wed, 25 Mar 2020 03:21:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="BLEduHMy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78DE72074D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alliedtelesis.co.nz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48nD104FSTzDqFY for ; Wed, 25 Mar 2020 14:21:24 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=alliedtelesis.co.nz (client-ip=202.36.163.20; helo=gate2.alliedtelesis.co.nz; envelope-from=chrisp@alliedtelesis.co.nz; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=alliedtelesis.co.nz Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.a=rsa-sha256 header.s=mail181024 header.b=BLEduHMy; dkim-atps=neutral Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48nCyK3187zDq6K for ; Wed, 25 Mar 2020 14:19:04 +1100 (AEDT) Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 16A3780237; Wed, 25 Mar 2020 16:19:04 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1585106344; bh=44FbT0mY8dOR0hwrYqg7wYOelRc5U4Tpq4XNZFjkj7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BLEduHMykXfOplW6ragwvQQqpcdRpobJPpQFFburhQek0Z80PQCnS496Yk4YEpXPs dkS/F4EOvcT80UScHmghxLCzBrsNtCkMPo620PIaLTc/+Xru/e/QFQNPY9y9dNGEPP RpvhySnIFFD2VTLo68s0nc7GP5RGbTilU9KDZN4Ig6QogFIMeV8u+roM+iLsOA+Xhs bF1gE0VauUcbHIDk5S6SXv9AbhRNUBcl6QBh73HxeenFBLRyHBB+s4Z+LicGgWsej2 0Rs5YfVsFSz6i4tZIbiW/uv40nPXbZgFwkP9qqr+K8/BKiglc3UpNABDfW4wwDXnzG fjbV1Ml2naPaQ== Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7, 5, 8, 10121) id ; Wed, 25 Mar 2020 16:19:03 +1300 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.20]) by smtp (Postfix) with ESMTP id 3866C13EEB7; Wed, 25 Mar 2020 16:18:58 +1300 (NZDT) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id CF44A28006C; Wed, 25 Mar 2020 16:18:58 +1300 (NZDT) From: Chris Packham To: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, christophe.leroy@c-s.fr, tglx@linutronix.de, oss@buserror.net Subject: [PATCH v2] powerpc/setup_64: Set cache-line-size based on cache-block-size Date: Wed, 25 Mar 2020 16:18:54 +1300 Message-Id: <20200325031854.7625-1-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable x-atlnz-ls: pat X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hamish Martin , Chris Packham , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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. Signed-off-by: Chris Packham --- It looks as though the bsizep =3D lsizep is not required per the spec but= it's probably safer to retain it. Changes in v2: - Scott pointed out that u-boot should be filling in the cache properties (which it does). But it does not specify a cache-line-size because it provides a cache-block-size and the spec says you don't have to if they= are the same. So the error is in the parsing not in the devicetree itself. arch/powerpc/kernel/setup_64.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_6= 4.c index e05e6dd67ae6..dd8a238b54b8 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -516,6 +516,8 @@ static bool __init parse_cache_info(struct device_nod= e *np, lsizep =3D of_get_property(np, propnames[3], NULL); if (bsizep =3D=3D NULL) bsizep =3D lsizep; + if (lsizep =3D=3D NULL) + lsizep =3D bsizep; if (lsizep !=3D NULL) lsize =3D be32_to_cpu(*lsizep); if (bsizep !=3D NULL) --=20 2.25.1