Update patches for v5.4
This commit is contained in:
parent
3c76d63bef
commit
09ab0b74bd
30
configs/surface-5.4.config
Normal file
30
configs/surface-5.4.config
Normal file
|
@ -0,0 +1,30 @@
|
|||
#
|
||||
# Surface Aggregator Module
|
||||
#
|
||||
CONFIG_GPIO_SYSFS=y # required for SURFACE_SAM_HPS
|
||||
CONFIG_SURFACE_SAM=m
|
||||
CONFIG_SURFACE_SAM_SSH=m
|
||||
CONFIG_SURFACE_SAM_SSH_DEBUG_DEVICE=y
|
||||
CONFIG_SURFACE_SAM_SAN=m
|
||||
CONFIG_SURFACE_SAM_VHF=m
|
||||
CONFIG_SURFACE_SAM_DTX=m
|
||||
CONFIG_SURFACE_SAM_HPS=m
|
||||
CONFIG_SURFACE_SAM_SID=m
|
||||
CONFIG_SURFACE_SAM_SID_GPELID=m
|
||||
CONFIG_SURFACE_SAM_SID_PERFMODE=m
|
||||
CONFIG_SURFACE_SAM_SID_VHF=m
|
||||
CONFIG_SURFACE_SAM_SID_POWER=m
|
||||
|
||||
#
|
||||
# IPTS touchscreen
|
||||
#
|
||||
CONFIG_TOUCHSCREEN_IPTS=m
|
||||
|
||||
#
|
||||
# Other Drivers
|
||||
#
|
||||
CONFIG_INPUT_SOC_BUTTON_ARRAY=m
|
||||
CONFIG_SURFACE_3_POWER_OPREGION=m
|
||||
CONFIG_SURFACE_3_BUTTON=m
|
||||
CONFIG_SURFACE_3_POWER_OPREGION=m
|
||||
CONFIG_SURFACE_PRO3_BUTTON=m
|
|
@ -1,4 +1,4 @@
|
|||
From 282a7c0dfafdcd6fecd3fef61353e9d8638752fe Mon Sep 17 00:00:00 2001
|
||||
From 776ae5ea12a951312f7fb3d3e69a3e7004eb4f4f Mon Sep 17 00:00:00 2001
|
||||
From: qzed <qzed@users.noreply.github.com>
|
||||
Date: Tue, 17 Sep 2019 17:17:56 +0200
|
||||
Subject: [PATCH 1/7] surface3-power
|
||||
|
@ -11,7 +11,7 @@ Subject: [PATCH 1/7] surface3-power
|
|||
create mode 100644 drivers/platform/x86/surface3_power.c
|
||||
|
||||
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
|
||||
index 1cab99320514..348c795019fa 100644
|
||||
index 1cab993205142..348c795019fa4 100644
|
||||
--- a/drivers/platform/x86/Kconfig
|
||||
+++ b/drivers/platform/x86/Kconfig
|
||||
@@ -1209,6 +1209,13 @@ config SURFACE_3_BUTTON
|
||||
|
@ -29,7 +29,7 @@ index 1cab99320514..348c795019fa 100644
|
|||
tristate "Intel P-Unit IPC Driver"
|
||||
---help---
|
||||
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
|
||||
index 415104033060..6dd955ad9bf1 100644
|
||||
index 4151040330601..6dd955ad9bf18 100644
|
||||
--- a/drivers/platform/x86/Makefile
|
||||
+++ b/drivers/platform/x86/Makefile
|
||||
@@ -85,6 +85,7 @@ obj-$(CONFIG_INTEL_PMC_IPC) += intel_pmc_ipc.o
|
||||
|
@ -42,7 +42,7 @@ index 415104033060..6dd955ad9bf1 100644
|
|||
obj-$(CONFIG_INTEL_TELEMETRY) += intel_telemetry_core.o \
|
||||
diff --git a/drivers/platform/x86/surface3_power.c b/drivers/platform/x86/surface3_power.c
|
||||
new file mode 100644
|
||||
index 000000000000..e0af01a60302
|
||||
index 0000000000000..e0af01a603025
|
||||
--- /dev/null
|
||||
+++ b/drivers/platform/x86/surface3_power.c
|
||||
@@ -0,0 +1,604 @@
|
||||
|
@ -651,5 +651,5 @@ index 000000000000..e0af01a60302
|
|||
+MODULE_DESCRIPTION("mshw0011 driver");
|
||||
+MODULE_LICENSE("GPL v2");
|
||||
--
|
||||
2.25.0
|
||||
2.26.2
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 3e6aef8d1ff405ae075722f3b4a5155b2320a111 Mon Sep 17 00:00:00 2001
|
||||
From 549b0062d79c181f68fc4216901db61b0da0f152 Mon Sep 17 00:00:00 2001
|
||||
From: kitakar5525 <34676735+kitakar5525@users.noreply.github.com>
|
||||
Date: Fri, 6 Dec 2019 23:10:30 +0900
|
||||
Subject: [PATCH 2/7] surface3-spi
|
||||
|
@ -8,7 +8,7 @@ Subject: [PATCH 2/7] surface3-spi
|
|||
1 file changed, 26 insertions(+)
|
||||
|
||||
diff --git a/drivers/input/touchscreen/surface3_spi.c b/drivers/input/touchscreen/surface3_spi.c
|
||||
index ce4828b1415a..63b0b8ddf090 100644
|
||||
index ce4828b1415a8..63b0b8ddf0903 100644
|
||||
--- a/drivers/input/touchscreen/surface3_spi.c
|
||||
+++ b/drivers/input/touchscreen/surface3_spi.c
|
||||
@@ -25,6 +25,12 @@
|
||||
|
@ -59,5 +59,5 @@ index ce4828b1415a..63b0b8ddf090 100644
|
|||
}
|
||||
|
||||
--
|
||||
2.25.0
|
||||
2.26.2
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From dfe2385d2165eedba0ca3bb4fb72bb5293c24c62 Mon Sep 17 00:00:00 2001
|
||||
From 2399e1d0b248cd799d6103ae6ec69449d5145d54 Mon Sep 17 00:00:00 2001
|
||||
From: Chih-Wei Huang <cwhuang@linux.org.tw>
|
||||
Date: Tue, 18 Sep 2018 11:01:37 +0800
|
||||
Subject: [PATCH 3/7] surface3-oemb
|
||||
|
@ -6,11 +6,11 @@ Subject: [PATCH 3/7] surface3-oemb
|
|||
---
|
||||
drivers/platform/x86/surface3-wmi.c | 7 +++++++
|
||||
sound/soc/codecs/rt5645.c | 9 +++++++++
|
||||
sound/soc/intel/common/soc-acpi-intel-cht-match.c | 6 ++++++
|
||||
3 files changed, 22 insertions(+)
|
||||
sound/soc/intel/common/soc-acpi-intel-cht-match.c | 8 ++++++++
|
||||
3 files changed, 24 insertions(+)
|
||||
|
||||
diff --git a/drivers/platform/x86/surface3-wmi.c b/drivers/platform/x86/surface3-wmi.c
|
||||
index 130b6f52a600..801083aa56d6 100644
|
||||
index 130b6f52a6001..801083aa56d6d 100644
|
||||
--- a/drivers/platform/x86/surface3-wmi.c
|
||||
+++ b/drivers/platform/x86/surface3-wmi.c
|
||||
@@ -37,6 +37,13 @@ static const struct dmi_system_id surface3_dmi_table[] = {
|
||||
|
@ -28,7 +28,7 @@ index 130b6f52a600..801083aa56d6 100644
|
|||
{ }
|
||||
};
|
||||
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
|
||||
index 19662ee330d6..dbe70f80d1de 100644
|
||||
index 19662ee330d6b..dbe70f80d1de7 100644
|
||||
--- a/sound/soc/codecs/rt5645.c
|
||||
+++ b/sound/soc/codecs/rt5645.c
|
||||
@@ -3675,6 +3675,15 @@ static const struct dmi_system_id dmi_platform_data[] = {
|
||||
|
@ -48,22 +48,24 @@ index 19662ee330d6..dbe70f80d1de 100644
|
|||
/*
|
||||
* Match for the GPDwin which unfortunately uses somewhat
|
||||
diff --git a/sound/soc/intel/common/soc-acpi-intel-cht-match.c b/sound/soc/intel/common/soc-acpi-intel-cht-match.c
|
||||
index d0fb43c2b9f6..de2583918afd 100644
|
||||
index d0fb43c2b9f68..0e938713cb133 100644
|
||||
--- a/sound/soc/intel/common/soc-acpi-intel-cht-match.c
|
||||
+++ b/sound/soc/intel/common/soc-acpi-intel-cht-match.c
|
||||
@@ -26,6 +26,12 @@ static const struct dmi_system_id cht_table[] = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
||||
@@ -27,6 +27,14 @@ static const struct dmi_system_id cht_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
|
||||
},
|
||||
},
|
||||
+ {
|
||||
+ .callback = cht_surface_quirk_cb,
|
||||
+ .matches = {
|
||||
+ DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
|
||||
+ DMI_MATCH(DMI_SYS_VENDOR, "OEMB"),
|
||||
+ DMI_MATCH(DMI_PRODUCT_NAME, "OEMB"),
|
||||
+ },
|
||||
},
|
||||
+ },
|
||||
{ }
|
||||
};
|
||||
|
||||
--
|
||||
2.25.0
|
||||
2.26.2
|
||||
|
||||
|
|
|
@ -1,97 +0,0 @@
|
|||
From 83aa487e4c43e598ee3e5266e79573ba6e0a3ab7 Mon Sep 17 00:00:00 2001
|
||||
From: Tuowen Zhao <ztuowen@gmail.com>
|
||||
Date: Wed, 16 Oct 2019 15:06:28 -0600
|
||||
Subject: [PATCH 4/7] ioremap_uc
|
||||
|
||||
---
|
||||
.../driver-api/driver-model/devres.rst | 1 +
|
||||
drivers/mfd/intel-lpss.c | 2 +-
|
||||
include/linux/io.h | 2 ++
|
||||
lib/devres.c | 19 +++++++++++++++++++
|
||||
4 files changed, 23 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
|
||||
index a100bef54952..92628fdc2f11 100644
|
||||
--- a/Documentation/driver-api/driver-model/devres.rst
|
||||
+++ b/Documentation/driver-api/driver-model/devres.rst
|
||||
@@ -314,6 +314,7 @@ IOMAP
|
||||
devm_ioport_unmap()
|
||||
devm_ioremap()
|
||||
devm_ioremap_nocache()
|
||||
+ devm_ioremap_uc()
|
||||
devm_ioremap_wc()
|
||||
devm_ioremap_resource() : checks resource, requests memory region, ioremaps
|
||||
devm_iounmap()
|
||||
diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
|
||||
index bfe4ff337581..b0f0781a6b9c 100644
|
||||
--- a/drivers/mfd/intel-lpss.c
|
||||
+++ b/drivers/mfd/intel-lpss.c
|
||||
@@ -384,7 +384,7 @@ int intel_lpss_probe(struct device *dev,
|
||||
if (!lpss)
|
||||
return -ENOMEM;
|
||||
|
||||
- lpss->priv = devm_ioremap(dev, info->mem->start + LPSS_PRIV_OFFSET,
|
||||
+ lpss->priv = devm_ioremap_uc(dev, info->mem->start + LPSS_PRIV_OFFSET,
|
||||
LPSS_PRIV_SIZE);
|
||||
if (!lpss->priv)
|
||||
return -ENOMEM;
|
||||
diff --git a/include/linux/io.h b/include/linux/io.h
|
||||
index accac822336a..a59834bc0a11 100644
|
||||
--- a/include/linux/io.h
|
||||
+++ b/include/linux/io.h
|
||||
@@ -64,6 +64,8 @@ static inline void devm_ioport_unmap(struct device *dev, void __iomem *addr)
|
||||
|
||||
void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
|
||||
resource_size_t size);
|
||||
+void __iomem *devm_ioremap_uc(struct device *dev, resource_size_t offset,
|
||||
+ resource_size_t size);
|
||||
void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset,
|
||||
resource_size_t size);
|
||||
void __iomem *devm_ioremap_wc(struct device *dev, resource_size_t offset,
|
||||
diff --git a/lib/devres.c b/lib/devres.c
|
||||
index 6a0e9bd6524a..17624d35e82d 100644
|
||||
--- a/lib/devres.c
|
||||
+++ b/lib/devres.c
|
||||
@@ -9,6 +9,7 @@
|
||||
enum devm_ioremap_type {
|
||||
DEVM_IOREMAP = 0,
|
||||
DEVM_IOREMAP_NC,
|
||||
+ DEVM_IOREMAP_UC,
|
||||
DEVM_IOREMAP_WC,
|
||||
};
|
||||
|
||||
@@ -39,6 +40,9 @@ static void __iomem *__devm_ioremap(struct device *dev, resource_size_t offset,
|
||||
case DEVM_IOREMAP_NC:
|
||||
addr = ioremap_nocache(offset, size);
|
||||
break;
|
||||
+ case DEVM_IOREMAP_UC:
|
||||
+ addr = ioremap_uc(offset, size);
|
||||
+ break;
|
||||
case DEVM_IOREMAP_WC:
|
||||
addr = ioremap_wc(offset, size);
|
||||
break;
|
||||
@@ -68,6 +72,21 @@ void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
|
||||
}
|
||||
EXPORT_SYMBOL(devm_ioremap);
|
||||
|
||||
+/**
|
||||
+ * devm_ioremap_uc - Managed ioremap_uc()
|
||||
+ * @dev: Generic device to remap IO address for
|
||||
+ * @offset: Resource address to map
|
||||
+ * @size: Size of map
|
||||
+ *
|
||||
+ * Managed ioremap_uc(). Map is automatically unmapped on driver detach.
|
||||
+ */
|
||||
+void __iomem *devm_ioremap_uc(struct device *dev, resource_size_t offset,
|
||||
+ resource_size_t size)
|
||||
+{
|
||||
+ return __devm_ioremap(dev, offset, size, DEVM_IOREMAP_UC);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(devm_ioremap_uc);
|
||||
+
|
||||
/**
|
||||
* devm_ioremap_nocache - Managed ioremap_nocache()
|
||||
* @dev: Generic device to remap IO address for
|
||||
--
|
||||
2.25.0
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,17 +1,17 @@
|
|||
From 459807ca9074d2ffba9ae7754e4c66a0679c6c70 Mon Sep 17 00:00:00 2001
|
||||
From d1452bffe608f437cb7a9db6b7223acf2ad4c87b Mon Sep 17 00:00:00 2001
|
||||
From: qzed <qzed@users.noreply.github.com>
|
||||
Date: Tue, 17 Sep 2019 17:21:43 +0200
|
||||
Subject: [PATCH 6/7] surface-lte
|
||||
Subject: [PATCH 5/7] surface-lte
|
||||
|
||||
---
|
||||
drivers/usb/serial/qcserial.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
|
||||
index 613f91add03d..e1428222dd73 100644
|
||||
index ce0401d3137f1..b0c190cd46c92 100644
|
||||
--- a/drivers/usb/serial/qcserial.c
|
||||
+++ b/drivers/usb/serial/qcserial.c
|
||||
@@ -177,6 +177,7 @@ static const struct usb_device_id id_table[] = {
|
||||
@@ -178,6 +178,7 @@ static const struct usb_device_id id_table[] = {
|
||||
{DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */
|
||||
{DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */
|
||||
{DEVICE_SWI(0x413c, 0x81d2)}, /* Dell Wireless 5818 */
|
||||
|
@ -20,5 +20,5 @@ index 613f91add03d..e1428222dd73 100644
|
|||
/* Huawei devices */
|
||||
{DEVICE_HWI(0x03f0, 0x581d)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) */
|
||||
--
|
||||
2.25.0
|
||||
2.26.2
|
||||
|
255
patches/5.4/0006-wifi.patch
Normal file
255
patches/5.4/0006-wifi.patch
Normal file
|
@ -0,0 +1,255 @@
|
|||
From 503e9e13d52372e50e52438cdf7d3c7113edb771 Mon Sep 17 00:00:00 2001
|
||||
From: kitakar5525 <34676735+kitakar5525@users.noreply.github.com>
|
||||
Date: Thu, 20 Feb 2020 16:51:11 +0900
|
||||
Subject: [PATCH 6/7] wifi
|
||||
|
||||
---
|
||||
.../net/wireless/marvell/mwifiex/cfg80211.c | 26 ++++++
|
||||
drivers/net/wireless/marvell/mwifiex/pcie.c | 84 +++++++++++--------
|
||||
.../net/wireless/marvell/mwifiex/sta_cmd.c | 31 ++-----
|
||||
3 files changed, 84 insertions(+), 57 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
|
||||
index d896841685008..108d7ac6a0dd9 100644
|
||||
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
|
||||
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
|
||||
@@ -25,6 +25,11 @@
|
||||
static char *reg_alpha2;
|
||||
module_param(reg_alpha2, charp, 0);
|
||||
|
||||
+static bool allow_ps_mode;
|
||||
+module_param(allow_ps_mode, bool, 0444);
|
||||
+MODULE_PARM_DESC(allow_ps_mode,
|
||||
+ "allow WiFi power management to be enabled. (default: disallowed)");
|
||||
+
|
||||
static const struct ieee80211_iface_limit mwifiex_ap_sta_limits[] = {
|
||||
{
|
||||
.max = 3, .types = BIT(NL80211_IFTYPE_STATION) |
|
||||
@@ -439,6 +444,27 @@ mwifiex_cfg80211_set_power_mgmt(struct wiphy *wiphy,
|
||||
|
||||
ps_mode = enabled;
|
||||
|
||||
+ /* Allow ps_mode to be enabled only when allow_ps_mode is set
|
||||
+ * (but always allow ps_mode to be disabled in case it gets enabled
|
||||
+ * for unknown reason and you want to disable it) */
|
||||
+ if (ps_mode && !allow_ps_mode) {
|
||||
+ dev_info(priv->adapter->dev,
|
||||
+ "Request to enable ps_mode received but it's disallowed "
|
||||
+ "by module parameter. Rejecting the request.\n");
|
||||
+
|
||||
+ /* Return negative value to inform userspace tools that setting
|
||||
+ * power_save to be enabled is not permitted. */
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (ps_mode)
|
||||
+ dev_warn(priv->adapter->dev,
|
||||
+ "WARN: Request to enable ps_mode received. Enabling it. "
|
||||
+ "Disable it if you encounter connection instability.\n");
|
||||
+ else
|
||||
+ dev_info(priv->adapter->dev,
|
||||
+ "Request to disable ps_mode received. Disabling it.\n");
|
||||
+
|
||||
return mwifiex_drv_set_power(priv, &ps_mode);
|
||||
}
|
||||
|
||||
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
||||
index fc1706d0647d7..b51c5e3571426 100644
|
||||
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
|
||||
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
||||
@@ -146,38 +146,45 @@ static bool mwifiex_pcie_ok_to_access_hw(struct mwifiex_adapter *adapter)
|
||||
*
|
||||
* If already not suspended, this function allocates and sends a host
|
||||
* sleep activate request to the firmware and turns off the traffic.
|
||||
+ *
|
||||
+ * XXX: ignoring all the above comment and just removes the card to
|
||||
+ * fix S0ix and "AP scanning (sometimes) not working after suspend".
|
||||
+ * Required code is extracted from mwifiex_pcie_remove().
|
||||
*/
|
||||
static int mwifiex_pcie_suspend(struct device *dev)
|
||||
{
|
||||
+ struct pci_dev *pdev = to_pci_dev(dev);
|
||||
+ struct pcie_service_card *card = pci_get_drvdata(pdev);
|
||||
struct mwifiex_adapter *adapter;
|
||||
- struct pcie_service_card *card = dev_get_drvdata(dev);
|
||||
-
|
||||
+ struct mwifiex_private *priv;
|
||||
+ const struct mwifiex_pcie_card_reg *reg;
|
||||
+ u32 fw_status;
|
||||
+ int ret;
|
||||
|
||||
/* Might still be loading firmware */
|
||||
wait_for_completion(&card->fw_done);
|
||||
|
||||
adapter = card->adapter;
|
||||
- if (!adapter) {
|
||||
- dev_err(dev, "adapter is not valid\n");
|
||||
+ if (!adapter || !adapter->priv_num)
|
||||
return 0;
|
||||
- }
|
||||
|
||||
- mwifiex_enable_wake(adapter);
|
||||
+ reg = card->pcie.reg;
|
||||
+ if (reg)
|
||||
+ ret = mwifiex_read_reg(adapter, reg->fw_status, &fw_status);
|
||||
+ else
|
||||
+ fw_status = -1;
|
||||
|
||||
- /* Enable the Host Sleep */
|
||||
- if (!mwifiex_enable_hs(adapter)) {
|
||||
- mwifiex_dbg(adapter, ERROR,
|
||||
- "cmd: failed to suspend\n");
|
||||
- clear_bit(MWIFIEX_IS_HS_ENABLING, &adapter->work_flags);
|
||||
- mwifiex_disable_wake(adapter);
|
||||
- return -EFAULT;
|
||||
- }
|
||||
+ if (fw_status == FIRMWARE_READY_PCIE && !adapter->mfg_mode) {
|
||||
+ mwifiex_deauthenticate_all(adapter);
|
||||
|
||||
- flush_workqueue(adapter->workqueue);
|
||||
+ priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
|
||||
+
|
||||
+ mwifiex_disable_auto_ds(priv);
|
||||
|
||||
- /* Indicate device suspended */
|
||||
- set_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags);
|
||||
- clear_bit(MWIFIEX_IS_HS_ENABLING, &adapter->work_flags);
|
||||
+ mwifiex_init_shutdown_fw(priv, MWIFIEX_FUNC_SHUTDOWN);
|
||||
+ }
|
||||
+
|
||||
+ mwifiex_remove_card(adapter);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -189,31 +196,35 @@ static int mwifiex_pcie_suspend(struct device *dev)
|
||||
*
|
||||
* If already not resumed, this function turns on the traffic and
|
||||
* sends a host sleep cancel request to the firmware.
|
||||
+ *
|
||||
+ * XXX: ignoring all the above comment and probes the card that was
|
||||
+ * removed on suspend. Required code is extracted from mwifiex_pcie_probe().
|
||||
*/
|
||||
static int mwifiex_pcie_resume(struct device *dev)
|
||||
{
|
||||
- struct mwifiex_adapter *adapter;
|
||||
- struct pcie_service_card *card = dev_get_drvdata(dev);
|
||||
+ struct pci_dev *pdev = to_pci_dev(dev);
|
||||
+ struct pcie_service_card *card = pci_get_drvdata(pdev);
|
||||
+ int ret;
|
||||
|
||||
+ pr_debug("info: vendor=0x%4.04X device=0x%4.04X rev=%d\n",
|
||||
+ pdev->vendor, pdev->device, pdev->revision);
|
||||
|
||||
- if (!card->adapter) {
|
||||
- dev_err(dev, "adapter structure is not valid\n");
|
||||
- return 0;
|
||||
- }
|
||||
+ init_completion(&card->fw_done);
|
||||
|
||||
- adapter = card->adapter;
|
||||
+ card->dev = pdev;
|
||||
|
||||
- if (!test_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags)) {
|
||||
- mwifiex_dbg(adapter, WARN,
|
||||
- "Device already resumed\n");
|
||||
- return 0;
|
||||
+ /* device tree node parsing and platform specific configuration */
|
||||
+ if (pdev->dev.of_node) {
|
||||
+ ret = mwifiex_pcie_probe_of(&pdev->dev);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
- clear_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags);
|
||||
-
|
||||
- mwifiex_cancel_hs(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA),
|
||||
- MWIFIEX_ASYNC_CMD);
|
||||
- mwifiex_disable_wake(adapter);
|
||||
+ if (mwifiex_add_card(card, &card->fw_done, &pcie_ops,
|
||||
+ MWIFIEX_PCIE, &pdev->dev)) {
|
||||
+ pr_err("%s failed\n", __func__);
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -229,8 +240,13 @@ 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;
|
||||
|
||||
+ /* disable bridge_d3 to fix driver crashing after suspend on gen4+
|
||||
+ * Surface devices */
|
||||
+ parent_pdev->bridge_d3 = false;
|
||||
+
|
||||
pr_debug("info: vendor=0x%4.04X device=0x%4.04X rev=%d\n",
|
||||
pdev->vendor, pdev->device, pdev->revision);
|
||||
|
||||
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
|
||||
index 4ed10cf82f9a4..410bef3d6a6eb 100644
|
||||
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
|
||||
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
|
||||
@@ -2254,7 +2254,6 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
|
||||
* - Function init (for first interface only)
|
||||
* - Read MAC address (for first interface only)
|
||||
* - Reconfigure Tx buffer size (for first interface only)
|
||||
- * - Enable auto deep sleep (for first interface only)
|
||||
* - Get Tx rate
|
||||
* - Get Tx power
|
||||
* - Set IBSS coalescing status
|
||||
@@ -2267,7 +2266,6 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
|
||||
struct mwifiex_adapter *adapter = priv->adapter;
|
||||
int ret;
|
||||
struct mwifiex_ds_11n_amsdu_aggr_ctrl amsdu_aggr_ctrl;
|
||||
- struct mwifiex_ds_auto_ds auto_ds;
|
||||
enum state_11d_t state_11d;
|
||||
struct mwifiex_ds_11n_tx_cfg tx_cfg;
|
||||
u8 sdio_sp_rx_aggr_enable;
|
||||
@@ -2339,16 +2337,10 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
|
||||
if (ret)
|
||||
return -1;
|
||||
|
||||
- if (priv->bss_type != MWIFIEX_BSS_TYPE_UAP) {
|
||||
- /* Enable IEEE PS by default */
|
||||
- priv->adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_PSP;
|
||||
- ret = mwifiex_send_cmd(priv,
|
||||
- HostCmd_CMD_802_11_PS_MODE_ENH,
|
||||
- EN_AUTO_PS, BITMAP_STA_PS, NULL,
|
||||
- true);
|
||||
- if (ret)
|
||||
- return -1;
|
||||
- }
|
||||
+ /* Not enabling ps_mode (IEEE power_save) by default. Enabling
|
||||
+ * this causes connection instability, especially on 5GHz APs
|
||||
+ * and eventually causes "firmware wakeup failed". Therefore,
|
||||
+ * the relevant code was removed from here. */
|
||||
|
||||
if (drcs) {
|
||||
adapter->drcs_enabled = true;
|
||||
@@ -2395,17 +2387,10 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
|
||||
if (ret)
|
||||
return -1;
|
||||
|
||||
- if (!disable_auto_ds && first_sta &&
|
||||
- priv->bss_type != MWIFIEX_BSS_TYPE_UAP) {
|
||||
- /* Enable auto deep sleep */
|
||||
- auto_ds.auto_ds = DEEP_SLEEP_ON;
|
||||
- auto_ds.idle_time = DEEP_SLEEP_IDLE_TIME;
|
||||
- ret = mwifiex_send_cmd(priv, HostCmd_CMD_802_11_PS_MODE_ENH,
|
||||
- EN_AUTO_PS, BITMAP_AUTO_DS,
|
||||
- &auto_ds, true);
|
||||
- if (ret)
|
||||
- return -1;
|
||||
- }
|
||||
+ /* Not enabling auto deep sleep (auto_ds) by default. Enabling
|
||||
+ * this reportedly causes "suspend/resume fails when not connected
|
||||
+ * to an Access Point." Therefore, the relevant code was removed
|
||||
+ * from here. */
|
||||
|
||||
if (priv->bss_type != MWIFIEX_BSS_TYPE_UAP) {
|
||||
/* Send cmd to FW to enable/disable 11D function */
|
||||
--
|
||||
2.26.2
|
||||
|
2061
patches/5.4/0007-ipts.patch
Normal file
2061
patches/5.4/0007-ipts.patch
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,168 +0,0 @@
|
|||
From 161c9aed6b224308438cec3aa48c896cba48b431 Mon Sep 17 00:00:00 2001
|
||||
From: sebanc <22224731+sebanc@users.noreply.github.com>
|
||||
Date: Mon, 4 Nov 2019 09:30:57 +0100
|
||||
Subject: [PATCH 7/7] wifi
|
||||
|
||||
---
|
||||
drivers/net/wireless/marvell/mwifiex/pcie.c | 74 ++++++++++---------
|
||||
.../net/wireless/marvell/mwifiex/sta_cmd.c | 15 +---
|
||||
2 files changed, 41 insertions(+), 48 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
||||
index fc1706d0647d..b3380ed75431 100644
|
||||
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
|
||||
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
||||
@@ -149,35 +149,38 @@ static bool mwifiex_pcie_ok_to_access_hw(struct mwifiex_adapter *adapter)
|
||||
*/
|
||||
static int mwifiex_pcie_suspend(struct device *dev)
|
||||
{
|
||||
+ struct pci_dev *pdev = to_pci_dev(dev);
|
||||
+ struct pcie_service_card *card = pci_get_drvdata(pdev);
|
||||
struct mwifiex_adapter *adapter;
|
||||
- struct pcie_service_card *card = dev_get_drvdata(dev);
|
||||
-
|
||||
+ struct mwifiex_private *priv;
|
||||
+ const struct mwifiex_pcie_card_reg *reg;
|
||||
+ u32 fw_status;
|
||||
+ int ret;
|
||||
|
||||
/* Might still be loading firmware */
|
||||
wait_for_completion(&card->fw_done);
|
||||
|
||||
adapter = card->adapter;
|
||||
- if (!adapter) {
|
||||
- dev_err(dev, "adapter is not valid\n");
|
||||
+ if (!adapter || !adapter->priv_num)
|
||||
return 0;
|
||||
- }
|
||||
|
||||
- mwifiex_enable_wake(adapter);
|
||||
+ reg = card->pcie.reg;
|
||||
+ if (reg)
|
||||
+ ret = mwifiex_read_reg(adapter, reg->fw_status, &fw_status);
|
||||
+ else
|
||||
+ fw_status = -1;
|
||||
+
|
||||
+ if (fw_status == FIRMWARE_READY_PCIE && !adapter->mfg_mode) {
|
||||
+ mwifiex_deauthenticate_all(adapter);
|
||||
|
||||
- /* Enable the Host Sleep */
|
||||
- if (!mwifiex_enable_hs(adapter)) {
|
||||
- mwifiex_dbg(adapter, ERROR,
|
||||
- "cmd: failed to suspend\n");
|
||||
- clear_bit(MWIFIEX_IS_HS_ENABLING, &adapter->work_flags);
|
||||
- mwifiex_disable_wake(adapter);
|
||||
- return -EFAULT;
|
||||
- }
|
||||
+ priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
|
||||
|
||||
- flush_workqueue(adapter->workqueue);
|
||||
+ mwifiex_disable_auto_ds(priv);
|
||||
|
||||
- /* Indicate device suspended */
|
||||
- set_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags);
|
||||
- clear_bit(MWIFIEX_IS_HS_ENABLING, &adapter->work_flags);
|
||||
+ mwifiex_init_shutdown_fw(priv, MWIFIEX_FUNC_SHUTDOWN);
|
||||
+ }
|
||||
+
|
||||
+ mwifiex_remove_card(adapter);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -192,28 +195,29 @@ static int mwifiex_pcie_suspend(struct device *dev)
|
||||
*/
|
||||
static int mwifiex_pcie_resume(struct device *dev)
|
||||
{
|
||||
- struct mwifiex_adapter *adapter;
|
||||
- struct pcie_service_card *card = dev_get_drvdata(dev);
|
||||
+ struct pci_dev *pdev = to_pci_dev(dev);
|
||||
+ struct pcie_service_card *card = pci_get_drvdata(pdev);
|
||||
+ int ret;
|
||||
|
||||
+ pr_debug("info: vendor=0x%4.04X device=0x%4.04X rev=%d\n",
|
||||
+ pdev->vendor, pdev->device, pdev->revision);
|
||||
|
||||
- if (!card->adapter) {
|
||||
- dev_err(dev, "adapter structure is not valid\n");
|
||||
- return 0;
|
||||
- }
|
||||
+ init_completion(&card->fw_done);
|
||||
|
||||
- adapter = card->adapter;
|
||||
+ card->dev = pdev;
|
||||
|
||||
- if (!test_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags)) {
|
||||
- mwifiex_dbg(adapter, WARN,
|
||||
- "Device already resumed\n");
|
||||
- return 0;
|
||||
+ /* device tree node parsing and platform specific configuration */
|
||||
+ if (pdev->dev.of_node) {
|
||||
+ ret = mwifiex_pcie_probe_of(&pdev->dev);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
- clear_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags);
|
||||
-
|
||||
- mwifiex_cancel_hs(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA),
|
||||
- MWIFIEX_ASYNC_CMD);
|
||||
- mwifiex_disable_wake(adapter);
|
||||
+ if (mwifiex_add_card(card, &card->fw_done, &pcie_ops,
|
||||
+ MWIFIEX_PCIE, &pdev->dev)) {
|
||||
+ pr_err("%s failed\n", __func__);
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -267,6 +271,8 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev,
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ pdev->bus->self->bridge_d3 = false;
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
|
||||
index 4ed10cf82f9a..013db4386c39 100644
|
||||
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
|
||||
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
|
||||
@@ -2265,14 +2265,13 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
|
||||
int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
|
||||
{
|
||||
struct mwifiex_adapter *adapter = priv->adapter;
|
||||
- int ret;
|
||||
struct mwifiex_ds_11n_amsdu_aggr_ctrl amsdu_aggr_ctrl;
|
||||
- struct mwifiex_ds_auto_ds auto_ds;
|
||||
enum state_11d_t state_11d;
|
||||
struct mwifiex_ds_11n_tx_cfg tx_cfg;
|
||||
u8 sdio_sp_rx_aggr_enable;
|
||||
u16 packet_aggr_enable;
|
||||
int data;
|
||||
+ int ret;
|
||||
|
||||
if (first_sta) {
|
||||
if (priv->adapter->iface_type == MWIFIEX_PCIE) {
|
||||
@@ -2395,18 +2394,6 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
|
||||
if (ret)
|
||||
return -1;
|
||||
|
||||
- if (!disable_auto_ds && first_sta &&
|
||||
- priv->bss_type != MWIFIEX_BSS_TYPE_UAP) {
|
||||
- /* Enable auto deep sleep */
|
||||
- auto_ds.auto_ds = DEEP_SLEEP_ON;
|
||||
- auto_ds.idle_time = DEEP_SLEEP_IDLE_TIME;
|
||||
- ret = mwifiex_send_cmd(priv, HostCmd_CMD_802_11_PS_MODE_ENH,
|
||||
- EN_AUTO_PS, BITMAP_AUTO_DS,
|
||||
- &auto_ds, true);
|
||||
- if (ret)
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
if (priv->bss_type != MWIFIEX_BSS_TYPE_UAP) {
|
||||
/* Send cmd to FW to enable/disable 11D function */
|
||||
state_11d = ENABLE_11D;
|
||||
--
|
||||
2.25.0
|
||||
|
Loading…
Reference in a new issue