Patchwork UBUNTU: SAUCE: Fix oops in patch_hdmi due to missing hda_gen_spec struct

login
register
mail settings
Submitter David Henningsson
Date April 18, 2013, 8:46 a.m.
Message ID <1366274787-5639-1-git-send-email-david.henningsson@canonical.com>
Download mbox | patch
Permalink /patch/237481/
State New
Headers show

Comments

David Henningsson - April 18, 2013, 8:46 a.m.
A recent commit added calls to the snd_hda_*_fixup functions. Under
kernel 3.8 and earlier these functions require a hda_gen_spec struct
to be first in the spec struct, or memory corruption might occur.

Buglink: https://bugs.launchpad.net/bugs/1169984
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
---
 sound/pci/hda/patch_hdmi.c |    1 +
 1 file changed, 1 insertion(+)
Stefan Bader - April 18, 2013, 9:02 a.m.
Looks reasonable. Just a bit confusing about how this relates to upstream. Does
mainline not need it because the fixup function is different? What about the
upstream stable trees?

-Stefan
Tim Gardner - April 18, 2013, 3:50 p.m.
On 04/18/2013 02:46 AM, David Henningsson wrote:
> A recent commit added calls to the snd_hda_*_fixup functions. Under
> kernel 3.8 and earlier these functions require a hda_gen_spec struct
> to be first in the spec struct, or memory corruption might occur.
> 
> Buglink: https://bugs.launchpad.net/bugs/1169984
> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
> ---
>  sound/pci/hda/patch_hdmi.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> index 6ae6331..1eee344 100644
> --- a/sound/pci/hda/patch_hdmi.c
> +++ b/sound/pci/hda/patch_hdmi.c
> @@ -80,6 +80,7 @@ struct hdmi_spec_per_pin {
>  };
>  
>  struct hdmi_spec {
> +	struct hda_gen_spec gen;
>  	int num_cvts;
>  	struct hdmi_spec_per_cvt cvts[MAX_HDMI_CVTS];
>  
> 

Dangerous 'void *' games. For which stable kernels is this required ?
c9ce6b260b039392b24ad65954788047d13d4c9a appears to be the upstream fix
but it is quite intrusive.

rtg
David Henningsson - April 19, 2013, 5:46 a.m.
On 04/18/2013 05:50 PM, Tim Gardner wrote:
> On 04/18/2013 02:46 AM, David Henningsson wrote:
>> A recent commit added calls to the snd_hda_*_fixup functions. Under
>> kernel 3.8 and earlier these functions require a hda_gen_spec struct
>> to be first in the spec struct, or memory corruption might occur.
>>
>> Buglink: https://bugs.launchpad.net/bugs/1169984
>> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
>> ---
>>   sound/pci/hda/patch_hdmi.c |    1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
>> index 6ae6331..1eee344 100644
>> --- a/sound/pci/hda/patch_hdmi.c
>> +++ b/sound/pci/hda/patch_hdmi.c
>> @@ -80,6 +80,7 @@ struct hdmi_spec_per_pin {
>>   };
>>
>>   struct hdmi_spec {
>> +	struct hda_gen_spec gen;
>>   	int num_cvts;
>>   	struct hdmi_spec_per_cvt cvts[MAX_HDMI_CVTS];
>>
>>
>
> Dangerous 'void *' games.

Indeed.

> For which stable kernels is this required ?
> c9ce6b260b039392b24ad65954788047d13d4c9a appears to be the upstream fix
> but it is quite intrusive.

It's required for every kernel you backported the below commit to:

commit 5d981dcc2da6182186eb8fa4ee1c29c20fdc66a0
Author: Mengdong Lin <mengdong.lin@intel.com>
Date:   Fri Feb 8 17:09:52 2013 -0500

     ALSA: hda - Add fixup for Haswell to enable all pin and convertor 
widgets
Tim Gardner - April 19, 2013, 12:38 p.m.
>>
>> Dangerous 'void *' games.
> 
> Indeed.
> 
>> For which stable kernels is this required ?
>> c9ce6b260b039392b24ad65954788047d13d4c9a appears to be the upstream fix
>> but it is quite intrusive.
> 
> It's required for every kernel you backported the below commit to:
> 
> commit 5d981dcc2da6182186eb8fa4ee1c29c20fdc66a0
> Author: Mengdong Lin <mengdong.lin@intel.com>
> Date:   Fri Feb 8 17:09:52 2013 -0500
> 
>     ALSA: hda - Add fixup for Haswell to enable all pin and convertor
> widgets
> 
> 

So, just for completeness, we only applied this patch to Raring. No
stable kernels are involved since this was never applied to upstream
stable. It was for the Lynx Point audio enablement only.

rtg

Patch

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 6ae6331..1eee344 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -80,6 +80,7 @@  struct hdmi_spec_per_pin {
 };
 
 struct hdmi_spec {
+	struct hda_gen_spec gen;
 	int num_cvts;
 	struct hdmi_spec_per_cvt cvts[MAX_HDMI_CVTS];