Ticket #7552: 978-b43_dmarx_adddisc.patch

File 978-b43_dmarx_adddisc.patch, 4.3 KB (added by thommyj@…, 5 years ago)

patch for adding rx desc underrun

  • drivers/net/wireless/b43/dma.c

    old new  
    16881688        b43_poison_rx_buffer(ring, skb); 
    16891689        sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize); 
    16901690} 
     1691void b43_dma_rx_discard(struct b43_dmaring *ring) 
     1692{ 
     1693   B43_WARN_ON(ring->tx); 
     1694 
     1695    /* Device has filled all buffers, drop all packets in buffers 
     1696     * and let TCP decrease speed. 
     1697     * Set index to one desc after the last one (which is marked) 
     1698     * so the device will see all slots as free again 
     1699     */ 
     1700    /* 
     1701     *TODO: How to increase rx_drop in mac80211 
     1702     */ 
     1703   b43_dma_write(ring, B43_DMA32_RXINDEX, ring->nr_slots * 
     1704                                     sizeof(struct b43_dmadesc32)); 
     1705} 
    16911706 
    16921707void b43_dma_rx(struct b43_dmaring *ring) 
    16931708{ 
  • drivers/net/wireless/b43/dma.h

    old new  
    1010#define B43_DMAIRQ_FATALMASK    ((1 << 10) | (1 << 11) | (1 << 12) \ 
    1111                                         | (1 << 14) | (1 << 15)) 
    1212#define B43_DMAIRQ_NONFATALMASK (1 << 13) 
    13 #define B43_DMAIRQ_RX_DONE              (1 << 16) 
     13#define B43_DMAIRQ_RX_DONE      (1 << 16) 
     14#define B43_DMAIRQ_RDESC_UFLOW  (1 << 13) 
    1415 
    1516/*** 32-bit DMA Engine. ***/ 
    1617 
     
    295296void b43_dma_handle_txstatus(struct b43_wldev *dev, 
    296297                             const struct b43_txstatus *status); 
    297298 
     299void b43_dma_rx_discard(struct b43_dmaring *ring); 
     300 
    298301void b43_dma_rx(struct b43_dmaring *ring); 
    299302 
    300303void b43_dma_direct_fifo_rx(struct b43_wldev *dev, 
  • drivers/net/wireless/b43/main.c

    old new  
    18941894                        b43_controller_restart(dev, "DMA error"); 
    18951895                        return; 
    18961896                } 
    1897                 if (merged_dma_reason & B43_DMAIRQ_NONFATALMASK) { 
    1898                         b43err(dev->wl, "DMA error: " 
    1899                                "0x%08X, 0x%08X, 0x%08X, " 
    1900                                "0x%08X, 0x%08X, 0x%08X\n", 
    1901                                dma_reason[0], dma_reason[1], 
    1902                                dma_reason[2], dma_reason[3], 
    1903                                dma_reason[4], dma_reason[5]); 
    1904                 } 
    19051897        } 
    19061898 
    19071899        if (unlikely(reason & B43_IRQ_UCODE_DEBUG)) 
     
    19201912                handle_irq_noise(dev); 
    19211913 
    19221914        /* Check the DMA reason registers for received data. */ 
     1915        if (dma_reason[0] & B43_DMAIRQ_RDESC_UFLOW) { 
     1916           //only print 256 time to not flood log 
     1917           if(!(dev->stats.rxdesc_underruns++&0xFF)){ 
     1918                        b43warn(dev->wl, "Rx descriptor underrun (high cpu load?), throwing packets\n"); 
     1919           } 
     1920           b43_dma_rx_discard(dev->dma.rx_ring); 
     1921                         
     1922        } 
    19231923        if (dma_reason[0] & B43_DMAIRQ_RX_DONE) { 
    19241924                if (b43_using_pio_transfers(dev)) 
    19251925                        b43_pio_rx(dev->pio.rx_queue); 
     
    19771977                return IRQ_NONE; 
    19781978 
    19791979        dev->dma_reason[0] = b43_read32(dev, B43_MMIO_DMA0_REASON) 
    1980             & 0x0001DC00; 
     1980            & 0x0001FC00; 
    19811981        dev->dma_reason[1] = b43_read32(dev, B43_MMIO_DMA1_REASON) 
    19821982            & 0x0000DC00; 
    19831983        dev->dma_reason[2] = b43_read32(dev, B43_MMIO_DMA2_REASON) 
     
    30813081                b43_write32(dev, 0x018C, 0x02000000); 
    30823082        } 
    30833083        b43_write32(dev, B43_MMIO_GEN_IRQ_REASON, 0x00004000); 
    3084         b43_write32(dev, B43_MMIO_DMA0_IRQ_MASK, 0x0001DC00); 
     3084        b43_write32(dev, B43_MMIO_DMA0_IRQ_MASK, 0x0001FC00); 
    30853085        b43_write32(dev, B43_MMIO_DMA1_IRQ_MASK, 0x0000DC00); 
    30863086        b43_write32(dev, B43_MMIO_DMA2_IRQ_MASK, 0x0000DC00); 
    30873087        b43_write32(dev, B43_MMIO_DMA3_IRQ_MASK, 0x0001DC00); 
  • drivers/net/wireless/b43/b43.h

    old new  
    671671 
    672672struct b43_stats { 
    673673        u8 link_noise; 
     674        u32 rxdesc_underruns; 
    674675}; 
    675676 
    676677struct b43_key {