fzort is currently certified at Journeyer level.

Member since: 2005-03-31 16:27:10
Last Login: 2015-11-24 10:54:09

FOAF RDF Share This

Homepage: http://www.fzort.org/mpr/


Recent blog entries by fzort

Syndication: RSS 2.0
22 Nov 2015 (updated 23 Nov 2015 at 01:55 UTC) »
Xperia E1 kernel tweaking (5)

Aaaand... another bug!

<4>[ 0.217984] WARNING: at /home/fzort/projects/xperia/kernel/fs/sysfs/dir.c:508 sysfs_add_one+0x88/0xb8()
<4>[ 0.218192] sysfs: cannot create duplicate filename '/class/sensors'

The device class sensors is registered twice, once by drivers/input/sensor_mgr.c, and then by (mainline kernel) drivers/sensors/sensors_class.c, which fails.

sensor_mgr.c seems to run first (is this deterministic?) so it's probably safe to remove sensors_class.c from the build. By the way, sensor_mgr.c also registers a device attribute called deviceInfor (yuck, camel case). Trying to read it on sysfs causes a kernel crash!

This bug is also present in stock software.

Edit: easy fix for the double /sys/class/sensors registration.

Edit 2: pretty awful kernel crash when doing a cat /sys/class/sensors/light/deviceInfor (or anything under /sys/class/sensors):

<1>[ 2909.524014] Unable to handle kernel NULL pointer dereference at virtual address 00000010
<1>[ 2909.524347] pgd = d4760000
<1>[ 2909.524610] [00000010] *pgd=00000000
<0>[ 2909.525297] Internal error: Oops: 805 [#1] PREEMPT SMP ARM

Edit 3: fixed
22 Nov 2015 (updated 22 Nov 2015 at 14:01 UTC) »
Xperia E1 kernel tweaking (4)

Looks like the msm-thermal driver (responsible for throttling the CPU frequency when things get hot) was not loading:

<4>[ 0.760658] msm_thermal: Wrong number of cpu

Relevant code in drivers/thermal/msm_thermal.c:

key = "qcom,cpu-sensors";
cpu_cnt = of_property_count_strings(node, key);
if (cpu_cnt != num_possible_cpus()) {
        pr_err("%s: Wrong number of cpu\n", KBUILD_MODNAME);
        ret = -EINVAL;
        goto hotplug_node_fail;

Looks like a mistake in the device tree (someone must have copy-pasted the qcom,msm-thermal section from a chipset with 4 cores, but this one only has 2). The fix was easy enough.

This also seems to happen with stock Sony software. If this were one of the flagship Xperia devices, I suppose I could submit a pull request, since the code for those phones is on github. But this is the lowest-end Xperia, only released on third-world markets - probably Sony won't care.
21 Nov 2015 (updated 22 Nov 2015 at 12:16 UTC) »
Xperia E1 kernel tweaking (3)

I was able to get rid of the error when trying to load the wlan.ko module by adding the option CONFIG_MODVERSIONS=n. But now I get another error:

<3>[ 21.083079] wlan: version magic '3.4.0-perf SMP preempt mod_unload modversions ARMv7 ' should be '3.4.0-perf SMP preempt mod_unload ARMv7 '

Trying to disable the checking on the kernel code made everything crash horribly. On a real Linux, I'd be able to try modprobe --force, but Android doesn't have modprobe. Sigh.

Edit: looks like the wlan.ko source code is on a separate repo after all. Not much much luck with it yet, though:
<6>[ 1601.775384] wlan: loading driver v3.2.3.185
<3>[ 1601.854994] wlan: driver load failure


Edit 2: after looking at the error messages displayed when the module is compiled with BUILD_DEBUG_VERSION and peeking around the code I could sort of guess that the configuration was incorrect and replaced the config files under /system/etc/firmware/wlan with the ones generated during the build. Now the module is loaded correctly with insmod, but for some reason is not loaded during boot. Still no wifi.

Edit 3: it works.
21 Nov 2015 (updated 22 Nov 2015 at 12:15 UTC) »
Xperia E1 kernel tweaking (2)

So I managed to get the kernel on the phone (gory details). But I don't get wifi - apparently because it's failing to load a module:

<6>[ 20.643671] wlan: disagrees about version of symbol module_layout

The module is not built with make modules - maybe it's closed-source. Sheesh.
19 Nov 2015 (updated 20 Nov 2015 at 05:54 UTC) »

So I tried to build a kernel for my lowly Xperia E1 smartphone today. Long story short, the kernel in the tarball I got from Sony's site didn't build out of the box, probably because I used gcc 4.8, which has the super nifty -Wsizeof-pointer-memaccess warning option.

It caught a bunch of facepalm-worthy bugs such as this one, in the akm8963 compass driver (drivers/misc/akm8963.c):

static ssize_t akm8963_sysfs_delay_show(
        struct akm8963_data *akm, char *buf, int pos)
        int64_t val;

        val = akm->delay[pos];

        return snprintf(buf,sizeof(buf), "%lld\n", val);

This one, in the BlueZ Bluetooth protocol stack (!) (net/bluetooth/hci_conn.c), reminded me of a recent rant by Linus Torvalds:

void hci_le_ltk_reply(struct hci_conn *conn, u8 ltk[16])
        struct hci_dev *hdev = conn->hdev;
        struct hci_cp_le_ltk_reply cp;
        BT_DBG("%p", conn);
        memset(&cp, 0, sizeof(cp));
        cp.handle = cpu_to_le16(conn->handle);
        memcpy(cp.ltk, ltk, sizeof(ltk));
        hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp);

I'm surprised this even works. Weirdly a similar memcpy is correct in the function immediately above this one.

After fixing these I eventually built the kernel, but couldn't get it to run on the phone yet (I think it should run with fastboot boot zImage-dtb). Ah well, I'll figure it out eventually.

By the way, it's very very nice of Sony to provide an official way to unlock the bootloader (that is, disable the kernel/ramdisk image checking in the bootloader), to provide instructions on how to build the kernel on their official blog, and to put the kernels for (most of) their smartphones on github. <3 you, Sony. Very different from a certain Korean smartphone manufacturer (won't name any names, but has a two-letter name).

212 older entries...


fzort certified others as follows:

  • fzort certified acs as Apprentice
  • fzort certified bi as Journeyer
  • fzort certified ncm as Master
  • fzort certified ashtong as Apprentice
  • fzort certified lerdsuwa as Journeyer
  • fzort certified raph as Master
  • fzort certified rms as Master
  • fzort certified titus as Apprentice
  • fzort certified redi as Master
  • fzort certified haruspex as Apprentice
  • fzort certified zx80user as Journeyer
  • fzort certified fzort as Apprentice
  • fzort certified dmitri as Apprentice
  • fzort certified ingvar as Journeyer
  • fzort certified salmoni as Journeyer
  • fzort certified StevenRainwater as Master
  • fzort certified karlberry as Master
  • fzort certified pesco as Apprentice
  • fzort certified johnnyb as Journeyer
  • fzort certified lloydwood as Master
  • fzort certified argp as Journeyer
  • fzort certified Pizza as Journeyer
  • fzort certified reenoo as Apprentice
  • fzort certified nkeynes as Apprentice
  • fzort certified laburu as Journeyer
  • fzort certified saju as Apprentice
  • fzort certified rillian as Master
  • fzort certified alan as Master
  • fzort certified jwz as Master
  • fzort certified chromatic as Master
  • fzort certified olecom as Apprentice
  • fzort certified SabineMcNeill as Apprentice
  • fzort certified pphaneuf as Journeyer
  • fzort certified fxn as Journeyer
  • fzort certified mbarkhau as Apprentice
  • fzort certified tampe as Apprentice
  • fzort certified yosch as Journeyer
  • fzort certified amatus as Journeyer
  • fzort certified MAK as Apprentice
  • fzort certified philiph as Apprentice
  • fzort certified poireau as Journeyer
  • fzort certified ta0kira as Apprentice
  • fzort certified teknopup as Apprentice
  • fzort certified pengjiayou as Apprentice
  • fzort certified Jasper1984 as Apprentice
  • fzort certified mbanck as Journeyer
  • fzort certified wtanaka as Apprentice
  • fzort certified stan as Apprentice
  • fzort certified jbrefort as Journeyer
  • fzort certified peliom as Apprentice
  • fzort certified dennissheil as Apprentice
  • fzort certified scameron as Master
  • fzort certified riscgrl as Journeyer
  • fzort certified murajov as Journeyer
  • fzort certified timbl as Master
  • fzort certified raz as Apprentice
  • fzort certified aminorex as Journeyer
  • fzort certified janneke as Apprentice
  • fzort certified netawater as Apprentice
  • fzort certified alvinj as Apprentice
  • fzort certified sye as Apprentice
  • fzort certified mpolla as Apprentice
  • fzort certified badvogato as Apprentice
  • fzort certified ittner as Apprentice
  • fzort certified phr as Master
  • fzort certified descubes as Master
  • fzort certified ggoebel as Apprentice
  • fzort certified superant as Master
  • fzort certified dangermaus as Journeyer
  • fzort certified cdfrey as Journeyer

Others have certified fzort as follows:

  • bi certified fzort as Journeyer
  • acs certified fzort as Journeyer
  • halcy0n certified fzort as Apprentice
  • fzort certified fzort as Apprentice
  • dmitri certified fzort as Apprentice
  • salmoni certified fzort as Journeyer
  • lerdsuwa certified fzort as Apprentice
  • whytheluckystiff certified fzort as Journeyer
  • ncm certified fzort as Journeyer
  • mirwin certified fzort as Journeyer
  • fxn certified fzort as Apprentice
  • argp certified fzort as Journeyer
  • StevenRainwater certified fzort as Journeyer
  • badvogato certified fzort as Journeyer
  • laburu certified fzort as Master
  • rengolin certified fzort as Journeyer
  • redi certified fzort as Journeyer
  • mbarkhau certified fzort as Journeyer
  • MAK certified fzort as Journeyer
  • ta0kira certified fzort as Journeyer
  • murajov certified fzort as Master
  • ittner certified fzort as Journeyer
  • superant certified fzort as Journeyer
  • dangermaus certified fzort as Master
  • cdfrey certified fzort as Journeyer

[ Certification disabled because you're not logged in. ]

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

Share this page