Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751595AbcCKS0u (ORCPT ); Fri, 11 Mar 2016 13:26:50 -0500 Received: from mail-by2on0094.outbound.protection.outlook.com ([207.46.100.94]:42153 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750787AbcCKS0s (ORCPT ); Fri, 11 Mar 2016 13:26:48 -0500 Authentication-Results: lunn.ch; dkim=none (message not signed) header.d=none;lunn.ch; dmarc=none action=none header.from=caviumnetworks.com; Message-ID: <56E30DDF.5040506@caviumnetworks.com> Date: Fri, 11 Mar 2016 10:26:39 -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: Andrew Lunn CC: David Daney , "David S. Miller" , , , Florian Fainelli , Robert Richter , Sunil Goutham , Kumar Gala , Ian Campbell , Mark Rutland , Pawel Moll , Rob Herring , Radha Mohan Chintakuntla , , David Daney Subject: Re: [PATCH 1/3] net: thunderx: Cleanup PHY probing code. References: <1457714822-5754-1-git-send-email-ddaney.cavm@gmail.com> <1457714822-5754-2-git-send-email-ddaney.cavm@gmail.com> <20160311173125.GI3153@lunn.ch> <56E30332.7060003@caviumnetworks.com> <20160311180030.GB19277@lunn.ch> In-Reply-To: <20160311180030.GB19277@lunn.ch> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: SN1PR07CA0010.namprd07.prod.outlook.com (25.162.170.148) To CY1PR07MB2134.namprd07.prod.outlook.com (25.164.112.12) X-MS-Office365-Filtering-Correlation-Id: a592386e-d7da-4e22-52db-08d349dab2bd X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2134;2:e/xYLpIojxjetqzQXOdzVzWkP9P7d8lIXGpUd+j0ngLsoNUkLO1oxn/m76vIX5FmMRF/l7Zo+LFasORHq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EUR3hXqSlM10M+YBgKfMLjgmCrOsSsN1h2sJE1928IEhYXb/oy+bwepmoRXZOQ8ksnueHvV/5+YKWlslv7I+bFpNUKsrf+Jz33CoLG8RkkaW2nhyFYSJOZkoL97ew5my79khyDdILBONamDFBCmPrvB1PRH80a1Rf2csD7o73Fp6li5iIFmbI7gofUWBuuMXmttMSOgf0zN05hKE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:CY1PR07MB2134;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB2134; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2134;4:x2Ynnm/dDkKi6AWDbIaK++OoVTaGkZEYN0km3tK8D2lw01b91+qUel5tNwdORcUw+5Gs7p7XOK0f9w7bbu3fogu6xIy2QzCjRruB3WZQ94gzojKQnY3TmG8YKKZ6QdDjho9QjeZxVcqH7RJ8bgK4+tOMm5M9AzeMmCB1GUMfaCMR7rGi2+s0rz2oJKIL97r3me80DXGm2dkt9G+PK31UnZPlsUnuh+5LnYFeMgITiu97Ev32pfKsbEqGfGfvUBnt4FVwlB5xZ4M7Ht3d1ehIfvPtKsJNG3i3WPO0nupMQVmeXQ78Cz0iPmc6BaRpva9TrzCKPfLUiSR4YtAmpDVr2xZUgZ64mWuDd1BhXjHYF6pOQXPJam1eHpfA6JSl4yhK X-Forefront-PRVS: 087894CD3C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(24454002)(479174004)(377454003)(65806001)(65956001)(66066001)(4001350100001)(92566002)(36756003)(189998001)(15975445007)(53416004)(2906002)(110136002)(2950100001)(5004730100002)(4326007)(33656002)(42186005)(77096005)(230700001)(80316001)(19580395003)(1096002)(47776003)(87266999)(5008740100001)(81166005)(23756003)(83506001)(65816999)(59896002)(50466002)(16799955002)(76176999)(93886004)(586003)(50986999)(64126003)(54356999)(3846002)(6116002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2134;H:dl.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?iso-8859-1?Q?1;CY1PR07MB2134;23:Z10RkCr738PqNhmIu1PRnPdURB8YgGQJyExczig?= =?iso-8859-1?Q?Fv5NKKBVxzOaJ6HOtX6DkbY6u8NzpjSvlJ7c9xKSshC+5ph9hkPnmO7DSE?= =?iso-8859-1?Q?Q+juZKyqsGw9+LgTl3Sfjl4lMkbYOyDaBTi9jMv0rYVyEtQVkekWDAx90R?= =?iso-8859-1?Q?xP+BPOSeMCjc8H81tKK92qCBDWJKkOerH+6Qw/eAbKTOw9imweDzU3XH4y?= =?iso-8859-1?Q?Wg7JRD5HEwuKgICJc/JPiaVXnfWrnmggb+E6Pb5nEtHy5m7ii6yeWkhVLQ?= =?iso-8859-1?Q?yDoHYG9hYbLQc7i53sFgyFlHvSQ2x3fTYPne7KNCrNCmQh4T+5Gq7UZMcC?= =?iso-8859-1?Q?KSx8RnEJGBCCf4OqqMukUwlzsLHDFwZ1OsSZ1s3l4eOMNMxwTNB2ZR2qe6?= =?iso-8859-1?Q?N0CtbNJ0DwtimKHhTCyQTAQ2ryquEiAzG4gteqMAV2wuOuavznQiJ3Cy5u?= =?iso-8859-1?Q?WvyWMHfeYflpFaj237o4VpP23jsmajvwZiF6drRaQxyHbqBquSSzoO/M7f?= =?iso-8859-1?Q?+GkHb57RGv5YEqIGbJtkU5de+xcCH6T6P9liaV4lNxlxdhRpK5r4iUtjb9?= =?iso-8859-1?Q?TI7UDQPMTrFLV4c2SJ9Ry+V8Ea2EA9OablI6o8Ntbm0M8XV9g3mMWwIMEG?= =?iso-8859-1?Q?u3vf2NawQ0JCXgfDTihB0fF1LoxqmsaOdiGf26w/mcNLLHkJw18s1vQ/kS?= =?iso-8859-1?Q?0zoWJdMh02TT/1DTY6DufGu5W7B00UBde/nnKs2tj3mC4QlZJ0Rgv9f7Jb?= =?iso-8859-1?Q?5NM2yFF1GH/nrylOp4aP4KbCSJDljagaXdKZxozUtMMPzC77GY4WZAH3fZ?= =?iso-8859-1?Q?fJFFXwkfkBjwESZNw5AkM1x+a5rNyinwrYVjDd4gKK9Xdxguiqs96UKwdI?= =?iso-8859-1?Q?o+wJpcyjORkLK9OuyS4zXpvcFhXAdj36RUbI64XPvjOCrP4pXYOcaUYsQk?= =?iso-8859-1?Q?r2pdaU92YRaT95uanU2xZhJKBVNKcG+pYeOsRuZiD4DxmsMjGxq3764Mcs?= =?iso-8859-1?Q?4RB6VbwCx1s+Anmiqo0WtqKE2TDKzJjNVIVB1EFptaVCOIu/2DpeyV9/ZB?= =?iso-8859-1?Q?ePMfOPhCDv4puD1t0c6E759JNdXvek6SfO2TMzUbAxRLUpd5kMRVAcfzxU?= =?iso-8859-1?Q?fCEX1M+/M53P7OTFM3QRaHW+AEkB16hC65uRd3zKWA2A1T0sov85mLvSOI?= =?iso-8859-1?Q?iiSGdiR//xGz7QjLk+dRiiHvHAclV7Xyw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2134;5:Ibum3/8XSHtBIfaCR4oevUjsgtNoLlNJf5cj2d+xawbBPZcc1NZhiz+1izKaKIaxjsPaRUcisa1DH5PvLfPjLU3XvkIKOdWnOnIYgm+Epze0ODYXeruelW6uuTuZuH1Wsq/qv6kHnbzY98l5PuQrLA==;24:HTGtuVsP0GMSNrKzJpe26+gp3VC9l/9z06sn7rd+alPLaCoH/ie4FfUEPxNvxMyhBpa1BAKYbenrELnSx5wkUk6Jb5Nbfy/MTbzbqnNirmU= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2016 18:26:42.2790 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2134 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3159 Lines: 84 On 03/11/2016 10:00 AM, Andrew Lunn wrote: > On Fri, Mar 11, 2016 at 09:41:06AM -0800, David Daney wrote: >> On 03/11/2016 09:31 AM, Andrew Lunn wrote: >>>> + phy_np = of_parse_phandle(node, "phy-handle", 0); >>>> + /* If there is no phy or defective firmware presents >>>> + * this cortina phy, for which there is no driver >>>> + * support, ignore it. >>>> + */ >>>> + if (phy_np && >>>> + !of_device_is_compatible(phy_np, "cortina,cs4223-slice")) { >>> >>> Hi David >>> >>> What is a cortina,cs4223-slice, >> >> It is 1/4 of: >> >> https://www.inphi.com/products/cs4223.php >> >>> and why does it need to be handled differently? >>> >> >> $ ls drivers/net/phy/*cortina* >> ls: cannot access drivers/net/phy/*cortina*: No such file or directory >> >> For this configuration of thunder_bgx.c, the use of a Linux PHY >> driver is optional. >> >> The firmware should probably not specify a PHY here, but it does so >> we ignore it so we don't wait around forever for the non-existent >> driver to bind. > > Hi David > > I don't see why it should wait around forever. I have boards with > Marvell PHYs, yet if i don't build the Marvell driver, the Ethernet > driver still loads, because the generic PHY driver is used instead. > Why does this not work here? As I said before, there is no driver for the device, so of_phy_find_device() will always return NULL. It appears that the architects of the cs4223 were not familiar with the various IEEE specifications for PHYs, so unsurprisingly, the device cannot be handled by any standards compliant generic drivers. The Marvell PHY architects, on the other hand, seem to have designed their devices with a keen eye for following the standards. So, also unsurprisingly, the Marvell devices work perfectly with the generic drivers. > > Also, Documentation/devicetree/bindings/net/phy.txt says: > > compatible: Compatible list, may contain > "ethernet-phy-ieee802.3-c22" or "ethernet-phy-ieee802.3-c45" for > PHYs that implement IEEE802.3 clause 22 or IEEE802.3 clause 45 > specifications. If neither of these are specified, the default is to > assume clause 22. > > If the phy's identifier is known then the list may contain an entry > of the form: "ethernet-phy-idAAAA.BBBB" where > AAAA - The value of the 16 bit Phy Identifier 1 register as > 4 hex digits. This is the chip vendor OUI bits 3:18 > BBBB - The value of the 16 bit Phy Identifier 2 register as > 4 hex digits. This is the chip vendor OUI bits 19:24, > followed by 10 bits of a vendor specific ID. > > The compatible list should not contain other values than those > listed here. > > So having "cortina,cs4223-slice" in the compatible string goes against > the binding. Yes, you are probably correct. That is why the comment in the patch explains the strategy of ignoring this node that is not complaint with the binding document. > To make this work, you probably need to extend the > whitelist_phys list in of_mdio.c. That wouldn't work. There is no driver for the PHY, putting it on a white list doesn't solve the missing driver problem.