From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86663C77B6C for ; Wed, 5 Apr 2023 16:09:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231837AbjDEQJc (ORCPT ); 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> 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