Received: by 10.223.185.116 with SMTP id b49csp6697455wrg; Wed, 28 Feb 2018 13:57:16 -0800 (PST) X-Google-Smtp-Source: AH8x226P6MFOyLz5muGjPgnurgJ4D1RbZcs5hItwfqfNfdJqjZbMr8K782z7swp0aej5S9h0sDod X-Received: by 10.99.114.18 with SMTP id n18mr15218627pgc.169.1519855036878; Wed, 28 Feb 2018 13:57:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519855036; cv=none; d=google.com; s=arc-20160816; b=maRwMqfvdY6l3++cSqvkkmSFkWUhsdVPLC3Cta0vWH3jsVEAAxW6uhweSbeqa4vvzR 3mAT/Vej6Bx2OPDxwu4DAfIYsXWzij1tBnY0FSG4Ti320AoFHmEGPbEpbQkQyhX1J8Db PTqzS1dP+SrproS3feBhJxYQopoijGPkbcU2hFVqyoPLBh8zEwQCkoGft+OoJKj0sy3V +htOReQYCwd46NRmepYs8XnhVQMimw8PUwbgj077n2y3RudkFTiO0KPeDI1UDOj7haQ+ pMw5tU/upC3DCKPRoy7WxjpF06ICCFw3D0FfvoZ3XIPHGLf9GihePMYHuPyeRFXHNFcB E0xQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=J5lPJFih0BTM90ILdqijb1NMOn79aHgd40ZEh2U+f1s=; b=HSw0Wn1hGSiFoS+NrsM6UsIj+NyHXPETjddDIL88CUh/ZbtkzTk4tSRjlCrcxk54mC WRrEnLJwfc9S/GsHF4a1um3LXVanHE9fkqZiRJYpEj2lumV+tP5H3b6BTx6zrna/44wG dNlNPh4mq8rUZjaRHVbIqwVT7odK3U7DKdsOsi3q6aFs59fx410SbY6twpBGlNBPEvCx bU9VHMg+0lVwWNWaS3yYROCsiTArylc29gE0VGQOaTQ8OWhaNad4rSpgsA9HSG41LaQu sM8xwaHmSKJCjc5OYcMCTFaDzuIiIFswpwe69rNmWQiF+g0OtkDI4yQ9xQSYwyVgw19v YJtA== 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 v192si1487763pgb.350.2018.02.28.13.56.59; Wed, 28 Feb 2018 13:57:16 -0800 (PST) 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 S935211AbeB1V4U (ORCPT + 99 others); Wed, 28 Feb 2018 16:56:20 -0500 Received: from guitar.tcltek.co.il ([192.115.133.116]:55170 "EHLO mx.tkos.co.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935108AbeB1V4T (ORCPT ); Wed, 28 Feb 2018 16:56:19 -0500 Received: from tarshish (unknown [10.0.8.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPS id 56EC24402B5; Wed, 28 Feb 2018 23:47:28 +0200 (IST) Date: Wed, 28 Feb 2018 23:47:25 +0200 From: Baruch Siach To: Arnd Bergmann Cc: Linus Walleij , Stefan Wahren , Dave Stevenson , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] gpio: raspberrypi-ext: fix firmware dependency Message-ID: <20180228214725.ewu3zt3l2xyxtxb2@tarshish> References: <20180228134822.2194009-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180228134822.2194009-1-arnd@arndb.de> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, Thanks for the fix. On Wed, Feb 28, 2018 at 02:48:08PM +0100, Arnd Bergmann wrote: > When the firmware driver is a loadable module, the gpio driver cannot be > built-in: > > drivers/gpio/gpio-raspberrypi-exp.o: In function `rpi_exp_gpio_set': > gpio-raspberrypi-exp.c:(.text+0xb4): undefined reference to `rpi_firmware_property' > drivers/gpio/gpio-raspberrypi-exp.o: In function `rpi_exp_gpio_get': > gpio-raspberrypi-exp.c:(.text+0x1ec): undefined reference to `rpi_firmware_property' > drivers/gpio/gpio-raspberrypi-exp.o: In function `rpi_exp_gpio_get_direction': > gpio-raspberrypi-exp.c:(.text+0x360): undefined reference to `rpi_firmware_property' > drivers/gpio/gpio-raspberrypi-exp.o: In function `rpi_exp_gpio_get_polarity': > gpio-raspberrypi-exp.c:(.text+0x4d4): undefined reference to `rpi_firmware_property' > drivers/gpio/gpio-raspberrypi-exp.o: In function `rpi_exp_gpio_dir_out': > gpio-raspberrypi-exp.c:(.text+0x670): undefined reference to `rpi_firmware_property' > drivers/gpio/gpio-raspberrypi-exp.o:gpio-raspberrypi-exp.c:(.text+0x7fc): more undefined references to `rpi_firmware_property' follow > drivers/gpio/gpio-raspberrypi-exp.o: In function `rpi_exp_gpio_dir_in': > drivers/gpio/gpio-raspberrypi-exp.o: In function `rpi_exp_gpio_probe': > gpio-raspberrypi-exp.c:(.text+0x93c): undefined reference to `rpi_firmware_get' > > We already have a Kconfig dependency for it, but when compile-testing, it > is disregarded. > > This changes the dependency so that compile-testing is only done when the > firmware driver is completely disabled. What about the CONFIG_ARCH_BCM2835=y case? The combination of CONFIG_GPIO_RASPBERRYPI_EXP=y and CONFIG_RASPBERRYPI_FIRMWARE=m is still valid. Wouldn't that break the build? Isn't there a way in Kconfig to force CONFIG_GPIO_RASPBERRYPI_EXP=m when CONFIG_RASPBERRYPI_FIRMWARE=m? What about 'depends on m || RASPBERRYPI_FIRMWARE=y'? Grepping around I also found this: drivers/power/supply/Kconfig: depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y' And this: drivers/infiniband/Kconfig: depends on m || IPV6 != m > Fixes: a98d90e7d588 ("gpio: raspberrypi-exp: Driver for RPi3 GPIO expander via mailbox service") > Signed-off-by: Arnd Bergmann > --- > drivers/gpio/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig > index 2ecd2adbaec6..52a8b0a6f4e1 100644 > --- a/drivers/gpio/Kconfig > +++ b/drivers/gpio/Kconfig > @@ -126,7 +126,7 @@ config GPIO_RASPBERRYPI_EXP > tristate "Raspberry Pi 3 GPIO Expander" > default RASPBERRYPI_FIRMWARE > depends on OF_GPIO > - depends on (ARCH_BCM2835 && RASPBERRYPI_FIRMWARE) || COMPILE_TEST > + depends on (ARCH_BCM2835 && RASPBERRYPI_FIRMWARE) || (COMPILE_TEST && !RASPBERRYPI_FIRMWARE) This is really non-obvious. An inline comment here might help, IMO. > help > Turn on GPIO support for the expander on Raspberry Pi 3 boards, using > the firmware mailbox to communicate with VideoCore on BCM283x chips. baruch -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -