Received: by 10.223.148.5 with SMTP id 5csp7799927wrq; Thu, 18 Jan 2018 09:39:10 -0800 (PST) X-Google-Smtp-Source: ACJfBosBLf1GnyPCZhcjQa1fknvsom7eoPkcZbP7eJ89DqcukL5hLb85b1JKrThGyIClGKyG+/PM X-Received: by 10.98.70.194 with SMTP id o63mr29681981pfi.58.1516297150362; Thu, 18 Jan 2018 09:39:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516297150; cv=none; d=google.com; s=arc-20160816; b=CmgUdBROwM97IMY/zeruKjniZwst5xLFtZJaoFD699C5uuSN+iFKyanGs8inewU/X2 37emY7613ztzSlzUUKEczVGq3WDLmtXTteJgAu45tzUtrYm5x0/hhd0qAMIbT5o8ViFU ejjHbZaJ3G4kdEndsgTvzBrrE005trt+JCtwHMxUV7ZRsAX4S/FyM3HHs5MRM6mhTBp3 ksrAC4h1H9iOkTS0UZp6L89AXZRxR91iUFq4ogYieMmeSpvyyvhxdfMPK9vTT2WSFH8m TDtgAJTTDHtgMhSYmfoXGCrjKVfI7zB80bGuCVnGtIu8JLAmwsdeS5QhcsuW8q91BDPd 90gQ== 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 :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature :arc-authentication-results; bh=3r6LaSzaB+0V1OFBwueQgrSJTgN9vhoytgdt4XKvl3I=; b=vxYfXaVRk+V1vfLLDa/RRnnlzwwXpVH7nOilSeGtkQjbj8R7iR3PunHKquXKEN8xAS sCh5MQcnq2NS3V+KVYLwdYnnJVVIa8oPAUuONeU/79AiQ+WDU+vREB5rJ7ajUosO1CfK muKIYG4A0VKXvU9agELkOJeYWNq4POda6Jm/8gE8bdDWZ4wj8Mg+qR1vAmqBlZV86veg gp0rOLVNqPC4nIkCadlW+i1dJsMlA6EMtM2XZaeUnmIPgqUZUso+9aHtO584DB7sxWb6 xb+j8tDoWFeLPu4HObLUEC23AKcWLsOMWlOtPRuhJYap+fcxf1QqjmAyIOVXy/MiL2dZ 1frg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=FWhL45JJ; 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 15-v6si64831pla.23.2018.01.18.09.38.56; Thu, 18 Jan 2018 09:39:10 -0800 (PST) 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=@sifive.com header.s=google header.b=FWhL45JJ; 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 S1755503AbeARRgs (ORCPT + 99 others); Thu, 18 Jan 2018 12:36:48 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:40800 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755407AbeARRgo (ORCPT ); Thu, 18 Jan 2018 12:36:44 -0500 Received: by mail-pg0-f68.google.com with SMTP id g16so8223132pgn.7 for ; Thu, 18 Jan 2018 09:36:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=3r6LaSzaB+0V1OFBwueQgrSJTgN9vhoytgdt4XKvl3I=; b=FWhL45JJbEqgzBxszKE47cuSfPJP/63+6SzZIaXBT1BO8yv936CjPdbXvQNDGnZagh 4GYcVN5bH1mZFTPjANGCNVa6aSy6jgiL0ckY+Kwe144aEAzFdMrf24t1+vG3Nl64YfsM /H0vN2YX40+RFnTKcSTXULA1Q0Kd3woZTwZrbL48DEawiW3DBdtndFZGGUaQeBS+1Ft9 IG4jURnAyqoSDBkWi/TR83kRWHuf1klOyNKgTJ7ODetNW4b7TpD9A/YDWpgw8ZXIfLK+ 0A/ScZVtSAISNKUUy4t2PIsHgQtDsYmGa1ePBY5+TjgJT8jjq2qY6nS8yRVDopnUEkc5 m8Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=3r6LaSzaB+0V1OFBwueQgrSJTgN9vhoytgdt4XKvl3I=; b=X79C4DawcZVT3+XavMcFNF2jS8/n9Xyj3KT9IF+BNnaqWb+inZ3QbqxO4ynQF7PQ0I HoFYolDWw0YE3u7jiMPA/qyXast2uWIP/d5N/AmfWpZfT8H0ICI3oA9ptfVjR+i23NVf 1q376PZKNoigpMswFmUEQrqCRHKUVQKO78ZwjMxV1J8olyp6YiDI3KN0MndGHGg3K4P4 D68esbp+RnluLIS83KDQl7LXFczfQ/49L+KY2krmtX+l9rbyJpZrCbP/nWyi5xBwzTs3 qtlvpMqcnZ3kd//COxsOc4aOP59QJXQ8zSyTVbJosJdq5aYpLCOwUczId192lspEV/un oLDw== X-Gm-Message-State: AKwxyteKZKPpCZixnIedd09Q4AJnafFhCUmXRzy9f8R2Y1vVfkcvTTlJ 54nhnF9ryTs0nXdBaPTakRJRWw== X-Received: by 10.98.242.2 with SMTP id m2mr18438612pfh.102.1516297003197; Thu, 18 Jan 2018 09:36:43 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id q13sm12438731pgp.76.2018.01.18.09.36.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 09:36:42 -0800 (PST) Date: Thu, 18 Jan 2018 09:36:42 -0800 (PST) X-Google-Original-Date: Thu, 18 Jan 2018 08:51:13 PST (-0800) Subject: Re: [PATCH v6 02/12] drivers: base: cacheinfo: setup DT cache properties early In-Reply-To: CC: sudeep.holla@arm.com, jeremy.linton@arm.com, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, hanjun.guo@linaro.org, lorenzo.pieralisi@arm.com, rjw@rjwysocki.net, Will Deacon , catalin.marinas@arm.com, Greg KH , viresh.kumar@linaro.org, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, jhugo@codeaurora.org, wangxiongfeng2@huawei.com, Jonathan.Zhang@cavium.com, ahs3@redhat.com, Jayachandran.Nair@cavium.com, austinwc@codeaurora.org, lenb@kernel.org, vkilari@codeaurora.org, morten.rasmussen@arm.com, albert@sifive.com From: Palmer Dabbelt To: sudeep.holla@arm.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 17 Jan 2018 10:08:27 PST (-0800), sudeep.holla@arm.com wrote: > (Sorry, somehow I missed this email until I saw Jeremy's reply today) > > On 15/01/18 16:07, Palmer Dabbelt wrote: >> On Mon, 15 Jan 2018 04:33:38 PST (-0800), sudeep.holla@arm.com wrote: >>> On Fri, Jan 12, 2018 at 06:59:10PM -0600, Jeremy Linton wrote: >>>> The original intent in cacheinfo was that an architecture >>>> specific populate_cache_leaves() would probe the hardware >>>> and then cache_shared_cpu_map_setup() and >>>> cache_override_properties() would provide firmware help to >>>> extend/expand upon what was probed. Arm64 was really >>>> the only architecture that was working this way, and >>>> with the removal of most of the hardware probing logic it >>>> became clear that it was possible to simplify the logic a bit. >>>> >>>> This patch combines the walk of the DT nodes with the >>>> code updating the cache size/line_size and nr_sets. >>>> cache_override_properties() (which was DT specific) is >>>> then removed. The result is that cacheinfo.of_node is >>>> no longer used as a temporary place to hold DT references >>>> for future calls that update cache properties. That change >>>> helps to clarify its one remaining use (matching >>>> cacheinfo nodes that represent shared caches) which >>>> will be used by the ACPI/PPTT code in the following patches. >>>> >>>> Cc: Palmer Dabbelt >>>> Cc: Albert Ou >>>> Signed-off-by: Jeremy Linton >>>> --- >>>>  arch/riscv/kernel/cacheinfo.c |  1 + >>>>  drivers/base/cacheinfo.c      | 65 >>>> +++++++++++++++++++------------------------ >>>>  include/linux/cacheinfo.h     |  1 + >>>>  3 files changed, 31 insertions(+), 36 deletions(-) >>>> >>>> diff --git a/arch/riscv/kernel/cacheinfo.c >>>> b/arch/riscv/kernel/cacheinfo.c >>>> index 10ed2749e246..6f4500233cf8 100644 >>>> --- a/arch/riscv/kernel/cacheinfo.c >>>> +++ b/arch/riscv/kernel/cacheinfo.c >>>> @@ -30,6 +30,7 @@ static void ci_leaf_init(struct cacheinfo *this_leaf, >>>>          CACHE_WRITE_BACK >>>>          | CACHE_READ_ALLOCATE >>>>          | CACHE_WRITE_ALLOCATE; >>>> +    cache_of_set_props(this_leaf, node); >>> >>> This may be necessary but can it be done as later patch ? So far nothing >>> is added that may break riscv IIUC. >>> >>> Palmer, Albert, >>> >>> Can you confirm ? Also, as I see we can thin down arch specific >>> implementation on riscv if it's just using DT like ARM64. Sorry if >>> I am missing to see something, so thought of checking. >>> >>> [...] >> >> Sorry, I guess I'm a bit confused as to what's going on here.  RISC-V >> uses device tree on all Linux systems. >> > > Good. By thin down, I was thinking of moving the init_cache_level and > populate_cache_leaves implementation of riscv to generic weak function > under CONFIG_OF. You may even endup deleting riscv cacheinfo.c > > Just a thought, sorry for not being clear earlier. OK, well, I'm always happy to convert things to generic implementations.