* [PATCH] acer-wmi: does not set persistence state by rfkill_init_sw_state
@ 2011-03-30 20:17 Florian Mickler
2011-03-30 20:22 ` Johannes Berg
2011-03-31 8:30 ` Florian Mickler
0 siblings, 2 replies; 5+ messages in thread
From: Florian Mickler @ 2011-03-30 20:17 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Lee, Chun-Yi, Carlos Corbacho, Matthew Garrett,
Dmitry Torokhov, Corentin Chary, Johannes Berg, Lee, Chun-Yi,
Florian Mickler
From: Lee, Chun-Yi <joeyli.kernel@gmail.com>
Acer BIOS keeps devices state when system reboot, but reset to default
device states (Wlan on, Bluetooth off, wwan on) if system cold boot.
That means BIOS's initial state is not always real persistence.
So, removed rfkill_init_sw_state because it sets initial state to
persistence then replicate to other new killswitch when rfkill-input
enabled.
After removed it, acer-wmi set initial soft-block state after rfkill
register, and doesn't allow set_block until rfkill initial finished.
Reference: bko#31002
https://bugzilla.kernel.org/show_bug.cgi?id=31002
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Tested-by: OldÅich JedliÄka <oldium.pro@seznam.cz>
Signed-off-by: Florian Mickler <florian@mickler.org>
---
This fixes a regression, but no stable annotation was given...
Oversight? Matthew/Chun-Yi please take a look.
drivers/platform/x86/acer-wmi.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index d798314..652a84e 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -217,6 +217,7 @@ struct acer_debug {
static struct rfkill *wireless_rfkill;
static struct rfkill *bluetooth_rfkill;
static struct rfkill *threeg_rfkill;
+static bool rfkill_inited;
/* Each low-level interface must define at least some of the following */
struct wmi_interface {
@@ -1157,9 +1158,13 @@ static int acer_rfkill_set(void *data, bool blocked)
{
acpi_status status;
u32 cap = (unsigned long)data;
- status = set_u32(!blocked, cap);
- if (ACPI_FAILURE(status))
- return -ENODEV;
+
+ if (rfkill_inited) {
+ status = set_u32(!blocked, cap);
+ if (ACPI_FAILURE(status))
+ return -ENODEV;
+ }
+
return 0;
}
@@ -1183,14 +1188,16 @@ static struct rfkill *acer_rfkill_register(struct device *dev,
return ERR_PTR(-ENOMEM);
status = get_device_status(&state, cap);
- if (ACPI_SUCCESS(status))
- rfkill_init_sw_state(rfkill_dev, !state);
err = rfkill_register(rfkill_dev);
if (err) {
rfkill_destroy(rfkill_dev);
return ERR_PTR(err);
}
+
+ if (ACPI_SUCCESS(status))
+ rfkill_set_sw_state(rfkill_dev, !state);
+
return rfkill_dev;
}
@@ -1225,6 +1232,8 @@ static int acer_rfkill_init(struct device *dev)
}
}
+ rfkill_inited = true;
+
schedule_delayed_work(&acer_rfkill_work, round_jiffies_relative(HZ));
return 0;
--
1.7.4.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] acer-wmi: does not set persistence state by rfkill_init_sw_state
2011-03-30 20:17 [PATCH] acer-wmi: does not set persistence state by rfkill_init_sw_state Florian Mickler
@ 2011-03-30 20:22 ` Johannes Berg
2011-03-30 21:19 ` Florian Mickler
2011-03-31 8:30 ` Florian Mickler
1 sibling, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2011-03-30 20:22 UTC (permalink / raw)
To: Florian Mickler
Cc: stable, linux-kernel, Lee, Chun-Yi, Carlos Corbacho,
Matthew Garrett, Dmitry Torokhov, Corentin Chary, Lee, Chun-Yi
On Wed, 2011-03-30 at 22:17 +0200, Florian Mickler wrote:
> From: Lee, Chun-Yi <joeyli.kernel@gmail.com>
>
> Acer BIOS keeps devices state when system reboot, but reset to default
> device states (Wlan on, Bluetooth off, wwan on) if system cold boot.
> That means BIOS's initial state is not always real persistence.
>
> So, removed rfkill_init_sw_state because it sets initial state to
> persistence then replicate to other new killswitch when rfkill-input
> enabled.
> After removed it, acer-wmi set initial soft-block state after rfkill
> register, and doesn't allow set_block until rfkill initial finished.
>
> Reference: bko#31002
> https://bugzilla.kernel.org/show_bug.cgi?id=31002
>
> Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
> Cc: Matthew Garrett <mjg@redhat.com>
> Cc: Dmitry Torokhov <dtor@mail.ru>
> Cc: Corentin Chary <corentincj@iksaif.net>
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
> Signed-off-by: Matthew Garrett <mjg@redhat.com>
> Tested-by: OldÅich JedliÄka <oldium.pro@seznam.cz>
Your mailer messed up the character set, you're advertising
Content-Type: text/plain; charset=UTF-8
and then here putting the byte sequence
\xc3\x85\xc2\x99
instead of
\xc5\x99
for "ř".
johannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] acer-wmi: does not set persistence state by rfkill_init_sw_state
2011-03-30 20:22 ` Johannes Berg
@ 2011-03-30 21:19 ` Florian Mickler
0 siblings, 0 replies; 5+ messages in thread
From: Florian Mickler @ 2011-03-30 21:19 UTC (permalink / raw)
To: Johannes Berg
Cc: stable, linux-kernel, Lee, Chun-Yi, Carlos Corbacho,
Matthew Garrett, Dmitry Torokhov, Corentin Chary, Lee, Chun-Yi
On Wed, 30 Mar 2011 22:22:32 +0200
Johannes Berg <johannes@sipsolutions.net> wrote:
> On Wed, 2011-03-30 at 22:17 +0200, Florian Mickler wrote:
> > From: Lee, Chun-Yi <joeyli.kernel@gmail.com>
> >
> > Acer BIOS keeps devices state when system reboot, but reset to default
> > device states (Wlan on, Bluetooth off, wwan on) if system cold boot.
> > That means BIOS's initial state is not always real persistence.
> >
> > So, removed rfkill_init_sw_state because it sets initial state to
> > persistence then replicate to other new killswitch when rfkill-input
> > enabled.
> > After removed it, acer-wmi set initial soft-block state after rfkill
> > register, and doesn't allow set_block until rfkill initial finished.
> >
> > Reference: bko#31002
> > https://bugzilla.kernel.org/show_bug.cgi?id=31002
> >
> > Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
> > Cc: Matthew Garrett <mjg@redhat.com>
> > Cc: Dmitry Torokhov <dtor@mail.ru>
> > Cc: Corentin Chary <corentincj@iksaif.net>
> > Cc: Johannes Berg <johannes@sipsolutions.net>
> > Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
> > Signed-off-by: Matthew Garrett <mjg@redhat.com>
> > Tested-by: OldÅich JedliÄka <oldium.pro@seznam.cz>
>
> Your mailer messed up the character set, you're advertising
> Content-Type: text/plain; charset=UTF-8
> and then here putting the byte sequence
> \xc3\x85\xc2\x99
> instead of
> \xc5\x99
>
> for "ř".
>
> johannes
>
Dang. That was vim+xterm or git-send-email.
I did
git-send-email sha1^..sha1 --to stable --cc lkml --annotate
and then moved the CC: Old*ich Jedli*ka line via yy and p to the bottom
and changed it to Tested-by:, and added my Signed-off-by: .
I don't think I can easily fix this up on my side as my xterm sadly
has some issues with utf8.
I don't know what's up with that. Maybe font?
Any tipps?
Flo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] acer-wmi: does not set persistence state by rfkill_init_sw_state
2011-03-30 20:17 [PATCH] acer-wmi: does not set persistence state by rfkill_init_sw_state Florian Mickler
2011-03-30 20:22 ` Johannes Berg
@ 2011-03-31 8:30 ` Florian Mickler
2011-03-31 8:49 ` Joey Lee
1 sibling, 1 reply; 5+ messages in thread
From: Florian Mickler @ 2011-03-31 8:30 UTC (permalink / raw)
To: Florian Mickler
Cc: stable, linux-kernel, Lee, Chun-Yi, Carlos Corbacho,
Matthew Garrett, Dmitry Torokhov, Corentin Chary, Johannes Berg,
Lee, Chun-Yi
On Wed, 30 Mar 2011 22:17:57 +0200
Florian Mickler <florian@mickler.org> wrote:
> From: Lee, Chun-Yi <joeyli.kernel@gmail.com>
>
> Acer BIOS keeps devices state when system reboot, but reset to default
> device states (Wlan on, Bluetooth off, wwan on) if system cold boot.
> That means BIOS's initial state is not always real persistence.
>
> So, removed rfkill_init_sw_state because it sets initial state to
> persistence then replicate to other new killswitch when rfkill-input
> enabled.
> After removed it, acer-wmi set initial soft-block state after rfkill
> register, and doesn't allow set_block until rfkill initial finished.
>
> Reference: bko#31002
> https://bugzilla.kernel.org/show_bug.cgi?id=31002
>
> Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
> Cc: Matthew Garrett <mjg@redhat.com>
> Cc: Dmitry Torokhov <dtor@mail.ru>
> Cc: Corentin Chary <corentincj@iksaif.net>
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
> Signed-off-by: Matthew Garrett <mjg@redhat.com>
> Tested-by: OldÅich JedliÄka <oldium.pro@seznam.cz>
> Signed-off-by: Florian Mickler <florian@mickler.org>
> ---
>
> This fixes a regression, but no stable annotation was given...
>
> Oversight? Matthew/Chun-Yi please take a look.
>
I forgot: This is upstream
commit 8215af019040ce9182728afee9642d8fdeb17f59 .
As for the Tested-by:, I think that's borked in git. At least I can't
get it out of git correctly. It should be:
Tested-by: Oldřich Jedlička <oldium.pro@seznam.cz>
Thanks,
Flo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] acer-wmi: does not set persistence state by rfkill_init_sw_state
2011-03-31 8:30 ` Florian Mickler
@ 2011-03-31 8:49 ` Joey Lee
0 siblings, 0 replies; 5+ messages in thread
From: Joey Lee @ 2011-03-31 8:49 UTC (permalink / raw)
To: florian; +Cc: corentincj, stable, dtor, mjg, johannes, carlos, linux-kernel
於 四,2011-03-31 於 10:30 +0200,Florian Mickler 提到:
> On Wed, 30 Mar 2011 22:17:57 +0200
> Florian Mickler <florian@mickler.org> wrote:
>
> > From: Lee, Chun-Yi <joeyli.kernel@gmail.com>
> >
> > Acer BIOS keeps devices state when system reboot, but reset to default
> > device states (Wlan on, Bluetooth off, wwan on) if system cold boot.
> > That means BIOS's initial state is not always real persistence.
> >
> > So, removed rfkill_init_sw_state because it sets initial state to
> > persistence then replicate to other new killswitch when rfkill-input
> > enabled.
> > After removed it, acer-wmi set initial soft-block state after rfkill
> > register, and doesn't allow set_block until rfkill initial finished.
> >
> > Reference: bko#31002
> > https://bugzilla.kernel.org/show_bug.cgi?id=31002
> >
> > Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
> > Cc: Matthew Garrett <mjg@redhat.com>
> > Cc: Dmitry Torokhov <dtor@mail.ru>
> > Cc: Corentin Chary <corentincj@iksaif.net>
> > Cc: Johannes Berg <johannes@sipsolutions.net>
> > Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
> > Signed-off-by: Matthew Garrett <mjg@redhat.com>
> > Tested-by: OldÅich JedliÄka <oldium.pro@seznam.cz>
> > Signed-off-by: Florian Mickler <florian@mickler.org>
> > ---
> >
> > This fixes a regression, but no stable annotation was given...
> >
> > Oversight? Matthew/Chun-Yi please take a look.
> >
>
> I forgot: This is upstream
> commit 8215af019040ce9182728afee9642d8fdeb17f59 .
>
> As for the Tested-by:, I think that's borked in git. At least I can't
> get it out of git correctly. It should be:
> Tested-by: Oldřich Jedlička <oldium.pro@seznam.cz>
>
> Thanks,
> Flo
>
Oldřich's name is good in my patch, just like the following attached,
but I don't know how to fix it in git tree:
>From 09bb9cac4345b0ca69216fd2cae17f20e145128b Mon Sep 17 00:00:00 2001
From: Lee, Chun-Yi <jlee@novell.com>
Date: Mon, 28 Mar 2011 14:49:15 +0800
Subject: [PATCH] acer-wmi: does not set persistence state by rfkill_init_sw_state
Acer BIOS keeps devices state when system reboot, but reset to default
device states (Wlan on, Bluetooth off, wwan on) if system cold boot.
That means BIOS's initial state is not always real persistence.
So, removed rfkill_init_sw_state because it sets initial state to
persistence then replicate to other new killswitch when rfkill-input
enabled.
After removed it, acer-wmi set initial soft-block state after rfkill
register, and doesn't allow set_block until rfkill initial finished.
Reference: bko#31002
https://bugzilla.kernel.org/show_bug.cgi?id=31002
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Oldřich Jedlička <oldium.pro@seznam.cz>
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
---
drivers/platform/x86/acer-wmi.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 5839fac..5b38ae4 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -222,6 +222,7 @@ struct acer_debug {
static struct rfkill *wireless_rfkill;
static struct rfkill *bluetooth_rfkill;
static struct rfkill *threeg_rfkill;
+static bool rfkill_inited;
/* Each low-level interface must define at least some of the following */
struct wmi_interface {
@@ -1162,9 +1163,13 @@ static int acer_rfkill_set(void *data, bool blocked)
{
acpi_status status;
u32 cap = (unsigned long)data;
- status = set_u32(!blocked, cap);
- if (ACPI_FAILURE(status))
- return -ENODEV;
+
+ if (rfkill_inited) {
+ status = set_u32(!blocked, cap);
+ if (ACPI_FAILURE(status))
+ return -ENODEV;
+ }
+
return 0;
}
@@ -1188,14 +1193,16 @@ static struct rfkill *acer_rfkill_register(struct device *dev,
return ERR_PTR(-ENOMEM);
status = get_device_status(&state, cap);
- if (ACPI_SUCCESS(status))
- rfkill_init_sw_state(rfkill_dev, !state);
err = rfkill_register(rfkill_dev);
if (err) {
rfkill_destroy(rfkill_dev);
return ERR_PTR(err);
}
+
+ if (ACPI_SUCCESS(status))
+ rfkill_set_sw_state(rfkill_dev, !state);
+
return rfkill_dev;
}
@@ -1230,6 +1237,8 @@ static int acer_rfkill_init(struct device *dev)
}
}
+ rfkill_inited = true;
+
schedule_delayed_work(&acer_rfkill_work, round_jiffies_relative(HZ));
return 0;
--
1.6.0.2
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-03-31 8:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-30 20:17 [PATCH] acer-wmi: does not set persistence state by rfkill_init_sw_state Florian Mickler
2011-03-30 20:22 ` Johannes Berg
2011-03-30 21:19 ` Florian Mickler
2011-03-31 8:30 ` Florian Mickler
2011-03-31 8:49 ` Joey Lee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome