From patchwork Sat Sep 30 17:37:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: silexcommon@gmail.com X-Patchwork-Id: 9979547 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 6B9B36034B for ; Sat, 30 Sep 2017 17:38:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55C1628500 for ; Sat, 30 Sep 2017 17:38:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AD7F28E1F; Sat, 30 Sep 2017 17:38:41 +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, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham 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 CADEC28500 for ; Sat, 30 Sep 2017 17:38:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752157AbdI3Rij (ORCPT ); Sat, 30 Sep 2017 13:38:39 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:37201 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751883AbdI3Rih (ORCPT ); Sat, 30 Sep 2017 13:38:37 -0400 Received: by mail-pg0-f66.google.com with SMTP id o1so540136pga.4 for ; Sat, 30 Sep 2017 10:38:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HFmrmHzGR//rorUoOCeWqZrAn941pJoFNy+d5DhbNew=; b=OAMo5l8z4sRo9qnDsXO2+nUMLcmhWRt5DPMw5QWTKouYTG8t5PMlRB3PAMUEc70hKJ Wx2Uf4oxymKe7DCbcrGgUqYq2T7Nz81NIlNWclPVM34li/gPAfY/mZcNf23hXG/vKcPc WXOKjnLG5wDUTUGKZf/Upi4qHhabLjIxMnJ3Oq7AK0u+j8ZbuvnjgAqz2y8ufPhdUd3m wbk9eEjeuE434lYYs5o5atBmnIFD0Evmr02NpSPJhPNqYyBr8/DTKsnEf1hgOaq9yyvi 4asbTkV3ec/tSHYuGs6tT70qKA3ZJvAhQW8BbYHnNYINGKujGfIueSb/2AdFHyyNnErC ZWlw== 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=HFmrmHzGR//rorUoOCeWqZrAn941pJoFNy+d5DhbNew=; b=gJi6PZurHVPA2Abs1UxQC7MDuDNXsDzr5O6htZJlmMcXmdxugz1WKzOcb6JmTmapgd ePS2UvoC7YjLXnxmZy/zsrjL68Vm2NwktLwqJLNv18g2EJjDiKY/rPKdHvv8hAXzGXY+ MCX1dzfVtcowZ8ZeSXHgQM5WYc+kEVPu7e3Uuatgtj93VJofi2olB4/RuBfI+V6G5xcB 3mZq0v2v4/THj38ECr1J3wTEu1kSfdDvx3MPecZkwbz3Fw3Lxd96WcavOqo0JnWWfYJ3 UUFbmniTQuKedPIJDvaaw6Fdr9hz0UHyPOtlb5nK09G97rkbx+1vNIukUu8cYJfqK7eA ncbg== X-Gm-Message-State: AHPjjUj4Wvk9s/sHhaOTrF6Az+Jyk5/Gk/+2DGrhzjIxByatNyy+BBfs WO86Gzes3IlQRtP+kxPqV8I= X-Google-Smtp-Source: AOwi7QARy7IP81YOHRXMFNNCzrFnKs4qW1y/NdiUoztkv+WT+TOysu2tu6KrFDigxjvk+oKBRajyCw== X-Received: by 10.98.166.10 with SMTP id t10mr10814399pfe.181.1506793116773; Sat, 30 Sep 2017 10:38:36 -0700 (PDT) Received: from localhost.localdomain ([171.60.245.167]) by smtp.gmail.com with ESMTPSA id q15sm11197640pgc.64.2017.09.30.10.38.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Sep 2017 10:38:36 -0700 (PDT) From: silexcommon@gmail.com X-Google-Original-From: alagusankar@silex-india.com To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Alagu Sankar Subject: [PATCH 05/11] ath10k_sdio: use clean packet headers Date: Sat, 30 Sep 2017 23:07:42 +0530 Message-Id: <1506793068-27445-6-git-send-email-alagusankar@silex-india.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506793068-27445-1-git-send-email-alagusankar@silex-india.com> References: <1506793068-27445-1-git-send-email-alagusankar@silex-india.com> 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 From: Alagu Sankar HTC header carries junk values that may be interpreted by the firmware differently. Enable credit update only if flow control is enabled for the corresponding endpoint. PLL clock setting sequence does not mask the PLL_CONTROL register value. Side effect of not masking the values is not known as the entire pll clock setting sequence is undocumented. Signed-off-by: Alagu Sankar --- drivers/net/wireless/ath/ath10k/htc.c | 4 +++- drivers/net/wireless/ath/ath10k/hw.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c index 75c2a3e..23e7216 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c @@ -84,11 +84,13 @@ static void ath10k_htc_prepare_tx_skb(struct ath10k_htc_ep *ep, struct ath10k_htc_hdr *hdr; hdr = (struct ath10k_htc_hdr *)skb->data; + memset(hdr, 0, sizeof(struct ath10k_htc_hdr)); hdr->eid = ep->eid; hdr->len = __cpu_to_le16(skb->len - sizeof(*hdr)); hdr->flags = 0; - hdr->flags |= ATH10K_HTC_FLAG_NEED_CREDIT_UPDATE; + if (ep->tx_credit_flow_enabled) + hdr->flags |= ATH10K_HTC_FLAG_NEED_CREDIT_UPDATE; spin_lock_bh(&ep->htc->tx_lock); hdr->seq_no = ep->seq_no++; diff --git a/drivers/net/wireless/ath/ath10k/hw.c b/drivers/net/wireless/ath/ath10k/hw.c index 07df7c6..2092392 100644 --- a/drivers/net/wireless/ath/ath10k/hw.c +++ b/drivers/net/wireless/ath/ath10k/hw.c @@ -812,6 +812,8 @@ static int ath10k_hw_qca6174_enable_pll_clock(struct ath10k *ar) if (ret) return -EINVAL; + reg_val &= ~(WLAN_PLL_CONTROL_REFDIV_MASK | WLAN_PLL_CONTROL_DIV_MASK | + WLAN_PLL_CONTROL_NOPWD_MASK); reg_val |= (SM(hw_clk->refdiv, WLAN_PLL_CONTROL_REFDIV) | SM(hw_clk->div, WLAN_PLL_CONTROL_DIV) | SM(1, WLAN_PLL_CONTROL_NOPWD));