mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] misc: Kconfig: tc9564: fix a circular dependency
@ 2026-10-02  1:33 Alex Elder
  2026-10-02  6:02 ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Elder @ 2026-10-02  1:33 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: daniel, bhelgaas, linux-kernel, kernel test robot

The TC9564_PCI config option selects PCI_DYNAMIC_OF_NODES.  But that
depends on OF_IRQ, and TC9564_PCI does not satisfy that dependency.

Simply adding "depends on OF_IRQ" results in a recursive Kconfig
dependency.

A little experimentation shows that the recursion can be avoided
when "depends on OF_IRQ" is added by *depending on* rather than
*selecting* PCI_QUIRKS.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202610020124.ieOiopjQ-lkp@intel.com/
Fixes: 1304b0c47ef81 ("misc: tc9564: introduce base PCI driver")
Signed-off-by: Alex Elder <elder@riscstar.com>
---
 drivers/misc/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 9c5b1e9d672e8..87ea92af81dca 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -571,9 +571,10 @@ config MCHP_LAN966X_PCI
 config TC9564_PCI
 	tristate "Toshiba TC9564 PCI function support"
 	depends on OF
+	depends on OF_IRQ
 	depends on PCI
+	depends on PCI_QUIRKS
 	select PCI_DYNAMIC_OF_NODES
-	select PCI_QUIRKS
 	default m
 	help
 	  This enables support for two PCI functions implemented by the

base-commit: 04434a1d0f311d76b1f15fa987918b471a0b8c6a
-- 
2.53.0


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

* Re: [PATCH] misc: Kconfig: tc9564: fix a circular dependency
  2026-10-02  1:33 [PATCH] misc: Kconfig: tc9564: fix a circular dependency Alex Elder
@ 2026-10-02  6:02 ` Arnd Bergmann
  2026-10-02 12:50   ` Alex Elder
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2026-10-02  6:02 UTC (permalink / raw)
  To: Alex Elder, Greg Kroah-Hartman
  Cc: daniel, bhelgaas, linux-kernel, kernel test robot

On Fri, Oct 2, 2026, at 03:33, Alex Elder wrote:
> The TC9564_PCI config option selects PCI_DYNAMIC_OF_NODES.  But that
> depends on OF_IRQ, and TC9564_PCI does not satisfy that dependency.
>
> Simply adding "depends on OF_IRQ" results in a recursive Kconfig
> dependency.
>
> A little experimentation shows that the recursion can be avoided
> when "depends on OF_IRQ" is added by *depending on* rather than
> *selecting* PCI_QUIRKS.

Hi Alex,

This change looks technically correct, but I find the description
misleading as you are not actually fixing a circular dependency
but instead a missing one.

> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 9c5b1e9d672e8..87ea92af81dca 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -571,9 +571,10 @@ config MCHP_LAN966X_PCI
>  config TC9564_PCI
>  	tristate "Toshiba TC9564 PCI function support"
>  	depends on OF
> +	depends on OF_IRQ
>  	depends on PCI
> +	depends on PCI_QUIRKS
>  	select PCI_DYNAMIC_OF_NODES
> -	select PCI_QUIRKS
>  	default m

I would go further here and simplify this to

config TC9564_PCI
 	tristate "Toshiba TC9564 PCI function support"
        depends on PCI && PCI_DYNAMIC_OF_NODES && PCI_QUIRKS

(in either one or three lines)

CONFIG_PCI_DYNAMIC_OF_NODES is a user-visible option, so you
should not select it from a driver.

  Arnd

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

* Re: [PATCH] misc: Kconfig: tc9564: fix a circular dependency
  2026-10-02  6:02 ` Arnd Bergmann
@ 2026-10-02 12:50   ` Alex Elder
  2026-10-02 12:55     ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Elder @ 2026-10-02 12:50 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman
  Cc: daniel, bhelgaas, linux-kernel, kernel test robot

On 10/2/26 1:02 AM, Arnd Bergmann wrote:
> On Fri, Oct 2, 2026, at 03:33, Alex Elder wrote:
>> The TC9564_PCI config option selects PCI_DYNAMIC_OF_NODES.  But that
>> depends on OF_IRQ, and TC9564_PCI does not satisfy that dependency.
>>
>> Simply adding "depends on OF_IRQ" results in a recursive Kconfig
>> dependency.
>>
>> A little experimentation shows that the recursion can be avoided
>> when "depends on OF_IRQ" is added by *depending on* rather than
>> *selecting* PCI_QUIRKS.
> 
> Hi Alex,
> 
> This change looks technically correct, but I find the description
> misleading as you are not actually fixing a circular dependency
> but instead a missing one.

That's true.  It's adding a missing dependency in a way
that avoids the circular dependency.  I will update this
and send version 2 shortly.

>> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
>> index 9c5b1e9d672e8..87ea92af81dca 100644
>> --- a/drivers/misc/Kconfig
>> +++ b/drivers/misc/Kconfig
>> @@ -571,9 +571,10 @@ config MCHP_LAN966X_PCI
>>   config TC9564_PCI
>>   	tristate "Toshiba TC9564 PCI function support"
>>   	depends on OF
>> +	depends on OF_IRQ
>>   	depends on PCI
>> +	depends on PCI_QUIRKS
>>   	select PCI_DYNAMIC_OF_NODES
>> -	select PCI_QUIRKS
>>   	default m
> 
> I would go further here and simplify this to
> 
> config TC9564_PCI
>   	tristate "Toshiba TC9564 PCI function support"
>          depends on PCI && PCI_DYNAMIC_OF_NODES && PCI_QUIRKS
> 
> (in either one or three lines)

If I do one, I'll combine OF and OF_IRQ similarly into one.

> CONFIG_PCI_DYNAMIC_OF_NODES is a user-visible option, so you
> should not select it from a driver.

OK, I didn't realize this.  Another thing to look for.

Thank you Arnd.

					-Alex

>    Arnd


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

* Re: [PATCH] misc: Kconfig: tc9564: fix a circular dependency
  2026-10-02 12:50   ` Alex Elder
@ 2026-10-02 12:55     ` Arnd Bergmann
  2026-10-02 14:07       ` Alex Elder
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2026-10-02 12:55 UTC (permalink / raw)
  To: Alex Elder, Greg Kroah-Hartman
  Cc: daniel, bhelgaas, linux-kernel, kernel test robot

On Fri, Oct 2, 2026, at 14:50, Alex Elder wrote:
> On 10/2/26 1:02 AM, Arnd Bergmann wrote:
>> On Fri, Oct 2, 2026, at 03:33, Alex Elder wrote:
>> config TC9564_PCI
>>   	tristate "Toshiba TC9564 PCI function support"
>>          depends on PCI && PCI_DYNAMIC_OF_NODES && PCI_QUIRKS
>> 
>> (in either one or three lines)
>
> If I do one, I'll combine OF and OF_IRQ similarly into one.

If you have a dependency on PCI_DYNAMIC_OF_NODES, you don't
need the extra dependency on OF_IRQ or OF.

I guess you don't need the dependency on PCI either, unless
we ever want to make PCI a tristate option have that in
a loadable module.

      Arnd

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

* Re: [PATCH] misc: Kconfig: tc9564: fix a circular dependency
  2026-10-02 12:55     ` Arnd Bergmann
@ 2026-10-02 14:07       ` Alex Elder
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Elder @ 2026-10-02 14:07 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman
  Cc: daniel, bhelgaas, linux-kernel, kernel test robot

On 10/2/26 7:55 AM, Arnd Bergmann wrote:
> On Fri, Oct 2, 2026, at 14:50, Alex Elder wrote:
>> On 10/2/26 1:02 AM, Arnd Bergmann wrote:
>>> On Fri, Oct 2, 2026, at 03:33, Alex Elder wrote:
>>> config TC9564_PCI
>>>    	tristate "Toshiba TC9564 PCI function support"
>>>           depends on PCI && PCI_DYNAMIC_OF_NODES && PCI_QUIRKS
>>>
>>> (in either one or three lines)
>>
>> If I do one, I'll combine OF and OF_IRQ similarly into one.
> 
> If you have a dependency on PCI_DYNAMIC_OF_NODES, you don't
> need the extra dependency on OF_IRQ or OF.
> 
> I guess you don't need the dependency on PCI either, unless
> we ever want to make PCI a tristate option have that in
> a loadable module.
> 
>        Arnd

I'm partly influenced by something comparable to "include
what you use", where my instinct here would be to explicitly
indicate dependencies even if other depended-on config
options satisfy them.  But I'll do what you're suggesting.

I will omit the dependency on PCI.  This is the same situation
as the OF dependency, where OF_IRQ is only available if OF is
enabled.

I'm adding "Suggested-by" you in the commit, because the final
(much simpler) form derives directly from what you've said here.

Thank you.

					-Alex

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

end of thread, other threads:[~2026-10-02 14:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-02  1:33 [PATCH] misc: Kconfig: tc9564: fix a circular dependency Alex Elder
2026-10-02  6:02 ` Arnd Bergmann
2026-10-02 12:50   ` Alex Elder
2026-10-02 12:55     ` Arnd Bergmann
2026-10-02 14:07       ` Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®