[Gta04-owner] Replicant 4.2 upstream status

Paul Kocialkowski contact at paulk.fr
Sat May 3 19:49:20 CEST 2014


> > * bq27x00 polls more often (1 minute)
> > * bq27x00 changes that I'll detail in separate threads (always report
> > charge, avoid inconsistent states, twl4030 supplicant)
> 
> We've had pretty good results, by using the userspace interface (e.g.
> /sys/module/bq27x00_battery/parameters/poll_interval). Maybe you can
> have a look at this, to avoid (not mainline-able) kernel changes.

This was doable after all. I reverted the commit on the replicant-4.2
branch of the kernel and pushed the userspace modifications too.

> > On the kernel side, there is a lot to do as well:
> > * ADB crash, rndis not working
> 
> Having a new look at the android-3.10 kernel might help. At the time
> when I imported ADB that kernel tree was still marked experimental, so
> things might have changed.

Okay, that one was tricky. First, I reverted your previous import and
added the commits from the android-3.10 AOSP kernel branch and fixed the
few API changes for 3.12. This was enough to get mtp and rndis working,
but the ADB driver mysteriously disappeared.

The commit[1] that removes the f_adb function mentions that it's
obsolete, so I did some further research and found a post[2] that
explains that ADB can now be used with FunctionFS and it gives pointers
on how to use ADB with FunctionFS. Then I discovered that the Nexus 10
uses the same mechanism, so it was easy to integrate that on the GTA04.

Then, adb was working (as well as the other USB gadget functions) but it
was making the kernel segfault at poweroff. It took me some time to
figure out that it was actually the userspace adb daemon that was
re-initializing FunctionFS after getting a notification that USB was
disconnected. This didn't seem like a normal thing to do and a patch in
Android 4.4 sorted that out, so I imported in back in Replicant 4.2

So with all that, everything works properly on the USB side!

> > * Headset detection the android way
> > * RTC clock wakeup (alarms)
> 
> This one might be hard, see: http://lwn.net/Articles/482345/

Alright, I'll let serious people decide what to do here :)

> > * don't fully suspend if wakelocks are held
> 
> Hmm this sort of works, e.g. if you do:
>   echo test > /sys/power/wake_lock
> 
> The system (CPU) will stay on, but the display will turn off if you
> click the PWR button.
> If you enter:
>   echo test > /sys/power/wake_unlock
> 
> The system will suspend normally again. Also apps like OSMand keep the
> display+CPU on. We have to check why some apps are not able to grab
> wakelocks. Maybe they expect a different name of the "wake_lock" node,
> or the permissions are not sufficient?

Reverting commit "PM / Sleep: Require CAP_BLOCK_SUSPEND to use
wake_lock/wake_unlock" makes it work normally. I think the Android 4.2
userspace doesn't set the capabilities correctly. That's a quick and
easy solution. That commit is not present on the Nexus 10 kernel (3.4)
by the way.

So now wakelocks are taken in account correctly and it doesn't cut music
playback anymore!

> > Still regarding the kernel, I tried to move the current draw limit from
> > 100mA to 250mA in the code and that makes USB storage sticks work with
> > OTG. Since that's a pretty nice feature to have and given that
> > apparently, it works properly and doesn't make the line collapse,
> > perhaps we should consider it. Most of these devices seem to report
> > 200mA max consumption.
> 
> That's nice! But I can't find this commit anywhere, could you please
> point me to it, so I can import it into the Goldelico 3.12-replicant4
> kernel?

I pushed that commit[3] as well, with the limit set to 200mA.

I've also added the OTG wakelock mechanism, converted to the clean
mainline way, using wakeup_source. So now the device stays awake when
connected to USB, so it doesn't cut ADB anymore.

[1]:
https://gitorious.org/replicant/kernel_goldelico_gta04/commit/4ee2be2d67c582e4327e332d41667f46096f5075
[2]: https://plus.google.com/111524780435806926688/posts/AaEccFjKNHE
[3]:
https://gitorious.org/replicant/kernel_goldelico_gta04/commit/df747b143df301939bce3aa872e92ee020546611

-- 
Paul Kocialkowski, Replicant developer

Replicant is a fully free Android distribution

Website:        http://www.replicant.us/
Wiki/Tracker:   http://redmine.replicant.us/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.goldelico.com/pipermail/gta04-owner/attachments/20140503/0295f041/attachment.asc>


More information about the Gta04-owner mailing list