Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932324AbdLREBf (ORCPT ); Sun, 17 Dec 2017 23:01:35 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:60538 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1757773AbdLREBc (ORCPT ); Sun, 17 Dec 2017 23:01:32 -0500 X-UUID: 9298b3ad92a94c19b0460a2cbf59975b-20171218 Message-ID: <1513569684.24235.12.camel@mtkswgap22> Subject: Re: [net-next] phylib: Add device reset GPIO support causes DSA MT7530 acquires reset-gpios fails From: Sean Wang To: Andrew Lunn CC: , , , , , , , , Date: Mon, 18 Dec 2017 12:01:24 +0800 In-Reply-To: <20171215101014.GB4213@lunn.ch> References: <1513320903.28444.65.camel@mtkswgap22> <20171215101014.GB4213@lunn.ch> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1267 Lines: 35 On Fri, 2017-12-15 at 11:10 +0100, Andrew Lunn wrote: > On Fri, Dec 15, 2017 at 02:55:03PM +0800, Sean Wang wrote: > > Hi Sergei, > > > > Recently I found the patch commit bafbdd527d56 (phylib: Add device reset > > GPIO support) would have the impact on MT7530 driver. Which causes the > > DSA MT7530 device (it's the child node under mdio bus) gets the > > reset-gpios fails because the same GPIO seems already be held in the > > earlier mdiobus_register_device call patched through the commit. > > > > do you have any idea how the commits also considers DSA case ? > > > > I guessed the DSA lan9303, mv88e8 switch should have the same issue > > since they have the same GPIO name as mdiobus_register_device required. > > Hi Sean > > Ah, not good :-( > > I _think_ for the mv88e6xxx, we can remove the gpio reset code from > the driver, and let the mdio core do it. I need to test to be sure. > > Would that work for you? > > Andrew > It probably can't. Because before the GPIO line is manipulated to reset, certain power control should be handled such as power sources from external PMIC to let devices actually enter the proper state. So, I thought the kind of reset should be better controlled by the specific driver, not by generic core. Sean