ARM: OMAP: mcbsp: Fix possible memory corruption
Subsystems (3)
PATCH 1/1 ARM: OMAP: mcbsp: Fix possible memory corruption
Commits 09d28d ("ARM: OMAP: mcbsp: Start generalize omap2_mcbsp_set_clks_src") and 7bc0c4 ("ARM: OMAP: mcbsp: Start generalize signal muxing functions") incorrectly set two struct omap_mcbsp_platform_data fields after omap_device_build_ss and kfree calls.
Fix this by moving these pdata assignments before those calls.
---
For 3.2, 3.1 is ok.
--- arch/arm/mach-omap2/mcbsp.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/mcbsp.c +3 -3
@@ -145,6 +145,9 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) pdata->reg_size =4 ; pdata->has_ccr = true; } + pdata->set_clk_src = omap2_mcbsp_set_clk_src; +if (id ==1 ) + pdata->mux_signal = omap2_mcbsp1_mux_rx_clk;if (oh->class->rev ==MCBSP_CONFIG_TYPE3 ) {if (id ==2 )
@@ -174,9 +177,6 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) name, oh->name);return PTR_ERR (pdev); } - pdata->set_clk_src = omap2_mcbsp_set_clk_src; -if (id ==1 ) - pdata->mux_signal = omap2_mcbsp1_mux_rx_clk; omap_mcbsp_count++;return 0 ; }
Signature · 1 line
1.7.7.3
PATCH 1/1 ARM: OMAP: mcbsp: Fix possible memory corruption
Commits 09d28d ("ARM: OMAP: mcbsp: Start generalize omap2_mcbsp_set_clks_src") and 7bc0c4 ("ARM: OMAP: mcbsp: Start generalize signal muxing functions") incorrectly set two struct omap_mcbsp_platform_data fields after omap_device_build_ss and kfree calls.
Fix this by moving these pdata assignments before those calls.
---
For 3.2, 3.1 is ok.
--- arch/arm/mach-omap2/mcbsp.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/mcbsp.c +3 -3
@@ -145,6 +145,9 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) pdata->reg_size =4 ; pdata->has_ccr = true; } + pdata->set_clk_src = omap2_mcbsp_set_clk_src; +if (id ==1 ) + pdata->mux_signal = omap2_mcbsp1_mux_rx_clk;if (oh->class->rev ==MCBSP_CONFIG_TYPE3 ) {if (id ==2 )
@@ -174,9 +177,6 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) name, oh->name);return PTR_ERR (pdev); } - pdata->set_clk_src = omap2_mcbsp_set_clk_src; -if (id ==1 ) - pdata->mux_signal = omap2_mcbsp1_mux_rx_clk; omap_mcbsp_count++;return 0 ; }
Signature · 1 line
1.7.7.3
PATCH 1/1 ARM: OMAP: mcbsp: Fix possible memory corruption
Quoted 9 lines · Jarkko Nikula
Commits 09d28d ("ARM: OMAP: mcbsp: Start generalize
omap2_mcbsp_set_clks_src") and 7bc0c4 ("ARM: OMAP: mcbsp: Start generalize signal muxing functions") incorrectly set two structomap_mcbsp_platform_datafields afteromap_device_build_ssand kfree calls.Fix this by moving these pdata assignments before those calls.
Signed-off-by Jarkko Nikula <[email protected]>Reported-by neilb at suse.de
Perhaps, should be:
and
Cc: <[email protected]> [3.1]
as for below.
Quoted 30 lines
---
For 3.2, 3.1 is ok.--- arch/arm/mach-omap2/mcbsp.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)arch/arm/mach-omap2/mcbsp.c +3
-3@@ -145,6 +145,9 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) pdata->reg_size =4 ; pdata->has_ccr = true; } + pdata->set_clk_src = omap2_mcbsp_set_clk_src; +if (id ==1 ) + pdata->mux_signal = omap2_mcbsp1_mux_rx_clk;if (oh->class->rev ==MCBSP_CONFIG_TYPE3 ) {if (id ==2 )@@ -174,9 +177,6 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) name, oh->name);return PTR_ERR (pdev); } - pdata->set_clk_src = omap2_mcbsp_set_clk_src; -if (id ==1 ) - pdata->mux_signal = omap2_mcbsp1_mux_rx_clk; omap_mcbsp_count++;return 0 ; }
Signature · 2 lines
Regards, Igor.
PATCH 1/1 ARM: OMAP: mcbsp: Fix possible memory corruption
Hi
Quoted 8 lines · Igor Grinberg
Quoted 7 lines · Jarkko Nikula
Commits 09d28d ("ARM: OMAP: mcbsp: Start generalize
omap2_mcbsp_set_clks_src") and 7bc0c4 ("ARM: OMAP: mcbsp: Start generalize signal muxing functions") incorrectly set two structomap_mcbsp_platform_datafields afteromap_device_build_ssand kfree calls.Fix this by moving these pdata assignments before those calls.
Quoted 10 lines
Quoted 2 lines
Signed-off-by Jarkko Nikula <[email protected]>Reported-by neilb at suse.dePerhaps, should be:
Reported-by NeilBrown <[email protected]>and
Cc: <[email protected]> [3.1]
as for below.Quoted 3 lines
---
For 3.2, 3.1 is ok.
---
No need to cc stable since the issue is not in stable kernels.
Signature · 1 line
Jarkko
PATCH 1/1 ARM: OMAP: mcbsp: Fix possible memory corruption
Quoted 18 lines · Jarkko Nikula
Hi
Quoted 15 lines · Igor Grinberg
Quoted 9 lines · Jarkko Nikula
Commits 09d28d ("ARM: OMAP: mcbsp: Start generalize
omap2_mcbsp_set_clks_src") and 7bc0c4 ("ARM: OMAP: mcbsp: Start generalize signal muxing functions") incorrectly set two structomap_mcbsp_platform_datafields afteromap_device_build_ssand kfree calls.Fix this by moving these pdata assignments before those calls.
Signed-off-by Jarkko Nikula <[email protected]>Reported-by neilb at suse.dePerhaps, should be:
Reported-by NeilBrown <[email protected]>and
Cc: <[email protected]> [3.1]
as for below.
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
---
For 3.2, 3.1 is ok.
---No need to cc stable since the issue is not in stable kernels.
Ah, so I've misunderstood what was that about... So it has been introduced in 3.2-rc cycle. Ok. Then now it is the perfect time to fix this ;)
Signature · 2 lines
Regards, Igor.
Tony Lindgren
maintainerPATCH 1/1 ARM: OMAP: mcbsp: Fix possible memory corruption
Quoted 19 lines · Igor Grinberg
Quoted 18 lines · Jarkko Nikula
Hi
Quoted 15 lines · Igor Grinberg
Quoted 9 lines · Jarkko Nikula
Commits 09d28d ("ARM: OMAP: mcbsp: Start generalize
omap2_mcbsp_set_clks_src") and 7bc0c4 ("ARM: OMAP: mcbsp: Start generalize signal muxing functions") incorrectly set two structomap_mcbsp_platform_datafields afteromap_device_build_ssand kfree calls.Fix this by moving these pdata assignments before those calls.
Signed-off-by Jarkko Nikula <[email protected]>Reported-by neilb at suse.dePerhaps, should be:
Reported-by NeilBrown <[email protected]>and
Cc: <[email protected]> [3.1]
as for below.
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
---
For 3.2, 3.1 is ok.
---No need to cc stable since the issue is not in stable kernels.
Ah, so I've misunderstood what was that about... So it has been introduced in 3.2-rc cycle. Ok. Then now it is the perfect time to fix this ;)
Applying into fixes.
Regards,
Tony
PATCH 1/1 ARM: OMAP: mcbsp: Fix possible memory corruption
Quoted 1 line · Tony Lindgren
Applying into fixes.
FWIW, I was bisecting this issue, the patch fixes the following slab corruptions on boot log:
...
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
Slab corruption: size-32 start=eea66740, len=32
010: d8 9d 02 c0 04 9d 02 c0 6b 6b 6b 6b 6b 6b 6b a5 ........kkkkkkk. Prev obj: start=eea66720, len=32
000: 6f 6d 61 70 32 5f 6d 63 73 70 69 2e 31 00 5a 5a omap2_mcspi.1.ZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. Next obj: start=eea66760, len=32
000: 70 6f 77 65 72 00 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a power.ZZZZZZZZZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. Slab corruption: size-32 start=eea66740, len=32
010: d8 9d 02 c0 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5 ....kkkkkkkkkkk. Prev obj: start=eea66720, len=32
000: 6f 6d 61 70 32 5f 6d 63 73 70 69 2e 31 00 5a 5a omap2_mcspi.1.ZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. Next obj: start=eea66760, len=32
000: 70 6f 77 65 72 00 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a power.ZZZZZZZZZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. Slab corruption: size-32 start=eea66740, len=32
010: d8 9d 02 c0 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5 ....kkkkkkkkkkk. Prev obj: start=eea66720, len=32
000: 6f 6d 61 70 32 5f 6d 63 73 70 69 2e 31 00 5a 5a omap2_mcspi.1.ZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. Next obj: start=eea66760, len=32
000: 70 6f 77 65 72 00 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a power.ZZZZZZZZZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. Slab corruption: size-32 start=eea66740, len=32
010: d8 9d 02 c0 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5 ....kkkkkkkkkkk. Prev obj: start=eea66720, len=32
000: 6f 6d 61 70 32 5f 6d 63 73 70 69 2e 31 00 5a 5a omap2_mcspi.1.ZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. Next obj: start=eea66760, len=32
000: 70 6f 77 65 72 00 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a power.ZZZZZZZZZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. OMAP DMA hardware revision 0.0
...
Regards,
Omar
Tony Lindgren
maintainerPATCH 1/1 ARM: OMAP: mcbsp: Fix possible memory corruption
Quoted 5 lines · Ramirez Luna, Omar
Quoted 1 line · Tony Lindgren
Applying into fixes.
FWIW, I was bisecting this issue, the patch fixes the following slab corruptions on boot log:
Thanks for the info, I've sent the pull request for the two patches in fixes branch.
Regards,
Tony
Quoted 40 lines
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
Slab corruption: size-32 start=eea66740, len=32
010: d8 9d 02 c0 04 9d 02 c0 6b 6b 6b 6b 6b 6b 6b a5 ........kkkkkkk. Prev obj: start=eea66720, len=32
000: 6f 6d 61 70 32 5f 6d 63 73 70 69 2e 31 00 5a 5a omap2_mcspi.1.ZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. Next obj: start=eea66760, len=32
000: 70 6f 77 65 72 00 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a power.ZZZZZZZZZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. Slab corruption: size-32 start=eea66740, len=32
010: d8 9d 02 c0 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5 ....kkkkkkkkkkk. Prev obj: start=eea66720, len=32
000: 6f 6d 61 70 32 5f 6d 63 73 70 69 2e 31 00 5a 5a omap2_mcspi.1.ZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. Next obj: start=eea66760, len=32
000: 70 6f 77 65 72 00 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a power.ZZZZZZZZZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. Slab corruption: size-32 start=eea66740, len=32
010: d8 9d 02 c0 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5 ....kkkkkkkkkkk. Prev obj: start=eea66720, len=32
000: 6f 6d 61 70 32 5f 6d 63 73 70 69 2e 31 00 5a 5a omap2_mcspi.1.ZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. Next obj: start=eea66760, len=32
000: 70 6f 77 65 72 00 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a power.ZZZZZZZZZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. Slab corruption: size-32 start=eea66740, len=32
010: d8 9d 02 c0 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5 ....kkkkkkkkkkk. Prev obj: start=eea66720, len=32
000: 6f 6d 61 70 32 5f 6d 63 73 70 69 2e 31 00 5a 5a omap2_mcspi.1.ZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. Next obj: start=eea66760, len=32
000: 70 6f 77 65 72 00 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a power.ZZZZZZZZZZ 010: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a a5 ZZZZZZZZZZZZZZZ. OMAP DMA hardware revision 0.0
...Regards,
Omar