From patchwork Mon Jan 23 15:04:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 9532697 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E1247604A0 for ; Mon, 23 Jan 2017 15:06:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9C9328346 for ; Mon, 23 Jan 2017 15:06:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE6622841D; Mon, 23 Jan 2017 15:06:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8939128356 for ; Mon, 23 Jan 2017 15:06:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751081AbdAWPF0 (ORCPT ); Mon, 23 Jan 2017 10:05:26 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35093 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750742AbdAWPFX (ORCPT ); Mon, 23 Jan 2017 10:05:23 -0500 Received: by mail-wm0-f46.google.com with SMTP id r126so137250487wmr.0 for ; Mon, 23 Jan 2017 07:04:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Kg1hNeYt5uWFJSfip8Xf7pIjBFqePcSgSoCA97ItHjI=; b=I7A3GSElgkiksdZpLj8ASWFiipyZHbR6JFOekcXTKgb62peVjd2zHE3SJkfaS9wAf6 P+zBaAdpNMbgbHZPNs5yBNH6+l+cuGlZr5+VA0DKOPuqPBfUzVkSuor+TO54fv+Ruwjl JjDRqdf2WlOFUiXwvZKN0gLV6SH7v7T35HCG4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Kg1hNeYt5uWFJSfip8Xf7pIjBFqePcSgSoCA97ItHjI=; b=moJbjxWBw2UcIfi3rNMhkl8AQaW/XU1dLv9dhIFp2LJv57k+qit8//UdevQjW+i3Uw bov4eRf21aPPymTcFbvno+kLuq3lmDe3i+y4WhAp/fqNfPL81iUfd/uy24gB+VRpbagb 8Zl2a1Mwlr8+MVLi9qjzTtkDmt8pWPELtX091oShq9mwDWHd/k8f3uHw/m/Gxt6+Snyf 1m3nq1UfeZnBihjwBGLKLJpWpinjgaAGvwzKB+oNQI/TqWEZSWu+inDn0bZTQfHndLFY lalDUV8gq12SVPS8qmBqTY/VlMyPQMk4QuXXzQ64QOAGPvCzCCAoo7h5jt/fPznR6d+x pD0Q== X-Gm-Message-State: AIkVDXKLekPx5faJ63CnI/jqcVwtUIs5OYTkzrY4hXNPjy8QaD15dEW/UOiUewdkpI1hsr3Z X-Received: by 10.28.148.76 with SMTP id w73mr14534147wmd.74.1485183886152; Mon, 23 Jan 2017 07:04:46 -0800 (PST) Received: from localhost.localdomain (host-2-98-105-38.as13285.net. [2.98.105.38]) by smtp.gmail.com with ESMTPSA id k43sm15085354wrc.46.2017.01.23.07.04.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Jan 2017 07:04:45 -0800 (PST) From: Srinivas Kandagatla To: Kalle Valo Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 2/3] ath10k: use dma_zalloc_coherent() Date: Mon, 23 Jan 2017 15:04:35 +0000 Message-Id: <1485183876-27080-2-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485183876-27080-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1485183876-27080-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP use dma_zalloc_coherent() instead of dma_alloc_coherent and memset(). Signed-off-by: Srinivas Kandagatla --- drivers/net/wireless/ath/ath10k/ce.c | 9 +-------- drivers/net/wireless/ath/ath10k/pci.c | 3 +-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c index 0b4d796..c2b388f 100644 --- a/drivers/net/wireless/ath/ath10k/ce.c +++ b/drivers/net/wireless/ath/ath10k/ce.c @@ -958,7 +958,7 @@ ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id, * coherent DMA are unsupported */ dest_ring->base_addr_owner_space_unaligned = - dma_alloc_coherent(ar->dev, + dma_zalloc_coherent(ar->dev, (nentries * sizeof(struct ce_desc) + CE_DESC_RING_ALIGN), &base_addr, GFP_KERNEL); @@ -969,13 +969,6 @@ ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id, dest_ring->base_addr_ce_space_unaligned = base_addr; - /* - * Correctly initialize memory to 0 to prevent garbage - * data crashing system when download firmware - */ - memset(dest_ring->base_addr_owner_space_unaligned, 0, - nentries * sizeof(struct ce_desc) + CE_DESC_RING_ALIGN); - dest_ring->base_addr_owner_space = PTR_ALIGN( dest_ring->base_addr_owner_space_unaligned, CE_DESC_RING_ALIGN); diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index b541a1c..855e3de 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -896,7 +896,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data, */ alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT); - data_buf = (unsigned char *)dma_alloc_coherent(ar->dev, + data_buf = (unsigned char *)dma_zalloc_coherent(ar->dev, alloc_nbytes, &ce_data_base, GFP_ATOMIC); @@ -905,7 +905,6 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data, ret = -ENOMEM; goto done; } - memset(data_buf, 0, alloc_nbytes); remaining_bytes = nbytes; ce_data = ce_data_base;