Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp649352pxj; Wed, 2 Jun 2021 08:05:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAY/CjFaLdpdHrCW6d27g9FUhIwQc5kM9B35MSx37E1iOSZ2t+2NA16rGg03NlHcr5Qula X-Received: by 2002:a17:906:13cb:: with SMTP id g11mr16743738ejc.169.1622646324276; Wed, 02 Jun 2021 08:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622646324; cv=none; d=google.com; s=arc-20160816; b=d2IMGabb7azJ7aExusBsFBBLRc23hOZM8cIE0VliuJdry4oSZ6cwRyAy2OGuK12K4H 2hgxbb2tQC3cRW5p6X72eGBaNpkKiE8QXH9nYaNonnBziD+MPxGuNvTIHvRM7rd85JAL h99RKFn6r8i93P4XXM+atn28M4R87Yjcwm1qznpBaPK2jw3/8kwrzSooMA0BSAvc61Fc hFZTKsl1fM4j3h4JZ/6ULSOwvLqt2phFvZzwfM9KjLdcA1YXqagshTdmbFPGZV7DNl7c bjsuQKn2RPylqqc+yAX6cmjvN92yiWogY/5tZIiU5ny4/EzkNtLTZExBPt1ElIu4U9h4 xkrA== 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=WEjzdT1K9N/i7mrDHuJGeWQegSBmwOjCS27olR29tFk=; b=JDjWo5vHvzifcCPhGX7fghq86pOF8DMjiD9QvRQ9QrZPv/DOLUPh9OmGI03cskpVsh 0DC5X4z5zkWuTM5GqK7ZX1qgonYJ41RWbvVpLlhaTqYIk4aL/mB/NgGF0uzWEukfe7kq bJcptNES08mG2p0RAKc8lf2VJoUST9PTRiotz85kCRuyVrAEcwwSpbFjN5r5APp1Xl2o HKEnnBaKV7qmN8wU1iudDsOZJpGUrTGr+WhclgjO/dp8yyWzy7BREyL+jkwHnv6/XMvj qyToxwU0Ze0OYp+VRvvsd//tV2xIvQwiOcAQLPJR/WfCi3D0dMA2B4o6kX9w7rlttqeD Nf2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ISRzAwpa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h3si115127edf.461.2021.06.02.08.05.01; Wed, 02 Jun 2021 08:05:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ISRzAwpa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231480AbhFBPFm (ORCPT + 99 others); Wed, 2 Jun 2021 11:05:42 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:41284 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230406AbhFBPFl (ORCPT ); Wed, 2 Jun 2021 11:05:41 -0400 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=WEjzdT1K9N/i7mrDHuJGeWQegSBmwOjCS27olR29tFk=; b=ISRzAwpaGAYYYqy4KR0GnG3irm ntifB42kf2MY+Gy3u5hucy2Ro2iU5gWNvNBNqLgKQrJVIWg8Ez9bMHWeIXEcYE2cqwvb5BWGFgof1 7xD2gCV+l69WU7jTW3CUS58Epu+3CwIOUEKZo/W6TIoOUVkV9eUJMGvFohKco2t2aokk=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1loSPQ-007TeB-FA; Wed, 02 Jun 2021 17:03:52 +0200 Date: Wed, 2 Jun 2021 17:03:52 +0200 From: Andrew Lunn To: Wong Vee Khee Cc: Heiner Kallweit , Russell King , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC net-next 0/2] Introduce MDIO probe order C45 over C22 Message-ID: References: <20210525055803.22116-1-vee.khee.wong@linux.intel.com> <20210601104734.GA18984@linux.intel.com> <20210601154423.GA27463@linux.intel.com> <20210601230352.GA28209@linux.intel.com> <20210602141557.GA29554@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210602141557.GA29554@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I took a look at how most ethernet drivers implement their "bus->read" > function. Most of them either return -EIO or -ENODEV. > > I think it safe to drop the return error type when we try with C45 access: > > > diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c > index 1539ea021ac0..282d16fdf6e1 100644 > --- a/drivers/net/phy/phy_device.c > +++ b/drivers/net/phy/phy_device.c > @@ -870,6 +870,18 @@ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45) > if (r) > return ERR_PTR(r); > > + /* PHY device such as the Marvell Alaska 88E2110 will return a PHY ID > + * of 0 when probed using get_phy_c22_id() with no error. Proceed to > + * probe with C45 to see if we're able to get a valid PHY ID in the C45 > + * space, if successful, create the C45 PHY device. > + */ > + if ((!is_c45) && (phy_id == 0)) { > + r = get_phy_c45_ids(bus, addr, &c45_ids); > + if (!r) > + return phy_device_create(bus, addr, phy_id, > + true, &c45_ids); > + } This is getting better. But look at for example drivers/net/mdio/mdio-bcm-unimac.c. What will happen when you ask it to do get_phy_c45_ids()? Andrew