[From nobody Thu Jun 25 05:55:06 2020
Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544])
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
 id 1h7aws-0000sC-3M
 for openwrt-devel@lists.openwrt.org; Sat, 23 Mar 2019 07:20:11 +0000
Received: by mail-ed1-x544.google.com with SMTP id x14so853245eds.1
 for &lt;openwrt-devel@lists.openwrt.org&gt;; Sat, 23 Mar 2019 00:20:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google;
 h=subject:from:to:cc:references:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=sFVgfGhHpWfpMO6brJVUK+bYMbf2CpnViSGhcuPtNwU=;
 b=CbLLBghk3t1k9gCCIJswcQsarQ4OEVoWtIzmwOrfGMU4dM2qbfFidbjKjXiNV9id70
 QHX6J/8adY4wSJJHVfN7Qs906eDBtDGMZgR0Ju9ywTDJdUUpczE4UEfu1fchobv2mjF7
 1eUMlqHmUSIQFJcW7kuuu0IRsvSIsl/qWXSuw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:subject:from:to:cc:references:message-id:date
 :user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=sFVgfGhHpWfpMO6brJVUK+bYMbf2CpnViSGhcuPtNwU=;
 b=GeLHZ+7/T36OQgVHkAyuhKwvVVra5uKe02oMJJnJ0ZePlyDDY6uHZzN6Kb/XeRlZkU
 EHLqEMGvDJwjuPWL1EAkoFY0jJ5g/BVq/vgMGgznM2V10NxDNggeyOr/A0hk7aSugKyc
 drSXuYS3crVm6iM+WUxbgKvfapSSdzfK3Hwxs545+GEvz0zpdKOLCq6Jt0Y2rovGD1O4
 KkYRt6zQZaLZ6BX4lLI+yeWs38fYBTsOeJv7r6gVs6bOAdD+OiJteLSXJ/4O3thdcnw7
 pGtyA5hmTPECN2/N/f4ngAOme7jS+F4mXsdIfrd0GXWSerRK2Mmifg4PQnbvXcv6R4ez
 339g==
X-Gm-Message-State: APjAAAV2OR3Q+wMC93KXNdeamOORlpwKscbftK/obehA7tRbntJo3zrJ
 jI27JYvkc7+TtV3JhfkawegFwQ==
X-Google-Smtp-Source: APXvYqw6B+ha233J8H/7d796pKqRGtgwShT1+V7ymHxbEUYpAhc6h5IpcM+mf6H+wJov7OI2KDrrLA==
X-Received: by 2002:a50:9e61:: with SMTP id z88mr9302109ede.100.1553325608420; 
 Sat, 23 Mar 2019 00:20:08 -0700 (PDT)
Received: from [192.168.178.129] (f140230.upc-f.chello.nl. [80.56.140.230])
 by smtp.gmail.com with ESMTPSA id a2sm3246441eds.45.2019.03.23.00.20.07
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 23 Mar 2019 00:20:07 -0700 (PDT)
Subject: Re: [PATCH] ath10k: reset chip after supported check
From: Arend Van Spriel &lt;arend.vanspriel@broadcom.com&gt;
To: Christian Lamparter &lt;chunkeey@gmail.com&gt;,
 =?UTF-8?Q?Tomislav_Po=c5=beega?= &lt;pozega.tomislav@gmail.com&gt;
Cc: linux-wireless &lt;linux-wireless@vger.kernel.org&gt;,
 openwrt-devel@lists.openwrt.org, Kalle Valo &lt;kvalo@codeaurora.org&gt;,
 =?UTF-8?Q?Micha=c5=82_Kazior?= &lt;kazikcz@gmail.com&gt;
References: &lt;1553281120-22139-1-git-send-email-pozega.tomislav@gmail.com&gt;
 &lt;3337086.qEUs9xMCTV@debian64&gt;
 &lt;fe853ec8-0dca-d931-8632-fbe4df5cfaf8@broadcom.com&gt;
Message-ID: &lt;edc38f32-977a-53f5-babd-605775326a20@broadcom.com&gt;
Date: Sat, 23 Mar 2019 08:20:07 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101
 Thunderbird/60.5.3
MIME-Version: 1.0
In-Reply-To: &lt;fe853ec8-0dca-d931-8632-fbe4df5cfaf8@broadcom.com&gt;
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20190323_002010_144537_5C33ED03 
X-CRM114-Status: GOOD (  15.15  )
X-Spam-Score: -0.2 (/)
X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
 Content analysis details:   (-0.2 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2a00:1450:4864:20:0:0:0:544 listed in]
 [list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily
 valid
 -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from
 author's domain
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
 -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from
 envelope-from domain
 -0.0 DKIMWL_WL_HIGH         DKIMwl.org - Whitelisted High sender

* resending with corrected email address from Kalle
--------------------------------------------------------------------
+ Michał

On 3/22/2019 8:25 PM, Christian Lamparter wrote:
 &gt; On Friday, March 22, 2019 7:58:40 PM CET Tomislav Požega wrote:
 &gt;&gt; When chip reset is done before the chip is checked if supported
 &gt;&gt; there will be crash. Previous behaviour caused bootloops on
 &gt;&gt; Archer C7 v1 units, this patch allows clean device boot without
 &gt;&gt; excluding ath10k driver.
 &gt;&gt;
 &gt; You need
 &gt;
 &gt; Fixes: 1a7fecb766c8 (&quot;ath10k: reset chip before reading chip_id in 
probe&quot;)
 &gt;
 &gt; too

Looking at the commit subject makes me suspicious whether this is a 
proper fix.

 &gt;&gt; Signed-off-by: Tomislav Požega &lt;pozega.tomislav@gmail.com&gt;
 &gt;&gt; ---
 &gt;&gt;   drivers/net/wireless/ath/ath10k/pci.c |   12 ++++++------
 &gt;&gt;   1 files changed, 6 insertions(+), 6 deletions(-)
 &gt;&gt;
 &gt;&gt; diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
 &gt;&gt; index e24403c..ec681da 100644
 &gt;&gt; --- a/drivers/net/wireless/ath/ath10k/pci.c
 &gt;&gt; +++ b/drivers/net/wireless/ath/ath10k/pci.c
 &gt;&gt; @@ -3619,12 +3619,6 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
 &gt;&gt;   		goto err_deinit_irq;
 &gt;&gt;   	}
 &gt;&gt;
 &gt;&gt; -	ret = ath10k_pci_chip_reset(ar);
 &gt;&gt; -	if (ret) {
 &gt;&gt; -		ath10k_err(ar, &quot;failed to reset chip: %d\n&quot;, ret);
 &gt;&gt; -		goto err_free_irq;
 &gt;&gt; -	}
 &gt;&gt; -
 &gt;&gt;   	bus_params.dev_type = ATH10K_DEV_TYPE_LL;
 &gt;&gt;   	bus_params.link_can_suspend = true;
 &gt;&gt;   	bus_params.chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS);

It seems to me the chip reset was done explicitly *before* reading the 
chipid for a reason.

&quot;&quot;&quot;
ath10k: reset chip before reading chip_id in probe
There are some very rare cases with some hardware
configuration that the device doesn't init quickly
enough in which case reading chip_id yielded 0.
This caused driver to subsequently fail to setup
the device.

Signed-off-by: Michal Kazior &lt;michal.kazior@tieto.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@qca.qualcomm.com&gt;
&quot;&quot;&quot;

Might be the ath10k_pci_chip_reset() function needs to be modified to 
work properly for Archer C7 v1 units.

Regards,
Arend

]