From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90C2629B20A; Fri, 5 Sep 2025 18:52:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757098366; cv=none; b=DbCZrU5QjzZ9B4UogkxIqcO+mk+vgOMVt0amqwJLUWD9DRIHn3waeSpRQ2qIFRlWG7PzyexnzegPbHC+G1XxDYCHTX0tZaTuOn7aR6j0CYFKOYHDBo0wzyfX1jqqgxKZPdlklcZ4w8c0Kvqeg8LYhL2+9C4p4E/OWKfeXFYeOz8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757098366; c=relaxed/simple; bh=6D2aVBqqBKV07BwAyUrhJdhm3+fz0a7BNgGgi1w1Y8E=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=m/0vYEq4kSsNQrpGVpy3a8UGtoJB4WleiSuLr7EmaKV/rsUjXnvONsKEP+ZT9H2tgrcsp0bu2mUtzyqYLCy27GLQbmftHswxFMSUG7XBRQIVeuzv0GOQidhu7QtIKtJgBP8SzJ6T72jtdF5MjQYoOqZ7pCrweotkP3Cottynn2Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7E1241BC0; Fri, 5 Sep 2025 11:52:35 -0700 (PDT) Received: from [10.1.197.69] (unknown [10.1.197.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 28DB93F6A8; Fri, 5 Sep 2025 11:52:38 -0700 (PDT) Message-ID: Date: Fri, 5 Sep 2025 19:52:36 +0100 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 10/33] arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate To: Rob Herring Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, devicetree@vger.kernel.org, shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand , Rex Nie , Dave Martin , Koba Ko , Shanker Donthineni , fenghuay@nvidia.com, baisheng.gao@unisoc.com, Jonathan Cameron , Rohit Mathew , Rafael Wysocki , Len Brown , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Greg Kroah-Hartman , Danilo Krummrich References: <20250822153048.2287-1-james.morse@arm.com> <20250822153048.2287-11-james.morse@arm.com> Content-Language: en-GB From: James Morse In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Rob, On 27/08/2025 17:16, Rob Herring wrote: > On Wed, Aug 27, 2025 at 10:39 AM Rob Herring wrote: >> >> On Fri, Aug 22, 2025 at 10:32 AM James Morse wrote: >>> >>> Probing MPAM is convoluted. MSCs that are integrated with a CPU may >>> only be accessible from those CPUs, and they may not be online. >>> Touching the hardware early is pointless as MPAM can't be used until >>> the system-wide common values for num_partid and num_pmg have been >>> discovered. > > [...] > >>> +static int mpam_dt_parse_resources(struct mpam_msc *msc, void *ignored) >>> +{ >>> + int err, num_ris = 0; >>> + const u32 *ris_idx_p; >>> + struct device_node *iter, *np; >>> + >>> + np = msc->pdev->dev.of_node; >>> + for_each_child_of_node(np, iter) { >> >> Use for_each_available_child_of_node_scoped() >> >>> + ris_idx_p = of_get_property(iter, "reg", NULL); >> >> This is broken on big endian and new users of of_get_property() are >> discouraged. Use of_property_read_reg(). > > Err, this is broken on little endian as the DT is big endian. > > So this was obviously not tested as I'm confident you didn't test on BE. 'not tested' is shades of grey. I fed the FVP ~6 different DTB files to hit the different paths through the driver. The FVP only has controls under RIS-0, so all of those only defined RIS-0, and unsurprisingly didn't notice the helper isn't endian safe. Thanks, James