Forráskód Böngészése

Update v4.19 patches

Changes:
  SAM:
    - Add support for Surface Book 3 in Surface HPS driver. The dGPU of
      the Surface Book 3 can now be turned on and off via the same
      mechanism already being used by the Surface Book 2.
    - Add SID devices for Surface Pro 6 with MSHW0111 ID.
    - Complete restructure of Surface Serial Hub driver internals. The
      old synchronous communication core has been replaced by a
      completely asynchronous implementation.
    - Misc. code improvements and clean-up.

References:
  kernel: https://github.com/linux-surface/kernel/commit/ab0ac25c9e46117ee376ad46383148a54774287b
  SAM: https://github.com/linux-surface/surface-aggregator-module/commit/6715faf265fd275aec0f5fab253cceecc9e5044e
Maximilian Luz 5 éve
szülő
commit
5202f18245

+ 6 - 6
patches/4.19/0001-surface3-power.patch

@@ -1,7 +1,7 @@
-From a2b33dd39478cc3c162c3e76a2a0bd888be6b019 Mon Sep 17 00:00:00 2001
+From 0cdf7b25f3375ca695c9622052aea85b5d62aa26 Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Sat, 28 Sep 2019 18:00:43 +0200
-Subject: [PATCH 01/10] surface3-power
+Subject: [PATCH 1/8] surface3-power
 
 ---
  drivers/platform/x86/Kconfig          |   7 +
@@ -11,7 +11,7 @@ Subject: [PATCH 01/10] surface3-power
  create mode 100644 drivers/platform/x86/surface3_power.c
 
 diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
-index 1e2524de6a63..2ad19dc64a4a 100644
+index 1e2524de6a63c..2ad19dc64a4af 100644
 --- a/drivers/platform/x86/Kconfig
 +++ b/drivers/platform/x86/Kconfig
 @@ -1160,6 +1160,13 @@ config SURFACE_3_BUTTON
@@ -29,7 +29,7 @@ index 1e2524de6a63..2ad19dc64a4a 100644
  	tristate "Intel P-Unit IPC Driver"
  	---help---
 diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
-index dc29af4d8e2f..2ea90039a3e4 100644
+index dc29af4d8e2fa..2ea90039a3e49 100644
 --- a/drivers/platform/x86/Makefile
 +++ b/drivers/platform/x86/Makefile
 @@ -81,6 +81,7 @@ obj-$(CONFIG_INTEL_PMC_IPC)	+= intel_pmc_ipc.o
@@ -42,7 +42,7 @@ index dc29af4d8e2f..2ea90039a3e4 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.26.2
+2.27.0
 

+ 4 - 4
patches/4.19/0002-surface3-spi.patch

@@ -1,14 +1,14 @@
-From 06e4d51c83a77d54ca5b1d402fb57554c51d3926 Mon Sep 17 00:00:00 2001
+From 269aabb2d471ff68167a0d515a1fb7d96b6b0a1b 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 02/10] surface3-spi
+Subject: [PATCH 2/8] surface3-spi
 
 ---
  drivers/input/touchscreen/surface3_spi.c | 26 ++++++++++++++++++++++++
  1 file changed, 26 insertions(+)
 
 diff --git a/drivers/input/touchscreen/surface3_spi.c b/drivers/input/touchscreen/surface3_spi.c
-index 5db0f1c4ef38..8935ddbc2357 100644
+index 5db0f1c4ef384..8935ddbc23574 100644
 --- a/drivers/input/touchscreen/surface3_spi.c
 +++ b/drivers/input/touchscreen/surface3_spi.c
 @@ -29,6 +29,12 @@
@@ -59,5 +59,5 @@ index 5db0f1c4ef38..8935ddbc2357 100644
  }
  
 -- 
-2.26.2
+2.27.0
 

+ 7 - 7
patches/4.19/0003-surface3-oemb.patch

@@ -1,7 +1,7 @@
-From c9fd73ef014ee91d0cda46c2c456ae579ba3b4e0 Mon Sep 17 00:00:00 2001
+From 39843798645bf98c1176b18a12d090706bf63337 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 03/10] surface3-oemb
+Subject: [PATCH 3/8] surface3-oemb
 
 ---
  drivers/platform/x86/surface3-wmi.c               | 7 +++++++
@@ -10,7 +10,7 @@ Subject: [PATCH 03/10] surface3-oemb
  3 files changed, 24 insertions(+)
 
 diff --git a/drivers/platform/x86/surface3-wmi.c b/drivers/platform/x86/surface3-wmi.c
-index 25b176996cb7..58d11877677f 100644
+index 25b176996cb79..58d11877677f2 100644
 --- a/drivers/platform/x86/surface3-wmi.c
 +++ b/drivers/platform/x86/surface3-wmi.c
 @@ -41,6 +41,13 @@ static const struct dmi_system_id surface3_dmi_table[] = {
@@ -28,10 +28,10 @@ index 25b176996cb7..58d11877677f 100644
  	{ }
  };
 diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
-index 7e3b47eeea04..85c0731dfd4b 100644
+index 9185bd7c5a6dc..a514d03ae58fc 100644
 --- a/sound/soc/codecs/rt5645.c
 +++ b/sound/soc/codecs/rt5645.c
-@@ -3706,6 +3706,15 @@ static const struct dmi_system_id dmi_platform_data[] = {
+@@ -3712,6 +3712,15 @@ static const struct dmi_system_id dmi_platform_data[] = {
  		},
  		.driver_data = (void *)&intel_braswell_platform_data,
  	},
@@ -48,7 +48,7 @@ index 7e3b47eeea04..85c0731dfd4b 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 91bb99b69601..8418938b32ad 100644
+index 91bb99b69601d..8418938b32ad5 100644
 --- a/sound/soc/intel/common/soc-acpi-intel-cht-match.c
 +++ b/sound/soc/intel/common/soc-acpi-intel-cht-match.c
 @@ -36,6 +36,14 @@ static const struct dmi_system_id cht_table[] = {
@@ -67,5 +67,5 @@ index 91bb99b69601..8418938b32ad 100644
  };
  
 -- 
-2.26.2
+2.27.0
 

+ 6 - 6
patches/4.19/0004-surface-buttons.patch

@@ -1,7 +1,7 @@
-From 25c1108f70fde7cca28e5f851427108737443088 Mon Sep 17 00:00:00 2001
+From 36033252cb6c138adf31c22e9f80abd852598c9c Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Sat, 27 Jul 2019 17:51:37 +0200
-Subject: [PATCH 04/10] surface-buttons
+Subject: [PATCH 4/8] surface-buttons
 
 ---
  drivers/input/misc/Kconfig                |   6 +-
@@ -10,7 +10,7 @@ Subject: [PATCH 04/10] surface-buttons
  3 files changed, 151 insertions(+), 16 deletions(-)
 
 diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
-index ca59a2be9bc5..ea69610370e8 100644
+index ca59a2be9bc53..ea69610370e84 100644
 --- a/drivers/input/misc/Kconfig
 +++ b/drivers/input/misc/Kconfig
 @@ -781,10 +781,10 @@ config INPUT_IDEAPAD_SLIDEBAR
@@ -28,7 +28,7 @@ index ca59a2be9bc5..ea69610370e8 100644
  	  To compile this driver as a module, choose M here: the
  	  module will be called soc_button_array.
 diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
-index 55cd6e0b409c..c564ea99f47d 100644
+index 55cd6e0b409c3..c564ea99f47db 100644
 --- a/drivers/input/misc/soc_button_array.c
 +++ b/drivers/input/misc/soc_button_array.c
 @@ -29,6 +29,11 @@ struct soc_button_info {
@@ -200,7 +200,7 @@ index 55cd6e0b409c..c564ea99f47d 100644
  };
  
 diff --git a/drivers/platform/x86/surfacepro3_button.c b/drivers/platform/x86/surfacepro3_button.c
-index 1b491690ce07..96627627060e 100644
+index 1b491690ce070..96627627060e9 100644
 --- a/drivers/platform/x86/surfacepro3_button.c
 +++ b/drivers/platform/x86/surfacepro3_button.c
 @@ -24,6 +24,12 @@
@@ -272,5 +272,5 @@ index 1b491690ce07..96627627060e 100644
  	if (!button)
  		return -ENOMEM;
 -- 
-2.26.2
+2.27.0
 

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 366 - 173
patches/4.19/0005-surface-sam.patch


+ 12 - 12
patches/4.19/0006-suspend.patch

@@ -1,7 +1,7 @@
-From 9fbb880aaed6b854547a6019cdfd2e78013f8fbb Mon Sep 17 00:00:00 2001
+From e853cd24e0d7909a3ae08521cc103a5f66c1df91 Mon Sep 17 00:00:00 2001
 From: kitakar5525 <34676735+kitakar5525@users.noreply.github.com>
 Date: Sat, 28 Sep 2019 17:48:21 +0200
-Subject: [PATCH 06/10] suspend
+Subject: [PATCH 6/8] suspend
 
 ---
  drivers/nvme/host/core.c |  36 ++++++++++++--
@@ -12,10 +12,10 @@ Subject: [PATCH 06/10] suspend
  5 files changed, 162 insertions(+), 6 deletions(-)
 
 diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
-index d5359c7c811a..04e1568b145a 100644
+index 0d60f2f8f3eec..6dcd37c10153f 100644
 --- a/drivers/nvme/host/core.c
 +++ b/drivers/nvme/host/core.c
-@@ -1055,15 +1055,15 @@ static struct nvme_id_ns *nvme_identify_ns(struct nvme_ctrl *ctrl,
+@@ -1068,15 +1068,15 @@ static struct nvme_id_ns *nvme_identify_ns(struct nvme_ctrl *ctrl,
  	return id;
  }
  
@@ -34,7 +34,7 @@ index d5359c7c811a..04e1568b145a 100644
  	c.features.fid = cpu_to_le32(fid);
  	c.features.dword11 = cpu_to_le32(dword11);
  
-@@ -1074,6 +1074,24 @@ static int nvme_set_features(struct nvme_ctrl *dev, unsigned fid, unsigned dword
+@@ -1087,6 +1087,24 @@ static int nvme_set_features(struct nvme_ctrl *dev, unsigned fid, unsigned dword
  	return ret;
  }
  
@@ -59,7 +59,7 @@ index d5359c7c811a..04e1568b145a 100644
  int nvme_set_queue_count(struct nvme_ctrl *ctrl, int *count)
  {
  	u32 q_count = (*count - 1) | ((*count - 1) << 16);
-@@ -3601,6 +3619,18 @@ static void nvme_free_ctrl(struct device *dev)
+@@ -3613,6 +3631,18 @@ static void nvme_free_ctrl(struct device *dev)
  		nvme_put_subsystem(subsys);
  }
  
@@ -79,7 +79,7 @@ index d5359c7c811a..04e1568b145a 100644
   * Initialize a NVMe controller structures.  This needs to be called during
   * earliest initialization so that we have the initialized structured around
 diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
-index cc4273f11989..40192b661798 100644
+index cc4273f119894..40192b6617983 100644
 --- a/drivers/nvme/host/nvme.h
 +++ b/drivers/nvme/host/nvme.h
 @@ -436,6 +436,7 @@ void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status,
@@ -104,7 +104,7 @@ index cc4273f11989..40192b661798 100644
  void nvme_stop_keep_alive(struct nvme_ctrl *ctrl);
  int nvme_reset_ctrl(struct nvme_ctrl *ctrl);
 diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
-index 3c68a5b35ec1..0cc7bea4eb70 100644
+index 3c68a5b35ec1b..0cc7bea4eb707 100644
 --- a/drivers/nvme/host/pci.c
 +++ b/drivers/nvme/host/pci.c
 @@ -26,6 +26,7 @@
@@ -266,10 +266,10 @@ index 3c68a5b35ec1..0cc7bea4eb70 100644
  	.err_handler	= &nvme_err_handler,
  };
 diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
-index db2efa219028..0d1ef41abea0 100644
+index 6e50f84733b75..b03884b6bc6f8 100644
 --- a/drivers/pci/pcie/aspm.c
 +++ b/drivers/pci/pcie/aspm.c
-@@ -1180,6 +1180,26 @@ static int pcie_aspm_get_policy(char *buffer, const struct kernel_param *kp)
+@@ -1170,6 +1170,26 @@ static int pcie_aspm_get_policy(char *buffer, const struct kernel_param *kp)
  module_param_call(policy, pcie_aspm_set_policy, pcie_aspm_get_policy,
  	NULL, 0644);
  
@@ -297,7 +297,7 @@ index db2efa219028..0d1ef41abea0 100644
  static ssize_t link_state_show(struct device *dev,
  		struct device_attribute *attr,
 diff --git a/include/linux/pci.h b/include/linux/pci.h
-index b1f297f4b7b0..94ab2fc800d3 100644
+index b1f297f4b7b0b..94ab2fc800d30 100644
 --- a/include/linux/pci.h
 +++ b/include/linux/pci.h
 @@ -1486,8 +1486,10 @@ extern bool pcie_ports_native;
@@ -312,5 +312,5 @@ index b1f297f4b7b0..94ab2fc800d3 100644
  
  #ifdef CONFIG_PCIEAER
 -- 
-2.26.2
+2.27.0
 

+ 54 - 54
patches/4.19/0007-ipts.patch

@@ -1,7 +1,7 @@
-From ec6ee78e1b8700139edd50e62e3815d12e5a889e Mon Sep 17 00:00:00 2001
+From 1be5cc4b139b8ec070d12b786fad6fba41f4c34a Mon Sep 17 00:00:00 2001
 From: Maximilian Luz <luzmaximilian@gmail.com>
 Date: Sat, 28 Sep 2019 17:58:17 +0200
-Subject: [PATCH 07/10] ipts
+Subject: [PATCH 7/8] ipts
 
 ---
  drivers/gpu/drm/i915/Makefile               |    3 +
@@ -89,7 +89,7 @@ Subject: [PATCH 07/10] ipts
  create mode 100644 include/linux/ipts.h
 
 diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
-index 5794f102f9b8..6ae0e91a213a 100644
+index 5794f102f9b8f..6ae0e91a213af 100644
 --- a/drivers/gpu/drm/i915/Makefile
 +++ b/drivers/gpu/drm/i915/Makefile
 @@ -155,6 +155,9 @@ i915-y += dvo_ch7017.o \
@@ -103,7 +103,7 @@ index 5794f102f9b8..6ae0e91a213a 100644
  i915-$(CONFIG_DRM_I915_CAPTURE_ERROR) += i915_gpu_error.o
  i915-$(CONFIG_DRM_I915_SELFTEST) += \
 diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
-index e063e98d1e82..99becb6aed68 100644
+index e063e98d1e82e..99becb6aed688 100644
 --- a/drivers/gpu/drm/i915/i915_debugfs.c
 +++ b/drivers/gpu/drm/i915/i915_debugfs.c
 @@ -31,6 +31,7 @@
@@ -191,7 +191,7 @@ index e063e98d1e82..99becb6aed68 100644
  
  int i915_debugfs_register(struct drm_i915_private *dev_priv)
 diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
-index b0d76a7a0946..81fba8e5ab05 100644
+index b0d76a7a0946f..81fba8e5ab050 100644
 --- a/drivers/gpu/drm/i915/i915_drv.c
 +++ b/drivers/gpu/drm/i915/i915_drv.c
 @@ -47,11 +47,12 @@
@@ -229,7 +229,7 @@ index b0d76a7a0946..81fba8e5ab05 100644
  
  	if (i915_gem_suspend(dev_priv))
 diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
-index db2e9af49ae6..99bc0c92c411 100644
+index db2e9af49ae6f..99bc0c92c4111 100644
 --- a/drivers/gpu/drm/i915/i915_drv.h
 +++ b/drivers/gpu/drm/i915/i915_drv.h
 @@ -3232,6 +3232,9 @@ void i915_gem_object_do_bit_17_swizzle(struct drm_i915_gem_object *obj,
@@ -243,7 +243,7 @@ index db2e9af49ae6..99bc0c92c411 100644
  __i915_gem_context_lookup_rcu(struct drm_i915_file_private *file_priv, u32 id)
  {
 diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
-index ef383fd42988..89da4ff09431 100644
+index ef383fd429885..89da4ff094312 100644
 --- a/drivers/gpu/drm/i915/i915_gem_context.c
 +++ b/drivers/gpu/drm/i915/i915_gem_context.c
 @@ -472,6 +472,18 @@ static bool needs_preempt_context(struct drm_i915_private *i915)
@@ -266,7 +266,7 @@ index ef383fd42988..89da4ff09431 100644
  {
  	struct i915_gem_context *ctx;
 diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
-index 29877969310d..37a58b19ec3f 100644
+index b7c3982321369..adf168aed2fe3 100644
 --- a/drivers/gpu/drm/i915/i915_irq.c
 +++ b/drivers/gpu/drm/i915/i915_irq.c
 @@ -36,6 +36,7 @@
@@ -287,7 +287,7 @@ index 29877969310d..37a58b19ec3f 100644
  	if (tasklet)
  		tasklet_hi_schedule(&engine->execlists.tasklet);
  }
-@@ -4122,7 +4126,8 @@ static void gen8_gt_irq_postinstall(struct drm_i915_private *dev_priv)
+@@ -4123,7 +4127,8 @@ static void gen8_gt_irq_postinstall(struct drm_i915_private *dev_priv)
  {
  	/* These are interrupts we'll toggle with the ring mask register */
  	uint32_t gt_interrupts[] = {
@@ -298,7 +298,7 @@ index 29877969310d..37a58b19ec3f 100644
  			GT_RENDER_USER_INTERRUPT << GEN8_BCS_IRQ_SHIFT |
  			GT_CONTEXT_SWITCH_INTERRUPT << GEN8_BCS_IRQ_SHIFT,
 diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
-index 295e981e4a39..84415814c007 100644
+index 295e981e4a398..84415814c0070 100644
 --- a/drivers/gpu/drm/i915/i915_params.c
 +++ b/drivers/gpu/drm/i915/i915_params.c
 @@ -145,7 +145,10 @@ i915_param_named_unsafe(edp_vswing, int, 0400,
@@ -314,7 +314,7 @@ index 295e981e4a39..84415814c007 100644
  i915_param_named(guc_log_level, int, 0400,
  	"GuC firmware logging level. Requires GuC to be loaded. "
 diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
-index 6c4d4a21474b..4ab800c3de6d 100644
+index 6c4d4a21474b5..4ab800c3de6d0 100644
 --- a/drivers/gpu/drm/i915/i915_params.h
 +++ b/drivers/gpu/drm/i915/i915_params.h
 @@ -46,7 +46,7 @@ struct drm_printer;
@@ -337,7 +337,7 @@ index 6c4d4a21474b..4ab800c3de6d 100644
  #define MEMBER(T, member, ...) T member;
  struct i915_params {
 diff --git a/drivers/gpu/drm/i915/intel_guc.h b/drivers/gpu/drm/i915/intel_guc.h
-index 4121928a495e..8967376accf3 100644
+index 4121928a495e0..8967376accf30 100644
 --- a/drivers/gpu/drm/i915/intel_guc.h
 +++ b/drivers/gpu/drm/i915/intel_guc.h
 @@ -69,6 +69,7 @@ struct intel_guc {
@@ -349,7 +349,7 @@ index 4121928a495e..8967376accf3 100644
  	struct guc_preempt_work preempt_work[I915_NUM_ENGINES];
  	struct workqueue_struct *preempt_wq;
 diff --git a/drivers/gpu/drm/i915/intel_guc_submission.c b/drivers/gpu/drm/i915/intel_guc_submission.c
-index 4aa5e6463e7b..da80c5f17fee 100644
+index 4aa5e6463e7b7..da80c5f17feea 100644
 --- a/drivers/gpu/drm/i915/intel_guc_submission.c
 +++ b/drivers/gpu/drm/i915/intel_guc_submission.c
 @@ -88,12 +88,17 @@ static inline struct i915_priolist *to_priolist(struct rb_node *rb)
@@ -481,7 +481,7 @@ index 4aa5e6463e7b..da80c5f17fee 100644
  #include "selftests/intel_guc.c"
  #endif
 diff --git a/drivers/gpu/drm/i915/intel_guc_submission.h b/drivers/gpu/drm/i915/intel_guc_submission.h
-index fb081cefef93..71fc7986585a 100644
+index fb081cefef935..71fc7986585ab 100644
 --- a/drivers/gpu/drm/i915/intel_guc_submission.h
 +++ b/drivers/gpu/drm/i915/intel_guc_submission.h
 @@ -79,5 +79,9 @@ void intel_guc_submission_disable(struct intel_guc *guc);
@@ -496,7 +496,7 @@ index fb081cefef93..71fc7986585a 100644
  #endif
 diff --git a/drivers/gpu/drm/i915/intel_ipts.c b/drivers/gpu/drm/i915/intel_ipts.c
 new file mode 100644
-index 000000000000..c1199074924a
+index 0000000000000..c1199074924a0
 --- /dev/null
 +++ b/drivers/gpu/drm/i915/intel_ipts.c
 @@ -0,0 +1,650 @@
@@ -1152,7 +1152,7 @@ index 000000000000..c1199074924a
 +}
 diff --git a/drivers/gpu/drm/i915/intel_ipts.h b/drivers/gpu/drm/i915/intel_ipts.h
 new file mode 100644
-index 000000000000..67f90b72f237
+index 0000000000000..67f90b72f2378
 --- /dev/null
 +++ b/drivers/gpu/drm/i915/intel_ipts.h
 @@ -0,0 +1,34 @@
@@ -1191,7 +1191,7 @@ index 000000000000..67f90b72f237
 +
 +#endif //_INTEL_IPTS_H_
 diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
-index 13e97faabaa7..a4af67d3d6ff 100644
+index 13e97faabaa74..a4af67d3d6ffd 100644
 --- a/drivers/gpu/drm/i915/intel_lrc.c
 +++ b/drivers/gpu/drm/i915/intel_lrc.c
 @@ -164,9 +164,6 @@
@@ -1242,7 +1242,7 @@ index 13e97faabaa7..a4af67d3d6ff 100644
  					    struct intel_context *ce)
  {
 diff --git a/drivers/gpu/drm/i915/intel_lrc.h b/drivers/gpu/drm/i915/intel_lrc.h
-index 4dfb78e3ec7e..32159231a16e 100644
+index 4dfb78e3ec7e4..32159231a16e7 100644
 --- a/drivers/gpu/drm/i915/intel_lrc.h
 +++ b/drivers/gpu/drm/i915/intel_lrc.h
 @@ -106,4 +106,12 @@ void intel_lr_context_resume(struct drm_i915_private *dev_priv);
@@ -1259,7 +1259,7 @@ index 4dfb78e3ec7e..32159231a16e 100644
 +
  #endif /* _INTEL_LRC_H_ */
 diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
-index 4a9f139e7b73..c137a57f6702 100644
+index 4a9f139e7b738..c137a57f67026 100644
 --- a/drivers/gpu/drm/i915/intel_panel.c
 +++ b/drivers/gpu/drm/i915/intel_panel.c
 @@ -34,6 +34,7 @@
@@ -1291,7 +1291,7 @@ index 4a9f139e7b73..c137a57f6702 100644
  
  static void pch_enable_backlight(const struct intel_crtc_state *crtc_state,
 diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
-index 3726eacdf65d..77263b5f5915 100644
+index 3726eacdf65de..77263b5f5915a 100644
 --- a/drivers/misc/Kconfig
 +++ b/drivers/misc/Kconfig
 @@ -520,6 +520,7 @@ source "drivers/misc/ti-st/Kconfig"
@@ -1303,7 +1303,7 @@ index 3726eacdf65d..77263b5f5915 100644
  source "drivers/misc/mic/Kconfig"
  source "drivers/misc/genwqe/Kconfig"
 diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
-index af22bbc3d00c..eb1eb0d58c32 100644
+index af22bbc3d00cb..eb1eb0d58c327 100644
 --- a/drivers/misc/Makefile
 +++ b/drivers/misc/Makefile
 @@ -44,6 +44,7 @@ obj-y				+= lis3lv02d/
@@ -1316,7 +1316,7 @@ index af22bbc3d00c..eb1eb0d58c32 100644
  obj-$(CONFIG_SRAM)		+= sram.o
 diff --git a/drivers/misc/ipts/Kconfig b/drivers/misc/ipts/Kconfig
 new file mode 100644
-index 000000000000..900d2c58ca74
+index 0000000000000..900d2c58ca74c
 --- /dev/null
 +++ b/drivers/misc/ipts/Kconfig
 @@ -0,0 +1,12 @@
@@ -1334,7 +1334,7 @@ index 000000000000..900d2c58ca74
 +source "drivers/misc/ipts/companion/Kconfig"
 diff --git a/drivers/misc/ipts/Makefile b/drivers/misc/ipts/Makefile
 new file mode 100644
-index 000000000000..bb3982f48afc
+index 0000000000000..bb3982f48afcb
 --- /dev/null
 +++ b/drivers/misc/ipts/Makefile
 @@ -0,0 +1,19 @@
@@ -1359,7 +1359,7 @@ index 000000000000..bb3982f48afc
 +obj-y += companion/
 diff --git a/drivers/misc/ipts/companion.c b/drivers/misc/ipts/companion.c
 new file mode 100644
-index 000000000000..8f66b852f137
+index 0000000000000..8f66b852f1371
 --- /dev/null
 +++ b/drivers/misc/ipts/companion.c
 @@ -0,0 +1,211 @@
@@ -1576,7 +1576,7 @@ index 000000000000..8f66b852f137
 +}
 diff --git a/drivers/misc/ipts/companion.h b/drivers/misc/ipts/companion.h
 new file mode 100644
-index 000000000000..7a1e4b388c40
+index 0000000000000..7a1e4b388c40a
 --- /dev/null
 +++ b/drivers/misc/ipts/companion.h
 @@ -0,0 +1,25 @@
@@ -1607,7 +1607,7 @@ index 000000000000..7a1e4b388c40
 +#endif // _IPTS_COMPANION_H_
 diff --git a/drivers/misc/ipts/companion/Kconfig b/drivers/misc/ipts/companion/Kconfig
 new file mode 100644
-index 000000000000..ef17d9bb5242
+index 0000000000000..ef17d9bb5242f
 --- /dev/null
 +++ b/drivers/misc/ipts/companion/Kconfig
 @@ -0,0 +1,8 @@
@@ -1621,7 +1621,7 @@ index 000000000000..ef17d9bb5242
 +	  If you have a Microsoft Surface using IPTS, select y or m here.
 diff --git a/drivers/misc/ipts/companion/Makefile b/drivers/misc/ipts/companion/Makefile
 new file mode 100644
-index 000000000000..b37f2f59937a
+index 0000000000000..b37f2f59937a8
 --- /dev/null
 +++ b/drivers/misc/ipts/companion/Makefile
 @@ -0,0 +1,2 @@
@@ -1629,7 +1629,7 @@ index 000000000000..b37f2f59937a
 +obj-$(CONFIG_INTEL_IPTS_SURFACE)+= ipts-surface.o
 diff --git a/drivers/misc/ipts/companion/ipts-surface.c b/drivers/misc/ipts/companion/ipts-surface.c
 new file mode 100644
-index 000000000000..a717dfcdfeba
+index 0000000000000..a717dfcdfeba7
 --- /dev/null
 +++ b/drivers/misc/ipts/companion/ipts-surface.c
 @@ -0,0 +1,157 @@
@@ -1792,7 +1792,7 @@ index 000000000000..a717dfcdfeba
 +IPTS_SURFACE_FIRMWARE("MSHW0137");
 diff --git a/drivers/misc/ipts/dbgfs.c b/drivers/misc/ipts/dbgfs.c
 new file mode 100644
-index 000000000000..fd9388de17e7
+index 0000000000000..fd9388de17e78
 --- /dev/null
 +++ b/drivers/misc/ipts/dbgfs.c
 @@ -0,0 +1,277 @@
@@ -2075,7 +2075,7 @@ index 000000000000..fd9388de17e7
 +}
 diff --git a/drivers/misc/ipts/gfx.c b/drivers/misc/ipts/gfx.c
 new file mode 100644
-index 000000000000..b8900f514c75
+index 0000000000000..b8900f514c756
 --- /dev/null
 +++ b/drivers/misc/ipts/gfx.c
 @@ -0,0 +1,180 @@
@@ -2261,7 +2261,7 @@ index 000000000000..b8900f514c75
 +}
 diff --git a/drivers/misc/ipts/gfx.h b/drivers/misc/ipts/gfx.h
 new file mode 100644
-index 000000000000..2880e122e9f9
+index 0000000000000..2880e122e9f96
 --- /dev/null
 +++ b/drivers/misc/ipts/gfx.h
 @@ -0,0 +1,25 @@
@@ -2292,7 +2292,7 @@ index 000000000000..2880e122e9f9
 +#endif // _IPTS_GFX_H_
 diff --git a/drivers/misc/ipts/hid.c b/drivers/misc/ipts/hid.c
 new file mode 100644
-index 000000000000..1b7ad2a774a8
+index 0000000000000..1b7ad2a774a86
 --- /dev/null
 +++ b/drivers/misc/ipts/hid.c
 @@ -0,0 +1,469 @@
@@ -2767,7 +2767,7 @@ index 000000000000..1b7ad2a774a8
 +}
 diff --git a/drivers/misc/ipts/hid.h b/drivers/misc/ipts/hid.h
 new file mode 100644
-index 000000000000..c943979e0198
+index 0000000000000..c943979e01983
 --- /dev/null
 +++ b/drivers/misc/ipts/hid.h
 @@ -0,0 +1,21 @@
@@ -2794,7 +2794,7 @@ index 000000000000..c943979e0198
 +#endif // _IPTS_HID_H_
 diff --git a/drivers/misc/ipts/ipts.c b/drivers/misc/ipts/ipts.c
 new file mode 100644
-index 000000000000..dfafabf8dd94
+index 0000000000000..dfafabf8dd949
 --- /dev/null
 +++ b/drivers/misc/ipts/ipts.c
 @@ -0,0 +1,62 @@
@@ -2862,7 +2862,7 @@ index 000000000000..dfafabf8dd94
 +}
 diff --git a/drivers/misc/ipts/ipts.h b/drivers/misc/ipts/ipts.h
 new file mode 100644
-index 000000000000..32eb3ffd68a3
+index 0000000000000..32eb3ffd68a3b
 --- /dev/null
 +++ b/drivers/misc/ipts/ipts.h
 @@ -0,0 +1,172 @@
@@ -3040,7 +3040,7 @@ index 000000000000..32eb3ffd68a3
 +#endif // _IPTS_H_
 diff --git a/drivers/misc/ipts/kernel.c b/drivers/misc/ipts/kernel.c
 new file mode 100644
-index 000000000000..a2c43228e2c7
+index 0000000000000..a2c43228e2c7d
 --- /dev/null
 +++ b/drivers/misc/ipts/kernel.c
 @@ -0,0 +1,1047 @@
@@ -4093,7 +4093,7 @@ index 000000000000..a2c43228e2c7
 +}
 diff --git a/drivers/misc/ipts/kernel.h b/drivers/misc/ipts/kernel.h
 new file mode 100644
-index 000000000000..7be45da01cfc
+index 0000000000000..7be45da01cfc0
 --- /dev/null
 +++ b/drivers/misc/ipts/kernel.h
 @@ -0,0 +1,17 @@
@@ -4116,7 +4116,7 @@ index 000000000000..7be45da01cfc
 +#endif // _IPTS_KERNEL_H_
 diff --git a/drivers/misc/ipts/mei-msgs.h b/drivers/misc/ipts/mei-msgs.h
 new file mode 100644
-index 000000000000..036b74f7234e
+index 0000000000000..036b74f7234ef
 --- /dev/null
 +++ b/drivers/misc/ipts/mei-msgs.h
 @@ -0,0 +1,901 @@
@@ -5023,7 +5023,7 @@ index 000000000000..036b74f7234e
 +#endif // _IPTS_MEI_MSGS_H_
 diff --git a/drivers/misc/ipts/mei.c b/drivers/misc/ipts/mei.c
 new file mode 100644
-index 000000000000..03b5d747a728
+index 0000000000000..03b5d747a728f
 --- /dev/null
 +++ b/drivers/misc/ipts/mei.c
 @@ -0,0 +1,238 @@
@@ -5267,7 +5267,7 @@ index 000000000000..03b5d747a728
 +MODULE_LICENSE("GPL");
 diff --git a/drivers/misc/ipts/msg-handler.c b/drivers/misc/ipts/msg-handler.c
 new file mode 100644
-index 000000000000..9431b1dfc6e0
+index 0000000000000..9431b1dfc6e06
 --- /dev/null
 +++ b/drivers/misc/ipts/msg-handler.c
 @@ -0,0 +1,405 @@
@@ -5678,7 +5678,7 @@ index 000000000000..9431b1dfc6e0
 +}
 diff --git a/drivers/misc/ipts/msg-handler.h b/drivers/misc/ipts/msg-handler.h
 new file mode 100644
-index 000000000000..eca4238adf4b
+index 0000000000000..eca4238adf4b1
 --- /dev/null
 +++ b/drivers/misc/ipts/msg-handler.h
 @@ -0,0 +1,28 @@
@@ -5712,7 +5712,7 @@ index 000000000000..eca4238adf4b
 +#endif /* _IPTS_MSG_HANDLER_H */
 diff --git a/drivers/misc/ipts/params.c b/drivers/misc/ipts/params.c
 new file mode 100644
-index 000000000000..3ea76ca8342a
+index 0000000000000..3ea76ca8342a9
 --- /dev/null
 +++ b/drivers/misc/ipts/params.c
 @@ -0,0 +1,42 @@
@@ -5760,7 +5760,7 @@ index 000000000000..3ea76ca8342a
 +
 diff --git a/drivers/misc/ipts/params.h b/drivers/misc/ipts/params.h
 new file mode 100644
-index 000000000000..c20546bacb08
+index 0000000000000..c20546bacb086
 --- /dev/null
 +++ b/drivers/misc/ipts/params.h
 @@ -0,0 +1,25 @@
@@ -5791,7 +5791,7 @@ index 000000000000..c20546bacb08
 +#endif // _IPTS_PARAMS_H_
 diff --git a/drivers/misc/ipts/resource.c b/drivers/misc/ipts/resource.c
 new file mode 100644
-index 000000000000..cfd212f2cac0
+index 0000000000000..cfd212f2cac09
 --- /dev/null
 +++ b/drivers/misc/ipts/resource.c
 @@ -0,0 +1,291 @@
@@ -6088,7 +6088,7 @@ index 000000000000..cfd212f2cac0
 +}
 diff --git a/drivers/misc/ipts/resource.h b/drivers/misc/ipts/resource.h
 new file mode 100644
-index 000000000000..27b9c17fcb89
+index 0000000000000..27b9c17fcb89a
 --- /dev/null
 +++ b/drivers/misc/ipts/resource.h
 @@ -0,0 +1,26 @@
@@ -6120,7 +6120,7 @@ index 000000000000..27b9c17fcb89
 +#endif // _IPTS_RESOURCE_H_
 diff --git a/drivers/misc/ipts/sensor-regs.h b/drivers/misc/ipts/sensor-regs.h
 new file mode 100644
-index 000000000000..c1afab48249b
+index 0000000000000..c1afab48249b7
 --- /dev/null
 +++ b/drivers/misc/ipts/sensor-regs.h
 @@ -0,0 +1,834 @@
@@ -6960,7 +6960,7 @@ index 000000000000..c1afab48249b
 +#endif // _IPTS_SENSOR_REGS_H_
 diff --git a/drivers/misc/ipts/state.h b/drivers/misc/ipts/state.h
 new file mode 100644
-index 000000000000..ef73d28db47c
+index 0000000000000..ef73d28db47cc
 --- /dev/null
 +++ b/drivers/misc/ipts/state.h
 @@ -0,0 +1,22 @@
@@ -6987,7 +6987,7 @@ index 000000000000..ef73d28db47c
 +
 +#endif // _IPTS_STATE_H_
 diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h
-index 2ac1dc5104b7..5daa857a4938 100644
+index 2ac1dc5104b7a..5daa857a49389 100644
 --- a/drivers/misc/mei/hw-me-regs.h
 +++ b/drivers/misc/mei/hw-me-regs.h
 @@ -119,6 +119,7 @@
@@ -6999,7 +6999,7 @@ index 2ac1dc5104b7..5daa857a4938 100644
  #define MEI_DEV_ID_SPT_H_2    0xA13B  /* Sunrise Point H 2 */
  
 diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
-index b4bf12f27caf..34f4338fa641 100644
+index b4bf12f27caf5..34f4338fa6417 100644
 --- a/drivers/misc/mei/pci-me.c
 +++ b/drivers/misc/mei/pci-me.c
 @@ -86,6 +86,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
@@ -7012,7 +7012,7 @@ index b4bf12f27caf..34f4338fa641 100644
  	{MEI_PCI_DEVICE(MEI_DEV_ID_LBG, MEI_ME_PCH12_CFG)},
 diff --git a/include/linux/ipts-binary.h b/include/linux/ipts-binary.h
 new file mode 100644
-index 000000000000..98b54d74ff88
+index 0000000000000..98b54d74ff888
 --- /dev/null
 +++ b/include/linux/ipts-binary.h
 @@ -0,0 +1,140 @@
@@ -7158,7 +7158,7 @@ index 000000000000..98b54d74ff88
 +#endif // IPTS_BINARY_H
 diff --git a/include/linux/ipts-companion.h b/include/linux/ipts-companion.h
 new file mode 100644
-index 000000000000..de31f5e0b186
+index 0000000000000..de31f5e0b186b
 --- /dev/null
 +++ b/include/linux/ipts-companion.h
 @@ -0,0 +1,29 @@
@@ -7193,7 +7193,7 @@ index 000000000000..de31f5e0b186
 +#endif // IPTS_COMPANION_H
 diff --git a/include/linux/ipts-gfx.h b/include/linux/ipts-gfx.h
 new file mode 100644
-index 000000000000..cb9d98fe96e4
+index 0000000000000..cb9d98fe96e4b
 --- /dev/null
 +++ b/include/linux/ipts-gfx.h
 @@ -0,0 +1,86 @@
@@ -7285,7 +7285,7 @@ index 000000000000..cb9d98fe96e4
 +#endif // IPTS_GFX_H
 diff --git a/include/linux/ipts.h b/include/linux/ipts.h
 new file mode 100644
-index 000000000000..f229a3436851
+index 0000000000000..f229a34368516
 --- /dev/null
 +++ b/include/linux/ipts.h
 @@ -0,0 +1,19 @@
@@ -7309,5 +7309,5 @@ index 000000000000..f229a3436851
 +
 +#endif // IPTS_H
 -- 
-2.26.2
+2.27.0
 

+ 258 - 0
patches/4.19/0008-wifi.patch

@@ -0,0 +1,258 @@
+From 2a2a34591cb7a76dd7b21c6254005e93695c4836 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 8/8] wifi
+
+---
+ .../net/wireless/marvell/mwifiex/cfg80211.c   | 26 ++++++
+ drivers/net/wireless/marvell/mwifiex/pcie.c   | 86 +++++++++++--------
+ .../net/wireless/marvell/mwifiex/sta_cmd.c    | 31 ++-----
+ 3 files changed, 83 insertions(+), 60 deletions(-)
+
+diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+index 650191db25cbe..dd487fc9c1a1e 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 991b9cc180006..2464f536192cb 100644
+--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
++++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
+@@ -146,40 +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 mwifiex_adapter *adapter;
+-	struct pcie_service_card *card;
+ 	struct pci_dev *pdev = to_pci_dev(dev);
+-
+-	card = pci_get_drvdata(pdev);
++	struct pcie_service_card *card = pci_get_drvdata(pdev);
++	struct mwifiex_adapter *adapter;
++	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);
+ 
+-	/* Indicate device suspended */
+-	set_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags);
+-	clear_bit(MWIFIEX_IS_HS_ENABLING, &adapter->work_flags);
++		mwifiex_disable_auto_ds(priv);
++
++		mwifiex_init_shutdown_fw(priv, MWIFIEX_FUNC_SHUTDOWN);
++	}
++
++	mwifiex_remove_card(adapter);
+ 
+ 	return 0;
+ }
+@@ -191,33 +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;
+ 	struct pci_dev *pdev = to_pci_dev(dev);
++	struct pcie_service_card *card = pci_get_drvdata(pdev);
++	int ret;
+ 
+-	card = pci_get_drvdata(pdev);
++	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;
+ }
+@@ -233,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.27.0
+

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott