Received: by 10.223.148.5 with SMTP id 5csp6159375wrq; Wed, 17 Jan 2018 10:09:59 -0800 (PST) X-Google-Smtp-Source: ACJfBouAQ94C+gsA7J6pQmGOL1ScTPAUuG0fUVvDO4RHeXmJcrDPTkkD/pPBWwuGax3knlJo+fC1 X-Received: by 10.124.22.142 with SMTP id v14mr37208549ply.241.1516212599494; Wed, 17 Jan 2018 10:09:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516212599; cv=none; d=google.com; s=arc-20160816; b=Go/YRsb5KK7cPAGemUPC5FZAffcE7Jjru8FV0D5OXBkpbkO7WVyo07zGOP3toio6iu BFMIyifv7MUzgHPz9B816e3kHVP5/u6mqbgsvd4ufLIzZMNYRnkLbEKSq28RH5kSGBR5 blpD73q56B+5J8TJpfSGQy2eNKvqZ9eWYkXZ200hdjeCYaiZZAzbKOcm1Itm+2+hL32y pFy1LfiY+ylBfWt+0KxX3M8DL02zwL5Xry3pvXA36twpDTbkYC6uIdH9Y4EdrPiZxeMy nCPYMq6pxJXd9pckMD/JnCwF1Cs0jtXW3SlwnGhGROGfbLTWGSYHJzGqwlFiH9Bfk2l3 zA4Q== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:to:subject:cc :arc-authentication-results; bh=R59jG3CuAco25FvniLSCWahkpFIYGq51q2DE8oi/n+4=; b=MGWIONHpqCgaNr5Z7UFDlbRSLISFXhFE6cB+azJIPfckNzZq2M2gYMuvo4WQdqP4bd Hp053kzCwYGmgOoKP+hzojcOA9LeN7sx/IEpADRFOGhN9uOLAC9OJ1N1tQLBmUMUJVNo EP1hJSCMezOtu28QUYdT1k69Pgi5h6Ah4hUDVRUt+JbCZb5C7hTCc659yALJXs6bQRJe iA2adJX0WakHLOM1rL3DuyUwVo1RhkT1DLnnV3QGv4r8YnUlQsb5S1zBvO7KGL6qlFsM 3OJcretVcOksuL/YwDEsM6kRchDUTkyMat3pCGid9GodRLDwDZKu9I6/xsb64A1CLllV hI4Q== ARC-Authentication-Results: i=1; mx.google.com; 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 c11si2858822pls.10.2018.01.17.10.09.44; Wed, 17 Jan 2018 10:09:59 -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; 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 S1754104AbeAQSIg (ORCPT + 99 others); Wed, 17 Jan 2018 13:08:36 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45612 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752578AbeAQSIe (ORCPT ); Wed, 17 Jan 2018 13:08:34 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 497AF80D; Wed, 17 Jan 2018 10:08:34 -0800 (PST) Received: from [10.1.210.28] (e107155-lin.cambridge.arm.com [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B607A3F53D; Wed, 17 Jan 2018 10:08:29 -0800 (PST) Cc: Sudeep Holla , 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 Subject: Re: [PATCH v6 02/12] drivers: base: cacheinfo: setup DT cache properties early To: Palmer Dabbelt References: From: Sudeep Holla Organization: ARM Message-ID: Date: Wed, 17 Jan 2018 18:08:27 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (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. -- Regards, Sudeep