Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7090010ybi; Thu, 1 Aug 2019 03:03:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMaTRQFqi3cC5r0ed6IFkpUnCEzjpWXyy1ghGiDpVXozZeEbu3csBEIDIFAhrFwxGT/Blp X-Received: by 2002:a17:90a:4803:: with SMTP id a3mr7920729pjh.58.1564653834208; Thu, 01 Aug 2019 03:03:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564653834; cv=none; d=google.com; s=arc-20160816; b=qkdR1oy4RXudzBS5qf1qe/nVpOTZyaL2Vn7NbWJlC6AzL93v9uxbhel3Yq51aAc13W u713tFXZapMB1r8OxVXqJttC2h0dcz+B2DjTYrxv7fpumXqSRapXVKhXkDwHZ4kR1Vts wLNP9xa4ncsiPqLnOO5p/ZOw91365Dv9S2GcozMJEJs28ksu+MPhdXfwRE76DMVrXQNq dnhS4f1ITyCG2b4eZmOhXs746xpDDYh2/zf1x/A/5YBYHqNI699yKLGBZ783FX5weRt/ 0Wb0KDmcMmx/KbCWmEN4KgwUDqedti2kJ961Dph4++D8VQmmk3jtPidKLKxSfQb6K7hh F1+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=o4rjBa+wwSvYSMwhp0lXA+I8fDMQOlw5TG+xOqDjsw0=; b=hWYyD+ADuzU6UZ9lzuqA1yUFTJmj2skhLTvlZZTqIjPKw8Gwu9luWvMJeVvzDub5Vb wVjoPujJQeAJm75SvWDrTh1uwxOmg1Y2uNm+mSk/VVHSVcVkDrQaDadGOewhBJki+Sir m9o0d7T8sugbOyDBDZCx6T2zp/KzZjlcfdXKg/gwy0FKOSY/t7Jnfkzi/9anWQkPkzDx OnH4L1C6dzGLJvB+0JhOERr0tqIBYKjupofHA1HoNl6wy3mhLCGgseC8hzo7N1WULuW+ kJ4BoyyKjySe3h1Gei98JgCES/8J8jKhUj1YzTTSWs0zHKR/A2nSACa717TpgWV9Lxhc RKBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z190si36681769pgd.303.2019.08.01.03.03.37; Thu, 01 Aug 2019 03:03:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729091AbfHAJzf (ORCPT + 99 others); Thu, 1 Aug 2019 05:55:35 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:46879 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725283AbfHAJzf (ORCPT ); Thu, 1 Aug 2019 05:55:35 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ht7o3-0000nO-Dh; Thu, 01 Aug 2019 11:55:31 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1ht7o1-0006Fm-FK; Thu, 01 Aug 2019 11:55:29 +0200 Date: Thu, 1 Aug 2019 11:55:29 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Schrempf Frieder Cc: Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-serial@vger.kernel.org" , Jiri Slaby Subject: Re: [PATCH] serial: imx: Avoid probe failure in case of missing gpiolib Message-ID: <20190801095529.dm3pvgts6cy6mbiq@pengutronix.de> References: <20190801081524.22577-1-frieder.schrempf@kontron.de> <20190801084827.m42ci3amo37hmesi@pengutronix.de> <0674d68b-99fa-3408-1dd1-22dc84144b43@kontron.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0674d68b-99fa-3408-1dd1-22dc84144b43@kontron.de> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 01, 2019 at 09:28:33AM +0000, Schrempf Frieder wrote: > Hi Uwe, > > On 01.08.19 10:48, Uwe Kleine-K?nig wrote: > > On Thu, Aug 01, 2019 at 08:18:05AM +0000, Schrempf Frieder wrote: > >> From: Frieder Schrempf > >> > >> If CONFIG_GPIOLIB is not enabled, mctrl_gpio_init() will return > >> -ENOSYS and cause the probing of the imx UART to fail. As the > >> GPIOs are optional, we should continue probing in this case. > > > > Is this really still the case? On which version did you hit this > > problem? > > Yes, I think it is. I used v5.2.5, that already has d99482673f95. > > > > > I would expect that is gone with > > d99482673f950817b30caf3fcdfb31179b050ce1 if not earlier. > > I think this is a different problem. If CONFIG_GPIOLIB is disabled, > mctrl_gpio_init() returns -ENOSYS unconditionally here: [1]. The > existing patch (d99482673f95) seems to handle the case when > CONFIG_GPIOLIB is enabled, but no or not all GPIOs are given in the dtb. Ah, I see. I don't think we should handle this on a per-driver basis. So my suggestion is to drop the dummy implementation for mctrl_gpio if GPIOLIB is disabled. Then the behaviour should be consistant with the gpio stuff returning NULL in this case. (Or alternatively adapt the dummy implementation to shortcut and behave identically.) (Having said that I don't like gpiolib's behaviour of returning NULL for the optional calls if it's disabled, but having mctrl_gpio behave differently is worse.) > The sh-sci.c driver has a similar check to skip this case: [2]. This should than be dropped, too. Best regards Uwe > [1] > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/serial/serial_mctrl_gpio.h#n121 > [2] > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/serial/sh-sci.c#n3290 -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |