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: 9979569 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 B13896034B for ; Sat, 30 Sep 2017 17:39:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97B4528EF7 for ; Sat, 30 Sep 2017 17:39:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CC6A28EFE; Sat, 30 Sep 2017 17:39:23 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham 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 3F5F928EF7 for ; Sat, 30 Sep 2017 17:39:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Ky8LQHmBlRZvlWPQMRaAtDjWmn7GCMNgtxsTU9hHNNI=; b=OFQPzECqmCK9iF2J9v7kYEO5M9 iMSj99vGDC11stj2bGRqQYHclXf97nmedmgPaGufEPOfnUOYfYiBVGD5k7hk3akyy9FCno+doaWsH U/3ZUDAeqDvXbZBE2CO4AcN6GkddFl6kwLW8CPjdb7+5JIQWi4FHlL642UCIv5YB+GSI8fkwP0XhG Sm0d9eMEdzFC9O3bcWpJm0eXVWnwfWnn9Hv4LMKgOQzlfEAHtI9Y/hpbzo49xrMrSbGp4CVbWLHjE nfYPhItsRrPVED6BZZL3uTwILOLnqPFNx7vDrP1kseP3Klkz/18PQnXXX2UD5DTGe69AOaK/CsH8d SbmGT6Ow==; 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 1dyLjR-0001pD-HO; Sat, 30 Sep 2017 17:39:17 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dyLj7-0001Pb-H4 for ath10k@lists.infradead.org; Sat, 30 Sep 2017 17:39:03 +0000 Received: by mail-pg0-x244.google.com with SMTP id y192so1837329pgd.5 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=DLpuSBpIPpoE5W1Viy039Paj+Aalt2X27r3x5uldl3lSlVVr7PWRn5X2cNelvsqxK/ amb/wfCE/fxMqUIiLE2arRdycT8LitpRSP/pS1RiTw7cY4iDoq312liPHtV56cTW741t Apl74+6sVIxXWMBokpN7HpBoKp/WVdXxGHwEP7hU3LWwiZZUehF6EnRn2IpZ98NLb0Kw yGuoDUWRYcJWa/VCUwxXHtNqnJNly10WNRK8kc0wJ9OIe5nuf95tpoQZted/o5j3ZJhl vWYrlwBNfXtFujB4Q5V0/x40YTQjJQc3+bARN1KxKO44Yj5m2NZdGMRA7+fIFpSogs/u suqg== X-Gm-Message-State: AHPjjUgXjbd7P8Ql4U3FBVI3xPbL39uhFzpygfpod4NbYdVbeOUToc9I VBc57tzCXAQlHeNXX/jhJoJRBK6eu18= 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170930_103858_176230_D5F00F7C X-CRM114-Status: GOOD ( 10.10 ) 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: Alagu Sankar , linux-wireless@vger.kernel.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 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));