Received: by 10.223.185.116 with SMTP id b49csp6710688wrg; Wed, 28 Feb 2018 14:11:28 -0800 (PST) X-Google-Smtp-Source: AH8x227/U+f3yNcS9ZAD/QDGBMJBO5PE9ykkU7g/Is+CAIUQruPWl1RsQfBYChaDO/JpH08xNbV3 X-Received: by 10.99.110.70 with SMTP id j67mr15426667pgc.202.1519855888194; Wed, 28 Feb 2018 14:11:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519855888; cv=none; d=google.com; s=arc-20160816; b=s8802KqwQgjnIm04grWvs+6+DXJpujwn6d9Xx6LIZr4ugZd52qe7d9udvbRUnuOHNE I2SBu2MIZGqbNV8PccVl1r84QdYbPDNVS6gUQG9GzSaR9XJDQyUZrJHEsRz1sq+mzKXs AB7kX8oQx1as3YKH9fo/8AqO1XV0yBEQZPPGeA579dLB2crWd7Kd9+aTSZqRMuYuonXN FYrI5O7yH4DW4Hm+34YAtBFpFE1aJRcEi9ciZvWVGWFXLtnOh5j50ULk1EV87K/KaJxn TEWsccrXkF77pYD/REI7j/4/xUNXrEMEdd32U76+X1s45spMlF4eVbbr/p4lIN46sBGp alJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=ng3nv8rMVyPAi6JkSOHRaGmmqVOihIeNMChBFLMn994=; b=ma7bBox9LZZ5bSFBXISdObC0v8VFdLNStPer6+xGBxZ3XPgsk3fUVPXTfq4+RAKMth iirB2ppCLc6aywvVzYgbY8scFPbtz0gMIOS6aSa0Ukpo64Sw/bYLf9QKMYh9XB3lPVTO L+PWGoY64GkCV2W4SfqOGsX/3XvZUkrRciv2HN5SrXCD4SH5z071mMfNq5oniEIMYhBx h+vGTR12BBBXCnyZTBB6uLEdxajZDH5Q0oRnic9flmAhzhHPe1GcYagbD4Qzz61hO9+2 mhL793XkM5B31ZOP3feKcceX2o79FWDdiJjMxTu9DP/UIZMe4iswNCFKGja5slWLUjFN KZiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=RlrMscgw; 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 l26si1853893pfj.401.2018.02.28.14.11.13; Wed, 28 Feb 2018 14:11:28 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=RlrMscgw; 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 S935461AbeB1WI6 (ORCPT + 99 others); Wed, 28 Feb 2018 17:08:58 -0500 Received: from mail-qt0-f196.google.com ([209.85.216.196]:39517 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935284AbeB1WIz (ORCPT ); Wed, 28 Feb 2018 17:08:55 -0500 Received: by mail-qt0-f196.google.com with SMTP id f4so5061347qtj.6; Wed, 28 Feb 2018 14:08:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ng3nv8rMVyPAi6JkSOHRaGmmqVOihIeNMChBFLMn994=; b=RlrMscgwgtC3jeUdPips/bs5IdL36NsR93snTwARce98s3G4aJK8sSteQw13KxLnfB eS893PvatnN86qz1oog3evNJpH3iB1+rH5VtGzEufNBXNvCEqy2xnijD0Hr6t1/4FJJZ GXQD+mJHq/IC8s/dzMG3v3qV9ysG2VQyQnX7VExOpWmvVRJtoxGGLCXEy3ysTwMD5G65 sR4wHIjiGE+kBJ1FVvYtymyXaDcB4X6pt8Q0ubMqatBtl+EaVcXfcH3mGaVfL002IN0Z vJVTdqT1GaMfjV1xjBqB5EugCgO3NBfUgvZGLB+ezMmszn3KMBSrILd/Er6NEutySag/ 8OGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ng3nv8rMVyPAi6JkSOHRaGmmqVOihIeNMChBFLMn994=; b=eJDP/2Eo7gzCr9ClymLWG6lxWQdiu+JSt0behsO0vWB9lmZjbQI8Y7bL0y+4bJFjj1 lIGQxL6YglMT74X+14mkqUSymvyPTW2eoB7JHoSNPg4NfzOqfOdupKWMi18+c8TyqUdP +TTG/jbvmp3LeRWoslirgKX0lUTr373HCIi3IeUeBhnYrGGPkN1lPbWNOfdQbskNg8hk ZXzHWtV6rNBt8cOVt6wnYh0wDTLKz4RY1FFAUos5TEA+jlOqhqmXuGkx+9mMhkOvAvYr U+vtu9YeK1RLT7Q6bUklCJYmPabO0+A39qD0x9LDehqv5BLl/nNyN5wFJG+DeA+65Xnh FioQ== X-Gm-Message-State: APf1xPDZ40rUPZlyLK7yuC3BJQSggV37YrADdefQgAO6MZjg2qO8KgyP RfZCCCgmFKng4m8AY1c1NGtiZGbR/oLI028j5nV8Z1UJ X-Received: by 10.200.82.76 with SMTP id y12mr13580658qtn.75.1519855734904; Wed, 28 Feb 2018 14:08:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.185.46 with HTTP; Wed, 28 Feb 2018 14:08:54 -0800 (PST) In-Reply-To: <20180228214725.ewu3zt3l2xyxtxb2@tarshish> References: <20180228134822.2194009-1-arnd@arndb.de> <20180228214725.ewu3zt3l2xyxtxb2@tarshish> From: Arnd Bergmann Date: Wed, 28 Feb 2018 23:08:54 +0100 X-Google-Sender-Auth: qPNSyquVh2-S3tQIwyCkbfvEBow Message-ID: Subject: Re: [PATCH] gpio: raspberrypi-ext: fix firmware dependency To: Baruch Siach Cc: Linus Walleij , Stefan Wahren , Dave Stevenson , linux-gpio@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 28, 2018 at 10:47 PM, Baruch Siach wrote: > 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? The problem I ran into only happens with CONFIG_ARCH_BCM2835=y to start with. My fix handles that case correctly, it forces CONFIG_GPIO_RASPBERRYPI_EXP to be either 'n' or 'm' when CONFIG_RASPBERRYPI_FIRMWARE=m. > What about 'depends on m || RASPBERRYPI_FIRMWARE=y'? That would be (slightly) wrong, it would force CONFIG_GPIO_RASPBERRYPI_EXP to be 'm' even if RASPBERRYPI_FIRMWARE=n. > 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' That is what I did here as well, except the !RASPBERRYPI_FIRMWARE only applies for COMPILE_TEST. > And this: > > drivers/infiniband/Kconfig: depends on m || IPV6 != m This is a less common way to express it. The idiomatic Kconfig expression here would be 'depends on IPV6 || !IPV6'. >> 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. How about # RASPBERRYPI_FIRMWARE is only available for ARCH_BCM2835, but we want to # allow compile-testing when it is disabled ? Arnd