Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2076630imu; Wed, 28 Nov 2018 21:57:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/VNVpVuDkYYDkaVPL+45GucQxfX5Kx/gtYi1cGw9TMVOutqYwj8uDYBu7nZw5eo1TmtMfCy X-Received: by 2002:a63:9306:: with SMTP id b6mr163815pge.36.1543471022439; Wed, 28 Nov 2018 21:57:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543471022; cv=none; d=google.com; s=arc-20160816; b=M7aMJXtl4YQcOKSXCZRNRH2PQ1x9fXkFtTzL+eXfrkxZTQodPLjv/pAbxQ2SpiNiP4 ONRe/bYQv4ynoNR1QTc6KHBTkm3M/PR69VLtJp7zo47jeMRfxtqibd4KUvGWJr4LL9El 0UAqNWC651BSGQz0Ue3vYqc3h+Jx/fEEXtKwCdzOsqgPeGO2A53I5jyzrK+AQmgLw9h3 Sg2NrlbMPha3tbi+Ft+TQVMVAPpT5PNx75yYPXKRXfb1qwDgQEj/sQdd2zLBiXNlw9sB OkPBDuTfL/uiBhCnW9RIea5jfeCMUd2MHkY8E7NrqSGIeYL12Qnpur0/E/iXOr9XnEU4 HF8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bxcTrYfwpWhtFlmCs28IZaAdRCUjjrf7qsMM7+kpdXI=; b=p6zU406c/0gd3NBAsRYQJFy3l/jclWTBr1/JOftuufFOJLD+ff8uaEyPM5Klnk6MPD C+ygNE3/Zd6j0HGYvLdCNQRY+1gkVxAiDaxFDeFNQrGCfhW/64ScvuvO7OBXlveehenY L+GYtidlYGQLBPopfxOLlVLFet2L2jcteEKr2N23BzGY/UDUHy1sfpwNvx5+Ik95uggH 31WjVvKttTrvuBqLrYNk6qnHOSH0F/3f2870L5fRDrHV6ZbyKrHnFChChndngMQ7W0Xx 8TIhs++I79JSHulZzj4v9C0HxtTFm2/mZhNHO9GX6RfxnnRc3ZxQxHICBAj+VNwGnMrG s1kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=XQdIZ5f5; 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 b24si1054383pgg.288.2018.11.28.21.56.47; Wed, 28 Nov 2018 21:57:02 -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=@lunn.ch header.s=20171124 header.b=XQdIZ5f5; 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 S1727883AbeK2Q7c (ORCPT + 99 others); Thu, 29 Nov 2018 11:59:32 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:53829 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727406AbeK2Q7c (ORCPT ); Thu, 29 Nov 2018 11:59:32 -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; bh=bxcTrYfwpWhtFlmCs28IZaAdRCUjjrf7qsMM7+kpdXI=; b=XQdIZ5f5H02MfszM11eQyPsf3iBkc5Q/95nFcTexdO2Lp7TMy/UbV2KwMxdTVQqU/aUvSq9YciZ+TC+ILPnkbDOCHWX+XlcB70sNellkykBefwsjzZsMmpu2SyjqDD3AUTal7ABhvZJr0enEPHKN/zZFF6P3puSoaBQ/Z0N5+vg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1gSFI6-0004ic-O0; Thu, 29 Nov 2018 06:55:10 +0100 Date: Thu, 29 Nov 2018 06:55:10 +0100 From: Andrew Lunn To: Palmer Dabbelt 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 Subject: Re: macb: probe of 10090000.ethernet failed with error -110 Message-ID: <20181129055510.GB17675@lunn.ch> References: <2e17bba6-d932-37b2-5dca-0963fc50f5e6@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c > index 7cae17517744..8e0a71ee6bab 100644 > --- a/drivers/net/phy/mscc.c > +++ b/drivers/net/phy/mscc.c > @@ -1822,6 +1822,24 @@ static int vsc85xx_probe(struct phy_device *phydev) > return vsc85xx_dt_led_modes_get(phydev, default_mode); > } > +static int vsc8541_reset(struct phy_device *phydev, int value) > +{ > + WARN_ON(value != 0 || value != 1); > + mdio_device_reset(&phydev->mdio, value); > + if (value == 1) { > + /* The VSC8541 has an unexpected feature where a single reset > + * rising edge can only be used to enter managed mode. For > + * unmanaged mode a pair of reset rising edges is necessary. > + * */ > + mdio_device_reset(&phydev_mdio, 0); > + mdio_device_reset(&phydev_mdio, 1); > + > + /* After this pair of reset rising edges we must wait at least > + * 15ms before writing any phy registers. */ > + msleep(15); > + } > +} > + > /* Microsemi VSC85xx PHYs */ > static struct phy_driver vsc85xx_driver[] = { > { > @@ -1927,6 +1945,7 @@ static struct phy_driver vsc85xx_driver[] = { > .get_sset_count = &vsc85xx_get_sset_count, > .get_strings = &vsc85xx_get_strings, > .get_stats = &vsc85xx_get_stats, > + .reset = &vsc8541_reset, So if we assume you can identify the PHY using its ID registers, you can put this reset code into the soft_reset call. That gets called first before anything else. There is no need to add a new function to phy_driver. Andrew