Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp193251rdb; Tue, 5 Dec 2023 02:50:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMa19r2EzHKQlIFTUikaxBMk+to7wEbjDduJFPe2UM9XJsA0jEFfoSBdzk/q4ujyvSQvOG X-Received: by 2002:a9d:65cc:0:b0:6d8:4690:d8b9 with SMTP id z12-20020a9d65cc000000b006d84690d8b9mr5721141oth.30.1701773420100; Tue, 05 Dec 2023 02:50:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701773420; cv=none; d=google.com; s=arc-20160816; b=m1GDDA5KA/6YMxI2PbSyBZ3CQBRZUIIYPR+c3car+tJ6VrkFPqzZ09Rj0foqzt2XUb IQQ0r5ywZKzszfYcZ4zkw+KUp6AhxVJutYjeyvlwiIxjkHMlvi42L2tgE/e7cMrtGQG7 Hqir2x/HXrehB8IYjpRN9BaMwSLyDNFBsihC6Hr6QoSbQfxud8bl/CA+7KUYvr4/oChq 28eZeOrzOV95Mh1GL2KhFXnAQAUBuBY2DGI4nJsPxv+Rj8iGzoKH3WP9nAchUUv53ABY 3/YP/baSpjXQ1uqBpUmMFf+rCgDTJZkA+G2ZF+mf7YzlMytb3KpoXjARKKGFG1We20RQ lJFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Upnjb/CtjXa7Ifq7kmJI62+mAm9o5YlGesjj/UWinbA=; fh=0CjR/P59gkS3RoA1MzYD3TAB1GMUolY2z17tQE+puF0=; b=RoFLPT/DRj3BjnfmJ1rXCyEAck5Szntw5EvzqAwK16J7uHcfSytP3qffY6M1rMY8A/ ZPi0bORU/7+3SvjwxYck8t/kfFuU+CqO5RQg7rjq18y8rRildq82mRBYBo1o7BzXKCac UVzM9g0nn1U8CNNWSmvIOf3d+BMbBuKcZfjwgd1kMCFVzk9Hjs4SLqJ6hc2BNR1gzYLl jXFOhqXqEAYkYw7DQgyH32oUHpBko7rDa46pCNpMtVMTdTUSboGP0lIeVl9FoFIJwqwl bLO1doydil96rReCEBo55dca9FZedcalCvmCFtKi/om2Znwz00bziMgxR4tTb4FEXDJq WCiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=duogcorQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id r22-20020a632056000000b0056fbf85c743si9010707pgm.790.2023.12.05.02.50.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 02:50:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=duogcorQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0CEE280BBE8D; Tue, 5 Dec 2023 02:50:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376731AbjLEKuG (ORCPT + 99 others); Tue, 5 Dec 2023 05:50:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376672AbjLEKuD (ORCPT ); Tue, 5 Dec 2023 05:50:03 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFDA7116; Tue, 5 Dec 2023 02:49:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender: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-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Upnjb/CtjXa7Ifq7kmJI62+mAm9o5YlGesjj/UWinbA=; b=duogcorQ4P8zl3J8qpazL8Dgj0 gHnjMJldEDLL/hRu89DsHHSe3nLkNLmgqQrqgETe/jTgORfz66dwyn/MNnL9AXKCZiLgwWoUm9bDA e2WdwdhsAXEi+bDtljNF7S+HBTPUb8khY0RpR427YJ3T/hQ/jGBeCl41qzTZcYl/1M96s6k8XVpvq gnmWfAp0NmIzWX5pau2JVLlDP03b/KePZYtrhMeCc8MWjV0kwFS9a7WFL+W1+s7mYPqE+eP83rDXo R4WqtqGhans10+bH8ntaaXL/pWeqN458OXnYwsNGpce4IYqQI1nRXFPflwNsXLyZFy5ETN5ITCgxY CHgwHrXA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:60944) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rASzq-0006ds-1N; Tue, 05 Dec 2023 10:49:46 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rASzr-0001e3-Hy; Tue, 05 Dec 2023 10:49:47 +0000 Date: Tue, 5 Dec 2023 10:49:47 +0000 From: "Russell King (Oracle)" To: Serge Semin Cc: Andrew Lunn , Heiner Kallweit , Alexandre Torgue , Jose Abreu , Jose Abreu , Maxime Chevallier , Tomer Maimon , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , openbmc@lists.ozlabs.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 06/16] net: pcs: xpcs: Avoid creating dummy XPCS MDIO device Message-ID: References: <20231205103559.9605-1-fancer.lancer@gmail.com> <20231205103559.9605-7-fancer.lancer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231205103559.9605-7-fancer.lancer@gmail.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 05 Dec 2023 02:50:19 -0800 (PST) On Tue, Dec 05, 2023 at 01:35:27PM +0300, Serge Semin wrote: > If the DW XPCS MDIO devices are either left unmasked for being auto-probed > or explicitly registered in the MDIO subsystem by means of the > mdiobus_register_board_info() method there is no point in creating the > dummy MDIO device instance in order to get the DW XPCS handler since the > MDIO core subsystem will create the device during the MDIO bus > registration procedure. Please reword this overly long sentence. If they're left unmasked, what prevents them being created as PHY devices? > @@ -1437,19 +1435,21 @@ struct dw_xpcs *xpcs_create_mdiodev(struct mii_bus *bus, int addr, > struct mdio_device *mdiodev; > struct dw_xpcs *xpcs; > > - mdiodev = mdio_device_create(bus, addr); > - if (IS_ERR(mdiodev)) > - return ERR_CAST(mdiodev); > + if (addr >= PHY_MAX_ADDR) > + return ERR_PTR(-EINVAL); > > - xpcs = xpcs_create(mdiodev, interface); > + if (mdiobus_is_registered_device(bus, addr)) { > + mdiodev = bus->mdio_map[addr]; > + mdio_device_get(mdiodev); No, this makes no sense now. This function is called xpcs_create_mdiodev() - note the "create_mdiodev" part. If it's getting the mdiodev from what is already there then it isn't creating it, so it's no longer doing what it says in its function name. If you want to add this functionality, create a new function to do it. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!