[Replicant] Fwd: libsamsung-ipc and Ubuntu-3.18

Victor Shilin chrono.monochrome at gmail.com
Tue Mar 30 16:28:25 UTC 2021


>
> As I understand the combination of forkbomb's modem branch (using
> forkbomb's repository) and forkbomb's libsamsung-ipc wasn't tested
> up to making a call. So while the modem is supposed to bootstrap we
> don't know if the code fully works.
>

Ah, I figured that could be the case, I was just hoping it would magically
work on the dev branches of forkbomb :)
I was tending to believe that the kernel modem driver was tested with the
modem being at least able to register to the network (which currently not
able do so on the mainline kernel), but it might be very possible it didn't
register to the network even on the original 4.16 dev branch.

I might test other kernels such as 4.17-5.2, but for the moment I shifted
my focus to the work on the USB HOST support (I got the VBUS to work on LK
5.12, I'll post some details later in the corresponding issue).

The issue is that older kernels doesn't seem to build anymore on my
> system so I'll try to import the patches that fixes that and if it
> takes too much time I'll build it on a VM.
>
I didn't have any issues with the build on my host system (Ubuntu 17.04)...
It must be the host system or the toolchains, I was able to build and test
as old kernels as 4.2 (those ones with the DTS, I was doing the downgrade
just for testing purposes, to see if I was able to port some drivers from
the smdk4412 kernel to the mainline).

I've also tried manually toggling the suspend-req GPIOs but when I read
> it in /sys/kernel/debug/gpio it stays high after the modem boot whereas
> in the smdk4412 kernel it is low.
>
That's interesting, I'm new to the GPIO stuff, but that could probably be
controlled by the bootloader itself? Or otherwise maybe it's only supposed
to be set as low only at some modem booting stages (just some vague
guesses, nothing more).

I've also a GNU/Linux setup with Parabola but unfortunately it can't
> run older kernels like 3.0 for comparison / test purposes.
>
Ubuntu 16.04 didn't boot with 3.0 too, I think the minimum kernel version
that worked was 3.4.112 (3.4.0 didn't work) or at least 3.5.


> That doesn't look good.
>
> I had that often and each time I fixed by restoring the backup of the
> RADIO partition. Sometimes the restored image would not stick after
> rebooting.
>
> I've no idea why it is corrupted as it's not supposed to open it
> read/write and open_android_modem_partition_by_name uses O_RDONLY.
>
> Maybe it's some issue with reboot as I tend to reboot before each test
> to make sure there is no interference with the tests.
>
> I've also to do some Replicant 6 work to release the next RC image and
> I'll get back to the modem work right after that or even in my free
> time in between.
>
It didn't seem to me that I ever corrupted the modem image during the
tests, at least yet (sometimes I boot up Android which I have as the
dualboot option to check if the modem image is still intact).
I made the backup of the modem and EFS partitions just in the case, but so
far so good - haven't had to restore them.
I sometimes use the 3-key combo to get to the recovery mode, to then change
the kernel.
For some reason, reboot or power off doesn't work on the mainline kernels
for me, but this should probably be only related to my setup I use.
I boot via the buildroot, which mounts ubuntu EXT4 image on the sdcard,
then it calls switch_root into that mounted ubuntu image. The image doesn't
unmount correctly upon the reboot and hangs here (from my understanding,
because the sdcard is unmounted before the image could have been unmounted
first).
It's quite a surprise I didn't end up corrupting the data on the image just
yet (which is mounted read-write), as it's probably expected to happen.


вт, 30 мар. 2021 г. в 16:40, Denis 'GNUtoo' Carikli <
GNUtoo at cyberdimension.org>:

> On Tue, 30 Mar 2021 10:00:14 +0300
> Victor Shilin <chrono.monochrome at gmail.com> wrote:
> > Hi,
> Hi,
>
> > 3.18 kernel uses the same modem driver as 3.0.101 one. I used my old
> > backport kernel sources to test if I got the configuration right at
> > least on the smdk4412 kernel.
> > I didn't test calls, but the modem seemed to boot correctly (it
> > received the PLMN code of my operator correctly, I didn't test here
> > anything else besides that).
> Thanks a lot, that means that it most probably worked. With the
> Replicant 11 kernel I don't see any networks yet.
>
> > Somehow I wasn't able to retrieve the IMEI with ipc-imei tool (just
> > some -EAGAIN errors in the log).
> That tool didn't work well. I could manage to get the IMEI under
> Replicant 6 but it had crashes for instance.
>
> I wrote that tool to have tests that didn't depend on having a SIM card
> that could register to a network, but at the end, I got a new SIM card
> and modified ipc-modem to be a little more configurable (to call a
> number of your choosing in the same country) as it was order of
> magnitude faster to do.
>
> I also tried to make it easier to write simple test applications along
> the way so I'll eventually get back to it.
>
> > I'm not sure if the kernel used provides any interest by itself (as it
> > doesn't even use the device tree, neither the device specific drivers
> > are upstreamed), but I'll leave the link:
> >
> https://github.com/ChronoMonochrome/android_kernel_samsung_smdk4412/commits/ubuntu-3.18
> >
> > Like I said 3.18 kernel uses exactly same driver as smdk4412 (3.0.101)
> > kernel, so unfortunately, it's nothing new that the modem booted up
> > here.
> That's interesting for doing tests.
>
> > But I'm moving now to test 4.16 kernel. I was having some issues
> > getting 4.16 booted up for some reason, so first I tested 5.10-rc2
> > and got the ipc-test stuck with the message:
> > "[ipc] ENTER generic_poll".
> >
> > forkbomb's version of libsamsung-ipc repo returns the following log on
> > 5.10-rc2 (replicant-11-i9300-modem branch without the ap_dump commit,
> > as the latter prevented the gpiohack driver from booting somehow):
> As I understand the combination of forkbomb's modem branch (using
> forkbomb's repository) and forkbomb's libsamsung-ipc wasn't tested
> up to making a call. So while the modem is supposed to bootstrap we
> don't know if the code fully works.
>
> The issue is that older kernels doesn't seem to build anymore on my
> system so I'll try to import the patches that fixes that and if it
> takes too much time I'll build it on a VM.
>
> > > acroreiser at localhost:~$ sudo ipc-modem --debug start
> [...]
> > > [D] Waited for host wake
> > > [D] Waited for link connected
> > > /dev/umts_ipc: -1 19
> > > /dev/umts_ipc: -1 19
> > > /dev/umts_ipc: -1 19
> > > /dev/umts_ipc: -1 19
> > > /dev/umts_ipc: -1 19
> > > /dev/umts_ipc: -1 19
> > > /dev/umts_ipc: -1 19
> > > /dev/umts_ipc: -1 19
> > > /dev/umts_ipc: -1 19
> > > [1] Starting modem_read_loop on FMT client
> On my branches I at least manage to send and receive some messages and
> I get into LPM mode, but the modem doesn't go in full power.
>
> I may have trigger somehow the modem registration while shutting down
> the phone once but I didn't manage to reproduce it.
>
> So there might be something in the kernel side that is missing, and
> I've also modified it extensively and left out 1 GPIO due to some
> conflicts with some other kernel versions.
>
> I've also tried manually toggling the suspend-req GPIOs but when I read
> it in /sys/kernel/debug/gpio it stays high after the modem boot whereas
> in the smdk4412 kernel it is low.
>
> > I'm testing everything on Ubuntu 16.04 (I haven't found a way to get
> > ADB working here, but fortunately, internal wifi and ssh works which
> > makes it much easier to test things).
> I've also a GNU/Linux setup with Parabola but unfortunately it can't
> run older kernels like 3.0 for comparison / test purposes.
>
> I should probably try with 3.18 too.
>
> [...]
> > >    [D] open_android_modem_partition_by_name: Trying to open
> > >    /dev/disk/by-partlabel/RADIO
> > >    [D] generic_boot: Opened the RADIO partition
> > >    [D] Mapped modem image data to memory
> > >    [D] ENTER xmm626_kernel_linux_modem_hci_power
> > >    [D] xmm626_kernel_linux_modem_hci_power: DONE
> > >    [D] Turned the modem off
> > >    [D] generic_boot: xmm626_kernel_linux_modem_power(NULL, 1) = 0
> > >    [D] ENTER xmm626_kernel_linux_modem_hci_power
> > >    [D] xmm626_kernel_linux_modem_hci_power: DONE
> > >    [D] generic_boot: xmm626_kernel_linux_modem_hci_power(client, 1)
> > > = 0 [D] Turned the modem on
> > >    [D] Failed to open boot device
> > >    [D] +-------------------------+
> > >    | /!\ generic_boot failed |
> > >    +-------------------------+
> > >    [E] Something went wrong
> > >    [D] ENTER generic_power_off
> > >    [D] ENTER generic_close
> > >    [D] generic_close DONE
> That doesn't look good.
>
> I had that often and each time I fixed by restoring the backup of the
> RADIO partition. Sometimes the restored image would not stick after
> rebooting.
>
> I've no idea why it is corrupted as it's not supposed to open it
> read/write and open_android_modem_partition_by_name uses O_RDONLY.
>
> Maybe it's some issue with reboot as I tend to reboot before each test
> to make sure there is no interference with the tests.
>
> I've also to do some Replicant 6 work to release the next RC image and
> I'll get back to the modem work right after that or even in my free
> time in between.
>
> Denis.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/replicant/attachments/20210330/4b9d0c9f/attachment-0001.html>


More information about the Replicant mailing list