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 5EB41D2C552 for ; Tue, 22 Oct 2024 13:41:15 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uw8layF2OfEF0dY1yp2NndYd5sSs234S0ck4HB9LZNw=; b=SudEQg+3jcphR2FaPz9LlxYbv2 5lG2CH3MGcQEwKLOMojW4Y/Qn/gvbxQiXDIcAT+223SgU1C108Y5YFUGqTPlC1dg9GFu13YqpDqsP ceEFA6n+GVHOpJW1sk33HTOxlKutMX8jTeHT2zfaMH7usorpLtr3RL4EfMm5QT+G8S17qZBeb/duw Ta3/T68FomN7PcCGh7FE7D46qZRbmZEEDfGBNNBqcWy0jlkqSlPJODIzQkS+L4Lhbxe2lVI1eqQDH AXoSzfZSzROwghj6htxCtM/xdmqwr8PpaVDEJpwhBynSOkDJ+QI1Di2UJL/Ap4uIBIfGA0ELQA5Vc nnlSb0bA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3F8C-0000000AzHu-2S5h; Tue, 22 Oct 2024 13:41:04 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3F2a-0000000AyH2-27hB for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2024 13:35:18 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 02C815C5B37; Tue, 22 Oct 2024 13:35:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB5CAC4CEC3; Tue, 22 Oct 2024 13:35:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729604115; bh=qDbw4iQAOpQcGNeHy6beNAJP98MdOCI+be23tNCoFSk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r85hpzFNcYJqa8q/mviguSa8hDJYzLTzeJAPiQFXlUVRQO/iPeQySWCnb9POflz/I /uG/FD5LLBLcg2c7xme06K+s+xSuX+YpSeW1+WmxdQj4Z/aLFSSVAcpRY/UgXaBAJQ jrdA3vaFo8FRCm3ZmX++XCObdMhQyHNLis286B1sQ5IxPEec45N0kDO6d3bowNnwhq dsUfJWA3ILOSK3uvtlRQKByZskt5Bk0eLIe7VZnZb70lrV9dolnbeAMf7/hxWlwaih 2QclJG/qTUnCO18VkLbg7kRGRyebQrH1L/eVXsF5QJJKZ4qo3TJknrvCManli0k+JE Yx9QtFmW02nWQ== Date: Tue, 22 Oct 2024 14:35:08 +0100 From: Simon Horman To: Daniel Machon Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , andrew@lunn.ch, Lars Povlsen , Steen Hegelund , horatiu.vultur@microchip.com, jensemil.schulzostergaard@microchip.com, Parthiban.Veerasooran@microchip.com, Raju.Lakkaraju@microchip.com, UNGLinuxDriver@microchip.com, Richard Cochran , Rob Herring , Krzysztof Kozlowski , Conor Dooley , jacob.e.keller@intel.com, ast@fiberby.net, maxime.chevallier@bootlin.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH net-next 14/15] net: sparx5: add compatible strings for lan969x and verify the target Message-ID: <20241022133508.GT402847@kernel.org> References: <20241021-sparx5-lan969x-switch-driver-2-v1-0-c8c49ef21e0f@microchip.com> <20241021-sparx5-lan969x-switch-driver-2-v1-14-c8c49ef21e0f@microchip.com> <20241022085050.GQ402847@kernel.org> <20241022120842.uf575qwaulufjyv6@DEN-DL-M70577> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241022120842.uf575qwaulufjyv6@DEN-DL-M70577> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241022_063516_665758_F4E1393D X-CRM114-Status: GOOD ( 36.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 On Tue, Oct 22, 2024 at 12:08:42PM +0000, Daniel Machon wrote: > Hi Simon, > > > > Add compatible strings for the twelve lan969x SKU's (Stock Keeping Unit) > > > that we support, and verify that the devicetree target is supported by > > > the chip target. > > > > > > Each SKU supports different bandwidths and features (see [1] for > > > details). We want to be able to run a SKU with a lower bandwidth and/or > > > feature set, than what is supported by the actual chip. In order to > > > accomplish this we: > > > > > > - add new field sparx5->target_dt that reflects the target from the > > > devicetree (compatible string). > > > > > > - compare the devicetree target with the actual chip target. If the > > > bandwidth and features provided by the devicetree target is > > > supported by the chip, we approve - otherwise reject. > > > > > > - set the core clock and features based on the devicetree target > > > > > > [1] https://www.microchip.com/en-us/product/lan9698 > > > > > > Reviewed-by: Steen Hegelund > > > Signed-off-by: Daniel Machon > > > --- > > > drivers/net/ethernet/microchip/sparx5/Makefile | 1 + > > > .../net/ethernet/microchip/sparx5/sparx5_main.c | 194 ++++++++++++++++++++- > > > .../net/ethernet/microchip/sparx5/sparx5_main.h | 1 + > > > 3 files changed, 193 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/net/ethernet/microchip/sparx5/Makefile b/drivers/net/ethernet/microchip/sparx5/Makefile > > > index 3435ca86dd70..8fe302415563 100644 > > > --- a/drivers/net/ethernet/microchip/sparx5/Makefile > > > +++ b/drivers/net/ethernet/microchip/sparx5/Makefile > > > @@ -19,3 +19,4 @@ sparx5-switch-$(CONFIG_DEBUG_FS) += sparx5_vcap_debugfs.o > > > # Provide include files > > > ccflags-y += -I$(srctree)/drivers/net/ethernet/microchip/vcap > > > ccflags-y += -I$(srctree)/drivers/net/ethernet/microchip/fdma > > > +ccflags-y += -I$(srctree)/drivers/net/ethernet/microchip/lan969x > > > diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c > > > index 5c986c373b3e..edbe639d98c5 100644 > > > --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c > > > +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c > > > @@ -24,6 +24,8 @@ > > > #include > > > #include > > > > > > +#include "lan969x.h" /* lan969x_desc */ > > > + > > > > Hi Daniel, > > > > Perhaps this will change when Krzysztof's comment elsewhere in this thread > > is addressed. But as it stands the construction in the above two hunks > > appears to cause a build failure. > > > > CC drivers/net/ethernet/microchip/sparx5/sparx5_main.o > > In file included from drivers/net/ethernet/microchip/sparx5/sparx5_main.c:27: > > ./drivers/net/ethernet/microchip/lan969x/lan969x.h:10:10: fatal error: sparx5_main.h: No such file or directory > > 10 | #include "sparx5_main.h" > > | ^~~~~~~~~~~~~~~ > > > > My preference would be to move away from adding -I directives and, rather, > > use relative includes as is common practice in Networking drivers (at least). > > > > ... > > > > -- > > pw-bot: changes-requested > > I didn't see this build failure when I ran my tests, nor did the NIPA > tests reveal it. I can only reproduce it if I point to the microchip > subdir when building - but maybe that's what you did too? > > Anyway, I will skip the -I includes and resort to relative includes, as > per your request. Thanks. Thanks Daniel, Yes I did see the problem when pointing to the subdir. But I was also able to see it without doing so when using a config based on tinyconfigi on x86_64. I can dig further if you like, or provide that config. But I did see that relative includes (or an extra -I) resolved the problem.