[Letux-kernel] wwan logic inversion
H. Nikolaus Schaller
hns at goldelico.com
Sat Nov 24 09:29:38 CET 2018
> Am 23.11.2018 um 20:57 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>
> Hi,
>
>> Am 23.11.2018 um 18:19 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>>
>> Unfortunately it is a little difficult to find a patch that has removed a specific line of code.
>> Finding the one that introduced a change is a simple git blame + grep
>>
>
> Here is the trick:
>
> git log --oneline letux-4.19.3 -S 'modem_en' arch/arm/boot/dts/omap3-gta04a5.dts
>
> Well, the result is empty!
>
> So this means we have indeed lost this while reorganizing the feature branches
> for 4.19-rc1.
>
> So in summary it is still in the letux/dt-gta04a5-v2 branch: http://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/work/letux-base/dt-gta04a5-v2
>
> But that branch is no longer merged (since ca. 4 weeks ago) - assuming that we
> have everything we need in letux/dt-gta04-v3
>
> http://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/letux/dt-gta04-v3
>
> But we haven't.
>
> So I'll factor out the modem_en patch from
>
> http://git.goldelico.com/?p=letux-kernel.git;a=blobdiff;f=arch/arm/boot/dts/omap3-gta04a5.dts;h=17a3dc11d420dc5953b98b53baa6199a8988f222;hp=600b6ca5a1bdc03795a85855c6394e6f1f2bf397;hb=dfb3da99842c6c8d4b6acfc94a778e034f5ee63e;hpb=84df9525b0c27f3ebc2ebb1864fa62a97fdedb7d
>
> and apply to 4.19.4 and add to letux/dt-gta04-v3 so that it will be merged into
> letux.4-20-rc4 on Monday.
>
> And of course test if it fixes the problem.
Hm. The strange thing is that I can't reproduce the problem with the 4.19.3 kernel:
root at letux:~# lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root at letux:~# rfkill unblock wwan
[ 250.358123] wwan_on_off_rfkill_set_block: blocked: 0
[ 250.363800] wwan_on_off_set_power:on = 1
[ 250.367950] wwan_on_off_is_powered_on: USB phy event 0
[ 250.376647] wwan_on_off_is_powered_on: we assume 0
[ 250.381652] wwan_on_off_is_powered_on: return 'false'
[ 250.387542] wwan_on_off_set_power: state 0
[ 250.391815] wwan_on_off_set_power: send impulse
[ 251.133087] wwan_on_off_is_powered_on: USB phy event 0
[ 251.138488] wwan_on_off_is_powered_on: we assume 1
[ 251.145416] wwan_on_off_is_powered_on: return 'true'
[ 251.150695] wwan_on_off_set_power: done
root at letux:~# [ 253.403228] usb 1-2: new high-speed USB device number 2 using ehci-omap
[ 253.607421] usb 1-2: New USB device found, idVendor=0af0, idProduct=8800, bcdDevice= 0.00
[ 253.616210] usb 1-2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[ 253.624969] usb 1-2: Product: Globetrotter HSUPA Modem
[ 253.630432] usb 1-2: Manufacturer: Option N.V.
[ 253.748168] hso: drivers/net/usb/hso.c: Option Wireless
[ 253.774322] hso 1-2:1.5: Not our interface
[ 253.785430] usbcore: registered new interface driver hso
rfkill block wwan
[ 270.307037] wwan_on_off_rfkill_set_block: blocked: 1
[ 270.312316] wwan_on_off_set_power:on = 0
[ 270.318054] wwan_on_off_is_powered_on: USB phy event 0
[ 270.325988] wwan_on_off_is_powered_on: we assume 1
[ 270.330993] wwan_on_off_is_powered_on: return 'true'
[ 270.336730] wwan_on_off_set_power: state 1
[ 270.341003] wwan_on_off_set_power: send impulse
[ 270.585662] usb 1-2: USB disconnect, device number 2
[ 271.083068] wwan_on_off_is_powered_on: USB phy event 0
[ 271.088470] wwan_on_off_is_powered_on: we assume 0
[ 271.097381] wwan_on_off_is_powered_on: return 'false'
[ 271.104705] wwan_on_off_set_power: done
root at letux:~# uname -a
Linux letux 4.19.3-letux+ #2950 SMP PREEMPT Fri Nov 23 21:39:00 CET 2018 armv7l GNU/Linux
root at letux:~#
unblock -> turns on (connect)
block -> turns off (disconnect)
This experiement is obviously without feedback because the driver reports "we assume 1/0".
Now the same device with 4.19.4 and the patch:
root at letux:~# uname -a
Linux letux 4.19.4-letux+ #2951 SMP PREEMPT Sat Nov 24 09:13:20 CET 2018 armv7l GNU/Linux
root at letux:~# rfkill unblock wwan
[ 91.425201] wwan_on_off_rfkill_set_block: blocked: 0
[ 91.430511] wwan_on_off_set_power:on = 1
[ 91.436676] wwan_on_off_is_powered_on: gpio value = 0
[ 91.442321] wwan_on_off_is_powered_on: return 'false'
[ 91.450317] wwan_on_off_set_power: state 0
[ 91.455017] wwan_on_off_set_power: send impulse
[ 92.193634] wwan_on_off_is_powered_on: gpio value = 1
[ 92.206604] wwan_on_off_is_powered_on: return 'true'
[ 92.218933] wwan_on_off_set_power: done
root at letux:~# [ 94.483642] usb 1-2: new high-speed USB device number 2 using ehci-omap
[ 94.687927] usb 1-2: New USB device found, idVendor=0af0, idProduct=8800, bcdDevice= 0.00
[ 94.696746] usb 1-2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[ 94.705596] usb 1-2: Product: Globetrotter HSUPA Modem
[ 94.711059] usb 1-2: Manufacturer: Option N.V.
[ 94.827880] hso: drivers/net/usb/hso.c: Option Wireless
[ 94.864959] hso 1-2:1.5: Not our interface
[ 94.871704] usbcore: registered new interface driver hso
root at letux:~# rfkill block wwan
[ 105.104675] wwan_on_off_rfkill_set_block: blocked: 1
[ 105.109954] wwan_on_off_set_power:on = 0
[ 105.116149] wwan_on_off_is_powered_on: gpio value = 1
[ 105.121765] wwan_on_off_is_powered_on: return 'true'
[ 105.130004] wwan_on_off_set_power: state 1
[ 105.134979] wwan_on_off_set_power: send impulse
[ 105.374511] usb 1-2: USB disconnect, device number 2
[ 105.874023] wwan_on_off_is_powered_on: gpio value = 0
[ 105.879638] wwan_on_off_is_powered_on: return 'false'
[ 105.887756] wwan_on_off_set_power: done
root at letux:~#
Here it seems to query the modem status pin (gpio value = 0/1).
Hope this helps to find out what is really going on.
BR,
Nikolaus
More information about the Letux-kernel
mailing list