ifconfig wlan0 up causing kernel crash and reboots - android

I am testing Relatek Wi-Fi Driver in Android LOllipop. The driver is registered as
usbcore: registered new interface driver rtl8192du
And the lsmod shows the output as
8192du 488167 0 - Live 0x00000000
The driver is inserted successfully . And the netcfg output shows that the wlan0 interface is down.
I tried to make the interface active as ifconfig wlan0 up and suddenly the kernel crashes and reboots after 5 seconds.
What are the reasons for the ifconfig to fail especially to crash the kernel?.....Any help would be appreciated
The kernel crash log is provided below
e[<8031bcf4>] (vsnprintf+0x38/0x424) from [<8004b534>] (kthread_create_on_node+0x98/0xdc)
[<8004b534>] (kthread_create_on_node+0x98/0xdc) from [<7f03d05c>] (rtw_start_drv_threads+0x20/0x5c [8192du])
[<80647c24>] (__dev_open+0xa0/0xfc) from [<80647e58>] (__dev_change_flags+0x8c/0x128)
[<80647e58>] (__dev_change_flags+0x8c/0x128) from [<80647f60>] (dev_change_flags+0x10/0x48)
[<80647f60>] (dev_change_flags+0x10/0x48) from [<806d16ac>] (devinet_ioctl+0x780/0x828)
[<806d16ac>] (devinet_ioctl+0x780/0x828) from [<806323c8>] (sock_ioctl+0x68/0x28c)
[<806323c8>] (sock_ioctl+0x68/0x28c) from [<800f09e8>] (do_vfs_ioctl+0x80/0x5bc)
[<800f09e8>] (do_vfs_ioctl+0x80/0x5bc) from [<800f0f94>] (SyS_ioctl+0x70/0x78)
[<800f0f94>] (SyS_ioctl+0x70/0x78) from [<8000e0c0>] (ret_fast_syscall+0x0/0x30)
Code: ba0000ee e59da014 e3a0b020 e59d1018 (e5d23000)
---[ end trace ffb896cf8181c101 ]---
Kernel panic - not syncing: Fatal exception

So many reasons..... but...
1) post backtrace (kernel backtrace) for more information
2) suspect ioctl which is connect to ifconfig - bring up the wlan (if it's not ioctl, then something else like proc, netlink or whatever to communicate kernel)
3) the vap (wlan) enable code itself
I think that we may need crash backtrace and we can understand it better....

Related

How can I add new accelerometer sensor to qcom android HAL?

Would like to enable MPU6050 accel & gyro sensor for my Qualcomm board which is MSM8909 chipset and android version is 8.x Oreo.
I have tried the following.
Enabled the kernel driver for the sensor "drivers/input/misc/mpu6050.c" and able to detect the sensor in android kernel too.
Log:
[ 62.096904] input: MPU6050-accel as /devices/soc/78b7000.i2c/i2c-3/3-0068/input/input2
[ 62.101460] input: gyroscope as /devices/soc/78b7000.i2c/i2c-3/3-0068/input/input3
msm8909w:/ # echo 1 > /sys/class/sensors/MPU6050-accel/enable
msm8909w:/ # echo 1 > /sys/class/sensors/MPU6050-gyro/enable
msm8909w:/ # getevent
add device 1: /dev/input/event3
name: "gyroscope"
add device 2: /dev/input/event2
name: "MPU6050-accel"
msm8909w:/ # lshal debug android.hardware.sensors#2.0:ISensors/default
android.hardware.sensors#2.0:ISensors/default does not exist, or no permission to connect.
msm8909w:/ #
msm8909w:/ # lshal debug android.hardware.sensors#1.0
android.hardware.sensors#1.0/default does not exist, or no permission to connect.
Tried to run android app to list out the sensors and found nothing, but able to list out sensors if I run it on my phone.
Following HAL layer settings & android code changes done and no luck!
device/qcom/msm8909w/sensors/hals.conf
sensors.msm8909w.so
sensors.msm8909.so
sensors.default.so
sensors.ssc.so
sensors.native.so
Created build error in hardware/qcom/sensors/Accelerometer.cpp file to see whether this code is building or not, I didn't get any build errors.
Also referred to following document.
https://developer.qualcomm.com/qfile/28820/lm80-p0436-9_sensors_porting_guide.pdf
Do I need to change anything in HAL layer for my new sensor or anything missing here ?
If you are not aware. Then i want to tell you that:
Qualcomm uses ADSP as subsystem for their sensor.
ADSP images are loaded by qcom kernel driver.
ADSP code is proprietary.
ADSP and android HAL communicate through fastrpc.
Thanks 😊
May be this is useful.

"port 53: Address already in use" docker error when I run docker compose up command

ERROR: for 515f8b2ecd33_docker-bind_bind_1 Cannot start service bind: b'driver failed programming external connectivity on endpoint docker-bind_bind_1 (bc8836ceccc907c7ad0610e941b533c68f250c56cffcd4646e9171e7a330c9b3): Error starting userland proxy: listen tcp 0.0.0.0:53: bind: address already in use'
Comment out masqdns parts of the docker-compose.yaml file that you should have in virtual environment folder("Home/User/ve").
If the error still persist Please update your docker-compose.yaml file.

Android Things Image on CM3

I am trying to get a Android Things Image to boot on the Compute Module 3.
I have gone through several trial and error to try and get a working image. Currently I sit in the Kernel after getting through the DTB problem I was originally facing.
I use dd to flash the image through RPIBOOT, I validate the pi fully works with Raspian.
This is what I see in the serial console:
MMC: mmc#7e300000: 0
reading uboot.env
In: serial
Out: serial
Err: serial
Net: Net Initialization Skipped
No ethernet found.
ANDROID: Attempting slot b, tries remaining 6
ANDROID: Booting slot: b
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
ANDROID: reboot reason: "(none)"
** Invalid Android Image header **
Android boot failed, error -1.
resetting ...
U-�MMC: mmc#7e300000: 0
reading uboot.env
In: serial
Out: serial
Err: serial
Net: Net Initialization Skipped
No ethernet found.
ANDROID: Attempting slot a, tries remaining 5
ANDROID: Booting slot: a
72 bytes read in 31 ms (2 KiB/s)
ANDROID: reboot reason: "(none)"
Booting kernel at 0x1000000 with fdt at 2efe8600...
## Booting Android Image at 0x01000000 ...
Kernel load addr 0x01000800 size 8385 KiB
Kernel command line: buildvariant=userdebug
RAM disk load addr 0x11000000 size 4947 KiB
## Flattened Device Tree blob at 2efe8600
Booting using the fdt blob at 0x2efe8600
XIP Kernel Image ... OK
Loading Ramdisk to 2cb2b000, end 2cfffb11 ... OK
reserving fdt memory region: addr=0 size=1000
reserving fdt memory region: addr=2efe8600 size=ba00
Loading Device Tree to 2dff1000, end 2dfff9ff ... OK
Starting kernel ...
Note The file system can't be mounted:
ANDROID: Attempting slot b, tries remaining 6
ANDROID: Booting slot: b
Failed to mount ext2 filesystem...
It will sit there forever. I have a feeling it is still something is wrongs with the Device Tree Blob that got me here. I also know the image is okay because I can boot it on a PI 3 B
I have tried both a CM3L and CM.
Both do the same thing and respond the same to the changes so I'm fairly confident that it is not a eMMC vs SD issue.
Does anyone have any thoughts on how I could debug this? Or even better a resource I can utilize to find the Android Things Kernel code for PI?

Android insmod kernel object on boot

I am currently trying to insmod a kernel module during the end of the boot process, and so I've created the following entries in init.rc:
on post_late_start
start myscript
on nonencrypted
class_start late_start
trigger post_late_start
on property:void.decrypt=trigger_restart_framework
class_start main
class_start late_start
trigger post_late_start
service myscript /data/my_sh.sh
disabled
oneshot
Then in my /data directory my_sh.sh has the following:
#!/system/bin/sh
log -t mytag -p V "Hello World!"
insmod mymodule.ko mod_parameter=arg
But when I run -- sometimes I do not see the "Hello World" tag when I logcat -s "mytag" and of course, the insmodded module is not installed either.
What is the proper way of late-inserting a kernel module (it needs to go in after network is up and /data is mounted). And further -- how do I get the output of insmod into the log so that I can debug? Any help is appreciated and I can post more details if necessary.
At least since Froyo and still in Lollipop, Android init implements insmod in system/core/init/buildin.c. It is supposed to work directly in an init*.rc file:
on boot
insmod /system/lib/modules/your-module.ko.
However, at least in Lollipop 5.1, it no longer works, as SELinux rules are enforced. init does not have the required sys_module permission. Therefore the underlying init_module system call returns EPERM. This is never reported to anywhere. The only symptom is that insmod commands now fail to load the module, always.
I opened an AOSP issue on this. According to Google, this works as intended. If you want to use kernel modules when SELinux is enforced (which they strongly advice against), you must yourself add the required SELinux permission to init.
I am not sure about your log, but to insmod you need to give the exact path to the module, because I dont think you will be having mymodule.ko residing in the same place as init.rc is there. So try to give the full path of your ko file.
Generally it resides in /lib/modules/youdrivername.ko
so check it here first.

Wifi Turn on FIRMWARE_LOADER faile error

I am using Odroid A device, which have bcm4239 wifi hardware(according to Hardkernel's spec. i don't know how to check this programatically). i have attached the log when i try to enable the wifi using
mWifiManager.setWifiEnabled(true).
I want to know the meaning of the log, especially "E/WifiHW(1175): FIRMWARE_LOADER faile" message.
Thank you!!
Below is the error log!!
I/WifiHW(1175): /sys/devices/platform/odroid-sysfs/wifi_enable : write success (on = 1)
I/WifiHW(1175): /sys/devices/platform/odroid-sysfs/wifi_nrst : write success (on = 1)
E/WifiHW(1175): FIRMWARE_LOADER faile
D/SoftapController(1079): Softap fwReload - Ok
D/NetworkManagementService(1175): rsp <213 (mac address here) 0.0.0.0 0 [up broadcast running multicast]>
D/CommandListener(1079): Setting iface cfg
D/CommandListener(1079): Trying to bring down wlan0
D/NetworkManagementService(1175): flags <[up broadcast running multicast]>
D/CommandListener(1079): broadcast flag ignored
E/WifiStateMachine(1175): Unable to change interface settings: java.lang.IllegalStateException: Unable to communicate with native daemon to interface setcfg - com.android.server.NativeDaemonConnectorException: Cmd {interface setcfg wlan0 0.0.0.0 0 [down broadcast running multicast]} failed with code 501 : {Flag unsupported}
E/wpa_supplicant(4058): Line 58: WPA-PSK accepted for key management, but no PSK configured.
E/wpa_supplicant(4058): Line 58: failed to parse network block.
I/wpa_supplicant(4058): rfkill: Cannot open RFKILL control device
E/WifiHW(1175): 'GET_NETWORK 0 bssid' fail.
...
I am using ICS 4.0.4..
Thanks in advance

Categories

Resources