From 902f9eb696dfdd40e88d99bafa34ea25f1f9e927 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 2 Apr 2023 20:48:00 -0400 Subject: [PATCH] Fixes for 6.2 Signed-off-by: Sasha Levin --- ...ncorrectly-applied-patch-for-map_pro.patch | 50 +++++++++++++++++++ ...-zero-sagaw-if-second-stage-not-supp.patch | 43 ++++++++++++++++ ...nctrl-ocelot-fix-alt-mode-for-ocelot.patch | 40 +++++++++++++++ ...mware-correct-non-pix-start-and-end-.patch | 48 ++++++++++++++++++ queue-6.2/series | 4 ++ 5 files changed, 185 insertions(+) create mode 100644 queue-6.2/input-xpad-fix-incorrectly-applied-patch-for-map_pro.patch create mode 100644 queue-6.2/iommu-vt-d-allow-zero-sagaw-if-second-stage-not-supp.patch create mode 100644 queue-6.2/pinctrl-ocelot-fix-alt-mode-for-ocelot.patch create mode 100644 queue-6.2/revert-venus-firmware-correct-non-pix-start-and-end-.patch diff --git a/queue-6.2/input-xpad-fix-incorrectly-applied-patch-for-map_pro.patch b/queue-6.2/input-xpad-fix-incorrectly-applied-patch-for-map_pro.patch new file mode 100644 index 00000000000..4d3adee603a --- /dev/null +++ b/queue-6.2/input-xpad-fix-incorrectly-applied-patch-for-map_pro.patch @@ -0,0 +1,50 @@ +From 3ecc840f8282f9a04eb9dce15de6ec569b2e146e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 19 Mar 2023 21:30:15 -0700 +Subject: Input: xpad - fix incorrectly applied patch for MAP_PROFILE_BUTTON + +From: Matthias Benkmann + +[ Upstream commit ffa6206ebf8d39e83d87ac226df68dbbe155819a ] + +When commit commit fff1011a26d6 ("Input: xpad - add X-Box Adaptive Profile +button") was applied, one hunk ended up in the wrong function; move it to +where it belongs. + +Fixes: fff1011a26d6 ("Input: xpad - add X-Box Adaptive Profile button") +Signed-off-by: Matthias Benkmann +Link: https://lore.kernel.org/r/20230318162106.0aef4ba5@ninja +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/joystick/xpad.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c +index 2959d80f7fdb6..cd36cf7165423 100644 +--- a/drivers/input/joystick/xpad.c ++++ b/drivers/input/joystick/xpad.c +@@ -779,9 +779,6 @@ static void xpad_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char *d + input_report_key(dev, BTN_C, data[8]); + input_report_key(dev, BTN_Z, data[9]); + +- /* Profile button has a value of 0-3, so it is reported as an axis */ +- if (xpad->mapping & MAP_PROFILE_BUTTON) +- input_report_abs(dev, ABS_PROFILE, data[34]); + + input_sync(dev); + } +@@ -1059,6 +1056,10 @@ static void xpadone_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char + (__u16) le16_to_cpup((__le16 *)(data + 8))); + } + ++ /* Profile button has a value of 0-3, so it is reported as an axis */ ++ if (xpad->mapping & MAP_PROFILE_BUTTON) ++ input_report_abs(dev, ABS_PROFILE, data[34]); ++ + /* paddle handling */ + /* based on SDL's SDL_hidapi_xboxone.c */ + if (xpad->mapping & MAP_PADDLES) { +-- +2.39.2 + diff --git a/queue-6.2/iommu-vt-d-allow-zero-sagaw-if-second-stage-not-supp.patch b/queue-6.2/iommu-vt-d-allow-zero-sagaw-if-second-stage-not-supp.patch new file mode 100644 index 00000000000..05175813155 --- /dev/null +++ b/queue-6.2/iommu-vt-d-allow-zero-sagaw-if-second-stage-not-supp.patch @@ -0,0 +1,43 @@ +From 072c76098fa5bf33cce7ad04a958307bb2b8bf30 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 29 Mar 2023 21:47:20 +0800 +Subject: iommu/vt-d: Allow zero SAGAW if second-stage not supported + +From: Lu Baolu + +[ Upstream commit bfd3c6b9fa4a1dc78139dd1621d5bea321ffa69d ] + +The VT-d spec states (in section 11.4.2) that hardware implementations +reporting second-stage translation support (SSTS) field as Clear also +report the SAGAW field as 0. Fix an inappropriate check in alloc_iommu(). + +Fixes: 792fb43ce2c9 ("iommu/vt-d: Enable Intel IOMMU scalable mode by default") +Suggested-by: Raghunathan Srinivasan +Reviewed-by: Kevin Tian +Signed-off-by: Jacob Pan +Signed-off-by: Lu Baolu +Link: https://lore.kernel.org/r/20230318024824.124542-1-baolu.lu@linux.intel.com +Link: https://lore.kernel.org/r/20230329134721.469447-3-baolu.lu@linux.intel.com +Signed-off-by: Joerg Roedel +Signed-off-by: Sasha Levin +--- + drivers/iommu/intel/dmar.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c +index b00a0ceb2d137..c80c524ad32d7 100644 +--- a/drivers/iommu/intel/dmar.c ++++ b/drivers/iommu/intel/dmar.c +@@ -1057,7 +1057,8 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd) + } + + err = -EINVAL; +- if (cap_sagaw(iommu->cap) == 0) { ++ if (!cap_sagaw(iommu->cap) && ++ (!ecap_smts(iommu->ecap) || ecap_slts(iommu->ecap))) { + pr_info("%s: No supported address widths. Not attempting DMA translation.\n", + iommu->name); + drhd->ignored = 1; +-- +2.39.2 + diff --git a/queue-6.2/pinctrl-ocelot-fix-alt-mode-for-ocelot.patch b/queue-6.2/pinctrl-ocelot-fix-alt-mode-for-ocelot.patch new file mode 100644 index 00000000000..73933feca83 --- /dev/null +++ b/queue-6.2/pinctrl-ocelot-fix-alt-mode-for-ocelot.patch @@ -0,0 +1,40 @@ +From 7157a2b37baa714c6b77a864d96624f57c76185f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 6 Feb 2023 21:37:20 +0100 +Subject: pinctrl: ocelot: Fix alt mode for ocelot + +From: Horatiu Vultur + +[ Upstream commit 657fd9da2d4b4aa0a384105b236baa22fa0233bf ] + +In case the driver was trying to set an alternate mode for gpio +0 or 32 then the mode was not set correctly. The reason is that +there is computation error inside the function ocelot_pinmux_set_mux +because in this case it was trying to shift to left by -1. +Fix this by actually shifting the function bits and not the position. + +Fixes: 4b36082e2e09 ("pinctrl: ocelot: fix pinmuxing for pins after 31") +Signed-off-by: Horatiu Vultur +Link: https://lore.kernel.org/r/20230206203720.1177718-1-horatiu.vultur@microchip.com +Signed-off-by: Linus Walleij +Signed-off-by: Sasha Levin +--- + drivers/pinctrl/pinctrl-ocelot.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c +index 29e4a6282a641..1dcbd0937ef5a 100644 +--- a/drivers/pinctrl/pinctrl-ocelot.c ++++ b/drivers/pinctrl/pinctrl-ocelot.c +@@ -1204,7 +1204,7 @@ static int ocelot_pinmux_set_mux(struct pinctrl_dev *pctldev, + regmap_update_bits(info->map, REG_ALT(0, info, pin->pin), + BIT(p), f << p); + regmap_update_bits(info->map, REG_ALT(1, info, pin->pin), +- BIT(p), f << (p - 1)); ++ BIT(p), (f >> 1) << p); + + return 0; + } +-- +2.39.2 + diff --git a/queue-6.2/revert-venus-firmware-correct-non-pix-start-and-end-.patch b/queue-6.2/revert-venus-firmware-correct-non-pix-start-and-end-.patch new file mode 100644 index 00000000000..6420796a21f --- /dev/null +++ b/queue-6.2/revert-venus-firmware-correct-non-pix-start-and-end-.patch @@ -0,0 +1,48 @@ +From 4acca2b2f38867edd19d7b6b490c346422bf4ffe Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 7 Feb 2023 11:22:54 +0100 +Subject: Revert "venus: firmware: Correct non-pix start and end addresses" + +From: Javier Martinez Canillas + +[ Upstream commit f95b8ea79c47c0ad3d18f45ad538f9970e414d1f ] + +This reverts commit a837e5161cff, which broke probing of the venus +driver, at least on the SC7180 SoC HP X2 Chromebook: + + qcom-venus aa00000.video-codec: Adding to iommu group 11 + qcom-venus aa00000.video-codec: non legacy binding + qcom-venus aa00000.video-codec: failed to reset venus core + qcom-venus: probe of aa00000.video-codec failed with error -110 + +Matthias Kaehlcke also reported that the same change caused a regression +in SC7180 and sc7280, that prevents AOSS from entering sleep mode during +system suspend. So let's revert this commit for now to fix both issues. + +Fixes: a837e5161cff ("venus: firmware: Correct non-pix start and end addresses") +Reported-by: Matthias Kaehlcke +Signed-off-by: Javier Martinez Canillas +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + drivers/media/platform/qcom/venus/firmware.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c +index 142d4c74017c0..d59ecf776715c 100644 +--- a/drivers/media/platform/qcom/venus/firmware.c ++++ b/drivers/media/platform/qcom/venus/firmware.c +@@ -38,8 +38,8 @@ static void venus_reset_cpu(struct venus_core *core) + writel(fw_size, wrapper_base + WRAPPER_FW_END_ADDR); + writel(0, wrapper_base + WRAPPER_CPA_START_ADDR); + writel(fw_size, wrapper_base + WRAPPER_CPA_END_ADDR); +- writel(0, wrapper_base + WRAPPER_NONPIX_START_ADDR); +- writel(0, wrapper_base + WRAPPER_NONPIX_END_ADDR); ++ writel(fw_size, wrapper_base + WRAPPER_NONPIX_START_ADDR); ++ writel(fw_size, wrapper_base + WRAPPER_NONPIX_END_ADDR); + + if (IS_V6(core)) { + /* Bring XTSS out of reset */ +-- +2.39.2 + diff --git a/queue-6.2/series b/queue-6.2/series index 8b6ab7a7dc0..80f5cd321b8 100644 --- a/queue-6.2/series +++ b/queue-6.2/series @@ -121,3 +121,7 @@ net-dsa-sync-unicast-and-multicast-addresses-for-vla.patch net-ethernet-mtk_eth_soc-fix-flow-block-refcounting-.patch net-ethernet-mtk_eth_soc-fix-l2-offloading-with-dsa-.patch net-ethernet-mtk_eth_soc-add-missing-ppe-cache-flush.patch +pinctrl-ocelot-fix-alt-mode-for-ocelot.patch +input-xpad-fix-incorrectly-applied-patch-for-map_pro.patch +iommu-vt-d-allow-zero-sagaw-if-second-stage-not-supp.patch +revert-venus-firmware-correct-non-pix-start-and-end-.patch -- 2.47.3