* [PATCH]: ARM DaVinci ASoC: Fix module unload error
@ 2009-02-13 7:09 chaithrika
2009-02-13 13:30 ` Mark Brown
2009-02-13 17:47 ` Hugo Villeneuve
0 siblings, 2 replies; 7+ messages in thread
From: chaithrika @ 2009-02-13 7:09 UTC (permalink / raw)
To: alsa-devel; +Cc: Chaithrika U S, davinci-linux-open-source
From: Chaithrika U S <chaithrika@ti.com>
Fix for the error when the audio module is unloaded.
On unregistering the platform_device, platform_device_release will free the
platform data.If platform data is static the kernel panics when it is freed.
Instead use the platform device helper function to add data.
This change has been tested on DM644x EVM.
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
---
sound/soc/davinci/davinci-evm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
index 1aad262..95c44bf 100644
--- a/sound/soc/davinci/davinci-evm.c
+++ b/sound/soc/davinci/davinci-evm.c
@@ -225,7 +225,7 @@ static int __init evm_init(void)
platform_set_drvdata(evm_snd_device, &evm_snd_devdata);
evm_snd_devdata.dev = &evm_snd_device->dev;
- evm_snd_device->dev.platform_data = data;
+ platform_device_add_data(evm_snd_device, data, sizeof(data));
ret = platform_device_add_resources(evm_snd_device, resources, 1);
if (ret) {
--
1.5.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH]: ARM DaVinci ASoC: Fix module unload error
2009-02-13 7:09 [PATCH]: ARM DaVinci ASoC: Fix module unload error chaithrika
@ 2009-02-13 13:30 ` Mark Brown
2009-02-13 19:36 ` Kevin Hilman
2009-02-13 17:47 ` Hugo Villeneuve
1 sibling, 1 reply; 7+ messages in thread
From: Mark Brown @ 2009-02-13 13:30 UTC (permalink / raw)
To: chaithrika; +Cc: alsa-devel, davinci-linux-open-source
On Fri, Feb 13, 2009 at 12:39:39PM +0530, chaithrika@ti.com wrote:
> From: Chaithrika U S <chaithrika@ti.com>
> Fix for the error when the audio module is unloaded.
> On unregistering the platform_device, platform_device_release will free the
> platform data.If platform data is static the kernel panics when it is freed.
> Instead use the platform device helper function to add data.
Which kernel tree is this patch against? It doesn't apply against
either the topic/asoc or fix/asoc branch of
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH]: ARM DaVinci ASoC: Fix module unload error
2009-02-13 7:09 [PATCH]: ARM DaVinci ASoC: Fix module unload error chaithrika
2009-02-13 13:30 ` Mark Brown
@ 2009-02-13 17:47 ` Hugo Villeneuve
2009-02-13 19:16 ` Kevin Hilman
1 sibling, 1 reply; 7+ messages in thread
From: Hugo Villeneuve @ 2009-02-13 17:47 UTC (permalink / raw)
To: chaithrika; +Cc: alsa-devel, davinci-linux-open-source
On Fri, 13 Feb 2009 12:39:39 +0530
chaithrika@ti.com wrote:
> From: Chaithrika U S <chaithrika@ti.com>
>
> Fix for the error when the audio module is unloaded.
> On unregistering the platform_device, platform_device_release will
> free the platform data.If platform data is static the kernel panics
> when it is freed. Instead use the platform device helper function to
> add data.
>
> This change has been tested on DM644x EVM.
>
> Signed-off-by: Chaithrika U S <chaithrika@ti.com>
> ---
> sound/soc/davinci/davinci-evm.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/sound/soc/davinci/davinci-evm.c
> b/sound/soc/davinci/davinci-evm.c index 1aad262..95c44bf 100644
> --- a/sound/soc/davinci/davinci-evm.c
> +++ b/sound/soc/davinci/davinci-evm.c
> @@ -225,7 +225,7 @@ static int __init evm_init(void)
>
> platform_set_drvdata(evm_snd_device, &evm_snd_devdata);
> evm_snd_devdata.dev = &evm_snd_device->dev;
> - evm_snd_device->dev.platform_data = data;
> + platform_device_add_data(evm_snd_device, data, sizeof(data));
Hi,
I modified your patch for the SFFSDR board and it also fixed the
problem. Thank-you.
Can you include the fix for the SFFSDR also in your patch? Here is the
modification for the SFFSDR:
diff --git a/sound/soc/davinci/davinci-sffsdr.c
b/sound/soc/davinci/davinci-sffsdr.c index a304ada..6e46258 100644
--- a/sound/soc/davinci/davinci-sffsdr.c
+++ b/sound/soc/davinci/davinci-sffsdr.c
@@ -128,7 +128,7 @@ static int __init sffsdr_init(void)
platform_set_drvdata(sffsdr_snd_device, &sffsdr_snd_devdata);
sffsdr_snd_devdata.dev = &sffsdr_snd_device->dev;
- sffsdr_snd_device->dev.platform_data = &sffsdr_snd_data;
+ platform_device_add_data(sffsdr_snd_device, &sffsdr_snd_data,
sizeof(sffsdr_snd_data));
ret = platform_device_add_resources(sffsdr_snd_device,
sffsdr_snd_resources,
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH]: ARM DaVinci ASoC: Fix module unload error
2009-02-13 17:47 ` Hugo Villeneuve
@ 2009-02-13 19:16 ` Kevin Hilman
0 siblings, 0 replies; 7+ messages in thread
From: Kevin Hilman @ 2009-02-13 19:16 UTC (permalink / raw)
To: Hugo Villeneuve; +Cc: chaithrika, alsa-devel, davinci-linux-open-source
Hugo Villeneuve <hugo@hugovil.com> writes:
> On Fri, 13 Feb 2009 12:39:39 +0530
> chaithrika@ti.com wrote:
>
>> From: Chaithrika U S <chaithrika@ti.com>
>>
>> Fix for the error when the audio module is unloaded.
>> On unregistering the platform_device, platform_device_release will
>> free the platform data.If platform data is static the kernel panics
>> when it is freed. Instead use the platform device helper function to
>> add data.
>>
>> This change has been tested on DM644x EVM.
>>
>> Signed-off-by: Chaithrika U S <chaithrika@ti.com>
>> ---
>> sound/soc/davinci/davinci-evm.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/sound/soc/davinci/davinci-evm.c
>> b/sound/soc/davinci/davinci-evm.c index 1aad262..95c44bf 100644
>> --- a/sound/soc/davinci/davinci-evm.c
>> +++ b/sound/soc/davinci/davinci-evm.c
>> @@ -225,7 +225,7 @@ static int __init evm_init(void)
>>
>> platform_set_drvdata(evm_snd_device, &evm_snd_devdata);
>> evm_snd_devdata.dev = &evm_snd_device->dev;
>> - evm_snd_device->dev.platform_data = data;
>> + platform_device_add_data(evm_snd_device, data, sizeof(data));
>
> Hi,
> I modified your patch for the SFFSDR board and it also fixed the
> problem. Thank-you.
>
> Can you include the fix for the SFFSDR also in your patch? Here is the
> modification for the SFFSDR:
>
> diff --git a/sound/soc/davinci/davinci-sffsdr.c
> b/sound/soc/davinci/davinci-sffsdr.c index a304ada..6e46258 100644
> --- a/sound/soc/davinci/davinci-sffsdr.c
> +++ b/sound/soc/davinci/davinci-sffsdr.c
> @@ -128,7 +128,7 @@ static int __init sffsdr_init(void)
>
> platform_set_drvdata(sffsdr_snd_device, &sffsdr_snd_devdata);
> sffsdr_snd_devdata.dev = &sffsdr_snd_device->dev;
> - sffsdr_snd_device->dev.platform_data = &sffsdr_snd_data;
> + platform_device_add_data(sffsdr_snd_device, &sffsdr_snd_data,
> sizeof(sffsdr_snd_data));
>
> ret = platform_device_add_resources(sffsdr_snd_device,
Hugo,
I will fold your change into Chaithrika's original patch.
Thanks,
Kevin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH]: ARM DaVinci ASoC: Fix module unload error
2009-02-13 13:30 ` Mark Brown
@ 2009-02-13 19:36 ` Kevin Hilman
2009-02-13 20:31 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: Kevin Hilman @ 2009-02-13 19:36 UTC (permalink / raw)
To: Mark Brown; +Cc: chaithrika, alsa-devel, davinci-linux-open-source
Mark Brown <broonie@sirena.org.uk> writes:
> On Fri, Feb 13, 2009 at 12:39:39PM +0530, chaithrika@ti.com wrote:
>> From: Chaithrika U S <chaithrika@ti.com>
>
>> Fix for the error when the audio module is unloaded.
>> On unregistering the platform_device, platform_device_release will free the
>> platform data.If platform data is static the kernel panics when it is freed.
>> Instead use the platform device helper function to add data.
>
> Which kernel tree is this patch against? It doesn't apply against
> either the topic/asoc or fix/asoc branch of
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
Hi Mark,
This patch is against DaVinci git[1], which still has some differences
compared to the upstream trees.
Below is a version of this patch against Linus' tree, with the SFFSDR
board changes from Hugo included.
Kevin
[1] http://git.kernel.org/?p=linux/kernel/git/khilman/linux-davinci.git;a=summary
commit 53748f550f8dcd2cad676e67804d69cd4424ab4f
Author: Chaithrika U S <chaithrika@ti.com>
Date: Fri Feb 13 12:39:39 2009 +0530
ASoC: DaVinci: fix module unload error
Fix for the error when the audio module is unloaded. On unregistering
the platform_device, platform_device_release will free the platform
data.If platform data is static the kernel panics when it is freed.
Instead use the platform device helper function to add data.
This change has been tested on DM644x EVM, DM644x SFFSDR and DM355 EVM.
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
index 54851f3..9b90b34 100644
--- a/sound/soc/davinci/davinci-evm.c
+++ b/sound/soc/davinci/davinci-evm.c
@@ -186,7 +186,8 @@ static int __init evm_init(void)
platform_set_drvdata(evm_snd_device, &evm_snd_devdata);
evm_snd_devdata.dev = &evm_snd_device->dev;
- evm_snd_device->dev.platform_data = &evm_snd_data;
+ platform_device_add_data(evm_snd_device, &evm_snd_data,
+ sizeof(evm_snd_data));
ret = platform_device_add_resources(evm_snd_device, evm_snd_resources,
ARRAY_SIZE(evm_snd_resources));
diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c
index 4935d1b..5a2e5e0 100644
--- a/sound/soc/davinci/davinci-sffsdr.c
+++ b/sound/soc/davinci/davinci-sffsdr.c
@@ -127,7 +127,8 @@ static int __init sffsdr_init(void)
platform_set_drvdata(sffsdr_snd_device, &sffsdr_snd_devdata);
sffsdr_snd_devdata.dev = &sffsdr_snd_device->dev;
- sffsdr_snd_device->dev.platform_data = &sffsdr_snd_data;
+ platform_device_add_data(sffsdr_snd_device, &sffsdr_snd_data,
+ sizeof(sffsdr_snd_data));
ret = platform_device_add_resources(sffsdr_snd_device,
sffsdr_snd_resources,
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH]: ARM DaVinci ASoC: Fix module unload error
2009-02-13 19:36 ` Kevin Hilman
@ 2009-02-13 20:31 ` Mark Brown
2009-02-13 22:37 ` Kevin Hilman
0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2009-02-13 20:31 UTC (permalink / raw)
To: Kevin Hilman; +Cc: chaithrika, alsa-devel, davinci-linux-open-source
On Fri, Feb 13, 2009 at 11:36:37AM -0800, Kevin Hilman wrote:
> This patch is against DaVinci git[1], which still has some differences
> compared to the upstream trees.
> Below is a version of this patch against Linus' tree, with the SFFSDR
> board changes from Hugo included.
Applied, thanks. Is there any plan in place for bringing the DaVinci
tree into sync with mainline here? It'd help avoid issues like this in
future.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH]: ARM DaVinci ASoC: Fix module unload error
2009-02-13 20:31 ` Mark Brown
@ 2009-02-13 22:37 ` Kevin Hilman
0 siblings, 0 replies; 7+ messages in thread
From: Kevin Hilman @ 2009-02-13 22:37 UTC (permalink / raw)
To: Mark Brown; +Cc: chaithrika, alsa-devel, davinci-linux-open-source
Mark Brown <broonie@sirena.org.uk> writes:
> On Fri, Feb 13, 2009 at 11:36:37AM -0800, Kevin Hilman wrote:
>
>> This patch is against DaVinci git[1], which still has some differences
>> compared to the upstream trees.
>
>> Below is a version of this patch against Linus' tree, with the SFFSDR
>> board changes from Hugo included.
>
> Applied, thanks. Is there any plan in place for bringing the DaVinci
> tree into sync with mainline here? It'd help avoid issues like this in
> future.
Yes, I am actively working on that. However, I'm currently focusing
on the core arch/arm/mach-davinci/* code first, then will work on
bringing the rest of the drivers up to speed.
Kevin
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-02-13 22:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-13 7:09 [PATCH]: ARM DaVinci ASoC: Fix module unload error chaithrika
2009-02-13 13:30 ` Mark Brown
2009-02-13 19:36 ` Kevin Hilman
2009-02-13 20:31 ` Mark Brown
2009-02-13 22:37 ` Kevin Hilman
2009-02-13 17:47 ` Hugo Villeneuve
2009-02-13 19:16 ` Kevin Hilman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.