linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH
@ 2017-08-25  8:12 Bin Meng
  2017-08-25 10:40 ` Mika Westerberg
  2017-10-11  8:03 ` Cyrille Pitchen
  0 siblings, 2 replies; 12+ messages in thread
From: Bin Meng @ 2017-08-25  8:12 UTC (permalink / raw)
  To: Mika Westerberg, Cyrille Pitchen, Boris Brezillon, Marek Vasut,
	Brian Norris, Richard Weinberger, David Woodhouse, linux-mtd,
	linux-kernel
  Cc: Stefan Roese

The Intel SPI-NOR driver is dependent on LPC_ICH to get the platform
data. Select it in the Kconfig.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 drivers/mtd/spi-nor/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
index bfdfb1e..e998800 100644
--- a/drivers/mtd/spi-nor/Kconfig
+++ b/drivers/mtd/spi-nor/Kconfig
@@ -93,6 +93,7 @@ config SPI_INTEL_SPI_PLATFORM
 	tristate "Intel PCH/PCU SPI flash platform driver" if EXPERT
 	depends on X86
 	select SPI_INTEL_SPI
+	select LPC_ICH
 	help
 	  This enables platform support for the Intel PCH/PCU SPI
 	  controller in master mode. This controller is present in modern
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH
  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-25 12:12   ` Stefan Roese
  2017-10-11  8:03 ` Cyrille Pitchen
  1 sibling, 2 replies; 12+ messages in thread
From: Mika Westerberg @ 2017-08-25 10:40 UTC (permalink / raw)
  To: Bin Meng
  Cc: Cyrille Pitchen, Boris Brezillon, Marek Vasut, Brian Norris,
	Richard Weinberger, David Woodhouse, linux-mtd, linux-kernel,
	Stefan Roese

On Fri, Aug 25, 2017 at 01:12:51AM -0700, Bin Meng wrote:
> The Intel SPI-NOR driver is dependent on LPC_ICH to get the platform
> data. Select it in the Kconfig.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
> 
>  drivers/mtd/spi-nor/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
> index bfdfb1e..e998800 100644
> --- a/drivers/mtd/spi-nor/Kconfig
> +++ b/drivers/mtd/spi-nor/Kconfig
> @@ -93,6 +93,7 @@ config SPI_INTEL_SPI_PLATFORM
>  	tristate "Intel PCH/PCU SPI flash platform driver" if EXPERT
>  	depends on X86
>  	select SPI_INTEL_SPI
> +	select LPC_ICH

How about 

	depends on X86 && LPC_ICH

instead?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH
  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
  1 sibling, 1 reply; 12+ messages in thread
From: Bin Meng @ 2017-08-25 12:11 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Cyrille Pitchen, Boris Brezillon, Marek Vasut, Brian Norris,
	Richard Weinberger, David Woodhouse, linux-mtd, linux-kernel,
	Stefan Roese

Hi Mika,

On Fri, Aug 25, 2017 at 6:40 PM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> On Fri, Aug 25, 2017 at 01:12:51AM -0700, Bin Meng wrote:
>> The Intel SPI-NOR driver is dependent on LPC_ICH to get the platform
>> data. Select it in the Kconfig.
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>> ---
>>
>>  drivers/mtd/spi-nor/Kconfig | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
>> index bfdfb1e..e998800 100644
>> --- a/drivers/mtd/spi-nor/Kconfig
>> +++ b/drivers/mtd/spi-nor/Kconfig
>> @@ -93,6 +93,7 @@ config SPI_INTEL_SPI_PLATFORM
>>       tristate "Intel PCH/PCU SPI flash platform driver" if EXPERT
>>       depends on X86
>>       select SPI_INTEL_SPI
>> +     select LPC_ICH
>
> How about
>
>         depends on X86 && LPC_ICH
>
> instead?

Other LPC_ICH users (like gpio, watchdog) use the 'select' logic, so I
would prefer to keep things consistent.

Regards,
Bin

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH
  2017-08-25 10:40 ` Mika Westerberg
  2017-08-25 12:11   ` Bin Meng
@ 2017-08-25 12:12   ` Stefan Roese
  1 sibling, 0 replies; 12+ messages in thread
From: Stefan Roese @ 2017-08-25 12:12 UTC (permalink / raw)
  To: Mika Westerberg, Bin Meng
  Cc: Boris Brezillon, Richard Weinberger, linux-kernel, Marek Vasut,
	linux-mtd, Cyrille Pitchen, Brian Norris, David Woodhouse

On 25.08.2017 12:40, Mika Westerberg wrote:
> On Fri, Aug 25, 2017 at 01:12:51AM -0700, Bin Meng wrote:
>> The Intel SPI-NOR driver is dependent on LPC_ICH to get the platform
>> data. Select it in the Kconfig.
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>> ---
>>
>>   drivers/mtd/spi-nor/Kconfig | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
>> index bfdfb1e..e998800 100644
>> --- a/drivers/mtd/spi-nor/Kconfig
>> +++ b/drivers/mtd/spi-nor/Kconfig
>> @@ -93,6 +93,7 @@ config SPI_INTEL_SPI_PLATFORM
>>   	tristate "Intel PCH/PCU SPI flash platform driver" if EXPERT
>>   	depends on X86
>>   	select SPI_INTEL_SPI
>> +	select LPC_ICH
> 
> How about
> 
> 	depends on X86 && LPC_ICH
> 
> instead?

I prefer Bin's version, as with your patch, the MTD SPI driver will
not be "seen" / selectable, as long as the LPC_ICH support is not
enabled. I've been hunting such dependencies myself a few times and
find them unnecessary burden.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH
  2017-08-25 12:11   ` Bin Meng
@ 2017-08-27 14:44     ` Mika Westerberg
  0 siblings, 0 replies; 12+ messages in thread
From: Mika Westerberg @ 2017-08-27 14:44 UTC (permalink / raw)
  To: Bin Meng
  Cc: Cyrille Pitchen, Boris Brezillon, Marek Vasut, Brian Norris,
	Richard Weinberger, David Woodhouse, linux-mtd, linux-kernel,
	Stefan Roese

On Fri, Aug 25, 2017 at 08:11:54PM +0800, Bin Meng wrote:
> Other LPC_ICH users (like gpio, watchdog) use the 'select' logic, so I
> would prefer to keep things consistent.

Fair enough.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH
  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-10-11  8:03 ` Cyrille Pitchen
  2017-10-13 11:15   ` Arnd Bergmann
  1 sibling, 1 reply; 12+ messages in thread
From: Cyrille Pitchen @ 2017-10-11  8:03 UTC (permalink / raw)
  To: Bin Meng, Mika Westerberg, Boris Brezillon, Marek Vasut,
	Brian Norris, Richard Weinberger, David Woodhouse, linux-mtd,
	linux-kernel
  Cc: Stefan Roese

Le 25/08/2017 à 10:12, Bin Meng a écrit :
> The Intel SPI-NOR driver is dependent on LPC_ICH to get the platform
> data. Select it in the Kconfig.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

Applied to the spi-nor/next branch of l2-mtd

Thanks!
> ---
> 
>  drivers/mtd/spi-nor/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
> index bfdfb1e..e998800 100644
> --- a/drivers/mtd/spi-nor/Kconfig
> +++ b/drivers/mtd/spi-nor/Kconfig
> @@ -93,6 +93,7 @@ config SPI_INTEL_SPI_PLATFORM
>  	tristate "Intel PCH/PCU SPI flash platform driver" if EXPERT
>  	depends on X86
>  	select SPI_INTEL_SPI
> +	select LPC_ICH
>  	help
>  	  This enables platform support for the Intel PCH/PCU SPI
>  	  controller in master mode. This controller is present in modern
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH
  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
  0 siblings, 2 replies; 12+ messages in thread
From: Arnd Bergmann @ 2017-10-13 11:15 UTC (permalink / raw)
  To: Cyrille Pitchen
  Cc: Bin Meng, Mika Westerberg, Boris Brezillon, Marek Vasut,
	Brian Norris, Richard Weinberger, David Woodhouse, linux-mtd,
	linux-kernel, Stefan Roese

On Wed, Oct 11, 2017 at 10:03 AM, Cyrille Pitchen
<cyrille.pitchen@wedev4u.fr> wrote:
> Le 25/08/2017 à 10:12, Bin Meng a écrit :
>> The Intel SPI-NOR driver is dependent on LPC_ICH to get the platform
>> data. Select it in the Kconfig.
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>
> Applied to the spi-nor/next branch of l2-mtd

This causes a build error now:

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]

Generally speaking, using 'select' to force-enable another
driver is a bad idea and causes endless problems, but if you
insist on doing that, please make sure you get the right
dependencies.

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.

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
        help
          This enables platform support for the Intel PCH/PCU SPI
          controller in master mode. This controller is present in modern

       Arnd

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH
  2017-10-13 11:15   ` Arnd Bergmann
@ 2017-10-14  6:09     ` Cyrille Pitchen
  2017-10-15 13:38     ` Bin Meng
  1 sibling, 0 replies; 12+ messages in thread
From: Cyrille Pitchen @ 2017-10-14  6:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Bin Meng, Mika Westerberg, Boris Brezillon, Marek Vasut,
	Brian Norris, Richard Weinberger, David Woodhouse, linux-mtd,
	linux-kernel, Stefan Roese

Hi Arnd,

Le 13/10/2017 à 13:15, Arnd Bergmann a écrit :
> On Wed, Oct 11, 2017 at 10:03 AM, Cyrille Pitchen
> <cyrille.pitchen@wedev4u.fr> wrote:
>> Le 25/08/2017 à 10:12, Bin Meng a écrit :
>>> The Intel SPI-NOR driver is dependent on LPC_ICH to get the platform
>>> data. Select it in the Kconfig.
>>>
>>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>>
>> Applied to the spi-nor/next branch of l2-mtd
> 
> This causes a build error now:
> 
> 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]
> 
> Generally speaking, using 'select' to force-enable another
> driver is a bad idea and causes endless problems, but if you
> insist on doing that, please make sure you get the right
> dependencies.
> 
> 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.
> 
> 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
>         help
>           This enables platform support for the Intel PCH/PCU SPI
>           controller in master mode. This controller is present in modern
> 
>        Arnd
> 

The patch has been removed from spi-nor/next and updated to 'Rejected'
in patchwork.

Thanks for your report.

Bin, you may have to submit another patch with the correct dependencies
or maybe adopt the "depends LPC_ICH" approach as suggested by Mika.

Best regards,

Cyrille

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH
  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
  2017-10-23 12:12       ` Mika Westerberg
  1 sibling, 2 replies; 12+ messages in thread
From: Bin Meng @ 2017-10-15 13:38 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Cyrille Pitchen, Mika Westerberg, Boris Brezillon, Marek Vasut,
	Brian Norris, Richard Weinberger, David Woodhouse, linux-mtd,
	linux-kernel, Stefan Roese

Hi Arnd,

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
> <cyrille.pitchen@wedev4u.fr> wrote:
>> Le 25/08/2017 à 10:12, Bin Meng a écrit :
>>> The Intel SPI-NOR driver is dependent on LPC_ICH to get the platform
>>> data. Select it in the Kconfig.
>>>
>>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>>
>> Applied to the spi-nor/next branch of l2-mtd
>
> This causes a build error now:
>
> 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.

> Generally speaking, using 'select' to force-enable another
> driver is a bad idea and causes endless problems, but if you
> insist on doing that, please make sure you get the right
> dependencies.
>

Sure.

> 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.

> 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

>         help
>           This enables platform support for the Intel PCH/PCU SPI
>           controller in master mode. This controller is present in modern
>

Regards,
Bin

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH
  2017-10-15 13:38     ` Bin Meng
@ 2017-10-16 12:34       ` Arnd Bergmann
  2017-10-23 12:12       ` Mika Westerberg
  1 sibling, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2017-10-16 12:34 UTC (permalink / raw)
  To: Bin Meng
  Cc: Cyrille Pitchen, Mika Westerberg, Boris Brezillon, Marek Vasut,
	Brian Norris, Richard Weinberger, David Woodhouse, linux-mtd,
	linux-kernel, Stefan Roese

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH
  2017-10-15 13:38     ` Bin Meng
  2017-10-16 12:34       ` Arnd Bergmann
@ 2017-10-23 12:12       ` Mika Westerberg
  2017-10-24  7:08         ` Bin Meng
  1 sibling, 1 reply; 12+ messages in thread
From: Mika Westerberg @ 2017-10-23 12:12 UTC (permalink / raw)
  To: Bin Meng
  Cc: Arnd Bergmann, Cyrille Pitchen, Boris Brezillon, Marek Vasut,
	Brian Norris, Richard Weinberger, David Woodhouse, linux-mtd,
	linux-kernel, Stefan Roese

On Sun, Oct 15, 2017 at 09:38:57PM +0800, Bin Meng wrote:
> > 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.

Yeah, I guess we can remove that EXPERT dependency. It was added there
exactly because I did not want ordinary users playing with the device
and inadvertently overwrite their BIOSes (if it is not protected). I
also agree it should be a separate patch. Do you want to do that or
should I?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] spi-nor: intel-spi: Fix Kconfig dependency to LPC_ICH
  2017-10-23 12:12       ` Mika Westerberg
@ 2017-10-24  7:08         ` Bin Meng
  0 siblings, 0 replies; 12+ messages in thread
From: Bin Meng @ 2017-10-24  7:08 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Arnd Bergmann, Cyrille Pitchen, Boris Brezillon, Marek Vasut,
	Brian Norris, Richard Weinberger, David Woodhouse, linux-mtd,
	linux-kernel, Stefan Roese

Hi Mika,

On Mon, Oct 23, 2017 at 8:12 PM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> On Sun, Oct 15, 2017 at 09:38:57PM +0800, Bin Meng wrote:
>> > 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.
>
> Yeah, I guess we can remove that EXPERT dependency. It was added there
> exactly because I did not want ordinary users playing with the device
> and inadvertently overwrite their BIOSes (if it is not protected). I
> also agree it should be a separate patch. Do you want to do that or
> should I?

Thanks. I can prepare a patch to remove EXPERT.

Regards,
Bin

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-10-24  7:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2017-10-23 12:12       ` Mika Westerberg
2017-10-24  7:08         ` Bin Meng

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).