From: Ivo van Doorn <ivdoorn@gmail.com>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: John Linville <linville@tuxdriver.com>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/5] rfkill: use killable locks instead of interruptible
Date: Sat, 11 Oct 2008 15:53:46 +0200 [thread overview]
Message-ID: <200810111553.46170.IvDoorn@gmail.com> (raw)
In-Reply-To: <1223586933-17753-2-git-send-email-hmh@hmh.eng.br>
On Thursday 09 October 2008, Henrique de Moraes Holschuh wrote:
> Apparently, many applications don't expect to get EAGAIN from fd read/write
> operations, since POSIX doesn't mandate it.
>
> Use mutex_lock_killable instead of mutex_lock_interruptible, which won't
> cause issues.
>
> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> Cc: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
> ---
> net/rfkill/rfkill.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
> index f949a48..08be968 100644
> --- a/net/rfkill/rfkill.c
> +++ b/net/rfkill/rfkill.c
> @@ -431,8 +431,9 @@ static ssize_t rfkill_state_store(struct device *dev,
> state != RFKILL_STATE_SOFT_BLOCKED)
> return -EINVAL;
>
> - if (mutex_lock_interruptible(&rfkill->mutex))
> - return -ERESTARTSYS;
> + error = mutex_lock_killable(&rfkill->mutex);
> + if (error)
> + return error;
> error = rfkill_toggle_radio(rfkill, state, 0);
> mutex_unlock(&rfkill->mutex);
>
> @@ -472,7 +473,7 @@ static ssize_t rfkill_claim_store(struct device *dev,
> * Take the global lock to make sure the kernel is not in
> * the middle of rfkill_switch_all
> */
> - error = mutex_lock_interruptible(&rfkill_global_mutex);
> + error = mutex_lock_killable(&rfkill_global_mutex);
> if (error)
> return error;
>
next prev parent reply other threads:[~2008-10-11 13:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-09 21:15 [GIT PATCH] rfkill updates Henrique de Moraes Holschuh
2008-10-09 21:15 ` [PATCH 1/5] rfkill: use killable locks instead of interruptible Henrique de Moraes Holschuh
2008-10-11 13:53 ` Ivo van Doorn [this message]
2008-10-09 21:15 ` [PATCH 2/5] rfkill: export global states to rfkill-input Henrique de Moraes Holschuh
2008-10-11 13:53 ` Ivo van Doorn
2008-10-09 21:15 ` [PATCH 3/5] rfkill: add master_switch_mode and EPO lock to rfkill and rfkill-input Henrique de Moraes Holschuh
2008-10-09 21:20 ` Henrique de Moraes Holschuh
2008-10-10 0:49 ` Henrique de Moraes Holschuh
2008-10-11 13:53 ` Ivo van Doorn
2008-10-12 1:44 ` Henrique de Moraes Holschuh
2008-10-09 21:15 ` [PATCH 4/5] rfkill: honour EPO state when resuming a rfkill controller Henrique de Moraes Holschuh
2008-10-11 13:53 ` Ivo van Doorn
2008-10-09 21:15 ` [PATCH 5/5] rfkill: rate-limit rfkill-input workqueue usage (v3) Henrique de Moraes Holschuh
2008-10-11 13:53 ` Ivo van Doorn
2008-10-11 13:53 ` [GIT PATCH] rfkill updates Ivo van Doorn
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=200810111553.46170.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=hmh@hmh.eng.br \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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).