On Fri, Oct 05, 2018 at 12:07:06PM +0000, Tony Chuang wrote: > > > +static void rtw_pci_dma_check(struct rtw_dev *rtwdev, > > > + struct rtw_pci_rx_ring *rx_ring, > > > + u32 idx) > > > +{ > > > + struct rtw_chip_info *chip = rtwdev->chip; > > > + struct rtw_pci_rx_buffer_desc *buf_desc; > > > + u32 desc_sz = chip->rx_buf_desc_sz; > > > + u16 total_pkt_size; > > > + int i; > > > + > > > + buf_desc = (struct rtw_pci_rx_buffer_desc *)(rx_ring->r.head + > > > + idx * desc_sz); > > > + for (i = 0; i < 20; i++) { > > > + total_pkt_size = le16_to_cpu(buf_desc->total_pkt_size); > > > + if (total_pkt_size) > > > + return; > > > + } > > > + > > > + if (i >= 20) > > > + rtw_warn(rtwdev, "pci bus timeout, drop packet\n"); > > This is not right, most likely you need to use > > dma_sync_single_for_cpu() . > > Not really understand how dma_sync_single_for_cpu() works. > Can you show me if possible? dma_sync_single_for_cpu() and dma_sync_single_for_device() transfer dma buffer ownership to respectivly CPU and device. It is well documented in: Documentation/DMA-API-HOWTO.txt: Documentation/DMA-API.txt Thanks Stanislaw