linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix adapter drivers unload order
@ 2011-03-18  8:25 Dmitriy Paliy
  2011-03-18 11:43 ` Bastien Nocera
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitriy Paliy @ 2011-03-18  8:25 UTC (permalink / raw)
  To: linux-bluetooth, szymon.janc; +Cc: Dmitriy Paliy

Order of unloading drivers shell be preserved as given in
audio_manager_exit. It was reverted in 'c772636 Fix unloading of adapter
drivers', which causes in turn bluetoothd crash on exit.

Removing of media end-point results in removing of A2DP end-point for
the corresponding A2DP server but not vice versa. Therefore, unregistering
and destroying A2DP server, which clears all A2DP end-points, before media
server is incorrect.
---
 src/adapter.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 8c368fe..9fa7c4d 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2258,8 +2258,8 @@ static void probe_driver(struct btd_adapter *adapter, gpointer user_data)
 		return;
 	}
 
-	adapter->loaded_drivers = g_slist_prepend(adapter->loaded_drivers,
-									driver);
+	adapter->loaded_drivers = g_slist_append(adapter->loaded_drivers,
+								driver);
 }
 
 static void load_drivers(struct btd_adapter *adapter)
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix adapter drivers unload order
  2011-03-18  8:25 [PATCH] Fix adapter drivers unload order Dmitriy Paliy
@ 2011-03-18 11:43 ` Bastien Nocera
  2011-03-18 11:59   ` Dmitriy Paliy
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien Nocera @ 2011-03-18 11:43 UTC (permalink / raw)
  To: Dmitriy Paliy; +Cc: linux-bluetooth, szymon.janc

On Fri, 2011-03-18 at 10:25 +0200, Dmitriy Paliy wrote:
> Order of unloading drivers shell be preserved as given in
> audio_manager_exit. It was reverted in 'c772636 Fix unloading of adapter
> drivers', which causes in turn bluetoothd crash on exit.
> 
> Removing of media end-point results in removing of A2DP end-point for
> the corresponding A2DP server but not vice versa. Therefore, unregistering
> and destroying A2DP server, which clears all A2DP end-points, before media
> server is incorrect.
> ---
>  src/adapter.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/adapter.c b/src/adapter.c
> index 8c368fe..9fa7c4d 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -2258,8 +2258,8 @@ static void probe_driver(struct btd_adapter *adapter, gpointer user_data)
>  		return;
>  	}
>  
> -	adapter->loaded_drivers = g_slist_prepend(adapter->loaded_drivers,
> -									driver);
> +	adapter->loaded_drivers = g_slist_append(adapter->loaded_drivers,
> +								driver);

That's usually g_slist_prepend() followed by a g_slist_reverse(), not a
g_slist_append().

>  }
>  
>  static void load_drivers(struct btd_adapter *adapter)



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix adapter drivers unload order
  2011-03-18 11:43 ` Bastien Nocera
@ 2011-03-18 11:59   ` Dmitriy Paliy
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitriy Paliy @ 2011-03-18 11:59 UTC (permalink / raw)
  To: ext Bastien Nocera; +Cc: linux-bluetooth, szymon.janc

Hi,

> > -	adapter->loaded_drivers = g_slist_prepend(adapter->loaded_drivers,
> > -									driver);
> > +	adapter->loaded_drivers = g_slist_append(adapter->loaded_drivers,
> > +								driver);
> 
> That's usually g_slist_prepend() followed by a g_slist_reverse(), not a
> g_slist_append().

In this case append looks more appropriate if we want to be consistent
with rest of code. To be more specific with audio_manager_init and
audio_manager_exit, and btd_register_adapter_driver where drivers are
appended
adapter_drivers = g_slist_append(adapter_drivers, driver);

BR,
Dmitriy



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Fix adapter drivers unload order
  2011-03-18 14:18 [PATCH 0/1 v2] " Dmitriy Paliy
@ 2011-03-18 14:18 ` Dmitriy Paliy
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitriy Paliy @ 2011-03-18 14:18 UTC (permalink / raw)
  To: linux-bluetooth, hadess; +Cc: Dmitriy Paliy

Order of unloading drivers shell be preserved as given in
audio_manager_exit. It was reverted in 'c772636 Fix unloading of adapter
drivers', which causes in turn bluetoothd crash on exit.

Removing of media end-point results in removing of A2DP end-point for
the corresponding A2DP server but not vice versa. Therefore, unregistering
and destroying A2DP server, which clears all A2DP end-points, before media
server is incorrect.
---
 src/adapter.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index cc4f43e..3455237 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2494,6 +2494,7 @@ static void remove_driver(gpointer data, gpointer user_data)
 
 static void unload_drivers(struct btd_adapter *adapter)
 {
+	adapter->loaded_drivers = g_slist_reverse(adapter->loaded_drivers);
 	g_slist_foreach(adapter->loaded_drivers, remove_driver, adapter);
 	g_slist_free(adapter->loaded_drivers);
 	adapter->loaded_drivers = NULL;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-18 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-18  8:25 [PATCH] Fix adapter drivers unload order Dmitriy Paliy
2011-03-18 11:43 ` Bastien Nocera
2011-03-18 11:59   ` Dmitriy Paliy
  -- strict thread matches above, loose matches on Subject: below --
2011-03-18 14:18 [PATCH 0/1 v2] " Dmitriy Paliy
2011-03-18 14:18 ` [PATCH] " Dmitriy Paliy

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).