Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1960531imu; Wed, 28 Nov 2018 19:02:19 -0800 (PST) X-Google-Smtp-Source: AJdET5deKuxsidEv8CF09DYlHjtm/d3xpoUcc9V9QC/iNm+ASXMrY9JY04vZf9FEZlNkpBuHV9R7 X-Received: by 2002:a63:101d:: with SMTP id f29mr35732391pgl.38.1543460539431; Wed, 28 Nov 2018 19:02:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543460539; cv=none; d=google.com; s=arc-20160816; b=fM2P4v6BjzX2zMLtAN2+DTLd2FG2Tb4ldRuB1etUiaNv1ZoxQ/LjYqe/cQEtRgahq0 yzb4ZG4jh/X3l90rW7SOWr8e2zf9UfqCH0kXbIp6HW3Uay0XXvP9RAeK430VU1mYc/CN u4fW52wA14JyjgSzajyKnL5ZhvhCFc9cS6F0JBdd6F9z+FIekJQr40TY973d+tiVY4lE 0sxnuASP006Om1ft15TOK7DZAl2sB7ekf1zRsZGO2MKPQZqaeBQuR3Qfua10yOr6V/Yw G6bU2L5RWBTcM/pGRhqIScBw4nM0BRyZIGgJHmn3z8L8BXbfxalKTIP9LcrZQ/Gs4IhS VtMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=PmvdE8m0FvNlBUvqM3GJLcyCwV+VfWmHN81+mwJltJw=; b=EFHhqfWsFdlxJVZMUoGQlFuXe+YvRRpDlBbiZhrAmIFoky3aexLIWvjjiWRDvPipFV A7QKGMImouTgUOMmusmzLAzKVw61M5JxN0zCJzyO0mKtKnqdcSs/QGhasOp13PF8u3Qy IiZBNHukOx2wxN66TQzyabKdSYcAtyyCEujImugnsYebM5QLsl/F1H1fVMg7n2fRbroi 4r1MRH6i6Q6bb0eKLXNpqDWR/b6pBsWrJRmMTyIiptp3SxBUwoJLNG4ty0DIBavX5atz Bjxe0onDgdQHS/bvz6yF+jWuhSziAU4oinJHVJ2k2Dcii/+qFxqk80Nt6rlNzo+ZTJn4 GuJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=KOA+xIQe; 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 p64si588135pfa.94.2018.11.28.19.02.00; Wed, 28 Nov 2018 19:02:19 -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=pass header.i=@sifive.com header.s=google header.b=KOA+xIQe; 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 S1727239AbeK2OFF (ORCPT + 99 others); Thu, 29 Nov 2018 09:05:05 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:42534 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726954AbeK2OFF (ORCPT ); Thu, 29 Nov 2018 09:05:05 -0500 Received: by mail-pf1-f194.google.com with SMTP id 64so264139pfr.9 for ; Wed, 28 Nov 2018 19:01:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=PmvdE8m0FvNlBUvqM3GJLcyCwV+VfWmHN81+mwJltJw=; b=KOA+xIQeYzAv5zIJYODzTUR3bwhJapiqnGtfCXltOtg6XfAPa7Y5HG+mGcA96dFxoD Y/W0tryalnTxqYMsqxop5zfP5HdxpRwqcp/XlPO93zJwNDkfMyzlJOIIOvU1doWmcUAL dEIhIh2VqqfJf8IZCoqm4MOQBOusaIQli2PsZMz6oQwyG9DQ+XWcSf5I9G51ROvgXT2H jq4B8UXHgYCPd5wN60dlHlk/7VDHeg90aigzHTrvi+0q5r0DjHprYug1/UlnTzHxEbBm yjY7/SrwSkCCkqTWW44/wYebOMfSUU1ghymDSWw/P4M4XwuP6bV2rmhVQpGqPN+putAs Tiow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=PmvdE8m0FvNlBUvqM3GJLcyCwV+VfWmHN81+mwJltJw=; b=uBie6mnAPga5ceQFrgaMJpae6XJLjzsigJbESXqXnc/zGyPf3wyd5kFkQRf0oy5s41 f5YRUtHqfCLFlhMJDiVMT3N/kNxSrmQlFPAPAURNhZ8hNRrPDUATdo/dk8lxfduqdHxL xv+BUu8Xv4Hmi/oz4qXxkK9MLZlSN1TLPZu/L63kMADt+2MXNFWOcOLTFbE2YY42RzJ8 0x7N5koqcNFGinY+q5iixznXakbeLZASXDrOxCULxONgsLR+hJTgeWUvgufol7+Sdz2R DUPZI47WQIE135H+iiBDjs4Ww6oCUs9EUFA11Jr3Bx6yMV8HCUVh3g/TYRwwZlTjxLFt t+hw== X-Gm-Message-State: AA+aEWalHpwKK/Tg1zgLbY70dTOf/TGwvcfkQ4uIMyVmSc73hOZuJzpz RNerEdPBPaZkDnQXCl26uxgGiQ== X-Received: by 2002:a62:69c4:: with SMTP id e187mr33591672pfc.50.1543460475482; Wed, 28 Nov 2018 19:01:15 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id b7sm467198pfa.52.2018.11.28.19.01.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Nov 2018 19:01:14 -0800 (PST) Date: Wed, 28 Nov 2018 19:01:14 -0800 (PST) X-Google-Original-Date: Wed, 28 Nov 2018 19:01:10 PST (-0800) Subject: Re: macb: probe of 10090000.ethernet failed with error -110 In-Reply-To: <20181129022858.GG5037@lunn.ch> CC: f.fainelli@gmail.com, sergei.shtylyov@cogentembedded.com, atish.patra@wdc.com, schwab@suse.de, nicolas.ferre@microchip.com, netdev@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, hkallweit1@gmail.com From: Palmer Dabbelt To: andrew@lunn.ch, Atish Patra , Paul Walmsley Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Nov 2018 18:28:58 PST (-0800), andrew@lunn.ch wrote: >> This is all fine as long as Linux doesn't go and reset the phy again. Until >> bafbdd527d56 ("phylib: Add device reset GPIO support") was the case. After >> that commit I believe phylib is resetting the phy while attempting to enter >> unmanaged mode, which is now allowed in this particular chip. >> >> Since it appears the phy is not usually described by the device tree but is >> instead discovered by probing a MII-based ID register, it seems the best >> place to put this is within the phy driver itself. I find it's usually best >> to describe things with code, so I hacked up something like > > Talking to Florian, i was under the impression that you could not even > discover the device when its reset state what wrong. You could not > read the ID registers. > > Your suggested change assumed you can discover the device. Is this > true? Sorry, I can't tell that from reading the code. Since our bootloader resets the phy into unmanaged mode I think that just deasserting reset should be OK, but I don't have much confidence in that -- once I run into one unexpected feature I start to expect more :) It looks like there's already an expectation that at least the phy ID registers can be read between falling and rising edges of a reset, as that's how the fixups are handled. Since the error message that shows up with a single (single as far as Linux is concerned, triple since a cold boot) reset rising edge still lists the phy by name I think that probing is working well enough, but I wouldn't be surprised if there's something in the middle that's gone wrong. It's possible registering a fixup that does the double reset can get us through the probing sequence. Maybe Atish or Paul can help out? I'm a bit embarrassed to admit that I can't actually figure out how to boot the board any more, it's been a year since it's been my primary target and since I just to arch/riscv stuff now I rely them to test on the board...