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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37D42C6FD1D for ; Mon, 20 Mar 2023 05:38:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229646AbjCTFiF (ORCPT ); Mon, 20 Mar 2023 01:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjCTFiC (ORCPT ); Mon, 20 Mar 2023 01:38:02 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9E27E6EBA; Sun, 19 Mar 2023 22:38:00 -0700 (PDT) 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 848C9FEC; Sun, 19 Mar 2023 22:38:43 -0700 (PDT) Received: from [10.162.41.7] (a077893.blr.arm.com [10.162.41.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 61EE93F67D; Sun, 19 Mar 2023 22:37:54 -0700 (PDT) Message-ID: <6ac7d093-b11c-b37f-8058-72c8d41fba73@arm.com> Date: Mon, 20 Mar 2023 11:07:51 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH 6/7] of/platform: Skip coresight etm4x devices from AMBA bus Content-Language: en-US To: Suzuki K Poulose , Rob Herring Cc: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, scclevenger@os.amperecomputing.com, Frank Rowand , Russell King , Greg Kroah-Hartman , "Rafael J. Wysocki" , Len Brown , Sudeep Holla , Lorenzo Pieralisi , Mathieu Poirier , Mike Leach , Leo Yan , devicetree@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230317030501.1811905-1-anshuman.khandual@arm.com> <20230317030501.1811905-7-anshuman.khandual@arm.com> From: Anshuman Khandual In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/17/23 21:33, Suzuki K Poulose wrote: >>>   drivers/of/platform.c | 10 +++++++++- >>>   1 file changed, 9 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/of/platform.c b/drivers/of/platform.c >>> index b2bd2e783445..59ff1a38ccaa 100644 >>> --- a/drivers/of/platform.c >>> +++ b/drivers/of/platform.c >>> @@ -325,6 +325,13 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l >>>          return NULL; >>>   } >>> >>> +static const struct of_device_id of_ignore_amba_table[] = { >>> +#ifdef CONFIG_CORESIGHT_SOURCE_ETM4X >>> +       { .compatible = "arm,coresight-etm4x" }, >>> +#endif >>> +       {}    /* NULL terminated */ >>> +}; >>> + >>>   /** >>>    * of_platform_bus_create() - Create a device for a node and its children. >>>    * @bus: device node of the bus to instantiate >>> @@ -373,7 +380,8 @@ static int of_platform_bus_create(struct device_node *bus, >>>                  platform_data = auxdata->platform_data; >>>          } >>> >>> -       if (of_device_is_compatible(bus, "arm,primecell")) { >>> +       if (of_device_is_compatible(bus, "arm,primecell") && >>> +           unlikely(!of_match_node(of_ignore_amba_table, bus))) { >> >> of_match_node is going to take orders of magnitude longer than any >> difference unlikely() would make. Drop it. > > Agreed. Sure, will drop the unlikely() here.