Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7264707rwp; Tue, 18 Jul 2023 12:31:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlEH1vq3dpcocZAkS6Oz0DNhyq9jiLVHzc6PxbidXwRu879LA6bFYyBrvy+htrlJgDXhmY6a X-Received: by 2002:a17:90a:69c2:b0:263:25f9:65b2 with SMTP id s60-20020a17090a69c200b0026325f965b2mr150347pjj.4.1689708714864; Tue, 18 Jul 2023 12:31:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689708714; cv=none; d=google.com; s=arc-20160816; b=pzFBC1WkcZb4+d4zBDpqaUwvSRUMT97EriXVbrvipLbzo6vz4dz8OddLaaIS1sl8Pz WY2SSBv2kcLamPqQIKWyTfTMzunYGdxxIvFDWm+fb9dNyAEt0zojWI8/Odsk6OJkRISv fYHZ0eAlWm6oS0YiAwZddZ3OsjjBsvHAXDN+FPncbh+BN8bNPiatCHfq0Gn7y8g6FXLW LeKZhIwDdTYosvsTRYOd6LzCRlVxjfcnlpv/U09CCVTVHqgx+95MhcRHeC8VR98/KU1b dxUEe+7qAjGt/bJUuuxolFLunlIGNahhe9BCJ83x++HVT+9v4vnjOtoL1TuSz3bENRBB LC8g== 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=XBARuUCyX6yvGo0grkLzkMPKrbLpwVIILWLCfgsXO0I=; fh=3Qw1G3qOo3in3hNUZUHpUMCPsGaVFIMiDja10RKWAas=; b=Z3xxjaKRs2RJwYuAE0Gi2JKVDVCJGKEeybmX4tXLh5iWtR+aEwuGxwPTIKgaN5WI9N Rz9yv+ClFsEg48wnH2EdKv/Yxl8pDrp8etGYlV1HvdBEI4L2peRGR4r1RlDaN8Cf+82Z hbOZmVpby2fCHHlK0pGz16T4fbYT9fG+RCEX4US0TD5tabOYW+U06W57IPffTIFF9MqJ B6Vakciefrjz6dIhNp2Dl4fMNrtXAUkIRD/2S5qx0cbOYIlet8M/42jE65baE+7wl+PA OdVMoEXwM6R7RpytJ1ixA7Uz00aZB4Qqdg0gsVxcja+JBvanfZhN5jKPUWsQ3TRwuquu nNfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=UlyApqh0; 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=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hk6-20020a17090b224600b0025ea4ae2799si8297976pjb.19.2023.07.18.12.31.42; Tue, 18 Jul 2023 12:31: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=UlyApqh0; 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=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229795AbjGRTTY (ORCPT + 99 others); Tue, 18 Jul 2023 15:19:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjGRTTX (ORCPT ); Tue, 18 Jul 2023 15:19:23 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74059198E; Tue, 18 Jul 2023 12:19:21 -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=XBARuUCyX6yvGo0grkLzkMPKrbLpwVIILWLCfgsXO0I=; b=UlyApqh0lmvL2xeIq14IGGi50q /yrJzsuqAkVMt6ILg6o6MpMkpj+52/aYapE2mB6AuZSrsq54aRAskDQYDA+k5cId2/+dbDZ3CIV/m uFee0yBfEndy+4a9x/eyzin6dkgEjtALsA/qtwGWCq1OPIRd7QyrztBBVNb0EZqcRLUc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qLqDj-001eLd-A7; Tue, 18 Jul 2023 21:18:51 +0200 Date: Tue, 18 Jul 2023 21:18:51 +0200 From: Andrew Lunn To: "Russell King (Oracle)" Cc: Michael Walle , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yisen Zhuang , Salil Mehta , Florian Fainelli , Broadcom internal kernel review list , Marek =?iso-8859-1?Q?Beh=FAn?= , Xu Liang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Simon Horman Subject: Re: [PATCH net-next v3 03/11] net: phy: replace is_c45 with phy_accces_mode Message-ID: <6afc205e-b525-44df-b81b-ef7cfdfb6680@lunn.ch> References: <20230620-feature-c45-over-c22-v3-0-9eb37edf7be0@kernel.org> <20230620-feature-c45-over-c22-v3-3-9eb37edf7be0@kernel.org> <509889a3-f633-40b0-8349-9ef378818cc7@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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,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 On Tue, Jul 18, 2023 at 06:52:12PM +0100, Russell King (Oracle) wrote: > On Tue, Jul 18, 2023 at 07:40:49PM +0200, Andrew Lunn wrote: > > > static inline bool phy_has_c45_registers(struct phy_device *phydev) > > > { > > > - return phydev->is_c45; > > > + return phydev->access_mode != PHY_ACCESS_C22; > > > } > > > > So this is making me wounder if we have a clean separation between > > register spaces and access methods. > > > > Should there be a phy_has_c22_registers() ? > > Yes, I've been wondering that. I've recently heard about a Realtek PHY > which is supported by our realtek driver, but appears on a SFP that > can only do C45 accesses. However, the realtek driver is written to > use C22 accesses to this PHY - and the PHY supports both. So currently > it doesn't work. > > That's just an additional data point for thinking about this, I haven't > formulated a solution to it yet. That kind of sounds like two drivers. Or two drivers in one .c file. Do you know what C45 IDs it has? Same as the C22? If it is different, each could have its own struct phy_driver. Andrew