public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: arvidjaar@mail.ru, linux-usb-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [linux-usb-devel] 2.6.19-rc5 regression: can't disable OHCI wakeup via sysfs
Date: Tue, 14 Nov 2006 13:18:10 -0800	[thread overview]
Message-ID: <200611141318.11080.david-b@pacbell.net> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0611131202290.2390-100000@iolanthe.rowland.org>

On Monday 13 November 2006 9:15 am, Alan Stern wrote:
> On Mon, 13 Nov 2006, David Brownell wrote:
> 
> > It's a *driver model* API, which is also accessible from sysfs ... to support
> > per-device policies, for example the (a) workaround.  The mechanism exists
> > even on kernels that don't include sysfs ... although on such systems, there
> > is no way for users to do things like say "ignore the fact that this mouse
> > claims to issue wakeup events, its descriptors lie".
> 
> Yes, it is separate from sysfs -- but it is _tied_ to the sysfs API.

I can't agree.  If you deconfigure sysfs, it still works.
Since it's independent like that, there's no way it's "tied".


> > > and therefore administrative  
> > > in nature, but now you say it's also being used to record hardware quirks.
> > 
> > No; I'm saying the driver model is used to record that the hardware mechanism
> > isn't available.   The fact that it's because of an implementation artifact
> > (bad silicon, or board layout, etc) versus a design artifact (silicon designed
> > without that feature) is immaterial ... in either case, the system can't use
> > the mechanism.
> 
> But the information is being recorded in the wrong spot.  The correct test
> should use device_can_wakeup, not device_may_wakeup.  The can_wakeup flag
> is the one which records whether or not the hardware mechanism is actually
> available.

Go look again.  "may" implies (i) can , and (ii) should.  So if there's a
hardware quirk registered, (i) always fails.  And in the not-uncommon case
where the device misbehavior isn't known to the kernel, userspace has the
option of making (ii) kick in (the workaround mentioned above).  This is a
generic approach, it works on all wakeup-capable devices.

So "may" is correct, and "can" is insufficient.



> Okay.  I'll write a patch to eliminate autostop and those routines when
> CONFIG_PM is off.
> 
> But that doesn't answer the question above: Should autostop check 
> device_can_wakeup rather than device_may_wakeup?

See above, and the definition of may_wakeup().


> Also: Does the quirk/bug detection logic clear can_wakeup, as it should?  
> Or does it only affect may_wakeup?

See above.  Quirks directly recognized by the kernel clear can_wakeup.
Ones that are reported via userspace clear should_wakeup.  Either suffices
to ensure that the may_wakeup() predicate fails.

- Dave

  reply	other threads:[~2006-11-14 21:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-18 15:19 2.6.17: dmesg flooded with "ohci_hcd 0000:00:02.0: wakeup" Andrey Borzenkov
2006-06-18 16:29 ` [linux-usb-devel] " David Brownell
2006-06-18 17:29   ` Andrey Borzenkov
2006-06-18 18:16     ` David Brownell
2006-06-18 19:22       ` Andrey Borzenkov
2006-06-19 18:39       ` Andrey Borzenkov
2006-06-19 20:12         ` David Brownell
2006-11-11 11:29           ` 2.6.19-rc5 regression: can't disable OHCI wakeup via sysfs Andrey Borzenkov
2006-11-12 16:31             ` [linux-usb-devel] " Alan Stern
2006-11-12 18:00               ` David Brownell
2006-11-12 21:59                 ` Alan Stern
2006-11-12 23:21                   ` David Brownell
2006-11-13 15:57                     ` Alan Stern
2006-11-13 16:39                       ` David Brownell
2006-11-13 17:15                         ` Alan Stern
2006-11-14 21:18                           ` David Brownell [this message]
2006-11-14 21:42                             ` Alan Stern
2006-11-14 22:56                               ` David Brownell
2006-11-13 19:58                         ` Alan Stern
2006-11-14 20:48                           ` Andrey Borzenkov
2006-11-14 20:54                             ` [Bulk] " David Brownell
2006-09-22 18:53       ` [linux-usb-devel] 2.6.17: dmesg flooded with "ohci_hcd 0000:00:02.0: wakeup" Andrey Borzenkov
2006-09-22 20:52         ` Alan Stern
2006-11-11 11:27       ` Andrey Borzenkov

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=200611141318.11080.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=arvidjaar@mail.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=stern@rowland.harvard.edu \
    /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