public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Gadiyar, Anand" <gadiyar@ti.com>,
	jidong xiao <jidong.xiao@gmail.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	linux-kbuild@vger.kernel.org,
	Vegard Nossum <vegard.nossum@gmail.com>
Subject: Re: Compile error with gregkh-07-usb-2.6.33-rc7.patch
Date: Wed, 17 Feb 2010 15:32:45 +0100	[thread overview]
Message-ID: <4B7BFE0D.4000509@suse.cz> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1002121026420.1499-100000@iolanthe.rowland.org>

On 12.2.2010 16:30, Alan Stern wrote:
> On Fri, 12 Feb 2010, Gadiyar, Anand wrote:
> 
>>>>> I guess you did _not_ enable CONFIG_PM_RUNTIME, right?
>>>>>
>>>>> pm_wq is only defined when CONFIG_PM_RUNTIME is enabled.
>>>>>
>>>>>      15 #ifdef CONFIG_PM_RUNTIME
>>>>>      16
>>>>>      17 extern struct workqueue_struct *pm_wq;
>>>>
>>>> Right, I had CONFIG_PM_RUNTIME disabled. Enabling it allowed the
>>>> compile to go through.
>>>>
>>>> Does that compile failure still needs to be fixed. I'm guessing
>>>> not everyone will build with this option enabled?
>>>>
>>> Well, looking at gregkh-07-usb-2.6.33-rc7.patch, I noticed following
>>> hunk of patch:
>>>
>>> diff -Naur -X linux-2.6.33-rc7-tty/Documentation/dontdiff linux-2.6.33-rc7-tty/drivers/usb/core/Kconfig linux-2.6.33-rc7-usb/drivers/usb/core/Kconfig
>>> --- linux-2.6.33-rc7-tty/drivers/usb/core/Kconfig       2009-09-09 15:13:59.000000000 -0700
>>> +++ linux-2.6.33-rc7-usb/drivers/usb/core/Kconfig       2010-02-09 13:21:32.000000000 -0800
>>> @@ -91,8 +91,8 @@
>>>           If you are unsure about this, say N here.
>>>
>>>  config USB_SUSPEND
>>> -       bool "USB selective suspend/resume and wakeup"
>>> -       depends on USB && PM
>>> +       bool "USB runtime power management (suspend/resume and wakeup)"
>>> +       depends on USB && PM_RUNTIME
>>>         help
>>>           If you say Y here, you can use driver calls or the sysfs
>>>           "power/level" file to suspend or resume individual USB
>>>
>>> This patch is saying, USB_SUSPEND is depends on PM_RUNTIME, in your
>>> case, USB_SUSPEND is enabled, but PM_RUNTIME is disabled, this is a
>>> little bit strange, I guess you have manually edited .config instead
>>> of running the command `make menuconfig`. I am afraid this might cause
>>> some dependency problem.
>>
>> Nope. I did `make ARCH=arm omap_3430sdp_defconfig`, and this generated
>> the .config. Wouldn't the dependencies be taken care of by this?
>>
>> (omap_3430sdp_defconfig has CONFIG_USB_SUSPEND=y and CONFIG_PM_RUNTIME
>> not set, since the defconfig is old. But wouldn't CONFIG_USB_SUSPEND
>> get turned off in this case?)
> 
> I would expect it to get turned off.  This sounds like a bug in the
> kernel build system.  Adding the linux-kbuild mailing list to the CC:.

The problem is a few lines below

config USB_OTG
	bool
	depends on USB && EXPERIMENTAL
	select USB_SUSPEND
        ^^^^^^^^^^^^^^^^^^
	default n

This triggers a know bug of the select statement
(Documentation/kbuild/kconfig-language.txt):

	select should be used with care. select will force
	a symbol to a value without visiting the dependencies.
	By abusing select you are able to select a symbol FOO even
	if FOO depends on BAR that is not set.
	In general use select only for non-visible symbols
	(no prompts anywhere) and for symbols with no dependencies.
	That will limit the usefulness but on the other hand avoid
	the illegal configurations all over.
	kconfig should one day warn about such things.

Vegard Nossum is going to work on replacing the current kconfig
dependency solver with something smarter during this year's GSoC, so
there is light at the end of the tunnel. In the meantime, you can change
the logic from "select USB_SUSPEND" to "depends on USB_SUSPEND". This
will force one to first set USB_SUSPEND manually, but will avoid the
build error.

Michal

  reply	other threads:[~2010-02-17 14:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5A47E75E594F054BAF48C5E4FC4B92AB031E80D6E0@dbde02.ent.ti.com>
2010-02-12 15:30 ` Compile error with gregkh-07-usb-2.6.33-rc7.patch Alan Stern
2010-02-17 14:32   ` Michal Marek [this message]
2010-02-18  4:16     ` Greg KH
2010-02-18  6:34       ` Gadiyar, Anand

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=4B7BFE0D.4000509@suse.cz \
    --to=mmarek@suse.cz \
    --cc=gadiyar@ti.com \
    --cc=gregkh@suse.de \
    --cc=jidong.xiao@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=vegard.nossum@gmail.com \
    /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