From: Arnd Bergmann <arnd@arndb.de>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Boris Brezillon <boris.brezillon@free-electrons.com>,
Marek Vasut <marek.vasut@gmail.com>,
Brian Norris <computersforpeace@gmail.com>,
Richard Weinberger <richard@nod.at>,
David Woodhouse <dwmw2@infradead.org>,
linux-mtd <linux-mtd@lists.infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Stefan Roese <sr@denx.de>
Subject: Re: [PATCH] spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH
Date: Mon, 16 Oct 2017 14:34:33 +0200 [thread overview]
Message-ID: <CAK8P3a1R=K5c7e9c72b4j612YVUoFzPs_+v8jN4FfBfWs+Ut-A@mail.gmail.com> (raw)
In-Reply-To: <CAEUhbmXmw9uGwnAQBd2bRYvGfmCAyJFAswp33Y5LvJREB7pjmA@mail.gmail.com>
On Sun, Oct 15, 2017 at 3:38 PM, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Fri, Oct 13, 2017 at 7:15 PM, Arnd Bergmann <arnd@arndb.de> wrote:>> On Wed, Oct 11, 2017 at 10:03 AM, Cyrille Pitchen
>> warning: (SPI_INTEL_SPI_PLATFORM && ITCO_WDT) selects LPC_ICH which
>> has unmet direct dependencies (HAS_IOMEM && PCI)
>> drivers/mfd/lpc_ich.c: In function 'lpc_ich_init_spi':
>> drivers/mfd/lpc_ich.c:1137:3: error: implicit declaration of function
>> 'pci_bus_write_config_byte'; did you mean 'pci_write_config_byte'?
>> [-Werror=implicit-function-declaration]
>>
>
> Thanks for your testing. However, I believe this build error cannot be
> seen in a real system due to x86 always has PCI on. But I see you were
> doing build testing with COMPILE_TEST.
I don't think there is a general dependency on PCI for x86, other
than the fact that most device drivers require it and you'd normally
want to enable it.
>> Also, the 'depends on EXPERT' statement looks misplaced,
>> enabling EXPERT should only be there to allow you to turn
>> extra things *off*, not to hide device drivers.
>>
>
> I will leave this to Mika to comment the "EXPERT" usage. If we remove
> this, I think that should be another patch and the documentation of
> this driver should be updated too.
Ok.
>> How about this:
>>
>> diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
>> index 19bcb63a1ce7..b81d9b4dae7b 100644
>> --- a/drivers/mtd/spi-nor/Kconfig
>> +++ b/drivers/mtd/spi-nor/Kconfig
>> @@ -90,7 +90,7 @@ config SPI_INTEL_SPI
>> tristate
>>
>> config SPI_INTEL_SPI_PCI
>> - tristate "Intel PCH/PCU SPI flash PCI driver" if EXPERT
>> + tristate "Intel PCH/PCU SPI flash PCI driver"
>> depends on X86 && PCI
>> select SPI_INTEL_SPI
>> help
>> @@ -106,10 +106,10 @@ config SPI_INTEL_SPI_PCI
>> will be called intel-spi-pci.
>>
>> config SPI_INTEL_SPI_PLATFORM
>> - tristate "Intel PCH/PCU SPI flash platform driver" if EXPERT
>> - depends on X86
>> + tristate "Intel PCH/PCU SPI flash platform driver"
>> + depends on X86 && (PCI || COMPILE_TEST)
>> select SPI_INTEL_SPI
>> - select LPC_ICH
>> + select LPC_ICH if PCI
>
> I think we just need do:
>
> depends on X86 && PCI
>
> then
>
> select LPC_ICH
Right, that would solve this particular build issue, just not
allow the compile-test alternative.
We could also try to fix this more broadly, to allow compile-testing
independent of X86: It is bad style to have a 'select' statement for
a user-visible symbol (both in my version above, and yours).
The only connection I see between LPC_ICH and
SPI_INTEL_SPI_PCI is that at the moment that MFD driver is the
only thing that provides a platform device named "intel-spi", but I
see no reason why the spi-nor driver needs to know about this.
In similar cases on ARM, I tend to recommend something like
config SPI_INTEL_SPI_PLATFORM
tristate "Intel PCH/PCU SPI flash platform driver" if LPC_ICH
|| COMPILE_TEST
select SPI_INTEL_SPI
and then change all the other 'select LPC_ICH' to 'depends on
as well. If we leave the 'select' in place here, it might be good to
remove the prompt from the LPC_ICH option and have it only
selected by the other drivers.
Arnd
next prev parent reply other threads:[~2017-10-16 12:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-25 8:12 [PATCH] spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH Bin Meng
2017-08-25 10:40 ` Mika Westerberg
2017-08-25 12:11 ` Bin Meng
2017-08-27 14:44 ` Mika Westerberg
2017-08-25 12:12 ` Stefan Roese
2017-10-11 8:03 ` Cyrille Pitchen
2017-10-13 11:15 ` Arnd Bergmann
2017-10-14 6:09 ` Cyrille Pitchen
2017-10-15 13:38 ` Bin Meng
2017-10-16 12:34 ` Arnd Bergmann [this message]
2017-10-23 12:12 ` Mika Westerberg
2017-10-24 7:08 ` Bin Meng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAK8P3a1R=K5c7e9c72b4j612YVUoFzPs_+v8jN4FfBfWs+Ut-A@mail.gmail.com' \
--to=arnd@arndb.de \
--cc=bmeng.cn@gmail.com \
--cc=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@wedev4u.fr \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=mika.westerberg@linux.intel.com \
--cc=richard@nod.at \
--cc=sr@denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).