Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752347AbdGGLIT (ORCPT ); Fri, 7 Jul 2017 07:08:19 -0400 Received: from mail-eopbgr10056.outbound.protection.outlook.com ([40.107.1.56]:51650 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751659AbdGGLIQ (ORCPT ); Fri, 7 Jul 2017 07:08:16 -0400 From: Andy Duan To: Richard Leitner , "robh+dt@kernel.org" , "mark.rutland@arm.com" CC: "netdev@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "dev@g0hl1n.net" , Andrew Lunn Subject: RE: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable option Thread-Topic: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable option Thread-Index: AQHS9liVhz49Jf19SE+3rJ5oc5evWaJH0raAgAAKjoCAAASU8IAAPw0AgAATqGA= Date: Fri, 7 Jul 2017 11:08:13 +0000 Message-ID: References: <1499346330-12166-1-git-send-email-richard.leitner@skidata.com> <1499346330-12166-2-git-send-email-richard.leitner@skidata.com> <81105c77-d48f-271b-2de1-c877b9413184@skidata.com> <6de114cb-4521-4bb2-d0a3-4aea32936bd3@skidata.com> In-Reply-To: <6de114cb-4521-4bb2-d0a3-4aea32936bd3@skidata.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: skidata.com; dkim=none (message not signed) header.d=none;skidata.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [199.59.231.64] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM4PR0401MB2259;7:feAV6vuYRN1F1+5WAdzqWMkz6dxOMUdvw03TjKnp0MCZU3a5okjOdba1i7GZ9728GXJQSIYver8NqNSUY1c9QbjH0yyuJn3n6pZ3pnTGExWpk/1nv9GzGLBc/7JAer/RVl3WZytB/FyWbDd0N/2DWVsZ4PgmxKzOU7GXTzTWl1ZmmFX2HArbiNPVC6I6wMXNpvLB5NKc9y1QWMlNC9Y0ZNuwMjpbxYPXqXieNj81Js7YnLR1j8KPjIFuL003t1dUPaUNfNZwQGrc44S3bRfkmDKGFeqzdBSUI7xUVB9EBNxUq9dmq2aJLiHZPisTBNUgECYOfKTmo95SYrdJbUA1yme550GOB0+fTapN2VmAcq3cLt9GDJV/ayrg4JYum7BvYygLWPEpr/pfqu4VqveLgSSDAXcNmFhVu2se86wuheEgmOPUV23r3zIJ0SFtuoEnJFKpBDcuralbPGw5L5pcydMkj7cuL+kPofC4mufFkRI7dmpH/jbQBrgwhZ723rX5mBmj/hXNkE9RPUcyb7Q5xiEkpk2+9x2V7RrUGSec72bvka9LLfQ0NXkdw5FCOvdd6YPrKal5ZVAUloe+apEJnW7eWit9nKFvg4wllyPfeJI3zRgSaelLu9APDu7HvjCY/lBIANONOH4a/PvOnz8hFpzP0RQ0xbZKinmyM8cOFGakCFETq4H1kK0AchQUHi+m/19YD/yIVE+mPV6p6O6BtsC9k+goYRHZKLvQ6SbIIuZuljk8QWmOaPhZ1225iaLixZ0FTIwBSqfHipqYAWq+bIghWog24gOPX3vLhjnGQq0= x-ms-office365-filtering-correlation-id: 0477a593-0ceb-40b3-4290-08d4c52875c6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(48565401081)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:AM4PR0401MB2259; x-ms-traffictypediagnostic: AM4PR0401MB2259: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(236129657087228)(9452136761055)(185117386973197)(48057245064654)(247924648384137)(17755550239193); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(2017060910062)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123558100)(20161123562025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:AM4PR0401MB2259;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:AM4PR0401MB2259; x-forefront-prvs: 0361212EA8 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39840400002)(39450400003)(39410400002)(39400400002)(39860400002)(39850400002)(24454002)(377454003)(8936002)(478600001)(9686003)(81166006)(6506006)(55016002)(7696004)(8676002)(66066001)(54906002)(33656002)(54356999)(4326008)(102836003)(2950100002)(99286003)(6116002)(189998001)(575784001)(86362001)(2906002)(229853002)(38730400002)(25786009)(2900100001)(53936002)(50986999)(2501003)(76176999)(3846002)(5250100002)(5660300001)(6246003)(74316002)(3660700001)(14454004)(3280700002)(305945005)(6436002)(7736002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR0401MB2259;H:AM4PR0401MB2260.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jul 2017 11:08:13.0643 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0401MB2259 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 quoted-printable to 8bit by nfs id v67B8SBn018230 Content-Length: 2362 Lines: 60 From: Richard Leitner Sent: Friday, July 07, 2017 5:53 PM >To: Andy Duan ; robh+dt@kernel.org; >mark.rutland@arm.com >Cc: netdev@vger.kernel.org; devicetree@vger.kernel.org; linux- >kernel@vger.kernel.org; dev@g0hl1n.net; Andrew Lunn >Subject: Re: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable >option > > >On 07/07/2017 09:03 AM, Andy Duan wrote: >> From: Richard Leitner Sent: Friday, July >> 07, 2017 1:51 PM >>>> Since it is common issue so long as using the PHY, can you move it >>>> into smsc >>> phy driver like in .smsc_phy_reset() function ? >>>> And get the reset pin from phy dts node. >>> >>> Some more points that come into my mind: >>> - The smsc_phy_reset function is registered as "soft_reset". Would >>> it be OK to use nRST in it? >> >> It is not reasonable. >> >>> - Would it be OK to call the phy_init_hw function from within the >>> smsc_phy_reset? >> >> No, phy_init_hw() already call .drv->soft_reset(). >> >>> - IMHO I'd have to move the reset gpio binding inside the phy node >>> then. Isn't that a pretty big change doing that for all PHYs/FECs? Would it be >"worth" it? >>> >> To make the change to be common, there have big change for phy driver. >> Maybe somebody can give one good suggestion/solution for it. > >Sorry, I don't think I understood everything correctly: > >1. The "phy-reset-gpios" binding should go inside the phy node. This will cause >to *change ALL FEC and PHY drivers*. Correct? > The "phy-reset-gpios" binding should go inside the phy node that is more reasonable. It is better PHY core driver handle phy hw reset. >2. Add an additonal "hard reset" function to the PHY driver which handles the >"phy-reset-gpios". Correct? > Correct. >3. Who should then trigger the "hard reset" of the PHY? phy_init_hw? The FEC? > >The point is that the LAN8710 is currently not always working correctly, >therefore this small change was proposed. Should we really change all >PHY/FECs only because of this? >Furthermore one problem still remains: The enet_refclk is controlled by the >FEC. How does the PHY recognize when it was disabled/enabled? > Your patch is workaround for the issue. As you pointed out these is a common issue. So we hope to get a better solution to handle these in common code. Andy