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: 9532693 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 A6D6160434 for ; Mon, 23 Jan 2017 15:06:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F43528346 for ; Mon, 23 Jan 2017 15:06:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9251A28416; Mon, 23 Jan 2017 15:06:22 +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=-1.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4452728346 for ; Mon, 23 Jan 2017 15:06:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cVgCG-0004la-Jj; Mon, 23 Jan 2017 15:06:16 +0000 Received: from mail-wm0-f43.google.com ([74.125.82.43]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cVgC9-0004ev-Da for ath10k@lists.infradead.org; Mon, 23 Jan 2017 15:06:12 +0000 Received: by mail-wm0-f43.google.com with SMTP id c85so136841763wmi.1 for ; Mon, 23 Jan 2017 07:05: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=Ju5mHlt+3QBY8KuuHHL/gA9MG7OGaGwhuBgQ/1FzZI88xaJhLvYW6rlYLawjCBc3dL OyvbiFFUKp2g95ear4WfJ0aDlBy0SFCYHZJX4ziipPBGQHGZEMZGZv4sytmGGMisn0uS eyS5Z5zxQL4oYwwgizCArAv047cjx+Xh0fjjtoZwc57hg5lF3p6cWGkqVWvpYyWSStoL EnkNd7lNuc41AZbW/v31thrj4T7Z43diD8WCUpYh41ey1NdUoHUflSPvTwpxG7lzVeRj JQPSX2IeM+r8s/fD13E0JRh1ltoU0xCh8m0Nog/oTxXkDaGH2kSGmxnc/Fk7dGjHFhHk QxRQ== X-Gm-Message-State: AIkVDXJvqP/laoO8XpxjDImqml4tKPpSWZFzwgZfbDGzOr3jbUrLvjlW+8E8i5Zudh7r9Uo7 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170123_070609_618425_3FDB5EDB X-CRM114-Status: UNSURE ( 7.99 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Srinivas Kandagatla , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, ath10k@lists.infradead.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.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;