|
@@ -1,406 +1,4 @@
|
|
-From 7877f4ebb43da4625e635c5f1ce491422a50a05a Mon Sep 17 00:00:00 2001
|
|
|
|
-From: Tsuchiya Yuto <kitakar@gmail.com>
|
|
|
|
-Date: Tue, 29 Sep 2020 17:32:22 +0900
|
|
|
|
-Subject: [PATCH] mwifiex: pcie: add reset_wsid quirk for Surface 3
|
|
|
|
-
|
|
|
|
-This commit adds reset_wsid quirk and uses this quirk for Surface 3 on
|
|
|
|
-card reset.
|
|
|
|
-
|
|
|
|
-To reset mwifiex on Surface 3, it seems that calling the _DSM method
|
|
|
|
-exists in \_SB.WSID [1] device is required.
|
|
|
|
-
|
|
|
|
-On Surface 3, calling the _DSM method removes/re-probes the card by
|
|
|
|
-itself. So, need to place the reset function before performing FLR and
|
|
|
|
-skip performing any other reset-related works.
|
|
|
|
-
|
|
|
|
-Note that Surface Pro 3 also has the WSID device [2], but it seems to need
|
|
|
|
-more work. This commit only supports Surface 3 yet.
|
|
|
|
-
|
|
|
|
-[1] https://github.com/linux-surface/acpidumps/blob/05cba925f3a515f222acb5b3551a032ddde958fe/surface_3/dsdt.dsl#L11947-L12011
|
|
|
|
-[2] https://github.com/linux-surface/acpidumps/blob/05cba925f3a515f222acb5b3551a032ddde958fe/surface_pro_3/dsdt.dsl#L12164-L12216
|
|
|
|
-
|
|
|
|
-Signed-off-by: Tsuchiya Yuto <kitakar@gmail.com>
|
|
|
|
-Patchset: mwifiex
|
|
|
|
----
|
|
|
|
- drivers/net/wireless/marvell/mwifiex/pcie.c | 10 +++
|
|
|
|
- .../wireless/marvell/mwifiex/pcie_quirks.c | 83 +++++++++++++++++++
|
|
|
|
- .../wireless/marvell/mwifiex/pcie_quirks.h | 6 ++
|
|
|
|
- 3 files changed, 99 insertions(+)
|
|
|
|
-
|
|
|
|
-diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
|
|
-index f7f9277602a5..56ae323ca3b5 100644
|
|
|
|
---- a/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
|
|
-+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
|
|
-@@ -2981,6 +2981,16 @@ static void mwifiex_pcie_card_reset_work(struct mwifiex_adapter *adapter)
|
|
|
|
- {
|
|
|
|
- struct pcie_service_card *card = adapter->card;
|
|
|
|
-
|
|
|
|
-+ /* On Surface 3, reset_wsid method removes then re-probes card by
|
|
|
|
-+ * itself. So, need to place it here and skip performing any other
|
|
|
|
-+ * reset-related works.
|
|
|
|
-+ */
|
|
|
|
-+ if (card->quirks & QUIRK_FW_RST_WSID_S3) {
|
|
|
|
-+ mwifiex_pcie_reset_wsid_quirk(card->dev);
|
|
|
|
-+ /* skip performing any other reset-related works */
|
|
|
|
-+ return;
|
|
|
|
-+ }
|
|
|
|
-+
|
|
|
|
- /* We can't afford to wait here; remove() might be waiting on us. If we
|
|
|
|
- * can't grab the device lock, maybe we'll get another chance later.
|
|
|
|
- */
|
|
|
|
-diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
|
|
-index dd6d21f1dbfd..2175358dc65d 100644
|
|
|
|
---- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
|
|
-+++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
|
|
-@@ -1,10 +1,21 @@
|
|
|
|
- // SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
- // NXP Wireless LAN device driver: PCIE and platform specific quirks
|
|
|
|
-
|
|
|
|
-+#include <linux/acpi.h>
|
|
|
|
- #include <linux/dmi.h>
|
|
|
|
-
|
|
|
|
- #include "pcie_quirks.h"
|
|
|
|
-
|
|
|
|
-+/* For reset_wsid quirk */
|
|
|
|
-+#define ACPI_WSID_PATH "\\_SB.WSID"
|
|
|
|
-+#define WSID_REV 0x0
|
|
|
|
-+#define WSID_FUNC_WIFI_PWR_OFF 0x1
|
|
|
|
-+#define WSID_FUNC_WIFI_PWR_ON 0x2
|
|
|
|
-+/* WSID _DSM UUID: "534ea3bf-fcc2-4e7a-908f-a13978f0c7ef" */
|
|
|
|
-+static const guid_t wsid_dsm_guid =
|
|
|
|
-+ GUID_INIT(0x534ea3bf, 0xfcc2, 0x4e7a,
|
|
|
|
-+ 0x90, 0x8f, 0xa1, 0x39, 0x78, 0xf0, 0xc7, 0xef);
|
|
|
|
-+
|
|
|
|
- /* quirk table based on DMI matching */
|
|
|
|
- static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
- {
|
|
|
|
-@@ -73,6 +84,14 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
- },
|
|
|
|
- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
- },
|
|
|
|
-+ {
|
|
|
|
-+ .ident = "Surface 3",
|
|
|
|
-+ .matches = {
|
|
|
|
-+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
|
|
-+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
|
|
|
|
-+ },
|
|
|
|
-+ .driver_data = (void *)QUIRK_FW_RST_WSID_S3,
|
|
|
|
-+ },
|
|
|
|
- {}
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
-@@ -89,6 +108,9 @@ void mwifiex_initialize_quirks(struct pcie_service_card *card)
|
|
|
|
- dev_info(&pdev->dev, "no quirks enabled\n");
|
|
|
|
- if (card->quirks & QUIRK_FW_RST_D3COLD)
|
|
|
|
- dev_info(&pdev->dev, "quirk reset_d3cold enabled\n");
|
|
|
|
-+ if (card->quirks & QUIRK_FW_RST_WSID_S3)
|
|
|
|
-+ dev_info(&pdev->dev,
|
|
|
|
-+ "quirk reset_wsid for Surface 3 enabled\n");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static void mwifiex_pcie_set_power_d3cold(struct pci_dev *pdev)
|
|
|
|
-@@ -145,3 +167,64 @@ int mwifiex_pcie_reset_d3cold_quirk(struct pci_dev *pdev)
|
|
|
|
-
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
-+
|
|
|
|
-+int mwifiex_pcie_reset_wsid_quirk(struct pci_dev *pdev)
|
|
|
|
-+{
|
|
|
|
-+ acpi_handle handle;
|
|
|
|
-+ union acpi_object *obj;
|
|
|
|
-+ acpi_status status;
|
|
|
|
-+
|
|
|
|
-+ dev_info(&pdev->dev, "Using reset_wsid quirk to perform FW reset\n");
|
|
|
|
-+
|
|
|
|
-+ status = acpi_get_handle(NULL, ACPI_WSID_PATH, &handle);
|
|
|
|
-+ if (ACPI_FAILURE(status)) {
|
|
|
|
-+ dev_err(&pdev->dev, "No ACPI handle for path %s\n",
|
|
|
|
-+ ACPI_WSID_PATH);
|
|
|
|
-+ return -ENODEV;
|
|
|
|
-+ }
|
|
|
|
-+
|
|
|
|
-+ if (!acpi_has_method(handle, "_DSM")) {
|
|
|
|
-+ dev_err(&pdev->dev, "_DSM method not found\n");
|
|
|
|
-+ return -ENODEV;
|
|
|
|
-+ }
|
|
|
|
-+
|
|
|
|
-+ if (!acpi_check_dsm(handle, &wsid_dsm_guid,
|
|
|
|
-+ WSID_REV, WSID_FUNC_WIFI_PWR_OFF)) {
|
|
|
|
-+ dev_err(&pdev->dev,
|
|
|
|
-+ "_DSM method doesn't support wifi power off func\n");
|
|
|
|
-+ return -ENODEV;
|
|
|
|
-+ }
|
|
|
|
-+
|
|
|
|
-+ if (!acpi_check_dsm(handle, &wsid_dsm_guid,
|
|
|
|
-+ WSID_REV, WSID_FUNC_WIFI_PWR_ON)) {
|
|
|
|
-+ dev_err(&pdev->dev,
|
|
|
|
-+ "_DSM method doesn't support wifi power on func\n");
|
|
|
|
-+ return -ENODEV;
|
|
|
|
-+ }
|
|
|
|
-+
|
|
|
|
-+ /* card will be removed immediately after this call on Surface 3 */
|
|
|
|
-+ dev_info(&pdev->dev, "turning wifi off...\n");
|
|
|
|
-+ obj = acpi_evaluate_dsm(handle, &wsid_dsm_guid,
|
|
|
|
-+ WSID_REV, WSID_FUNC_WIFI_PWR_OFF,
|
|
|
|
-+ NULL);
|
|
|
|
-+ if (!obj) {
|
|
|
|
-+ dev_err(&pdev->dev,
|
|
|
|
-+ "device _DSM execution failed for turning wifi off\n");
|
|
|
|
-+ return -EIO;
|
|
|
|
-+ }
|
|
|
|
-+ ACPI_FREE(obj);
|
|
|
|
-+
|
|
|
|
-+ /* card will be re-probed immediately after this call on Surface 3 */
|
|
|
|
-+ dev_info(&pdev->dev, "turning wifi on...\n");
|
|
|
|
-+ obj = acpi_evaluate_dsm(handle, &wsid_dsm_guid,
|
|
|
|
-+ WSID_REV, WSID_FUNC_WIFI_PWR_ON,
|
|
|
|
-+ NULL);
|
|
|
|
-+ if (!obj) {
|
|
|
|
-+ dev_err(&pdev->dev,
|
|
|
|
-+ "device _DSM execution failed for turning wifi on\n");
|
|
|
|
-+ return -EIO;
|
|
|
|
-+ }
|
|
|
|
-+ ACPI_FREE(obj);
|
|
|
|
-+
|
|
|
|
-+ return 0;
|
|
|
|
-+}
|
|
|
|
-diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
|
|
|
|
-index d6ff964aec5b..40c95ab24bd7 100644
|
|
|
|
---- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
|
|
|
|
-+++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
|
|
|
|
-@@ -5,5 +5,11 @@
|
|
|
|
-
|
|
|
|
- #define QUIRK_FW_RST_D3COLD BIT(0)
|
|
|
|
-
|
|
|
|
-+/* Surface 3 and Surface Pro 3 have the same _DSM method but need to
|
|
|
|
-+ * be handled differently. Currently, only S3 is supported.
|
|
|
|
-+ */
|
|
|
|
-+#define QUIRK_FW_RST_WSID_S3 BIT(1)
|
|
|
|
-+
|
|
|
|
- void mwifiex_initialize_quirks(struct pcie_service_card *card);
|
|
|
|
- int mwifiex_pcie_reset_d3cold_quirk(struct pci_dev *pdev);
|
|
|
|
-+int mwifiex_pcie_reset_wsid_quirk(struct pci_dev *pdev);
|
|
|
|
---
|
|
|
|
-2.38.0
|
|
|
|
-
|
|
|
|
-From a752cce0b4ff03b78c53f4f9889a707bf706f9bc Mon Sep 17 00:00:00 2001
|
|
|
|
-From: Tsuchiya Yuto <kitakar@gmail.com>
|
|
|
|
-Date: Wed, 30 Sep 2020 18:08:24 +0900
|
|
|
|
-Subject: [PATCH] mwifiex: pcie: (OEMB) add quirk for Surface 3 with broken DMI
|
|
|
|
- table
|
|
|
|
-
|
|
|
|
-(made referring to http://git.osdn.net/view?p=android-x86/kernel.git;a=commitdiff;h=18e2e857c57633b25b3b4120f212224a108cd883)
|
|
|
|
-
|
|
|
|
-On some Surface 3, the DMI table gets corrupted for unknown reasons
|
|
|
|
-and breaks existing DMI matching used for device-specific quirks.
|
|
|
|
-
|
|
|
|
-This commit adds the (broken) DMI info for the affected Surface 3.
|
|
|
|
-
|
|
|
|
-On affected systems, DMI info will look like this:
|
|
|
|
- $ grep . /sys/devices/virtual/dmi/id/{bios_vendor,board_name,board_vendor,\
|
|
|
|
- chassis_vendor,product_name,sys_vendor}
|
|
|
|
- /sys/devices/virtual/dmi/id/bios_vendor:American Megatrends Inc.
|
|
|
|
- /sys/devices/virtual/dmi/id/board_name:OEMB
|
|
|
|
- /sys/devices/virtual/dmi/id/board_vendor:OEMB
|
|
|
|
- /sys/devices/virtual/dmi/id/chassis_vendor:OEMB
|
|
|
|
- /sys/devices/virtual/dmi/id/product_name:OEMB
|
|
|
|
- /sys/devices/virtual/dmi/id/sys_vendor:OEMB
|
|
|
|
-
|
|
|
|
-Expected:
|
|
|
|
- $ grep . /sys/devices/virtual/dmi/id/{bios_vendor,board_name,board_vendor,\
|
|
|
|
- chassis_vendor,product_name,sys_vendor}
|
|
|
|
- /sys/devices/virtual/dmi/id/bios_vendor:American Megatrends Inc.
|
|
|
|
- /sys/devices/virtual/dmi/id/board_name:Surface 3
|
|
|
|
- /sys/devices/virtual/dmi/id/board_vendor:Microsoft Corporation
|
|
|
|
- /sys/devices/virtual/dmi/id/chassis_vendor:Microsoft Corporation
|
|
|
|
- /sys/devices/virtual/dmi/id/product_name:Surface 3
|
|
|
|
- /sys/devices/virtual/dmi/id/sys_vendor:Microsoft Corporation
|
|
|
|
-
|
|
|
|
-Signed-off-by: Tsuchiya Yuto <kitakar@gmail.com>
|
|
|
|
-Patchset: mwifiex
|
|
|
|
----
|
|
|
|
- drivers/net/wireless/marvell/mwifiex/pcie_quirks.c | 9 +++++++++
|
|
|
|
- 1 file changed, 9 insertions(+)
|
|
|
|
-
|
|
|
|
-diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
|
|
-index 2175358dc65d..aec48547a88a 100644
|
|
|
|
---- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
|
|
-+++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
|
|
-@@ -92,6 +92,15 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
- },
|
|
|
|
- .driver_data = (void *)QUIRK_FW_RST_WSID_S3,
|
|
|
|
- },
|
|
|
|
-+ {
|
|
|
|
-+ .ident = "Surface 3",
|
|
|
|
-+ .matches = {
|
|
|
|
-+ DMI_EXACT_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
|
|
|
|
-+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "OEMB"),
|
|
|
|
-+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "OEMB"),
|
|
|
|
-+ },
|
|
|
|
-+ .driver_data = (void *)QUIRK_FW_RST_WSID_S3,
|
|
|
|
-+ },
|
|
|
|
- {}
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
---
|
|
|
|
-2.38.0
|
|
|
|
-
|
|
|
|
-From e651da0b596b34da881f2eddb924a36cb31f8ec0 Mon Sep 17 00:00:00 2001
|
|
|
|
-From: Tsuchiya Yuto <kitakar@gmail.com>
|
|
|
|
-Date: Sun, 4 Oct 2020 00:11:49 +0900
|
|
|
|
-Subject: [PATCH] mwifiex: pcie: disable bridge_d3 for Surface gen4+
|
|
|
|
-
|
|
|
|
-Currently, mwifiex fw will crash after suspend on recent kernel series.
|
|
|
|
-On Windows, it seems that the root port of wifi will never enter D3 state
|
|
|
|
-(stay on D0 state). And on Linux, disabling the D3 state for the
|
|
|
|
-bridge fixes fw crashing after suspend.
|
|
|
|
-
|
|
|
|
-This commit disables the D3 state of root port on driver initialization
|
|
|
|
-and fixes fw crashing after suspend.
|
|
|
|
-
|
|
|
|
-Signed-off-by: Tsuchiya Yuto <kitakar@gmail.com>
|
|
|
|
-Patchset: mwifiex
|
|
|
|
----
|
|
|
|
- drivers/net/wireless/marvell/mwifiex/pcie.c | 7 +++++
|
|
|
|
- .../wireless/marvell/mwifiex/pcie_quirks.c | 27 +++++++++++++------
|
|
|
|
- .../wireless/marvell/mwifiex/pcie_quirks.h | 1 +
|
|
|
|
- 3 files changed, 27 insertions(+), 8 deletions(-)
|
|
|
|
-
|
|
|
|
-diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
|
|
-index 56ae323ca3b5..3b9a1d97f16e 100644
|
|
|
|
---- a/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
|
|
-+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
|
|
-@@ -368,6 +368,7 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev,
|
|
|
|
- const struct pci_device_id *ent)
|
|
|
|
- {
|
|
|
|
- struct pcie_service_card *card;
|
|
|
|
-+ struct pci_dev *parent_pdev = pci_upstream_bridge(pdev);
|
|
|
|
- int ret;
|
|
|
|
-
|
|
|
|
- pr_debug("info: vendor=0x%4.04X device=0x%4.04X rev=%d\n",
|
|
|
|
-@@ -409,6 +410,12 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev,
|
|
|
|
- return -1;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-+ /* disable bridge_d3 for Surface gen4+ devices to fix fw crashing
|
|
|
|
-+ * after suspend
|
|
|
|
-+ */
|
|
|
|
-+ if (card->quirks & QUIRK_NO_BRIDGE_D3)
|
|
|
|
-+ parent_pdev->bridge_d3 = false;
|
|
|
|
-+
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
|
|
-index aec48547a88a..842980db998f 100644
|
|
|
|
---- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
|
|
-+++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
|
|
-@@ -24,7 +24,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
- DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
|
|
- DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 4"),
|
|
|
|
- },
|
|
|
|
-- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
-+ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- .ident = "Surface Pro 5",
|
|
|
|
-@@ -33,7 +34,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
- DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
|
|
- DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "Surface_Pro_1796"),
|
|
|
|
- },
|
|
|
|
-- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
-+ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- .ident = "Surface Pro 5 (LTE)",
|
|
|
|
-@@ -42,7 +44,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
- DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
|
|
- DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "Surface_Pro_1807"),
|
|
|
|
- },
|
|
|
|
-- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
-+ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- .ident = "Surface Pro 6",
|
|
|
|
-@@ -50,7 +53,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
- DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
|
|
- DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 6"),
|
|
|
|
- },
|
|
|
|
-- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
-+ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- .ident = "Surface Book 1",
|
|
|
|
-@@ -58,7 +62,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
- DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
|
|
- DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Book"),
|
|
|
|
- },
|
|
|
|
-- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
-+ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- .ident = "Surface Book 2",
|
|
|
|
-@@ -66,7 +71,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
- DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
|
|
- DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Book 2"),
|
|
|
|
- },
|
|
|
|
-- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
-+ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- .ident = "Surface Laptop 1",
|
|
|
|
-@@ -74,7 +80,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
- DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
|
|
- DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Laptop"),
|
|
|
|
- },
|
|
|
|
-- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
-+ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- .ident = "Surface Laptop 2",
|
|
|
|
-@@ -82,7 +89,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
- DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
|
|
- DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Laptop 2"),
|
|
|
|
- },
|
|
|
|
-- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
-+ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- .ident = "Surface 3",
|
|
|
|
-@@ -120,6 +128,9 @@ void mwifiex_initialize_quirks(struct pcie_service_card *card)
|
|
|
|
- if (card->quirks & QUIRK_FW_RST_WSID_S3)
|
|
|
|
- dev_info(&pdev->dev,
|
|
|
|
- "quirk reset_wsid for Surface 3 enabled\n");
|
|
|
|
-+ if (card->quirks & QUIRK_NO_BRIDGE_D3)
|
|
|
|
-+ dev_info(&pdev->dev,
|
|
|
|
-+ "quirk no_brigde_d3 enabled\n");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static void mwifiex_pcie_set_power_d3cold(struct pci_dev *pdev)
|
|
|
|
-diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
|
|
|
|
-index 40c95ab24bd7..0162eee0ee3c 100644
|
|
|
|
---- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
|
|
|
|
-+++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
|
|
|
|
-@@ -9,6 +9,7 @@
|
|
|
|
- * be handled differently. Currently, only S3 is supported.
|
|
|
|
- */
|
|
|
|
- #define QUIRK_FW_RST_WSID_S3 BIT(1)
|
|
|
|
-+#define QUIRK_NO_BRIDGE_D3 BIT(2)
|
|
|
|
-
|
|
|
|
- void mwifiex_initialize_quirks(struct pcie_service_card *card);
|
|
|
|
- int mwifiex_pcie_reset_d3cold_quirk(struct pci_dev *pdev);
|
|
|
|
---
|
|
|
|
-2.38.0
|
|
|
|
-
|
|
|
|
-From 3bcb56b5f40e4b16ca8eab0b4548008982c93264 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From e8c9d38dd90a1d2141ee5b36faf122155051a508 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
|
|
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
|
|
Date: Tue, 3 Nov 2020 13:28:04 +0100
|
|
Date: Tue, 3 Nov 2020 13:28:04 +0100
|
|
Subject: [PATCH] mwifiex: Add quirk resetting the PCI bridge on MS Surface
|
|
Subject: [PATCH] mwifiex: Add quirk resetting the PCI bridge on MS Surface
|
|
@@ -434,10 +32,10 @@ Patchset: mwifiex
|
|
3 files changed, 31 insertions(+), 8 deletions(-)
|
|
3 files changed, 31 insertions(+), 8 deletions(-)
|
|
|
|
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
-index 3b9a1d97f16e..f2ced269b543 100644
|
|
|
|
|
|
+index f7f9277602a5..3aeff40179cf 100644
|
|
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
-@@ -1769,9 +1769,21 @@ mwifiex_pcie_send_boot_cmd(struct mwifiex_adapter *adapter, struct sk_buff *skb)
|
|
|
|
|
|
+@@ -1762,9 +1762,21 @@ mwifiex_pcie_send_boot_cmd(struct mwifiex_adapter *adapter, struct sk_buff *skb)
|
|
static int mwifiex_pcie_init_fw_port(struct mwifiex_adapter *adapter)
|
|
static int mwifiex_pcie_init_fw_port(struct mwifiex_adapter *adapter)
|
|
{
|
|
{
|
|
struct pcie_service_card *card = adapter->card;
|
|
struct pcie_service_card *card = adapter->card;
|
|
@@ -460,114 +58,114 @@ index 3b9a1d97f16e..f2ced269b543 100644
|
|
if (mwifiex_write_reg(adapter, reg->rx_rdptr, card->rxbd_rdptr |
|
|
if (mwifiex_write_reg(adapter, reg->rx_rdptr, card->rxbd_rdptr |
|
|
tx_wrap)) {
|
|
tx_wrap)) {
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
-index 842980db998f..dd914393ffcb 100644
|
|
|
|
|
|
+index dd6d21f1dbfd..f46b06f8d643 100644
|
|
--- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
--- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.c
|
|
-@@ -25,7 +25,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
|
|
+@@ -13,7 +13,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 4"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 4"),
|
|
},
|
|
},
|
|
- .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-- QUIRK_NO_BRIDGE_D3),
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3 |
|
|
|
|
|
|
+- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
},
|
|
},
|
|
{
|
|
{
|
|
.ident = "Surface Pro 5",
|
|
.ident = "Surface Pro 5",
|
|
-@@ -35,7 +36,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
|
|
+@@ -22,7 +23,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "Surface_Pro_1796"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "Surface_Pro_1796"),
|
|
},
|
|
},
|
|
- .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-- QUIRK_NO_BRIDGE_D3),
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3 |
|
|
|
|
|
|
+- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
},
|
|
},
|
|
{
|
|
{
|
|
.ident = "Surface Pro 5 (LTE)",
|
|
.ident = "Surface Pro 5 (LTE)",
|
|
-@@ -45,7 +47,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
|
|
+@@ -31,7 +33,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "Surface_Pro_1807"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "Surface_Pro_1807"),
|
|
},
|
|
},
|
|
- .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-- QUIRK_NO_BRIDGE_D3),
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3 |
|
|
|
|
|
|
+- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
},
|
|
},
|
|
{
|
|
{
|
|
.ident = "Surface Pro 6",
|
|
.ident = "Surface Pro 6",
|
|
-@@ -54,7 +57,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
|
|
+@@ -39,7 +42,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 6"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 6"),
|
|
},
|
|
},
|
|
- .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-- QUIRK_NO_BRIDGE_D3),
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3 |
|
|
|
|
|
|
+- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
},
|
|
},
|
|
{
|
|
{
|
|
.ident = "Surface Book 1",
|
|
.ident = "Surface Book 1",
|
|
-@@ -63,7 +67,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
|
|
+@@ -47,7 +51,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Book"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Book"),
|
|
},
|
|
},
|
|
- .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-- QUIRK_NO_BRIDGE_D3),
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3 |
|
|
|
|
|
|
+- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
},
|
|
},
|
|
{
|
|
{
|
|
.ident = "Surface Book 2",
|
|
.ident = "Surface Book 2",
|
|
-@@ -72,7 +77,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
|
|
+@@ -55,7 +60,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Book 2"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Book 2"),
|
|
},
|
|
},
|
|
- .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-- QUIRK_NO_BRIDGE_D3),
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3 |
|
|
|
|
|
|
+- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
},
|
|
},
|
|
{
|
|
{
|
|
.ident = "Surface Laptop 1",
|
|
.ident = "Surface Laptop 1",
|
|
-@@ -81,7 +87,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
|
|
+@@ -63,7 +69,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Laptop"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Laptop"),
|
|
},
|
|
},
|
|
- .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-- QUIRK_NO_BRIDGE_D3),
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3 |
|
|
|
|
|
|
+- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
},
|
|
},
|
|
{
|
|
{
|
|
.ident = "Surface Laptop 2",
|
|
.ident = "Surface Laptop 2",
|
|
-@@ -90,7 +97,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
|
|
+@@ -71,7 +78,8 @@ static const struct dmi_system_id mwifiex_quirk_table[] = {
|
|
|
|
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Laptop 2"),
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Laptop 2"),
|
|
},
|
|
},
|
|
- .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
|
|
-- QUIRK_NO_BRIDGE_D3),
|
|
|
|
-+ QUIRK_NO_BRIDGE_D3 |
|
|
|
|
|
|
+- .driver_data = (void *)QUIRK_FW_RST_D3COLD,
|
|
|
|
++ .driver_data = (void *)(QUIRK_FW_RST_D3COLD |
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
+ QUIRK_DO_FLR_ON_BRIDGE),
|
|
},
|
|
},
|
|
- {
|
|
|
|
- .ident = "Surface 3",
|
|
|
|
-@@ -131,6 +139,8 @@ void mwifiex_initialize_quirks(struct pcie_service_card *card)
|
|
|
|
- if (card->quirks & QUIRK_NO_BRIDGE_D3)
|
|
|
|
- dev_info(&pdev->dev,
|
|
|
|
- "quirk no_brigde_d3 enabled\n");
|
|
|
|
|
|
+ {}
|
|
|
|
+ };
|
|
|
|
+@@ -89,6 +97,8 @@ void mwifiex_initialize_quirks(struct pcie_service_card *card)
|
|
|
|
+ dev_info(&pdev->dev, "no quirks enabled\n");
|
|
|
|
+ if (card->quirks & QUIRK_FW_RST_D3COLD)
|
|
|
|
+ dev_info(&pdev->dev, "quirk reset_d3cold enabled\n");
|
|
+ if (card->quirks & QUIRK_DO_FLR_ON_BRIDGE)
|
|
+ if (card->quirks & QUIRK_DO_FLR_ON_BRIDGE)
|
|
+ dev_info(&pdev->dev, "quirk do_flr_on_bridge enabled\n");
|
|
+ dev_info(&pdev->dev, "quirk do_flr_on_bridge enabled\n");
|
|
}
|
|
}
|
|
|
|
|
|
static void mwifiex_pcie_set_power_d3cold(struct pci_dev *pdev)
|
|
static void mwifiex_pcie_set_power_d3cold(struct pci_dev *pdev)
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
|
|
-index 0162eee0ee3c..1b7c1e63ac5d 100644
|
|
|
|
|
|
+index d6ff964aec5b..5d30ae39d65e 100644
|
|
--- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
|
|
--- a/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/pcie_quirks.h
|
|
-@@ -10,6 +10,7 @@
|
|
|
|
- */
|
|
|
|
- #define QUIRK_FW_RST_WSID_S3 BIT(1)
|
|
|
|
- #define QUIRK_NO_BRIDGE_D3 BIT(2)
|
|
|
|
-+#define QUIRK_DO_FLR_ON_BRIDGE BIT(3)
|
|
|
|
|
|
+@@ -4,6 +4,7 @@
|
|
|
|
+ #include "pcie.h"
|
|
|
|
+
|
|
|
|
+ #define QUIRK_FW_RST_D3COLD BIT(0)
|
|
|
|
++#define QUIRK_DO_FLR_ON_BRIDGE BIT(1)
|
|
|
|
|
|
void mwifiex_initialize_quirks(struct pcie_service_card *card);
|
|
void mwifiex_initialize_quirks(struct pcie_service_card *card);
|
|
int mwifiex_pcie_reset_d3cold_quirk(struct pci_dev *pdev);
|
|
int mwifiex_pcie_reset_d3cold_quirk(struct pci_dev *pdev);
|
|
--
|
|
--
|
|
-2.38.0
|
|
|
|
|
|
+2.38.1
|
|
|
|
|
|
-From 01adfefa9e7c14a7e77be36d3c5374d252b5de24 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 1a5210524194ca0bd4330828ca98e1ecdc02d72f Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
|
|
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
|
|
Date: Thu, 25 Mar 2021 11:33:02 +0100
|
|
Date: Thu, 25 Mar 2021 11:33:02 +0100
|
|
Subject: [PATCH] Bluetooth: btusb: Lower passive lescan interval on Marvell
|
|
Subject: [PATCH] Bluetooth: btusb: Lower passive lescan interval on Marvell
|
|
@@ -643,62 +241,5 @@ index 1bb46cbff0fa..8aa8db5d4cde 100644
|
|
(id->driver_info & BTUSB_MEDIATEK)) {
|
|
(id->driver_info & BTUSB_MEDIATEK)) {
|
|
hdev->setup = btusb_mtk_setup;
|
|
hdev->setup = btusb_mtk_setup;
|
|
--
|
|
--
|
|
-2.38.0
|
|
|
|
-
|
|
|
|
-From c2ed6cb8f8ff11bb1571797542ae1f863024d2b1 Mon Sep 17 00:00:00 2001
|
|
|
|
-From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
|
|
|
|
-Date: Tue, 10 Nov 2020 12:49:56 +0100
|
|
|
|
-Subject: [PATCH] mwifiex: Use non-posted PCI register writes
|
|
|
|
-
|
|
|
|
-On the 88W8897 card it's very important the TX ring write pointer is
|
|
|
|
-updated correctly to its new value before setting the TX ready
|
|
|
|
-interrupt, otherwise the firmware appears to crash (probably because
|
|
|
|
-it's trying to DMA-read from the wrong place).
|
|
|
|
-
|
|
|
|
-Since PCI uses "posted writes" when writing to a register, it's not
|
|
|
|
-guaranteed that a write will happen immediately. That means the pointer
|
|
|
|
-might be outdated when setting the TX ready interrupt, leading to
|
|
|
|
-firmware crashes especially when ASPM L1 and L1 substates are enabled
|
|
|
|
-(because of the higher link latency, the write will probably take
|
|
|
|
-longer).
|
|
|
|
-
|
|
|
|
-So fix those firmware crashes by always forcing non-posted writes. We do
|
|
|
|
-that by simply reading back the register after writing it, just as a lot
|
|
|
|
-of other drivers do.
|
|
|
|
-
|
|
|
|
-There are two reproducers that are fixed with this patch:
|
|
|
|
-
|
|
|
|
-1) During rx/tx traffic and with ASPM L1 substates enabled (the enabled
|
|
|
|
-substates are platform dependent), the firmware crashes and eventually a
|
|
|
|
-command timeout appears in the logs. That crash is fixed by using a
|
|
|
|
-non-posted write in mwifiex_pcie_send_data().
|
|
|
|
-
|
|
|
|
-2) When sending lots of commands to the card, waking it up from sleep in
|
|
|
|
-very quick intervals, the firmware eventually crashes. That crash
|
|
|
|
-appears to be fixed by some other non-posted write included here.
|
|
|
|
-
|
|
|
|
-Patchset: mwifiex
|
|
|
|
----
|
|
|
|
- drivers/net/wireless/marvell/mwifiex/pcie.c | 6 ++++++
|
|
|
|
- 1 file changed, 6 insertions(+)
|
|
|
|
-
|
|
|
|
-diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
|
|
-index f2ced269b543..68f827d34b76 100644
|
|
|
|
---- a/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
|
|
-+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
|
|
-@@ -226,6 +226,12 @@ static int mwifiex_write_reg(struct mwifiex_adapter *adapter, int reg, u32 data)
|
|
|
|
-
|
|
|
|
- iowrite32(data, card->pci_mmap1 + reg);
|
|
|
|
-
|
|
|
|
-+ /* Do a read-back, which makes the write non-posted, ensuring the
|
|
|
|
-+ * completion before returning.
|
|
|
|
-+ * The firmware of the 88W8897 card is buggy and this avoids crashes.
|
|
|
|
-+ */
|
|
|
|
-+ ioread32(card->pci_mmap1 + reg);
|
|
|
|
-+
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
---
|
|
|
|
-2.38.0
|
|
|
|
|
|
+2.38.1
|
|
|
|
|