rpms/kernel/F-10 linux-2.6-wireless-ath9k-dma-fixes.patch, NONE, 1.1 kernel.spec, 1.1170, 1.1171 linux-2.6-wireless-ath9k-check-broken-iommu.patch, 1.1, NONE

John W. Linville linville at fedoraproject.org
Tue Dec 2 21:33:20 UTC 2008


Author: linville

Update of /cvs/pkgs/rpms/kernel/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13915

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-wireless-ath9k-dma-fixes.patch 
Removed Files:
	linux-2.6-wireless-ath9k-check-broken-iommu.patch 
Log Message:
ath9k DMA fixes

linux-2.6-wireless-ath9k-dma-fixes.patch:

--- NEW FILE linux-2.6-wireless-ath9k-dma-fixes.patch ---
>From linux-wireless-owner at vger.kernel.org Tue Dec  2 15:52:19 2008
Return-path: <linux-wireless-owner at vger.kernel.org>
Envelope-to: linville at tuxdriver.com
Delivery-date: Tue, 02 Dec 2008 15:52:19 -0500
Received: from vger.kernel.org ([209.132.176.167])
	by smtp.tuxdriver.com with esmtp (Exim 4.63)
	(envelope-from <linux-wireless-owner at vger.kernel.org>)
	id 1L7cEF-0001rU-3l
	for linville at tuxdriver.com; Tue, 02 Dec 2008 15:52:19 -0500
Received: (majordomo at vger.kernel.org) by vger.kernel.org via listexpand
	id S1752106AbYLBUvg (ORCPT <rfc822;linville at tuxdriver.com>);
	Tue, 2 Dec 2008 15:51:36 -0500
Received: (majordomo at vger.kernel.org) by vger.kernel.org id S1752030AbYLBUvg
	(ORCPT <rfc822;linux-wireless-outgoing>);
	Tue, 2 Dec 2008 15:51:36 -0500
Received: from mail.atheros.com ([12.36.123.2]:24760 "EHLO mail.atheros.com"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1751848AbYLBUvf (ORCPT <rfc822;linux-wireless at vger.kernel.org>);
	Tue, 2 Dec 2008 15:51:35 -0500
Received: from mail.atheros.com ([10.10.20.108])
	by sidewinder.atheros.com
	for <linux-kernel at vger.kernel.org>; Tue, 02 Dec 2008 12:51:35 -0800
Received: from smtp.atheros.com (10.10.18.125) by
 SC1EXHC-02.global.atheros.com (10.10.20.106) with Microsoft SMTP Server (TLS)
 id 8.0.751.0; Tue, 2 Dec 2008 12:51:28 -0800
Received: by smtp.atheros.com (sSMTP sendmail emulation); Tue, 02 Dec 2008
 12:51:28 -0800
From:	"Luis R. Rodriguez" <lrodriguez at atheros.com>
To:	<stable at kernel.org>
CC:	<ath9k-devel at lists.ath9k.org>, <linux-wireless at vger.kernel.org>,
	<linux-kernel at vger.kernel.org>, <sfr at canb.auug.org.au>,
	"Luis R. Rodriguez" <lrodriguez at atheros.com>,
	Maciej Zenczykowski <zenczykowski at gmail.com>,
	Bennyam Malavazi <Bennyam.Malavazi at atheros.com>
Subject: [PATCH] ath9k: Fix SW-IOMMU bounce buffer starvation
Date:	Tue, 2 Dec 2008 12:51:20 -0800
Message-ID: <1228251082-11677-2-git-send-email-lrodriguez at atheros.com>
X-Mailer: git-send-email 1.5.6.rc2.15.g457bb.dirty
In-Reply-To: <1228251082-11677-1-git-send-email-lrodriguez at atheros.com>
References: <1228251082-11677-1-git-send-email-lrodriguez at atheros.com>
MIME-Version: 1.0
Content-Type: text/plain
Sender:	linux-wireless-owner at vger.kernel.org
Precedence: bulk
List-ID: <linux-wireless.vger.kernel.org>
X-Mailing-List:	linux-wireless at vger.kernel.org
X-Spam-Score: -4.0 (----)
X-Spam-Status: No
Content-Length: 2667
Lines: 71

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 <zenczykowski at gmail.com>
Signed-off-by: Bennyam Malavazi <Bennyam.Malavazi at atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez at atheros.com>
---
 drivers/net/wireless/ath9k/recv.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c
index 20ddb7a..4d23827 100644
--- 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, int flush)
 
 		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_softc *sc,
 	 * 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_softc *sc,
 			  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);
 }
-- 
1.5.6.rc2.15.g457bb.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


>From linux-wireless-owner at vger.kernel.org Tue Dec  2 15:52:21 2008
Return-path: <linux-wireless-owner at vger.kernel.org>
Envelope-to: linville at tuxdriver.com
Delivery-date: Tue, 02 Dec 2008 15:52:21 -0500
Received: from vger.kernel.org ([209.132.176.167])
	by smtp.tuxdriver.com with esmtp (Exim 4.63)
	(envelope-from <linux-wireless-owner at vger.kernel.org>)
	id 1L7cEH-0001rU-7u
	for linville at tuxdriver.com; Tue, 02 Dec 2008 15:52:21 -0500
Received: (majordomo at vger.kernel.org) by vger.kernel.org via listexpand
	id S1752556AbYLBUvm (ORCPT <rfc822;linville at tuxdriver.com>);
	Tue, 2 Dec 2008 15:51:42 -0500
Received: (majordomo at vger.kernel.org) by vger.kernel.org id S1752535AbYLBUvl
	(ORCPT <rfc822;linux-wireless-outgoing>);
	Tue, 2 Dec 2008 15:51:41 -0500
Received: from mail.atheros.com ([12.36.123.2]:24771 "EHLO mail.atheros.com"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1752082AbYLBUvg (ORCPT <rfc822;linux-wireless at vger.kernel.org>);
	Tue, 2 Dec 2008 15:51:36 -0500
Received: from mail.atheros.com ([10.10.20.108])
	by sidewinder.atheros.com
	for <linux-kernel at vger.kernel.org>; Tue, 02 Dec 2008 12:51:36 -0800
Received: from smtp.atheros.com (10.10.18.125) by
 SC1EXHC-02.global.atheros.com (10.10.20.111) with Microsoft SMTP Server (TLS)
 id 8.0.751.0; Tue, 2 Dec 2008 12:51:35 -0800
Received: by smtp.atheros.com (sSMTP sendmail emulation); Tue, 02 Dec 2008
 12:51:34 -0800
From:	"Luis R. Rodriguez" <lrodriguez at atheros.com>
To:	<stable at kernel.org>
CC:	<ath9k-devel at lists.ath9k.org>, <linux-wireless at vger.kernel.org>,
	<linux-kernel at vger.kernel.org>, <sfr at canb.auug.org.au>,
	"Luis R. Rodriguez" <lrodriguez at atheros.com>,
	Bennyam Malavazi <Bennyam.Malavazi at atheros.com>
Subject: [PATCH] ath9k: correct expected max RX buffer size
Date:	Tue, 2 Dec 2008 12:51:21 -0800
Message-ID: <1228251082-11677-3-git-send-email-lrodriguez at atheros.com>
X-Mailer: git-send-email 1.5.6.rc2.15.g457bb.dirty
In-Reply-To: <1228251082-11677-2-git-send-email-lrodriguez at atheros.com>
References: <1228251082-11677-1-git-send-email-lrodriguez at atheros.com>
 <1228251082-11677-2-git-send-email-lrodriguez at atheros.com>
MIME-Version: 1.0
Content-Type: text/plain
Sender:	linux-wireless-owner at vger.kernel.org
Precedence: bulk
List-ID: <linux-wireless.vger.kernel.org>
X-Mailing-List:	linux-wireless at vger.kernel.org
X-Spam-Score: -4.0 (----)
X-Spam-Status: No
Status: RO
Content-Length: 1309
Lines: 35

We should only tell the hardware its capable of DMA'ing
to us only what we asked dev_alloc_skb(). Prior to this
it is possible a large RX'd frame could have corrupted
DMA data but for us but we were saved only because we
were previously also pci_map_single()'ing the same large
value. The issue prior to this though was we were unmapping
a smaller amount which the prior DMA patch fixed.

Signed-off-by: Bennyam Malavazi <Bennyam.Malavazi at atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez at atheros.com>
---
 drivers/net/wireless/ath9k/recv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c
index 4d23827..0941589 100644
--- a/drivers/net/wireless/ath9k/recv.c
+++ b/drivers/net/wireless/ath9k/recv.c
@@ -52,7 +52,7 @@ static void ath_rx_buf_link(struct ath_softc *sc, struct ath_buf *bf)
 	/* setup rx descriptors */
 	ath9k_hw_setuprxdesc(ah,
 			     ds,
-			     skb_tailroom(skb),   /* buffer size */
+			     sc->sc_rxbufsize,
 			     0);
 
 	if (sc->sc_rxlink == NULL)
-- 
1.5.6.rc2.15.g457bb.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


>From linux-wireless-owner at vger.kernel.org Tue Dec  2 15:52:21 2008
Return-path: <linux-wireless-owner at vger.kernel.org>
Envelope-to: linville at tuxdriver.com
Delivery-date: Tue, 02 Dec 2008 15:52:21 -0500
Received: from vger.kernel.org ([209.132.176.167])
	by smtp.tuxdriver.com with esmtp (Exim 4.63)
	(envelope-from <linux-wireless-owner at vger.kernel.org>)
	id 1L7cEG-0001rU-99
	for linville at tuxdriver.com; Tue, 02 Dec 2008 15:52:20 -0500
Received: (majordomo at vger.kernel.org) by vger.kernel.org via listexpand
	id S1752260AbYLBUvk (ORCPT <rfc822;linville at tuxdriver.com>);
	Tue, 2 Dec 2008 15:51:40 -0500
Received: (majordomo at vger.kernel.org) by vger.kernel.org id S1752440AbYLBUvk
	(ORCPT <rfc822;linux-wireless-outgoing>);
	Tue, 2 Dec 2008 15:51:40 -0500
Received: from mail.atheros.com ([12.36.123.2]:24786 "EHLO mail.atheros.com"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1752260AbYLBUvi (ORCPT <rfc822;linux-wireless at vger.kernel.org>);
	Tue, 2 Dec 2008 15:51:38 -0500
Received: from mail.atheros.com ([10.10.20.108])
	by sidewinder.atheros.com
	for <linux-kernel at vger.kernel.org>; Tue, 02 Dec 2008 12:51:38 -0800
Received: from smtp.atheros.com (10.10.18.125) by
 SC1EXHC-02.global.atheros.com (10.10.20.106) with Microsoft SMTP Server (TLS)
 id 8.0.751.0; Tue, 2 Dec 2008 12:51:37 -0800
Received: by smtp.atheros.com (sSMTP sendmail emulation); Tue, 02 Dec 2008
 12:51:36 -0800
From:	"Luis R. Rodriguez" <lrodriguez at atheros.com>
To:	<stable at kernel.org>
CC:	<ath9k-devel at lists.ath9k.org>, <linux-wireless at vger.kernel.org>,
	<linux-kernel at vger.kernel.org>, <sfr at canb.auug.org.au>,
	"Luis R. Rodriguez" <lrodriguez at atheros.com>
Subject: [PATCH 1/3] ath9k: Handle -ENOMEM on RX gracefully
Date:	Tue, 2 Dec 2008 12:51:22 -0800
Message-ID: <1228251082-11677-4-git-send-email-lrodriguez at atheros.com>
X-Mailer: git-send-email 1.5.6.rc2.15.g457bb.dirty
In-Reply-To: <1228251082-11677-3-git-send-email-lrodriguez at atheros.com>
References: <1228251082-11677-1-git-send-email-lrodriguez at atheros.com>
 <1228251082-11677-2-git-send-email-lrodriguez at atheros.com>
 <1228251082-11677-3-git-send-email-lrodriguez at atheros.com>
MIME-Version: 1.0
Content-Type: text/plain
Sender:	linux-wireless-owner at vger.kernel.org
Precedence: bulk
List-ID: <linux-wireless.vger.kernel.org>
X-Mailing-List:	linux-wireless at vger.kernel.org
X-Spam-Score: -4.0 (----)
X-Spam-Status: No
Status: RO
Content-Length: 2812
Lines: 87

We would get an oops on RX on -ENOMEM by passing
NULL to the hardware on ath_rx_buf_link(). The oops
would look something like this:

ath_rx_tasklet
...
RIP: ath_rx_buf_link

We correct this by handling the allocation for the next
skb we will put in our RX tail directly on the ath_rx_tasklet()
*prior* to sending up the last hardware processed
skb. If we run out of memory this gauranteees we have
skbs to work with while it simply drops new received
frames.

Signed-off-by: Luis R. Rodriguez <lrodriguez at atheros.com>
---
 drivers/net/wireless/ath9k/recv.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c
index 0941589..a4f92b2 100644
--- a/drivers/net/wireless/ath9k/recv.c
+++ b/drivers/net/wireless/ath9k/recv.c
@@ -441,18 +441,16 @@ static void ath_rx_requeue(struct ath_softc *sc, struct sk_buff *skb)
  */
 static int ath_rx_indicate(struct ath_softc *sc,
 			   struct sk_buff *skb,
+			   struct sk_buff *nskb,
 			   struct ath_recv_status *status,
 			   u16 keyix)
 {
 	struct ath_buf *bf = ATH_RX_CONTEXT(skb)->ctx_rxbuf;
-	struct sk_buff *nskb;
 	int type;
 
 	/* indicate frame to the stack, which will free the old skb. */
 	type = ath__rx_indicate(sc, skb, status, keyix);
 
-	/* allocate a new skb and queue it to for H/W processing */
-	nskb = ath_rxbuf_alloc(sc, sc->sc_rxbufsize);
 	if (nskb != NULL) {
 		bf->bf_mpdu = nskb;
 		bf->bf_buf_addr = ath_skb_map_single(sc,
@@ -741,6 +739,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
 	struct ath_desc *ds;
 	struct ieee80211_hdr *hdr;
 	struct sk_buff *skb = NULL;
+	struct sk_buff *nskb = NULL;
 	struct ath_recv_status rx_status;
 	struct ath_hal *ah = sc->sc_ah;
 	int type, rx_processed = 0;
@@ -963,6 +962,17 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
 		 */
 		if (sc->sc_rxbufsize < ds->ds_rxstat.rs_datalen)
 			goto rx_next;
+
+		/* allocate a new skb and queue it to for H/W processing */
+		nskb = ath_rxbuf_alloc(sc, sc->sc_rxbufsize);
+
+		/* Diregard current RX'd frame and reuse the old skb */
+		if (!nskb) {
+			list_move_tail(&bf->list, &sc->sc_rxbuf);
+			ath_rx_buf_link(sc, bf);
+			goto rx_next;
+		}
+
 		/*
 		 * Sync and unmap the frame.  At this point we're
 		 * committed to passing the sk_buff somewhere so
@@ -1052,7 +1062,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
 
 		/* Pass frames up to the stack. */
 
-		type = ath_rx_indicate(sc, skb,
+		type = ath_rx_indicate(sc, skb, nskb,
 			&rx_status, ds->ds_rxstat.rs_keyix);
 
 		/*
-- 
1.5.6.rc2.15.g457bb.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html




Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-10/kernel.spec,v
retrieving revision 1.1170
retrieving revision 1.1171
diff -u -r1.1170 -r1.1171
--- kernel.spec	2 Dec 2008 02:56:50 -0000	1.1170
+++ kernel.spec	2 Dec 2008 21:32:49 -0000	1.1171
@@ -642,11 +642,10 @@
 Patch670: linux-2.6-ata-quirk.patch
 Patch672: linux-2.6-libata-avoid-overflow-with-large-disks.patch
 
-#Patch680: linux-2.6-iwlwifi-use-dma_alloc_coherent.patch
-Patch681: linux-2.6-iwlagn-downgrade-BUG_ON-in-interrupt.patch
-Patch682: linux-2.6-iwl3945-ibss-tsf-fix.patch
+Patch680: linux-2.6-iwlagn-downgrade-BUG_ON-in-interrupt.patch
+Patch681: linux-2.6-iwl3945-ibss-tsf-fix.patch
+Patch682: linux-2.6-wireless-ath9k-dma-fixes.patch
 Patch690: linux-2.6-at76.patch
-Patch692: linux-2.6-wireless-ath9k-check-broken-iommu.patch
 
 Patch700: linux-2.6-nfs-client-mounts-hang.patch
 
@@ -1259,19 +1258,17 @@
 # fix overlow with large disk
 ApplyPatch linux-2.6-libata-avoid-overflow-with-large-disks.patch
 
-# fix spot's iwlwifi, hopefully...
-#ApplyPatch linux-2.6-iwlwifi-use-dma_alloc_coherent.patch
 # make jarod's iwl4965 not panic near N APs, hopefully
 ApplyPatch linux-2.6-iwlagn-downgrade-BUG_ON-in-interrupt.patch
 # iwl3945 fix for stable ad-hoc mode connections (#459401)
 ApplyPatch linux-2.6-iwl3945-ibss-tsf-fix.patch
 
+# Backported ath9k DMA fixes from pre-2.6.28
+ApplyPatch linux-2.6-wireless-ath9k-dma-fixes.patch
+
 # Add misc wireless bits from upstream wireless tree
 ApplyPatch linux-2.6-at76.patch
 
-# disable ath9k when swiotlb is in use
-ApplyPatch linux-2.6-wireless-ath9k-check-broken-iommu.patch
-
 # NFS Client mounts hang when exported directory do not exist
 ApplyPatch linux-2.6-nfs-client-mounts-hang.patch
 
@@ -1932,6 +1929,10 @@
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Tue Dec 02 2008 John W. Linville <linville at redhat.com> 2.6.27.7-135
+- Backported ath9k DMA fixes from pre-2.6.28
+- Drop patch to disable ath9k when swiotlb is in use
+
 * Tue Dec 02 2008 Dave Airlie <airlied at redhat.com> 2.6.27.7-134
 - radeon: fix IGP aperture sizing (#473895)
 


--- linux-2.6-wireless-ath9k-check-broken-iommu.patch DELETED ---




More information about the fedora-extras-commits mailing list