Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3467619pxj; Tue, 1 Jun 2021 06:07:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxp5oHNqNqnZ/7kBqTjggAj2r86i11gbmLsJinMPYEuRNnC6URimPedQi/N9myFTzHGCLrm X-Received: by 2002:a92:a053:: with SMTP id b19mr21411295ilm.284.1622552838168; Tue, 01 Jun 2021 06:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622552838; cv=none; d=google.com; s=arc-20160816; b=bkNLOSQ8NvXB5bCwoL8jlj+gDizt0GhIPk25+lYDqGpP5WWstUFf6Pa8EW7F1YznhJ SaEARXCMY4cC1liRxi9xiOoSZ2GMUD6yBrF5Iw1jIJdous3UZoUf3wxlyfCXbMuqFn+X 6Klv7ZayjedP7oYCm0oYFufMac/cOuZa+1MYvAlitcSht/dU9woR0cQ7rUANvLI/nH2L VSnOp4V5hUX7FYUq8DtgqSCKEOpo8KeH5vMUXSMsZQrnxLHWKpRbw00+ZF6RW/vTQxQG tv6/dJHipmFI44WHGu/DNt2BkOBb0ynG1u2YLvBklOiOAgBDEN5jIEuWQq0DHL7yOc0D dc5Q== 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=1nlyDUEZQwgAaoaZn/Zf38Ai9ligQ5XU00uvWa0IyRo=; b=RT2fDsAJ5TzZcgwIR84OoA8wJDVMJXeqjndVxvTBjBdX2ga6x6fHjAshBkzLdZmA5C 2w36ttWcIKA7R4/BScYl1VuAPrOmKmESVKWhItwMPwjNSeewsOCtnNjPU8z0pmK6SjNZ ux3nc8QqSgIn9VrEAB0jl+jEanGc8rSlzbtT1X9ZcaONB7o4qfBvnageC7vzQ+XqVwLP +OwXUuf3mAnnIo/CrOFomxIYY5TaNTC/FWRfwg9bfLPRtm6N9qAX40p8DEBJO8U7lv3d Vb681VD1WBfyaM+bdzpujwpfYbYXJsiRVBLqMbPOFFBYlvl0NfJvtNzN84bI/WUXiFHZ 0GUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ldePIHyi; 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 j13si691249ils.109.2021.06.01.06.07.03; Tue, 01 Jun 2021 06:07:18 -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=ldePIHyi; 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 S233921AbhFANGi (ORCPT + 99 others); Tue, 1 Jun 2021 09:06:38 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:38728 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233905AbhFANGg (ORCPT ); Tue, 1 Jun 2021 09:06:36 -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=1nlyDUEZQwgAaoaZn/Zf38Ai9ligQ5XU00uvWa0IyRo=; b=ldePIHyiDH9JQeGLucmWsxSu58 KAxlYi0h7zPGSssVPnhFtrG6wzD+HfzktSxy5WQSyh1DR3kCBBMEMDmMr0AdPYSJ33BprG9nXMULt X2RNxCDQe+LGxd7/FjJCvo1p3gb5yIJEKADV/ysWHaBjjhywmwmbroBDpVPLD7R07/w0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1lo44h-007I14-HY; Tue, 01 Jun 2021 15:04:51 +0200 Date: Tue, 1 Jun 2021 15:04:51 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210601104734.GA18984@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 01, 2021 at 06:47:34PM +0800, Wong Vee Khee wrote: > On Tue, May 25, 2021 at 03:34:34PM +0200, Andrew Lunn wrote: > > On Tue, May 25, 2021 at 01:58:03PM +0800, Wong Vee Khee wrote: > > > Synopsys MAC controller is capable of pairing with external PHY devices > > > that accessible via Clause-22 and Clause-45. > > > > > > There is a problem when it is paired with Marvell 88E2110 which returns > > > PHY ID of 0 using get_phy_c22_id(). We can add this check in that > > > function, but this will break swphy, as swphy_reg_reg() return 0. [1] > > > > Is it possible to identify it is a Marvell PHY? Do any of the other > > C22 registers return anything unique? I'm wondering if adding > > .match_phy_device to genphy would work to identify it is a Marvell PHY > > and not bind to it. Or we can turn it around, make the > > .match_phy_device specifically look for the fixed-link device by > > putting a magic number in one of the vendor registers. > > > > I checked the Marvell and did not see any unique register values. > Also, since get_phy_c22_id() returns a *phy_id== 0, it is not bind to > any PHY driver, so I don't think adding the match_phy_device check in > getphy would help. It has a Marvell ID in C45 space. So maybe we need to special case for ID 0. If we get that, go look in C45 space. If we find a valid ID, use it. If we get EOPNOTSUP because the MDIO bus is not C45 capable, or we don't find a vendor ID in C45 space, keep with id == 0 and load genphy? The other option is consider the PHY broken, and require that you put the correct ID in DT as the compatible string. The correct driver will then be loaded, based on the compatible string, rather than what is found by probing. Andrew