From cdc4a9a125caea5342822f513584fefd089bc2f4 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Mon, 29 Jan 2024 08:31:29 -0500 Subject: [PATCH] Fixes for 6.1 Signed-off-by: Sasha Levin --- ...ing-genhd_fl_no_part-to-bdev_add_par.patch | 60 +++++++ ...25-ensure-bridge-is-suspended-in-dis.patch | 86 ++++++++++ ...e-ps8640-ensure-bridge-is-suspended-.patch | 86 ++++++++++ ...e-ps8640-make-sure-we-drop-the-aux-m.patch | 46 +++++ ...e-ps8640-wait-for-hpd-when-doing-an-.patch | 51 ++++++ ...i902x-fix-audio-codec-unregistration.patch | 85 ++++++++++ ...ridge-sii902x-fix-probing-race-issue.patch | 130 ++++++++++++++ ...2x-use-devm_regulator_bulk_get_enabl.patch | 84 +++++++++ ...ccidental-on-stack-copy-of-exynos_dr.patch | 66 ++++++++ ...inor-fix-for-loop-iteration-in-gsc_r.patch | 39 +++++ ...-add-missing-bus-flags-for-tianma-tm.patch | 49 ++++++ ...ear-interrupt-after-set-the-interrup.patch | 160 ++++++++++++++++++ ...egister-smp_ops-on-non-smp-platforms.patch | 44 +++++ queue-6.1/series | 15 ++ ...fix-sfdp-bfpt-read-by-usig-mspi-read.patch | 49 ++++++ ...fix-finalize-message-on-error-return.patch | 43 +++++ 16 files changed, 1093 insertions(+) create mode 100644 queue-6.1/block-move-checking-genhd_fl_no_part-to-bdev_add_par.patch create mode 100644 queue-6.1/drm-bridge-anx7625-ensure-bridge-is-suspended-in-dis.patch create mode 100644 queue-6.1/drm-bridge-parade-ps8640-ensure-bridge-is-suspended-.patch create mode 100644 queue-6.1/drm-bridge-parade-ps8640-make-sure-we-drop-the-aux-m.patch create mode 100644 queue-6.1/drm-bridge-parade-ps8640-wait-for-hpd-when-doing-an-.patch create mode 100644 queue-6.1/drm-bridge-sii902x-fix-audio-codec-unregistration.patch create mode 100644 queue-6.1/drm-bridge-sii902x-fix-probing-race-issue.patch create mode 100644 queue-6.1/drm-bridge-sii902x-use-devm_regulator_bulk_get_enabl.patch create mode 100644 queue-6.1/drm-exynos-fix-accidental-on-stack-copy-of-exynos_dr.patch create mode 100644 queue-6.1/drm-exynos-gsc-minor-fix-for-loop-iteration-in-gsc_r.patch create mode 100644 queue-6.1/drm-panel-simple-add-missing-bus-flags-for-tianma-tm.patch create mode 100644 queue-6.1/gpio-eic-sprd-clear-interrupt-after-set-the-interrup.patch create mode 100644 queue-6.1/mips-lantiq-register-smp_ops-on-non-smp-platforms.patch create mode 100644 queue-6.1/spi-bcm-qspi-fix-sfdp-bfpt-read-by-usig-mspi-read.patch create mode 100644 queue-6.1/spi-fix-finalize-message-on-error-return.patch diff --git a/queue-6.1/block-move-checking-genhd_fl_no_part-to-bdev_add_par.patch b/queue-6.1/block-move-checking-genhd_fl_no_part-to-bdev_add_par.patch new file mode 100644 index 00000000000..d93bb8bd876 --- /dev/null +++ b/queue-6.1/block-move-checking-genhd_fl_no_part-to-bdev_add_par.patch @@ -0,0 +1,60 @@ +From 49c24363751816ea425ddc3697e6186854d9605b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 18 Jan 2024 21:04:01 +0800 +Subject: block: Move checking GENHD_FL_NO_PART to bdev_add_partition() + +From: Li Lingfeng + +[ Upstream commit 7777f47f2ea64efd1016262e7b59fab34adfb869 ] + +Commit 1a721de8489f ("block: don't add or resize partition on the disk +with GENHD_FL_NO_PART") prevented all operations about partitions on disks +with GENHD_FL_NO_PART in blkpg_do_ioctl() since they are meaningless. +However, it changed error code in some scenarios. So move checking +GENHD_FL_NO_PART to bdev_add_partition() to eliminate impact. + +Fixes: 1a721de8489f ("block: don't add or resize partition on the disk with GENHD_FL_NO_PART") +Reported-by: Allison Karlitskaya +Closes: https://lore.kernel.org/all/CAOYeF9VsmqKMcQjo1k6YkGNujwN-nzfxY17N3F-CMikE1tYp+w@mail.gmail.com/ +Signed-off-by: Li Lingfeng +Reviewed-by: Yu Kuai +Link: https://lore.kernel.org/r/20240118130401.792757-1-lilingfeng@huaweicloud.com +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + block/ioctl.c | 2 -- + block/partitions/core.c | 5 +++++ + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/block/ioctl.c b/block/ioctl.c +index ebe4a2653622..47567ba1185a 100644 +--- a/block/ioctl.c ++++ b/block/ioctl.c +@@ -20,8 +20,6 @@ static int blkpg_do_ioctl(struct block_device *bdev, + struct blkpg_partition p; + sector_t start, length; + +- if (disk->flags & GENHD_FL_NO_PART) +- return -EINVAL; + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; + if (copy_from_user(&p, upart, sizeof(struct blkpg_partition))) +diff --git a/block/partitions/core.c b/block/partitions/core.c +index b8112f52d388..3927f4283f6b 100644 +--- a/block/partitions/core.c ++++ b/block/partitions/core.c +@@ -453,6 +453,11 @@ int bdev_add_partition(struct gendisk *disk, int partno, sector_t start, + goto out; + } + ++ if (disk->flags & GENHD_FL_NO_PART) { ++ ret = -EINVAL; ++ goto out; ++ } ++ + if (partition_overlaps(disk, start, length, -1)) { + ret = -EBUSY; + goto out; +-- +2.43.0 + diff --git a/queue-6.1/drm-bridge-anx7625-ensure-bridge-is-suspended-in-dis.patch b/queue-6.1/drm-bridge-anx7625-ensure-bridge-is-suspended-in-dis.patch new file mode 100644 index 00000000000..2380344c40f --- /dev/null +++ b/queue-6.1/drm-bridge-anx7625-ensure-bridge-is-suspended-in-dis.patch @@ -0,0 +1,86 @@ +From bdf585528c070712129c223323f183527bbc29bf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 17 Jan 2024 17:58:14 -0800 +Subject: drm/bridge: anx7625: Ensure bridge is suspended in disable() + +From: Hsin-Yi Wang + +[ Upstream commit 4d5b7daa3c610af3f322ad1e91fc0c752ff32f0e ] + +Similar to commit 26db46bc9c67 ("drm/bridge: parade-ps8640: Ensure bridge +is suspended in .post_disable()"). Add a mutex to ensure that aux transfer +won't race with atomic_disable by holding the PM reference and prevent +the bridge from suspend. + +Also we need to use pm_runtime_put_sync_suspend() to suspend the bridge +instead of idle with pm_runtime_put_sync(). + +Fixes: 3203e497eb76 ("drm/bridge: anx7625: Synchronously run runtime suspend.") +Fixes: adca62ec370c ("drm/bridge: anx7625: Support reading edid through aux channel") +Signed-off-by: Hsin-Yi Wang +Tested-by: Xuxin Xiong +Reviewed-by: Pin-yen Lin +Reviewed-by: Douglas Anderson +Signed-off-by: Douglas Anderson +Link: https://patchwork.freedesktop.org/patch/msgid/20240118015916.2296741-1-hsinyi@chromium.org +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/bridge/analogix/anx7625.c | 7 ++++++- + drivers/gpu/drm/bridge/analogix/anx7625.h | 2 ++ + 2 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c +index cf86cc05b7fc..5f8137e9cfd7 100644 +--- a/drivers/gpu/drm/bridge/analogix/anx7625.c ++++ b/drivers/gpu/drm/bridge/analogix/anx7625.c +@@ -1742,6 +1742,7 @@ static ssize_t anx7625_aux_transfer(struct drm_dp_aux *aux, + u8 request = msg->request & ~DP_AUX_I2C_MOT; + int ret = 0; + ++ mutex_lock(&ctx->aux_lock); + pm_runtime_get_sync(dev); + msg->reply = 0; + switch (request) { +@@ -1758,6 +1759,7 @@ static ssize_t anx7625_aux_transfer(struct drm_dp_aux *aux, + msg->size, msg->buffer); + pm_runtime_mark_last_busy(dev); + pm_runtime_put_autosuspend(dev); ++ mutex_unlock(&ctx->aux_lock); + + return ret; + } +@@ -2454,7 +2456,9 @@ static void anx7625_bridge_atomic_disable(struct drm_bridge *bridge, + ctx->connector = NULL; + anx7625_dp_stop(ctx); + +- pm_runtime_put_sync(dev); ++ mutex_lock(&ctx->aux_lock); ++ pm_runtime_put_sync_suspend(dev); ++ mutex_unlock(&ctx->aux_lock); + } + + static enum drm_connector_status +@@ -2648,6 +2652,7 @@ static int anx7625_i2c_probe(struct i2c_client *client) + + mutex_init(&platform->lock); + mutex_init(&platform->hdcp_wq_lock); ++ mutex_init(&platform->aux_lock); + + INIT_DELAYED_WORK(&platform->hdcp_work, hdcp_check_work_func); + platform->hdcp_workqueue = create_workqueue("hdcp workqueue"); +diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.h b/drivers/gpu/drm/bridge/analogix/anx7625.h +index 14f33d6be289..239956199e1b 100644 +--- a/drivers/gpu/drm/bridge/analogix/anx7625.h ++++ b/drivers/gpu/drm/bridge/analogix/anx7625.h +@@ -471,6 +471,8 @@ struct anx7625_data { + struct workqueue_struct *hdcp_workqueue; + /* Lock for hdcp work queue */ + struct mutex hdcp_wq_lock; ++ /* Lock for aux transfer and disable */ ++ struct mutex aux_lock; + char edid_block; + struct display_timing dt; + u8 display_timing_valid; +-- +2.43.0 + diff --git a/queue-6.1/drm-bridge-parade-ps8640-ensure-bridge-is-suspended-.patch b/queue-6.1/drm-bridge-parade-ps8640-ensure-bridge-is-suspended-.patch new file mode 100644 index 00000000000..56e2b387bdf --- /dev/null +++ b/queue-6.1/drm-bridge-parade-ps8640-ensure-bridge-is-suspended-.patch @@ -0,0 +1,86 @@ +From 7686045aa5e5e2bc6f8868c61d6ef656b97c1637 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 9 Jan 2024 20:04:57 +0800 +Subject: drm/bridge: parade-ps8640: Ensure bridge is suspended in + .post_disable() + +From: Pin-yen Lin + +[ Upstream commit 26db46bc9c675e43230cc6accd110110a7654299 ] + +The ps8640 bridge seems to expect everything to be power cycled at the +disable process, but sometimes ps8640_aux_transfer() holds the runtime +PM reference and prevents the bridge from suspend. + +Prevent that by introducing a mutex lock between ps8640_aux_transfer() +and .post_disable() to make sure the bridge is really powered off. + +Fixes: 826cff3f7ebb ("drm/bridge: parade-ps8640: Enable runtime power management") +Signed-off-by: Pin-yen Lin +Reviewed-by: Douglas Anderson +Signed-off-by: Douglas Anderson +Link: https://patchwork.freedesktop.org/patch/msgid/20240109120528.1292601-1-treapking@chromium.org +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/bridge/parade-ps8640.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c b/drivers/gpu/drm/bridge/parade-ps8640.c +index 146e1ad76223..3982568bd093 100644 +--- a/drivers/gpu/drm/bridge/parade-ps8640.c ++++ b/drivers/gpu/drm/bridge/parade-ps8640.c +@@ -106,6 +106,7 @@ struct ps8640 { + struct device_link *link; + bool pre_enabled; + bool need_post_hpd_delay; ++ struct mutex aux_lock; + }; + + static const struct regmap_config ps8640_regmap_config[] = { +@@ -353,6 +354,7 @@ static ssize_t ps8640_aux_transfer(struct drm_dp_aux *aux, + struct device *dev = &ps_bridge->page[PAGE0_DP_CNTL]->dev; + int ret; + ++ mutex_lock(&ps_bridge->aux_lock); + pm_runtime_get_sync(dev); + ret = _ps8640_wait_hpd_asserted(ps_bridge, 200 * 1000); + if (ret) { +@@ -362,6 +364,7 @@ static ssize_t ps8640_aux_transfer(struct drm_dp_aux *aux, + ret = ps8640_aux_transfer_msg(aux, msg); + pm_runtime_mark_last_busy(dev); + pm_runtime_put_autosuspend(dev); ++ mutex_unlock(&ps_bridge->aux_lock); + + return ret; + } +@@ -481,7 +484,18 @@ static void ps8640_post_disable(struct drm_bridge *bridge) + ps_bridge->pre_enabled = false; + + ps8640_bridge_vdo_control(ps_bridge, DISABLE); ++ ++ /* ++ * The bridge seems to expect everything to be power cycled at the ++ * disable process, so grab a lock here to make sure ++ * ps8640_aux_transfer() is not holding a runtime PM reference and ++ * preventing the bridge from suspend. ++ */ ++ mutex_lock(&ps_bridge->aux_lock); ++ + pm_runtime_put_sync_suspend(&ps_bridge->page[PAGE0_DP_CNTL]->dev); ++ ++ mutex_unlock(&ps_bridge->aux_lock); + } + + static int ps8640_bridge_attach(struct drm_bridge *bridge, +@@ -662,6 +676,8 @@ static int ps8640_probe(struct i2c_client *client) + if (!ps_bridge) + return -ENOMEM; + ++ mutex_init(&ps_bridge->aux_lock); ++ + ps_bridge->supplies[0].supply = "vdd12"; + ps_bridge->supplies[1].supply = "vdd33"; + ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ps_bridge->supplies), +-- +2.43.0 + diff --git a/queue-6.1/drm-bridge-parade-ps8640-make-sure-we-drop-the-aux-m.patch b/queue-6.1/drm-bridge-parade-ps8640-make-sure-we-drop-the-aux-m.patch new file mode 100644 index 00000000000..bb6e1822cab --- /dev/null +++ b/queue-6.1/drm-bridge-parade-ps8640-make-sure-we-drop-the-aux-m.patch @@ -0,0 +1,46 @@ +From 40deefaa22b945295d70104fdfd0e1d794103f92 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 17 Jan 2024 10:35:03 -0800 +Subject: drm/bridge: parade-ps8640: Make sure we drop the AUX mutex in the + error case + +From: Douglas Anderson + +[ Upstream commit a20f1b02bafcbf5a32d96a1d4185d6981cf7d016 ] + +After commit 26db46bc9c67 ("drm/bridge: parade-ps8640: Ensure bridge +is suspended in .post_disable()"), if we hit the error case in +ps8640_aux_transfer() then we return without dropping the mutex. Fix +this oversight. + +Fixes: 26db46bc9c67 ("drm/bridge: parade-ps8640: Ensure bridge is suspended in .post_disable()") +Reviewed-by: Hsin-Yi Wang +Signed-off-by: Douglas Anderson +Link: https://patchwork.freedesktop.org/patch/msgid/20240117103502.1.Ib726a0184913925efc7e99c4d4fc801982e1bc24@changeid +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/bridge/parade-ps8640.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c b/drivers/gpu/drm/bridge/parade-ps8640.c +index 3982568bd093..09737acc2cf4 100644 +--- a/drivers/gpu/drm/bridge/parade-ps8640.c ++++ b/drivers/gpu/drm/bridge/parade-ps8640.c +@@ -359,11 +359,13 @@ static ssize_t ps8640_aux_transfer(struct drm_dp_aux *aux, + ret = _ps8640_wait_hpd_asserted(ps_bridge, 200 * 1000); + if (ret) { + pm_runtime_put_sync_suspend(dev); +- return ret; ++ goto exit; + } + ret = ps8640_aux_transfer_msg(aux, msg); + pm_runtime_mark_last_busy(dev); + pm_runtime_put_autosuspend(dev); ++ ++exit: + mutex_unlock(&ps_bridge->aux_lock); + + return ret; +-- +2.43.0 + diff --git a/queue-6.1/drm-bridge-parade-ps8640-wait-for-hpd-when-doing-an-.patch b/queue-6.1/drm-bridge-parade-ps8640-wait-for-hpd-when-doing-an-.patch new file mode 100644 index 00000000000..cd017dbf187 --- /dev/null +++ b/queue-6.1/drm-bridge-parade-ps8640-wait-for-hpd-when-doing-an-.patch @@ -0,0 +1,51 @@ +From f7ee039aace06b0c60b9a8b8497f2347db159032 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 21 Dec 2023 13:55:48 -0800 +Subject: drm/bridge: parade-ps8640: Wait for HPD when doing an AUX transfer + +From: Douglas Anderson + +[ Upstream commit 024b32db43a359e0ded3fcc6cd86247cbbed4224 ] + +Unlike what is claimed in commit f5aa7d46b0ee ("drm/bridge: +parade-ps8640: Provide wait_hpd_asserted() in struct drm_dp_aux"), if +someone manually tries to do an AUX transfer (like via `i2cdump ${bus} +0x50 i`) while the panel is off we don't just get a simple transfer +error. Instead, the whole ps8640 gets thrown for a loop and goes into +a bad state. + +Let's put the function to wait for the HPD (and the magical 50 ms +after first reset) back in when we're doing an AUX transfer. This +shouldn't actually make things much slower (assuming the panel is on) +because we should immediately poll and see the HPD high. Mostly this +is just an extra i2c transfer to the bridge. + +Fixes: f5aa7d46b0ee ("drm/bridge: parade-ps8640: Provide wait_hpd_asserted() in struct drm_dp_aux") +Tested-by: Pin-yen Lin +Reviewed-by: Pin-yen Lin +Signed-off-by: Douglas Anderson +Link: https://patchwork.freedesktop.org/patch/msgid/20231221135548.1.I10f326a9305d57ad32cee7f8d9c60518c8be20fb@changeid +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/bridge/parade-ps8640.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c b/drivers/gpu/drm/bridge/parade-ps8640.c +index 083337a27966..146e1ad76223 100644 +--- a/drivers/gpu/drm/bridge/parade-ps8640.c ++++ b/drivers/gpu/drm/bridge/parade-ps8640.c +@@ -354,6 +354,11 @@ static ssize_t ps8640_aux_transfer(struct drm_dp_aux *aux, + int ret; + + pm_runtime_get_sync(dev); ++ ret = _ps8640_wait_hpd_asserted(ps_bridge, 200 * 1000); ++ if (ret) { ++ pm_runtime_put_sync_suspend(dev); ++ return ret; ++ } + ret = ps8640_aux_transfer_msg(aux, msg); + pm_runtime_mark_last_busy(dev); + pm_runtime_put_autosuspend(dev); +-- +2.43.0 + diff --git a/queue-6.1/drm-bridge-sii902x-fix-audio-codec-unregistration.patch b/queue-6.1/drm-bridge-sii902x-fix-audio-codec-unregistration.patch new file mode 100644 index 00000000000..b4f92832e15 --- /dev/null +++ b/queue-6.1/drm-bridge-sii902x-fix-audio-codec-unregistration.patch @@ -0,0 +1,85 @@ +From 7ad90abca22fd33506ed97e1eca992c4ad0414a4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 3 Jan 2024 15:31:08 +0200 +Subject: drm/bridge: sii902x: Fix audio codec unregistration + +From: Tomi Valkeinen + +[ Upstream commit 3fc6c76a8d208d3955c9e64b382d0ff370bc61fc ] + +The driver never unregisters the audio codec platform device, which can +lead to a crash on module reloading, nor does it handle the return value +from sii902x_audio_codec_init(). + +Signed-off-by: Tomi Valkeinen +Fixes: ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support") +Cc: Jyri Sarha +Acked-by: Linus Walleij +Link: https://lore.kernel.org/r/20240103-si902x-fixes-v1-2-b9fd3e448411@ideasonboard.com +Signed-off-by: Neil Armstrong +Link: https://patchwork.freedesktop.org/patch/msgid/20240103-si902x-fixes-v1-2-b9fd3e448411@ideasonboard.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/bridge/sii902x.c | 21 +++++++++++++++++---- + 1 file changed, 17 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c +index f648d686eb37..6359d6f53a1b 100644 +--- a/drivers/gpu/drm/bridge/sii902x.c ++++ b/drivers/gpu/drm/bridge/sii902x.c +@@ -1040,7 +1040,9 @@ static int sii902x_init(struct sii902x *sii902x) + return ret; + } + +- sii902x_audio_codec_init(sii902x, dev); ++ ret = sii902x_audio_codec_init(sii902x, dev); ++ if (ret) ++ return ret; + + i2c_set_clientdata(sii902x->i2c, sii902x); + +@@ -1048,13 +1050,15 @@ static int sii902x_init(struct sii902x *sii902x) + 1, 0, I2C_MUX_GATE, + sii902x_i2c_bypass_select, + sii902x_i2c_bypass_deselect); +- if (!sii902x->i2cmux) +- return -ENOMEM; ++ if (!sii902x->i2cmux) { ++ ret = -ENOMEM; ++ goto err_unreg_audio; ++ } + + sii902x->i2cmux->priv = sii902x; + ret = i2c_mux_add_adapter(sii902x->i2cmux, 0, 0, 0); + if (ret) +- return ret; ++ goto err_unreg_audio; + + sii902x->bridge.funcs = &sii902x_bridge_funcs; + sii902x->bridge.of_node = dev->of_node; +@@ -1067,6 +1071,12 @@ static int sii902x_init(struct sii902x *sii902x) + drm_bridge_add(&sii902x->bridge); + + return 0; ++ ++err_unreg_audio: ++ if (!PTR_ERR_OR_ZERO(sii902x->audio.pdev)) ++ platform_device_unregister(sii902x->audio.pdev); ++ ++ return ret; + } + + static int sii902x_probe(struct i2c_client *client, +@@ -1139,6 +1149,9 @@ static void sii902x_remove(struct i2c_client *client) + + drm_bridge_remove(&sii902x->bridge); + i2c_mux_del_adapters(sii902x->i2cmux); ++ ++ if (!PTR_ERR_OR_ZERO(sii902x->audio.pdev)) ++ platform_device_unregister(sii902x->audio.pdev); + } + + static const struct of_device_id sii902x_dt_ids[] = { +-- +2.43.0 + diff --git a/queue-6.1/drm-bridge-sii902x-fix-probing-race-issue.patch b/queue-6.1/drm-bridge-sii902x-fix-probing-race-issue.patch new file mode 100644 index 00000000000..2dce73878db --- /dev/null +++ b/queue-6.1/drm-bridge-sii902x-fix-probing-race-issue.patch @@ -0,0 +1,130 @@ +From 172d2b8aaf68ce7a1a872bd5c21ce9dbb00f5435 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 3 Jan 2024 15:31:07 +0200 +Subject: drm/bridge: sii902x: Fix probing race issue + +From: Tomi Valkeinen + +[ Upstream commit 08ac6f132dd77e40f786d8af51140c96c6d739c9 ] + +A null pointer dereference crash has been observed rarely on TI +platforms using sii9022 bridge: + +[ 53.271356] sii902x_get_edid+0x34/0x70 [sii902x] +[ 53.276066] sii902x_bridge_get_edid+0x14/0x20 [sii902x] +[ 53.281381] drm_bridge_get_edid+0x20/0x34 [drm] +[ 53.286305] drm_bridge_connector_get_modes+0x8c/0xcc [drm_kms_helper] +[ 53.292955] drm_helper_probe_single_connector_modes+0x190/0x538 [drm_kms_helper] +[ 53.300510] drm_client_modeset_probe+0x1f0/0xbd4 [drm] +[ 53.305958] __drm_fb_helper_initial_config_and_unlock+0x50/0x510 [drm_kms_helper] +[ 53.313611] drm_fb_helper_initial_config+0x48/0x58 [drm_kms_helper] +[ 53.320039] drm_fbdev_dma_client_hotplug+0x84/0xd4 [drm_dma_helper] +[ 53.326401] drm_client_register+0x5c/0xa0 [drm] +[ 53.331216] drm_fbdev_dma_setup+0xc8/0x13c [drm_dma_helper] +[ 53.336881] tidss_probe+0x128/0x264 [tidss] +[ 53.341174] platform_probe+0x68/0xc4 +[ 53.344841] really_probe+0x188/0x3c4 +[ 53.348501] __driver_probe_device+0x7c/0x16c +[ 53.352854] driver_probe_device+0x3c/0x10c +[ 53.357033] __device_attach_driver+0xbc/0x158 +[ 53.361472] bus_for_each_drv+0x88/0xe8 +[ 53.365303] __device_attach+0xa0/0x1b4 +[ 53.369135] device_initial_probe+0x14/0x20 +[ 53.373314] bus_probe_device+0xb0/0xb4 +[ 53.377145] deferred_probe_work_func+0xcc/0x124 +[ 53.381757] process_one_work+0x1f0/0x518 +[ 53.385770] worker_thread+0x1e8/0x3dc +[ 53.389519] kthread+0x11c/0x120 +[ 53.392750] ret_from_fork+0x10/0x20 + +The issue here is as follows: + +- tidss probes, but is deferred as sii902x is still missing. +- sii902x starts probing and enters sii902x_init(). +- sii902x calls drm_bridge_add(). Now the sii902x bridge is ready from + DRM's perspective. +- sii902x calls sii902x_audio_codec_init() and + platform_device_register_data() +- The registration of the audio platform device causes probing of the + deferred devices. +- tidss probes, which eventually causes sii902x_bridge_get_edid() to be + called. +- sii902x_bridge_get_edid() tries to use the i2c to read the edid. + However, the sii902x driver has not set up the i2c part yet, leading + to the crash. + +Fix this by moving the drm_bridge_add() to the end of the +sii902x_init(), which is also at the very end of sii902x_probe(). + +Signed-off-by: Tomi Valkeinen +Fixes: 21d808405fe4 ("drm/bridge/sii902x: Fix EDID readback") +Acked-by: Linus Walleij +Link: https://lore.kernel.org/r/20240103-si902x-fixes-v1-1-b9fd3e448411@ideasonboard.com +Signed-off-by: Neil Armstrong +Link: https://patchwork.freedesktop.org/patch/msgid/20240103-si902x-fixes-v1-1-b9fd3e448411@ideasonboard.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/bridge/sii902x.c | 29 ++++++++++++++++------------- + 1 file changed, 16 insertions(+), 13 deletions(-) + +diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c +index f6e8b401069b..f648d686eb37 100644 +--- a/drivers/gpu/drm/bridge/sii902x.c ++++ b/drivers/gpu/drm/bridge/sii902x.c +@@ -1040,16 +1040,6 @@ static int sii902x_init(struct sii902x *sii902x) + return ret; + } + +- sii902x->bridge.funcs = &sii902x_bridge_funcs; +- sii902x->bridge.of_node = dev->of_node; +- sii902x->bridge.timings = &default_sii902x_timings; +- sii902x->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID; +- +- if (sii902x->i2c->irq > 0) +- sii902x->bridge.ops |= DRM_BRIDGE_OP_HPD; +- +- drm_bridge_add(&sii902x->bridge); +- + sii902x_audio_codec_init(sii902x, dev); + + i2c_set_clientdata(sii902x->i2c, sii902x); +@@ -1062,7 +1052,21 @@ static int sii902x_init(struct sii902x *sii902x) + return -ENOMEM; + + sii902x->i2cmux->priv = sii902x; +- return i2c_mux_add_adapter(sii902x->i2cmux, 0, 0, 0); ++ ret = i2c_mux_add_adapter(sii902x->i2cmux, 0, 0, 0); ++ if (ret) ++ return ret; ++ ++ sii902x->bridge.funcs = &sii902x_bridge_funcs; ++ sii902x->bridge.of_node = dev->of_node; ++ sii902x->bridge.timings = &default_sii902x_timings; ++ sii902x->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID; ++ ++ if (sii902x->i2c->irq > 0) ++ sii902x->bridge.ops |= DRM_BRIDGE_OP_HPD; ++ ++ drm_bridge_add(&sii902x->bridge); ++ ++ return 0; + } + + static int sii902x_probe(struct i2c_client *client, +@@ -1130,12 +1134,11 @@ static int sii902x_probe(struct i2c_client *client, + } + + static void sii902x_remove(struct i2c_client *client) +- + { + struct sii902x *sii902x = i2c_get_clientdata(client); + +- i2c_mux_del_adapters(sii902x->i2cmux); + drm_bridge_remove(&sii902x->bridge); ++ i2c_mux_del_adapters(sii902x->i2cmux); + } + + static const struct of_device_id sii902x_dt_ids[] = { +-- +2.43.0 + diff --git a/queue-6.1/drm-bridge-sii902x-use-devm_regulator_bulk_get_enabl.patch b/queue-6.1/drm-bridge-sii902x-use-devm_regulator_bulk_get_enabl.patch new file mode 100644 index 00000000000..453a9662c00 --- /dev/null +++ b/queue-6.1/drm-bridge-sii902x-use-devm_regulator_bulk_get_enabl.patch @@ -0,0 +1,84 @@ +From d4596b022a3d0a0a996a34e991b523e4494648fc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 30 Nov 2022 11:22:37 +0200 +Subject: drm/bridge: sii902x: Use devm_regulator_bulk_get_enable() + +From: Matti Vaittinen + +[ Upstream commit ff1eae1201a46f997126297d2d3440baa2d1b9a9 ] + +Simplify using devm_regulator_bulk_get_enable() + +Signed-off-by: Matti Vaittinen +Acked-by: Robert Foss +Signed-off-by: Neil Armstrong +Link: https://patchwork.freedesktop.org/patch/msgid/e6153c7beb2076b9ea13082b2024ec3296bc08bc.1669799805.git.mazziesaccount@gmail.com +Stable-dep-of: 08ac6f132dd7 ("drm/bridge: sii902x: Fix probing race issue") +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/bridge/sii902x.c | 26 ++++---------------------- + 1 file changed, 4 insertions(+), 22 deletions(-) + +diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c +index 878fb7d3732b..f6e8b401069b 100644 +--- a/drivers/gpu/drm/bridge/sii902x.c ++++ b/drivers/gpu/drm/bridge/sii902x.c +@@ -171,7 +171,6 @@ struct sii902x { + struct drm_connector connector; + struct gpio_desc *reset_gpio; + struct i2c_mux_core *i2cmux; +- struct regulator_bulk_data supplies[2]; + bool sink_is_hdmi; + /* + * Mutex protects audio and video functions from interfering +@@ -1072,6 +1071,7 @@ static int sii902x_probe(struct i2c_client *client, + struct device *dev = &client->dev; + struct device_node *endpoint; + struct sii902x *sii902x; ++ static const char * const supplies[] = {"iovcc", "cvcc12"}; + int ret; + + ret = i2c_check_functionality(client->adapter, +@@ -1122,27 +1122,11 @@ static int sii902x_probe(struct i2c_client *client, + + mutex_init(&sii902x->mutex); + +- sii902x->supplies[0].supply = "iovcc"; +- sii902x->supplies[1].supply = "cvcc12"; +- ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(sii902x->supplies), +- sii902x->supplies); ++ ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(supplies), supplies); + if (ret < 0) +- return ret; +- +- ret = regulator_bulk_enable(ARRAY_SIZE(sii902x->supplies), +- sii902x->supplies); +- if (ret < 0) { +- dev_err_probe(dev, ret, "Failed to enable supplies"); +- return ret; +- } ++ return dev_err_probe(dev, ret, "Failed to enable supplies"); + +- ret = sii902x_init(sii902x); +- if (ret < 0) { +- regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies), +- sii902x->supplies); +- } +- +- return ret; ++ return sii902x_init(sii902x); + } + + static void sii902x_remove(struct i2c_client *client) +@@ -1152,8 +1136,6 @@ static void sii902x_remove(struct i2c_client *client) + + i2c_mux_del_adapters(sii902x->i2cmux); + drm_bridge_remove(&sii902x->bridge); +- regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies), +- sii902x->supplies); + } + + static const struct of_device_id sii902x_dt_ids[] = { +-- +2.43.0 + diff --git a/queue-6.1/drm-exynos-fix-accidental-on-stack-copy-of-exynos_dr.patch b/queue-6.1/drm-exynos-fix-accidental-on-stack-copy-of-exynos_dr.patch new file mode 100644 index 00000000000..f8e42039eeb --- /dev/null +++ b/queue-6.1/drm-exynos-fix-accidental-on-stack-copy-of-exynos_dr.patch @@ -0,0 +1,66 @@ +From 07cabe206a58ea208f96fe69e93b8882b2aabbdb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 14 Dec 2023 13:32:15 +0100 +Subject: drm/exynos: fix accidental on-stack copy of exynos_drm_plane + +From: Arnd Bergmann + +[ Upstream commit 960b537e91725bcb17dd1b19e48950e62d134078 ] + +gcc rightfully complains about excessive stack usage in the fimd_win_set_pixfmt() +function: + +drivers/gpu/drm/exynos/exynos_drm_fimd.c: In function 'fimd_win_set_pixfmt': +drivers/gpu/drm/exynos/exynos_drm_fimd.c:750:1: error: the frame size of 1032 bytes is larger than 1024 byte +drivers/gpu/drm/exynos/exynos5433_drm_decon.c: In function 'decon_win_set_pixfmt': +drivers/gpu/drm/exynos/exynos5433_drm_decon.c:381:1: error: the frame size of 1032 bytes is larger than 1024 bytes + +There is really no reason to copy the large exynos_drm_plane +structure to the stack before using one of its members, so just +use a pointer instead. + +Fixes: 6f8ee5c21722 ("drm/exynos: fimd: Make plane alpha configurable") +Signed-off-by: Arnd Bergmann +Reviewed-by: Marek Szyprowski +Signed-off-by: Inki Dae +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 4 ++-- + drivers/gpu/drm/exynos/exynos_drm_fimd.c | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +index 8155d7e650f1..4bc5d9470acd 100644 +--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c ++++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +@@ -319,9 +319,9 @@ static void decon_win_set_bldmod(struct decon_context *ctx, unsigned int win, + static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win, + struct drm_framebuffer *fb) + { +- struct exynos_drm_plane plane = ctx->planes[win]; ++ struct exynos_drm_plane *plane = &ctx->planes[win]; + struct exynos_drm_plane_state *state = +- to_exynos_plane_state(plane.base.state); ++ to_exynos_plane_state(plane->base.state); + unsigned int alpha = state->base.alpha; + unsigned int pixel_alpha; + unsigned long val; +diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c +index ae6636e6658e..529033b980b2 100644 +--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c ++++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c +@@ -662,9 +662,9 @@ static void fimd_win_set_bldmod(struct fimd_context *ctx, unsigned int win, + static void fimd_win_set_pixfmt(struct fimd_context *ctx, unsigned int win, + struct drm_framebuffer *fb, int width) + { +- struct exynos_drm_plane plane = ctx->planes[win]; ++ struct exynos_drm_plane *plane = &ctx->planes[win]; + struct exynos_drm_plane_state *state = +- to_exynos_plane_state(plane.base.state); ++ to_exynos_plane_state(plane->base.state); + uint32_t pixel_format = fb->format->format; + unsigned int alpha = state->base.alpha; + u32 val = WINCONx_ENWIN; +-- +2.43.0 + diff --git a/queue-6.1/drm-exynos-gsc-minor-fix-for-loop-iteration-in-gsc_r.patch b/queue-6.1/drm-exynos-gsc-minor-fix-for-loop-iteration-in-gsc_r.patch new file mode 100644 index 00000000000..e5c0c9c3cf4 --- /dev/null +++ b/queue-6.1/drm-exynos-gsc-minor-fix-for-loop-iteration-in-gsc_r.patch @@ -0,0 +1,39 @@ +From 6f60b95eec955ef78cf749a274a9945cc8c7816d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 20 Dec 2023 12:53:15 +0300 +Subject: drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume + +From: Fedor Pchelkin + +[ Upstream commit 4050957c7c2c14aa795dbf423b4180d5ac04e113 ] + +Do not forget to call clk_disable_unprepare() on the first element of +ctx->clocks array. + +Found by Linux Verification Center (linuxtesting.org). + +Fixes: 8b7d3ec83aba ("drm/exynos: gsc: Convert driver to IPP v2 core API") +Signed-off-by: Fedor Pchelkin +Reviewed-by: Marek Szyprowski +Signed-off-by: Inki Dae +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c +index 964dceb28c1e..68ea92742b06 100644 +--- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c ++++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c +@@ -1342,7 +1342,7 @@ static int __maybe_unused gsc_runtime_resume(struct device *dev) + for (i = 0; i < ctx->num_clocks; i++) { + ret = clk_prepare_enable(ctx->clocks[i]); + if (ret) { +- while (--i > 0) ++ while (--i >= 0) + clk_disable_unprepare(ctx->clocks[i]); + return ret; + } +-- +2.43.0 + diff --git a/queue-6.1/drm-panel-simple-add-missing-bus-flags-for-tianma-tm.patch b/queue-6.1/drm-panel-simple-add-missing-bus-flags-for-tianma-tm.patch new file mode 100644 index 00000000000..d024e899aad --- /dev/null +++ b/queue-6.1/drm-panel-simple-add-missing-bus-flags-for-tianma-tm.patch @@ -0,0 +1,49 @@ +From d1548b9637b1cd21496526bde829e22902d4d384 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 12 Oct 2023 10:42:08 +0200 +Subject: drm: panel-simple: add missing bus flags for Tianma tm070jvhg[30/33] + +From: Markus Niebel + +[ Upstream commit 45dd7df26cee741b31c25ffdd44fb8794eb45ccd ] + +The DE signal is active high on this display, fill in the missing +bus_flags. This aligns panel_desc with its display_timing. + +Fixes: 9a2654c0f62a ("drm/panel: Add and fill drm_panel type field") +Fixes: b3bfcdf8a3b6 ("drm/panel: simple: add Tianma TM070JVHG33") + +Signed-off-by: Markus Niebel +Signed-off-by: Alexander Stein +Reviewed-by: Sam Ravnborg +Link: https://lore.kernel.org/r/20231012084208.2731650-1-alexander.stein@ew.tq-group.com +Signed-off-by: Neil Armstrong +Link: https://patchwork.freedesktop.org/patch/msgid/20231012084208.2731650-1-alexander.stein@ew.tq-group.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/panel/panel-simple.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c +index 005377f58eb4..b714ee1bcbaa 100644 +--- a/drivers/gpu/drm/panel/panel-simple.c ++++ b/drivers/gpu/drm/panel/panel-simple.c +@@ -3603,6 +3603,7 @@ static const struct panel_desc tianma_tm070jdhg30 = { + }, + .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, + .connector_type = DRM_MODE_CONNECTOR_LVDS, ++ .bus_flags = DRM_BUS_FLAG_DE_HIGH, + }; + + static const struct panel_desc tianma_tm070jvhg33 = { +@@ -3615,6 +3616,7 @@ static const struct panel_desc tianma_tm070jvhg33 = { + }, + .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, + .connector_type = DRM_MODE_CONNECTOR_LVDS, ++ .bus_flags = DRM_BUS_FLAG_DE_HIGH, + }; + + static const struct display_timing tianma_tm070rvhg71_timing = { +-- +2.43.0 + diff --git a/queue-6.1/gpio-eic-sprd-clear-interrupt-after-set-the-interrup.patch b/queue-6.1/gpio-eic-sprd-clear-interrupt-after-set-the-interrup.patch new file mode 100644 index 00000000000..6f01d95b74d --- /dev/null +++ b/queue-6.1/gpio-eic-sprd-clear-interrupt-after-set-the-interrup.patch @@ -0,0 +1,160 @@ +From a7dd3c8be38d8517804172a2b6fb2b33d4eeb13c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 9 Jan 2024 15:38:48 +0800 +Subject: gpio: eic-sprd: Clear interrupt after set the interrupt type + +From: Wenhua Lin + +[ Upstream commit 84aef4ed59705585d629e81d633a83b7d416f5fb ] + +The raw interrupt status of eic maybe set before the interrupt is enabled, +since the eic interrupt has a latch function, which would trigger the +interrupt event once enabled it from user side. To solve this problem, +interrupts generated before setting the interrupt trigger type are ignored. + +Fixes: 25518e024e3a ("gpio: Add Spreadtrum EIC driver support") +Acked-by: Chunyan Zhang +Signed-off-by: Wenhua Lin +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + drivers/gpio/gpio-eic-sprd.c | 32 ++++++++++++++++++++++++++++---- + 1 file changed, 28 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c +index 8d722e026e9c..c2857ed0c78a 100644 +--- a/drivers/gpio/gpio-eic-sprd.c ++++ b/drivers/gpio/gpio-eic-sprd.c +@@ -318,20 +318,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type) + switch (flow_type) { + case IRQ_TYPE_LEVEL_HIGH: + sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IEV, 1); ++ sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IC, 1); + break; + case IRQ_TYPE_LEVEL_LOW: + sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IEV, 0); ++ sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IC, 1); + break; + case IRQ_TYPE_EDGE_RISING: + case IRQ_TYPE_EDGE_FALLING: + case IRQ_TYPE_EDGE_BOTH: + state = sprd_eic_get(chip, offset); +- if (state) ++ if (state) { + sprd_eic_update(chip, offset, + SPRD_EIC_DBNC_IEV, 0); +- else ++ sprd_eic_update(chip, offset, ++ SPRD_EIC_DBNC_IC, 1); ++ } else { + sprd_eic_update(chip, offset, + SPRD_EIC_DBNC_IEV, 1); ++ sprd_eic_update(chip, offset, ++ SPRD_EIC_DBNC_IC, 1); ++ } + break; + default: + return -ENOTSUPP; +@@ -343,20 +350,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type) + switch (flow_type) { + case IRQ_TYPE_LEVEL_HIGH: + sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTPOL, 0); ++ sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTCLR, 1); + break; + case IRQ_TYPE_LEVEL_LOW: + sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTPOL, 1); ++ sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTCLR, 1); + break; + case IRQ_TYPE_EDGE_RISING: + case IRQ_TYPE_EDGE_FALLING: + case IRQ_TYPE_EDGE_BOTH: + state = sprd_eic_get(chip, offset); +- if (state) ++ if (state) { + sprd_eic_update(chip, offset, + SPRD_EIC_LATCH_INTPOL, 0); +- else ++ sprd_eic_update(chip, offset, ++ SPRD_EIC_LATCH_INTCLR, 1); ++ } else { + sprd_eic_update(chip, offset, + SPRD_EIC_LATCH_INTPOL, 1); ++ sprd_eic_update(chip, offset, ++ SPRD_EIC_LATCH_INTCLR, 1); ++ } + break; + default: + return -ENOTSUPP; +@@ -370,29 +384,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type) + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0); + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0); + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 1); ++ sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1); + irq_set_handler_locked(data, handle_edge_irq); + break; + case IRQ_TYPE_EDGE_FALLING: + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0); + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0); + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 0); ++ sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1); + irq_set_handler_locked(data, handle_edge_irq); + break; + case IRQ_TYPE_EDGE_BOTH: + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0); + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 1); ++ sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1); + irq_set_handler_locked(data, handle_edge_irq); + break; + case IRQ_TYPE_LEVEL_HIGH: + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0); + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 1); + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 1); ++ sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1); + irq_set_handler_locked(data, handle_level_irq); + break; + case IRQ_TYPE_LEVEL_LOW: + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0); + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 1); + sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 0); ++ sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1); + irq_set_handler_locked(data, handle_level_irq); + break; + default: +@@ -405,29 +424,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type) + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0); + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0); + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 1); ++ sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1); + irq_set_handler_locked(data, handle_edge_irq); + break; + case IRQ_TYPE_EDGE_FALLING: + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0); + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0); + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 0); ++ sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1); + irq_set_handler_locked(data, handle_edge_irq); + break; + case IRQ_TYPE_EDGE_BOTH: + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0); + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 1); ++ sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1); + irq_set_handler_locked(data, handle_edge_irq); + break; + case IRQ_TYPE_LEVEL_HIGH: + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0); + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 1); + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 1); ++ sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1); + irq_set_handler_locked(data, handle_level_irq); + break; + case IRQ_TYPE_LEVEL_LOW: + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0); + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 1); + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 0); ++ sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1); + irq_set_handler_locked(data, handle_level_irq); + break; + default: +-- +2.43.0 + diff --git a/queue-6.1/mips-lantiq-register-smp_ops-on-non-smp-platforms.patch b/queue-6.1/mips-lantiq-register-smp_ops-on-non-smp-platforms.patch new file mode 100644 index 00000000000..abb7aaae634 --- /dev/null +++ b/queue-6.1/mips-lantiq-register-smp_ops-on-non-smp-platforms.patch @@ -0,0 +1,44 @@ +From e17c4e23da495364e18b901c36d02adaee0bf3e3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 22 Jan 2024 19:47:09 +0100 +Subject: MIPS: lantiq: register smp_ops on non-smp platforms + +From: Aleksander Jan Bajkowski + +[ Upstream commit 4bf2a626dc4bb46f0754d8ac02ec8584ff114ad5 ] + +Lantiq uses a common kernel config for devices with 24Kc and 34Kc cores. +The changes made previously to add support for interrupts on all cores +work on 24Kc platforms with SMP disabled and 34Kc platforms with SMP +enabled. This patch fixes boot issues on Danube (single core 24Kc) with +SMP enabled. + +Fixes: 730320fd770d ("MIPS: lantiq: enable all hardware interrupts on second VPE") +Signed-off-by: Aleksander Jan Bajkowski +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Sasha Levin +--- + arch/mips/lantiq/prom.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c +index be4829cc7a3a..28da4e720d17 100644 +--- a/arch/mips/lantiq/prom.c ++++ b/arch/mips/lantiq/prom.c +@@ -114,10 +114,9 @@ void __init prom_init(void) + prom_init_cmdline(); + + #if defined(CONFIG_MIPS_MT_SMP) +- if (cpu_has_mipsmt) { +- lantiq_smp_ops = vsmp_smp_ops; ++ lantiq_smp_ops = vsmp_smp_ops; ++ if (cpu_has_mipsmt) + lantiq_smp_ops.init_secondary = lantiq_init_secondary; +- register_smp_ops(&lantiq_smp_ops); +- } ++ register_smp_ops(&lantiq_smp_ops); + #endif + } +-- +2.43.0 + diff --git a/queue-6.1/series b/queue-6.1/series index ff238871da2..245975e973b 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -164,3 +164,18 @@ btrfs-zoned-optimize-hint-byte-for-zoned-allocator.patch nfsd-fix-release_lockowner.patch drm-panel-edp-drm-panel-edp-fix-auo-b116xak01-name-a.patch revert-powerpc-64s-increase-default-stack-size-to-32.patch +drm-bridge-parade-ps8640-wait-for-hpd-when-doing-an-.patch +drm-panel-simple-add-missing-bus-flags-for-tianma-tm.patch +drm-bridge-sii902x-use-devm_regulator_bulk_get_enabl.patch +drm-bridge-sii902x-fix-probing-race-issue.patch +drm-bridge-sii902x-fix-audio-codec-unregistration.patch +drm-bridge-parade-ps8640-ensure-bridge-is-suspended-.patch +drm-bridge-parade-ps8640-make-sure-we-drop-the-aux-m.patch +drm-exynos-fix-accidental-on-stack-copy-of-exynos_dr.patch +drm-exynos-gsc-minor-fix-for-loop-iteration-in-gsc_r.patch +gpio-eic-sprd-clear-interrupt-after-set-the-interrup.patch +block-move-checking-genhd_fl_no_part-to-bdev_add_par.patch +drm-bridge-anx7625-ensure-bridge-is-suspended-in-dis.patch +spi-bcm-qspi-fix-sfdp-bfpt-read-by-usig-mspi-read.patch +spi-fix-finalize-message-on-error-return.patch +mips-lantiq-register-smp_ops-on-non-smp-platforms.patch diff --git a/queue-6.1/spi-bcm-qspi-fix-sfdp-bfpt-read-by-usig-mspi-read.patch b/queue-6.1/spi-bcm-qspi-fix-sfdp-bfpt-read-by-usig-mspi-read.patch new file mode 100644 index 00000000000..517af6b3219 --- /dev/null +++ b/queue-6.1/spi-bcm-qspi-fix-sfdp-bfpt-read-by-usig-mspi-read.patch @@ -0,0 +1,49 @@ +From 0e0104c885d2890c0cdfe239e4dbcdccaddb79e4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 9 Jan 2024 16:00:32 -0500 +Subject: spi: bcm-qspi: fix SFDP BFPT read by usig mspi read + +From: Kamal Dasu + +[ Upstream commit 574bf7bbe83794a902679846770f75a9b7f28176 ] + +SFDP read shall use the mspi reads when using the bcm_qspi_exec_mem_op() +call. This fixes SFDP parameter page read failures seen with parts that +now use SFDP protocol to read the basic flash parameter table. + +Fixes: 5f195ee7d830 ("spi: bcm-qspi: Implement the spi_mem interface") +Signed-off-by: Kamal Dasu +Tested-by: Florian Fainelli +Reviewed-by: Florian Fainelli +Link: https://msgid.link/r/20240109210033.43249-1-kamal.dasu@broadcom.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spi-bcm-qspi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c +index 137e7315a3cf..b24955910147 100644 +--- a/drivers/spi/spi-bcm-qspi.c ++++ b/drivers/spi/spi-bcm-qspi.c +@@ -19,7 +19,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include "spi-bcm-qspi.h" +@@ -1221,7 +1221,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem, + + /* non-aligned and very short transfers are handled by MSPI */ + if (!IS_ALIGNED((uintptr_t)addr, 4) || !IS_ALIGNED((uintptr_t)buf, 4) || +- len < 4) ++ len < 4 || op->cmd.opcode == SPINOR_OP_RDSFDP) + mspi_read = true; + + if (!has_bspi(qspi) || mspi_read) +-- +2.43.0 + diff --git a/queue-6.1/spi-fix-finalize-message-on-error-return.patch b/queue-6.1/spi-fix-finalize-message-on-error-return.patch new file mode 100644 index 00000000000..b51a1ed2d4d --- /dev/null +++ b/queue-6.1/spi-fix-finalize-message-on-error-return.patch @@ -0,0 +1,43 @@ +From 2384fac7449d9256b82bc1aeed3270476e6f7bdd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 Jan 2024 14:53:09 -0600 +Subject: spi: fix finalize message on error return + +From: David Lechner + +[ Upstream commit 8c2ae772fe08e33f3d7a83849e85539320701abd ] + +In __spi_pump_transfer_message(), the message was not finalized in the +first error return as it is in the other error return paths. Not +finalizing the message could cause anything waiting on the message to +complete to hang forever. + +This adds the missing call to spi_finalize_current_message(). + +Fixes: ae7d2346dc89 ("spi: Don't use the message queue if possible in spi_sync") +Signed-off-by: David Lechner +Link: https://msgid.link/r/20240125205312.3458541-2-dlechner@baylibre.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spi.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c +index 22d227878bc4..19688f333e0b 100644 +--- a/drivers/spi/spi.c ++++ b/drivers/spi/spi.c +@@ -1636,6 +1636,10 @@ static int __spi_pump_transfer_message(struct spi_controller *ctlr, + pm_runtime_put_noidle(ctlr->dev.parent); + dev_err(&ctlr->dev, "Failed to power device: %d\n", + ret); ++ ++ msg->status = ret; ++ spi_finalize_current_message(ctlr); ++ + return ret; + } + } +-- +2.43.0 + -- 2.47.3