Bug 43337

Summary: SMIA++/SMIA sensor support breaks build
Product: Drivers Reporter: Alexandre Demers (alexandre.f.demers)
Component: OtherAssignee: Alan (alan)
Status: CLOSED CODE_FIX    
Severity: high CC: alan, florian, mchehab
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: 3.5-rc1 Subsystem:
Regression: No Bisected commit-id:
Attachments: .config that generates the latest bug

Description Alexandre Demers 2012-06-03 23:51:19 UTC
When building kernel with SMIA++/SMIA sensor support, it fails with an error. Unselecting it fixes the build procedure.


  LD      drivers/media/video/smiapp/built-in.o
  CC [M]  drivers/media/video/smiapp/smiapp-core.o
  CC [M]  drivers/media/video/smiapp/smiapp-regs.o
/home/dema1701/projects/kernel/linux-3/drivers/media/video/smiapp/smiapp-core.c: In function ‘smiapp_registered’:
/home/dema1701/projects/kernel/linux-3/drivers/media/video/smiapp/smiapp-core.c:2472:3: error: implicit declaration of function ‘kzalloc’ [-Werror=implicit-function-declaration]
/home/dema1701/projects/kernel/linux-3/drivers/media/video/smiapp/smiapp-core.c:2472:15: warning: assignment makes pointer from integer without a cast [enabled by default]
/home/dema1701/projects/kernel/linux-3/drivers/media/video/smiapp/smiapp-core.c:2639:2: error: implicit declaration of function ‘kfree’ [-Werror=implicit-function-declaration]
/home/dema1701/projects/kernel/linux-3/drivers/media/video/smiapp/smiapp-core.c: In function ‘smiapp_probe’:
/home/dema1701/projects/kernel/linux-3/drivers/media/video/smiapp/smiapp-core.c:2808:9: warning: assignment makes pointer from integer without a cast [enabled by default]
cc1: some warnings being treated as errors
make[5]: *** [drivers/media/video/smiapp/smiapp-core.o] Error 1
Comment 1 Alan 2012-06-12 09:45:42 UTC
Add an include of <linux/slab.h> to the problem files and let me know if that cures it
Comment 2 Alexandre Demers 2012-06-13 03:45:05 UTC
It fixes it.
Comment 3 Alexandre Demers 2012-06-13 04:28:14 UTC
And now at the end of the build:
ERROR: "clk_enable" [drivers/media/video/smiapp/smiapp.ko] undefined!
ERROR: "clk_disable" [drivers/media/video/smiapp/smiapp.ko] undefined!
ERROR: "clk_put" [drivers/media/video/smiapp/smiapp.ko] undefined!
ERROR: "clk_get" [drivers/media/video/smiapp/smiapp.ko] undefined!
ERROR: "clk_set_rate" [drivers/media/video/smiapp/smiapp.ko] undefined!

I made a clean build just in case and it did the same.
Comment 4 Alan 2012-06-13 10:12:47 UTC
Ok thats a different bug to go with it. Can you attach your .config file and I'll have a further look
Comment 5 Alexandre Demers 2012-06-13 21:28:57 UTC
Created attachment 73587 [details]
.config that generates the latest bug
Comment 6 Alexandre Demers 2012-06-13 21:31:56 UTC
It is the only module having this problem, so I would think it is not related to my .config but I may be wrong.
Comment 7 Alan 2012-06-14 09:46:15 UTC
The .config means I can reproduce your build options.

What usually happens in cases like this is that its a specific set of options that mean something that works in most cases (by luck including the needed header or bits) then fails.

The .config means I can fix it and verify your config works.
Comment 8 Alexandre Demers 2012-06-14 12:26:28 UTC
(In reply to comment #7)
> The .config means I can reproduce your build options.
> 
> What usually happens in cases like this is that its a specific set of options
> that mean something that works in most cases (by luck including the needed
> header or bits) then fails.
> 
> The .config means I can fix it and verify your config works.

Ah, yes, I see!
Comment 9 Alan 2012-06-14 12:41:15 UTC
Ok done.. it needs the clock layer so adding an && HAVE_CLK to Kconfig sorts it
out. I don't think in its current form it was meant to leak into x86 builds.

Patch sent to the author

Thanks
Comment 10 Alan 2012-06-15 11:15:19 UTC
In Sakari's tree
Comment 11 Florian Mickler 2012-07-01 09:40:20 UTC
A patch referencing this bug report has been merged in Linux v3.5-rc5:

commit 099987f0aaf28771261b91a41240b9228f2e32b2
Author: Alan Cox <alan@linux.intel.com>
Date:   Thu Jun 14 09:54:07 2012 -0300

    [media] smia: Fix compile failures