Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754644AbcCWKMT (ORCPT ); Wed, 23 Mar 2016 06:12:19 -0400 Received: from smtpoutz27.laposte.net ([194.117.213.102]:42006 "EHLO smtp.laposte.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752037AbcCWKMM (ORCPT ); Wed, 23 Mar 2016 06:12:12 -0400 Message-ID: <56F26BF7.3090201@laposte.net> Date: Wed, 23 Mar 2016 11:12:07 +0100 From: Sebastian Frias User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: =?windows-1252?Q?Uwe_Kleine-K=F6nig?= CC: Daniel Mack , "David S. Miller" , netdev@vger.kernel.org, lkml , mason , Florian Fainelli , Mans Rullgard , Fabio Estevam , Martin Blumenstingl , Linus Walleij Subject: Re: [PATCH] net: phy: at803x: don't depend on GPIOLIB References: <56E99727.9040702@laposte.net> <20160318125455.GN4292@pengutronix.de> <56EC2525.8000706@laposte.net> <20160318191242.GQ4292@pengutronix.de> <56EFEDAD.9030903@laposte.net> <20160321135457.GX4292@pengutronix.de> <56F0150F.8080804@laposte.net> <20160321201229.GA6191@pengutronix.de> <56F157EF.5080307@laposte.net> <20160322194224.GF6191@pengutronix.de> In-Reply-To: <20160322194224.GF6191@pengutronix.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-VR-SrcIP: 83.142.147.193 X-VR-FullState: 0 X-VR-Score: -100 X-VR-Cause-1: gggruggvucftvghtrhhoucdtuddrfeekkedrudeigddufecutefuodetggdotefrodftvfcurfhrohhf X-VR-Cause-2: ihhlvgemucfntefrqffuvffgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhs X-VR-Cause-3: ucdlqddutddtmdenucfjughrpefkfffhfgggvffufhgjtgfgsehtkegrtddtfeehnecuhfhrohhmpefu X-VR-Cause-4: vggsrghsthhirghnucfhrhhirghsuceoshhfkeegsehlrghpohhsthgvrdhnvghtqeenucfkphepkeef X-VR-Cause-5: rddugedvrddugeejrdduleefnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghloheplgdu X-VR-Cause-6: jedvrddvjedrtddrvddugegnpdhinhgvthepkeefrddugedvrddugeejrdduleefpdhmrghilhhfrhho X-VR-Cause-7: mhepshhfkeegsehlrghpohhsthgvrdhnvghtpdhrtghpthhtohepuhdrkhhlvghinhgvqdhkohgvnhhi X-VR-Cause-8: ghesphgvnhhguhhtrhhonhhigidruggv X-VR-AvState: No X-VR-State: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1512 Lines: 47 Hi Uwe, On 03/22/2016 08:42 PM, Uwe Kleine-K?nig wrote: > Hello Sebastian, > > On Tue, Mar 22, 2016 at 03:34:23PM +0100, Sebastian Frias wrote: >> I think we are in a deadlock :-) >> I'm going to reply inline below, but I will also send a different email >> to Daniel with a small recap. >> I think he should share the intent of the "reset" mechanism he >> introduced, in particular if it is mandatory. > > The things I said in my mail are valid in general, not only for the > at803x phy. > > Let me repeat them once more: > > Preconditions: > - Some of the devices a given driver handles have a reset line and > others don't. > - A non-empty subset (maybe all) of the devices that have a reset line > require that this reset line is used. > > Then the way to handle this in the driver should be done as follows: > > unless reset_handling_not_necessary(): > gpio = gpiod_get_optional("reset") > if IS_ERR(gpio): > return PTR_ERR(gpio) > > Checking for -ENOSYS or GPIOLIB=n is not allowed because the device > you're currently handling might need the GPIO, so you must not continue > without the ability to control the line. > > So the options you have (as you have a phy that doesn't need the reset > handling): > > - enable GPIOLIB (either in your .config or introduce a Kconfig > dependency) > - improve reset_handling_not_necessary() to return true for your case > I will see if I can "improve reset_handling_not_necessary() to return true". Best regards, Sebastian