linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [RFC] ATH9K: infinite loop in Tasklet
@ 2012-12-11 10:01 Cedric VONCKEN
  2012-12-30 14:19 ` Mohammed Shafi
  0 siblings, 1 reply; 15+ messages in thread
From: Cedric VONCKEN @ 2012-12-11 10:01 UTC (permalink / raw)
  To: linux-wireless

	Any suggestion to fix correctly this issue ?

	Best regards.

-----Message d'origine-----
De : Cedric VONCKEN 
Envoyé : vendredi 7 décembre 2012 16:28
À : 'linux-wireless@vger.kernel.org'
Objet : [RFC] ATH9K: infinite loop in Tasklet

                Dear mailling list, 
                
                I think there is a possible infinite loop in ATH9K tasklet, and this loop block the linux kernel.

     	 In my test based on freescale MPC8315 cpu, the Wireless card is bridged to Ethernet driver (Gianfar). When I receive data from Wifi (iperf -c xx -b50M) to Ethernet, the Gianfar NAPI poll function is never called because the ath_rx_tasklet always loops.

                In the ath_rx_tasklet(...), the "while" loops until ath_get_next_rx_buf() or ath_edma_get_next_rx_buf returns a buffer. 

                If these functions always  return a buffer, this tasklet always runs. While this tasklet runs, all other tasklets are blocked. 
      To fix it I applied this patch:
      
      --- recv.c             2012-12-07 14:30:26.000000000 +0100
      +++ recv.c.new                2012-12-07 14:30:05.364591961 +0100
      @@ -1067,6 +1067,7 @@
                     u64 tsf = 0;
                     u32 tsf_lower = 0;
                     unsigned long flags;
      +             int count = 150;
      
                      if (edma)
                                    dma_type = DMA_BIDIRECTIONAL;
      @@ -1085,6 +1086,10 @@
                                    if (test_bit(SC_OP_RXFLUSH, &sc->sc_flags) && (flush == 0))
                                                    break;
      
      +                             if(count <= 0)
      +                                            break;
      +
      +                             count --;
                                    memset(&rs, 0, sizeof(rs));
                                    if (edma)
                                                    bf = ath_edma_get_next_rx_buf(sc, &rs, qtype);
      
      I think this solution is not correct, because the tasklet is not rescheduled and we always have data in Rx buffer. 
      
                Have you any suggestion to fix this issue correctly?

                Thanks for your help.

                Best regards.


^ permalink raw reply	[flat|nested] 15+ messages in thread
* [RFC] ATH9K: infinite loop in Tasklet
@ 2012-12-07 15:27 Cedric VONCKEN
  0 siblings, 0 replies; 15+ messages in thread
From: Cedric VONCKEN @ 2012-12-07 15:27 UTC (permalink / raw)
  To: linux-wireless

                Dear mailling list, 
                
                I think there is a possible infinite loop in ATH9K tasklet, and this loop block the linux kernel.

     	 In my test based on freescale MPC8315 cpu, the Wireless card is bridged to Ethernet driver (Gianfar). When I receive data from Wifi (iperf -c xx -b50M) to Ethernet, the Gianfar NAPI poll function is never called because the ath_rx_tasklet always loops.

                In the ath_rx_tasklet(...), the "while" loops until ath_get_next_rx_buf() or ath_edma_get_next_rx_buf returns a buffer. 

                If these functions always  return a buffer, this tasklet always runs. While this tasklet runs, all other tasklets are blocked. 
      To fix it I applied this patch:
      
      --- recv.c             2012-12-07 14:30:26.000000000 +0100
      +++ recv.c.new                2012-12-07 14:30:05.364591961 +0100
      @@ -1067,6 +1067,7 @@
                     u64 tsf = 0;
                     u32 tsf_lower = 0;
                     unsigned long flags;
      +             int count = 150;
      
                      if (edma)
                                    dma_type = DMA_BIDIRECTIONAL;
      @@ -1085,6 +1086,10 @@
                                    if (test_bit(SC_OP_RXFLUSH, &sc->sc_flags) && (flush == 0))
                                                    break;
      
      +                             if(count <= 0)
      +                                            break;
      +
      +                             count --;
                                    memset(&rs, 0, sizeof(rs));
                                    if (edma)
                                                    bf = ath_edma_get_next_rx_buf(sc, &rs, qtype);
      
      I think this solution is not correct, because the tasklet is not rescheduled and we always have data in Rx buffer. 
      
                Have you any suggestion to fix this issue correctly?

                Thanks for your help.

                Best regards.


^ permalink raw reply	[flat|nested] 15+ messages in thread
* [RFC] ATH9K: infinite loop in Tasklet
@ 2012-12-07 13:52 Cedric VONCKEN
  0 siblings, 0 replies; 15+ messages in thread
From: Cedric VONCKEN @ 2012-12-07 13:52 UTC (permalink / raw)
  To: linux-wireless

                Dear mailling list, 
                
                I think there is a possible infinite loop in ATH9K tasklet, and this loop block the linux kernel.

     	 In my test based on freescale MPC8315 cpu, the Wireless card is bridged to Ethernet driver (Gianfar). When I receive data from Wifi (iperf -c xx -b50M) to Ethernet, the Gianfar NAPI poll function is never called because the ath_rx_tasklet always loops.

                In the ath_rx_tasklet(...), the "while" loops until ath_get_next_rx_buf() or ath_edma_get_next_rx_buf returns a buffer. 

                If these functions always  return a buffer, this tasklet always runs. While this tasklet runs, all other tasklets are blocked. 
      To fix it I applied this patch:
      
      --- recv.c             2012-12-07 14:30:26.000000000 +0100
      +++ recv.c.new                2012-12-07 14:30:05.364591961 +0100
      @@ -1067,6 +1067,7 @@
                     u64 tsf = 0;
                     u32 tsf_lower = 0;
                     unsigned long flags;
      +             int count = 150;
      
                      if (edma)
                                    dma_type = DMA_BIDIRECTIONAL;
      @@ -1085,6 +1086,10 @@
                                    if (test_bit(SC_OP_RXFLUSH, &sc->sc_flags) && (flush == 0))
                                                    break;
      
      +                             if(count <= 0)
      +                                            break;
      +
      +                             count --;
                                    memset(&rs, 0, sizeof(rs));
                                    if (edma)
                                                    bf = ath_edma_get_next_rx_buf(sc, &rs, qtype);
      
      I think this solution is not correct, because the tasklet is not rescheduled and we always have data in Rx buffer. 
      
                Have you any suggestion to fix this issue correctly?

                Thanks for your help.

                Best regards.


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

end of thread, other threads:[~2013-01-03  1:36 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-11 10:01 [RFC] ATH9K: infinite loop in Tasklet Cedric VONCKEN
2012-12-30 14:19 ` Mohammed Shafi
2013-01-01  4:20   ` Adrian Chadd
2013-01-01 15:18     ` Felix Fietkau
2013-01-01 23:40       ` Adrian Chadd
2013-01-02 13:17         ` voncken
2013-01-02 16:21           ` Adrian Chadd
2013-01-02 17:15             ` voncken
2013-01-02 20:13               ` Adrian Chadd
2013-01-02 20:48                 ` Felix Fietkau
2013-01-02 23:12                   ` Adrian Chadd
2013-01-02 23:22                     ` Felix Fietkau
2013-01-03  1:36                       ` Adrian Chadd
  -- strict thread matches above, loose matches on Subject: below --
2012-12-07 15:27 Cedric VONCKEN
2012-12-07 13:52 Cedric VONCKEN

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).