[From nobody Thu Jun 25 05:55:06 2020
Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543])
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
 id 1h7atJ-0007cS-MQ
 for openwrt-devel@lists.openwrt.org; Sat, 23 Mar 2019 07:16:32 +0000
Received: by mail-ed1-x543.google.com with SMTP id p20so3024617eds.6
 for &lt;openwrt-devel@lists.openwrt.org&gt;; Sat, 23 Mar 2019 00:16:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google;
 h=subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=tjzLOSP7QzZmuUDuBIBWuvZMCJc5VqvbmgpgaJVF4/8=;
 b=YPNaJGfyhR22Auto3X8qHVgbG2c5o597A8jhAT+PkrqoD6UZodenZN+JzYUYJf3R1i
 lHJ54pRYS1S1sOxF23Um0+9cbcvBkHlNPnhB3/JWMyy2p6WNqnIJpveYBoqLnxhyxc+K
 CGBdIA143eRFaMuNlFgATR14gLkoWExDnlbEw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:subject:to:cc:references:from:message-id:date
 :user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=tjzLOSP7QzZmuUDuBIBWuvZMCJc5VqvbmgpgaJVF4/8=;
 b=hWWaiD/YajvvS4suhGvqupmj3/JNIYQES98CljMv1692gLXLylaLDVsFBXqw0vnID/
 K4zBuQwEh8+mM6+C0EnxcJDSPeaSrBLIS/SGgY8iRA8QVPMxBW34mEmilkCZrJF01FI8
 yygY5+UwfXx/g8ay4HsOJ277F5RvTCJKako33eKuivW67azrSzJqFY2u7WbSGm5TJTD1
 URqLsq8OPujjDOjiE/krhWRG+AEnx+g6coGy9y6Ua9s4NbZAtJy2NnDKcGpUaBeQrT3u
 dpQ+6U2ZSNKbaR8I/OF6//igqum4l6TwhAL8X+rl7/Yf98luWNMmFZYxtR+OcNeJ5zFM
 BmdQ==
X-Gm-Message-State: APjAAAV0i9kZjy550+nAqcWSfBn2nmBnjVv2AEh7RGHgdcC8wJVV2Fot
 8hvd9zK1slN7/UzUisgYZf/seQ==
X-Google-Smtp-Source: APXvYqzkxNQ/6j/R5YItq4zmdUFUEbE1rNUNLEQDxl8XRyy8RjdEdIr3vpQH2RqYC0atrmwx7yPeZQ==
X-Received: by 2002:aa7:d9d2:: with SMTP id v18mr8972783eds.74.1553325386436; 
 Sat, 23 Mar 2019 00:16:26 -0700 (PDT)
Received: from [192.168.178.129] (f140230.upc-f.chello.nl. [80.56.140.230])
 by smtp.gmail.com with ESMTPSA id p16sm211357ejb.13.2019.03.23.00.16.25
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 23 Mar 2019 00:16:25 -0700 (PDT)
Subject: Re: [PATCH] ath10k: reset chip after supported check
To: Christian Lamparter &lt;chunkeey@gmail.com&gt;,
 =?UTF-8?Q?Tomislav_Po=c5=beega?= &lt;pozega.tomislav@gmail.com&gt;
Cc: linux-wireless@vger.kernel.org, openwrt-devel@lists.openwrt.org,
 kalle@codeaurora.org, =?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;
From: Arend Van Spriel &lt;arend.vanspriel@broadcom.com&gt;
Message-ID: &lt;fe853ec8-0dca-d931-8632-fbe4df5cfaf8@broadcom.com&gt;
Date: Sat, 23 Mar 2019 08:16:25 +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;3337086.qEUs9xMCTV@debian64&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_001629_735106_250DDE0E 
X-CRM114-Status: GOOD (  15.04  )
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:543 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

+ 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

]