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 EA40DC7EE2C for ; Thu, 25 May 2023 09:05:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uuyLtSF9MdpLze3jaAlqB/y5AappZ6WxAX6QHobkpUU=; b=rpwJbuJ+oRnkEk duqjk5j2nt+1MGCIDtMLKFfvj36SeZ2yRRO8uSVAau99Q5NxttDesbqTFgbew/x+sg113u2Sc5u+Z DDoeHzQs0Sl4Tu1tDJ8ahsI5qnL0wS8dCTsihmD1gKX1wHPCJ/m8vpYTHt0oJIF2LV30zE49ueMmp H/24N2EfQTGXYsrp0ieNyICqjQhd6RwpdCq1DLhlgbP7FDh2wvO66UIG6091i2WU1Zpj1zc01OQal FnL6/IilqF04In3ma8AlkmJovI4CUd4z77DidQ0Nwu9XzmMRpEKcbsPFvpRTz1y/bN3/9gO/CsiPK srH2jEbVEfrzUdIKsR9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q26tl-00G5MY-26; Thu, 25 May 2023 09:04:41 +0000 Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q26ti-00G5Lv-2v for linux-arm-kernel@lists.infradead.org; Thu, 25 May 2023 09:04:40 +0000 Received: (Authenticated sender: maxime.chevallier@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 3DCB460013; Thu, 25 May 2023 09:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1685005475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8AnUzsP3UiJT5MlwCjsZ+EyBtgzsenG9IYcBknz1kBQ=; b=U2M8IBLinR/uVFzSNOYp/JLVIV4pHW8pufMV2Zwvzee1LzdOwuJE1bMW6bWaMWJsNDmvSp x/3aTpevugcHU38/xepiBW7Sze2R82WDfkHxpB5skOSFvbT44byBFf+Q6dMFT2/F7N2huE Lds8/8E4zgK67x7VwXM6Y/DKtOlxlePfu8vDsCtGWfk/uAbDDltY1kFBWMIhP+gBN6hAI4 jCozUHi3CGSgjNaz5ey+RK3dPL2f1EAqo7kivOGX3oiZT03/W+/WNraV6IZzr8uw2acXk0 7klvjDcM+HPd7bnQjcAnHzpowAxnzoRK1Iid2cTwu8rRXSmDvx0mp2ZIkxZ4oQ== Date: Thu, 25 May 2023 11:04:29 +0200 From: Maxime Chevallier To: Vladimir Oltean Cc: Andrew Lunn , Mark Brown , davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, alexis.lothore@bootlin.com, thomas.petazzoni@bootlin.com, Jakub Kicinski , Eric Dumazet , Paolo Abeni , Florian Fainelli , Heiner Kallweit , Russell King , Ioana Ciornei , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Maxime Coquelin , Jose Abreu , Alexandre Torgue , Giuseppe Cavallaro Subject: Re: [PATCH net-next 1/4] net: mdio: Introduce a regmap-based mdio driver Message-ID: <20230525110429.66ba241b@pc-7.home> In-Reply-To: <20230524174145.hhurl4olnzmfadww@skbuf> References: <20230524130807.310089-1-maxime.chevallier@bootlin.com> <20230524130807.310089-2-maxime.chevallier@bootlin.com> <8f779d98-d437-4d8b-914d-8e315b4aca17@lunn.ch> <20230524174145.hhurl4olnzmfadww@skbuf> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230525_020439_135338_CC6C77A7 X-CRM114-Status: GOOD ( 16.65 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Vlad, Andrew, On Wed, 24 May 2023 20:41:45 +0300 Vladimir Oltean wrote: > On Wed, May 24, 2023 at 07:30:51PM +0200, Andrew Lunn wrote: > > > + mii->name = DRV_NAME; > > > + strscpy(mii->id, config->name, MII_BUS_ID_SIZE); > > > + mii->parent = config->parent; > > > + mii->read = mdio_regmap_read_c22; > > > + mii->write = mdio_regmap_write_c22; > > > > Since there is only one valid address on the bus, you can set > > mii->phy_mask to make the scanning of the bus a little faster. Good point, I'll add that. > Sorry, I didn't reach this thread yet, I don't have the full context. > Just wanted to add: if the caller knows that there's only a PCS and > not a PHY on this bus, you don't want auto-scanning at all, since > that will create an unconnected phy_device. It would be good if the > caller provided the phy_mask. As there can only be one mdiodevice on that bus, and we are already passing the address of the only available device in struct mdio_rgmap_config.valid_addr, I guess we can simply add a flag to indicate if autoscan needs to be enabled or not, and set phy_mask to either unmask the only valid address, or plain ~0UL if we don't want autoscan at all. Thanks both of you for the reviews, Maxime _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel