Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp354285rwb; Mon, 28 Nov 2022 22:27:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf65mH7wMzSq+Q0aTitq082OUhlW0A7pqAmVysWqtiykYFzrlou/TKiwmoNkgRWE8ULTWbg4 X-Received: by 2002:a17:907:7622:b0:7be:ac3d:f685 with SMTP id jy2-20020a170907762200b007beac3df685mr10177196ejc.51.1669703243985; Mon, 28 Nov 2022 22:27:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669703243; cv=none; d=google.com; s=arc-20160816; b=NcoKpMODrV9D1T3SMyP4GkyS7PrmlleBJHoOD9X6SU2dnvlROkRVxi/cyoUaGl8EpD XuBx6J81Zkbn5TQDLsBq5mhx3czZ/hs4p4L2qSewk3M+2eXnEWhOKhQeUhj0/MbUQPhv iEIzEoxW+J/gHoiU3Gza4Y8+jVjUImbIxSFEE5twy93rMXuTGIauxyuL8uA8Q0Iq1tux dsSq2kgNU0KAQ8VcQaG7aB+NaFF/2SifI8ERSmnFdFk3RPJtbFFkZ26aGk00R5MDFaOH +a6rvwQUoDe9B2qkKYJZvazU6tx2Q8L+YYDoRtO/btf9UcG3fyzFtm84Vt97FDsbHxRi 7V+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:feedback-id:dkim-signature:dkim-signature; bh=toRxxeDncESQ5ly6fHLcJiv4LuWMVHyJPEIjPKru2Cg=; b=p619LZ7+MQj5T5GODiE3Tzy55frgckGEe+D2/lfxPN69AAf6gE+5Gdi2bQOwZRtYAl 1UJLfSyMGPsaN//JCDP2ajFqDgBOWxt6bjqPFMyMyc+qGAJX+d/kFVQknVitHsaXwRxp N/dQE598jyXJ7yG3kVrsCuflhxjCR5sIDe2s0qrefOb+lv+r+8tOKjyDaAOcjKj2OhtN FcKAJPRDwInVNPj1xJ75Oy8CSuOMY8+x7z/LJo2VM/4er+zTAEFpWLE9192O+bdaP2ED ZBPvUEVIwkX7QXlFpP4wGStrikYIVLCzLKwnO8yj70NEUPJCcCCOftWqhQUaN3NUvLJg IEJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=GnNXEBVX; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=e0O86b1K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id vt5-20020a170907a60500b007ae664aa7dbsi9638797ejc.877.2022.11.28.22.27.03; Mon, 28 Nov 2022 22:27:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=GnNXEBVX; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=e0O86b1K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235632AbiK2F6G (ORCPT + 82 others); Tue, 29 Nov 2022 00:58:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229830AbiK2F6F (ORCPT ); Tue, 29 Nov 2022 00:58:05 -0500 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABB7227FC7; Mon, 28 Nov 2022 21:58:04 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 212215C010E; Tue, 29 Nov 2022 00:58:04 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 29 Nov 2022 00:58:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1669701484; x= 1669787884; bh=toRxxeDncESQ5ly6fHLcJiv4LuWMVHyJPEIjPKru2Cg=; b=G nNXEBVXe4/fRb0d2elSjodffbQpUW6HTYxjt5noLwqTcLzbPnXgg4kZXhJ+y+N5A 63IexRDGMr0sBbpXHlKacen0AsPhQwg2JvhVDyKI2pG7aYuyPox1aPYqQUAGS0vS DKeCqWIGOhjKD0RE65S1WrmryKdl4QJPy8lD1IOMzAEwXLDuZv3xc46Fbk+1//ew G8UJ15pOIM10t00bTipGEopPFXgxuxjcFN7ZgdPhO9ITMWqkVGyZ2hAjpAdaLvB+ NZVOyqD6mBcAgwa+Kv7NPOMWKMT9+Z7AW/0Z802kkbFhmd8J3zOX7HtjB68zqSFF ThWfwj8i8svWWkQkoAz3A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1669701484; x= 1669787884; bh=toRxxeDncESQ5ly6fHLcJiv4LuWMVHyJPEIjPKru2Cg=; b=e 0O86b1KyCXPKIzyCduorHpOyPLo0c6fqtE4XdsEkGMVNoFjJ2UcVu/t32BDxw1F6 VZopeONoAKs7vOX9QKO9QURn22eI6uXzk6xD3UGZ2HknF2z072r/FSJlxOy62QDP G/L+tmztMysaR1FeePGQiQQhF+kShkgO8o2uh/vR7MddHxsuNFQ+NZAqu/T2Aj+1 9mlV8uaoC3yt3ATjcnbMFMDZn5+RQpz3FGhujsllztySNRLdo+Fl8UPBH074w5Y5 rhH/cz4bWStDGX/NVpaCTy/x46eI7Me85xrDFeUWIsbGplTToygg9X6wOPAgCth7 W/32C2sZ7DsrH/vIr2tzA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrjeefgdeludcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfvvehfhffujggtgfesthejredttdefjeenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepjefgfffhudejfedtuedugeeutdetgfeiteffffehjeeugfeuvdeh jeetfedtffdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 29 Nov 2022 00:58:02 -0500 (EST) Message-ID: <565e1861-7052-9bd3-e7ba-e590bd91cf20@sholland.org> Date: Mon, 28 Nov 2022 23:58:01 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Content-Language: en-US To: "Lad, Prabhakar" Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Geert Uytterhoeven , Magnus Damm , Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Guo Ren , Jisheng Zhang , Atish Patra , Anup Patel , Andrew Jones , Nathan Chancellor , Philipp Tomsich , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Biju Das , Lad Prabhakar References: <20221124172207.153718-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20221124172207.153718-8-prabhakar.mahadev-lad.rj@bp.renesas.com> From: Samuel Holland Subject: Re: [PATCH v4 7/7] soc: renesas: Add L2 cache management for RZ/Five SoC In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/26/22 15:09, Lad, Prabhakar wrote: >>> + if (!ax45mp_priv->l2c_base) { >>> + ret = -ENOMEM; >>> + goto l2c_err; >>> + } >>> + >>> + ret = ax45mp_configure_l2_cache(np); >>> + if (ret) >>> + goto l2c_err; >>> + >>> + ret = ax45mp_configure_pma_regions(np); >>> + if (ret) >>> + goto l2c_err; >>> + >>> + static_branch_disable(&ax45mp_l2c_configured); >> >> Instead of enabling this before the probe function, and disabling it >> afterward, just enable it once here, in the success case. Then you can >> drop the !ax45mp_priv check in the functions above. >> > I think I had tried it but static_branch_unlikely() was always returning true. You use DEFINE_STATIC_KEY_FALSE above, so static_branch_unlikely() should return false until you call static_branch_enable(). >> And none of the functions would get called anyway if the alternative is >> not applied. I suppose it's not possible to do some of this probe logic >> in the alternative check function? >> > you mean to check in the vendor errata patch function to see if this > driver has probed? I meant to do the equivalent of: + ax45mp_priv->ucctl_ok = ax45mp_cpu_cache_controlable(); + ax45mp_priv->l2cache_enabled = ax45mp_cpu_l2c_ctl_status() & AX45MP_L2_CACHE_CTL_CEN_MASK; in the errata function, since that decides if the cache maintenance functions actually do anything. But ax45mp_cpu_l2c_ctl_status() gets the MMIO address from the DT, and trying to do that from the errata function could get ugly, so maybe it is not a good suggestion. Regards, Samuel