Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1352722pxb; Thu, 24 Mar 2022 18:30:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvkZ+AYV3CcDUbJjVwQAxrFUH2Rw6Ixt6ElBCjQ1hCcjNmFJwnfguhcBvU2h7Jzq/AiuhN X-Received: by 2002:a17:90b:4a12:b0:1c7:5aa4:2a72 with SMTP id kk18-20020a17090b4a1200b001c75aa42a72mr9676469pjb.201.1648171854750; Thu, 24 Mar 2022 18:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648171854; cv=none; d=google.com; s=arc-20160816; b=hZ2ge3aMWF7YVcAdmpD5fe2/1CSEOLpxxDB5pmOETK3/rO/dxaAh3/qR9D89A0TixD KoQI/CTBEdqjkoBaGQ+dd8trbZ8VmEJwevlD/A9xsibj8ATkD81v+yOHnFFzz1D2OVJW Kz2brVh5zwbUaBgXCHQ4eZyx3JprzCGxLDjz3TvBKYa4KiXVYkzmPgwMKvDV7wl9bk8S 2VcHI6URq8JHfI2obd3n/Hd4wmwcYnyc8a2gdgc11HIHhIjXlF9eulHcTuQyxJY6bQXz He+JucMwLSzwiXHnBnezpv9ppY9eyc83fYhbOCGDp4Kj/Skg/JDmTLCHDc2WzspoxAck ZiUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=EXspul3bxV1ROddHWUH5dYvmEAgYPmadkfO6M4GEFq4=; b=RT5waI5wGEE/+ExQe1Hh2ur0zkrlA2ksjgV00IpMQgRxZL7kkPrztao5RC0o452fGY cdbcKILb1XiYHN4sZFiOWHGe8UN/MdjQFu74jMtSV8sx+ayHOrfH8kZoBh+InQvt+pZi dCyUE+YadIefPGNYJw1perKQrEyMlxULfosxEkpH8orjgMYsrqhGEuanB0lNS5u5saeH 2sEzPoh3wN5ayjiI7KgHk4TniPYQPyo8sqffDghrDuoaye+c/hw8Lg6QQARqHZAxJiRT 0m04M7N8h/N2wTiPzAbxafWHMTwTkt9WatnXStWRgc0Xzk7e2SDIYCC/hb1HfIr+a8OZ /QZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=dVeofnZ+; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z185-20020a6233c2000000b004fa3a8dfff2si1143611pfz.169.2022.03.24.18.30.39; Thu, 24 Mar 2022 18:30:54 -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=@lunn.ch header.s=20171124 header.b=dVeofnZ+; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344330AbiCWTl3 (ORCPT + 99 others); Wed, 23 Mar 2022 15:41:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240358AbiCWTl2 (ORCPT ); Wed, 23 Mar 2022 15:41:28 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B9345749C; Wed, 23 Mar 2022 12:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To: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=EXspul3bxV1ROddHWUH5dYvmEAgYPmadkfO6M4GEFq4=; b=dVeofnZ+TOMTdO2uLMs5Upulco bGum5lnQdTfrlAcA64OHzpfybLu6QbuJzHJk+s/exqbrOBOwCz6Nex/JkRHywxZ8qzSVRK7KEdHs8 HphUmRaKIBVbZRBdIx4Yv5mQCeRR248aQTGrMO5OsL+oRCs8yqtPDKZbx6krQOUZYEgU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nX6pg-00CKi9-2T; Wed, 23 Mar 2022 20:39:48 +0100 Date: Wed, 23 Mar 2022 20:39:48 +0100 From: Andrew Lunn To: Michael Walle Cc: Heiner Kallweit , Russell King , Jakub Kicinski , Paolo Abeni , "David S . Miller" , Xu Liang , Alexandre Belloni , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC net-next 2/5] net: phy: support indirect c45 access in get_phy_c45_ids() Message-ID: References: <20220323183419.2278676-1-michael@walle.cc> <20220323183419.2278676-3-michael@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220323183419.2278676-3-michael@walle.cc> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, 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 > +static int mdiobus_probe_mmd_read(struct mii_bus *bus, int prtad, int devad, > + u16 regnum) > +{ > + int ret; > + > + /* For backwards compatibility, treat MDIOBUS_NO_CAP as c45 capable */ > + if (bus->probe_capabilities == MDIOBUS_NO_CAP || > + bus->probe_capabilities >= MDIOBUS_C45) Maybe we should do the work and mark up those that are C45 capable. At a quick count, see 16 of them. > + return mdiobus_c45_read(bus, prtad, devad, regnum); > + > + mutex_lock(&bus->mdio_lock); > + > + /* Write the desired MMD Devad */ > + ret = __mdiobus_write(bus, prtad, MII_MMD_CTRL, devad); > + if (ret) > + goto out; > + > + /* Write the desired MMD register address */ > + ret = __mdiobus_write(bus, prtad, MII_MMD_DATA, regnum); > + if (ret) > + goto out; > + > + /* Select the Function : DATA with no post increment */ > + ret = __mdiobus_write(bus, prtad, MII_MMD_CTRL, > + devad | MII_MMD_CTRL_NOINCR); > + if (ret) > + goto out; Make mmd_phy_indirect() usable, rather then repeat it. Andrew