netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb-my8/4N5VtI7c+919tysfdA@public.gmane.org>
To: Felix Fietkau <nbd-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
Cc: "Michał Mirosław"
	<mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"Jouni Malinen"
	<jmalinen-DlyHzToyqoxBDgjK7y7TUQ@public.gmane.org>,
	"Senthil Balasubramanian"
	<senthilkumar-DlyHzToyqoxBDgjK7y7TUQ@public.gmane.org>,
	ath9k-devel-juf53994utBLZpfksSYvnA@public.gmane.org,
	"Vasanthakumar Thiagarajan"
	<vasanth-DlyHzToyqoxBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [ath9k-devel] [PATCH v2 07/46] net/wireless: ath9k: fix DMA API usage
Date: Mon, 11 Jul 2011 22:30:23 -0700	[thread overview]
Message-ID: <4E1BDBEF.1090505@candelatech.com> (raw)
In-Reply-To: <4E1BCF36.2010506-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>

On 07/11/2011 09:36 PM, Felix Fietkau wrote:
> On 2011-07-11 8:52 AM, Michał Mirosław wrote:
>> Also constify buf_addr for ath9k_hw_process_rxdesc_edma() to verify
>> assumptions --- dma_sync_single_for_device() call can be removed.
>>
>> Signed-off-by: Michał Mirosław<mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
>> ---
>> drivers/net/wireless/ath/ath9k/ar9003_mac.c | 4 ++--
>> drivers/net/wireless/ath/ath9k/ar9003_mac.h | 2 +-
>> drivers/net/wireless/ath/ath9k/recv.c | 10 +++-------
>> 3 files changed, 6 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
>> index 70dc8ec..c5f46d5 100644
>> --- a/drivers/net/wireless/ath/ath9k/recv.c
>> +++ b/drivers/net/wireless/ath/ath9k/recv.c
>> @@ -684,15 +684,11 @@ static bool ath_edma_get_buffers(struct ath_softc *sc,
>> BUG_ON(!bf);
>>
>> dma_sync_single_for_cpu(sc->dev, bf->bf_buf_addr,
>> - common->rx_bufsize, DMA_FROM_DEVICE);
>> + common->rx_bufsize, DMA_BIDIRECTIONAL);
>>
>> ret = ath9k_hw_process_rxdesc_edma(ah, NULL, skb->data);
>> - if (ret == -EINPROGRESS) {
>> - /*let device gain the buffer again*/
>> - dma_sync_single_for_device(sc->dev, bf->bf_buf_addr,
>> - common->rx_bufsize, DMA_FROM_DEVICE);
>> + if (ret == -EINPROGRESS)
>> return false;
>> - }
>>
>> __skb_unlink(skb,&rx_edma->rx_fifo);
>> if (ret == -EINVAL) {
> I have strong doubts about this change. On most MIPS devices, dma_sync_single_for_cpu is a no-op, whereas dma_sync_single_for_device flushes the cache range.
> With this change, the CPU could cache the DMA status part behind skb->data and that cache entry would not be flushed inbetween calls to this functions on the
> same buffer, likely leading to rx stalls.

At the very least, it would need heavy testing.  It took a very long time to get
the ath9k DMA issues (mostly?) resolved...so we shouldn't go mucking in this
code on theory...

Thanks,
Ben

>
> - Felix
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html


-- 
Ben Greear <greearb-my8/4N5VtI7c+919tysfdA@public.gmane.org>
Candela Technologies Inc  http://www.candelatech.com
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2011-07-12  5:30 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-11  0:52 [PATCH v2 00/46] Clean up RX copybreak and DMA handling Michał Mirosław
2011-07-11  0:52 ` [PATCH v2 01/46] net: introduce __netdev_alloc_skb_aligned() Michał Mirosław
2011-07-11  5:46   ` [PATCH net-next-2.6] net: introduce build_skb() Eric Dumazet
2011-07-11 10:53     ` Michał Mirosław
2011-07-12 15:40     ` Eric Dumazet
2011-07-12 15:54       ` Michał Mirosław
2011-07-11  0:52 ` [PATCH v2 05/46] net: bnx2x: fix DMA sync direction Michał Mirosław
2011-07-11  0:52 ` [PATCH v2 03/46] net drivers: remove unnecessary dma_sync_to_device(DMA_FROM_DEVICE) Michał Mirosław
2011-07-11  8:30   ` Vlad Zolotarov
2011-07-11  9:29     ` Michał Mirosław
2011-07-11  9:46       ` Vlad Zolotarov
2011-07-11  0:52 ` [PATCH v2 04/46] net/wireless: p54: remove useless dma_sync_single_for_device(DMA_FROM_DEVICE) Michał Mirosław
     [not found]   ` <86c8bde08b005ca7eb4806ea77aec1f3212d63fc.1310339688.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2011-07-11 15:15     ` Pavel Roskin
2011-07-12  4:50     ` Felix Fietkau
2011-07-11  0:52 ` [PATCH v2 02/46] net: wrap common patterns of rx handler code Michał Mirosław
2011-07-11  0:52 ` [PATCH v2 06/46] net/tokenring: 3c359: fix DMA API usage Michał Mirosław
     [not found] ` <cover.1310339688.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2011-07-11  0:52   ` [PATCH v2 07/46] net/wireless: ath9k: " Michał Mirosław
2011-07-12  4:36     ` Felix Fietkau
     [not found]       ` <4E1BCF36.2010506-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2011-07-12  5:30         ` Ben Greear [this message]
2011-07-12  9:55         ` [ath9k-devel] " Michał Mirosław
2011-07-12 12:54           ` Felix Fietkau
     [not found]             ` <B4765EFC-B5C9-4E2D-BE00-ED5519D13A4E-Vt+b4OUoWG0@public.gmane.org>
2011-07-12 13:03               ` [ath9k-devel] " Michał Mirosław
     [not found]                 ` <20110712130316.GA8621-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2011-07-12 14:21                   ` Felix Fietkau
2011-07-12 15:58                     ` Michał Mirosław
     [not found]                       ` <20110712155849.GB10651-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2011-07-12 16:04                         ` Felix Fietkau
2011-07-12 19:13                           ` Michał Mirosław
2011-07-12 19:32         ` Ralf Baechle
     [not found]           ` <20110712193204.GB13413-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>
2011-07-12 20:53             ` Michał Mirosław
     [not found]               ` <20110712205316.GA13503-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2011-07-12 20:59                 ` Michał Mirosław
2011-07-11  0:52 ` [PATCH v2 08/46] net/wireless: b43: fix DMA direction for RX buffers Michał Mirosław
2011-07-11  0:52 ` [PATCH v2 13/46] net: sunbmac: cleanup RX skb allocation Michał Mirosław
2011-07-11  0:52 ` [PATCH v2 12/46] net: sunhme: " Michał Mirosław
2011-07-11  0:52 ` [PATCH v2 10/46] net: jme: convert to generic DMA API Michał Mirosław
2011-07-11  0:52 ` [PATCH v2 11/46] net: sungem: cleanup RX skb allocation Michał Mirosław
2011-07-11  0:52 ` [PATCH v2 09/46] net: octeon_mgmt: fix DMA unmap size Michał Mirosław
2011-07-11  0:52 ` [PATCH v2 15/46] net/wireless: b43: use kfree_skb() for untouched skbs Michał Mirosław
2011-07-11  0:52 ` [PATCH v2 14/46] net: sunbmac: cleanup magic '34' Michał Mirosław
2011-07-11  0:52 ` [PATCH v2 16/46] net: cxgb3: don't drop packets on memory pressure in driver Michał Mirosław
2011-07-11  0:52 ` [PATCH v2 46/46] net: mark drivers that drop packets from rx queue head under memory pressure Michał Mirosław
2011-07-11  5:40   ` Francois Romieu
2011-07-11  6:47   ` Eilon Greenstein
2011-07-11 10:04     ` Michał Mirosław
2011-07-11 10:16       ` Eilon Greenstein
2011-07-11 15:24   ` Stephen Hemminger
2011-07-11  6:54 ` [PATCH v2 00/46] Clean up RX copybreak and DMA handling David Miller
2011-07-11  9:16   ` Michał Mirosław
2011-07-11  9:24     ` David Miller
2011-07-11  9:47       ` Michał Mirosław
2011-07-11 10:11         ` David Miller
2011-07-11 11:17           ` Michał Mirosław
2011-07-11 12:36   ` Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E1BDBEF.1090505@candelatech.com \
    --to=greearb-my8/4n5vti7c+919tysfda@public.gmane.org \
    --cc=ath9k-devel-juf53994utBLZpfksSYvnA@public.gmane.org \
    --cc=jmalinen-DlyHzToyqoxBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org \
    --cc=nbd-p3rKhJxN3npAfugRpC6u6w@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=senthilkumar-DlyHzToyqoxBDgjK7y7TUQ@public.gmane.org \
    --cc=vasanth-DlyHzToyqoxBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).