2013-10-25 10:41:27

by Stanislaw Gruszka

[permalink] [raw]
Subject: [PATCH] iwl3945: do not print RFKILL message

We can mess logs if user space try to open device again and again if
RFKILL switch is on. Do not print message and return ERFKILL error
instead to indicate where the problem is.

Note that iwl4965 handle this problem differently, it allows to open
device when radio is disabled.

Reported-by: Dietmar Rudolph <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
---
drivers/net/wireless/iwlegacy/3945-mac.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index dea3b50..f7c2145 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -2396,8 +2396,7 @@ __il3945_up(struct il_priv *il)
clear_bit(S_RFKILL, &il->status);
else {
set_bit(S_RFKILL, &il->status);
- IL_WARN("Radio disabled by HW RF Kill switch\n");
- return -ENODEV;
+ return -ERFKILL;
}

_il_wr(il, CSR_INT, 0xFFFFFFFF);
--
1.8.3.1



2013-10-30 08:35:25

by Stanislaw Gruszka

[permalink] [raw]
Subject: Re: [PATCH] iwl3945: do not print RFKILL message

On Fri, Oct 25, 2013 at 01:17:59PM +0200, Johannes Berg wrote:
> On Fri, 2013-10-25 at 12:37 +0200, Stanislaw Gruszka wrote:
> > We can mess logs if user space try to open device again and again if
> > RFKILL switch is on. Do not print message and return ERFKILL error
> > instead to indicate where the problem is.
>
> Are you maybe not calling wiphy_rfkill_set_hw_state() in the right
> places?

This is done from work scheduled every 2 second if rfkill state change,
but is possible that initial state is not provided to upper layer.

Dietmar or Pedro, could you test attached patch (my old laptop with 3945
does not work any longer). It is alternative to previous patch posted
before, does rfkill work ok with it?

Stanislaw


Attachments:
(No filename) (730.00 B)
iwl3945_rfkill.patch (1.18 kB)
Download all attachments

2013-10-30 13:34:38

by Pedro Francisco

[permalink] [raw]
Subject: Re: [PATCH] iwl3945: do not print RFKILL message

On Wed, Oct 30, 2013 at 8:34 AM, Stanislaw Gruszka <[email protected]> wrote:
> Dietmar or Pedro, could you test attached patch (my old laptop with 3945
> does not work any longer). It is alternative to previous patch posted
> before, does rfkill work ok with it?

My main laptop is no longer the one with the 3945. That being said, I
still intend to test the other patches (powersave) and I can add this
one to the mix, I just don't know when :)

--
Pedro

2013-10-30 08:51:55

by Dietmar Rudolph

[permalink] [raw]
Subject: Re: [PATCH] iwl3945: do not print RFKILL message

> Dietmar or Pedro, could you test attached patch (my old laptop with 3945
> does not work any longer). It is alternative to previous patch posted
> before, does rfkill work ok with it?

Stanislaw,

I'm sorry a cannot be any help here as I don't have the time nor the
environment to compile and test your patch.

In regard to this, I'm just a plain end user who installed Ubuntu
out of the box. I had nticed the problem of the ever growing kernel
log and found this mailing list to be the right spot to post a bug
report. And I noticed your immediate reaction. Keep up the great work.

Kind regards
Dietmar

--
Dietmar Rudolph
Gesch?ftsf?hrer/President

CR/LF GmbH
Obere Fuhr 27, 45136 Essen, Germany
phone: ++49 201 254566
mailto: [email protected], http://www.crlf.de

CR/LF Beratungsgesellschaft f?r EDV-Anwendungen mbH
Essen HRB 7016 - GF: Dipl.-Math. Dietmar Rudolph

2013-10-25 11:18:08

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] iwl3945: do not print RFKILL message

On Fri, 2013-10-25 at 12:37 +0200, Stanislaw Gruszka wrote:
> We can mess logs if user space try to open device again and again if
> RFKILL switch is on. Do not print message and return ERFKILL error
> instead to indicate where the problem is.

Are you maybe not calling wiphy_rfkill_set_hw_state() in the right
places?

johannes