Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753235AbcD1P4k (ORCPT ); Thu, 28 Apr 2016 11:56:40 -0400 Received: from skprod3.natinst.com ([130.164.80.24]:55381 "EHLO ni.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752189AbcD1P4i convert rfc822-to-8bit (ORCPT ); Thu, 28 Apr 2016 11:56:38 -0400 Date: Thu, 28 Apr 2016 10:55:56 -0500 From: Nathan Sullivan To: Nicolas Ferre Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Fainelli , Alexandre Belloni Subject: Re: [PATCH v2] net: macb: do not scan PHYs manually Message-ID: <20160428155556.GA8333@nathan3500-linux-VM> References: <1461854802-8142-1-git-send-email-nathan.sullivan@ni.com> <57222FCE.8050407@atmel.com> MIME-Version: 1.0 In-Reply-To: <57222FCE.8050407@atmel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on US-AUS-MGWOut1/AUS/H/NIC(Release 8.5.3FP6 HF1218|December 12, 2014) at 04/28/2016 10:55:57 AM, Serialize by Router on US-AUS-MGWOut1/AUS/H/NIC(Release 8.5.3FP6 HF1218|December 12, 2014) at 04/28/2016 10:55:57 AM Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8BIT X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-04-28_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1396 Lines: 29 On Thu, Apr 28, 2016 at 05:44:14PM +0200, Nicolas Ferre wrote: > Le 28/04/2016 16:46, Nathan Sullivan a ?crit : > > Since of_mdiobus_register and mdiobus_register will scan automatically, > > do not manually scan for PHY devices in the macb ethernet driver. Doing > > so will result in many nonexistent PHYs on the MDIO bus if the MDIO > > lines are floating or grounded, such as when they are not used. > > > > Signed-off-by: Nathan Sullivan > > Well, as explained in the commit message that added this feature and in > the comment, if no phy is specified in the DT we end up without phy... > > There are AT91 platforms which lack specification for the phy node in > the DT. So, I don't know if there is a better way to deal with this case > but I see this removal as risky. > > Bye, > > Nicolas Ferre Hmm, are AT91 platforms special in this regard? As far as I can tell, this driver (macb) and Marvell PXA are the only ethernet drivers that call mdiobus_scan directly, and PXA does it on a known address. I do see that there are trees that use macb and don't have a phy listed, which is unfortunate. Another way to fix our issue would be to consider all 0x0s a bad ID in mdiobus_scan, so grounded MDIO lines do not get PHYs scanned. Or we could add a DT property to disable the manual scan. I'm not sure what the correct solution is, do you have a preference?