2022-03-24 21:05:15

by Maxime Bizon

[permalink] [raw]
Subject: Re: [REGRESSION] Recent swiotlb DMA_FROM_DEVICE fixes break ath9k-based AP


On Thu, 2022-03-24 at 15:27 +0100, Toke Høiland-Jørgensen wrote:

>
> I'm looking into this; but in the interest of a speedy resolution of
> the regression I would be in favour of merging that partial revert
> and reinstating it if/when we identify (and fix) any bugs in ath9k :)

This looks fishy:

ath9k/recv.c

/* We will now give hardware our shiny new allocated skb */
new_buf_addr = dma_map_single(sc->dev, requeue_skb->data,
common->rx_bufsize, dma_type);
if (unlikely(dma_mapping_error(sc->dev, new_buf_addr))) {
dev_kfree_skb_any(requeue_skb);
goto requeue_drop_frag;
}

/* Unmap the frame */
dma_unmap_single(sc->dev, bf->bf_buf_addr,
common->rx_bufsize, dma_type);

bf->bf_mpdu = requeue_skb;
bf->bf_buf_addr = new_buf_addr;

--
Maxime




2022-03-24 21:11:24

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [REGRESSION] Recent swiotlb DMA_FROM_DEVICE fixes break ath9k-based AP

On Thu, Mar 24, 2022 at 05:29:12PM +0100, Maxime Bizon wrote:
> > I'm looking into this; but in the interest of a speedy resolution of
> > the regression I would be in favour of merging that partial revert
> > and reinstating it if/when we identify (and fix) any bugs in ath9k :)
>
> This looks fishy:
>
> ath9k/recv.c
>
> /* We will now give hardware our shiny new allocated skb */
> new_buf_addr = dma_map_single(sc->dev, requeue_skb->data,
> common->rx_bufsize, dma_type);
> if (unlikely(dma_mapping_error(sc->dev, new_buf_addr))) {
> dev_kfree_skb_any(requeue_skb);
> goto requeue_drop_frag;
> }
>
> /* Unmap the frame */
> dma_unmap_single(sc->dev, bf->bf_buf_addr,
> common->rx_bufsize, dma_type);
>
> bf->bf_mpdu = requeue_skb;
> bf->bf_buf_addr = new_buf_addr;

Creating a new mapping for the same buffer before unmapping the
previous one does looks rather bogus. But it does not fit the
pattern where revering the sync_single changes make the driver
work again.