From patchwork Thu Feb 21 16:21:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 10824327 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E35FC1399 for ; Thu, 21 Feb 2019 16:22:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDD29319CA for ; Thu, 21 Feb 2019 16:22:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBC7E319DC; Thu, 21 Feb 2019 16:22:09 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 76A5E319DF for ; Thu, 21 Feb 2019 16:22:09 +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=KRLaXdzrykU2xj+OWdsPw3VIRN7vmRVSnzzGCENLpTU=; b=PZCJJj25rSfp6WRwutHXTiBwBJ S7Mpi4S5TcPnE5hrKLOS9cVILd4zCgOqtX96aCu0x33bl2OkkdU+gIRAu8akfFIL/l52mUtk+zuH6 NCPKWo3wo2U+6yPt485nF+Arav0vUOAqIFxH/zmS2CIOQ5yk7xuXdCs8ZRj+hgczSaj3O3yg+N76E YpOo+3wOHzCe3JfUhAk+sd4fzTy9RtE7rqgfgI/O8BPgxc2hKyl3DqSQFDmd/VltCmNKnzQ/Y4xd1 BLBYw9WEfyo3tLqbpkyIg0SxxlWrcSb3f6NbyftBLXjyViaCwPKHH4vgf60NDmUI5809cT9uKdndE 8bC9b3LQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gwr6u-0002BH-I8; Thu, 21 Feb 2019 16:22:08 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gwr6r-0002Af-VS for ath10k@lists.infradead.org; Thu, 21 Feb 2019 16:22:07 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5829060EE8; Thu, 21 Feb 2019 16:22:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550766125; bh=x6mbtZLchhAtSgSgjExPChUEXfr4Yx6kSSB2wPccl50=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VKY8T1JGGQ+id/sBX3erarGKYR4lrRGKGgzspDNBJ3MMup2ki0DXCNcHxn6y5jrfo TyO2vWdFoUtsMGcJaYMI1nexpTwPYJOqOk21MvoXVSy6jqMVMYAq/+NsgHY5w0HerP cJ6bNxTTaVbXn95H7oXjafuYii9S36dwErAL90Eo= Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 91CBA60EC1; Thu, 21 Feb 2019 16:22:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550766124; bh=x6mbtZLchhAtSgSgjExPChUEXfr4Yx6kSSB2wPccl50=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PNdtqHKPgBy2C+Nqmu5f3gzo6bW7NCv4NH/zHAAOytuYC6MdkrLTb63HthNX3cmjA AprHaKPhiAjcJF6CQfh64PC0/jLZ7JqlIP8wnfuAB2122MDS7EWxrxQLfdlgg+amHF UGsfnB7PS+cYt/BXMABMKdk8NUh5GFEtYRfr9QVI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 91CBA60EC1 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: ath10k@lists.infradead.org Subject: [PATCH 1/4] ath10k: sdio: set hi_acs_flags Date: Thu, 21 Feb 2019 18:21:55 +0200 Message-Id: <1550766118-31703-2-git-send-email-kvalo@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550766118-31703-1-git-send-email-kvalo@codeaurora.org> References: <1550766118-31703-1-git-send-email-kvalo@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190221_082206_024573_5ECDBD61 X-CRM114-Status: GOOD ( 10.82 ) 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, Wen Gong 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 The SDIO firmware does not allow transmitting packets with the reduced tx completion HI_ACS option. SDIO firmware uses 1544 as alternate credit size, which is not big enough for the maximum sized mac80211 frames. Disable both these HI_ACS flags for SDIO. Co-developed-by: Wen Gong Signed-off-by: Alagu Sankar Signed-off-by: Wen Gong Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/core.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index ac2cf3f1c7b4..0c62a61b5eac 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -637,10 +637,16 @@ static void ath10k_init_sdio(struct ath10k *ar) ath10k_bmi_write32(ar, hi_mbox_isr_yield_limit, 99); ath10k_bmi_read32(ar, hi_acs_flags, ¶m); - param |= (HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET | - HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET | - HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE); + /* Data transfer is not initiated, when reduced Tx completion + * is used for SDIO. disable it until fixed + */ + param &= ~HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET; + /* Alternate credit size of 1544 as used by SDIO firmware is + * not big enough for mac80211 / native wifi frames. disable it + */ + param &= ~HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE; + param |= HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET; ath10k_bmi_write32(ar, hi_acs_flags, param); } From patchwork Thu Feb 21 16:21:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 10824337 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B9881399 for ; Thu, 21 Feb 2019 16:22:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86D9231998 for ; Thu, 21 Feb 2019 16:22:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84DBA319D2; Thu, 21 Feb 2019 16:22:15 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 30ADD319D9 for ; Thu, 21 Feb 2019 16:22:15 +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=LtDtJPc7G+zy65Cs2anpAhkQP1gTtmKtyswYrJlbGXM=; b=oSk2GmStkSmY61wxd4q2WxYj8S /YPgINRv+H0bYNvckRylLhdtvECHXd4yadbU/8BFAJzVJEZ/hUch5DFyynvl/MNz+1qvgjsEkSjPb Lgelru82zoJ13aeYG0V3lZf20c7GsS1qgv2Pk9SSwvj1OwOGb7A2dPMBgpldFdv0rZR2l3wVNfivG xg9uVmbU1hjUNpD5RlR5WOxpI3JvoXLYMgcQfb0YpT37vz8SI2CL3gkcPVjYlXPzrFbyFIPxheuYE Qrgf07onE/RMVjYQo4+sYgu1k7+qpuG6IUOwQBsINRqUfuTWkN3L3CvTGxV45WRZjwOh64NkC7HGa +zYWV41A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gwr6z-0002HB-CI; Thu, 21 Feb 2019 16:22:13 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gwr6t-0002Aw-0F for ath10k@lists.infradead.org; Thu, 21 Feb 2019 16:22:08 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 626F560F32; Thu, 21 Feb 2019 16:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550766126; bh=Aa/WMHHzXxuVrhxwrUzH4oZfZhzhOm9of7SGso60Otw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UY976z24LrCgUgTR1xnin72RXBua8ZYntwKb+3FY5+xcSbTz3mk8IZ+JMFYh6kBQU Tmn+bMZugmRTYlGcEBra0quSGuFYm/FvQeLsMQd0pDj5amLGGca8WzauaGQwJka5E2 J18f6VNg5YDwCtB4r9imX/LnMGOAbv//Uj8u2OpY= Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8716560C04; Thu, 21 Feb 2019 16:22:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550766125; bh=Aa/WMHHzXxuVrhxwrUzH4oZfZhzhOm9of7SGso60Otw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b1lyMzWoABo1byK6y6SENS5Ree4uk53sws8dDUudAlsOwKBx2Futv2j2gFjiIODMo bk78VlvXK2yGPDNeVQ4TgCTxUPHxtjuGiTFsgf75DG65tZwupKP+u10TgF/OrSvYMD BxiptBwe2DrstAG+TtNsgjo/oYgW5pHzvoI+jpg0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8716560C04 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: ath10k@lists.infradead.org Subject: [PATCH 2/4] ath10k: sdio: disable fwlog prints Date: Thu, 21 Feb 2019 18:21:56 +0200 Message-Id: <1550766118-31703-3-git-send-email-kvalo@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550766118-31703-1-git-send-email-kvalo@codeaurora.org> References: <1550766118-31703-1-git-send-email-kvalo@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190221_082207_065858_FB556FF2 X-CRM114-Status: UNSURE ( 9.42 ) 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: Alagu Sankar , linux-wireless@vger.kernel.org, Wen Gong 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 The SDIO firmware may turn it on based on scratch registers so disable the firmware log to avoid that. Co-developed-by: Wen Gong Signed-off-by: Alagu Sankar Signed-off-by: Wen Gong Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 0c62a61b5eac..7ccd6741c5b0 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -648,6 +648,13 @@ static void ath10k_init_sdio(struct ath10k *ar) param &= ~HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE; param |= HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET; ath10k_bmi_write32(ar, hi_acs_flags, param); + + /* Explicitly set fwlog prints to zero as target may turn it on + * based on scratch registers. + */ + ath10k_bmi_read32(ar, hi_option_flag, ¶m); + param |= HI_OPTION_DISABLE_DBGLOG; + ath10k_bmi_write32(ar, hi_option_flag, param); } static int ath10k_init_configure_target(struct ath10k *ar) From patchwork Thu Feb 21 16:21:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 10824339 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB7881399 for ; Thu, 21 Feb 2019 16:22:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B44F8319AF for ; Thu, 21 Feb 2019 16:22:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B255E319E3; Thu, 21 Feb 2019 16:22:18 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 5AF89319AF for ; Thu, 21 Feb 2019 16:22:18 +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=brUu8fHK8N+/BdvugmqKrqPi8f1YDm2a3xhcAN1IzXQ=; b=QyHqOp8EoO6DbT3gikYkO5mQmF WcAmUKq2iFhK9MBUgJLujby/gMGFCsDsOXoa1btZnRE45a707mzD7oKbgxnu7V6Wuejz8l6PKnZkJ UO5jYyO21a17NjHvs+U09J6j8SvD6fS8xXrBQFxmWqzitqsDYBzRkRVb+zIFs+dQeIW0MsMPKYpuV vwE5rcrYCdcPsCq9ltHQLI1YbVZgvqlbNfcGExkfo90WFJkzO1DL7+PqabyPQ7JBmao+bFNRAOpY+ 6AuJLvUIv1m/QYovz3Ym7uUz370ogaECEAYvn5ro0fTvu19SCjr2vcuSn57z8ywja46gisQrvnFYy gJ6sitMA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gwr72-0002MG-Vo; Thu, 21 Feb 2019 16:22:17 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gwr6v-0002By-AS for ath10k@lists.infradead.org; Thu, 21 Feb 2019 16:22:12 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BF0A560F5E; Thu, 21 Feb 2019 16:22:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550766129; bh=DDs6j/F8yOv6tSIvgbDGoBA8/v5XDogrxOMJI3Vq3IU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iYQpX4n+n4GwMYotrGUq8VShQHDvDNot8YjfoRL6aR1GIIWBXw7bqgZ7+IkYy2VsA QVkPkC5FrqaOSvLeD0pm/dAxR5dFuzCBFI+th2OBE91TWhc1G2e+HNFWy0r7LBZIFl 2Ss6V0Kd8adYefeNKJ7TuKyRiEGTyF7IHomhYrT0= Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5FC9360F2F; Thu, 21 Feb 2019 16:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550766127; bh=DDs6j/F8yOv6tSIvgbDGoBA8/v5XDogrxOMJI3Vq3IU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KXqHF0yB1TEvgJ7QMeUnLY1wdGWZfoDfoNSPtZGvGQrX16uMObk9ydTBMS3MX/5mC dDL0A6TY0CN4mROX+CHmaU7IJFMUd8ovcB/uOGc8eSJ7BWeLRRNOA2haSyr7BB5PqO k7t0u4oCl7tAPFnnWqsURoZfP6W/6tnGK0f3D9To= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5FC9360F2F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: ath10k@lists.infradead.org Subject: [PATCH 3/4] ath10k: sdio: reset chip on power_down() Date: Thu, 21 Feb 2019 18:21:57 +0200 Message-Id: <1550766118-31703-4-git-send-email-kvalo@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550766118-31703-1-git-send-email-kvalo@codeaurora.org> References: <1550766118-31703-1-git-send-email-kvalo@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190221_082209_589261_E4CA9F03 X-CRM114-Status: GOOD ( 13.97 ) 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: linux-wireless@vger.kernel.org, Wen Gong 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: Wen Gong The target device needs to be reset during power_down(), otherwise only the first power_up() will work. And as ath10k calls power_up() during driver initialisation the driver would be otherwise unusable. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00005-QCARMSWP-1. Signed-off-by: Wen Gong Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/sdio.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index d62502f386f2..fae56c67766f 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -1382,6 +1382,12 @@ static int ath10k_sdio_hif_power_up(struct ath10k *ar, ath10k_dbg(ar, ATH10K_DBG_BOOT, "sdio power on\n"); + ret = ath10k_sdio_config(ar); + if (ret) { + ath10k_err(ar, "failed to config sdio: %d\n", ret); + return ret; + } + sdio_claim_host(func); ret = sdio_enable_func(func); @@ -1419,11 +1425,19 @@ static void ath10k_sdio_hif_power_down(struct ath10k *ar) /* Disable the card */ sdio_claim_host(ar_sdio->func); + ret = sdio_disable_func(ar_sdio->func); - sdio_release_host(ar_sdio->func); + if (ret) { + ath10k_warn(ar, "unable to disable sdio function: %d\n", ret); + sdio_release_host(ar_sdio->func); + return; + } + ret = mmc_hw_reset(ar_sdio->func->card->host); if (ret) - ath10k_warn(ar, "unable to disable sdio function: %d\n", ret); + ath10k_warn(ar, "unable to reset sdio: %d\n", ret); + + sdio_release_host(ar_sdio->func); ar_sdio->is_disabled = true; } @@ -2028,12 +2042,6 @@ static int ath10k_sdio_probe(struct sdio_func *func, ath10k_sdio_set_mbox_info(ar); - ret = ath10k_sdio_config(ar); - if (ret) { - ath10k_err(ar, "failed to config sdio: %d\n", ret); - goto err_free_wq; - } - bus_params.dev_type = ATH10K_DEV_TYPE_HL; /* TODO: don't know yet how to get chip_id with SDIO */ bus_params.chip_id = 0; From patchwork Thu Feb 21 16:21:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 10824341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D960A14E1 for ; Thu, 21 Feb 2019 16:22:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4C28319C2 for ; Thu, 21 Feb 2019 16:22:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3387319DE; Thu, 21 Feb 2019 16:22: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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 564AE319B5 for ; Thu, 21 Feb 2019 16:22:22 +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=/s1mhY1fdjLAXXC2CVGNLRd/P8Dr+NCKcbVm5bdeOSg=; b=mAxxccNcq51hb7OcSxbp8v7qLX SkjIjQbIw83+usAFqEcpP6A2xST+7gmeZmIbXbA+YLuqF+prQuEpl2iTbw9tFI5sUUNj63QDjLNrX zuysHh06ARqA/xsywCWTaEy9e7672pWJ3FP9MigzyVBWECSljkwVkDEYVoBoxY3AYviR3euUHLLDl 05m/V6GBhHFyZpHXIvIGqZY+dgzXPP0ZNGlqJZ5TyWGS+TdlwC0uJ7a55yz/yUItYarrOl9koBXad ZmYKrQVEF4bN6lWIrri3bF/s/Wy+pYHnSDJwU/+K0BLQkRo/68eUSnaucfBpeYSmsqKwacECFc83Q 821PHUSw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gwr76-0002RH-0w; Thu, 21 Feb 2019 16:22:20 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gwr6x-0002E9-5F for ath10k@lists.infradead.org; Thu, 21 Feb 2019 16:22:15 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8B43760F62; Thu, 21 Feb 2019 16:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550766130; bh=+GwZXD4xWjUcnuWSVQ8CBcuz6yezp42EyM9DZzoPnvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KCSaRXbe3nLLdYzF+hUsxIWCdWzPZqj1ZEDhrKgC7v1dW682RHinyEKBjZsw5qhrc wOx5LsW6LhKi6+CkcVZPLihT5rL4QQ0A1bJ1bJTShShX1Nro0sQmgE07sYJ2//W7h+ +UbO/BaWe6hZ55iLXxcYZdJh2S2YAB5uBKgJDUsY= Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1167260F40; Thu, 21 Feb 2019 16:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550766129; bh=+GwZXD4xWjUcnuWSVQ8CBcuz6yezp42EyM9DZzoPnvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MPixtv6eGoZffmefN73kbozXby6PABiUcU4GEJZYmLf2WbCMN0dSiZOwl0h9cAqlc CUQ7qYHZWPhQt+J0D5MX2fMYy1EmIE37Ptmv0oTnIYvNa9kIgdEbE+7icCCjl/NZxQ bJga742SVLmEjMsliRa+xjYBUD2Aoyb6ofPjCqWI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1167260F40 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: ath10k@lists.infradead.org Subject: [PATCH 4/4] ath10k: don't report unset rssi values to mac80211 Date: Thu, 21 Feb 2019 18:21:58 +0200 Message-Id: <1550766118-31703-5-git-send-email-kvalo@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550766118-31703-1-git-send-email-kvalo@codeaurora.org> References: <1550766118-31703-1-git-send-email-kvalo@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190221_082211_392977_41463ED8 X-CRM114-Status: GOOD ( 12.34 ) 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, Wen Gong 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 The SDIO firmware does not provide RSSI value to the host, it's only set to zero. In that case don't report the value to mac80211. One risk here is that value zero might be a valid value with other firmware, currently there's no way to detect that. Without the fix, the rssi value indicated by iw changes between the actual value and -95. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00005-QCARMSWP-1. Co-developed-by: Wen Gong Signed-off-by: Alagu Sankar Signed-off-by: Wen Gong Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/htt_rx.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 4fc885617de1..62479b037210 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2119,9 +2119,15 @@ static bool ath10k_htt_rx_proc_rx_ind_hl(struct ath10k_htt *htt, hdr = (struct ieee80211_hdr *)skb->data; rx_status = IEEE80211_SKB_RXCB(skb); rx_status->chains |= BIT(0); - rx_status->signal = ATH10K_DEFAULT_NOISE_FLOOR + - rx->ppdu.combined_rssi; - rx_status->flag &= ~RX_FLAG_NO_SIGNAL_VAL; + if (rx->ppdu.combined_rssi == 0) { + /* SDIO firmware does not provide signal */ + rx_status->signal = 0; + rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL; + } else { + rx_status->signal = ATH10K_DEFAULT_NOISE_FLOOR + + rx->ppdu.combined_rssi; + rx_status->flag &= ~RX_FLAG_NO_SIGNAL_VAL; + } spin_lock_bh(&ar->data_lock); ch = ar->scan_channel;