Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp689235rwd; Thu, 25 May 2023 02:26:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zChdzv+2H74dEr/EM3t6X6M8SfNnSiN1HbhuZrpOroXXHx6NE9jCr0Sup0+hENnsm3s9F X-Received: by 2002:a17:902:758c:b0:1ad:c627:87de with SMTP id j12-20020a170902758c00b001adc62787demr968271pll.32.1685006812860; Thu, 25 May 2023 02:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685006812; cv=none; d=google.com; s=arc-20160816; b=CK4bXfcERK5SwA+E4W64mv8KoGP9uPyXxq3KZPquFk8evoZVaMXgRZ56z3NoOecA9W UI7mQOJbHONae8CnStFNjf/K7mfe6OKDIG6NOAw7TWoX/jbasY89SSDGQNhR2B6kHrk/ 5RhE4OIn+pGp5p3TTjV9pxw7NYRWrJAhat0p6+EYdL6ayzYokHXL/Ggj0Lx2N8y1VPQc ms78OI0mSCtJ6iI+OcBHE7FL6rDQfcG2rciBaHJRp8e1cdJRkik8gh1UCmIC2qgrZAkf SkMetv1tjirBalu63Vgd5l54k1AL+9VEhi3y2IX1joiO/+sxmVsXUeZoO0jHTY7TstIq 4ffQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=8AnUzsP3UiJT5MlwCjsZ+EyBtgzsenG9IYcBknz1kBQ=; b=fKp9uf0X39Z0mPrywgwaGBc2YM1hV02o5ngtauDiTlj/5yzlr2HAsWVhpkEupvxaaa W5BUipwJBDYILcvzfleKiN71zlDvU/pLSmJ3TNDTWe8OMs6gpHcodARxn1lCVZU5dtQS NGYax4tlZiZsfoPeLu5qSgxZSSsM3tp6f3ovZ2t3uq17/ju45KMJRMvzar8RkAqa36OD a/XfA8ycdapK+b7dGgPX18Lyr2RhXbQPyq7pTAbpd5yDrzmwjy1Xz7ebXcBRyJnO5AWx nCpd1akufBfA2IU4cZlsyYXUuFJIXc66VuXkGlN+1AL7ewWZv67mV/34NNwNomNDKMqt tmrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=U2M8IBLi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l1-20020a170902ec0100b001a6b6085041si1018369pld.512.2023.05.25.02.26.40; Thu, 25 May 2023 02:26:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=U2M8IBLi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240373AbjEYJEk (ORCPT + 99 others); Thu, 25 May 2023 05:04:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239674AbjEYJEi (ORCPT ); Thu, 25 May 2023 05:04:38 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5963199; Thu, 25 May 2023 02:04:36 -0700 (PDT) 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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