From patchwork Fri Mar 22 18:58:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom Psyborg X-Patchwork-Id: 10866417 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-2.web.codeaurora.org (Postfix) with ESMTP id 505971515 for ; Fri, 22 Mar 2019 18:59:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39F482A9AC for ; Fri, 22 Mar 2019 18:59:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B6202A9AE; Fri, 22 Mar 2019 18:59:06 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 C81842A9AC for ; Fri, 22 Mar 2019 18:59:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727000AbfCVS7E (ORCPT ); Fri, 22 Mar 2019 14:59:04 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41907 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726073AbfCVS7E (ORCPT ); Fri, 22 Mar 2019 14:59:04 -0400 Received: by mail-wr1-f67.google.com with SMTP id p1so3461450wrs.8 for ; Fri, 22 Mar 2019 11:59:03 -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:mime-version :content-transfer-encoding; bh=qcdSnDTSowJzKfOwTYCbaCs2fE9AmMZzQfDyywO/xLw=; b=NPez2YT05c+LAyKtsD5fnfFI/mIFI1Qak+nnBw2ol2GyUabLMFOyDsoDFzz6ZJ2R2A URsx8EXO9gl/AxE7QKgkP+9f+E6CWBt2JA9jVZoDgQ4gzFkjfUS9z1/y5Uf3zIdp/aVo DLa6H5M7Q1NxSmwHsFNqRBhOYRgS65JQzl1mjevaf5NC1Hbqq4Bay6mir0IGHyXgRNKU vbPqHFAQOraL4GiwlywsBYVTRHWrPe5SIKq724v3fTJMK3fmU2tLYiXj5jrSAlpGReEr jcS7WG0p9TwD28TPWvwIb20bxVH82UC4lRp2svfZit95BPcWxGwf2hnJTqKCSCAOKDE1 +qKw== 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:mime-version :content-transfer-encoding; bh=qcdSnDTSowJzKfOwTYCbaCs2fE9AmMZzQfDyywO/xLw=; b=Uh+INCiqVVobx7el5whQ/wk79o6CU1wVEkmGUUWF0Ym60x+QSyp1B+AMf0m3QwTlA8 8VxyiZIBl2SDfVzH8ih0KTxofE680trzlSDhB9DwBtpxox+A3O8Q3D/qoL/nzMKx+dGx XDUvGMqGeyfra3BQpwmfKtEeuRiH0+Et8Xo9+y3fD4+u9wAbBcy1kEeNwssrdvDhwiRA xe0q340Wa/gDDXQWa6dA7Ur2bI3sgGdMEm+DDSaqIe5DqWFveZhZLwFaiVIxuVf0WyKH 6ovEi8SnGQ7hgsPTLh63EhEzdsYKukZkM5tJHzd5ZJl8HGVFck47o4cg6C+8XL8lxqRJ ujEg== X-Gm-Message-State: APjAAAUzUH51CA6ON+NcYF6W5m0Een8j0h7ZXy3yzkVBkgDoItCaS+Nn BSJWHgnSDT1mxPhH1jXm4kRdyHe5 X-Google-Smtp-Source: APXvYqwgCeaRUDs7BbJK/fjqLAz5OM3F1SPYifNUgUYFFghOFRoPDKSfheEreO4C6kJQ1hGnkaXViQ== X-Received: by 2002:adf:f80d:: with SMTP id s13mr6608311wrp.38.1553281142741; Fri, 22 Mar 2019 11:59:02 -0700 (PDT) Received: from localhost.localdomain ([31.147.208.18]) by smtp.googlemail.com with ESMTPSA id o8sm6963126wmh.11.2019.03.22.11.59.01 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 22 Mar 2019 11:59:02 -0700 (PDT) From: =?utf-8?q?Tomislav_Po=C5=BEega?= To: linux-wireless@vger.kernel.org Cc: openwrt-devel@lists.openwrt.org Subject: [PATCH] ath10k: reset chip after supported check Date: Fri, 22 Mar 2019 19:58:40 +0100 Message-Id: <1553281120-22139-1-git-send-email-pozega.tomislav@gmail.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 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 When chip reset is done before the chip is checked if supported there will be crash. Previous behaviour caused bootloops on Archer C7 v1 units, this patch allows clean device boot without excluding ath10k driver. Signed-off-by: Tomislav Požega Signed-off-by: Michal Kazior Signed-off-by: Kalle Valo Signed-off-by: Michal Kazior Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/pci.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index e24403c..ec681da 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -3619,12 +3619,6 @@ static int ath10k_pci_probe(struct pci_dev *pdev, goto err_deinit_irq; } - ret = ath10k_pci_chip_reset(ar); - if (ret) { - ath10k_err(ar, "failed to reset chip: %d\n", ret); - goto err_free_irq; - } - bus_params.dev_type = ATH10K_DEV_TYPE_LL; bus_params.link_can_suspend = true; bus_params.chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS); @@ -3639,6 +3633,12 @@ static int ath10k_pci_probe(struct pci_dev *pdev, goto err_free_irq; } + ret = ath10k_pci_chip_reset(ar); + if (ret) { + ath10k_err(ar, "failed to reset chip: %d\n", ret); + goto err_free_irq; + } + ret = ath10k_core_register(ar, &bus_params); if (ret) { ath10k_err(ar, "failed to register driver core: %d\n", ret);