linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Zhu Yi <yi.zhu@intel.com>, Adel Gadllah <adel.gadllah@gmail.com>,
	linux-wireless@vger.kernel.org, randy.dunlap@oracle.com,
	"John W. Linville" <linville@tuxdriver.com>,
	fcrespel@gmail.com
Subject: Re: [PATCH] iwlwifi: remove input device and fix rfkill state
Date: Wed, 2 Jul 2008 18:00:25 +0200	[thread overview]
Message-ID: <200807021800.25894.IvDoorn@gmail.com> (raw)
In-Reply-To: <20080702154327.GA11309@khazad-dum.debian.net>

On Wednesday 02 July 2008, Henrique de Moraes Holschuh wrote:
> On Wed, 02 Jul 2008, Zhu Yi wrote:
> > On Tue, 2008-07-01 at 13:56 -0300, Henrique de Moraes Holschuh wrote:
> > > On Tue, 01 Jul 2008, Adel Gadllah wrote:
> > > > The calls to iwl|iwl3945_rfkill_set_hw_state() had to be moved
> > > because rfkill_force_state() cannot be called from an atomic context.
> > 
> > Yes, but what your patch changed is not in the atomic context. It is
> > just inside the driver's priv->mutex. I don't see any problem if you
> > call rfkill_force_state() inside it.
> > 
> > > Yeah, the joys of mutexes.  If this is going to be a severe annoyance
> > > to drivers, I don't see why rfkill could not be changed to use some
> > > other locking primitive that does work on atomic contexes.
> > 
> > Allowing rfkill_force_state() to be called in the atomic context would
> > be useful especially for hardware rfkill. Devices (i.e iwl4965) receive
> > an interrupt when the hw-rfkill state changes. It's natural to update
> > the rfkill state in this context.
> > 
> > How about protect the rfkill->state by a spinlock and put the
> > notifier_call_chain() into a workqueue in the rfkill subsystem?
> 
> That shouldn't be a problem.  What are the spinlock primitives I should be
> using on rfkill_force_state so that it would be compatible with most drivers
> (and not cause issues when called in task context instead of interrupt
> context)?

Well actually it isn't that easy, the lock would also be used for the state change
callback function toward the driver. And if that is done under a spinlock, USB
drivers will start complaining since they can't access the hardware under atomic
context...

Ivo

  reply	other threads:[~2008-07-02 15:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-01 15:49 [PATCH] iwlwifi: remove input device and fix rfkill state Adel Gadllah
2008-07-01 16:56 ` Henrique de Moraes Holschuh
2008-07-02  8:25   ` Zhu Yi
2008-07-02 15:43     ` Henrique de Moraes Holschuh
2008-07-02 16:00       ` Ivo van Doorn [this message]
2008-07-02 18:41         ` Henrique de Moraes Holschuh
2008-07-02 22:31           ` Ivo van Doorn
2008-07-03  1:53             ` Henrique de Moraes Holschuh
2008-07-03  3:11               ` Zhu Yi
2008-07-03 12:49                 ` Henrique de Moraes Holschuh

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=200807021800.25894.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=adel.gadllah@gmail.com \
    --cc=fcrespel@gmail.com \
    --cc=hmh@hmh.eng.br \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=randy.dunlap@oracle.com \
    --cc=yi.zhu@intel.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;
as well as URLs for NNTP newsgroup(s).