From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6BD44C87FCB for ; Wed, 6 Aug 2025 20:14:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YKT+avjlebWQpXX2zKp41AgpJn8+eX0xTCaIABgkziE=; b=Nr8BbqcdleBv21s58U0w/bvD5N +n8x9yyPuZ5lNyeOj6IPLP6M89K9BOIrQeRTy+61tHY4a42+clGymfE8keX2i+3t2dYA+GyzoEFQK ufkPQj5zgtZtgJns5Wj1rW3nkdNG8O7uSmGMRbzGgrDWCZJ+P/NNz94FY3v1VuzEzjrZZb4ewSdai WaLGs8Hf9xrG6wCbv7QxxHgg8d1gQPvAtOKlZPbPeEe/4pR954JsNDTBmNJL/VfbYwFzwFXPPVAOc nFzeXGIIufxq+gST7qbYrJxaKNfRjhNnFai6qzQe0/q/oNL7MP2XA7jlEi3tHdHTzOLx+ZKnYRRr4 6GIre8og==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1ujkXF-0000000GMUz-33cM; Wed, 06 Aug 2025 20:14:53 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1ujiUV-0000000G0z5-0ac7 for linux-arm-kernel@lists.infradead.org; Wed, 06 Aug 2025 18:03:56 +0000 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 AB46F176C; Wed, 6 Aug 2025 11:03:46 -0700 (PDT) Received: from [10.1.197.43] (eglon.cambridge.arm.com [10.1.197.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A412A3F738; Wed, 6 Aug 2025 11:03:43 -0700 (PDT) Message-ID: <13398823-bcef-4bda-a6ea-c5ccde49ef6a@arm.com> Date: Wed, 6 Aug 2025 19:03:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 13/36] arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate To: Ben Horgan , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Rob Herring , Rohit Mathew , Shanker Donthineni , Zeng Heng , Lecopzer Chen , Carl Worth , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , 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 References: <20250711183648.30766-1-james.morse@arm.com> <20250711183648.30766-14-james.morse@arm.com> <347c93ec-a645-43fa-a648-88a3d9ace733@arm.com> Content-Language: en-GB From: James Morse In-Reply-To: <347c93ec-a645-43fa-a648-88a3d9ace733@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250806_110355_219023_E41600F4 X-CRM114-Status: GOOD ( 12.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Ben, On 24/07/2025 12:02, Ben Horgan wrote: > On 11/07/2025 19:36, 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. >> >> Start with driver probe/remove and mapping the MSC. >> diff --git a/drivers/platform/arm64/mpam/mpam_devices.c b/drivers/platform/arm64/mpam/ >> mpam_devices.c >> new file mode 100644 >> index 000000000000..5b886ba54ba8 >> --- /dev/null >> +++ b/drivers/platform/arm64/mpam/mpam_devices.c >> @@ -0,0 +1,336 @@ >> +static int mpam_dt_count_msc(void) >> +{ >> +    int count = 0; >> +    struct device_node *np; >> + >> +    for_each_compatible_node(np, NULL, "arm,mpam-msc") > This will count even 'status = "disabled"' nodes. Add a check for that. > > if (of_device_is_available(np))> +        count++; Good spot, fixed - thanks. Thanks, James >> + >> +    return count; >> +}