Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3036064ybe; Sun, 8 Sep 2019 05:55:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxT6LrbLstk73OtZAM3/yOQGFfykuRK7bMm3mGG5X5gPQY2w66eDNUqFPgjjAeqxIu52mFS X-Received: by 2002:a17:90a:3524:: with SMTP id q33mr19423210pjb.37.1567947308791; Sun, 08 Sep 2019 05:55:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567947308; cv=none; d=google.com; s=arc-20160816; b=OUGzozIJaX4+cCxSF/X07ocisRHw74FG3fvTTvCCfytW4N2QgE9pBUUE13qDJ1NZyB z8RsIuyEUwooSkrszHnSUDsSEsZPKHpFAoB1Ovj+ve0hpJk/u5t3lq4sfgRbJtJlvsx+ 6mU66A62miA0AO2/ZxgL83rXJvkXZ9SpRw++rR2MAOXQD4oAAMP1fD8AcO1eOoir9AXF vUxTggX5lAG8fqjYQe3oYt+63nNYAwDampys3mr+3PTV4WgvkvqVniJmPa6iQIbLWjp2 FafS7oL2sLzw8KpGggLXd+o8+qIktm4zvTqSYKasZDIZUQQ6d9JwUzx+rolCDBRcl6Z0 nRDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ho5rMqmvPV/b/YmpXToBzxMOBGjfEQyC6kp5sZH2O9g=; b=LoA44Bso026o+vo/4DTE62SPwCjl6XY0Qn/nK6+phsw71sBvPruETvWi+BPFJ9QGFw Jpz26YfYZadAX7OrFMBOvTnCOxcj5+PrylXN+wrL3tieo20n1MxmB4f6tQzVmW/sy8tB hmKCk4Lq17mlbVRDItKx4lSJm2fciaho1nf8enAckSBbnpxFGyfu2pQaq9UB8RaMYmcu GUfLR0AgQVgcf6I7niycxVndz8ndcj0mrdlTz2oOzf0n3+MiydTrKT7G6UJuN/t4wZii 7g5j7sXow29kmtGd66Vksi4XlxP5hGTPORbWbgbtY0bd6tRsFjQSVj2PUaUJy37rot7k vZNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=crOpftYY; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i135si10408959pgd.554.2019.09.08.05.54.54; Sun, 08 Sep 2019 05:55:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=crOpftYY; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392028AbfIGXSW (ORCPT + 99 others); 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-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 Content-Type: multipart/mixed; boundary="nextPart5470804.AK8FHB7eIg" Content-Transfer-Encoding: 7Bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This is a multi-part message in MIME format. --nextPart5470804.AK8FHB7eIg Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 --nextPart5470804.AK8FHB7eIg Content-Disposition: attachment; filename="4-9-ath10k-restore-QCA9880-AR1A-v1-detection.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="4-9-ath10k-restore-QCA9880-AR1A-v1-detection.patch" From 38ac13d668f237941c8b77f16375f8f0e4de966a Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Mon, 25 Mar 2019 13:50:19 +0100 Subject: [PATCH 4.9] 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 # 4.9 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 2019-09-08 00:07:21.374565470 +0200 +++ b/drivers/net/wireless/ath/ath10k/pci.c 2019-09-08 00:17:15.365912133 +0200 @@ -3172,7 +3172,7 @@ static int ath10k_pci_probe(struct pci_d struct ath10k_pci *ar_pci; enum ath10k_hw_rev hw_rev; u32 chip_id; - 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); @@ -3181,6 +3181,7 @@ static int ath10k_pci_probe(struct pci_d 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; @@ -3300,6 +3301,19 @@ static int ath10k_pci_probe(struct pci_d goto err_deinit_irq; } + /* 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) { + chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS); + if (chip_id != 0xffffffff) { + if (!ath10k_pci_chip_is_supported(pdev->device, + chip_id)) + goto err_unsupported; + } + } + ret = ath10k_pci_chip_reset(ar); if (ret) { ath10k_err(ar, "failed to reset chip: %d\n", ret); @@ -3312,11 +3326,8 @@ static int ath10k_pci_probe(struct pci_d goto err_free_irq; } - if (!ath10k_pci_chip_is_supported(pdev->device, chip_id)) { - ath10k_err(ar, "device %04x with chip_id %08x isn't supported\n", - pdev->device, chip_id); - goto err_free_irq; - } + if (!ath10k_pci_chip_is_supported(pdev->device, chip_id)) + goto err_unsupported; ret = ath10k_core_register(ar, chip_id); if (ret) { @@ -3326,6 +3337,10 @@ static int ath10k_pci_probe(struct pci_d 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); --nextPart5470804.AK8FHB7eIg Content-Disposition: attachment; filename="4-4-ath10k-restore-QCA9880-AR1A-v1-detection.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="4-4-ath10k-restore-QCA9880-AR1A-v1-detection.patch" From 38ac13d668f237941c8b77f16375f8f0e4de966a Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Mon, 25 Mar 2019 13:50:19 +0100 Subject: [PATCH 4.4] 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 # 4.4 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 2019-09-08 00:07:21.374565470 +0200 +++ b/drivers/net/wireless/ath/ath10k/pci.c 2019-09-08 00:17:15.365912133 +0200 @@ -2988,12 +2988,13 @@ static int ath10k_pci_probe(struct pci_d struct ath10k_pci *ar_pci; enum ath10k_hw_rev hw_rev; u32 chip_id; - bool pci_ps; + bool pci_ps, is_qca988x = false; switch (pci_dev->device) { case QCA988X_2_0_DEVICE_ID: hw_rev = ATH10K_HW_QCA988X; pci_ps = false; + is_qca988x = true; break; case QCA6164_2_1_DEVICE_ID: case QCA6174_2_1_DEVICE_ID: @@ -3087,6 +3088,19 @@ static int ath10k_pci_probe(struct pci_d goto err_deinit_irq; } + /* 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) { + chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS); + if (chip_id != 0xffffffff) { + if (!ath10k_pci_chip_is_supported(pdev->device, + chip_id)) + goto err_unsupported; + } + } + ret = ath10k_pci_chip_reset(ar); if (ret) { ath10k_err(ar, "failed to reset chip: %d\n", ret); @@ -3099,11 +3113,8 @@ static int ath10k_pci_probe(struct pci_d goto err_free_irq; } - if (!ath10k_pci_chip_is_supported(pdev->device, chip_id)) { - ath10k_err(ar, "device %04x with chip_id %08x isn't supported\n", - pdev->device, chip_id); - goto err_free_irq; - } + if (!ath10k_pci_chip_is_supported(pdev->device, chip_id)) + goto err_unsupported; ret = ath10k_core_register(ar, chip_id); if (ret) { @@ -3113,6 +3124,10 @@ static int ath10k_pci_probe(struct pci_d 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_kill_tasklet(ar); --nextPart5470804.AK8FHB7eIg Content-Disposition: attachment; filename="4-14-ath10k-restore-QCA9880-AR1A-v1-detection.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="4-14-ath10k-restore-QCA9880-AR1A-v1-detection.patch" From 38ac13d668f237941c8b77f16375f8f0e4de966a Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Mon, 25 Mar 2019 13:50:19 +0100 Subject: [PATCH 4.14] 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 # 4.14 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 2019-09-08 00:07:21.374565470 +0200 +++ b/drivers/net/wireless/ath/ath10k/pci.c 2019-09-08 00:17:15.365912133 +0200 @@ -3202,7 +3202,7 @@ static int ath10k_pci_probe(struct pci_d struct ath10k_pci *ar_pci; enum ath10k_hw_rev hw_rev; u32 chip_id; - 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); @@ -3211,6 +3211,7 @@ static int ath10k_pci_probe(struct pci_d 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; @@ -3331,6 +3332,19 @@ static int ath10k_pci_probe(struct pci_d goto err_deinit_irq; } + /* 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) { + chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS); + if (chip_id != 0xffffffff) { + if (!ath10k_pci_chip_is_supported(pdev->device, + chip_id)) + goto err_unsupported; + } + } + ret = ath10k_pci_chip_reset(ar); if (ret) { ath10k_err(ar, "failed to reset chip: %d\n", ret); @@ -3343,11 +3357,8 @@ static int ath10k_pci_probe(struct pci_d goto err_free_irq; } - if (!ath10k_pci_chip_is_supported(pdev->device, chip_id)) { - ath10k_err(ar, "device %04x with chip_id %08x isn't supported\n", - pdev->device, chip_id); - goto err_free_irq; - } + if (!ath10k_pci_chip_is_supported(pdev->device, chip_id)) + goto err_unsupported; ret = ath10k_core_register(ar, chip_id); if (ret) { @@ -3357,6 +3368,10 @@ static int ath10k_pci_probe(struct pci_d 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); --nextPart5470804.AK8FHB7eIg Content-Disposition: attachment; filename="4-19-ath10k-restore-QCA9880-AR1A-v1-detection.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="4-19-ath10k-restore-QCA9880-AR1A-v1-detection.patch" From 38ac13d668f237941c8b77f16375f8f0e4de966a Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Mon, 25 Mar 2019 13:50:19 +0100 Subject: [PATCH 4.19] 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 # 4.19 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 2019-09-08 00:07:21.374565470 +0200 +++ b/drivers/net/wireless/ath/ath10k/pci.c 2019-09-08 00:17:15.365912133 +0200 @@ -3483,7 +3483,7 @@ static int ath10k_pci_probe(struct pci_d struct ath10k_pci *ar_pci; enum ath10k_hw_rev hw_rev; u32 chip_id; - 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); @@ -3493,6 +3493,7 @@ static int ath10k_pci_probe(struct pci_d 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; @@ -3612,6 +3613,19 @@ static int ath10k_pci_probe(struct pci_d goto err_deinit_irq; } + /* 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) { + chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS); + if (chip_id != 0xffffffff) { + if (!ath10k_pci_chip_is_supported(pdev->device, + chip_id)) + goto err_unsupported; + } + } + ret = ath10k_pci_chip_reset(ar); if (ret) { ath10k_err(ar, "failed to reset chip: %d\n", ret); @@ -3624,11 +3638,8 @@ static int ath10k_pci_probe(struct pci_d goto err_free_irq; } - if (!ath10k_pci_chip_is_supported(pdev->device, chip_id)) { - ath10k_err(ar, "device %04x with chip_id %08x isn't supported\n", - pdev->device, chip_id); - goto err_free_irq; - } + if (!ath10k_pci_chip_is_supported(pdev->device, chip_id)) + goto err_unsupported; ret = ath10k_core_register(ar, chip_id); if (ret) { @@ -3638,6 +3649,10 @@ static int ath10k_pci_probe(struct pci_d 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); --nextPart5470804.AK8FHB7eIg Content-Disposition: attachment; filename="5-2-ath10k-restore-QCA9880-AR1A-v1-detection.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="5-2-ath10k-restore-QCA9880-AR1A-v1-detection.patch" 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 --nextPart5470804.AK8FHB7eIg--