Re: am335x: USB DMA IRQ issue

2015-03-03 Thread Bin Liu
On Sat, Feb 28, 2015 at 3:57 PM, Felipe Balbi ba...@ti.com wrote:
 Hi,

 On Sat, Feb 28, 2015 at 10:39:49PM +0100, Yegor Yefremov wrote:
 On Tue, Feb 24, 2015 at 5:36 PM, Felipe Balbi ba...@ti.com wrote:
  Hi,
 
  On Thu, Feb 05, 2015 at 12:19:23PM +0100, Yegor Yefremov wrote:
  I have a problem with my am335x based board and USB.
 
  Kernel: Linux version 3.18.1 (YegorYefremov@development1) (gcc version
  4.9.2 (Buildroot 2015.02-git-00797-gf1b07c0) ) #1 SMP Thu Jan 15
  15:31:27 CET 2015
 
  I took two devices and equipped them with USB WLAN cards: Bus 001
  Device 003: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless
  Adapter. One device as AP and another as client. Client makes
  permanent ping to AP. And from time to time I start nuttcp session.
  After 2-3 days I get following errors:
 
  2-3 days ? oh man... :-)
 
  Here's one thing to try. Can you do some variable size pingtest ?
  Something like below should do ?
 
  random()
  {
  size=$(dd if=/dev/urandom count=1 2/dev/null|cksum|
  cut -f1 -d |tr '-' '\0')
  size=$(expr $size % 6)
  }
 
  num=$1
 
  if [ -z $num ]
  then
  num=1
  fi
 
  while ! ifconfig usb0 /dev/null 21; do
  printf waiting for usb0\n
  sleep 1;
  done
 
  ifconfig usb0 192.168.2.14
 
  for i in $(seq 1 $num); do
  random
  printf %d: \t pinging with size %-27d $i $size
  if ! ping -c 6 192.168.2.15 -s $size -q -i 0 /dev/null 21; then
  printf FAILED\n
  break
  fi
  printf PASSED\n
  done

 Still haven't tried your test, but have seen this interesting
 patch/proposal http://e2e.ti.com/support/arm/sitara_arm/f/791/t/404743.
 Seems to be somehow related.

 patch makes sense. If you can make sure it really solves your problem
 then send it as a proper patch on top of my testing/next, I'd be glad.

FYI, the patch is posted here
http://marc.info/?l=linux-usbm=142526223500889w=2.


 At some point, I'll just split dma callback into dedicated rx and tx
 callbacks to avoid confusion in the future.

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


Re: am335x: USB DMA IRQ issue

2015-02-28 Thread Yegor Yefremov
On Tue, Feb 24, 2015 at 5:36 PM, Felipe Balbi ba...@ti.com wrote:
 Hi,

 On Thu, Feb 05, 2015 at 12:19:23PM +0100, Yegor Yefremov wrote:
 I have a problem with my am335x based board and USB.

 Kernel: Linux version 3.18.1 (YegorYefremov@development1) (gcc version
 4.9.2 (Buildroot 2015.02-git-00797-gf1b07c0) ) #1 SMP Thu Jan 15
 15:31:27 CET 2015

 I took two devices and equipped them with USB WLAN cards: Bus 001
 Device 003: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless
 Adapter. One device as AP and another as client. Client makes
 permanent ping to AP. And from time to time I start nuttcp session.
 After 2-3 days I get following errors:

 2-3 days ? oh man... :-)

 Here's one thing to try. Can you do some variable size pingtest ?
 Something like below should do ?

 random()
 {
 size=$(dd if=/dev/urandom count=1 2/dev/null|cksum|
 cut -f1 -d |tr '-' '\0')
 size=$(expr $size % 6)
 }

 num=$1

 if [ -z $num ]
 then
 num=1
 fi

 while ! ifconfig usb0 /dev/null 21; do
 printf waiting for usb0\n
 sleep 1;
 done

 ifconfig usb0 192.168.2.14

 for i in $(seq 1 $num); do
 random
 printf %d: \t pinging with size %-27d $i $size
 if ! ping -c 6 192.168.2.15 -s $size -q -i 0 /dev/null 21; then
 printf FAILED\n
 break
 fi
 printf PASSED\n
 done

Still haven't tried your test, but have seen this interesting
patch/proposal http://e2e.ti.com/support/arm/sitara_arm/f/791/t/404743.
Seems to be somehow related.

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


Re: am335x: USB DMA IRQ issue

2015-02-28 Thread Felipe Balbi
Hi,

On Sat, Feb 28, 2015 at 10:39:49PM +0100, Yegor Yefremov wrote:
 On Tue, Feb 24, 2015 at 5:36 PM, Felipe Balbi ba...@ti.com wrote:
  Hi,
 
  On Thu, Feb 05, 2015 at 12:19:23PM +0100, Yegor Yefremov wrote:
  I have a problem with my am335x based board and USB.
 
  Kernel: Linux version 3.18.1 (YegorYefremov@development1) (gcc version
  4.9.2 (Buildroot 2015.02-git-00797-gf1b07c0) ) #1 SMP Thu Jan 15
  15:31:27 CET 2015
 
  I took two devices and equipped them with USB WLAN cards: Bus 001
  Device 003: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless
  Adapter. One device as AP and another as client. Client makes
  permanent ping to AP. And from time to time I start nuttcp session.
  After 2-3 days I get following errors:
 
  2-3 days ? oh man... :-)
 
  Here's one thing to try. Can you do some variable size pingtest ?
  Something like below should do ?
 
  random()
  {
  size=$(dd if=/dev/urandom count=1 2/dev/null|cksum|
  cut -f1 -d |tr '-' '\0')
  size=$(expr $size % 6)
  }
 
  num=$1
 
  if [ -z $num ]
  then
  num=1
  fi
 
  while ! ifconfig usb0 /dev/null 21; do
  printf waiting for usb0\n
  sleep 1;
  done
 
  ifconfig usb0 192.168.2.14
 
  for i in $(seq 1 $num); do
  random
  printf %d: \t pinging with size %-27d $i $size
  if ! ping -c 6 192.168.2.15 -s $size -q -i 0 /dev/null 21; then
  printf FAILED\n
  break
  fi
  printf PASSED\n
  done
 
 Still haven't tried your test, but have seen this interesting
 patch/proposal http://e2e.ti.com/support/arm/sitara_arm/f/791/t/404743.
 Seems to be somehow related.

patch makes sense. If you can make sure it really solves your problem
then send it as a proper patch on top of my testing/next, I'd be glad.

At some point, I'll just split dma callback into dedicated rx and tx
callbacks to avoid confusion in the future.

-- 
balbi


signature.asc
Description: Digital signature


Re: am335x: USB DMA IRQ issue

2015-02-24 Thread Felipe Balbi
Hi,

On Thu, Feb 05, 2015 at 12:19:23PM +0100, Yegor Yefremov wrote:
 I have a problem with my am335x based board and USB.
 
 Kernel: Linux version 3.18.1 (YegorYefremov@development1) (gcc version
 4.9.2 (Buildroot 2015.02-git-00797-gf1b07c0) ) #1 SMP Thu Jan 15
 15:31:27 CET 2015
 
 I took two devices and equipped them with USB WLAN cards: Bus 001
 Device 003: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless
 Adapter. One device as AP and another as client. Client makes
 permanent ping to AP. And from time to time I start nuttcp session.
 After 2-3 days I get following errors:

2-3 days ? oh man... :-)

Here's one thing to try. Can you do some variable size pingtest ?
Something like below should do ?

random()
{
size=$(dd if=/dev/urandom count=1 2/dev/null|cksum|
cut -f1 -d |tr '-' '\0')
size=$(expr $size % 6)
}

num=$1

if [ -z $num ]
then
num=1
fi

while ! ifconfig usb0 /dev/null 21; do
printf waiting for usb0\n
sleep 1;
done

ifconfig usb0 192.168.2.14

for i in $(seq 1 $num); do
random
printf %d: \t pinging with size %-27d $i $size
if ! ping -c 6 192.168.2.15 -s $size -q -i 0 /dev/null 21; then
printf FAILED\n
break
fi
printf PASSED\n
done

cheers

-- 
balbi


signature.asc
Description: Digital signature


am335x: USB DMA IRQ issue

2015-02-05 Thread Yegor Yefremov
I have a problem with my am335x based board and USB.

Kernel: Linux version 3.18.1 (YegorYefremov@development1) (gcc version
4.9.2 (Buildroot 2015.02-git-00797-gf1b07c0) ) #1 SMP Thu Jan 15
15:31:27 CET 2015

I took two devices and equipped them with USB WLAN cards: Bus 001
Device 003: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless
Adapter. One device as AP and another as client. Client makes
permanent ping to AP. And from time to time I start nuttcp session.
After 2-3 days I get following errors:

CPU: 0 PID: 6123 Comm: kworker/u2:2 Tainted: GW  3.18.1 #1
Workqueue: phy0 rt2x00link_watchdog [rt2x00lib]
[c001596c] (unwind_backtrace) from [c0012218] (show_stack+0x10/0x14)
[c0012218] (show_stack) from [c05c7fe8] (dump_stack+0x84/0x9c)
[c05c7fe8] (dump_stack) from [c004031c] (warn_slowpath_common+0x6c/0x90)
[c004031c] (warn_slowpath_common) from [c00403dc]
(warn_slowpath_null+0x1c/0x24)
[c00403dc] (warn_slowpath_null) from [c02d0d44]
(cppi41_dma_control+0x298/0x2e0)
[c02d0d44] (cppi41_dma_control) from [c03eb100]
(cppi41_dma_channel_abort+0xc0/0x134)
[c03eb100] (cppi41_dma_channel_abort) from [c03e69f8]
(musb_cleanup_urb.isra.12+0x40/0xfc)
[c03e69f8] (musb_cleanup_urb.isra.12) from [c03e6d04]
(musb_urb_dequeue+0xe8/0x128)
[c03e6d04] (musb_urb_dequeue) from [c03b74bc] (usb_hcd_unlink_urb+0x4c/0x84)
[c03b74bc] (usb_hcd_unlink_urb) from [c03b863c] (usb_kill_urb+0x4c/0xc4)
[c03b863c] (usb_kill_urb) from [bf01291c]
(rt2x00usb_flush_entry+0x30/0x58 [rt2x00usb])
[bf01291c] (rt2x00usb_flush_entry [rt2x00usb]) from [bf007128]
(rt2x00queue_for_each_entry+0x84/0x250 [rt2x00lib])
[bf007128] (rt2x00queue_for_each_entry [rt2x00lib]) from
[bf0128e4] (rt2x00usb_flush_queue+0x98/0xa0 [rt2x00usb])
[bf0128e4] (rt2x00usb_flush_queue [rt2x00usb]) from [bf007bcc]
(rt2x00queue_flush_queue+0x44/0xa8 [rt2x00lib])
[bf007bcc] (rt2x00queue_flush_queue [rt2x00lib]) from [bf012d50]
(rt2x00usb_watchdog+0xc4/0xec [rt2x00usb])
[bf012d50] (rt2x00usb_watchdog [rt2x00usb]) from [bf02f950]
(rt2800usb_watchdog+0x74/0x1c0 [rt2800usb])
[bf02f950] (rt2800usb_watchdog [rt2800usb]) from [bf008b30]
(rt2x00link_watchdog+0x2c/0x58 [rt2x00lib])
[bf008b30] (rt2x00link_watchdog [rt2x00lib]) from [c005586c]
(process_one_work+0x1c4/0x494)
[c005586c] (process_one_work) from [c00562dc] (worker_thread+0x38/0x4bc)
[c00562dc] (worker_thread) from [c005a6e8] (kthread+0xc8/0xe4)
[c005a6e8] (kthread) from [c000e888] (ret_from_fork+0x14/0x2c)
---[ end trace 981fe2c9ed6055b8 ]---
[ cut here ]
WARNING: CPU: 0 PID: 6123 at drivers/dma/cppi41.c:320 cppi41_irq+0x144/0x198()
Modules linked in: rt2800usb rt2800lib rt2x00usb rt2x00lib led_class
CPU: 0 PID: 6123 Comm: kworker/u2:2 Tainted: GW  3.18.1 #1
Workqueue: phy0 rt2x00link_watchdog [rt2x00lib]
[c001596c] (unwind_backtrace) from [c0012218] (show_stack+0x10/0x14)
[c0012218] (show_stack) from [c05c7fe8] (dump_stack+0x84/0x9c)
[c05c7fe8] (dump_stack) from [c004031c] (warn_slowpath_common+0x6c/0x90)
[c004031c] (warn_slowpath_common) from [c00403dc]
(warn_slowpath_null+0x1c/0x24)
[c00403dc] (warn_slowpath_null) from [c02d12dc] (cppi41_irq+0x144/0x198)
[c02d12dc] (cppi41_irq) from [c0089544] (handle_irq_event_percpu+0x3c/0x1d8)
[c0089544] (handle_irq_event_percpu) from [c008971c]
(handle_irq_event+0x3c/0x5c)
[c008971c] (handle_irq_event) from [c008c2ec] (handle_level_irq+0xb4/0x144)
[c008c2ec] (handle_level_irq) from [c0088c70] (generic_handle_irq+0x28/0x3c)
[c0088c70] (generic_handle_irq) from [c0088f38]
(__handle_domain_irq+0x64/0xc8)
[c0088f38] (__handle_domain_irq) from [c0008780]
(omap_intc_handle_irq+0xb4/0xc4)
[c0008780] (omap_intc_handle_irq) from [c05cf9a4] (__irq_svc+0x44/0x5c)
Exception stack(0xcf7a5d30 to 0xcf7a5d78)
5d20: 0001 ccb64af8  ccb64580
5d40: a013 cf5a2010 cf5a2010  a013 c0008300 0001 cf365934
5d60: 0002 cf7a5d78 c007cd34 c05cefe8 2013 
[c05cf9a4] (__irq_svc) from [c05cefe8]
(_raw_spin_unlock_irqrestore+0x34/0x44)
[c05cefe8] (_raw_spin_unlock_irqrestore) from [c03e6cc0]
(musb_urb_dequeue+0xa4/0x128)
[c03e6cc0] (musb_urb_dequeue) from [c03b74bc] (usb_hcd_unlink_urb+0x4c/0x84)
[c03b74bc] (usb_hcd_unlink_urb) from [c03b863c] (usb_kill_urb+0x4c/0xc4)
[c03b863c] (usb_kill_urb) from [bf01291c]
(rt2x00usb_flush_entry+0x30/0x58 [rt2x00usb])
[bf01291c] (rt2x00usb_flush_entry [rt2x00usb]) from [bf007128]
(rt2x00queue_for_each_entry+0x84/0x250 [rt2x00lib])
[bf007128] (rt2x00queue_for_each_entry [rt2x00lib]) from
[bf0128e4] (rt2x00usb_flush_queue+0x98/0xa0 [rt2x00usb])
[bf0128e4] (rt2x00usb_flush_queue [rt2x00usb]) from [bf007bcc]
(rt2x00queue_flush_queue+0x44/0xa8 [rt2x00lib])
[bf007bcc] (rt2x00queue_flush_queue [rt2x00lib]) from [bf012d50]
(rt2x00usb_watchdog+0xc4/0xec [rt2x00usb])
[bf012d50] (rt2x00usb_watchdog [rt2x00usb]) from [bf02f950]
(rt2800usb_watchdog+0x74/0x1c0 [rt2800usb])
[bf02f950] (rt2800usb_watchdog [rt2800usb]) from [bf008b30]
(rt2x00link_watchdog+0x2c/0x58