Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4871423rwn; Sun, 11 Sep 2022 23:57:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR65P7HtAzlQdeiq5yDQ2XKhIpTgAyQHCrmZldUG8fhR19A3KGhDrkBhfTXXnkUO5VGZgREW X-Received: by 2002:a65:6048:0:b0:412:73c7:cca9 with SMTP id a8-20020a656048000000b0041273c7cca9mr22853644pgp.257.1662965847081; Sun, 11 Sep 2022 23:57:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662965847; cv=none; d=google.com; s=arc-20160816; b=Db52DoisGlOq0sfStYoJ5pHTBqQFcgyopwNaEL24Cxgtx3HhguIzaras4akZOE3pNR zgCmqacFYu7Pcy78y474xx48c/eeZA5YCFN0tVessbFrnS0bAMT49wNslbc8jtlqLZ1W z1viVO/Zn5LpHqUuA3lmc+x2GCjyTiso81xTRl/DlQq1hUzPs3mPSvB58D1b9tTTuGA+ qZf2LqAhfQGTLa8ZKeHav5ifeQ0HaPXMcl9KClotW+dwQZsWsjAsVnUGfn9eFGj7tKtW aINfp3txfQGGd3WpkE2E8ydNZNFXHVLC9g/C748l8kv0MNc7HRpmqT7ra4OYD0R3vQfR +7Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=6MMFOsdik3pOVxza5iFw67+zQvf/yIVZHtdOoLDh9XA=; b=JCCAzzGkp6T3l1dIzxFES2neQ8MdYbzlp7ohCvhSVmtHvaYQR/k6sCdBex02qqYhiW XuNme/h7rXaoHS3VT2ndOaZkATuX1zKMcGrXfrZYPAYtazpf/jUbX6mOwOQbc96TfAy1 ZbnmGl1psaCXXtougxz+sadqizBGfEBv+sBIsFGIgBqf2TEHCtc4XfuUQ9zsDMW7ARzJ q6PhAomj5A5KT80qg7scXBiIpttxejEO+UYDuKeq9tJKUjqVERwHihR+tIAZ8VozXPNe k838ieS21LzP3qaQizSh5bonw8akz5Qn76T7IPNIL4TfLEpO4JqJZXrU3ur2BUZkRIRv 316A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=WBHyt8tS; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a170902c94600b001781675f424si8727014pla.548.2022.09.11.23.57.14; Sun, 11 Sep 2022 23:57:27 -0700 (PDT) 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=@sifive.com header.s=google header.b=WBHyt8tS; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229762AbiILGiF (ORCPT + 99 others); Mon, 12 Sep 2022 02:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbiILGiD (ORCPT ); Mon, 12 Sep 2022 02:38:03 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCFAE205C1 for ; Sun, 11 Sep 2022 23:38:01 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id w8so13183962lft.12 for ; Sun, 11 Sep 2022 23:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=6MMFOsdik3pOVxza5iFw67+zQvf/yIVZHtdOoLDh9XA=; b=WBHyt8tStNEomzn+/msR7XqF/ADGnzCqlpOgYyuTl9iS4felZamXZBRCDP0wkg8l4R fV0ajIesocWpV+qkZk7ucUVPVljcFmi1gppGcQ39zw/MdY3OaKKpXa2+KAEzcCDsWJCb YBFw+HGsnM+pYVt73fG5IHj4mit/jgCc+fc82ai5AYNJ6x38I5qethpk/vJg07qVRFs8 HZC1Ev/RjvySyWmKUC46gT5n+2+94pblkCEqx98gZ6P4t1Cvz3eLBfjp37QJqhEkr4Zx +YlPi400FroQQTn0yRA7lE9kfYLTg7gd4xDoXrAn56m7jJac34t5p/lCI9l10F4KwMHz z4jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=6MMFOsdik3pOVxza5iFw67+zQvf/yIVZHtdOoLDh9XA=; b=Wp99ZCt8Gezr4tUsmS3+zXBwnuA++5lDak8XaVta9i7tM6Vw76b/+4C+AhEWIlDHXu 0BYAoMUyDGrq+VGKwvEcUC9nZMVBYARwQ4j8/Z5W4UXLZ8ykcbhkOdl4CB6pa6Zw2qsM uJegtnK6Qs932qaX+92i1fYJuNCc1veK5FuQaA0ppVsZqR/+PdIa1nrYNtj0UNnUIhet trnWq959Mj9s8BaZqd56WMBIwwglQUGNhd4U32xv2MnYgMkaumetbYWKAGcoh097sIhy TgIGl5w3ON+vd8yCTqO09pu4nsuwZ9q2tFO2V6e2Nm1dHoXkx1/ZYCPQdwWfR8FHXP4T +aKQ== X-Gm-Message-State: ACgBeo12v1a8xL/2EBznlaxnq28YZBpKA/lXp9gSApXuExVbvI/133wM gTEyCKJRi/FhB6hSu4ULB87Jabsx465/RZyN7IXXeA== X-Received: by 2002:ac2:5681:0:b0:498:f58f:c006 with SMTP id 1-20020ac25681000000b00498f58fc006mr5016032lfr.428.1662964679707; Sun, 11 Sep 2022 23:37:59 -0700 (PDT) MIME-Version: 1.0 References: <20220908144424.4232-1-zong.li@sifive.com> <20220908144424.4232-4-zong.li@sifive.com> <632b2853-1543-e3ba-b34f-39f3f4fdaddc@microchip.com> In-Reply-To: <632b2853-1543-e3ba-b34f-39f3f4fdaddc@microchip.com> From: Zong Li Date: Mon, 12 Sep 2022 14:37:48 +0800 Message-ID: Subject: Re: [PATCH v3 3/6] soc: sifive: ccache: determine the cache level from dts To: Conor Dooley Cc: Rob Herring , krzysztof.kozlowski+dt@linaro.org, Palmer Dabbelt , Paul Walmsley , Albert Ou , Greentime Hu , Ben Dooks , bp@alien8.de, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-riscv , linux-edac@vger.kernel.org, "linux-kernel@vger.kernel.org List" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Fri, Sep 9, 2022 at 2:28 AM wrote: > > On 08/09/2022 15:44, Zong Li wrote: > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > > > Composable cache could be L2 or L3 cache, use 'cache-level' property of > > device node to determine the level. > > > > Signed-off-by: Zong Li > > Signed-off-by: Greentime Hu > > --- > > drivers/soc/sifive/sifive_ccache.c | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/soc/sifive/sifive_ccache.c b/drivers/soc/sifive/sifive_ccache.c > > index 949b824e89ad..690c19489317 100644 > > --- a/drivers/soc/sifive/sifive_ccache.c > > +++ b/drivers/soc/sifive/sifive_ccache.c > > @@ -38,6 +38,7 @@ > > static void __iomem *ccache_base; > > static int g_irq[SIFIVE_CCACHE_MAX_ECCINTR]; > > static struct riscv_cacheinfo_ops ccache_cache_ops; > > +static int level; > > > > enum { > > DIR_CORR = 0, > > @@ -144,7 +145,7 @@ static const struct attribute_group *ccache_get_priv_group(struct cacheinfo > > *this_leaf) > > { > > /* We want to use private group for composable cache only */ > > - if (this_leaf->level == 2) > > + if (this_leaf->level == level) > > return &priv_attr_group; > > else > > return NULL; > > @@ -215,6 +216,9 @@ static int __init sifive_ccache_init(void) > > if (!ccache_base) > > return -ENOMEM; > > > > + if (of_property_read_u32(np, "cache-level", &level)) > > + return -ENODEV; > > I think ENOENT or EINVAL are more comment patterns here? > > Either way, > Reviewed-by: Conor Dooley > I will fix it in V4 patch. Thanks > > + > > intr_num = of_property_count_u32_elems(np, "interrupts"); > > if (!intr_num) { > > pr_err("CCACHE: no interrupts property\n"); > > -- > > 2.17.1 > > >