Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2649645lqo; Tue, 14 May 2024 05:32:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtSe+aOTjqDN2vYvdYK66fpXwT6rQwdy8lXvr86WgAnl6ci7yw5qIa6TXUPKwG+sAcpkg0/3Kk1+9Uq/PTUxlThf3VeRwISAo1iJ4VIw== X-Google-Smtp-Source: AGHT+IEidpY7hE1LNt92fmLD+71DxUFaPAN2jNj+65aKmB8cJe+ZEus4GYJ2WZwYVnumOtErd/pd X-Received: by 2002:a05:622a:110f:b0:43a:f698:2b21 with SMTP id d75a77b69052e-43dfdadff07mr136523561cf.36.1715689972469; Tue, 14 May 2024 05:32:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715689972; cv=pass; d=google.com; s=arc-20160816; b=o8q/6971HN5P8nQCBNlWF9DNor9cdxbYcyIsH36A673r+eK+D4LJ6uWySB8ReoIlZ8 A6+9nQzSqVkMJa9gNWKD2tlfdPF7/rbKrs53m5w2YhGxefmb2BsH0ZcaPAqNq6wLQJfU ItquDty6yNqQ7ZiDdaZfAIY2UEkIW5YtWKLn5DvSFbTY7sbUd2ivzpkxhOSBPjS4YZBx ga2nO3xOxmDZEBtoX9/48r79Y09+/x8lp9AOeeK+VfiT8YlcMEOn/lSTtPycnqSJ+0up n0+KgOOk0M9Wt1+IQPm5ErhAhM05mFMXVDVCGQakLTk6B1c3RTiqnNj+koCDUF9F9fir eA0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=h+Th6xmT1MpeIKC5d/s5VDGWqlNBXzjBRZNOOPTDpeU=; fh=7osyf1H14MsGOkRevWEejQqlYML0oxr0LzZjpQlXM/E=; b=WI4mESLys70+a/r6Yrm2PchaCnhd04wO4Lvikf66j6DV+llOoOfV4hb35DvAv+LAOz GLp7FIpwklKe06fNp+/A23P6kDhHmGJssMrEB2DOReSCLJlDDU49T0JyIo4KiQe7waFe mFI2bIXkmnQFFe7O01yJKsP3LAqbw7HmXZK8BAUgk4+gt/tBQit7Xj7zFu2DcylrFQOd PUi/Cpo+D/EQJA7atmxj+pArqbkxG43ceDHjBdLQ2LxRfvEaG4I0floFg+bYum0mNa7G Frmug7RdpUFxCTaj/8ofJWsdgZsZQ6W3bKou8IYhj1H7cyFbb7sTsAI86DFGoc7eON5P Nusw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=qTpZKrBA; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-178660-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178660-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43e265e055fsi18515181cf.507.2024.05.14.05.32.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 05:32:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178660-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=qTpZKrBA; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-178660-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178660-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CD41A1C20AE1 for ; Tue, 14 May 2024 12:32:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EDF8E6311D; Tue, 14 May 2024 12:32:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="qTpZKrBA" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8335E433CE for ; Tue, 14 May 2024 12:32:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715689965; cv=none; b=V5YzelkuSCTdelbHlj5CJpgHcnpuMsjynp4pkgodcHLoK1hhILsk6wOHYNLTD0e/6EZkoBmvYysxcANU94bm3qvePd0KM/5oo5s90sw0o9008PiONW2RGhmJRHYdao70HVh6rnLGgQsUOSpLMGOIgqOrHq6RYK4lzuUEwrEm69E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715689965; c=relaxed/simple; bh=I9pm5ltuRP7CtyZZABgcYsllXH5JG+kEGVHyLkkT8pU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=r8/1Dv5a50QdG4gKnVN6vXzPgipeUD1O472zlujcYLAiDyg8SF/kW/MqppGNcJ6/HmzhGFRqGNztMfLh0hHJSzVDBavrDIPwwv9Z4zk0EDJc4EeAfcYuKs2Gxv74NPHQZtGJgXTShnNnYC9UfzRLk3YZGJd7NJihUTikJW6Slis= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=qTpZKrBA; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Content-Disposition: In-Reply-To:References; bh=h+Th6xmT1MpeIKC5d/s5VDGWqlNBXzjBRZNOOPTDpeU=; b=qT pZKrBAljR+2Owa6RKVtxjKAzMYjwXytVqkeIpY5BkVuJUEl59DrqAKLOmbEo6oXlDDkHo9syWsygS 6l9ksWDUvF10kPaiXjKi+p96bJnJIaV/HACVPSUgi1CBMWyz5olSWpgC/8dutZi1QL7XrUPpaBs3h mPVd9BbSLRFnS4g=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1s6rKi-00FO2N-E8; Tue, 14 May 2024 14:32:40 +0200 Date: Tue, 14 May 2024 14:32:40 +0200 From: Andrew Lunn To: Stephen Langstaff Cc: Florian Fainelli , linux-kernel@vger.kernel.org, OlteanV@gmail.com Subject: Re: drivers/net/dsa/dsa_loop_bdinfo.c build problems Message-ID: References: <7efffaa0-6330-4b01-b3d2-63eb063cbbb0@gmail.com> <212a9464-d52b-4730-95b9-5a0aebd38c91@gmail.com> <688e54ec-3b29-4e3b-a2c3-f2c83b9c97b7@lunn.ch> <732d8bb2-1d4f-4958-b130-0bd15a407271@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, May 14, 2024 at 10:28:55AM +0100, Stephen Langstaff wrote: > On Mon, May 13, 2024 at 8:05 PM Florian Fainelli wrote: > > Attached is a configuration that I use on a x86-64 VM for testing that > > is started with: > > That's kind of what I expect to be happening on my target, but it's not. > > I notice that your configuration does not define CONFIG_FIXED_PHY as > either a module or built-in - could that explain both the fact that my > dsa_loop_bdinfo.c does not get compiled when using the default > Makefiles, and that if I force compilation to a module it does not > appear to create the expected lanX@eth0 interfaces? > > I have added some printk debug lines to the dsa_loop_init and > dsa_loop_drv_probe functions, and only see the one from the init > function, which makes me suspect that something is stopping the probe > from happening - I assume this should happen when the dsa_loop_bdinfo > module is inserted? > > root@machine:~/dsa_test# ls > dsa_loop.ko dsa_loop_bdinfo.ko > > root@machine:~/dsa_test# modprobe dsa_core > root@machine:~/dsa_test# > > root@machine:~/dsa_test# insmod dsa_loop_bdinfo.ko > [ 51.742367] dsa_loop_bdinfo_init > > root@machine:~/dsa_test# insmod dsa_loop.ko > [ 58.485104] dsa_loop_init This is probably an ordering problem. dsa_loop_bdinfo calls mdiobus_register_board_info() with the bus_id "fixed-0". That call adds it to a linked list, but does nothing else. mdiobus_setup_mdiodev_from_board_info() is what walks the linked list and sees if an MDIO bus matches the ID, and if so, calls the callback to add a device to the bus. mdiobus_setup_mdiodev_from_board_info() is only called from __mdiobus_register(). So the boardinfo needs to be registered before the bus is registers. The other way around does not work. So try to making FIXED_PHY = m, and load it after dsa_loop_bdinfo.ko. Andrew