linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
	davej@redhat.com
Subject: Re: [PATCH] libata: fix broken Kconfig setup
Date: Mon, 17 Oct 2005 11:32:58 -0400	[thread overview]
Message-ID: <4353C42A.3000005@pobox.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0510170754500.23590@g5.osdl.org>

Linus Torvalds wrote:
> 
> On Mon, 17 Oct 2005, Jeff Garzik wrote:
> 
>>CONFIG_SCSI_SATA is truly a boolean option, not a tristate.
>>Since the Kconfig dependencies are insufficient to describe this (2.4
>>had dep_mbool), we need to resort to 'if'.
> 
> 
> Two problems:
> 
>  - this is ugly as hell
> 
>    First, you change SCSI_SATA to be boolean, then you change the 
>    depends-on to be "if". Which makes no sense. Once SCSI_SATA is a 
>    boolean, then the "depends on" works fine, since SCSI_SATA can no 
>    longer be "m" anyway (ie your comment about "dep_mbool" doesn't make 
>    sense).
> 
>    Second, if you want "dep_mbool", then you can have dep_mbool in Kconfig 
>    too. Just do
> 
> 	depends on (XYZ != n)
> 
>    which gets you what you want (ie if XYZ is "m", then the inequality 
>    will be "y")
> 
>    So you might as well have just done something like
> 
> 	 config SCSI_SATA
> 	-       tristate "Serial ATA (SATA) support"
> 	-       depends on SCSI
> 	+       bool "Serial ATA (SATA) support"
> 	+       depends on SCSI != n
> 
>    and then just added SCSI to the "depends on" lines to get the "m" 
>    config. No "if" needed.
> 
>  - anything that depends on a module had better only be _inside_ that 
>    module. Ie the "dep_mbool" kind of behaviour should _not_ affect 
>    anything outside the module. The reason? Maybe you build the module 
>    _later_, and maybe you don't ever load it.
> 
>    So it appears that your dependence on quirk_intel_ide_combined() is 
>    fundamentally broken for the "m" case _anyway_.

CONFIG_SCSI_SATA does two things:
* Enables/disables the display of the SATA driver menu.
* Enables/disables the compiled-in PCI quirk.

Both of these are boolean, and have absolutely nothing to do with modules.

The original problem that caused me to merge the problematic patch (my 
fault for bad merge) was that Kconfig wouldn't allow SATA drivers to be 
built as modules if you did
	bool SCSI_SATA depends on SCSI
	tristate SCSI_SATA_driver depends on SCSI_SATA

That's why I used an 'if' in my patch.  I suppose we could split it into 
two Kconfig options, one for the menu (CONFIG_SCSI_SATA) using 'if', and 
one specifically for the PCI quirk.  Such a split would make it obvious 
that CONFIG_SCSI_SATA controls display of a menu, and nothing more.

Comments?

The entire situation is a hack, because we're fighting the 
always-built-in IDE driver for control of the hardware.  IDE driver 
picks up the PATA+SATA device even though it isn't listed in 
drivers/ide/pci/piix.c PCI table, because it blindly probes at the IDE 
ports after exhausting other options.


> Anyway, the second thing means that the whole configuration is somewhat 
> broken, but on the whole, why not this _much_ more trivial patch?

Because it's fundamental a boolean, and has -zero- to do with modules. 
Encouraging people to think otherwise will just lead to more confusion.

	Jeff

  reply	other threads:[~2005-10-17 15:32 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-17  4:46 [PATCH] libata: fix broken Kconfig setup Jeff Garzik
2005-10-17 11:10 ` Matthias Urlichs
2005-10-17 11:20   ` Jeff Garzik
2005-10-17 15:14 ` Linus Torvalds
2005-10-17 15:32   ` Jeff Garzik [this message]
2005-10-17 15:58     ` Linus Torvalds
2005-10-17 16:21       ` Jeff Garzik
2005-10-17 16:38         ` Linus Torvalds
2005-10-17 16:53           ` Linus Torvalds
2005-10-17 17:11             ` Jeff Garzik
2005-10-17 17:25               ` Linus Torvalds
2005-10-17 17:38                 ` Jeff Garzik
2005-10-19 11:49                 ` Alistair John Strachan
2005-10-19 16:02                   ` Randy.Dunlap
2005-10-17 17:01           ` Jeff Garzik
2005-10-18 11:15             ` Sergey Vlasov
2005-10-18 20:56               ` Jeff Garzik
2005-10-17 17:12         ` Linus Torvalds
2005-10-17 17:22           ` Jeff Garzik
2005-10-17 16:52   ` Jesse Barnes
2005-10-17 17:03     ` Jeff Garzik
2005-10-17 17:06       ` Jesse Barnes
2005-10-17 17:16         ` Jeff Garzik
2005-10-20 14:14         ` Alan Cox
2005-10-20 16:45           ` Jesse Barnes

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=4353C42A.3000005@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=akpm@osdl.org \
    --cc=davej@redhat.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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).