Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755966AbYLCUAh (ORCPT ); Wed, 3 Dec 2008 15:00:37 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754448AbYLCTuo (ORCPT ); Wed, 3 Dec 2008 14:50:44 -0500 Received: from kroah.org ([198.145.64.141]:59694 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754121AbYLCTue (ORCPT ); Wed, 3 Dec 2008 14:50:34 -0500 Date: Wed, 3 Dec 2008 11:49:16 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, sfr@canb.auug.org.au, ath9k-devel@venema.h4ckr.net, "Luis R. Rodriguez" , Maciej Zenczykowski , Bennyam Malavazi Subject: [patch 025/104] ath9k: Fix SW-IOMMU bounce buffer starvation Message-ID: <20081203194916.GZ8950@kroah.com> References: <20081203193901.715896543@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="ath9k-fix-sw-iommu-bounce-buffer-starvation.patch" In-Reply-To: <20081203194725.GA8950@kroah.com> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2800 Lines: 76 2.6.27-stable review patch. If anyone has any objections, please let us know. ------------------ From: Luis R. Rodriguez commit ca0c7e5101fd4f37fed8e851709f08580b92fbb3 upstream. This should fix the SW-IOMMU bounce buffer starvation seen ok kernel.org bugzilla 11811: http://bugzilla.kernel.org/show_bug.cgi?id=11811 Users on MacBook Pro 3.1/MacBook v2 would see something like: DMA: Out of SW-IOMMU space for 4224 bytes at device 0000:0b:00.0 Unfortunately its only easy to trigger on MacBook Pro 3.1/MacBook v2 so far so its difficult to debug (even with swiotlb=force). We were pci_unmap_single()'ing less bytes than what we called for with pci_map_single() and as such we were starving the swiotlb from its 64MB amount of bounce buffers. We remain consistent and now always use sc->rxbufsize for RX. While at it we update the beacon DMA maps as well to only use the data portion of the skb, previous to this we were pci_map_single()'ing more data for beaconing than what we tell the hardware it can use, therefore pushing more iotlb abuse. Still not sure why this is so easily triggerable on MacBook Pro 3.1, it may be the hardware configuration tends to use more memory > 3GB mark for DMA. Signed-off-by: Maciej Zenczykowski Signed-off-by: Bennyam Malavazi Signed-off-by: Luis R. Rodriguez Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath9k/recv.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) --- a/drivers/net/wireless/ath9k/recv.c +++ b/drivers/net/wireless/ath9k/recv.c @@ -1011,7 +1011,7 @@ int ath_rx_tasklet(struct ath_softc *sc, pci_dma_sync_single_for_cpu(sc->pdev, bf->bf_buf_addr, - skb_tailroom(skb), + sc->sc_rxbufsize, PCI_DMA_FROMDEVICE); pci_unmap_single(sc->pdev, bf->bf_buf_addr, @@ -1303,8 +1303,7 @@ dma_addr_t ath_skb_map_single(struct ath * NB: do NOT use skb->len, which is 0 on initialization. * Use skb's entire data area instead. */ - *pa = pci_map_single(sc->pdev, skb->data, - skb_end_pointer(skb) - skb->head, direction); + *pa = pci_map_single(sc->pdev, skb->data, sc->sc_rxbufsize, direction); return *pa; } @@ -1314,6 +1313,5 @@ void ath_skb_unmap_single(struct ath_sof dma_addr_t *pa) { /* Unmap skb's entire data area */ - pci_unmap_single(sc->pdev, *pa, - skb_end_pointer(skb) - skb->head, direction); + pci_unmap_single(sc->pdev, *pa, sc->sc_rxbufsize, direction); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/