Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932751AbbHLP1w (ORCPT ); Wed, 12 Aug 2015 11:27:52 -0400 Received: from mail-bl2on0140.outbound.protection.outlook.com ([65.55.169.140]:6189 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751581AbbHLP1u (ORCPT ); Wed, 12 Aug 2015 11:27:50 -0400 From: Madalin-Cristian Bucur To: Stas Sergeev , Florian Fainelli , "netdev@vger.kernel.org" , "grant.likely@linaro.org" , "robh+dt@kernel.org" CC: "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Liberman Igal , Stas Sergeev , "joakim.tjernlund@transmode.se" , Shaohui Xie Subject: RE: [PATCH 0/2] of: fsl/fman: reuse the fixed node parsing code Thread-Topic: [PATCH 0/2] of: fsl/fman: reuse the fixed node parsing code Thread-Index: AQHQz40u7/EeGP0M3EaSWT7KT29M554CYVyAgASdLgCAAAcBIIAACVUAgAFL3eCAABP/gIAABbOQgAAOUgCAAAFHEA== Date: Wed, 12 Aug 2015 15:27:47 +0000 Message-ID: References: <1438785745-15517-1-git-send-email-madalin.bucur@freescale.com> <55C63D3B.5020005@gmail.com> <55CA1C14.3000202@list.ru> <55CA29C8.5000707@list.ru> <55CB50F1.7050308@list.ru> <55CB61BC.1050209@list.ru> In-Reply-To: <55CB61BC.1050209@list.ru> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=madalin.bucur@freescale.com; x-originating-ip: [192.88.166.1] x-microsoft-exchange-diagnostics: 1;BL2PR03MB499;5:tQ8TLH4ZrjM9UmlM0DVUA7Ww4l+WZICRsrhacHVsEAz0H7QKVu+thaR7K2TBpkW4jJP8K0X9Xm98VfJsv1dvtnGWUHVYVCkQiUDoT35U+SY3SEDmq7btlzQFKIgyJVeux4Ud4RWzZPSYPS76WhVxLg==;24:B+TU8221G1dmwMdRQzorlylsmiPsSnhNCe5E7TAOPgoCtE0VccpIuU6zLcBclrrP+VLFia650O/6QxoAZHIwjwWW9aNH6fa+5lCh6JiIW9M=;20:guxCYdcwboThM+WC9sSLTF9hTSmVCk1ZtAeyIU2GgZCGGeDyi1PuzHZVk2kGRdwwkTP66J2R16Y6SCH6wA9vOw== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB499; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BL2PR03MB499;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB499; x-forefront-prvs: 0666E15D35 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(189002)(13464003)(199003)(19580405001)(19580395003)(86362001)(122556002)(40100003)(54356999)(92566002)(101416001)(33656002)(189998001)(50986999)(2501003)(99286002)(46102003)(105586002)(74316001)(106356001)(106116001)(2201001)(87936001)(2656002)(93886004)(76176999)(77096005)(102836002)(5003600100002)(5002640100001)(2900100001)(64706001)(2950100001)(15975445007)(66066001)(68736005)(10400500002)(5001960100002)(107886002)(76576001)(5001920100001)(5001830100001)(81156007)(5001860100001)(77156002)(62966003)(5001770100001)(97736004)(4001540100001)(4001430100001)(179675005);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR03MB499;H:BL2PR03MB545.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Aug 2015 15:27:47.5861 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB499 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t7CFRw5C019574 Content-Length: 4281 Lines: 103 > -----Original Message----- > From: Stas Sergeev [mailto:stsp@list.ru] > But have you looked into the patch I pointed previously? > https://lkml.org/lkml/2015/7/20/711 > You code will likely clash with it because my patch extends > of_phy_register_fixed_link(). > I admin I failed to grasp the details of your change - the lack of ample context Lines makes it a bit difficult. I'm sure your change could be merged then the of parsing could be separated from the actual fixed_phy_register() call if anyone cares about that. > > Then I could call only of_* functions but the end result would be the same > > and of_phy_register_fixed_phy() would not justify its existence that much... > You didn't say you wanted to obsolete the of_phy_register_fixed_phy(). > Since it is there (and even changed by me in a way your > patch will likely clash), IMHO it would be better if it is used, > rather than copy/pasted into the driver. Please note I was referring to a fictional new function that would embed the call to fixed_phy_register(). I was not talking about some existing API, just about a new of_call named of_phy_register_fixed_phy() that would in the end be called by of_phy_register_fixed_link() and by some drivers that want to get in the middle of things and get a hold on status. Maybe the fact we're reviewing two patches in one thread is what makes the discussion less than optimal. > > The getter for status you suggest would be fine, but not sure how one > > would retrieve > > it from the mac_node unless we change of_phy_register_fixed_link() to > > return the > > pointer to phy (and all the drivers that use it...). > If you look for instance to mvneta.c, you'll find the following: > --- > err = of_phy_register_fixed_link(dn); > /* In the case of a fixed PHY, the DT node associated > * to the PHY is the Ethernet MAC DT node. > */ > phy_node = of_node_get(dn); > ... > phy = of_phy_find_device(dn); > --- > > So the answer is: just use the same mac_node for both. I understand, I'll use this approach although is suboptimal imho to scan the device tree again to get a phy pointer that you need just to get some of info that was parsed in a call you just made. > >> Also I meant the description should have been in the patch, > >> not in the e-mail. :) You only wrote _what_ the patch does > >> (which is of course obvious from the code itself), but not > >> _why_ and _what was fixed_ (what didn't work). > >> > > If you refer to the first, separation patch, I thought the description was > enough: > > > > of: separate fixed link parsing from registration > > > > Some drivers may need > "may need"? I don't understand. > If it is a fix, then they _do need_, and in this case it should > be specified what was broken and what is fixed. > If it is just a clean-up, then "may need" may suffice, but it > was not mentioned it is a clean-up. So I still don't know what > this patch is all about. > "Some drivers" - which ones? The ones that are limited to > the purely fixed links, and never support AN or MDIO? > Or some other drivers too? > So really, the description sounds very cryptic to me. Mine, when there is a fixed link node, maybe others. When there isn't any fixed link node, the internal PHY config defaults to 1G full duplex AN enabled and adjust link takes care of things. > > > to parse the fixed link values before registering > > the fixed link phy. Separate the parsing from the actual registration > > and provide an export for the added parsing function. > > > > Signed-off-by: Madalin Bucur > > > > For this one it was a bit brief, I admit - the longer version would be that > before it > > we were not using from fixed link anything else but the fact the link was > fixed > > (ignored actual speed, duplex values there) > And what didn't work as the result? > > > and this patch tries to fix that. > What started to work after that patch that didn't without it? 10M half duplex for instance I'd close this thread for now and use in my driver of_phy_find_device(mac_node). Thank you, Madalin ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?