From: Ben Greear <greearb@candelatech.com>
To: Felix Fietkau <nbd@openwrt.org>, linux-wireless@vger.kernel.org
Cc: kvalo@codeaurora.org, ath10k@lists.infradead.org
Subject: Re: [PATCH v2] ath10k: do not use coherent memory for allocated device memory chunks
Date: Wed, 30 Dec 2015 13:55:17 -0800 [thread overview]
Message-ID: <568452C5.7090700@candelatech.com> (raw)
In-Reply-To: <1448908321-3042-1-git-send-email-nbd@openwrt.org>
On 11/30/2015 10:32 AM, Felix Fietkau wrote:
> Coherent memory is more expensive to allocate (and constrained on some
> architectures where it has to be pre-allocated). It is also completely
> unnecessary, since the host has no reason to even access these allocated
> memory spaces
>
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
> - memset(ar->wmi.mem_chunks[idx].vaddr, 0, pool_size);
> + if (!num_units)
> + return -ENOMEM;
> +
> + paddr = dma_map_single(ar->dev, vaddr, pool_size, DMA_TO_DEVICE);
> + if (dma_mapping_error(ar->dev, paddr)) {
> + kfree(vaddr);
> + return -ENOMEM;
> + }
Are you sure you have the direction correct for the 'dma_map_single'
call?
I thought this memory was for the NIC to scribble in, and probably
host should never even bother reading or writing it?
The reason I started looking at this is that I see these errors when
trying to use a 4x4 wave-2 ath10k NIC in a 4.4.0-rc7 ath kernel:
[ 202.489625] wlan0: authenticate with 00:0e:8e:f8:73:96
[ 202.784533] DMAR: DRHD: handling fault status reg 3
[ 202.786246] wlan0: send auth to 00:0e:8e:f8:73:96 (try 1/3)
[ 202.788133] DMAR: DMAR:[DMA Write] Request device [05:00.0] fault addr ff5de000
DMAR:[fault reason 05] PTE Write access is not set
[ 202.887410] wlan0: send auth to 00:0e:8e:f8:73:96 (try 2/3)
[ 202.988423] wlan0: send auth to 00:0e:8e:f8:73:96 (try 3/3)
[ 203.089437] wlan0: authentication with 00:0e:8e:f8:73:96 timed out
This is on an Intel x86-64 system with IOMMU (VT-d) enabled.
I'm likely having more than one problem since a 4.3.0-rc6+ kernel is not
working with this NIC either...
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
WARNING: multiple messages have this Message-ID (diff)
From: Ben Greear <greearb@candelatech.com>
To: Felix Fietkau <nbd@openwrt.org>, linux-wireless@vger.kernel.org
Cc: ath10k@lists.infradead.org, kvalo@codeaurora.org
Subject: Re: [PATCH v2] ath10k: do not use coherent memory for allocated device memory chunks
Date: Wed, 30 Dec 2015 13:55:17 -0800 [thread overview]
Message-ID: <568452C5.7090700@candelatech.com> (raw)
In-Reply-To: <1448908321-3042-1-git-send-email-nbd@openwrt.org>
On 11/30/2015 10:32 AM, Felix Fietkau wrote:
> Coherent memory is more expensive to allocate (and constrained on some
> architectures where it has to be pre-allocated). It is also completely
> unnecessary, since the host has no reason to even access these allocated
> memory spaces
>
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
> - memset(ar->wmi.mem_chunks[idx].vaddr, 0, pool_size);
> + if (!num_units)
> + return -ENOMEM;
> +
> + paddr = dma_map_single(ar->dev, vaddr, pool_size, DMA_TO_DEVICE);
> + if (dma_mapping_error(ar->dev, paddr)) {
> + kfree(vaddr);
> + return -ENOMEM;
> + }
Are you sure you have the direction correct for the 'dma_map_single'
call?
I thought this memory was for the NIC to scribble in, and probably
host should never even bother reading or writing it?
The reason I started looking at this is that I see these errors when
trying to use a 4x4 wave-2 ath10k NIC in a 4.4.0-rc7 ath kernel:
[ 202.489625] wlan0: authenticate with 00:0e:8e:f8:73:96
[ 202.784533] DMAR: DRHD: handling fault status reg 3
[ 202.786246] wlan0: send auth to 00:0e:8e:f8:73:96 (try 1/3)
[ 202.788133] DMAR: DMAR:[DMA Write] Request device [05:00.0] fault addr ff5de000
DMAR:[fault reason 05] PTE Write access is not set
[ 202.887410] wlan0: send auth to 00:0e:8e:f8:73:96 (try 2/3)
[ 202.988423] wlan0: send auth to 00:0e:8e:f8:73:96 (try 3/3)
[ 203.089437] wlan0: authentication with 00:0e:8e:f8:73:96 timed out
This is on an Intel x86-64 system with IOMMU (VT-d) enabled.
I'm likely having more than one problem since a 4.3.0-rc6+ kernel is not
working with this NIC either...
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2015-12-30 21:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-30 18:32 [PATCH v2] ath10k: do not use coherent memory for allocated device memory chunks Felix Fietkau
2015-11-30 18:32 ` Felix Fietkau
2015-12-08 14:54 ` Kalle Valo
2015-12-08 14:54 ` Kalle Valo
2015-12-30 21:55 ` Ben Greear [this message]
2015-12-30 21:55 ` Ben Greear
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=568452C5.7090700@candelatech.com \
--to=greearb@candelatech.com \
--cc=ath10k@lists.infradead.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@openwrt.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.