Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp851942rwl; Wed, 5 Apr 2023 08:30:55 -0700 (PDT) X-Google-Smtp-Source: AKy350btxjo3dTTTZwAR0Qa0JWB9LhjTTacaqRy+YIcynFK/mUOiQsUCPMYOUZUg9kA6gt9/HHz+ X-Received: by 2002:a05:6402:1b1e:b0:502:246e:6739 with SMTP id by30-20020a0564021b1e00b00502246e6739mr2067419edb.27.1680708655486; Wed, 05 Apr 2023 08:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680708655; cv=none; d=google.com; s=arc-20160816; b=lkMlpa34REAXvqN1pNs2e6ah38OA0KYUAIB3GWuPA3CXv/mDalC9opn2OL6+7b4CSk kgBhB+3zHL4GHVtJUN6Sm0AXRcfhLYr9AxwC3ZikGbnAKqwLp2aCa+2GMgkwYNBOKIXp +xHJP/kDc6Z+mqKWAH3wsRcORZjFuclB8ByADvMuarnBwSIvVe9ATXnbDrvJ9bPOBpPP WFBJB4MsfXRPBQFoHp0WQPWhZ5E8jLikRNIpTsQpCZ91Suy9dz2Mhc23BRG+BR4NBpjD aVbAcIZT5uIvanLYNvwr+87090Ivi3xKIQyvLmoMVHbSQaJEIaFH+nQFMX3dXkibHUxN btuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=uydpM1WhVQasL1eUIMW0esWGuI2om1OqowkDcGSpF80=; b=eECWY1UvnHWTTyZ6GqvlPDTkoKfwYeGePTaRKqe4l52KGY6p7UYaVqyjoMW/8AVADZ AEfDkmSsEMARfcuMTIuhYfQ0vxPHvZQrRQYC5o/l/Uv0EXlTR69odtfXxTUGTz7fG2fD 7esCpVQKMni5eOJ3G/NCTzNzS4C+XoTlngJWedS4SyWLsazf94390ZoK21Oi5JeNJStV Kc9haK/OPTZF+nwkw+36FiG09GrQ+Lgq9EgOWm4x7ZpT/bkCBbUhoABWFfzoNWlgW286 QwaRMYPXAlnqOaMbRyg8A7sInE7y2xxRE8M7u3U2DUW8X4wSf+GgoHC0O955CcOv+lKX aNjw== ARC-Authentication-Results: i=1; mx.google.com; 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 l4-20020aa7cac4000000b004ad726540b2si1462435edt.468.2023.04.05.08.30.12; Wed, 05 Apr 2023 08:30:55 -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; 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 S238250AbjDEP1h (ORCPT + 99 others); Wed, 5 Apr 2023 11:27:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237929AbjDEP1f (ORCPT ); Wed, 5 Apr 2023 11:27:35 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84EB2102 for ; Wed, 5 Apr 2023 08:27:34 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pk52Q-0007Rq-Lu; Wed, 05 Apr 2023 17:27:06 +0200 Received: from mfe by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1pk52Q-0001IW-3w; Wed, 05 Apr 2023 17:27:06 +0200 Date: Wed, 5 Apr 2023 17:27:06 +0200 From: Marco Felsch To: Florian Fainelli Cc: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Broadcom internal kernel review list , Richard Cochran , Radu Pirea , Shyam Sundar S K , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , "Rafael J. Wysocki" , Len Brown , Rob Herring , Frank Rowand , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, devicetree@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH 05/12] net: phy: add phy_id_broken support Message-ID: <20230405152706.qr2rsuxr2y3usbru@pengutronix.de> References: <20230405-net-next-topic-net-phy-reset-v1-0-7e5329f08002@pengutronix.de> <20230405-net-next-topic-net-phy-reset-v1-5-7e5329f08002@pengutronix.de> <6461467c-8f9d-41b6-b060-08190126e81f@lunn.ch> <956792db-c6a4-f16f-e7e4-b9d08c12f986@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <956792db-c6a4-f16f-e7e4-b9d08c12f986@gmail.com> User-Agent: NeoMutt/20180716 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 23-04-05, Florian Fainelli wrote: > On 4/5/2023 5:27 AM, Andrew Lunn wrote: > > On Wed, Apr 05, 2023 at 11:26:56AM +0200, Marco Felsch wrote: > > > Some phy's don't report the correct phy-id, e.g. the TJA1102 dual-port > > > report 0 for the 2nd port. To fix this a driver needs to supply the > > > phyid instead and tell the phy framework to not try to readout the > > > phyid. The latter case is done via the new 'phy_id_broken' flag which > > > tells the phy framework to skip phyid readout for the corresponding phy. > > > > In general, we try to avoid work around for broken hardware in the > > core. Please try to solve this within nxp-tja11xx.c. > > Agreed, and one way to solve working around broken PHY identification > registers is to provide them through the compatible string via > "ethernet-phyAAAA.BBBB". This forces the PHY library not to read from those > registers yet instantiate the PHY device and force it to bind to a certain > phy_driver. The nxp-tja11xx.c is a bit special in case of two-port devices since the 2nd port registers a 2nd phy device which is correct but don't have a dedicated compatible and so on. My 2nd idea here was to check if phy_id is !0 and in this case just use it. I went this way to make it a bit more explicit. Regards, Marco > -- > Florian >