Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3443833ybf; Tue, 3 Mar 2020 06:11:38 -0800 (PST) X-Google-Smtp-Source: ADFU+vsLOlE3D9GgT401ETaz1oJqcYoAkWkxFaxczicdpquD6GIh6ty0cZ+LgxvMOJBcDp9sTlp7 X-Received: by 2002:aca:b9c2:: with SMTP id j185mr2454817oif.112.1583244698609; Tue, 03 Mar 2020 06:11:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583244698; cv=none; d=google.com; s=arc-20160816; b=IikGW52ghRFZ0BwrJFvebTg9SdjcJVwDwStBPS/dEadb17qDcnWhKQLqkXF+F7PnmA S2bDuQ/oqiTRd9OP0gvpu3WdfekQFgVK0yFRkku/NF27aBo4MGp9or/fXm+LINTwKl+V BsnuU4X32IJv9xwS7GV1Ki7g2LgdvX+JpaKWa7WOWcAs+kdahG7cds8V7FgXS+YHF3nx M/LWG/xERYb8RlPbrOSUraxrvaMBRVPC4zjcwJYxHkC/FHGeWzpLcjq6cmxvWmM+hVDt 9kw+S391JcqvFpwwLTAP2d0Kkls+UnD2jUEnSfjwvjcckqKHq8EEhuP7iOSRhjCqPnv4 tLwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=LxSraZ4V6R6eSZ2XYZzkqraIm7vZB0AJQUd3qlAu/BQ=; b=QhYBugiKGaYvgin61lnoW8yHo5EZivADVUC15lt8tbu+bnlD9a4CQtTn8ZiSp+MhL1 m7EQS3yXg3IRpwEHMxLiDPEDP9txY3lC3TcBSe7AAS/3UJVB1RJvYJzw4op6k9ih1YmA ZKT8QFT6JMn5YHvndBqmkVS3HxtgQjb7ft4bg2ivhir54F4bhe6HlsD0+YtMRQ0Q87J2 S5+o027b/9eN5DbXFtzVqf4vAkzwJBK5cvuQn1DcNwb14s+mlEGIcooepW40Bni7aNrn XRmWHQcrqGKSQ1lEo48E3ovfcXcdmVUUWkSxK5OA8XvLODGmNyjjPrm7KZozwE2l1qg7 HIMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=gEdvT9UJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m85si8256176oig.158.2020.03.03.06.11.15; Tue, 03 Mar 2020 06:11:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=gEdvT9UJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729400AbgCCN7m (ORCPT + 99 others); Tue, 3 Mar 2020 08:59:42 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:43508 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729366AbgCCN7m (ORCPT ); Tue, 3 Mar 2020 08:59:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=LxSraZ4V6R6eSZ2XYZzkqraIm7vZB0AJQUd3qlAu/BQ=; b=gEdvT9UJOe7ZmXC9c8402O0aeo ZGe43nTZlQu4l2nCtqiM8ZfXptCpck6hPP/C6TDQSTWTw0m43qAduJYnA48JY3CRtZXc3hJVlh/zC stWqc/CxpRzYlAUEK7k9Ff1V3s14AVySvuD7ZHGX2R/8jZywUmYAOAYmzXbsuLI2M/Fk=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1j985A-0006OD-Bh; Tue, 03 Mar 2020 14:59:36 +0100 Date: Tue, 3 Mar 2020 14:59:36 +0100 From: Andrew Lunn To: Oleksij Rempel Cc: Florian Fainelli , Heiner Kallweit , Pengutronix Kernel Team , linux-kernel@vger.kernel.org, "David S. Miller" , netdev@vger.kernel.org, Marek Vasut , David Jander , Quentin Schulz Subject: Re: [PATCH v1] net: phy: tja11xx: add TJA1102 support Message-ID: <20200303135936.GG31977@lunn.ch> References: <20200303073715.32301-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200303073715.32301-1-o.rempel@pengutronix.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Oleksij > TJA1102 is an dual T1 PHY chip. Both PHYs are separately addressable. > PHY 0 can be identified by PHY ID. PHY 1 has no PHY ID and can be > configured in device tree by setting compatible = > "ethernet-phy-id0180.dc81". Why-o-why do silicon vendors make devices with invalid PHY IDs!?!?! Did you try avoiding the compatible string. We know PHY 0 will probe as normal. From its PHY ID we know it is a dual device. Could the probe of PHY 0 register PHY 1? No idea if it will work, but could nxp-tja11xx.c register is fixup for PHY_ID_TJA1102. That fixup would do something like: void tja1102_fixup(struct phy_device *phydev_phy0) { struct mii_bus *bus = phydev_phy0->mdio.mii; struct phy_device *phydev_phy1; phydev_phy1 = phy_device_create(bus, phydev_phy0->addr + 1, PHY_ID_TJA1102, FALSE, NULL); if (phydev_phy1) phy_device_register(phydev_phy1); } I think the issue here is, it will deadlock when scanning for fixup for phydev_phy1. So this basic idea, but maybe hooked in somewhere else? Something like this might also help vsc8584 which is a quad PHY with some shared registers? Andrew