From 961865b01672f1af857018ab0b89d60bda519fb8 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sat, 23 Dec 2023 11:04:00 -0500 Subject: [PATCH] Fixes for 6.6 Signed-off-by: Sasha Levin --- ...ai-fix-channel-swap-issue-on-i.mx8mp.patch | 46 +++++++ ...fix-missing-report-for-jack-initial-.patch | 70 ++++++++++ ...eate-idle-bo-s-pte-during-vm-state-m.patch | 39 ++++++ ...ix-static-analysis-tool-reported-iss.patch | 54 ++++++++ ...-mtl-fix-hdmi-dp-pll-clock-selection.patch | 41 ++++++ ...-gpio_device-locking-wrapper-around-.patch | 64 +++++++++ ...e-the-coalesced-stop-conditions-with.patch | 115 +++++++++++++++++ ...x-missing-clk_disable_unprepare-and-.patch | 59 +++++++++ ...io4-use-dedicated-lock-class-for-irq.patch | 121 ++++++++++++++++++ queue-6.6/series | 10 ++ ...dd-cpu-dependencies-for-32-bit-build.patch | 52 ++++++++ 11 files changed, 671 insertions(+) create mode 100644 queue-6.6/asoc-fsl_sai-fix-channel-swap-issue-on-i.mx8mp.patch create mode 100644 queue-6.6/asoc-hdmi-codec-fix-missing-report-for-jack-initial-.patch create mode 100644 queue-6.6/drm-amdgpu-re-create-idle-bo-s-pte-during-vm-state-m.patch create mode 100644 queue-6.6/drm-i915-hwmon-fix-static-analysis-tool-reported-iss.patch create mode 100644 queue-6.6/drm-i915-mtl-fix-hdmi-dp-pll-clock-selection.patch create mode 100644 queue-6.6/gpiolib-cdev-add-gpio_device-locking-wrapper-around-.patch create mode 100644 queue-6.6/i2c-aspeed-handle-the-coalesced-stop-conditions-with.patch create mode 100644 queue-6.6/i2c-qcom-geni-fix-missing-clk_disable_unprepare-and-.patch create mode 100644 queue-6.6/pinctrl-at91-pio4-use-dedicated-lock-class-for-irq.patch create mode 100644 queue-6.6/x86-xen-add-cpu-dependencies-for-32-bit-build.patch diff --git a/queue-6.6/asoc-fsl_sai-fix-channel-swap-issue-on-i.mx8mp.patch b/queue-6.6/asoc-fsl_sai-fix-channel-swap-issue-on-i.mx8mp.patch new file mode 100644 index 00000000000..9b65f918d6f --- /dev/null +++ b/queue-6.6/asoc-fsl_sai-fix-channel-swap-issue-on-i.mx8mp.patch @@ -0,0 +1,46 @@ +From d490af1ff2f3b34d4ade720bd33c871d4b38a2ad Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 Dec 2023 10:30:57 +0800 +Subject: ASoC: fsl_sai: Fix channel swap issue on i.MX8MP + +From: Shengjiu Wang + +[ Upstream commit 8f0f01647550daf9cd8752c1656dcb0136d79ce1 ] + +When flag mclk_with_tere and mclk_direction_output enabled, +The SAI transmitter or receiver will be enabled in very early +stage, that if FSL_SAI_xMR is set by previous case, +for example previous case is one channel, current case is +two channels, then current case started with wrong xMR in +the beginning, then channel swap happen. + +The patch is to clear xMR in hw_free() to avoid such +channel swap issue. + +Fixes: 3e4a82612998 ("ASoC: fsl_sai: MCLK bind with TX/RX enable bit") +Signed-off-by: Shengjiu Wang +Reviewed-by: Daniel Baluta +Link: https://msgid.link/r/1702953057-4499-1-git-send-email-shengjiu.wang@nxp.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/fsl/fsl_sai.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c +index 3252eefc4bc0e..3d202398c5411 100644 +--- a/sound/soc/fsl/fsl_sai.c ++++ b/sound/soc/fsl/fsl_sai.c +@@ -715,6 +715,9 @@ static int fsl_sai_hw_free(struct snd_pcm_substream *substream, + bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + unsigned int ofs = sai->soc_data->reg_offset; + ++ /* Clear xMR to avoid channel swap with mclk_with_tere enabled case */ ++ regmap_write(sai->regmap, FSL_SAI_xMR(tx), 0); ++ + regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx, ofs), + FSL_SAI_CR3_TRCE_MASK, 0); + +-- +2.43.0 + diff --git a/queue-6.6/asoc-hdmi-codec-fix-missing-report-for-jack-initial-.patch b/queue-6.6/asoc-hdmi-codec-fix-missing-report-for-jack-initial-.patch new file mode 100644 index 00000000000..d01e867ba15 --- /dev/null +++ b/queue-6.6/asoc-hdmi-codec-fix-missing-report-for-jack-initial-.patch @@ -0,0 +1,70 @@ +From f53cc052944579296f0e1f097676b5a2afa5413e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 18 Dec 2023 15:56:52 +0100 +Subject: ASoC: hdmi-codec: fix missing report for jack initial status + +From: Jerome Brunet + +[ Upstream commit 025222a9d6d25eee2ad9a1bb5a8b29b34b5ba576 ] + +This fixes a problem introduced while fixing ELD reporting with no jack +set. + +Most driver using the hdmi-codec will call the 'plugged_cb' callback +directly when registered to report the initial state of the HDMI connector. + +With the commit mentionned, this occurs before jack is ready and the +initial report is lost for platforms actually providing a jack for HDMI. + +Fix this by storing the hdmi connector status regardless of jack being set +or not and report the last status when jack gets set. + +With this, the initial state is reported correctly even if it is +disconnected. This was not done initially and is also a fix. + +Fixes: 15be353d55f9 ("ASoC: hdmi-codec: register hpd callback on component probe") +Reported-by: Zhengqiao Xia +Closes: https://lore.kernel.org/alsa-devel/CADYyEwTNyY+fR9SgfDa-g6iiDwkU3MUdPVCYexs2_3wbcM8_vg@mail.gmail.com/ +Cc: Hsin-Yi Wang +Tested-by: Zhengqiao Xia +Signed-off-by: Jerome Brunet +Link: https://msgid.link/r/20231218145655.134929-1-jbrunet@baylibre.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/hdmi-codec.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c +index 20da1eaa4f1c7..0938671700c62 100644 +--- a/sound/soc/codecs/hdmi-codec.c ++++ b/sound/soc/codecs/hdmi-codec.c +@@ -850,8 +850,9 @@ static int hdmi_dai_probe(struct snd_soc_dai *dai) + static void hdmi_codec_jack_report(struct hdmi_codec_priv *hcp, + unsigned int jack_status) + { +- if (hcp->jack && jack_status != hcp->jack_status) { +- snd_soc_jack_report(hcp->jack, jack_status, SND_JACK_LINEOUT); ++ if (jack_status != hcp->jack_status) { ++ if (hcp->jack) ++ snd_soc_jack_report(hcp->jack, jack_status, SND_JACK_LINEOUT); + hcp->jack_status = jack_status; + } + } +@@ -880,6 +881,13 @@ static int hdmi_codec_set_jack(struct snd_soc_component *component, + + if (hcp->hcd.ops->hook_plugged_cb) { + hcp->jack = jack; ++ ++ /* ++ * Report the initial jack status which may have been provided ++ * by the parent hdmi driver while the hpd hook was registered. ++ */ ++ snd_soc_jack_report(jack, hcp->jack_status, SND_JACK_LINEOUT); ++ + return 0; + } + +-- +2.43.0 + diff --git a/queue-6.6/drm-amdgpu-re-create-idle-bo-s-pte-during-vm-state-m.patch b/queue-6.6/drm-amdgpu-re-create-idle-bo-s-pte-during-vm-state-m.patch new file mode 100644 index 00000000000..c7d79b4c7f8 --- /dev/null +++ b/queue-6.6/drm-amdgpu-re-create-idle-bo-s-pte-during-vm-state-m.patch @@ -0,0 +1,39 @@ +From 7b97670b08afe7a77343f6529de6ff24322ab5a9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 Dec 2023 14:39:42 +0800 +Subject: drm/amdgpu: re-create idle bo's PTE during VM state machine reset +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: ZhenGuo Yin + +[ Upstream commit 4a0057afa35872a5f2e65576785844688dd9fa5e ] + +Idle bo's PTE needs to be re-created when resetting VM state machine. +Set idle bo's vm_bo as moved to mark it as invalid. + +Fixes: 55bf196f60df ("drm/amdgpu: reset VM when an error is detected") +Signed-off-by: ZhenGuo Yin +Reviewed-by: Christian König +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +index 89c8e51cd3323..9fe1278fd5861 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +@@ -285,6 +285,7 @@ static void amdgpu_vm_bo_reset_state_machine(struct amdgpu_vm *vm) + list_for_each_entry_safe(vm_bo, tmp, &vm->idle, vm_status) { + struct amdgpu_bo *bo = vm_bo->bo; + ++ vm_bo->moved = true; + if (!bo || bo->tbo.type != ttm_bo_type_kernel) + list_move(&vm_bo->vm_status, &vm_bo->vm->moved); + else if (bo->parent) +-- +2.43.0 + diff --git a/queue-6.6/drm-i915-hwmon-fix-static-analysis-tool-reported-iss.patch b/queue-6.6/drm-i915-hwmon-fix-static-analysis-tool-reported-iss.patch new file mode 100644 index 00000000000..8365de670b7 --- /dev/null +++ b/queue-6.6/drm-i915-hwmon-fix-static-analysis-tool-reported-iss.patch @@ -0,0 +1,54 @@ +From 8b257a0cd35610b6c1cfbe00fe863706e4471c1e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 4 Dec 2023 20:18:09 +0530 +Subject: drm/i915/hwmon: Fix static analysis tool reported issues + +From: Karthik Poosa + +[ Upstream commit 768f17fd25e4a98bf5166148629ecf6f647d5efc ] + +Updated i915 hwmon with fixes for issues reported by static analysis tool. +Fixed integer overflow with upcasting. + +v2: +- Added Fixes tag (Badal). +- Updated commit message as per review comments (Anshuman). + +Fixes: 4c2572fe0ae7 ("drm/i915/hwmon: Expose power1_max_interval") +Reviewed-by: Badal Nilawar +Reviewed-by: Anshuman Gupta +Signed-off-by: Karthik Poosa +Signed-off-by: Anshuman Gupta +Link: https://patchwork.freedesktop.org/patch/msgid/20231204144809.1518704-1-karthik.poosa@intel.com +(cherry picked from commit ac3420d3d428443a08b923f9118121c170192b62) +Signed-off-by: Jani Nikula +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/i915/i915_hwmon.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/i915/i915_hwmon.c b/drivers/gpu/drm/i915/i915_hwmon.c +index 975da8e7f2a9f..8c3f443c8347e 100644 +--- a/drivers/gpu/drm/i915/i915_hwmon.c ++++ b/drivers/gpu/drm/i915/i915_hwmon.c +@@ -175,7 +175,7 @@ hwm_power1_max_interval_show(struct device *dev, struct device_attribute *attr, + * tau4 = (4 | x) << y + * but add 2 when doing the final right shift to account for units + */ +- tau4 = ((1 << x_w) | x) << y; ++ tau4 = (u64)((1 << x_w) | x) << y; + /* val in hwmon interface units (millisec) */ + out = mul_u64_u32_shr(tau4, SF_TIME, hwmon->scl_shift_time + x_w); + +@@ -211,7 +211,7 @@ hwm_power1_max_interval_store(struct device *dev, + r = FIELD_PREP(PKG_MAX_WIN, PKG_MAX_WIN_DEFAULT); + x = REG_FIELD_GET(PKG_MAX_WIN_X, r); + y = REG_FIELD_GET(PKG_MAX_WIN_Y, r); +- tau4 = ((1 << x_w) | x) << y; ++ tau4 = (u64)((1 << x_w) | x) << y; + max_win = mul_u64_u32_shr(tau4, SF_TIME, hwmon->scl_shift_time + x_w); + + if (val > max_win) +-- +2.43.0 + diff --git a/queue-6.6/drm-i915-mtl-fix-hdmi-dp-pll-clock-selection.patch b/queue-6.6/drm-i915-mtl-fix-hdmi-dp-pll-clock-selection.patch new file mode 100644 index 00000000000..70a68870353 --- /dev/null +++ b/queue-6.6/drm-i915-mtl-fix-hdmi-dp-pll-clock-selection.patch @@ -0,0 +1,41 @@ +From f0997cda38dc316a50abbca1977ed05bb624148b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 14 Dec 2023 00:05:26 +0200 +Subject: drm/i915/mtl: Fix HDMI/DP PLL clock selection + +From: Imre Deak + +[ Upstream commit dbcab554f777390d9bb6a808ed0cd90ee59bb44e ] + +Select the HDMI specific PLL clock only for HDMI outputs. + +Fixes: 62618c7f117e ("drm/i915/mtl: C20 PLL programming") +Cc: Mika Kahola +Cc: Radhakrishna Sripada +Reviewed-by: Radhakrishna Sripada +Signed-off-by: Imre Deak +Link: https://patchwork.freedesktop.org/patch/msgid/20231213220526.1828827-1-imre.deak@intel.com +(cherry picked from commit 937d02cc79c6828fef28a4d80d8d0ad2f7bf2b62) +Signed-off-by: Jani Nikula +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/i915/display/intel_cx0_phy.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c b/drivers/gpu/drm/i915/display/intel_cx0_phy.c +index 80e4ec6ee4031..048e581fda16c 100644 +--- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c ++++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c +@@ -2420,7 +2420,8 @@ static void intel_program_port_clock_ctl(struct intel_encoder *encoder, + + val |= XELPDP_FORWARD_CLOCK_UNGATE; + +- if (is_hdmi_frl(crtc_state->port_clock)) ++ if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI) && ++ is_hdmi_frl(crtc_state->port_clock)) + val |= XELPDP_DDI_CLOCK_SELECT(XELPDP_DDI_CLOCK_SELECT_DIV18CLK); + else + val |= XELPDP_DDI_CLOCK_SELECT(XELPDP_DDI_CLOCK_SELECT_MAXPCLK); +-- +2.43.0 + diff --git a/queue-6.6/gpiolib-cdev-add-gpio_device-locking-wrapper-around-.patch b/queue-6.6/gpiolib-cdev-add-gpio_device-locking-wrapper-around-.patch new file mode 100644 index 00000000000..0dde2b46d42 --- /dev/null +++ b/queue-6.6/gpiolib-cdev-add-gpio_device-locking-wrapper-around-.patch @@ -0,0 +1,64 @@ +From 4483c8a2b46aceb11812b4472cfa409b66f65196 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 21 Dec 2023 09:20:36 +0800 +Subject: gpiolib: cdev: add gpio_device locking wrapper around gpio_ioctl() + +From: Kent Gibson + +[ Upstream commit 1d656bd259edb89dc1d9938ec5c5389867088546 ] + +While the GPIO cdev gpio_ioctl() call is in progress, the kernel can +call gpiochip_remove() which will set gdev->chip to NULL, after which +any subsequent access will cause a crash. + +gpio_ioctl() was overlooked by the previous fix to protect syscalls +(bdbbae241a04), so add protection for that. + +Fixes: bdbbae241a04 ("gpiolib: protect the GPIO device against being dropped while in use by user-space") +Fixes: d7c51b47ac11 ("gpio: userspace ABI for reading/writing GPIO lines") +Fixes: 3c0d9c635ae2 ("gpiolib: cdev: support GPIO_V2_GET_LINE_IOCTL and GPIO_V2_LINE_GET_VALUES_IOCTL") +Fixes: aad955842d1c ("gpiolib: cdev: support GPIO_V2_GET_LINEINFO_IOCTL and GPIO_V2_GET_LINEINFO_WATCH_IOCTL") +Signed-off-by: Kent Gibson +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + drivers/gpio/gpiolib-cdev.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c +index e39d344feb289..4f3e66ece7f78 100644 +--- a/drivers/gpio/gpiolib-cdev.c ++++ b/drivers/gpio/gpiolib-cdev.c +@@ -2482,10 +2482,7 @@ static int lineinfo_unwatch(struct gpio_chardev_data *cdev, void __user *ip) + return 0; + } + +-/* +- * gpio_ioctl() - ioctl handler for the GPIO chardev +- */ +-static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ++static long gpio_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg) + { + struct gpio_chardev_data *cdev = file->private_data; + struct gpio_device *gdev = cdev->gdev; +@@ -2522,6 +2519,17 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) + } + } + ++/* ++ * gpio_ioctl() - ioctl handler for the GPIO chardev ++ */ ++static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ++{ ++ struct gpio_chardev_data *cdev = file->private_data; ++ ++ return call_ioctl_locked(file, cmd, arg, cdev->gdev, ++ gpio_ioctl_unlocked); ++} ++ + #ifdef CONFIG_COMPAT + static long gpio_ioctl_compat(struct file *file, unsigned int cmd, + unsigned long arg) +-- +2.43.0 + diff --git a/queue-6.6/i2c-aspeed-handle-the-coalesced-stop-conditions-with.patch b/queue-6.6/i2c-aspeed-handle-the-coalesced-stop-conditions-with.patch new file mode 100644 index 00000000000..4e6ac81403d --- /dev/null +++ b/queue-6.6/i2c-aspeed-handle-the-coalesced-stop-conditions-with.patch @@ -0,0 +1,115 @@ +From 54e0d88a94fbb7452087a67e7b019868a920e3a5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 11 Dec 2023 17:22:16 +0700 +Subject: i2c: aspeed: Handle the coalesced stop conditions with the start + conditions. + +From: Quan Nguyen + +[ Upstream commit b4cc1cbba5195a4dd497cf2f8f09e7807977d543 ] + +Some masters may drive the transfers with low enough latency between +the nak/stop phase of the current command and the start/address phase +of the following command that the interrupts are coalesced by the +time we process them. +Handle the stop conditions before processing SLAVE_MATCH to fix the +complaints that sometimes occur below. + +"aspeed-i2c-bus 1e78a040.i2c-bus: irq handled != irq. Expected +0x00000086, but was 0x00000084" + +Fixes: f9eb91350bb2 ("i2c: aspeed: added slave support for Aspeed I2C driver") +Signed-off-by: Quan Nguyen +Reviewed-by: Andrew Jeffery +Reviewed-by: Andi Shyti +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-aspeed.c | 48 ++++++++++++++++++++++----------- + 1 file changed, 32 insertions(+), 16 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c +index 28e2a5fc45282..5511fd46a65ea 100644 +--- a/drivers/i2c/busses/i2c-aspeed.c ++++ b/drivers/i2c/busses/i2c-aspeed.c +@@ -249,18 +249,46 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status) + if (!slave) + return 0; + +- command = readl(bus->base + ASPEED_I2C_CMD_REG); ++ /* ++ * Handle stop conditions early, prior to SLAVE_MATCH. Some masters may drive ++ * transfers with low enough latency between the nak/stop phase of the current ++ * command and the start/address phase of the following command that the ++ * interrupts are coalesced by the time we process them. ++ */ ++ if (irq_status & ASPEED_I2CD_INTR_NORMAL_STOP) { ++ irq_handled |= ASPEED_I2CD_INTR_NORMAL_STOP; ++ bus->slave_state = ASPEED_I2C_SLAVE_STOP; ++ } ++ ++ if (irq_status & ASPEED_I2CD_INTR_TX_NAK && ++ bus->slave_state == ASPEED_I2C_SLAVE_READ_PROCESSED) { ++ irq_handled |= ASPEED_I2CD_INTR_TX_NAK; ++ bus->slave_state = ASPEED_I2C_SLAVE_STOP; ++ } ++ ++ /* Propagate any stop conditions to the slave implementation. */ ++ if (bus->slave_state == ASPEED_I2C_SLAVE_STOP) { ++ i2c_slave_event(slave, I2C_SLAVE_STOP, &value); ++ bus->slave_state = ASPEED_I2C_SLAVE_INACTIVE; ++ } + +- /* Slave was requested, restart state machine. */ ++ /* ++ * Now that we've dealt with any potentially coalesced stop conditions, ++ * address any start conditions. ++ */ + if (irq_status & ASPEED_I2CD_INTR_SLAVE_MATCH) { + irq_handled |= ASPEED_I2CD_INTR_SLAVE_MATCH; + bus->slave_state = ASPEED_I2C_SLAVE_START; + } + +- /* Slave is not currently active, irq was for someone else. */ ++ /* ++ * If the slave has been stopped and not started then slave interrupt ++ * handling is complete. ++ */ + if (bus->slave_state == ASPEED_I2C_SLAVE_INACTIVE) + return irq_handled; + ++ command = readl(bus->base + ASPEED_I2C_CMD_REG); + dev_dbg(bus->dev, "slave irq status 0x%08x, cmd 0x%08x\n", + irq_status, command); + +@@ -279,17 +307,6 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status) + irq_handled |= ASPEED_I2CD_INTR_RX_DONE; + } + +- /* Slave was asked to stop. */ +- if (irq_status & ASPEED_I2CD_INTR_NORMAL_STOP) { +- irq_handled |= ASPEED_I2CD_INTR_NORMAL_STOP; +- bus->slave_state = ASPEED_I2C_SLAVE_STOP; +- } +- if (irq_status & ASPEED_I2CD_INTR_TX_NAK && +- bus->slave_state == ASPEED_I2C_SLAVE_READ_PROCESSED) { +- irq_handled |= ASPEED_I2CD_INTR_TX_NAK; +- bus->slave_state = ASPEED_I2C_SLAVE_STOP; +- } +- + switch (bus->slave_state) { + case ASPEED_I2C_SLAVE_READ_REQUESTED: + if (unlikely(irq_status & ASPEED_I2CD_INTR_TX_ACK)) +@@ -324,8 +341,7 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status) + i2c_slave_event(slave, I2C_SLAVE_WRITE_RECEIVED, &value); + break; + case ASPEED_I2C_SLAVE_STOP: +- i2c_slave_event(slave, I2C_SLAVE_STOP, &value); +- bus->slave_state = ASPEED_I2C_SLAVE_INACTIVE; ++ /* Stop event handling is done early. Unreachable. */ + break; + case ASPEED_I2C_SLAVE_START: + /* Slave was just started. Waiting for the next event. */; +-- +2.43.0 + diff --git a/queue-6.6/i2c-qcom-geni-fix-missing-clk_disable_unprepare-and-.patch b/queue-6.6/i2c-qcom-geni-fix-missing-clk_disable_unprepare-and-.patch new file mode 100644 index 00000000000..e45f9ff1b54 --- /dev/null +++ b/queue-6.6/i2c-qcom-geni-fix-missing-clk_disable_unprepare-and-.patch @@ -0,0 +1,59 @@ +From 2e76c0704abffbbc58f520956298cf9289d60436 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 30 Nov 2023 09:43:24 +0800 +Subject: i2c: qcom-geni: fix missing clk_disable_unprepare() and + geni_se_resources_off() + +From: Yang Yingliang + +[ Upstream commit 043465b66506e8c647cdd38a2db1f2ee0f369a1b ] + +Add missing clk_disable_unprepare() and geni_se_resources_off() in the error +path in geni_i2c_probe(). + +Fixes: 14d02fbadb5d ("i2c: qcom-geni: add desc struct to prepare support for I2C Master Hub variant") +Signed-off-by: Yang Yingliang +Reviewed-by: Andi Shyti +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-qcom-geni.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c +index 229353e96e095..0a9d389df301b 100644 +--- a/drivers/i2c/busses/i2c-qcom-geni.c ++++ b/drivers/i2c/busses/i2c-qcom-geni.c +@@ -857,6 +857,7 @@ static int geni_i2c_probe(struct platform_device *pdev) + ret = geni_se_resources_on(&gi2c->se); + if (ret) { + dev_err(dev, "Error turning on resources %d\n", ret); ++ clk_disable_unprepare(gi2c->core_clk); + return ret; + } + proto = geni_se_read_proto(&gi2c->se); +@@ -876,8 +877,11 @@ static int geni_i2c_probe(struct platform_device *pdev) + /* FIFO is disabled, so we can only use GPI DMA */ + gi2c->gpi_mode = true; + ret = setup_gpi_dma(gi2c); +- if (ret) ++ if (ret) { ++ geni_se_resources_off(&gi2c->se); ++ clk_disable_unprepare(gi2c->core_clk); + return dev_err_probe(dev, ret, "Failed to setup GPI DMA mode\n"); ++ } + + dev_dbg(dev, "Using GPI DMA mode for I2C\n"); + } else { +@@ -890,6 +894,8 @@ static int geni_i2c_probe(struct platform_device *pdev) + + if (!tx_depth) { + dev_err(dev, "Invalid TX FIFO depth\n"); ++ geni_se_resources_off(&gi2c->se); ++ clk_disable_unprepare(gi2c->core_clk); + return -EINVAL; + } + +-- +2.43.0 + diff --git a/queue-6.6/pinctrl-at91-pio4-use-dedicated-lock-class-for-irq.patch b/queue-6.6/pinctrl-at91-pio4-use-dedicated-lock-class-for-irq.patch new file mode 100644 index 00000000000..f609e5a166f --- /dev/null +++ b/queue-6.6/pinctrl-at91-pio4-use-dedicated-lock-class-for-irq.patch @@ -0,0 +1,121 @@ +From 9c7992373278333cebac5423a80ddd7a9a2ae428 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 15 Dec 2023 22:34:24 +0100 +Subject: pinctrl: at91-pio4: use dedicated lock class for IRQ +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Alexis Lothoré + +[ Upstream commit 14694179e561b5f2f7e56a0f590e2cb49a9cc7ab ] + +Trying to suspend to RAM on SAMA5D27 EVK leads to the following lockdep +warning: + + ============================================ + WARNING: possible recursive locking detected + 6.7.0-rc5-wt+ #532 Not tainted + -------------------------------------------- + sh/92 is trying to acquire lock: + c3cf306c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0xe8/0x100 + + but task is already holding lock: + c3d7c46c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0xe8/0x100 + + other info that might help us debug this: + Possible unsafe locking scenario: + + CPU0 + ---- + lock(&irq_desc_lock_class); + lock(&irq_desc_lock_class); + + *** DEADLOCK *** + + May be due to missing lock nesting notation + + 6 locks held by sh/92: + #0: c3aa0258 (sb_writers#6){.+.+}-{0:0}, at: ksys_write+0xd8/0x178 + #1: c4c2df44 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x138/0x284 + #2: c32684a0 (kn->active){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x148/0x284 + #3: c232b6d4 (system_transition_mutex){+.+.}-{3:3}, at: pm_suspend+0x13c/0x4e8 + #4: c387b088 (&dev->mutex){....}-{3:3}, at: __device_suspend+0x1e8/0x91c + #5: c3d7c46c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0xe8/0x100 + + stack backtrace: + CPU: 0 PID: 92 Comm: sh Not tainted 6.7.0-rc5-wt+ #532 + Hardware name: Atmel SAMA5 + unwind_backtrace from show_stack+0x18/0x1c + show_stack from dump_stack_lvl+0x34/0x48 + dump_stack_lvl from __lock_acquire+0x19ec/0x3a0c + __lock_acquire from lock_acquire.part.0+0x124/0x2d0 + lock_acquire.part.0 from _raw_spin_lock_irqsave+0x5c/0x78 + _raw_spin_lock_irqsave from __irq_get_desc_lock+0xe8/0x100 + __irq_get_desc_lock from irq_set_irq_wake+0xa8/0x204 + irq_set_irq_wake from atmel_gpio_irq_set_wake+0x58/0xb4 + atmel_gpio_irq_set_wake from irq_set_irq_wake+0x100/0x204 + irq_set_irq_wake from gpio_keys_suspend+0xec/0x2b8 + gpio_keys_suspend from dpm_run_callback+0xe4/0x248 + dpm_run_callback from __device_suspend+0x234/0x91c + __device_suspend from dpm_suspend+0x224/0x43c + dpm_suspend from dpm_suspend_start+0x9c/0xa8 + dpm_suspend_start from suspend_devices_and_enter+0x1e0/0xa84 + suspend_devices_and_enter from pm_suspend+0x460/0x4e8 + pm_suspend from state_store+0x78/0xe4 + state_store from kernfs_fop_write_iter+0x1a0/0x284 + kernfs_fop_write_iter from vfs_write+0x38c/0x6f4 + vfs_write from ksys_write+0xd8/0x178 + ksys_write from ret_fast_syscall+0x0/0x1c + Exception stack(0xc52b3fa8 to 0xc52b3ff0) + 3fa0: 00000004 005a0ae8 00000001 005a0ae8 00000004 00000001 + 3fc0: 00000004 005a0ae8 00000001 00000004 00000004 b6c616c0 00000020 0059d190 + 3fe0: 00000004 b6c61678 aec5a041 aebf1a26 + +This warning is raised because pinctrl-at91-pio4 uses chained IRQ. Whenever +a wake up source configures an IRQ through irq_set_irq_wake, it will +lock the corresponding IRQ desc, and then call irq_set_irq_wake on "parent" +IRQ which will do the same on its own IRQ desc, but since those two locks +share the same class, lockdep reports this as an issue. + +Fix lockdep false positive by setting a different class for parent and +children IRQ + +Fixes: 776180848b57 ("pinctrl: introduce driver for Atmel PIO4 controller") +Signed-off-by: Alexis Lothoré +Link: https://lore.kernel.org/r/20231215-lockdep_warning-v1-1-8137b2510ed5@bootlin.com +Signed-off-by: Linus Walleij +Signed-off-by: Sasha Levin +--- + drivers/pinctrl/pinctrl-at91-pio4.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c +index 383309e533c3d..a27c01fcbb47e 100644 +--- a/drivers/pinctrl/pinctrl-at91-pio4.c ++++ b/drivers/pinctrl/pinctrl-at91-pio4.c +@@ -1068,6 +1068,13 @@ static const struct of_device_id atmel_pctrl_of_match[] = { + } + }; + ++/* ++ * This lock class allows to tell lockdep that parent IRQ and children IRQ do ++ * not share the same class so it does not raise false positive ++ */ ++static struct lock_class_key atmel_lock_key; ++static struct lock_class_key atmel_request_key; ++ + static int atmel_pinctrl_probe(struct platform_device *pdev) + { + struct device *dev = &pdev->dev; +@@ -1214,6 +1221,7 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) + irq_set_chip_and_handler(irq, &atmel_gpio_irq_chip, + handle_simple_irq); + irq_set_chip_data(irq, atmel_pioctrl); ++ irq_set_lockdep_class(irq, &atmel_lock_key, &atmel_request_key); + dev_dbg(dev, + "atmel gpio irq domain: hwirq: %d, linux irq: %d\n", + i, irq); +-- +2.43.0 + diff --git a/queue-6.6/series b/queue-6.6/series index 24b373c8149..357343cddfa 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -67,3 +67,13 @@ net-check-dev-gso_max_size-in-gso_features_check.patch keys-dns-allow-key-types-eg.-dns-to-be-reclaimed-imm.patch afs-fix-overwriting-of-result-of-dns-query.patch afs-fix-use-after-free-due-to-get-remove-race-in-vol.patch +drm-i915-hwmon-fix-static-analysis-tool-reported-iss.patch +drm-i915-mtl-fix-hdmi-dp-pll-clock-selection.patch +asoc-hdmi-codec-fix-missing-report-for-jack-initial-.patch +asoc-fsl_sai-fix-channel-swap-issue-on-i.mx8mp.patch +i2c-qcom-geni-fix-missing-clk_disable_unprepare-and-.patch +drm-amdgpu-re-create-idle-bo-s-pte-during-vm-state-m.patch +i2c-aspeed-handle-the-coalesced-stop-conditions-with.patch +x86-xen-add-cpu-dependencies-for-32-bit-build.patch +pinctrl-at91-pio4-use-dedicated-lock-class-for-irq.patch +gpiolib-cdev-add-gpio_device-locking-wrapper-around-.patch diff --git a/queue-6.6/x86-xen-add-cpu-dependencies-for-32-bit-build.patch b/queue-6.6/x86-xen-add-cpu-dependencies-for-32-bit-build.patch new file mode 100644 index 00000000000..ed902a46ab3 --- /dev/null +++ b/queue-6.6/x86-xen-add-cpu-dependencies-for-32-bit-build.patch @@ -0,0 +1,52 @@ +From ac127c1777090c83c70fa1a244e17af28b36121f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 4 Dec 2023 09:47:01 +0100 +Subject: x86/xen: add CPU dependencies for 32-bit build + +From: Arnd Bergmann + +[ Upstream commit 93cd0597649844a0fe7989839a3202735fb3ae67 ] + +Xen only supports modern CPUs even when running a 32-bit kernel, and it now +requires a kernel built for a 64 byte (or larger) cache line: + +In file included from : +In function 'xen_vcpu_setup', + inlined from 'xen_vcpu_setup_restore' at arch/x86/xen/enlighten.c:111:3, + inlined from 'xen_vcpu_restore' at arch/x86/xen/enlighten.c:141:3: +include/linux/compiler_types.h:435:45: error: call to '__compiletime_assert_287' declared with attribute error: BUILD_BUG_ON failed: sizeof(*vcpup) > SMP_CACHE_BYTES +arch/x86/xen/enlighten.c:166:9: note: in expansion of macro 'BUILD_BUG_ON' + 166 | BUILD_BUG_ON(sizeof(*vcpup) > SMP_CACHE_BYTES); + | ^~~~~~~~~~~~ + +Enforce the dependency with a whitelist of CPU configurations. In normal +distro kernels, CONFIG_X86_GENERIC is enabled, and this works fine. When this +is not set, still allow Xen to be built on kernels that target a 64-bit +capable CPU. + +Fixes: db2832309a82 ("x86/xen: fix percpu vcpu_info allocation") +Signed-off-by: Arnd Bergmann +Reviewed-by: Juergen Gross +Tested-by: Alyssa Ross +Link: https://lore.kernel.org/r/20231204084722.3789473-1-arnd@kernel.org +Signed-off-by: Juergen Gross +Signed-off-by: Sasha Levin +--- + arch/x86/xen/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig +index 9b1ec5d8c99c8..a65fc2ae15b49 100644 +--- a/arch/x86/xen/Kconfig ++++ b/arch/x86/xen/Kconfig +@@ -9,6 +9,7 @@ config XEN + select PARAVIRT_CLOCK + select X86_HV_CALLBACK_VECTOR + depends on X86_64 || (X86_32 && X86_PAE) ++ depends on X86_64 || (X86_GENERIC || MPENTIUM4 || MCORE2 || MATOM || MK8) + depends on X86_LOCAL_APIC && X86_TSC + help + This is the Linux Xen port. Enabling this will allow the +-- +2.43.0 + -- 2.47.3