* [PATCH] Fix Maemo6 MCE: set state variable directly
@ 2010-10-20 14:59 Daniel Örstadius
2010-11-04 14:41 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Örstadius @ 2010-10-20 14:59 UTC (permalink / raw)
To: linux-bluetooth
[-- Attachment #1: Type: text/plain, Size: 29 bytes --]
Hi,
Please review.
/Daniel
[-- Attachment #2: 0001-Fix-Maemo6-MCE-set-state-variable-directly.patch --]
[-- Type: text/x-patch, Size: 1285 bytes --]
From b9adfbe1db7b6f783d3bd6b98962a32161284127 Mon Sep 17 00:00:00 2001
From: Daniel Orstadius <daniel.orstadius@nokia.com>
Date: Wed, 20 Oct 2010 17:13:17 +0300
Subject: [PATCH] Fix Maemo6 MCE: set state variable directly
If the state variable is not updated until mce_signal_callback and
SetProperty(Powered) is called two times quickly, then the second
call will not generate a request to change the radio state of the
MCE if its corresponding call to adapter_powered occurs before the
first triggering of mce_signal_callback.
With this patch two calls to the MCE are executed, although there
might still be an unnecessary power cycle in that
mce_signal_callback is also triggered twice.
---
plugins/maemo6.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/plugins/maemo6.c b/plugins/maemo6.c
index 0a1e551..3c91926 100644
--- a/plugins/maemo6.c
+++ b/plugins/maemo6.c
@@ -166,7 +166,9 @@ static void adapter_powered(struct btd_adapter *adapter, gboolean powered)
DBUS_TYPE_UINT32, &radio_mask,
DBUS_TYPE_INVALID);
- if (!dbus_connection_send(conn, msg, NULL))
+ if (dbus_connection_send(conn, msg, NULL))
+ mce_bt_set = powered;
+ else
error("calling %s failed", MCE_RADIO_STATES_CHANGE_REQ);
dbus_message_unref(msg);
--
1.6.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix Maemo6 MCE: set state variable directly
2010-10-20 14:59 [PATCH] Fix Maemo6 MCE: set state variable directly Daniel Örstadius
@ 2010-11-04 14:41 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2010-11-04 14:41 UTC (permalink / raw)
To: Daniel Örstadius; +Cc: linux-bluetooth
On Wed, Oct 20, 2010, Daniel Örstadius wrote:
> From: Daniel Orstadius <daniel.orstadius@nokia.com>
> Date: Wed, 20 Oct 2010 17:13:17 +0300
> Subject: [PATCH] Fix Maemo6 MCE: set state variable directly
>
> If the state variable is not updated until mce_signal_callback and
> SetProperty(Powered) is called two times quickly, then the second
> call will not generate a request to change the radio state of the
> MCE if its corresponding call to adapter_powered occurs before the
> first triggering of mce_signal_callback.
>
> With this patch two calls to the MCE are executed, although there
> might still be an unnecessary power cycle in that
> mce_signal_callback is also triggered twice.
> ---
> plugins/maemo6.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
This patch has been pushed upstream after an offline discussion which
concluded that it should be safe to ignore the method reply from MCE in
this case.
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-04 14:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-20 14:59 [PATCH] Fix Maemo6 MCE: set state variable directly Daniel Örstadius
2010-11-04 14:41 ` Johan Hedberg
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).