From: Ben Greear <greearb@candelatech.com>
To: Michal Kazior <michal.kazior@tieto.com>, ath10k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 4/5] ath10k: clean up cont frag desc init code
Date: Wed, 20 Jan 2016 11:34:10 -0800 [thread overview]
Message-ID: <569FE132.7040006@candelatech.com> (raw)
In-Reply-To: <1452693668-30030-5-git-send-email-michal.kazior@tieto.com>
On 01/13/2016 06:01 AM, Michal Kazior wrote:
> This makes the code easier to extend and re-use.
>
> While at it fix _warn to _err. Other than that
> there are no functional changes.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
> ---
> drivers/net/wireless/ath/ath10k/htt_tx.c | 58 ++++++++++++++++++++++----------
> 1 file changed, 41 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
> index b3adadb5f824..41a9811820e8 100644
> --- a/drivers/net/wireless/ath/ath10k/htt_tx.c
> +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
> @@ -97,6 +97,41 @@ void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id)
> idr_remove(&htt->pending_tx, msdu_id);
> }
>
> +static void ath10k_htt_tx_free_cont_frag_desc(struct ath10k_htt *htt)
> +{
> + size_t size;
> +
> + if (!htt->frag_desc.vaddr)
> + return;
> +
> + size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc);
> +
> + dma_free_coherent(htt->ar->dev,
> + size,
> + htt->frag_desc.vaddr,
> + htt->frag_desc.paddr);
> +}
> +
> +static int ath10k_htt_tx_alloc_cont_frag_desc(struct ath10k_htt *htt)
> +{
> + struct ath10k *ar = htt->ar;
> + size_t size;
> +
> + if (!ar->hw_params.continuous_frag_desc)
> + return 0;
> +
> + size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc);
> + htt->frag_desc.vaddr = dma_alloc_coherent(ar->dev, size,
> + &htt->frag_desc.paddr,
> + GFP_DMA);
Did you mean to change GFP_KERNEL to GFP_DMA?
> - size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc);
> - htt->frag_desc.vaddr = dma_alloc_coherent(ar->dev, size,
> - &htt->frag_desc.paddr,
> - GFP_KERNEL);
> - if (!htt->frag_desc.vaddr) {
> - ath10k_warn(ar, "failed to alloc fragment desc memory\n");
> - ret = -ENOMEM;
> + ret = ath10k_htt_tx_alloc_cont_frag_desc(htt);
> + if (ret) {
> + ath10k_err(ar, "failed to alloc cont frag desc: %d\n", ret);
> goto free_txbuf;
> }
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: Michal Kazior <michal.kazior@tieto.com>, ath10k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 4/5] ath10k: clean up cont frag desc init code
Date: Wed, 20 Jan 2016 11:34:10 -0800 [thread overview]
Message-ID: <569FE132.7040006@candelatech.com> (raw)
In-Reply-To: <1452693668-30030-5-git-send-email-michal.kazior@tieto.com>
On 01/13/2016 06:01 AM, Michal Kazior wrote:
> This makes the code easier to extend and re-use.
>
> While at it fix _warn to _err. Other than that
> there are no functional changes.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
> ---
> drivers/net/wireless/ath/ath10k/htt_tx.c | 58 ++++++++++++++++++++++----------
> 1 file changed, 41 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
> index b3adadb5f824..41a9811820e8 100644
> --- a/drivers/net/wireless/ath/ath10k/htt_tx.c
> +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
> @@ -97,6 +97,41 @@ void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id)
> idr_remove(&htt->pending_tx, msdu_id);
> }
>
> +static void ath10k_htt_tx_free_cont_frag_desc(struct ath10k_htt *htt)
> +{
> + size_t size;
> +
> + if (!htt->frag_desc.vaddr)
> + return;
> +
> + size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc);
> +
> + dma_free_coherent(htt->ar->dev,
> + size,
> + htt->frag_desc.vaddr,
> + htt->frag_desc.paddr);
> +}
> +
> +static int ath10k_htt_tx_alloc_cont_frag_desc(struct ath10k_htt *htt)
> +{
> + struct ath10k *ar = htt->ar;
> + size_t size;
> +
> + if (!ar->hw_params.continuous_frag_desc)
> + return 0;
> +
> + size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc);
> + htt->frag_desc.vaddr = dma_alloc_coherent(ar->dev, size,
> + &htt->frag_desc.paddr,
> + GFP_DMA);
Did you mean to change GFP_KERNEL to GFP_DMA?
> - size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc);
> - htt->frag_desc.vaddr = dma_alloc_coherent(ar->dev, size,
> - &htt->frag_desc.paddr,
> - GFP_KERNEL);
> - if (!htt->frag_desc.vaddr) {
> - ath10k_warn(ar, "failed to alloc fragment desc memory\n");
> - ret = -ENOMEM;
> + ret = ath10k_htt_tx_alloc_cont_frag_desc(htt);
> + if (ret) {
> + ath10k_err(ar, "failed to alloc cont frag desc: %d\n", ret);
> goto free_txbuf;
> }
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2016-01-20 19:34 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-13 14:01 [PATCH 0/5] ath10k: add basic hostq support Michal Kazior
2016-01-13 14:01 ` Michal Kazior
2016-01-13 14:01 ` [PATCH 1/5] ath10k: rename some HTT events Michal Kazior
2016-01-13 14:01 ` Michal Kazior
2016-01-13 14:01 ` [PATCH 2/5] ath10k: add new htt definitions Michal Kazior
2016-01-13 14:01 ` Michal Kazior
2016-01-13 14:01 ` [PATCH 3/5] ath10k: add new FW_FEATURE_PEER_FLOW_CONTROL Michal Kazior
2016-01-13 14:01 ` Michal Kazior
2016-01-13 14:01 ` [PATCH 4/5] ath10k: clean up cont frag desc init code Michal Kazior
2016-01-13 14:01 ` Michal Kazior
2016-01-20 19:34 ` Ben Greear [this message]
2016-01-20 19:34 ` Ben Greear
2016-01-21 6:01 ` Michal Kazior
2016-01-21 6:01 ` Michal Kazior
2016-01-13 14:01 ` [PATCH 5/5] ath10k: implement basic support for new tx path firmware Michal Kazior
2016-01-13 14:01 ` Michal Kazior
2016-01-21 13:13 ` [PATCH 0/5] ath10k: add basic hostq support Michal Kazior
2016-01-21 13:13 ` Michal Kazior
2016-01-21 13:13 ` [PATCH 1/5] ath10k: rename some HTT events Michal Kazior
2016-01-21 13:13 ` Michal Kazior
2016-01-21 13:13 ` [PATCH 2/5] ath10k: add new htt definitions Michal Kazior
2016-01-21 13:13 ` Michal Kazior
2016-01-21 13:13 ` [PATCH 3/5] ath10k: add new FW_FEATURE_PEER_FLOW_CONTROL Michal Kazior
2016-01-21 13:13 ` Michal Kazior
2016-01-21 13:13 ` [PATCH 4/5] ath10k: clean up cont frag desc init code Michal Kazior
2016-01-21 13:13 ` Michal Kazior
2016-01-21 13:13 ` [PATCH 5/5] ath10k: implement basic support for new tx path firmware Michal Kazior
2016-01-21 13:13 ` Michal Kazior
2016-01-21 13:24 ` [PATCH 0/5] ath10k: add basic hostq support Michal Kazior
2016-01-21 13:24 ` Michal Kazior
2016-02-02 11:19 ` Kalle Valo
2016-02-02 11:19 ` Kalle Valo
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=569FE132.7040006@candelatech.com \
--to=greearb@candelatech.com \
--cc=ath10k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=michal.kazior@tieto.com \
/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.