Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp908534rwl; Wed, 5 Apr 2023 09:12:46 -0700 (PDT) X-Google-Smtp-Source: AKy350YaE/WfNe8p9c9DOQr5DEKrCxdLI7Gj6zqunvdpYyuKOZo7skrnUr/uR6X7DKc7EfCOgOdD X-Received: by 2002:a05:6a00:1ca9:b0:62d:d85b:fcfc with SMTP id y41-20020a056a001ca900b0062dd85bfcfcmr2709854pfw.8.1680711166051; Wed, 05 Apr 2023 09:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680711166; cv=none; d=google.com; s=arc-20160816; b=ylnhHrUFKYudmRjlO+2aPbQLjGNxIWhy9XjBOvEpTdAJkEFuKAJZfzGluRiHlitN8E wMniiCmNCCntSMsAbbEmgeRgROmA3RJ0zrUvrsLe0vwOemJbIH2+ItjOD7atHP0iI9jB Awk0vnnVBm1RzH8l4Fvw4w/uv7c/Kr/mBXO8xcsTBSan/JhYucnRl0ypQ1mBLmXXIUsj jwuInQA/gewKLD5WCjE997c2OQ3WoycWWFx4d032nv/6u8Tc03hcfmMMiEDvNULVUWJp F5xs7NETuSUt7BMOD/8dEVZYqCe2t0+ZBhDfVH57V4oHv+j4eIQKsKY+cHhywkFsVaiA hCmw== 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=0YOe3B05kwzESGEZwtFaaWYdJFRP1kunFb8Z3mAHVNE=; b=JVngHIu7e+Ho6r1qMrruZtdB4x+GsDMdcq4cUDxyCH5ydi2VaCt8F4tQeBqCHVmiuo K9qMpMu/XdP8WqzyZkTzU212yD6irVYmNL7ReZhc9ScGqnTSsXvShOXTZTBnpfQK6lHU sf4IbKa6kN1cI6i6eryam+ByipEoA63QGqbLcSoO3n8Fh+M4V+flEu77b46b6f2p9hcZ jh7lqGBmrb1iCd/fNKDHbUZEO8tkAD/7m4DoITpHgPJ1UI88WIlga9qoqmH3lfndGqO2 rO6DDfsyzOePqYhF/4VAyr8BX26N3gHV4gP0Su7J1O5/08fXNCB64V2WAByqvCQkLeBd 0Krw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=W0PM71DU; 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 w187-20020a6262c4000000b006265c3b7053si12726136pfb.200.2023.04.05.09.12.33; Wed, 05 Apr 2023 09:12:46 -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=W0PM71DU; 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 S229962AbjDEQJc (ORCPT + 99 others); Wed, 5 Apr 2023 12:09:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjDEQJa (ORCPT ); Wed, 5 Apr 2023 12:09:30 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B331A134; Wed, 5 Apr 2023 09:09:29 -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=0YOe3B05kwzESGEZwtFaaWYdJFRP1kunFb8Z3mAHVNE=; b=W0PM71DUI+PeuWeSJKT8aBibBy uebHBj+i/fYRZBkUdz14UDuxq7PuT5EG9CxOG505qP46ASoyrqq4emsiKFfjyh2IMb/FVdOMwinit e1GIZ4HFF4JNi8RHSCB6wluvmQbDEJx+8a6OdPZ6UbJt2E55iPrYfuvR1FUir4n+lars=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pk5hC-009XOU-NY; Wed, 05 Apr 2023 18:09:14 +0200 Date: Wed, 5 Apr 2023 18:09:14 +0200 From: Andrew Lunn To: Marco Felsch Cc: Florian Fainelli , 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: <8acb116d-6a14-439d-82ce-d32f2b510fce@lunn.ch> 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> <20230405152706.qr2rsuxr2y3usbru@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230405152706.qr2rsuxr2y3usbru@pengutronix.de> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 > 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. What is actually wrong with the current solution? It is nicely hidden away in the driver, where workarounds for broken hardware should be. If you have found device 1 of 2, does that not suggest its resets are already in a good state and nothing needs to be done for the second PHY? So just register the second PHY with the code from within the driver. Andrew