diff mbox

Staging: Android logger: fix compiling error

Message ID 1256316741-14053-1-git-send-email-bryan.wu@canonical.com
State Accepted
Headers show

Commit Message

Bryan Wu Oct. 23, 2009, 4:52 p.m. UTC
When compiling Android staging driver for PXA3XX machine, met following error:

  CC      drivers/staging/android/logger.o
drivers/staging/android/logger.c: In function 'logger_read':
drivers/staging/android/logger.c:165: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
drivers/staging/android/logger.c:165: error: (Each undeclared identifier is reported only once
drivers/staging/android/logger.c:165: error: for each function it appears in.)
drivers/staging/android/logger.c:178: error: implicit declaration of function 'signal_pending'
drivers/staging/android/logger.c:183: error: implicit declaration of function 'schedule'
drivers/staging/android/logger.c: In function 'logger_aio_write':
drivers/staging/android/logger.c:325: error: dereferencing pointer to incomplete type
drivers/staging/android/logger.c:333: error: dereferencing pointer to incomplete type
drivers/staging/android/logger.c:334: error: dereferencing pointer to incomplete type
drivers/staging/android/logger.c:337: error: dereferencing pointer to incomplete type
drivers/staging/android/logger.c:360: error: dereferencing pointer to incomplete type
drivers/staging/android/logger.c:363: error: dereferencing pointer to incomplete type
drivers/staging/android/logger.c:370: error: increment of pointer to unknown structure
drivers/staging/android/logger.c:370: error: arithmetic on pointer to an incomplete type
drivers/staging/android/logger.c:377: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
make[3]: *** [drivers/staging/android/logger.o] Error 1

Compiling broke since commit a99bbaf5ee6bad1aca0c88ea65ec6e5373e86184
    headers: remove sched.h from poll.h

Adding <linux/sched.h> to fix this compiling bug.

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 drivers/staging/android/logger.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Andy Whitcroft Oct. 26, 2009, 1:09 p.m. UTC | #1
On Sat, Oct 24, 2009 at 12:52:21AM +0800, Bryan Wu wrote:
> When compiling Android staging driver for PXA3XX machine, met following error:
> 
>   CC      drivers/staging/android/logger.o
> drivers/staging/android/logger.c: In function 'logger_read':
> drivers/staging/android/logger.c:165: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
> drivers/staging/android/logger.c:165: error: (Each undeclared identifier is reported only once
> drivers/staging/android/logger.c:165: error: for each function it appears in.)
> drivers/staging/android/logger.c:178: error: implicit declaration of function 'signal_pending'
> drivers/staging/android/logger.c:183: error: implicit declaration of function 'schedule'
> drivers/staging/android/logger.c: In function 'logger_aio_write':
> drivers/staging/android/logger.c:325: error: dereferencing pointer to incomplete type
> drivers/staging/android/logger.c:333: error: dereferencing pointer to incomplete type
> drivers/staging/android/logger.c:334: error: dereferencing pointer to incomplete type
> drivers/staging/android/logger.c:337: error: dereferencing pointer to incomplete type
> drivers/staging/android/logger.c:360: error: dereferencing pointer to incomplete type
> drivers/staging/android/logger.c:363: error: dereferencing pointer to incomplete type
> drivers/staging/android/logger.c:370: error: increment of pointer to unknown structure
> drivers/staging/android/logger.c:370: error: arithmetic on pointer to an incomplete type
> drivers/staging/android/logger.c:377: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
> make[3]: *** [drivers/staging/android/logger.o] Error 1
> 
> Compiling broke since commit a99bbaf5ee6bad1aca0c88ea65ec6e5373e86184
>     headers: remove sched.h from poll.h
> 
> Adding <linux/sched.h> to fix this compiling bug.
> 
> Cc: Alexey Dobriyan <adobriyan@gmail.com>
> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
> ---
>  drivers/staging/android/logger.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
> index 6c10b45..a8eb7d1 100644
> --- a/drivers/staging/android/logger.c
> +++ b/drivers/staging/android/logger.c
> @@ -21,6 +21,7 @@
>  #include <linux/fs.h>
>  #include <linux/miscdevice.h>
>  #include <linux/uaccess.h>
> +#include <linux/sched.h>
>  #include <linux/poll.h>
>  #include <linux/time.h>
>  #include "logger.h"

This appears to be a patch for 2.6.32 kernels.  It fixes compilation of
the core android functionality.  

Seems appropriate for Lucid to allow testing there.

-apw
Eric Miao Oct. 27, 2009, 4:40 a.m. UTC | #2
> Compiling broke since commit a99bbaf5ee6bad1aca0c88ea65ec6e5373e86184
>    headers: remove sched.h from poll.h
>
> Adding <linux/sched.h> to fix this compiling bug.
>

Bryan,

Is this something caused by incorrect pxa header files?

> Cc: Alexey Dobriyan <adobriyan@gmail.com>
> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
> ---
>  drivers/staging/android/logger.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
> index 6c10b45..a8eb7d1 100644
> --- a/drivers/staging/android/logger.c
> +++ b/drivers/staging/android/logger.c
> @@ -21,6 +21,7 @@
>  #include <linux/fs.h>
>  #include <linux/miscdevice.h>
>  #include <linux/uaccess.h>
> +#include <linux/sched.h>
>  #include <linux/poll.h>
>  #include <linux/time.h>
>  #include "logger.h"
> --
> 1.6.3.3
>
>
> --
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
>
Bryan Wu Oct. 27, 2009, 4:42 a.m. UTC | #3
Eric Miao wrote:
>> Compiling broke since commit a99bbaf5ee6bad1aca0c88ea65ec6e5373e86184
>>    headers: remove sched.h from poll.h
>>
>> Adding <linux/sched.h> to fix this compiling bug.
>>
> 
> Bryan,
> 
> Is this something caused by incorrect pxa header files?
> 

No. the commit a99bbaf5ee6bad1aca0c88ea65ec6e5373e86184 missed to fix this issue in Android driver.
It fixed others. I just added it back.

-Bryan
gregkh@suse.de Oct. 27, 2009, 2:05 p.m. UTC | #4
On Tue, Oct 27, 2009 at 12:40:07PM +0800, Eric Miao wrote:
> > Compiling broke since commit a99bbaf5ee6bad1aca0c88ea65ec6e5373e86184
> >    headers: remove sched.h from poll.h
> >
> > Adding <linux/sched.h> to fix this compiling bug.

I have now just marked the android drivers as broken, as this is not the
only build error in them at the moment :(

thanks,

greg k-h
Bryan Wu Oct. 29, 2009, 1:01 a.m. UTC | #5
Greg KH wrote:
> On Tue, Oct 27, 2009 at 12:40:07PM +0800, Eric Miao wrote:
>>> Compiling broke since commit a99bbaf5ee6bad1aca0c88ea65ec6e5373e86184
>>>    headers: remove sched.h from poll.h
>>>
>>> Adding <linux/sched.h> to fix this compiling bug.
> 
> I have now just marked the android drivers as broken, as this is not the
> only build error in them at the moment :(
> 

Yeah, actually the drivers/staging/android/lowmemorykiller.c has been failing to compile for a long 
time, because that struct mm_struct does not have a field named oom_adj. All the Android drivers are 
compiled as modules in Ubuntu kernel package, except this one.

Although Android public kernel is still in 2.6.29, it's own driver is totally different with our 
mainline staging version. Is there any plan to sync with it?

Thanks,
-Bryan
gregkh@suse.de Oct. 29, 2009, 1:04 a.m. UTC | #6
On Thu, Oct 29, 2009 at 09:01:07AM +0800, Bryan Wu wrote:
> Greg KH wrote:
> > On Tue, Oct 27, 2009 at 12:40:07PM +0800, Eric Miao wrote:
> >>> Compiling broke since commit a99bbaf5ee6bad1aca0c88ea65ec6e5373e86184
> >>>    headers: remove sched.h from poll.h
> >>>
> >>> Adding <linux/sched.h> to fix this compiling bug.
> > 
> > I have now just marked the android drivers as broken, as this is not the
> > only build error in them at the moment :(
> > 
> 
> Yeah, actually the drivers/staging/android/lowmemorykiller.c has been
> failing to compile for a long time, because that struct mm_struct does
> not have a field named oom_adj. All the Android drivers are compiled
> as modules in Ubuntu kernel package, except this one.
> 
> Although Android public kernel is still in 2.6.29, it's own driver is
> totally different with our mainline staging version. Is there any plan
> to sync with it?

No, Google has abandoned any current effort to push code upstream for
the past year :(

The android drivers are deleted in linux-next and will go away in 2.6.33
because of this.

thanks,

greg k-h
Bryan Wu Oct. 29, 2009, 1:11 a.m. UTC | #7
Greg KH wrote:
> On Thu, Oct 29, 2009 at 09:01:07AM +0800, Bryan Wu wrote:
>> Greg KH wrote:
>>> On Tue, Oct 27, 2009 at 12:40:07PM +0800, Eric Miao wrote:
>>>>> Compiling broke since commit a99bbaf5ee6bad1aca0c88ea65ec6e5373e86184
>>>>>    headers: remove sched.h from poll.h
>>>>>
>>>>> Adding <linux/sched.h> to fix this compiling bug.
>>> I have now just marked the android drivers as broken, as this is not the
>>> only build error in them at the moment :(
>>>
>> Yeah, actually the drivers/staging/android/lowmemorykiller.c has been
>> failing to compile for a long time, because that struct mm_struct does
>> not have a field named oom_adj. All the Android drivers are compiled
>> as modules in Ubuntu kernel package, except this one.
>>
>> Although Android public kernel is still in 2.6.29, it's own driver is
>> totally different with our mainline staging version. Is there any plan
>> to sync with it?
> 
> No, Google has abandoned any current effort to push code upstream for
> the past year :(
> 
> The android drivers are deleted in linux-next and will go away in 2.6.33
> because of this.
> 

Thanks a lot for this update. It looks like we need to consider to drop Android 
modules in our Ubuntu kernel building somehow.

Cheers,
-Bryan
gregkh@suse.de Oct. 29, 2009, 1:17 a.m. UTC | #8
On Thu, Oct 29, 2009 at 09:11:39AM +0800, Bryan Wu wrote:
> Greg KH wrote:
> > On Thu, Oct 29, 2009 at 09:01:07AM +0800, Bryan Wu wrote:
> >> Greg KH wrote:
> >>> On Tue, Oct 27, 2009 at 12:40:07PM +0800, Eric Miao wrote:
> >>>>> Compiling broke since commit a99bbaf5ee6bad1aca0c88ea65ec6e5373e86184
> >>>>>    headers: remove sched.h from poll.h
> >>>>>
> >>>>> Adding <linux/sched.h> to fix this compiling bug.
> >>> I have now just marked the android drivers as broken, as this is not the
> >>> only build error in them at the moment :(
> >>>
> >> Yeah, actually the drivers/staging/android/lowmemorykiller.c has been
> >> failing to compile for a long time, because that struct mm_struct does
> >> not have a field named oom_adj. All the Android drivers are compiled
> >> as modules in Ubuntu kernel package, except this one.
> >>
> >> Although Android public kernel is still in 2.6.29, it's own driver is
> >> totally different with our mainline staging version. Is there any plan
> >> to sync with it?
> > 
> > No, Google has abandoned any current effort to push code upstream for
> > the past year :(
> > 
> > The android drivers are deleted in linux-next and will go away in 2.6.33
> > because of this.
> > 
> 
> Thanks a lot for this update. It looks like we need to consider to drop Android 
> modules in our Ubuntu kernel building somehow.

As no one is using them, it should be trivial to just change your kernel
config, right?

thanks,

greg k-h
Bryan Wu Oct. 29, 2009, 1:27 a.m. UTC | #9
Greg KH wrote:
> On Thu, Oct 29, 2009 at 09:11:39AM +0800, Bryan Wu wrote:
>> Greg KH wrote:
>>> On Thu, Oct 29, 2009 at 09:01:07AM +0800, Bryan Wu wrote:
>>>> Greg KH wrote:
>>>>> On Tue, Oct 27, 2009 at 12:40:07PM +0800, Eric Miao wrote:
>>>>>>> Compiling broke since commit a99bbaf5ee6bad1aca0c88ea65ec6e5373e86184
>>>>>>>    headers: remove sched.h from poll.h
>>>>>>>
>>>>>>> Adding <linux/sched.h> to fix this compiling bug.
>>>>> I have now just marked the android drivers as broken, as this is not the
>>>>> only build error in them at the moment :(
>>>>>
>>>> Yeah, actually the drivers/staging/android/lowmemorykiller.c has been
>>>> failing to compile for a long time, because that struct mm_struct does
>>>> not have a field named oom_adj. All the Android drivers are compiled
>>>> as modules in Ubuntu kernel package, except this one.
>>>>
>>>> Although Android public kernel is still in 2.6.29, it's own driver is
>>>> totally different with our mainline staging version. Is there any plan
>>>> to sync with it?
>>> No, Google has abandoned any current effort to push code upstream for
>>> the past year :(
>>>
>>> The android drivers are deleted in linux-next and will go away in 2.6.33
>>> because of this.
>>>
>> Thanks a lot for this update. It looks like we need to consider to drop Android 
>> modules in our Ubuntu kernel building somehow.
> 
> As no one is using them, it should be trivial to just change your kernel
> config, right?
> 

The reason we include them is that we wanna port the Android runtime environment 
to Ubuntu. Then the Android applications can run on Android compatible Ubuntu OS 
directly without any modification.

The Android runtime environment needs some Android drivers such as Binder.

But now, it is hard for us to do that without a workable Android drivers in 
mainline.

Thanks
-Bryan
gregkh@suse.de Oct. 29, 2009, 1:28 a.m. UTC | #10
On Thu, Oct 29, 2009 at 09:27:40AM +0800, Bryan Wu wrote:
> Greg KH wrote:
> > On Thu, Oct 29, 2009 at 09:11:39AM +0800, Bryan Wu wrote:
> >> Greg KH wrote:
> >>> On Thu, Oct 29, 2009 at 09:01:07AM +0800, Bryan Wu wrote:
> >>>> Greg KH wrote:
> >>>>> On Tue, Oct 27, 2009 at 12:40:07PM +0800, Eric Miao wrote:
> >>>>>>> Compiling broke since commit a99bbaf5ee6bad1aca0c88ea65ec6e5373e86184
> >>>>>>>    headers: remove sched.h from poll.h
> >>>>>>>
> >>>>>>> Adding <linux/sched.h> to fix this compiling bug.
> >>>>> I have now just marked the android drivers as broken, as this is not the
> >>>>> only build error in them at the moment :(
> >>>>>
> >>>> Yeah, actually the drivers/staging/android/lowmemorykiller.c has been
> >>>> failing to compile for a long time, because that struct mm_struct does
> >>>> not have a field named oom_adj. All the Android drivers are compiled
> >>>> as modules in Ubuntu kernel package, except this one.
> >>>>
> >>>> Although Android public kernel is still in 2.6.29, it's own driver is
> >>>> totally different with our mainline staging version. Is there any plan
> >>>> to sync with it?
> >>> No, Google has abandoned any current effort to push code upstream for
> >>> the past year :(
> >>>
> >>> The android drivers are deleted in linux-next and will go away in 2.6.33
> >>> because of this.
> >>>
> >> Thanks a lot for this update. It looks like we need to consider to drop Android 
> >> modules in our Ubuntu kernel building somehow.
> > 
> > As no one is using them, it should be trivial to just change your kernel
> > config, right?
> > 
> 
> The reason we include them is that we wanna port the Android runtime environment 
> to Ubuntu. Then the Android applications can run on Android compatible Ubuntu OS 
> directly without any modification.
> 
> The Android runtime environment needs some Android drivers such as Binder.

Don't you also need the wakelocks and the hooks in the core of the
kernel to tie into the binder mess?

> But now, it is hard for us to do that without a workable Android drivers in 
> mainline.

Then push on Google to get them cleaned up and fixed!  Or do it
yourself, all I need is a developer to take ownership of the code.

thanks,

greg k-h
Bryan Wu Oct. 29, 2009, 1:55 a.m. UTC | #11
Greg KH wrote:
> On Thu, Oct 29, 2009 at 09:27:40AM +0800, Bryan Wu wrote:
>> Greg KH wrote:
>>> On Thu, Oct 29, 2009 at 09:11:39AM +0800, Bryan Wu wrote:
>>>> Greg KH wrote:
>>>>> On Thu, Oct 29, 2009 at 09:01:07AM +0800, Bryan Wu wrote:
>>>>>> Greg KH wrote:
>>>>>>> On Tue, Oct 27, 2009 at 12:40:07PM +0800, Eric Miao wrote:
>>>>>>>>> Compiling broke since commit a99bbaf5ee6bad1aca0c88ea65ec6e5373e86184
>>>>>>>>>    headers: remove sched.h from poll.h
>>>>>>>>>
>>>>>>>>> Adding <linux/sched.h> to fix this compiling bug.
>>>>>>> I have now just marked the android drivers as broken, as this is not the
>>>>>>> only build error in them at the moment :(
>>>>>>>
>>>>>> Yeah, actually the drivers/staging/android/lowmemorykiller.c has been
>>>>>> failing to compile for a long time, because that struct mm_struct does
>>>>>> not have a field named oom_adj. All the Android drivers are compiled
>>>>>> as modules in Ubuntu kernel package, except this one.
>>>>>>
>>>>>> Although Android public kernel is still in 2.6.29, it's own driver is
>>>>>> totally different with our mainline staging version. Is there any plan
>>>>>> to sync with it?
>>>>> No, Google has abandoned any current effort to push code upstream for
>>>>> the past year :(
>>>>>
>>>>> The android drivers are deleted in linux-next and will go away in 2.6.33
>>>>> because of this.
>>>>>
>>>> Thanks a lot for this update. It looks like we need to consider to drop Android 
>>>> modules in our Ubuntu kernel building somehow.
>>> As no one is using them, it should be trivial to just change your kernel
>>> config, right?
>>>
>> The reason we include them is that we wanna port the Android runtime environment 
>> to Ubuntu. Then the Android applications can run on Android compatible Ubuntu OS 
>> directly without any modification.
>>
>> The Android runtime environment needs some Android drivers such as Binder.
> 
> Don't you also need the wakelocks and the hooks in the core of the
> kernel to tie into the binder mess?
> 

Yeah, that is complicated. -:(

>> But now, it is hard for us to do that without a workable Android drivers in 
>> mainline.
> 
> Then push on Google to get them cleaned up and fixed!  Or do it
> yourself, all I need is a developer to take ownership of the code.
> 

I'm doing a task which is trying to merge Android patches to Ubuntu kernel and 
mainline, not only the Android drivers but also the ARM port code which is not 
in mainline.

But since Android kernel is 2.6.29 and ours or mainline is 2.6.31+, you know it 
needs much more effort without Google's help.

And for sure, I'm very happy to help this out.

Cheers,
-Bryan
Brian Swetland Oct. 29, 2009, 2:22 a.m. UTC | #12
On Wed, Oct 28, 2009 at 6:55 PM, Bryan Wu <bryan.wu@canonical.com> wrote:
>>> But now, it is hard for us to do that without a workable Android drivers
>>> in mainline.
>>
>> Then push on Google to get them cleaned up and fixed!  Or do it
>> yourself, all I need is a developer to take ownership of the code.
>
> I'm doing a task which is trying to merge Android patches to Ubuntu kernel
> and mainline, not only the Android drivers but also the ARM port code which
> is not in mainline.
>
> But since Android kernel is 2.6.29 and ours or mainline is 2.6.31+, you know
> it needs much more effort without Google's help.
>
> And for sure, I'm very happy to help this out.

We (Google) definitely want to get back in sync with mainline (as I've
mentioned earlier in this or a related thread), and we're planning on
snapping up our kernel trees to 2.6.32+ once we get past various
deadlines in the near future.  Obviously action speaks louder than
words here, and I understand Greg's frustration at the slow pace so
far and appreciate his efforts to encourage us to stop dropping the
ball.

Probably the two biggest pain points for general driver support are
wakelocks (which we were making some progress on getting cleaned up on
the linux-pm list -- Arve will be respinning those patchsets for
review again before long) and some of the gpio support.  Otherwise,
most of the drivers don't have a lot of dependencies on new core
kernel infrastructure and many effectively stand alone.  For some of
the qualcomm chipsets, there is a fair bit of layering needed for
functions owned by the modem or dsp cores -- smem / smd / rpc / etc.

Brian
Pavel Machek Oct. 30, 2009, 2:08 p.m. UTC | #13
Hi!

>>> But now, it is hard for us to do that without a workable Android 
>>> drivers in mainline.
>>
>> Then push on Google to get them cleaned up and fixed!  Or do it
>> yourself, all I need is a developer to take ownership of the code.
>>
>
> I'm doing a task which is trying to merge Android patches to Ubuntu 
> kernel and mainline, not only the Android drivers but also the ARM port 
> code which is not in mainline.
>
> But since Android kernel is 2.6.29 and ours or mainline is 2.6.31+, you 
> know it needs much more effort without Google's help.
>
> And for sure, I'm very happy to help this out.

I guess Greg will be happy to put android stuff back into staging if
you promise to maintain it. That should be fairly low effort (hour per
week?). Basically you have to respond to email, fix it when it breaks,
and perhaps test compile it when -rc1 comes...

Sounds easy enough, no?
									Pavel
Bryan Wu Nov. 1, 2009, 4:40 p.m. UTC | #14
Pavel Machek wrote:
> Hi!
> 
>>>> But now, it is hard for us to do that without a workable Android 
>>>> drivers in mainline.
>>> Then push on Google to get them cleaned up and fixed!  Or do it
>>> yourself, all I need is a developer to take ownership of the code.
>>>
>> I'm doing a task which is trying to merge Android patches to Ubuntu 
>> kernel and mainline, not only the Android drivers but also the ARM port 
>> code which is not in mainline.
>>
>> But since Android kernel is 2.6.29 and ours or mainline is 2.6.31+, you 
>> know it needs much more effort without Google's help.
>>
>> And for sure, I'm very happy to help this out.
> 
> I guess Greg will be happy to put android stuff back into staging if
> you promise to maintain it. That should be fairly low effort (hour per
> week?). Basically you have to respond to email, fix it when it breaks,
> and perhaps test compile it when -rc1 comes...
> 
> Sounds easy enough, no?
> 									Pavel

Great, I do love to maintain it with the help from Brian Swetland and other 
Google folks.

Thanks a lot, Greg and Pavel.

-Bryan
diff mbox

Patch

diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
index 6c10b45..a8eb7d1 100644
--- a/drivers/staging/android/logger.c
+++ b/drivers/staging/android/logger.c
@@ -21,6 +21,7 @@ 
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 #include <linux/uaccess.h>
+#include <linux/sched.h>
 #include <linux/poll.h>
 #include <linux/time.h>
 #include "logger.h"