* [PATCH v2] ath9k: fix dma mapping leak of rx buffer upon rmmod
@ 2009-03-23 22:25 Luis R. Rodriguez
2009-03-24 0:21 ` FUJITA Tomonori
0 siblings, 1 reply; 3+ messages in thread
From: Luis R. Rodriguez @ 2009-03-23 22:25 UTC (permalink / raw)
To: linville
Cc: linux-wireless, ath9k-devel, Luis R. Rodriguez, stable,
FUJITA Tomonori
We were claiming DMA buffers on the RX tasklet but never
upon a simple module removal.
Cc: stable@kernel.org
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
Sorry, forgot to CC stable
drivers/net/wireless/ath9k/recv.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c
index 917bac7..71cb18d 100644
--- a/drivers/net/wireless/ath9k/recv.c
+++ b/drivers/net/wireless/ath9k/recv.c
@@ -344,8 +344,13 @@ void ath_rx_cleanup(struct ath_softc *sc)
list_for_each_entry(bf, &sc->rx.rxbuf, list) {
skb = bf->bf_mpdu;
- if (skb)
+ if (skb) {
+ dma_unmap_single(sc->dev,
+ bf->bf_buf_addr,
+ sc->rx.bufsize,
+ DMA_FROM_DEVICE);
dev_kfree_skb(skb);
+ }
}
if (sc->rx.rxdma.dd_desc_len != 0)
--
1.5.6.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ath9k: fix dma mapping leak of rx buffer upon rmmod
2009-03-24 0:21 ` FUJITA Tomonori
@ 2009-03-23 23:31 ` Luis R. Rodriguez
0 siblings, 0 replies; 3+ messages in thread
From: Luis R. Rodriguez @ 2009-03-23 23:31 UTC (permalink / raw)
To: FUJITA Tomonori
Cc: Luis Rodriguez, linville@tuxdriver.com,
linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org,
stable@kernel.org
On Mon, Mar 23, 2009 at 05:21:28PM -0700, FUJITA Tomonori wrote:
> On Mon, 23 Mar 2009 18:25:01 -0400
> "Luis R. Rodriguez" <lrodriguez@atheros.com> wrote:
>
> > We were claiming DMA buffers on the RX tasklet but never
> > upon a simple module removal.
> >
> > Cc: stable@kernel.org
> > Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> > Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
> > ---
> >
> > Sorry, forgot to CC stable
> >
> > drivers/net/wireless/ath9k/recv.c | 7 ++++++-
> > 1 files changed, 6 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c
> > index 917bac7..71cb18d 100644
> > --- a/drivers/net/wireless/ath9k/recv.c
> > +++ b/drivers/net/wireless/ath9k/recv.c
> > @@ -344,8 +344,13 @@ void ath_rx_cleanup(struct ath_softc *sc)
> >
> > list_for_each_entry(bf, &sc->rx.rxbuf, list) {
> > skb = bf->bf_mpdu;
> > - if (skb)
> > + if (skb) {
> > + dma_unmap_single(sc->dev,
> > + bf->bf_buf_addr,
> > + sc->rx.bufsize,
> > + DMA_FROM_DEVICE);
> > dev_kfree_skb(skb);
> > + }
> > }
>
> ath9k uses pci_map/unmap_* families so using dma_map/unmap looks
> inconsistent. It works though.
>
> I think that my original patch is fine:
>
> http://marc.info/?l=linux-kernel&m=123725029228065&w=2
Noted -- the ported patch for 2.6.29 will use pci_unmap_single() however
this patch was for 2.6.30 where we now have bus-agnostic routines. To
get a better idea of how this looks feel free to check out ath9k from
the wireless-testing git tree.
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
Luis
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ath9k: fix dma mapping leak of rx buffer upon rmmod
2009-03-23 22:25 [PATCH v2] ath9k: fix dma mapping leak of rx buffer upon rmmod Luis R. Rodriguez
@ 2009-03-24 0:21 ` FUJITA Tomonori
2009-03-23 23:31 ` Luis R. Rodriguez
0 siblings, 1 reply; 3+ messages in thread
From: FUJITA Tomonori @ 2009-03-24 0:21 UTC (permalink / raw)
To: lrodriguez; +Cc: linville, linux-wireless, ath9k-devel, stable, fujita.tomonori
On Mon, 23 Mar 2009 18:25:01 -0400
"Luis R. Rodriguez" <lrodriguez@atheros.com> wrote:
> We were claiming DMA buffers on the RX tasklet but never
> upon a simple module removal.
>
> Cc: stable@kernel.org
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
> ---
>
> Sorry, forgot to CC stable
>
> drivers/net/wireless/ath9k/recv.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c
> index 917bac7..71cb18d 100644
> --- a/drivers/net/wireless/ath9k/recv.c
> +++ b/drivers/net/wireless/ath9k/recv.c
> @@ -344,8 +344,13 @@ void ath_rx_cleanup(struct ath_softc *sc)
>
> list_for_each_entry(bf, &sc->rx.rxbuf, list) {
> skb = bf->bf_mpdu;
> - if (skb)
> + if (skb) {
> + dma_unmap_single(sc->dev,
> + bf->bf_buf_addr,
> + sc->rx.bufsize,
> + DMA_FROM_DEVICE);
> dev_kfree_skb(skb);
> + }
> }
ath9k uses pci_map/unmap_* families so using dma_map/unmap looks
inconsistent. It works though.
I think that my original patch is fine:
http://marc.info/?l=linux-kernel&m=123725029228065&w=2
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-24 0:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-23 22:25 [PATCH v2] ath9k: fix dma mapping leak of rx buffer upon rmmod Luis R. Rodriguez
2009-03-24 0:21 ` FUJITA Tomonori
2009-03-23 23:31 ` Luis R. Rodriguez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).