From patchwork Mon Jan 23 15:04:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 92227 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1266642qgi; Mon, 23 Jan 2017 07:06:02 -0800 (PST) X-Received: by 10.84.237.22 with SMTP id s22mr2410087plk.145.1485183962473; Mon, 23 Jan 2017 07:06:02 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e21si15877482pgi.307.2017.01.23.07.06.02; Mon, 23 Jan 2017 07:06:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751216AbdAWPFa (ORCPT + 25 others); Mon, 23 Jan 2017 10:05:30 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:36707 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750732AbdAWPFX (ORCPT ); Mon, 23 Jan 2017 10:05:23 -0500 Received: by mail-wm0-f44.google.com with SMTP id c85so136841012wmi.1 for ; Mon, 23 Jan 2017 07:04:46 -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; bh=s8hqfjFVQ+jFrmcdGg63i78Dj8dhwQGvyL/A9Jgw1hk=; b=GaMVIZVp+mDuIngqXhx8CnvexG5QFbH9Zwk9HPCx4pqoquk2/JjJU56Xa1AGBdpX2C SiqCGAOhso6JDvCApji2uljO2xFnqMspBkGzHOBNZVeWSumftDwDC42vlQQtp7e/wU3k GqXt8zTfpvVcXUljHiVrAHkUSejg9XVPmKL5U= 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; bh=s8hqfjFVQ+jFrmcdGg63i78Dj8dhwQGvyL/A9Jgw1hk=; b=HRG/Xid3t6/MZNjkxN52mC3IKirDK7at9O1kUHGTooUbGvpJEvfme09OiMWdOlHdHj 8SUJa+GzgXMLWGOQMLiuHRVg3r7ZBus/kNZLyBZP+Mvle1deWVOqWJsvwsxVK8ZuoU1R moy28pyTPv7IKP+njXlUHw+OnZWUKMrw3nNSK3CmZt60e7aTD5w7wxBjomqSld5FAIkC p+/sA1iuB4tqOLEJ+pcmytF4hU1F0nE7NBH/yIW2mWBJxrSEgCPJnBLpfv8x3NkevCQJ 8+TZtoVcvuiT4nZTeYnBo0i96sh/GWvLxkDjVJa+WHpNSPrBDS7hA6kK3dbqVPPX9buk yg1w== X-Gm-Message-State: AIkVDXLGnk2av/oEhuVAixcYW84wyh/Vbwdng+sSAdw0p5cclIrun9qsZvSQRORaGQxzWqEG X-Received: by 10.223.148.230 with SMTP id 93mr22434775wrr.13.1485183885220; Mon, 23 Jan 2017 07:04:45 -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.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Jan 2017 07:04:43 -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 1/3] ath10k: remove multiple defines of DIAG_TRANSFER_LIMIT Date: Mon, 23 Jan 2017 15:04:34 +0000 Message-Id: <1485183876-27080-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DIAG_TRANSFER_LIMIT is redefined with same value and comments just below this entry, remove this duplicate entry. Signed-off-by: Srinivas Kandagatla --- drivers/net/wireless/ath/ath10k/pci.h | 5 ----- 1 file changed, 5 deletions(-) -- 2.10.1 diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h index 9854ad5..c76789d 100644 --- a/drivers/net/wireless/ath/ath10k/pci.h +++ b/drivers/net/wireless/ath/ath10k/pci.h @@ -25,11 +25,6 @@ #include "ahb.h" /* - * maximum number of bytes that can be handled atomically by DiagRead/DiagWrite - */ -#define DIAG_TRANSFER_LIMIT 2048 - -/* * maximum number of bytes that can be * handled atomically by DiagRead/DiagWrite */ 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: 92226 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1266353qgi; Mon, 23 Jan 2017 07:05:33 -0800 (PST) X-Received: by 10.84.248.10 with SMTP id p10mr43277723pll.87.1485183933454; Mon, 23 Jan 2017 07:05:33 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u24si15891712pfg.253.2017.01.23.07.05.33; Mon, 23 Jan 2017 07:05:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751269AbdAWPFb (ORCPT + 25 others); Mon, 23 Jan 2017 10:05:31 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:36961 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750756AbdAWPFX (ORCPT ); Mon, 23 Jan 2017 10:05:23 -0500 Received: by mail-wm0-f46.google.com with SMTP id c206so160019705wme.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=Td7sW3J6xkWq3z9JSKwPZiFwWFTEUGPw7MpYgVmwYRYal5HC0ZLYlnFKbI8D2vIJLR hAiR/xLV4/xnMd3SGxZ6C4OoFTEhj5on1KbBh9VsxhPApSAceDDgHFS3DD58BI98/azW uk9h8gapM9EwXVp01zTwjxdsy3h3PM84421CcpVfhodf7vZ6r6D+Pc/nMxonAVV9xkzN YxwMTOxmjPBeR+NKYr4T+FWaIA3Xw89L4HbdEcKsrmO5s7NT1hG9Q6Zo/O6Q++BhFGd1 vrtJnk6m9rVhYIRM1WwSyWAJiOWmaQLBHjoHLCqGwE4nN1M9Ztve9DXatp0WaVZWDDBu dsrQ== X-Gm-Message-State: AIkVDXINjL43Xdd0ZDsLS3ObPOfN/9vvTULzcm/RKLqX2tJ6naZ8E11xlwSizm8VzUj+bonx 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.10.1 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; From patchwork Mon Jan 23 15:04:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 92225 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1266328qgi; Mon, 23 Jan 2017 07:05:29 -0800 (PST) X-Received: by 10.84.210.8 with SMTP id z8mr43249866plh.94.1485183929564; Mon, 23 Jan 2017 07:05:29 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z86si15918193pfj.81.2017.01.23.07.05.29; Mon, 23 Jan 2017 07:05:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750828AbdAWPF1 (ORCPT + 5 others); Mon, 23 Jan 2017 10:05:27 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:35119 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750794AbdAWPFX (ORCPT ); Mon, 23 Jan 2017 10:05:23 -0500 Received: by mail-wm0-f53.google.com with SMTP id r126so137251671wmr.0 for ; Mon, 23 Jan 2017 07:04:48 -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=Rraz87RSPLbp31PpmazMgb78bpeKsURONTYzDf6T9+w=; b=UcuQEfuGvqwuQ3JLAdf0EZ/3he8aNxQoJDQTSuVoyr+8jxaWX3A3o8Dul3zzQz3tpK izxXGmh0ChCCL2mbNOdNCwXcXStcRgcJ321HYzoix5/sI+u4TDr0saMK9tKIuWu7ZKH8 xpUTT8uvs/AZ+Gc5PClBU2Y5nt6d/UZzgLmmA= 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=Rraz87RSPLbp31PpmazMgb78bpeKsURONTYzDf6T9+w=; b=dqqNgsUtzj1rWU7yRBbZALibZluoWmtI7K7LVpK9yzBGI0kkv+kfMEVPA3dwndwEvF p4c+vwTvAna2bXZv3xr4zThBK7s2ac1nV8bSXB7VWkVc0F5GXHm+nb8WSTzUA3Hpr03f 0Q2ErF9OqTKAMsJ9c0r4HmLsmM1DikJG70yJZI0W1kivk9VhpC6qetSGIB/+pztlopSl 6zNhrAYu3sdKno3o8mcfqFYBynPZ14hblX0G9T2VCtSUAtbQhxnebpYpXMPxJdcQSGI7 NXSwA8J4SU6Uslwy3OnmX7lq5sdC3wBbNQnWamQGwf8TQIiZOK1oLWuKi7tO+LFkupfa 3gOA== X-Gm-Message-State: AIkVDXKCU3xkl8/pJnIQRQ+OUhDMAQXeTwPl9Kaw1uy1LgoxquUZrriUNYAmgJr1aNm7EpTd X-Received: by 10.28.23.66 with SMTP id 63mr14674884wmx.46.1485183887553; Mon, 23 Jan 2017 07:04:47 -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.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Jan 2017 07:04:46 -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 3/3] ath10k: fix typo in addr calculation Date: Mon, 23 Jan 2017 15:04:36 +0000 Message-Id: <1485183876-27080-3-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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org CORE_CTRL_ADDRESS is offset in register address space, it does not make sense to OR it to derive the final address. It looks like its a typo, so fix it. Signed-off-by: Srinivas Kandagatla --- drivers/net/wireless/ath/ath10k/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.10.1 diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 855e3de..023ab10 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -1936,7 +1936,7 @@ static int ath10k_pci_wake_target_cpu(struct ath10k *ar) { u32 addr, val; - addr = SOC_CORE_BASE_ADDRESS | CORE_CTRL_ADDRESS; + addr = SOC_CORE_BASE_ADDRESS + CORE_CTRL_ADDRESS; val = ath10k_pci_read32(ar, addr); val |= CORE_CTRL_CPU_INTR_MASK; ath10k_pci_write32(ar, addr, val);