linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* CONFIG_PREEMPT_RT_FULL an usb gadget
@ 2013-08-27 14:54 Hänel-Baas, Alexander
  2013-08-29 11:35 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 6+ messages in thread
From: Hänel-Baas, Alexander @ 2013-08-27 14:54 UTC (permalink / raw)
  To: linux-rt-users@vger.kernel.org

Hello rt-community,

i use the kernel 3.10.4 with the 3.10.4-rt-1 patch
and the usb RNDIS connection to a windows pc.

In the kernelconfig i set the low-latency desktop with CONFIG_PREEMPT_LL=y and the usb Ethernet gadget works fine.

Now i change the kernelconfig to CONFIG_PREEMPT_RT_FULL=Y and now it is not possible to get a working usb gadget connection.

In both situation i see that windows detect the RNDIS device in the device manager. 

The next step was to enable the USB gadget debugging messages to see what is going on.
At this time I see many usb-gadget outputs:

#dmesg
[   84.085953] gen_ndis_query_resp: RNDIS_OID_GEN_RCV_NO_BUFFER
[   84.093266] g_ether gadget: rndis reqa1.01 v0000 i0000 l4096
[   84.093621] g_ether gadget: rndis req21.00 v0000 i0000 l36
[   84.101284] g_ether gadget: rndis reqa1.01 v0000 i0000 l4096
[   84.101680] g_ether gadget: rndis req21.00 v0000 i0000 l36
[   84.109265] g_ether gadget: rndis reqa1.01 v0000 i0000 l4096
[   84.109663] g_ether gadget: rndis req21.00 v0000 i0000 l36
[   84.109782] gen_ndis_query_resp: RNDIS_OID_GEN_RCV_NO_BUFFER
...

But I can't find a difference between the working config (low-latency)
and the full-rt configuration.

What can I do to get a working fully pre-emptible usb gadget?	

kind regards
Alexander Haenel-Baas






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CONFIG_PREEMPT_RT_FULL an usb gadget
  2013-08-27 14:54 CONFIG_PREEMPT_RT_FULL an usb gadget Hänel-Baas, Alexander
@ 2013-08-29 11:35 ` Sebastian Andrzej Siewior
       [not found]   ` <9BA84827B30CBE4996725F98F7DC91232F955F47@SMExchange01.siebmeyer.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-08-29 11:35 UTC (permalink / raw)
  To: Hänel-Baas, Alexander; +Cc: linux-rt-users@vger.kernel.org

* Hänel-Baas, Alexander | 2013-08-27 14:54:35 [+0000]:

>Hello rt-community,
Hi,

>i use the kernel 3.10.4 with the 3.10.4-rt-1 patch
>and the usb RNDIS connection to a windows pc.

So you use an x86 based UDC/machine if you are using v3.10.4-rt1 here.

>In the kernelconfig i set the low-latency desktop with CONFIG_PREEMPT_LL=y and the usb Ethernet gadget works fine.
>
>Now i change the kernelconfig to CONFIG_PREEMPT_RT_FULL=Y and now it is not possible to get a working usb gadget connection.

Is a different gadget working? Say usb-storage against Windows oder
g_ncm against Linux?

>In both situation i see that windows detect the RNDIS device in the device manager. 
>
>The next step was to enable the USB gadget debugging messages to see what is going on.
>At this time I see many usb-gadget outputs:
>
>#dmesg
>[   84.085953] gen_ndis_query_resp: RNDIS_OID_GEN_RCV_NO_BUFFER
>[   84.093266] g_ether gadget: rndis reqa1.01 v0000 i0000 l4096
>[   84.093621] g_ether gadget: rndis req21.00 v0000 i0000 l36
>[   84.101284] g_ether gadget: rndis reqa1.01 v0000 i0000 l4096
>[   84.101680] g_ether gadget: rndis req21.00 v0000 i0000 l36
>[   84.109265] g_ether gadget: rndis reqa1.01 v0000 i0000 l4096
>[   84.109663] g_ether gadget: rndis req21.00 v0000 i0000 l36
>[   84.109782] gen_ndis_query_resp: RNDIS_OID_GEN_RCV_NO_BUFFER
>...
>
>But I can't find a difference between the working config (low-latency)
>and the full-rt configuration.
>
>What can I do to get a working fully pre-emptible usb gadget?	

Try to enable lock debuging and see if the kernel complains about
something.
So after enabling debug you don't see a difference in the communication?
Can you try against Linux RNDIS and see if that is working? If that also
fails then you get a chance to debug.

>
>kind regards
>Alexander Haenel-Baas

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: AW: CONFIG_PREEMPT_RT_FULL an usb gadget
       [not found]   ` <9BA84827B30CBE4996725F98F7DC91232F955F47@SMExchange01.siebmeyer.org>
@ 2013-08-29 18:58     ` Sebastian Andrzej Siewior
  2013-09-03  7:02       ` AW: " Hänel-Baas, Alexander
  2013-09-12 11:41       ` Hänel-Baas, Alexander
  0 siblings, 2 replies; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-08-29 18:58 UTC (permalink / raw)
  To: "Hänel-Baas, Alexander"; +Cc: linux-rt-users


please keep the list in Cc.

On 08/29/2013 04:36 PM, Hänel-Baas, Alexander wrote:
> Hi Sebastian,

Hi Alexander,

> yes i use a x86 machine with 3.10.4-rt1 patch.
> No, there is no other gadget's or usb device active.

I meant try another gadget (like storage) or rndis on a linux host
where you can debug since Windows isn't that cooperative.

> Now I have enabled the lock debug (I hope so), but I can't see a message that the kernel complains about something.
> 
> Yes that the point. In the debugging msg. is no difference between the working or not working situation.
> 
> I attached my kernel config's: 
> Config_3.10.4_PREEMPT_FULL -> Fully preemptible
> Config_3.10.4_PREEMPT_LL	-> Low-Latency
> 
> The other files are the corresponding  dmesg.
> preempt_full_dmesg.txt
> preempt_ll_dmesg.txt

Sorry, I have currently no time look at those, I'm on the run…

> 
> Ok, I look for another linux machine to connect:  (Traget: linux) <-> usb --- RNDIS --- usb <-> (linux:Host) 

Good. Note that that most gadgets attach RDNIS as an additional
function that means under normal circumstances Linux ignores RNDIS and
goes for CDC.

> Thank you for help,
> 
> Alex

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* AW: AW: CONFIG_PREEMPT_RT_FULL an usb gadget
  2013-08-29 18:58     ` AW: " Sebastian Andrzej Siewior
@ 2013-09-03  7:02       ` Hänel-Baas, Alexander
  2013-09-12 11:41       ` Hänel-Baas, Alexander
  1 sibling, 0 replies; 6+ messages in thread
From: Hänel-Baas, Alexander @ 2013-09-03  7:02 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: linux-rt-users

Hi Sebastian,

now i have a working debian host :)

You remember: 
(Linux target RT.PREEMPT)usb --- RNDIS --- usb <-> (linux:Host debian)

So, the next problem is: the machine connect with CDC and not with rndis

The target says:
g_ether gadget: high-speed config #1: CDC Ethernet (ECM)
g_ether gadget: init ecm
g_ether gadget: notify connect true
g_ether gadget: activate ecm
usb0: qlen 10
g_ether gadget: ecm_open
usb0: eth_start
g_ether gadget: notify connect true
g_ether gadget: notify speed 425984000

And the debian host says:
usbcore: registered new interface driver rndis_host
usb 1-1: USB disconnect, device number 2
cdc_ether 1-1:1.0: eth1: unregister 'cdc_ether' usb-0000:02:03.0-1, CDC Ethernet Device
usb 1-1: new high-speed USB device number 3 using ehci_hcd
usb 1-1: New USB device found, idVendor=1c2b, idProduct=000b
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1: Product: RNDIS/Ethernet Gadget
usb 1-1: Manufacturer: Linux 3.10.4-rt1-KTT-V1_AHB with pch_udc
cdc_ether 1-1:1.0: eth1: register 'cdc_ether' at usb-0000:02:03.0-1, CDC Ethernet Device, 00:01:84:00:08:15

And I don’t know how to configure it. 
Do you have an idea for this?


Greetings
Alex

-----Ursprüngliche Nachricht-----
Von: Sebastian Andrzej Siewior [mailto:bigeasy@linutronix.de] 
Gesendet: Donnerstag, 29. August 2013 20:58
An: Hänel-Baas, Alexander
Cc: linux-rt-users
Betreff: Re: AW: CONFIG_PREEMPT_RT_FULL an usb gadget


please keep the list in Cc.

On 08/29/2013 04:36 PM, Hänel-Baas, Alexander wrote:
> Hi Sebastian,

Hi Alexander,

> yes i use a x86 machine with 3.10.4-rt1 patch.
> No, there is no other gadget's or usb device active.

I meant try another gadget (like storage) or rndis on a linux host where you can debug since Windows isn't that cooperative.

> Now I have enabled the lock debug (I hope so), but I can't see a message that the kernel complains about something.
> 
> Yes that the point. In the debugging msg. is no difference between the working or not working situation.
> 
> I attached my kernel config's: 
> Config_3.10.4_PREEMPT_FULL -> Fully preemptible
> Config_3.10.4_PREEMPT_LL	-> Low-Latency
> 
> The other files are the corresponding  dmesg.
> preempt_full_dmesg.txt
> preempt_ll_dmesg.txt

Sorry, I have currently no time look at those, I'm on the run…

> 
> Ok, I look for another linux machine to connect:  (Traget: linux) <-> 
> usb --- RNDIS --- usb <-> (linux:Host)

Good. Note that that most gadgets attach RDNIS as an additional function that means under normal circumstances Linux ignores RNDIS and goes for CDC.

> Thank you for help,
> 
> Alex

Sebastian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* AW: AW: CONFIG_PREEMPT_RT_FULL an usb gadget
  2013-08-29 18:58     ` AW: " Sebastian Andrzej Siewior
  2013-09-03  7:02       ` AW: " Hänel-Baas, Alexander
@ 2013-09-12 11:41       ` Hänel-Baas, Alexander
  2013-10-11  9:39         ` Sebastian Andrzej Siewior
  1 sibling, 1 reply; 6+ messages in thread
From: Hänel-Baas, Alexander @ 2013-09-12 11:41 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: linux-rt-users

Hello Sebastion,

so the rndis configuration works...

No I see on the target with the rt-preempt patch this kernel message:

[   97.206853] g_ether gadget: high-speed config #2: RNDIS  <- the debian host is already connected and we have a putty connection to the target
[  247.216366] g_ether gadget: rndis response on err -22        <- the debian host say:  communication error
[  248.974081] NOHZ: local_softirq_pending 02
[  248.974135] NOHZ: local_softirq_pending 80
[  248.984213] NOHZ: local_softirq_pending 182
[  249.010278] [sched_delayed] sched: RT throttling activated
[  249.996113] NOHZ: local_softirq_pending 02
[  249.996647] NOHZ: local_softirq_pending 82
[  249.996798] NOHZ: local_softirq_pending 102
[  250.986077] NOHZ: local_softirq_pending 100
[  250.987073] NOHZ: local_softirq_pending 102
[  251.976188] NOHZ: local_softirq_pending 02
[  253.286567] pch_udc 0000:05:02.4: pch_udc_ep_clear_nak: RxFIFO not Empty
[  254.972880] NOHZ: local_softirq_pending 02


On this situation the target is very slow. 
top shows:

Mem: 29972K used, 464160K free, 0K shrd, 0K buff, 8040K cached
CPU:  0.1% usr 71.8% sys  0.0% nic 11.0% idle  0.0% io  0.0% irq 16.9% sirq
Load average: 4.52 2.48 1.06 2/86 203
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
   61     2 root     SW       0  0.0   0 20.1 [irq/18-pch-dma]
   78     2 root     SW       0  0.0   0 16.6 [irq/18-ehci_hcd]
  188     2 root     SW       0  0.0   0 14.5 [irq/18-pch_udc]
   82     2 root     SW       0  0.0   0  9.1 [irq/18-ohci_hcd]
   81     2 root     SW       0  0.0   0  8.3 [irq/18-ohci_hcd]
   80     2 root     SW       0  0.0   0  7.8 [irq/18-ohci_hcd]
    3     2 root     RW       0  0.0   0  6.6 [ksoftirqd/0]

I hope that is right information to find the problem.

Greetings
Alexander



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CONFIG_PREEMPT_RT_FULL an usb gadget
  2013-09-12 11:41       ` Hänel-Baas, Alexander
@ 2013-10-11  9:39         ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-10-11  9:39 UTC (permalink / raw)
  To: Hänel-Baas, Alexander; +Cc: linux-rt-users

* Hänel-Baas, Alexander | 2013-09-12 11:41:56 [+0000]:

>Hello Sebastion,

Hello Alexander

>so the rndis configuration works...
>
>No I see on the target with the rt-preempt patch this kernel message:
>
>[   97.206853] g_ether gadget: high-speed config #2: RNDIS  <- the debian host is already connected and we have a putty connection to the target
>[  247.216366] g_ether gadget: rndis response on err -22        <- the debian host say:  communication error

There is quite some time in between.

>[  248.974081] NOHZ: local_softirq_pending 02
>[  248.974135] NOHZ: local_softirq_pending 80
>[  248.984213] NOHZ: local_softirq_pending 182
>[  249.010278] [sched_delayed] sched: RT throttling activated
>[  249.996113] NOHZ: local_softirq_pending 02
>[  249.996647] NOHZ: local_softirq_pending 82
>[  249.996798] NOHZ: local_softirq_pending 102
>[  250.986077] NOHZ: local_softirq_pending 100
>[  250.987073] NOHZ: local_softirq_pending 102
>[  251.976188] NOHZ: local_softirq_pending 02

And this looks like something is busy looping.

>[  253.286567] pch_udc 0000:05:02.4: pch_udc_ep_clear_nak: RxFIFO not Empty
>[  254.972880] NOHZ: local_softirq_pending 02

>On this situation the target is very slow. 
>top shows:
>
>Mem: 29972K used, 464160K free, 0K shrd, 0K buff, 8040K cached
>CPU:  0.1% usr 71.8% sys  0.0% nic 11.0% idle  0.0% io  0.0% irq 16.9% sirq
>Load average: 4.52 2.48 1.06 2/86 203
>  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
>   61     2 root     SW       0  0.0   0 20.1 [irq/18-pch-dma]
>   78     2 root     SW       0  0.0   0 16.6 [irq/18-ehci_hcd]
>  188     2 root     SW       0  0.0   0 14.5 [irq/18-pch_udc]
>   82     2 root     SW       0  0.0   0  9.1 [irq/18-ohci_hcd]
>   81     2 root     SW       0  0.0   0  8.3 [irq/18-ohci_hcd]
>   80     2 root     SW       0  0.0   0  7.8 [irq/18-ohci_hcd]
>    3     2 root     RW       0  0.0   0  6.6 [ksoftirqd/0]
>
>I hope that is right information to find the problem.

pch_udc and maybe pch-dma are probably the two brining the system down.
ehci & ohci are probably only invoked because they share the same line.

Can you check what pch udc/dma are doing on normal situations and what
is different on -RT? My guess is that the UDC is not working well.
I just booted v3.10.14-rt9 on am335x-evm with musb as the UDC and rndis
gadget against x86 with the same kernel.
The host says:
| usbcore: registered new interface driver cdc_ether
| rndis_host 2-1.4:2.0: usb_probe_interface
| rndis_host 2-1.4:2.0: usb_probe_interface - got id
| rndis_host 2-1.4:2.0 usb0: register 'rndis_host' at usb-0000:00:05.0-1.4, RNDIS device, 42:10:84:84:ab:88
| usbcore: registered new interface driver rndis_host
| usb 2-1.4: link qh32-0001/f19d9de0 start 2 [1/0 us]
|root@squsb:~# ping 10.10.10.10 -c1
|PING 10.10.10.10 (10.10.10.10) 56(84) bytes of data.
|64 bytes from 10.10.10.10: icmp_seq=1 ttl=64 time=1.18 ms
|
|--- 10.10.10.10 ping statistics ---
|1 packets transmitted, 1 received, 0% packet loss, time 0ms
|rtt min/avg/max/mdev = 1.185/1.185/1.185/0.000 ms

and the device:
| usb0: eth_open
| usb0: eth_start
| g_ether gadget: rndis_open
| rndis_set_param_medium: 0 4259840
| g_ether gadget: suspend
| g_ether gadget: reset config
| g_ether gadget: rndis deactivated
| usb0: gether_disconnect
| g_ether gadget: high-speed config #2: RNDIS
| g_ether gadget: init rndis
| g_ether gadget: RNDIS RX/TX early activation ... 
| usb0: qlen 10
| g_ether gadget: rndis_open
| rndis_set_param_medium: 0 4259840
| usb0: eth_start
| rndis_set_param_dev:
| g_ether gadget: rndis req21.00 v0000 i0000 l24
| rndis_msg_parser: RNDIS_MSG_INIT
| g_ether gadget: rndis reqa1.01 v0000 i0000 l1025
| g_ether gadget: rndis req21.00 v0000 i0000 l28
| gen_ndis_query_resp: RNDIS_OID_GEN_PHYSICAL_MEDIUM
| g_ether gadget: rndis reqa1.01 v0000 i0000 l1025
| g_ether gadget: rndis req21.00 v0000 i0000 l76
| gen_ndis_query_resp: RNDIS_OID_802_3_PERMANENT_ADDRESS
| g_ether gadget: rndis reqa1.01 v0000 i0000 l1025
| g_ether gadget: rndis req21.00 v0000 i0000 l32
| gen_ndis_set_resp: RNDIS_OID_GEN_CURRENT_PACKET_FILTER 0000002d
| g_ether gadget: rndis reqa1.01 v0000 i0000 l1025
|/ # ping -c1 10.10.10.11
|PING 10.10.10.11 (10.10.10.11): 56 data bytes
|64 bytes from 10.10.10.11: seq=0 ttl=64 time=1.433 ms

I used a difference UDC (musb instead if pch_udc). Since the rndis is
working I think is okay and the problem is somewhere around your UDC.
Try to disable ehci & ohci and try to figure out why pch is taking so
long.

>Greetings
>Alexander

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-10-11  9:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-27 14:54 CONFIG_PREEMPT_RT_FULL an usb gadget Hänel-Baas, Alexander
2013-08-29 11:35 ` Sebastian Andrzej Siewior
     [not found]   ` <9BA84827B30CBE4996725F98F7DC91232F955F47@SMExchange01.siebmeyer.org>
2013-08-29 18:58     ` AW: " Sebastian Andrzej Siewior
2013-09-03  7:02       ` AW: " Hänel-Baas, Alexander
2013-09-12 11:41       ` Hänel-Baas, Alexander
2013-10-11  9:39         ` Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).