From patchwork Sat Sep 7 23:18:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 11136721 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C76F176 for ; Sat, 7 Sep 2019 23:18:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7ED1021871 for ; Sat, 7 Sep 2019 23:18:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="crOpftYY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392978AbfIGXSW (ORCPT ); Sat, 7 Sep 2019 19:18:22 -0400 Received: from mail-wr1-f44.google.com ([209.85.221.44]:44584 "EHLO mail-wr1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727632AbfIGXSW (ORCPT ); Sat, 7 Sep 2019 19:18:22 -0400 Received: by mail-wr1-f44.google.com with SMTP id 30so9993935wrk.11; Sat, 07 Sep 2019 16:18:19 -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 :mime-version:content-transfer-encoding; bh=ho5rMqmvPV/b/YmpXToBzxMOBGjfEQyC6kp5sZH2O9g=; b=crOpftYYJyOpDkmIh1LJKrucBmKU57BKLnAB9toHsusLcFSwP6eZQCOWNOrWKy60UJ ZzzMUDtx42kYT/cbSJlIPQedR9JzrhwG9Ypb69UqBzY219eJyeUgrTLEweEeZ4Pnw8RW 4bvtXTUchFuYiB8fC42pv6QXbZ/Uop0nRpFo8wlFiDMKzcLGi3oBcbAWGxJcAHJqocI1 6VbaESA8/JYk5yP3CNhJfY4IOcyoIz/ksdAMeBu1m4c4fO4GU5OTqDaChEwUB9mB2cBP +W3oJf5mL2cL4sipthTAYinAwW+2rTUT+iIdLx3udeAVmsIzH5jJApsc8VZGKSm/Le7y pGiQ== 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:mime-version:content-transfer-encoding; bh=ho5rMqmvPV/b/YmpXToBzxMOBGjfEQyC6kp5sZH2O9g=; b=D3dMa2rSFpBRxtjYmkJEFoBDUZuos9zhQjaroz/aO66fEcoVCMy+QGiP3XPgKco/yK YfZSgjrTMp/88gLqR7zReR1M4+gC7iZw+dXVWgv+vaaMLrpnvsRL0fK5fiStfPsLd8QJ 91R6FUT9N7VnvN3eiJHMvSD8eFijs5QEI2uc8KR7Y6Q2JdeRgvdY+Ppp20ZEL5flAdhh yx5Ak9GUHQQjD2wvcR/ggNxhS8dGM/VAkQdpY83JTiikag5Jiuuihtet2tPpuhao26Lj EGo95Yf3CSZgift/xAueef6ajVkMXNZ6/cyLYzie8SHsLHaSIghXQjo9NJk6ahKeHaKe 4nbg== X-Gm-Message-State: APjAAAXi3PhyYlKT16r0dI72aS5KvcFZJ8ScWmxNEuZqK2qTwY4g5fcd XFRzGQcT1tohjQcIzNUnFx8= X-Google-Smtp-Source: APXvYqxhf+v1eBFCusMuONg6h8MDuROGxmo9w9eQTHdxd2yUSI3FQHDUGkBqlFjWwzwHp163qpj8iQ== X-Received: by 2002:adf:ef05:: with SMTP id e5mr12502866wro.127.1567898298181; Sat, 07 Sep 2019 16:18:18 -0700 (PDT) Received: from debian64.daheim (pD9E29DC7.dip0.t-ipconnect.de. [217.226.157.199]) by smtp.gmail.com with ESMTPSA id k9sm19185994wrd.7.2019.09.07.16.18.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2019 16:18:17 -0700 (PDT) Received: from localhost.daheim ([127.0.0.1] helo=debian64.localnet) by debian64.daheim with esmtp (Exim 4.92.1) (envelope-from ) id 1i6jyC-0007V1-HK; Sun, 08 Sep 2019 01:18:16 +0200 From: Christian Lamparter To: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, Sasha Levin Cc: Kalle Valo , stable@vger.kernel.org Subject: stable backports for "ath10k: restore QCA9880-AR1A (v1) detection" Date: Sun, 08 Sep 2019 01:18:13 +0200 Message-ID: <8482869.vuxnZITksI@debian64> In-Reply-To: <20190907214359.1C52A21835@mail.kernel.org> References: <20190906215423.23589-1-chunkeey@gmail.com> <20190907214359.1C52A21835@mail.kernel.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hello, On Saturday, September 7, 2019 11:43:58 PM CEST Sasha Levin wrote: > This commit has been processed because it contains a "Fixes:" tag, > fixing commit: 1a7fecb766c8 ath10k: reset chip before reading chip_id in probe. > > The bot has tested the following trees: v5.2.13, v4.19.71, v4.14.142, v4.9.191, v4.4.191. > > v5.2.13: Failed to apply! Possible dependencies: > 6d084ac27ab4 ("ath10k: initialise struct ath10k_bus params to zero") The bot is right. Either add that patch or remove the "= {};" from the patch that was sent to linux-wireless (based on "wireless-testing.git"). Alternatively, I've also added patches (as file attachments, I did this in the hopes of fooling patchwork and the bots at least a bit... as well as parking the patches for later). That said, I think this will go horribly wrong because of this response. Since It has been a long time since I needed a multi-version patch so I'm sorry for not being up-to-date with the latest for-stable meta. > v4.19.71: Failed to apply! Possible dependencies: > 31324d17976e ("ath10k: support extended board data download for dual-band QCA9984") > [...] too much > [...]: [...] > > NOTE: The patch will not be queued to stable trees until it is upstream. > > How should we proceed with this patch? You could let loose your ci-bot on the attached patches and see if they would do the trick. I'm very optimistic that this will need some more time though. So, "let's cross that bridge whenever we get there." Cheers, Christian From 38ac13d668f237941c8b77f16375f8f0e4de966a Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Mon, 25 Mar 2019 13:50:19 +0100 Subject: [PATCH 5.2] ath10k: restore QCA9880-AR1A (v1) detection To: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Cc: Kalle Valo This patch restores the old behavior that read the chip_id on the QCA988x before resetting the chip. This needs to be done in this order since the unsupported QCA988x AR1A chips fall off the bus when resetted. Otherwise the next MMIO Op after the reset causes a BUS ERROR and panic. Cc: stable@vger.kernel.org # 5.2 Fixes: 1a7fecb766c8 ("ath10k: reset chip before reading chip_id in probe") Signed-off-by: Christian Lamparter --- drivers/net/wireless/ath/ath10k/pci.c | 36 +++++++++++++++++++-------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -3490,7 +3490,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev, struct ath10k_pci *ar_pci; enum ath10k_hw_rev hw_rev; struct ath10k_bus_params bus_params; - bool pci_ps; + bool pci_ps, is_qca988x = false; int (*pci_soft_reset)(struct ath10k *ar); int (*pci_hard_reset)(struct ath10k *ar); u32 (*targ_cpu_to_ce_addr)(struct ath10k *ar, u32 addr); @@ -3500,6 +3500,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev, case QCA988X_2_0_DEVICE_ID: hw_rev = ATH10K_HW_QCA988X; pci_ps = false; + is_qca988x = true; pci_soft_reset = ath10k_pci_warm_reset; pci_hard_reset = ath10k_pci_qca988x_chip_reset; targ_cpu_to_ce_addr = ath10k_pci_qca988x_targ_cpu_to_ce_addr; @@ -3619,25 +3620,34 @@ static int ath10k_pci_probe(struct pci_dev *pdev, goto err_deinit_irq; } + bus_params.dev_type = ATH10K_DEV_TYPE_LL; + bus_params.link_can_suspend = true; + /* Read CHIP_ID before reset to catch QCA9880-AR1A v1 devices that + * fall off the bus during chip_reset. These chips have the same pci + * device id as the QCA9880 BR4A or 2R4E. So that's why the check. + */ + if (is_qca988x) { + bus_params.chip_id = + ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS); + if (bus_params.chip_id != 0xffffffff) { + if (!ath10k_pci_chip_is_supported(pdev->device, + bus_params.chip_id)) + goto err_unsupported; + } + } + 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); - if (bus_params.chip_id == 0xffffffff) { - ath10k_err(ar, "failed to get chip id\n"); - goto err_free_irq; - } + if (bus_params.chip_id == 0xffffffff) + goto err_unsupported; - if (!ath10k_pci_chip_is_supported(pdev->device, bus_params.chip_id)) { - ath10k_err(ar, "device %04x with chip_id %08x isn't supported\n", - pdev->device, bus_params.chip_id); + if (!ath10k_pci_chip_is_supported(pdev->device, bus_params.chip_id)) goto err_free_irq; - } ret = ath10k_core_register(ar, &bus_params); if (ret) { @@ -3647,6 +3657,10 @@ static int ath10k_pci_probe(struct pci_dev *pdev, return 0; +err_unsupported: + ath10k_err(ar, "device %04x with chip_id %08x isn't supported\n", + pdev->device, bus_params.chip_id); + err_free_irq: ath10k_pci_free_irq(ar); ath10k_pci_rx_retry_sync(ar); -- 2.23.0