Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754433AbbLCVYF (ORCPT ); Thu, 3 Dec 2015 16:24:05 -0500 Received: from mail-bl2on0058.outbound.protection.outlook.com ([65.55.169.58]:22023 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754093AbbLCVYC (ORCPT ); Thu, 3 Dec 2015 16:24:02 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=David.Daney@caviumnetworks.com; Message-ID: <5660B2EC.1050705@caviumnetworks.com> Date: Thu, 3 Dec 2015 13:23:56 -0800 From: David Daney User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Pavel Machek CC: Florian Fainelli , Dinh Nguyen , "David S. Miller" , , , "linux-kernel@vger.kernel.org" Subject: Re: SoCFPGA ethernet broken References: <561FF9E2.30102@opensource.altera.com> <56200687.9040903@gmail.com> <562005AD.8020903@opensource.altera.com> <56200BD7.8020505@gmail.com> <20151203204811.GB14427@amd> In-Reply-To: <20151203204811.GB14427@amd> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: BY2PR07CA057.namprd07.prod.outlook.com (10.141.251.32) To SN1PR07MB2143.namprd07.prod.outlook.com (25.164.47.13) X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2143;2:T0nKpZS10FUrfiQZU+SRE0Wgi8iixpl5zK1flMfIwoi99l4wZK2HdcFhShet6uNxTHNCQP9S4sTorOPQW6W4f3VLFqvZa7s2Zovd9l9TWxFbiY+bCCAc3i4kQ8vvxgMGgLUfDR/i5QiG+ig/S+InBw==;3:sV7I6ve+GKOlWJ5NX8TaEi4RTt9rh0n2I0FaxGxYMrjKI3PWdnSZS/7fC8ixJ45WgVyCLNS1cSQNeOl9tcWnWmPEsos42+8rIAP/l0bg3btv9mJuTgSV/7hAF8bkF7Rm;25:mg8g+svpd0fEAKEjs82EZFaU+I93TlA3IrOMwDHJw4r+gxYa6ZqBAAb5G7wz0SsSN7vI2quzd3jUiJyg1T84gB3QDVAlnopKtEdcCw413d9ieMM/cbz9HB6VkSq/p5FSD/I2Rve/yhl93Bk7GJJdo0O7MbkVHadmjj510/eDPVzBK0MEaQM6vaf26sdQ0OBSGS15pwKi8eb/eq6nxbxBOc2Z81uH9hJKJeChmE4sh/9OkNOlOsxwB+NtP43GHKlV8+n6BJsTrCdVK21mIil8mw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB2143; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2143;20:3e08ZVHJlPmhs7wVUFaAZZJujeeL8B1OyoUX4xQ4cSZcljJWHJgvl0pcNS2xCX8OcvLikLVMF1WUi1cVz9gpyFYLkDN/5Rx3cqDjECqKT666jOGbvW/xsSs9+h1Ro+Uq8x2u+UdmHmq+Yd5lfK/AuF/1w/fVWpJSbvfiMx1sU07kKCbumYfHmSh1/E7yiJdVikuSS4flkTG+SOq7G+tEiRlRzuSUYWYSHaJCt8yf2LjsYSW8XS2nuolqlqzU4i5PeW8YsNq3t+UMVOUsHkfX+ZtygomCmiKiWExfXQY/G/2wUyom7eBbHdFEjbTT46DudRSTTinReY5z4sUBMaU143X/v6fH1AaUZWNOsZxrcMcz1bfgL4EZx2+c+EvQ2QM6ET+f0A5vXLF0S/HKR5FPw1Tku1vyk5OUBptd8UDc3aRrVGk0lyj0JB5wV2r8yo74lg3UlBc0lD0jmbzzpIm+wTGQ86DrP7PctmKfVH6gsh+A8UuSMr52/XjV0p7MHZmIQbU4ES3t71b2MnUssHiKOcTA8D8wClCJ2/+qzDYkBNQtkV/5cQj5k0rxDCh4tVR6hI6haQ1a8ltRONtkX1MnuJUhCLzlk6FOkdNf1g84+rE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046);SRVR:SN1PR07MB2143;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB2143; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2143;4:ZcBylaEjwQhoT5VleuMlcu0Q6yyDmyr5aSM7gm41R8It/0txHhZz6sXSe18LFBhiO3o452leMzkBAvrvg5NLvA7yghShw2TN2d9NMrMCNRveUCw9psksihaqsYCqM8V+t9oOj5/9i4YCZSNUXXTWtDJULa+MrDBhaxjUKAIyeZCvfgNVvViZKyc8h5xMSx2xl3VY5DUNkwDwCox3+InyqrWsAYe66Bkwg/07Owl+qgIaQZ8eUREYZ6PFIoAHfMH/3/enktNTNqOPJaeuVJNCpWR9EktH14RV+hpFTPXvpVXUx0bM7j7J3TjSPEkzVPvIBeKOWVDa0j4LwjWi6ANRdSEVaz2GKjKtrTBduUMg7szzLlq3GPYp3YZuX25knF5O X-Forefront-PRVS: 077929D941 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(199003)(377424004)(24454002)(479174004)(377454003)(189002)(97736004)(50466002)(36756003)(189998001)(1096002)(6116002)(4001350100001)(5001960100002)(586003)(5004730100002)(2950100001)(3846002)(4001150100001)(77096005)(101416001)(65816999)(230700001)(92566002)(5008740100001)(110136002)(106356001)(19580395003)(40100003)(80316001)(76176999)(122386002)(47776003)(105586002)(66066001)(87266999)(53416004)(33656002)(23756003)(81156007)(65956001)(50986999)(54356999)(65806001)(59896002)(87976001)(64126003)(83506001)(69596002)(42186005)(93886004);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB2143;H:dl.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?iso-8859-1?Q?1;SN1PR07MB2143;23:VXH6uB7oiGTkRZTIbbwdPCJ46CcvmiOGm7qOAtX?= =?iso-8859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xT8zxdX0Ikcz?= =?iso-8859-1?Q?YL8tUR3MVJ5ynpnmj0ZUKGtFl1rByhQ30aPVW3emKNHVbyXtjbPWn6XC2X?= =?iso-8859-1?Q?w18uXzhZh/56ktWGj7pWNR1rpehyV5UFhOflHn//+oeCITA3W9r3HSajB7?= =?iso-8859-1?Q?VOEJ8vEzJADqcjmjmYkIzuSTeu0gM33EBsohEJzsUZVxPrJpTC5jQXSHxb?= =?iso-8859-1?Q?S4zgnsf2hUPTrEBEFSgrCDLIQuRyLeYJff8gqqRxrVZC9PGaxkFUSCALh4?= =?iso-8859-1?Q?ReVAqITstzCT8ZovVsEIVepGFs+1QWNtn3k35pI8Fqym+7duB1Vz4MC8fk?= =?iso-8859-1?Q?gU6L2kudJuHiraNHA1GB0ql8/sCFK+rCjiHu41BuJYlmTLyPQ6Q990bAam?= =?iso-8859-1?Q?zN7I6WdWHnApr+E/MVjTQT7npphLcmABcLFYf48jlqmxLwU6OukCuGnPov?= =?iso-8859-1?Q?m8E7ouqVrP7WRnHZTe2OS7fRMs/RC?= X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2143;5:TNNT3jTzOhweGXD/YNIyRcP4AWz4hhqKADjhrrNRz4A2lCEmEDNPiekJPtDv3iQmad8qX1Zl/VKGlz6HqIynX0GI78JEDnQoETvT0xd4w0wxZHKgJIe0mTT+S7aE5JgjrSJbzW7IoQQF2pG5tBL0hQ==;24:Rb8UFnAjhFLS2qIMhwaHHsmU143VcT1hyQ3NURx1laENilua15u5N1n+IqaS0Z5892MvK8apEz63JixSphpXgToCwxEabhkSAYwju8SBI0c= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2015 21:23:58.8249 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2143 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3068 Lines: 73 On 12/03/2015 12:48 PM, Pavel Machek wrote: > On Thu 2015-10-15 13:25:59, Florian Fainelli wrote: >> On 15/10/15 12:59, Dinh Nguyen wrote: >>> On 10/15/2015 03:03 PM, Florian Fainelli wrote: >>>> On 15/10/15 12:09, Dinh Nguyen wrote: >>>>> Hi, >>>>> >>>>> commit "8b63ec1837fa phylib: Make PHYs children of their MDIO bus, not >>>>> the bus' parent." seems to have broken ethernet support for the SoCFPGA >>>>> platform which is using the stmmac ethernet driver. >>>> >>>> It is not clear to me how this relates to what you are seeing yet. >>>> >>>>> >>>>> It appears that during DHCP, it cannot get an IP address. This only >>>>> happens if ethernet was not used by the bootloader to tftp an kernel >>>>> image. If I use the bootloader to tftp an image then ethernet is working >>>>> fine. So I think the PHY is not getting enabled properly. >>>>> >>>>> If I revert this patch, then ethernet is back to working on the platform. >>>> >>>> Is the Device Tree source for this platform available somewhere to look at? >>>> >>> >>> Yes, I'm using the DTS that is in the mainline: >>> >>> arch/arm/boot/dts/socfpga.dtsi >>> arch/arm/boot/dts/socfpga_cyclone5.dtsi >>> arch/arm/boot/dts/socfpga_cyclone5_socdk.dts >> >> There are no PHY devices in any of these DTS files, instead there is the >> non-standard "phy-addr" property which is set to 0xffffffff supposedly >> to indicate that the MDIO bus should be scanned. This is likely part of >> your problem. The stmmac driver seems to be looking for "snps,phy-addr" >> and not "phy-addr", so I am not even clear how this is supposed to work, >> and the driver mentions this custom property is deprecated anyway. >> >> The core problem is in >> drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c::stmmac_mdio_register >> which manually detects the PHY, that is mostly fine, except that it does >> not really seem to work here for a reason that is still unclear to me. >> >> Your Ethernet PHYs need to be declared in Device Tree, see >> Documentation/devicetree/bindings/net/phy.txt > > While updating DTS might be good idea, I don't think you can simply > blame this on DTS. If it worked before the change, it is supposed to > work after the change, otherwise we call that change a "regression" > and revert the change. FWIW: My initial patch to address the failure worked with the original DTB. Also: userspace wasn't broken. So, the commandment about not breaking userspace wasn't broken. Although admittedly, breaking the kernel isn't good either. > > Plus, DTS is supposed to be ABI. Old DTS should still work on new > kernels in ideal world. If you supply the device tree file in the kernel tree, it is not an ABI. If the device tree is not part of the kernel, and instead comes from the boot firmware of the board, then you could make the ABI claim. David Daney -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/