]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.18
authorSasha Levin <sashal@kernel.org>
Mon, 4 Jul 2022 14:51:29 +0000 (10:51 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 4 Jul 2022 14:51:29 +0000 (10:51 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
16 files changed:
queue-5.18/drivers-cpufreq-add-missing-of_node_put-in-qoriq-cpu.patch [new file with mode: 0644]
queue-5.18/drm-fourcc-fix-integer-type-usage-in-uapi-header.patch [new file with mode: 0644]
queue-5.18/drm-i915-dgfx-disable-d3cold-at-gfx-root-port.patch [new file with mode: 0644]
queue-5.18/drm-i915-gem-add-missing-else.patch [new file with mode: 0644]
queue-5.18/drm-msm-dpu-increment-vsync_cnt-before-waking-up-use.patch [new file with mode: 0644]
queue-5.18/drm-msm-gem-fix-error-return-on-fence-id-alloc-fail.patch [new file with mode: 0644]
queue-5.18/hwmon-ibmaem-don-t-call-platform_device_del-if-platf.patch [new file with mode: 0644]
queue-5.18/net-sparx5-add-handling-of-host-mdb-entries.patch [new file with mode: 0644]
queue-5.18/net-sparx5-mdb-add-del-handle-non-sparx5-devices.patch [new file with mode: 0644]
queue-5.18/platform-x86-ideapad-laptop-add-allow_v4_dytc-module.patch [new file with mode: 0644]
queue-5.18/platform-x86-panasonic-laptop-de-obfuscate-button-co.patch [new file with mode: 0644]
queue-5.18/platform-x86-panasonic-laptop-don-t-report-duplicate.patch [new file with mode: 0644]
queue-5.18/platform-x86-panasonic-laptop-filter-out-duplicate-v.patch [new file with mode: 0644]
queue-5.18/platform-x86-panasonic-laptop-revert-resolve-hotkey-.patch [new file with mode: 0644]
queue-5.18/platform-x86-panasonic-laptop-sort-includes-alphabet.patch [new file with mode: 0644]
queue-5.18/series

diff --git a/queue-5.18/drivers-cpufreq-add-missing-of_node_put-in-qoriq-cpu.patch b/queue-5.18/drivers-cpufreq-add-missing-of_node_put-in-qoriq-cpu.patch
new file mode 100644 (file)
index 0000000..14878a1
--- /dev/null
@@ -0,0 +1,37 @@
+From 8df672004211df29b6b6aa329bae87c43dc9c42b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 15 Jun 2022 17:48:07 +0800
+Subject: drivers: cpufreq: Add missing of_node_put() in qoriq-cpufreq.c
+
+From: Liang He <windhl@126.com>
+
+[ Upstream commit 4ff5a9b6d95f3524bf6d27147df497eb21968300 ]
+
+In qoriq_cpufreq_probe(), of_find_matching_node() will return a
+node pointer with refcount incremented. We should use of_node_put()
+when it is not used anymore.
+
+Fixes: 157f527639da ("cpufreq: qoriq: convert to a platform driver")
+[ Viresh: Fixed Author's name in commit log ]
+Signed-off-by: Liang He <windhl@126.com>
+Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/cpufreq/qoriq-cpufreq.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c
+index 6b6b20da2bcf..573b417e1483 100644
+--- a/drivers/cpufreq/qoriq-cpufreq.c
++++ b/drivers/cpufreq/qoriq-cpufreq.c
+@@ -275,6 +275,7 @@ static int qoriq_cpufreq_probe(struct platform_device *pdev)
+       np = of_find_matching_node(NULL, qoriq_cpufreq_blacklist);
+       if (np) {
++              of_node_put(np);
+               dev_info(&pdev->dev, "Disabling due to erratum A-008083");
+               return -ENODEV;
+       }
+-- 
+2.35.1
+
diff --git a/queue-5.18/drm-fourcc-fix-integer-type-usage-in-uapi-header.patch b/queue-5.18/drm-fourcc-fix-integer-type-usage-in-uapi-header.patch
new file mode 100644 (file)
index 0000000..c4be40c
--- /dev/null
@@ -0,0 +1,66 @@
+From 3119d6ddb481ab153504b3b3146ca16a4a1bcc8e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 21 Jun 2022 20:39:21 +0000
+Subject: drm/fourcc: fix integer type usage in uapi header
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Carlos Llamas <cmllamas@google.com>
+
+[ Upstream commit 20b8264394b33adb1640a485a62a84bc1388b6a3 ]
+
+Kernel uapi headers are supposed to use __[us]{8,16,32,64} types defined
+by <linux/types.h> as opposed to 'uint32_t' and similar. See [1] for the
+relevant discussion about this topic. In this particular case, the usage
+of 'uint64_t' escaped headers_check as these macros are not being called
+here. However, the following program triggers a compilation error:
+
+  #include <drm/drm_fourcc.h>
+
+  int main()
+  {
+       unsigned long x = AMD_FMT_MOD_CLEAR(RB);
+       return 0;
+  }
+
+gcc error:
+  drm.c:5:27: error: ‘uint64_t’ undeclared (first use in this function)
+      5 |         unsigned long x = AMD_FMT_MOD_CLEAR(RB);
+        |                           ^~~~~~~~~~~~~~~~~
+
+This patch changes AMD_FMT_MOD_{SET,CLEAR} macros to use the correct
+integer types, which fixes the above issue.
+
+  [1] https://lkml.org/lkml/2019/6/5/18
+
+Fixes: 8ba16d599374 ("drm/fourcc: Add AMD DRM modifiers.")
+Signed-off-by: Carlos Llamas <cmllamas@google.com>
+Reviewed-by: Simon Ser <contact@emersion.fr>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/uapi/drm/drm_fourcc.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
+index fc0c1454d275..7b9e3f9a0f00 100644
+--- a/include/uapi/drm/drm_fourcc.h
++++ b/include/uapi/drm/drm_fourcc.h
+@@ -1375,11 +1375,11 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
+ #define AMD_FMT_MOD_PIPE_MASK 0x7
+ #define AMD_FMT_MOD_SET(field, value) \
+-      ((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT)
++      ((__u64)(value) << AMD_FMT_MOD_##field##_SHIFT)
+ #define AMD_FMT_MOD_GET(field, value) \
+       (((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##_MASK)
+ #define AMD_FMT_MOD_CLEAR(field) \
+-      (~((uint64_t)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT))
++      (~((__u64)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT))
+ #if defined(__cplusplus)
+ }
+-- 
+2.35.1
+
diff --git a/queue-5.18/drm-i915-dgfx-disable-d3cold-at-gfx-root-port.patch b/queue-5.18/drm-i915-dgfx-disable-d3cold-at-gfx-root-port.patch
new file mode 100644 (file)
index 0000000..131c9a0
--- /dev/null
@@ -0,0 +1,140 @@
+From 036ef28e22740244e68069fd265c00683176d0f9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 16 Jun 2022 17:52:49 +0530
+Subject: drm/i915/dgfx: Disable d3cold at gfx root port
+
+From: Anshuman Gupta <anshuman.gupta@intel.com>
+
+[ Upstream commit 7d23a80dc9720a378707edc03a7275d5a372355f ]
+
+Currently i915 disables d3cold for i915 pci dev.
+This blocks D3 for i915 gfx pci upstream bridge (VSP).
+Let's disable d3cold at gfx root port to make sure that
+i915 gfx VSP can transition to D3 to save some power.
+
+We don't need to disable/enable d3cold in rpm, s2idle
+suspend/resume handlers. Disabling/Enabling d3cold at
+gfx root port in probe/remove phase is sufficient.
+
+Fixes: 1a085e23411d ("drm/i915: Disable D3Cold in s2idle and runtime pm")
+Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
+Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
+Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>
+Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20220616122249.5007-1-anshuman.gupta@intel.com
+(cherry picked from commit 138c2fca6f408f397ea8fbbbf33203f244d96e01)
+Signed-off-by: Jani Nikula <jani.nikula@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/i915/i915_driver.c | 34 +++++++++++++-----------------
+ 1 file changed, 15 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
+index 62b3f332bbf5..0478fa6259eb 100644
+--- a/drivers/gpu/drm/i915/i915_driver.c
++++ b/drivers/gpu/drm/i915/i915_driver.c
+@@ -538,6 +538,7 @@ static int i915_set_dma_info(struct drm_i915_private *i915)
+ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
+ {
+       struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
++      struct pci_dev *root_pdev;
+       int ret;
+       if (i915_inject_probe_failure(dev_priv))
+@@ -651,6 +652,15 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
+       intel_bw_init_hw(dev_priv);
++      /*
++       * FIXME: Temporary hammer to avoid freezing the machine on our DGFX
++       * This should be totally removed when we handle the pci states properly
++       * on runtime PM and on s2idle cases.
++       */
++      root_pdev = pcie_find_root_port(pdev);
++      if (root_pdev)
++              pci_d3cold_disable(root_pdev);
++
+       return 0;
+ err_msi:
+@@ -674,11 +684,16 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
+ static void i915_driver_hw_remove(struct drm_i915_private *dev_priv)
+ {
+       struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
++      struct pci_dev *root_pdev;
+       i915_perf_fini(dev_priv);
+       if (pdev->msi_enabled)
+               pci_disable_msi(pdev);
++
++      root_pdev = pcie_find_root_port(pdev);
++      if (root_pdev)
++              pci_d3cold_enable(root_pdev);
+ }
+ /**
+@@ -1195,14 +1210,6 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)
+               goto out;
+       }
+-      /*
+-       * FIXME: Temporary hammer to avoid freezing the machine on our DGFX
+-       * This should be totally removed when we handle the pci states properly
+-       * on runtime PM and on s2idle cases.
+-       */
+-      if (suspend_to_idle(dev_priv))
+-              pci_d3cold_disable(pdev);
+-
+       pci_disable_device(pdev);
+       /*
+        * During hibernation on some platforms the BIOS may try to access
+@@ -1367,8 +1374,6 @@ static int i915_drm_resume_early(struct drm_device *dev)
+       pci_set_master(pdev);
+-      pci_d3cold_enable(pdev);
+-
+       disable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
+       ret = vlv_resume_prepare(dev_priv, false);
+@@ -1545,7 +1550,6 @@ static int intel_runtime_suspend(struct device *kdev)
+ {
+       struct drm_i915_private *dev_priv = kdev_to_i915(kdev);
+       struct intel_runtime_pm *rpm = &dev_priv->runtime_pm;
+-      struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
+       int ret;
+       if (drm_WARN_ON_ONCE(&dev_priv->drm, !HAS_RUNTIME_PM(dev_priv)))
+@@ -1591,12 +1595,6 @@ static int intel_runtime_suspend(struct device *kdev)
+               drm_err(&dev_priv->drm,
+                       "Unclaimed access detected prior to suspending\n");
+-      /*
+-       * FIXME: Temporary hammer to avoid freezing the machine on our DGFX
+-       * This should be totally removed when we handle the pci states properly
+-       * on runtime PM and on s2idle cases.
+-       */
+-      pci_d3cold_disable(pdev);
+       rpm->suspended = true;
+       /*
+@@ -1635,7 +1633,6 @@ static int intel_runtime_resume(struct device *kdev)
+ {
+       struct drm_i915_private *dev_priv = kdev_to_i915(kdev);
+       struct intel_runtime_pm *rpm = &dev_priv->runtime_pm;
+-      struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
+       int ret;
+       if (drm_WARN_ON_ONCE(&dev_priv->drm, !HAS_RUNTIME_PM(dev_priv)))
+@@ -1648,7 +1645,6 @@ static int intel_runtime_resume(struct device *kdev)
+       intel_opregion_notify_adapter(dev_priv, PCI_D0);
+       rpm->suspended = false;
+-      pci_d3cold_enable(pdev);
+       if (intel_uncore_unclaimed_mmio(&dev_priv->uncore))
+               drm_dbg(&dev_priv->drm,
+                       "Unclaimed access during suspend, bios?\n");
+-- 
+2.35.1
+
diff --git a/queue-5.18/drm-i915-gem-add-missing-else.patch b/queue-5.18/drm-i915-gem-add-missing-else.patch
new file mode 100644 (file)
index 0000000..8cb4e6d
--- /dev/null
@@ -0,0 +1,44 @@
+From e9e141df47498d2d5ad1fb4945f856d3f5faeace Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 21 Jun 2022 13:49:26 +0100
+Subject: drm/i915/gem: add missing else
+
+From: katrinzhou <katrinzhou@tencent.com>
+
+[ Upstream commit 9efdd519d001ee3e761f6ff80d5eb123387421c1 ]
+
+Add missing else in set_proto_ctx_param() to fix coverity issue.
+
+Addresses-Coverity: ("Unused value")
+Fixes: d4433c7600f7 ("drm/i915/gem: Use the proto-context to handle create parameters (v5)")
+Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
+Signed-off-by: katrinzhou <katrinzhou@tencent.com>
+[tursulin: fixup alignment]
+Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20220621124926.615884-1-tvrtko.ursulin@linux.intel.com
+(cherry picked from commit 7482a65664c16cc88eb84d2b545a1fed887378a1)
+Signed-off-by: Jani Nikula <jani.nikula@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/i915/gem/i915_gem_context.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
+index 9ae294eb7fb4..12b7d4d39216 100644
+--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
++++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
+@@ -932,8 +932,9 @@ static int set_proto_ctx_param(struct drm_i915_file_private *fpriv,
+       case I915_CONTEXT_PARAM_PERSISTENCE:
+               if (args->size)
+                       ret = -EINVAL;
+-              ret = proto_context_set_persistence(fpriv->dev_priv, pc,
+-                                                  args->value);
++              else
++                      ret = proto_context_set_persistence(fpriv->dev_priv, pc,
++                                                          args->value);
+               break;
+       case I915_CONTEXT_PARAM_PROTECTED_CONTENT:
+-- 
+2.35.1
+
diff --git a/queue-5.18/drm-msm-dpu-increment-vsync_cnt-before-waking-up-use.patch b/queue-5.18/drm-msm-dpu-increment-vsync_cnt-before-waking-up-use.patch
new file mode 100644 (file)
index 0000000..34e98d6
--- /dev/null
@@ -0,0 +1,58 @@
+From eb277ec2910d2463b9c2e3a5e73761f059f0735b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 21 Jun 2022 19:38:55 -0700
+Subject: drm/msm/dpu: Increment vsync_cnt before waking up userspace
+
+From: Stephen Boyd <swboyd@chromium.org>
+
+[ Upstream commit c28d76d360f9f7af1f910342bde27939873bc45e ]
+
+The 'vsync_cnt' is used to count the number of frames for a crtc.
+Unfortunately, we increment the count after waking up userspace via
+dpu_crtc_vblank_callback() calling drm_crtc_handle_vblank().
+drm_crtc_handle_vblank() wakes up userspace processes that have called
+drm_wait_vblank_ioctl(), and if that ioctl is expecting the count to
+increase it won't.
+
+Increment the count before calling into the drm APIs so that we don't
+have to worry about ordering the increment with anything else in drm.
+This fixes a software video decode test that fails to see frame counts
+increase on Trogdor boards.
+
+Cc: Mark Yacoub <markyacoub@chromium.org>
+Cc: Jessica Zhang <quic_jesszhan@quicinc.com>
+Fixes: 885455d6bf82 ("drm/msm: Change dpu_crtc_get_vblank_counter to use vsync count.")
+Signed-off-by: Stephen Boyd <swboyd@chromium.org>
+Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
+Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Tested-by: Jessica Zhang <quic_jesszhan@quicinc.com> # Trogdor (sc7180)
+Patchwork: https://patchwork.freedesktop.org/patch/490531/
+Link: https://lore.kernel.org/r/20220622023855.2970913-1-swboyd@chromium.org
+Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+index 3940b9c6323b..fffd2ef897a0 100644
+--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
++++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+@@ -1187,12 +1187,13 @@ static void dpu_encoder_vblank_callback(struct drm_encoder *drm_enc,
+       DPU_ATRACE_BEGIN("encoder_vblank_callback");
+       dpu_enc = to_dpu_encoder_virt(drm_enc);
++      atomic_inc(&phy_enc->vsync_cnt);
++
+       spin_lock_irqsave(&dpu_enc->enc_spinlock, lock_flags);
+       if (dpu_enc->crtc)
+               dpu_crtc_vblank_callback(dpu_enc->crtc);
+       spin_unlock_irqrestore(&dpu_enc->enc_spinlock, lock_flags);
+-      atomic_inc(&phy_enc->vsync_cnt);
+       DPU_ATRACE_END("encoder_vblank_callback");
+ }
+-- 
+2.35.1
+
diff --git a/queue-5.18/drm-msm-gem-fix-error-return-on-fence-id-alloc-fail.patch b/queue-5.18/drm-msm-gem-fix-error-return-on-fence-id-alloc-fail.patch
new file mode 100644 (file)
index 0000000..9d1cde6
--- /dev/null
@@ -0,0 +1,37 @@
+From 8ee6e66b028e19d6a3c750e3ebc314f25c910613 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 24 Jun 2022 11:45:28 -0700
+Subject: drm/msm/gem: Fix error return on fence id alloc fail
+
+From: Rob Clark <robdclark@chromium.org>
+
+[ Upstream commit 08de214138cdea438a0dfcb10d355a6650c6017c ]
+
+This was a typo, we didn't actually want to return zero.
+
+Fixes: a61acbbe9cf8 ("drm/msm: Track "seqno" fences by idr")
+Signed-off-by: Rob Clark <robdclark@chromium.org>
+Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Patchwork: https://patchwork.freedesktop.org/patch/491145/
+Link: https://lore.kernel.org/r/20220624184528.4036837-1-robdclark@gmail.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/msm/msm_gem_submit.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
+index c6d60c8d286d..fec4e3973287 100644
+--- a/drivers/gpu/drm/msm/msm_gem_submit.c
++++ b/drivers/gpu/drm/msm/msm_gem_submit.c
+@@ -913,7 +913,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
+                                                   INT_MAX, GFP_KERNEL);
+       }
+       if (submit->fence_id < 0) {
+-              ret = submit->fence_id = 0;
++              ret = submit->fence_id;
+               submit->fence_id = 0;
+       }
+-- 
+2.35.1
+
diff --git a/queue-5.18/hwmon-ibmaem-don-t-call-platform_device_del-if-platf.patch b/queue-5.18/hwmon-ibmaem-don-t-call-platform_device_del-if-platf.patch
new file mode 100644 (file)
index 0000000..f3bfd0d
--- /dev/null
@@ -0,0 +1,71 @@
+From 6dba6e3fa34ad48fd7160e7385e537c75279111c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 1 Jul 2022 15:41:53 +0800
+Subject: hwmon: (ibmaem) don't call platform_device_del() if
+ platform_device_add() fails
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+[ Upstream commit d0e51022a025ca5350fafb8e413a6fe5d4baf833 ]
+
+If platform_device_add() fails, it no need to call platform_device_del(), split
+platform_device_unregister() into platform_device_del/put(), so platform_device_put()
+can be called separately.
+
+Fixes: 8808a793f052 ("ibmaem: new driver for power/energy/temp meters in IBM System X hardware")
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
+Link: https://lore.kernel.org/r/20220701074153.4021556-1-yangyingliang@huawei.com
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/hwmon/ibmaem.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c
+index de6baf6ca3d1..dab4908b78a8 100644
+--- a/drivers/hwmon/ibmaem.c
++++ b/drivers/hwmon/ibmaem.c
+@@ -550,7 +550,7 @@ static int aem_init_aem1_inst(struct aem_ipmi_data *probe, u8 module_handle)
+       res = platform_device_add(data->pdev);
+       if (res)
+-              goto ipmi_err;
++              goto dev_add_err;
+       platform_set_drvdata(data->pdev, data);
+@@ -598,7 +598,9 @@ static int aem_init_aem1_inst(struct aem_ipmi_data *probe, u8 module_handle)
+       ipmi_destroy_user(data->ipmi.user);
+ ipmi_err:
+       platform_set_drvdata(data->pdev, NULL);
+-      platform_device_unregister(data->pdev);
++      platform_device_del(data->pdev);
++dev_add_err:
++      platform_device_put(data->pdev);
+ dev_err:
+       ida_simple_remove(&aem_ida, data->id);
+ id_err:
+@@ -690,7 +692,7 @@ static int aem_init_aem2_inst(struct aem_ipmi_data *probe,
+       res = platform_device_add(data->pdev);
+       if (res)
+-              goto ipmi_err;
++              goto dev_add_err;
+       platform_set_drvdata(data->pdev, data);
+@@ -738,7 +740,9 @@ static int aem_init_aem2_inst(struct aem_ipmi_data *probe,
+       ipmi_destroy_user(data->ipmi.user);
+ ipmi_err:
+       platform_set_drvdata(data->pdev, NULL);
+-      platform_device_unregister(data->pdev);
++      platform_device_del(data->pdev);
++dev_add_err:
++      platform_device_put(data->pdev);
+ dev_err:
+       ida_simple_remove(&aem_ida, data->id);
+ id_err:
+-- 
+2.35.1
+
diff --git a/queue-5.18/net-sparx5-add-handling-of-host-mdb-entries.patch b/queue-5.18/net-sparx5-add-handling-of-host-mdb-entries.patch
new file mode 100644 (file)
index 0000000..ae411a6
--- /dev/null
@@ -0,0 +1,66 @@
+From 42598b02426bb280a72f6fd21dc0e201d112a0c2 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 3 May 2022 11:39:22 +0200
+Subject: net: sparx5: Add handling of host MDB entries
+
+From: Casper Andersson <casper.casan@gmail.com>
+
+[ Upstream commit 1c1ed5a48411e1686997157c21633653fbe045c6 ]
+
+Handle adding and removing MDB entries for host
+
+Signed-off-by: Casper Andersson <casper.casan@gmail.com>
+Link: https://lore.kernel.org/r/20220503093922.1630804-1-casper.casan@gmail.com
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ .../net/ethernet/microchip/sparx5/sparx5_switchdev.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c b/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c
+index 5389fffc694a..3429660cd2e5 100644
+--- a/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c
++++ b/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c
+@@ -396,6 +396,11 @@ static int sparx5_handle_port_mdb_add(struct net_device *dev,
+       u32 mact_entry;
+       int res, err;
++      if (netif_is_bridge_master(v->obj.orig_dev)) {
++              sparx5_mact_learn(spx5, PGID_CPU, v->addr, v->vid);
++              return 0;
++      }
++
+       /* When VLAN unaware the vlan value is not parsed and we receive vid 0.
+        * Fall back to bridge vid 1.
+        */
+@@ -461,6 +466,11 @@ static int sparx5_handle_port_mdb_del(struct net_device *dev,
+       u32 mact_entry, res, pgid_entry[3];
+       int err;
++      if (netif_is_bridge_master(v->obj.orig_dev)) {
++              sparx5_mact_forget(spx5, v->addr, v->vid);
++              return 0;
++      }
++
+       if (!br_vlan_enabled(spx5->hw_bridge_dev))
+               vid = 1;
+       else
+@@ -500,6 +510,7 @@ static int sparx5_handle_port_obj_add(struct net_device *dev,
+                                                 SWITCHDEV_OBJ_PORT_VLAN(obj));
+               break;
+       case SWITCHDEV_OBJ_ID_PORT_MDB:
++      case SWITCHDEV_OBJ_ID_HOST_MDB:
+               err = sparx5_handle_port_mdb_add(dev, nb,
+                                                SWITCHDEV_OBJ_PORT_MDB(obj));
+               break;
+@@ -552,6 +563,7 @@ static int sparx5_handle_port_obj_del(struct net_device *dev,
+                                                 SWITCHDEV_OBJ_PORT_VLAN(obj)->vid);
+               break;
+       case SWITCHDEV_OBJ_ID_PORT_MDB:
++      case SWITCHDEV_OBJ_ID_HOST_MDB:
+               err = sparx5_handle_port_mdb_del(dev, nb,
+                                                SWITCHDEV_OBJ_PORT_MDB(obj));
+               break;
+-- 
+2.35.1
+
diff --git a/queue-5.18/net-sparx5-mdb-add-del-handle-non-sparx5-devices.patch b/queue-5.18/net-sparx5-mdb-add-del-handle-non-sparx5-devices.patch
new file mode 100644 (file)
index 0000000..2623e45
--- /dev/null
@@ -0,0 +1,49 @@
+From 1db268dfa73c29228975887239a4b4b9a26d5035 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 30 Jun 2022 14:22:26 +0200
+Subject: net: sparx5: mdb add/del handle non-sparx5 devices
+
+From: Casper Andersson <casper.casan@gmail.com>
+
+[ Upstream commit 9c5de246c1dbe785268fc2e83c88624b92e4ec93 ]
+
+When adding/deleting mdb entries on other net_devices, eg., tap
+interfaces, it should not crash.
+
+Fixes: 3bacfccdcb2d ("net: sparx5: Add mdb handlers")
+Signed-off-by: Casper Andersson <casper.casan@gmail.com>
+Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
+Link: https://lore.kernel.org/r/20220630122226.316812-1-casper.casan@gmail.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c b/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c
+index 3429660cd2e5..5edc8b7176c8 100644
+--- a/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c
++++ b/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c
+@@ -396,6 +396,9 @@ static int sparx5_handle_port_mdb_add(struct net_device *dev,
+       u32 mact_entry;
+       int res, err;
++      if (!sparx5_netdevice_check(dev))
++              return -EOPNOTSUPP;
++
+       if (netif_is_bridge_master(v->obj.orig_dev)) {
+               sparx5_mact_learn(spx5, PGID_CPU, v->addr, v->vid);
+               return 0;
+@@ -466,6 +469,9 @@ static int sparx5_handle_port_mdb_del(struct net_device *dev,
+       u32 mact_entry, res, pgid_entry[3];
+       int err;
++      if (!sparx5_netdevice_check(dev))
++              return -EOPNOTSUPP;
++
+       if (netif_is_bridge_master(v->obj.orig_dev)) {
+               sparx5_mact_forget(spx5, v->addr, v->vid);
+               return 0;
+-- 
+2.35.1
+
diff --git a/queue-5.18/platform-x86-ideapad-laptop-add-allow_v4_dytc-module.patch b/queue-5.18/platform-x86-ideapad-laptop-add-allow_v4_dytc-module.patch
new file mode 100644 (file)
index 0000000..6c6aeae
--- /dev/null
@@ -0,0 +1,63 @@
+From bd90f0433abf1e9b2fa971226d5f880d1664a336 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 23 Jun 2022 13:59:14 +0200
+Subject: platform/x86: ideapad-laptop: Add allow_v4_dytc module parameter
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+[ Upstream commit a27a1e35f5c87463ba7c12d5b7d7cbafbefc9213 ]
+
+Add an allow_v4_dytc module parameter to allow users to easily test if
+DYTC version 4 platform-profiles work on their laptop.
+
+Fixes: 599482c58ebd ("platform/x86: ideapad-laptop: Add platform support for Ideapad 5 Pro 16ACH6-82L5")
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=213297
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://lore.kernel.org/r/20220623115914.103001-1-hdegoede@redhat.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/ideapad-laptop.c | 21 ++++++++++++++-------
+ 1 file changed, 14 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
+index 6b472fd431d0..abd0c81d62c4 100644
+--- a/drivers/platform/x86/ideapad-laptop.c
++++ b/drivers/platform/x86/ideapad-laptop.c
+@@ -152,6 +152,10 @@ static bool no_bt_rfkill;
+ module_param(no_bt_rfkill, bool, 0444);
+ MODULE_PARM_DESC(no_bt_rfkill, "No rfkill for bluetooth.");
++static bool allow_v4_dytc;
++module_param(allow_v4_dytc, bool, 0444);
++MODULE_PARM_DESC(allow_v4_dytc, "Enable DYTC version 4 platform-profile support.");
++
+ /*
+  * ACPI Helpers
+  */
+@@ -907,13 +911,16 @@ static int ideapad_dytc_profile_init(struct ideapad_private *priv)
+       dytc_version = (output >> DYTC_QUERY_REV_BIT) & 0xF;
+-      if (dytc_version < 5) {
+-              if (dytc_version < 4 || !dmi_check_system(ideapad_dytc_v4_allow_table)) {
+-                      dev_info(&priv->platform_device->dev,
+-                               "DYTC_VERSION is less than 4 or is not allowed: %d\n",
+-                               dytc_version);
+-                      return -ENODEV;
+-              }
++      if (dytc_version < 4) {
++              dev_info(&priv->platform_device->dev, "DYTC_VERSION < 4 is not supported\n");
++              return -ENODEV;
++      }
++
++      if (dytc_version < 5 &&
++          !(allow_v4_dytc || dmi_check_system(ideapad_dytc_v4_allow_table))) {
++              dev_info(&priv->platform_device->dev,
++                       "DYTC_VERSION 4 support may not work. Pass ideapad_laptop.allow_v4_dytc=Y on the kernel commandline to enable\n");
++              return -ENODEV;
+       }
+       priv->dytc = kzalloc(sizeof(*priv->dytc), GFP_KERNEL);
+-- 
+2.35.1
+
diff --git a/queue-5.18/platform-x86-panasonic-laptop-de-obfuscate-button-co.patch b/queue-5.18/platform-x86-panasonic-laptop-de-obfuscate-button-co.patch
new file mode 100644 (file)
index 0000000..7dde3bd
--- /dev/null
@@ -0,0 +1,70 @@
+From 1e80d547b535d76fc7b1ff2c1109485a58b6ac1a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 24 Jun 2022 13:23:35 +0200
+Subject: platform/x86: panasonic-laptop: de-obfuscate button codes
+
+From: Stefan Seyfried <seife+kernel@b1-systems.com>
+
+[ Upstream commit 65a3e6c8d3f7c346813a05f3d76fc46b640d76d6 ]
+
+In the definition of panasonic_keymap[] the key codes are given in
+decimal, later checks are done with hexadecimal values, which does
+not help in understanding the code.
+Additionally use two helper variables to shorten the code and make
+the logic more obvious.
+
+Fixes: ed83c9171829 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug")
+Signed-off-by: Stefan Seyfried <seife+kernel@b1-systems.com>
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Link: https://lore.kernel.org/r/20220624112340.10130-3-hdegoede@redhat.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/panasonic-laptop.c | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
+index 37850d07987d..ca6137f4000f 100644
+--- a/drivers/platform/x86/panasonic-laptop.c
++++ b/drivers/platform/x86/panasonic-laptop.c
+@@ -762,6 +762,8 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
+       struct input_dev *hotk_input_dev = pcc->input_dev;
+       int rc;
+       unsigned long long result;
++      unsigned int key;
++      unsigned int updown;
+       rc = acpi_evaluate_integer(pcc->handle, METHOD_HKEY_QUERY,
+                                  NULL, &result);
+@@ -770,18 +772,22 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
+               return;
+       }
++      key = result & 0xf;
++      updown = result & 0x80; /* 0x80 == key down; 0x00 = key up */
++
+       /* hack: some firmware sends no key down for sleep / hibernate */
+-      if ((result & 0xf) == 0x7 || (result & 0xf) == 0xa) {
+-              if (result & 0x80)
++      if (key == 7 || key == 10) {
++              if (updown)
+                       sleep_keydown_seen = 1;
+               if (!sleep_keydown_seen)
+                       sparse_keymap_report_event(hotk_input_dev,
+-                                      result & 0xf, 0x80, false);
++                                      key, 0x80, false);
+       }
+-      if ((result & 0xf) == 0x7 || (result & 0xf) == 0x9 || (result & 0xf) == 0xa) {
++      /* for the magic values, see panasonic_keymap[] above */
++      if (key == 7 || key == 9 || key == 10) {
+               if (!sparse_keymap_report_event(hotk_input_dev,
+-                                              result & 0xf, result & 0x80, false))
++                                              key, updown, false))
+                       pr_err("Unknown hotkey event: 0x%04llx\n", result);
+       }
+ }
+-- 
+2.35.1
+
diff --git a/queue-5.18/platform-x86-panasonic-laptop-don-t-report-duplicate.patch b/queue-5.18/platform-x86-panasonic-laptop-don-t-report-duplicate.patch
new file mode 100644 (file)
index 0000000..d5336c4
--- /dev/null
@@ -0,0 +1,67 @@
+From 215b16fda0a68bc0aec48eef439cbc4ba1fc5610 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 24 Jun 2022 13:23:38 +0200
+Subject: platform/x86: panasonic-laptop: don't report duplicate brightness
+ key-presses
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+[ Upstream commit 1f2c9de83a50447a2d7166f6273ab0c0e97cd68e ]
+
+The brightness key-presses might also get reported by the ACPI video bus,
+check for this and in this case don't report the presses to avoid reporting
+2 presses for a single key-press.
+
+Fixes: ed83c9171829 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug")
+Reported-and-tested-by: Stefan Seyfried <seife+kernel@b1-systems.com>
+Reported-and-tested-by: Kenneth Chan <kenneth.t.chan@gmail.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Link: https://lore.kernel.org/r/20220624112340.10130-6-hdegoede@redhat.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/Kconfig            | 1 +
+ drivers/platform/x86/panasonic-laptop.c | 8 ++++++++
+ 2 files changed, 9 insertions(+)
+
+diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
+index 5d9dd70e4e0f..634a6c1eb2d3 100644
+--- a/drivers/platform/x86/Kconfig
++++ b/drivers/platform/x86/Kconfig
+@@ -945,6 +945,7 @@ config PANASONIC_LAPTOP
+       tristate "Panasonic Laptop Extras"
+       depends on INPUT && ACPI
+       depends on BACKLIGHT_CLASS_DEVICE
++      depends on ACPI_VIDEO=n || ACPI_VIDEO
+       select INPUT_SPARSEKMAP
+       help
+         This driver adds support for access to backlight control and hotkeys
+diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
+index 2e6531dd15f9..d65e6c2372ca 100644
+--- a/drivers/platform/x86/panasonic-laptop.c
++++ b/drivers/platform/x86/panasonic-laptop.c
+@@ -132,6 +132,7 @@
+ #include <linux/slab.h>
+ #include <linux/types.h>
+ #include <linux/uaccess.h>
++#include <acpi/video.h>
+ MODULE_AUTHOR("Hiroshi Miura <miura@da-cha.org>");
+ MODULE_AUTHOR("David Bronaugh <dbronaugh@linuxboxen.org>");
+@@ -783,6 +784,13 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
+                                       key, 0x80, false);
+       }
++      /*
++       * Don't report brightness key-presses if they are also reported
++       * by the ACPI video bus.
++       */
++      if ((key == 1 || key == 2) && acpi_video_handles_brightness_key_presses())
++              return;
++
+       if (!sparse_keymap_report_event(hotk_input_dev, key, updown, false))
+               pr_err("Unknown hotkey event: 0x%04llx\n", result);
+ }
+-- 
+2.35.1
+
diff --git a/queue-5.18/platform-x86-panasonic-laptop-filter-out-duplicate-v.patch b/queue-5.18/platform-x86-panasonic-laptop-filter-out-duplicate-v.patch
new file mode 100644 (file)
index 0000000..00d5515
--- /dev/null
@@ -0,0 +1,129 @@
+From 5ebee35d1f11f24e1bc7ddc6e45b331bb53f44ff Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 24 Jun 2022 13:23:39 +0200
+Subject: platform/x86: panasonic-laptop: filter out duplicate volume
+ up/down/mute keypresses
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+[ Upstream commit aacb455dfe01b7a24a792a2fbe7a04112ce8321d ]
+
+On some Panasonic models the volume up/down/mute keypresses get
+reported both through the Panasonic ACPI HKEY interface as well as
+through the atkbd device.
+
+Filter out the atkbd scan-codes for these to avoid reporting presses
+twice.
+
+Note normally we would leave the filtering of these to userspace by mapping
+the scan-codes to KEY_UNKNOWN through /lib/udev/hwdb.d/60-keyboard.hwdb.
+However in this case that would cause regressions since we were filtering
+the Panasonic ACPI HKEY events before, so filter these in the kernel.
+
+Fixes: ed83c9171829 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug")
+Reported-and-tested-by: Stefan Seyfried <seife+kernel@b1-systems.com>
+Reported-and-tested-by: Kenneth Chan <kenneth.t.chan@gmail.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Link: https://lore.kernel.org/r/20220624112340.10130-7-hdegoede@redhat.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/Kconfig            |  1 +
+ drivers/platform/x86/panasonic-laptop.c | 41 +++++++++++++++++++++++++
+ 2 files changed, 42 insertions(+)
+
+diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
+index 634a6c1eb2d3..ddb8f14247c0 100644
+--- a/drivers/platform/x86/Kconfig
++++ b/drivers/platform/x86/Kconfig
+@@ -946,6 +946,7 @@ config PANASONIC_LAPTOP
+       depends on INPUT && ACPI
+       depends on BACKLIGHT_CLASS_DEVICE
+       depends on ACPI_VIDEO=n || ACPI_VIDEO
++      depends on SERIO_I8042 || SERIO_I8042 = n
+       select INPUT_SPARSEKMAP
+       help
+         This driver adds support for access to backlight control and hotkeys
+diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
+index d65e6c2372ca..615e39cbbbf1 100644
+--- a/drivers/platform/x86/panasonic-laptop.c
++++ b/drivers/platform/x86/panasonic-laptop.c
+@@ -122,6 +122,7 @@
+ #include <linux/acpi.h>
+ #include <linux/backlight.h>
+ #include <linux/ctype.h>
++#include <linux/i8042.h>
+ #include <linux/init.h>
+ #include <linux/input.h>
+ #include <linux/input/sparse-keymap.h>
+@@ -129,6 +130,7 @@
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
+ #include <linux/seq_file.h>
++#include <linux/serio.h>
+ #include <linux/slab.h>
+ #include <linux/types.h>
+ #include <linux/uaccess.h>
+@@ -241,6 +243,42 @@ struct pcc_acpi {
+       struct platform_device  *platform;
+ };
++/*
++ * On some Panasonic models the volume up / down / mute keys send duplicate
++ * keypress events over the PS/2 kbd interface, filter these out.
++ */
++static bool panasonic_i8042_filter(unsigned char data, unsigned char str,
++                                 struct serio *port)
++{
++      static bool extended;
++
++      if (str & I8042_STR_AUXDATA)
++              return false;
++
++      if (data == 0xe0) {
++              extended = true;
++              return true;
++      } else if (extended) {
++              extended = false;
++
++              switch (data & 0x7f) {
++              case 0x20: /* e0 20 / e0 a0, Volume Mute press / release */
++              case 0x2e: /* e0 2e / e0 ae, Volume Down press / release */
++              case 0x30: /* e0 30 / e0 b0, Volume Up press / release */
++                      return true;
++              default:
++                      /*
++                       * Report the previously filtered e0 before continuing
++                       * with the next non-filtered byte.
++                       */
++                      serio_interrupt(port, 0xe0, 0);
++                      return false;
++              }
++      }
++
++      return false;
++}
++
+ /* method access functions */
+ static int acpi_pcc_write_sset(struct pcc_acpi *pcc, int func, int val)
+ {
+@@ -1006,6 +1044,7 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
+               pcc->platform = NULL;
+       }
++      i8042_install_filter(panasonic_i8042_filter);
+       return 0;
+ out_platform:
+@@ -1029,6 +1068,8 @@ static int acpi_pcc_hotkey_remove(struct acpi_device *device)
+       if (!device || !pcc)
+               return -EINVAL;
++      i8042_remove_filter(panasonic_i8042_filter);
++
+       if (pcc->platform) {
+               device_remove_file(&pcc->platform->dev, &dev_attr_cdpower);
+               platform_device_unregister(pcc->platform);
+-- 
+2.35.1
+
diff --git a/queue-5.18/platform-x86-panasonic-laptop-revert-resolve-hotkey-.patch b/queue-5.18/platform-x86-panasonic-laptop-revert-resolve-hotkey-.patch
new file mode 100644 (file)
index 0000000..5796225
--- /dev/null
@@ -0,0 +1,47 @@
+From 2bc41ff24449f9d7c10b2fbec325be212a58b4dc Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 24 Jun 2022 13:23:37 +0200
+Subject: platform/x86: panasonic-laptop: revert "Resolve hotkey double trigger
+ bug"
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+[ Upstream commit 83a5ddc3dc561c40d948b85553514aaba99123d8 ]
+
+In hindsight blindly throwing away most of the key-press events is not
+a good idea. So revert commit ed83c9171829 ("platform/x86:
+panasonic-laptop: Resolve hotkey double trigger bug").
+
+Fixes: ed83c9171829 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug")
+Reported-and-tested-by: Stefan Seyfried <seife+kernel@b1-systems.com>
+Reported-and-tested-by: Kenneth Chan <kenneth.t.chan@gmail.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Link: https://lore.kernel.org/r/20220624112340.10130-5-hdegoede@redhat.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/panasonic-laptop.c | 8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
+index 26e31ac09dc6..2e6531dd15f9 100644
+--- a/drivers/platform/x86/panasonic-laptop.c
++++ b/drivers/platform/x86/panasonic-laptop.c
+@@ -783,12 +783,8 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
+                                       key, 0x80, false);
+       }
+-      /* for the magic values, see panasonic_keymap[] above */
+-      if (key == 7 || key == 9 || key == 10) {
+-              if (!sparse_keymap_report_event(hotk_input_dev,
+-                                              key, updown, false))
+-                      pr_err("Unknown hotkey event: 0x%04llx\n", result);
+-      }
++      if (!sparse_keymap_report_event(hotk_input_dev, key, updown, false))
++              pr_err("Unknown hotkey event: 0x%04llx\n", result);
+ }
+ static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event)
+-- 
+2.35.1
+
diff --git a/queue-5.18/platform-x86-panasonic-laptop-sort-includes-alphabet.patch b/queue-5.18/platform-x86-panasonic-laptop-sort-includes-alphabet.patch
new file mode 100644 (file)
index 0000000..bc3e365
--- /dev/null
@@ -0,0 +1,57 @@
+From 99fc87bd4c004f5f0515e18029c568ee4e967977 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 24 Jun 2022 13:23:36 +0200
+Subject: platform/x86: panasonic-laptop: sort includes alphabetically
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+[ Upstream commit fe4326c8d18dc8a54affdc9ab269ad92dafef659 ]
+
+Sort includes alphabetically, small cleanup patch in preparation of
+further changes.
+
+Fixes: ed83c9171829 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug")
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Link: https://lore.kernel.org/r/20220624112340.10130-4-hdegoede@redhat.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/panasonic-laptop.c | 17 ++++++++---------
+ 1 file changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
+index ca6137f4000f..26e31ac09dc6 100644
+--- a/drivers/platform/x86/panasonic-laptop.c
++++ b/drivers/platform/x86/panasonic-laptop.c
+@@ -119,20 +119,19 @@
+  *            - v0.1  start from toshiba_acpi driver written by John Belmonte
+  */
+-#include <linux/kernel.h>
+-#include <linux/module.h>
+-#include <linux/init.h>
+-#include <linux/types.h>
++#include <linux/acpi.h>
+ #include <linux/backlight.h>
+ #include <linux/ctype.h>
+-#include <linux/seq_file.h>
+-#include <linux/uaccess.h>
+-#include <linux/slab.h>
+-#include <linux/acpi.h>
++#include <linux/init.h>
+ #include <linux/input.h>
+ #include <linux/input/sparse-keymap.h>
++#include <linux/kernel.h>
++#include <linux/module.h>
+ #include <linux/platform_device.h>
+-
++#include <linux/seq_file.h>
++#include <linux/slab.h>
++#include <linux/types.h>
++#include <linux/uaccess.h>
+ MODULE_AUTHOR("Hiroshi Miura <miura@da-cha.org>");
+ MODULE_AUTHOR("David Bronaugh <dbronaugh@linuxboxen.org>");
+-- 
+2.35.1
+
index 023f7c11a9bf56a21bd0cb08bef21bec9ec7b592..ed90135e45a50de63e73ca0324599e7af3ffdc3f 100644 (file)
@@ -78,3 +78,18 @@ ipv6-sit-fix-ipip6_tunnel_get_prl-return-value.patch
 ipv6-fix-lockdep-splat-in-in6_dump_addrs.patch
 mlxsw-spectrum_router-fix-rollback-in-tunnel-next-hop-init.patch
 net-tun-avoid-disabling-napi-twice.patch
+drm-msm-dpu-increment-vsync_cnt-before-waking-up-use.patch
+platform-x86-ideapad-laptop-add-allow_v4_dytc-module.patch
+drm-i915-gem-add-missing-else.patch
+drm-i915-dgfx-disable-d3cold-at-gfx-root-port.patch
+drm-msm-gem-fix-error-return-on-fence-id-alloc-fail.patch
+drivers-cpufreq-add-missing-of_node_put-in-qoriq-cpu.patch
+platform-x86-panasonic-laptop-de-obfuscate-button-co.patch
+platform-x86-panasonic-laptop-sort-includes-alphabet.patch
+platform-x86-panasonic-laptop-revert-resolve-hotkey-.patch
+platform-x86-panasonic-laptop-don-t-report-duplicate.patch
+platform-x86-panasonic-laptop-filter-out-duplicate-v.patch
+drm-fourcc-fix-integer-type-usage-in-uapi-header.patch
+net-sparx5-add-handling-of-host-mdb-entries.patch
+net-sparx5-mdb-add-del-handle-non-sparx5-devices.patch
+hwmon-ibmaem-don-t-call-platform_device_del-if-platf.patch