ADB requires new userland setup w/ linux-linaro-android 3.0-2011.07

Bug #807230 reported by John Stultz
34
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Linaro Android
Fix Released
High
vishal

Bug Description

ADB was reworked in the linux-3.0 kernel, removing the need for device specific platform drivers (similar to the change I did in 2.6.39). However, for adb to work over USB, some userland commands have to be issued at boot:

Workaround:
echo 0 > /sys/class/android_usb/android0/enable
echo adb,acm > /sys/class/android_usb/android0/functions
echo 2 > /sys/class/android_usb/android0/f_acm/instances
echo 1 > /sys/class/android_usb/android0/enable

(The above were found in the commit log here: https://review.source.android.com/#/c/23890/ )

After those commands are issued, I was able to get ADB functioning with the android-3.0 kernel.

Zach Pfeffer (pfefferz)
Changed in linaro-android:
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Zach Pfeffer (pfefferz)
milestone: none → 11.07
Revision history for this message
Zach Pfeffer (pfefferz) wrote :

When I run the last command I get an oops.

Changed in linaro-android:
assignee: Zach Pfeffer (pfefferz) → John Stultz (jstultz)
Revision history for this message
Zach Pfeffer (pfefferz) wrote :
Revision history for this message
John Stultz (jstultz) wrote :

Yuck. So the crash only happens on panda when no USB cable is plugged into the USB gadget port.
If the cable is plugged in when the enable sysfs call is made, it seems to work ok.

Still digging.

Revision history for this message
John Stultz (jstultz) wrote :

Ok. Got a potential fix posted to lkml for review:
https://lkml.org/lkml/2011/7/20/357

Revision history for this message
Alexander Sack (asac) wrote :

can we commit this fix as a workaround to tree for 11.07 and verify before it gets confirmed on lkml?

Revision history for this message
John Stultz (jstultz) wrote :

Ok, nagged the maintainer and he said he's a bit too busy to look at it right now, but its in his queue for post 3.1-rc1.

Thus, the fix has been commited to the linaro+android tree for now and I've pushed it out so that its available.

Zach: You ok with adding the adb setup commands now in the init scripts?

John Stultz (jstultz)
Changed in linaro-android:
assignee: John Stultz (jstultz) → nobody
assignee: nobody → John Stultz (jstultz)
Alexander Sack (asac)
summary: - ADB requires new userland setup w/ linux-3.0+ kernels
+ ADB requires new userland setup w/ linux-linaro-android 3.0-2011.07
Zach Pfeffer (pfefferz)
Changed in linaro-android:
importance: Critical → High
Zach Pfeffer (pfefferz)
Changed in linaro-android:
milestone: 11.07 → 11.08
Zach Pfeffer (pfefferz)
Changed in linaro-android:
milestone: 11.08 → 11.07
description: updated
Revision history for this message
Ken Werner (kwerner) wrote :

I've added a "service" by appending the follwoing two lines to the init.rc:

<snip>
service adbfix /system/etc/adbfix.sh
    oneshot
</snip>

and put the commands mentioned above in a shell script at /system/etc/adbfix.sh - works fine for me.

Revision history for this message
John Stultz (jstultz) wrote :

So with the crash resolved, there shouldn't be any more kernel side functionality required, so I'm assigning this to Zach for the integration of the userland modifications (similar to what Ken did).

Changed in linaro-android:
assignee: John Stultz (jstultz) → nobody
Alexander Sack (asac)
Changed in linaro-android:
milestone: 11.07 → 11.09
Revision history for this message
Alexander Sack (asac) wrote :

this bug has a solution it seems. From the info I see here it feels like a low hanging fruit.

Potential board specific issues can be followed up on in individual bugs afterwards. The sooner we land this fix in platform, the sooner we'll know.

Zach Pfeffer (pfefferz)
Changed in linaro-android:
assignee: nobody → vishal (vishalbhoj)
Revision history for this message
vishal (vishalbhoj) wrote :

with the commit http://review.android.git.linaro.org/#change,135 , adb should have worked.But I see the following behaviour.

On Panda build, adb works on panda provided cable is plugged into the device after its booted up(android driver gets configured completely after cable is plugged in), appears to be stable this way works on multiple times plugging/unplugging of cable.
On Beagle-xM: adb is not stable,keeps disconnecting when you run commands like "logcat OR ls -l" on the adb shell.
On LEB-panda,adb works but kernel crashes when you unplug the cable.

Revision history for this message
Zach Pfeffer (pfefferz) wrote :

Vishal,

Would you file 3 target specific bugs with each behavior and assign them to both the TI LT (Andy) and the Android Team (You). Make sure you mark them public.

vishal (vishalbhoj)
Changed in linaro-android:
status: Confirmed → Fix Released
Revision history for this message
vishal (vishalbhoj) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.