Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2074533ybd; Thu, 27 Jun 2019 06:22:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdj0zrhkHaSOjBeHr+fD3/TDgJC0ucQ9inLDQAI7N8Ho2/Z837SaPikIpyQ79Q5XwE4bvD X-Received: by 2002:a17:902:be12:: with SMTP id r18mr4452920pls.341.1561641733724; Thu, 27 Jun 2019 06:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561641733; cv=none; d=google.com; s=arc-20160816; b=vyZxb9/DpN9lRjj6nmOghN9clFWyCaHYCeZqViVd0R/0MrOpgxexBRaCIvLE3GbxdZ Wh+8mU+uo1ENp6IiHU8SSrdpqIa6E44+8jn8rPweAwhRRD0UNSkRQzyLnaA6B6Kq1pr+ RDFiT85gPLDalhuB3xENc27viaprP9Gqy0uvd6YduplfEPjXhwl3RXED9ZU1YFD7qQpO DEx2pjwieoTWA60xcJ83R867SO8W17LKmkvQ4nd4I0xLMmC0DGhSmusWP/lTt2X0K9r0 xpUHZf8rCCPsdE335CacoP/R3mCrTwZSyM/mEQ5x1A4LH4yZiOVoWns6vfHLkQcY1ZZM mgeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=oA5GMdnGrxF6sTzzRcKYXpIVUL/ec5EzcBXgMsfLGhA=; b=NzfIP3YEGBhSIwLuhCpnCRe51V+X/hyV9aNHBskMsiw2SsYRSbKIxdZ+wsixfQ3cmu va+b3NDgejBUO/g1+8sSE4KcxYPIrHGsjY+q/tVrJqU35TIeg8V1kfFtXUo97GWAn/vv wMd2T5G4ajzK5cKBmvyyWDJBiA8Cg+rMBrLlr7aNluhZLhGngg81dL2P8qrRrrM7dHIg PuLUYFyxO0AhKshsBJaz7YZq++O3zykY6BhgNaClX7qDz/WvGNexUlEIbHTo8ve2l7iK i0KNTZEh4nJgjYyxFNdja7Jhs9S93lXF0LLqOwe2fNrl3ppYFeCD5+eRWBYp4VvHK/DW RTlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=en28+nAK; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e92si2433540pld.312.2019.06.27.06.21.57; Thu, 27 Jun 2019 06:22:13 -0700 (PDT) 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=pass header.i=@gmail.com header.s=20161025 header.b=en28+nAK; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726711AbfF0NVm (ORCPT + 99 others); Thu, 27 Jun 2019 09:21:42 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:46414 "EHLO mail-wr1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726059AbfF0NVm (ORCPT ); Thu, 27 Jun 2019 09:21:42 -0400 Received: by mail-wr1-f45.google.com with SMTP id n4so2525223wrw.13; Thu, 27 Jun 2019 06:21:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=oA5GMdnGrxF6sTzzRcKYXpIVUL/ec5EzcBXgMsfLGhA=; b=en28+nAK8m6rZ3ZTvk3LC0DPGjptazamkjHHl1rH5uXYhTNzshicqWF/MxlyQbCGJy wLuU0DGTApf9VNNPze75OixM7kRciu2fpb0vhYmy2Qq0CBAOPb0e3EI+cV+xrurrGXHw iJoKglsPEo/6pRu3GO3DRVtQSbU/1zlHfqC1MI86vbuySlVzM6qCnnxsbqiuHhGMHBZM 0Z2uQxO4DI9vj8fnrTnkqG8z40Zz78NmesPA9e8cPBS2YS/rdZSQVsg+YWOmHHh8Gd+w uSRHJa9BgPGfPAadm4ccZc3zSKMSCriq+sWFz8/sPtW6YfLFC3KvkDEa3WNDPYknY2nq 60tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=oA5GMdnGrxF6sTzzRcKYXpIVUL/ec5EzcBXgMsfLGhA=; b=jiy/F09TtQLKTIT/w5xqwB1KDoVEO+tWexwQiHQAQdKykyiiRYcihIza+a/+Fgq6U/ k/EVOEDcaEs9F+XQbo75Jl4a+0D0x1RuCkzbK1xua13q6sY8VgrDHjYImo87Vg6ZXxz8 SYnVnyw9YQ1wyvqgni7UbocthBItVa/DA0A3JtW+xkjFL0XQnNEWDhGXcQjVl5HOKfnx i+MTkt0+Z7qTQyf/ZtdbxJu4m1CgWogcS+a1q9zRdQjKez2FdKuF+KSg6ON2eNveWcWs HQNLC9UzZuZ9bS22esXcPX2BHMv2tDFC+kKSre8auufwUH09YYRnUMQyNEFwZZ/YwOpT 63cg== X-Gm-Message-State: APjAAAXl2jcVUKw00yd8B+K6IhckV+l6/Qc8zxuB86Htv7GzwuTKJM5k hsA2GJxLU8vRz6wvzJzzgKsOgRzB X-Received: by 2002:a5d:4090:: with SMTP id o16mr3463732wrp.292.1561641700045; Thu, 27 Jun 2019 06:21:40 -0700 (PDT) Received: from Red ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id y4sm3712762wrn.68.2019.06.27.06.21.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 06:21:39 -0700 (PDT) Date: Thu, 27 Jun 2019 15:21:37 +0200 From: Corentin Labbe To: jacmet@sunsite.dk, davem@davemloft.net, netdev@vger.kernel.org, linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [BUG] net: dm9600: false link status Message-ID: <20190627132137.GB29016@Red> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello I own an USB dongle which is a "Davicom DM96xx USB 10/100 Ethernet". According to the CHIP_ID, it is a DM9620. Since I needed for bringing network to uboot for a board, I have started to create its uboot's driver. My uboot driver is based on the dm9600 Linux driver. The dongle was working but very very slowy (24Kib/s). After some debug i found that the main problem was that it always link to 10Mbit/s Half-duplex. (according to the MAC registers) For checking the status of the dongle I have plugged it on a Linux box which give me: dm9601 6-2:1.0 enp0s29f0u2: link up, 100Mbps, full-duplex, lpa 0xFFFF But in fact the Linux driver is tricked. I have added debug of MDIO write/read and got: [157550.926974] dm9601 6-2:1.0 (unnamed net_device) (uninitialized): dm9601_mdio_write() phy_id=0x00, loc=0x00, val=0x8000 [157550.931962] dm9601 6-2:1.0 (unnamed net_device) (uninitialized): dm9601_mdio_write() phy_id=0x00, loc=0x04, val=0x05e1 [157550.951967] dm9601 6-2:1.0 (unnamed net_device) (uninitialized): dm9601_mdio_read() phy_id=0x00, loc=0x00, returns=0xffff [157550.951971] dm9601 6-2:1.0 (unnamed net_device) (uninitialized): dm9601_mdio_write() phy_id=0x00, loc=0x00, val=0xffff [157567.781989] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x01, returns=0xffff [157567.796985] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x01, returns=0xffff [157567.811989] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x04, returns=0xffff [157567.826974] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x05, returns=0xffff [157567.841972] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x00, returns=0xffff [157567.856974] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x01, returns=0xffff [157567.871990] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x04, returns=0xffff [157567.886974] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x05, returns=0xffff [157567.906010] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x01, returns=0xffff [157567.920986] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x01, returns=0xffff [157567.935975] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x04, returns=0xffff [157567.950974] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x05, returns=0xffff [157567.965974] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x00, returns=0xffff [157567.980970] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x01, returns=0xffff [157567.995973] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x04, returns=0xffff [157568.010971] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x05, returns=0xffff [157568.025973] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x01, returns=0xffff [157568.040969] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x01, returns=0xffff [157568.055971] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x04, returns=0xffff [157568.070970] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x05, returns=0xffff [157568.085971] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x00, returns=0xffff [157568.100971] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x01, returns=0xffff [157568.115973] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x04, returns=0xffff [157568.130970] dm9601 6-2:1.0 enp0s29f0u2: dm9601_mdio_read() phy_id=0x00, loc=0x05, returns=0xffff So the problem is the same than in my uboot driver, the PHY always return 0xFFFF. I have tried lots of hack but fail to bring the PHY up. So it exsists two problem: - Linux saying 100Mbps, full-duplex even if it is false. - the PHY which seems in bad state. For further information, the PHY is the internal one. On the dongle, only the davicom chip is present (along with some resistors/capacitors and a quartz), so I think of the absence of an external PHY. Regards