Ticket #7552: 840-b43-workaround-rx-fifo-overflow.patch

File 840-b43-workaround-rx-fifo-overflow.patch, 1.5 KB (added by Dmitriy Taychenachev <dimichxp@…>, 5 years ago)

for mac80211 openwrt package

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

    a b  
    16891692        sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize); 
    16901693} 
    16911694 
     1695static int dma_rx_check_overflow(struct b43_dmaring *ring) 
     1696{ 
     1697        u32 state; 
     1698        u32 rxctl; 
     1699 
     1700        if (ring->type != B43_DMA_32BIT) 
     1701                return 0; 
     1702 
     1703        state = b43_dma_read(ring, B43_DMA32_RXSTATUS) & B43_DMA32_RXSTATE; 
     1704        if (state != B43_DMA32_RXSTAT_IDLEWAIT) 
     1705                return 0; 
     1706 
     1707        rxctl = b43_dma_read(ring, B43_DMA32_RXCTL); 
     1708        b43_dmacontroller_rx_reset(ring->dev, ring->mmio_base, ring->type); 
     1709 
     1710        b43_dma_write(ring, B43_DMA32_RXCTL, rxctl); 
     1711        b43_dma_write(ring, B43_DMA32_RXINDEX, ring->nr_slots * 
     1712                      sizeof(struct b43_dmadesc32)); 
     1713        ring->current_slot = 0; 
     1714 
     1715        printk("DMA RX reset due to overflow\n"); 
     1716 
     1717        return 1; 
     1718} 
     1719 
    16921720void b43_dma_rx(struct b43_dmaring *ring) 
    16931721{ 
    16941722        const struct b43_dma_ops *ops = ring->ops; 
     
    17001728        B43_WARN_ON(!(current_slot >= 0 && current_slot < ring->nr_slots)); 
    17011729 
    17021730        slot = ring->current_slot; 
     1731 
     1732        /* XXX: BRCM4318(?) dirty workaround: 
     1733         *      it seems sometimes the RX ring overflows due to interrupt latencies;  
     1734         *      i.e. skb allocations are slow on routers with high CPU load 
     1735         *      and tight memory constraints */ 
     1736        if (slot == current_slot) { 
     1737                /* Try to reset the RX channel, will cost us few lost frames, 
     1738                 * but will recover from an eternal stall */ 
     1739                if (dma_rx_check_overflow(ring)) 
     1740                        return;          
     1741        } 
     1742         
    17031743        for (; slot != current_slot; slot = next_slot(ring, slot)) { 
    17041744                dma_rx(ring, &slot); 
    17051745                update_max_used_slots(ring, ++used_slots);