public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	corentincj@iksaif.net, linux-kernel@vger.kernel.org,
	linux-acpi@vger.kernel.org
Subject: Re: [PATCH v2 2/2] eeepc-laptop: Use standard interfaces
Date: Tue, 19 Aug 2008 22:18:29 -0300	[thread overview]
Message-ID: <20080820011828.GD29336@khazad-dum.debian.net> (raw)
In-Reply-To: <20080819232411.GA5421@srcf.ucam.org>

On Wed, 20 Aug 2008, Matthew Garrett wrote:
> On Tue, Aug 19, 2008 at 08:09:50PM -0300, Henrique de Moraes Holschuh wrote:
> > Looks fine to me at first glance.  I do wonder if there are no events at all
> > you could hook to rfkill_force_state() instead of (or in addition to) using
> > the get_state()?
> 
> The only change event is generated by hitting the wifi key, which ties 
> into rfkill-input. Won't that already force a state update on the event?

Yes, but one must keep this in mind:

1. If the event has no bearing on compulsory hardware state changes (i.e.
the hardware won't change state by itself when the event happens, it is
really just reporting a simple key press that will do nothing by itself),
you just report the key as an event.

2. If the hardware/firmware *ALSO* compulsory changes the rfkill state (i.e.
the event also means the real rfkill controller state probably changed), you
take the opportunity to do a forced immediate state poll and
rfkill_force_state() the new state.

So, it basically depends whether the EEEPC hardware/firmware does (1) or
(2).  If it is (1), the patch is correct.  If it is (2), it should do a bit
more stuff that ends up with a call to rfkill_force_state().

The reason is that there is absolutely *NO* reason why rfkill-input (or
anything else for that matter) has to obey the input event.  They can just
discard it if they want: it is a local system policy matter.  Therefore, if
there is anything in *hardware* or *firmware* that is already acting on that
event, you *MUST* arrange for a call to rfkill_force_state().

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

  reply	other threads:[~2008-08-20  1:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-04 17:08 [PATCH 1/2] eeepc-laptop: Fix user after free Matthew Garrett
2008-08-04 17:15 ` [PATCH 2/2] eeepc-laptop: Use standard interfaces Matthew Garrett
2008-08-04 17:53   ` Ivo van Doorn
2008-08-04 17:36     ` Matthew Garrett
2008-08-04 21:21       ` Henrique de Moraes Holschuh
2008-08-04 21:29   ` Henrique de Moraes Holschuh
2008-08-06  9:23 ` [PATCH v2 1/2] eeepc-laptop: Fix user after free Matthew Garrett
2008-08-06  9:25   ` [PATCH v2 2/2] eeepc-laptop: Use standard interfaces Matthew Garrett
2008-08-19  9:58     ` Andrew Morton
2008-08-19 11:13       ` Matthew Garrett
2008-08-19 23:09         ` Henrique de Moraes Holschuh
2008-08-19 23:24           ` Matthew Garrett
2008-08-20  1:18             ` Henrique de Moraes Holschuh [this message]
2008-08-20  1:28               ` Matthew Garrett
2008-08-20  1:32                 ` Henrique de Moraes Holschuh
2008-08-20  1:42                   ` Awkward rfkill corner cases Matthew Garrett
2008-08-20  2:30                     ` Henrique de Moraes Holschuh
2008-10-08 20:50         ` [PATCH v2 2/2] eeepc-laptop: Use standard interfaces Len Brown

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=20080820011828.GD29336@khazad-dum.debian.net \
    --to=hmh@hmh.eng.br \
    --cc=akpm@linux-foundation.org \
    --cc=corentincj@iksaif.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.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