[Letux-kernel] w2sg004 woes

H. Nikolaus Schaller hns at goldelico.com
Sun Feb 12 10:11:38 CET 2017


Hi,

> Am 12.02.2017 um 09:43 schrieb Andreas Kemnade <andreas at kemnade.info>:
> 
> Hi,
> 
> I just noticed this waring occuring when the gps module is loaded
> with a recent kernel.
> Maybe someone knows about what is wring.

Yes. It comes from the tty/uart layer and our uart-slave patches. It seems that
uart_change_pm is not allowed during driver probing. Or some pm isn't initialized
at this point. Or something else :)

Since this warning does not harm (except for a 200ms boot delay), I did not invest
any time to fix it.

Anyways, we have to rework the w2sg driver completely to get it upstream by using
the new serdev interface. This means that this call sequence will go away completely
and we will remove our own fix in the end...

There is already a w2sg driver skeleton based on serdev in branch work/hns/misc/w2sg-serdev.

To use it, you have to "unmerge" work/hns/misc/w2sg-tty-slave2
and merge work/robh/serial-bus work/hns/misc/w2sg-serdev

Basically the driver must be a man-in-the-middle between the serdev tty port
(which works) and a new user-space interface (because the /dev/ttyO1 is disabled).

I think about adding a new /dev/ttyO1 :) This seems to be easier to manage wrt.
buffering than a chardev /dev/gps. But I have not found time to add the code to
create a new /dev/tty* and add the ops for user-space open(), close(), read(), write().

It should also be possible to stty the GPS interface to change line disciplines.
I don't know if you can stty on a plain chardev. Hence this may also require us
to create a new /dev/tty.

Where do we need stty? E.g. for stty -icanon time 1 min 1 if we want to see every
single character and not full lines.

BR,
Nikolaus

> 
> [   17.120605] w2sg_probe()
> [   17.124389] w2sg_probe() lna_regulator = ddf91080
> [   17.131774] ------------[ cut here ]------------
> [   17.138153] WARNING: CPU: 0 PID: 947 at ../drivers/tty/serial/serial_core.c:129 uart_change_pm+0x74/0x80
> [   17.148590] Modules linked in: w2sg0004(+) bq27xxx_battery w1_bq27000 omap_hdq
> [   17.156768] CPU: 0 PID: 947 Comm: modprobe Not tainted 4.10.0-rc7-letux+ #1
> [   17.164154] Hardware name: Generic OMAP36xx (Flattened Device Tree)
> [   17.170837] [<c010f348>] (unwind_backtrace) from [<c010b8f4>] (show_stack+0x10/0x14)
> [   17.179077] [<c010b8f4>] (show_stack) from [<c042e7c0>] (dump_stack+0x98/0xd0)
> [   17.186767] [<c042e7c0>] (dump_stack) from [<c012f7ac>] (__warn+0xd0/0x100)
> [   17.194183] [<c012f7ac>] (__warn) from [<c012f880>] (warn_slowpath_null+0x1c/0x24)
> [   17.202209] [<c012f880>] (warn_slowpath_null) from [<c04bdb4c>] (uart_change_pm+0x74/0x80)
> [   17.210998] [<c04bdb4c>] (uart_change_pm) from [<c04c1130>] (uart_register_rx_notification+0x3c/0x12c)
> [   17.220916] [<c04c1130>] (uart_register_rx_notification) from [<bf014648>] (w2sg_probe+0x1fc/0x35c [w2sg0004])
> [   17.231597] [<bf014648>] (w2sg_probe [w2sg0004]) from [<c04d8d74>] (platform_drv_probe+0x50/0xa0)
> [   17.241027] [<c04d8d74>] (platform_drv_probe) from [<c04d6dc4>] (driver_probe_device+0x140/0x2b8)
> [   17.250457] [<c04d6dc4>] (driver_probe_device) from [<c04d6fc4>] (__driver_attach+0x88/0xac)
> [   17.259429] [<c04d6fc4>] (__driver_attach) from [<c04d54e0>] (bus_for_each_dev+0x6c/0x90)
> [   17.268127] [<c04d54e0>] (bus_for_each_dev) from [<c04d64c0>] (bus_add_driver+0xcc/0x1e8)
> [   17.276824] [<c04d64c0>] (bus_add_driver) from [<c04d7f60>] (driver_register+0x9c/0xe0)
> [   17.285308] [<c04d7f60>] (driver_register) from [<c0101938>] (do_one_initcall+0xa8/0x150)
> [   17.294006] [<c0101938>] (do_one_initcall) from [<c0218970>] (do_init_module+0x58/0x1c0)
> [   17.302612] [<c0218970>] (do_init_module) from [<c01c4e84>] (load_module+0x18e8/0x1e00)
> [   17.311126] [<c01c4e84>] (load_module) from [<c01c5570>] (SyS_finit_module+0x88/0x90)
> [   17.319458] [<c01c5570>] (SyS_finit_module) from [<c0107040>] (ret_fast_syscall+0x0/0x1c)
> [   17.328979] ---[ end trace 7939ea584913f7cb ]---
> [   17.344177] w2sg_rfkill_set_block: blocked: 0
> [   17.348937] w2sg0004 probed
> _______________________________________________
> http://projects.goldelico.com/p/gta04-kernel/
> Letux-kernel mailing list
> Letux-kernel at openphoenux.org
> http://lists.goldelico.com/mailman/listinfo.cgi/letux-kernel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20170212/5a3b7dc2/attachment.asc>


More information about the Letux-kernel mailing list