Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964848AbdLRTVl (ORCPT ); Mon, 18 Dec 2017 14:21:41 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:38950 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934949AbdLRTVg (ORCPT ); Mon, 18 Dec 2017 14:21:36 -0500 X-Google-Smtp-Source: ACJfBovzo2/hRLNI24qmWgTAiIEofs73FYio3leByJHGssw0eFNUSsuRujAAd1k39wwg9IGFYMBNCQ== Subject: Re: [net-next] phylib: Add device reset GPIO support causes DSA MT7530 acquires reset-gpios fails To: Andrew Lunn , Sean Wang Cc: sergei.shtylyov@cogentembedded.com, vivien.didelot@savoirfairelinux.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, richard.leitner@skidata.com, geert+renesas@glider.be References: <1513320903.28444.65.camel@mtkswgap22> <20171215101014.GB4213@lunn.ch> <1513569684.24235.12.camel@mtkswgap22> <20171218080120.GD30815@lunn.ch> From: Florian Fainelli Message-ID: <5cf08589-b4e4-3b4c-cc3e-c6100492155f@gmail.com> Date: Mon, 18 Dec 2017 11:21:29 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20171218080120.GD30815@lunn.ch> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1245 Lines: 33 On 12/18/2017 12:01 AM, Andrew Lunn wrote: > Hi Sean > >> 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. > > Yes, the driver should do it in that case. > > So we have a few choices: > > 1) Change the name of one of the properties > > 2) Make the new code look at the compatible string, any only apply a > reset if it is a PHY. > > 3) Make the new code only hold the gpio when it needs it. Same for the > driver, so that they both can reset the device. > > Any other ideas? Any preferences? 2) and 3) are probably simpler to > do, less backwards compatibility issues. 3) potentially could cause > issues when a device is reset in the wrong context, because of > external PMIC etc. So i'm thinking 2). We could also add some sort of flag that indicates whether the reset should be managed by the core, or the driver, I would have to double check there is not a chicken and egg problem and that the driver probe is early enough this can happen... -- Florian