From 8d68f17df3e8eff0a9290006836ce8abeef9397b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 8 Jul 2025 17:15:37 +0200 Subject: [PATCH] 6.1-stable patches added patches: dma-buf-fix-timeout-handling-in-dma_resv_wait_timeout-v2.patch i2c-designware-fix-an-initialization-issue.patch logitech-c-270-even-more-broken.patch --- ...handling-in-dma_resv_wait_timeout-v2.patch | 56 +++++++++++++++++++ ...signware-fix-an-initialization-issue.patch | 39 +++++++++++++ .../logitech-c-270-even-more-broken.patch | 32 +++++++++++ queue-6.1/series | 3 + 4 files changed, 130 insertions(+) create mode 100644 queue-6.1/dma-buf-fix-timeout-handling-in-dma_resv_wait_timeout-v2.patch create mode 100644 queue-6.1/i2c-designware-fix-an-initialization-issue.patch create mode 100644 queue-6.1/logitech-c-270-even-more-broken.patch diff --git a/queue-6.1/dma-buf-fix-timeout-handling-in-dma_resv_wait_timeout-v2.patch b/queue-6.1/dma-buf-fix-timeout-handling-in-dma_resv_wait_timeout-v2.patch new file mode 100644 index 0000000000..41587ca8fb --- /dev/null +++ b/queue-6.1/dma-buf-fix-timeout-handling-in-dma_resv_wait_timeout-v2.patch @@ -0,0 +1,56 @@ +From 2b95a7db6e0f75587bffddbb490399cbb87e4985 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20K=C3=B6nig?= +Date: Tue, 28 Jan 2025 10:47:48 +0100 +Subject: dma-buf: fix timeout handling in dma_resv_wait_timeout v2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Christian König + +commit 2b95a7db6e0f75587bffddbb490399cbb87e4985 upstream. + +Even the kerneldoc says that with a zero timeout the function should not +wait for anything, but still return 1 to indicate that the fences are +signaled now. + +Unfortunately that isn't what was implemented, instead of only returning +1 we also waited for at least one jiffies. + +Fix that by adjusting the handling to what the function is actually +documented to do. + +v2: improve code readability + +Reported-by: Marek Olšák +Reported-by: Lucas Stach +Signed-off-by: Christian König +Reviewed-by: Lucas Stach +Cc: +Link: https://lore.kernel.org/r/20250129105841.1806-1-christian.koenig@amd.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/dma-buf/dma-resv.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +--- a/drivers/dma-buf/dma-resv.c ++++ b/drivers/dma-buf/dma-resv.c +@@ -673,11 +673,13 @@ long dma_resv_wait_timeout(struct dma_re + dma_resv_iter_begin(&cursor, obj, usage); + dma_resv_for_each_fence_unlocked(&cursor, fence) { + +- ret = dma_fence_wait_timeout(fence, intr, ret); +- if (ret <= 0) { +- dma_resv_iter_end(&cursor); +- return ret; +- } ++ ret = dma_fence_wait_timeout(fence, intr, timeout); ++ if (ret <= 0) ++ break; ++ ++ /* Even for zero timeout the return value is 1 */ ++ if (timeout) ++ timeout = ret; + } + dma_resv_iter_end(&cursor); + diff --git a/queue-6.1/i2c-designware-fix-an-initialization-issue.patch b/queue-6.1/i2c-designware-fix-an-initialization-issue.patch new file mode 100644 index 0000000000..6b5e9ea1e5 --- /dev/null +++ b/queue-6.1/i2c-designware-fix-an-initialization-issue.patch @@ -0,0 +1,39 @@ +From 3d30048958e0d43425f6d4e76565e6249fa71050 Mon Sep 17 00:00:00 2001 +From: "Michael J. Ruhl" +Date: Fri, 27 Jun 2025 10:35:11 -0400 +Subject: i2c/designware: Fix an initialization issue + +From: Michael J. Ruhl + +commit 3d30048958e0d43425f6d4e76565e6249fa71050 upstream. + +The i2c_dw_xfer_init() function requires msgs and msg_write_idx from the +dev context to be initialized. + +amd_i2c_dw_xfer_quirk() inits msgs and msgs_num, but not msg_write_idx. + +This could allow an out of bounds access (of msgs). + +Initialize msg_write_idx before calling i2c_dw_xfer_init(). + +Reviewed-by: Andy Shevchenko +Fixes: 17631e8ca2d3 ("i2c: designware: Add driver support for AMD NAVI GPU") +Cc: # v5.13+ +Signed-off-by: Michael J. Ruhl +Signed-off-by: Andi Shyti +Link: https://lore.kernel.org/r/20250627143511.489570-1-michael.j.ruhl@intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/i2c/busses/i2c-designware-master.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/i2c/busses/i2c-designware-master.c ++++ b/drivers/i2c/busses/i2c-designware-master.c +@@ -298,6 +298,7 @@ static int amd_i2c_dw_xfer_quirk(struct + + dev->msgs = msgs; + dev->msgs_num = num_msgs; ++ dev->msg_write_idx = 0; + i2c_dw_xfer_init(dev); + i2c_dw_disable_int(dev); + diff --git a/queue-6.1/logitech-c-270-even-more-broken.patch b/queue-6.1/logitech-c-270-even-more-broken.patch new file mode 100644 index 0000000000..b1ed04e6ac --- /dev/null +++ b/queue-6.1/logitech-c-270-even-more-broken.patch @@ -0,0 +1,32 @@ +From cee4392a57e14a799fbdee193bc4c0de65b29521 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Thu, 5 Jun 2025 14:28:45 +0200 +Subject: Logitech C-270 even more broken + +From: Oliver Neukum + +commit cee4392a57e14a799fbdee193bc4c0de65b29521 upstream. + +Some varieties of this device don't work with +RESET_RESUME alone. + +Signed-off-by: Oliver Neukum +Cc: stable +Link: https://lore.kernel.org/r/20250605122852.1440382-1-oneukum@suse.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/core/quirks.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/usb/core/quirks.c ++++ b/drivers/usb/core/quirks.c +@@ -227,7 +227,8 @@ static const struct usb_device_id usb_qu + { USB_DEVICE(0x046a, 0x0023), .driver_info = USB_QUIRK_RESET_RESUME }, + + /* Logitech HD Webcam C270 */ +- { USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME }, ++ { USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME | ++ USB_QUIRK_NO_LPM}, + + /* Logitech HD Pro Webcams C920, C920-C, C922, C925e and C930e */ + { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT }, diff --git a/queue-6.1/series b/queue-6.1/series index e6571d69ab..8d5b77e582 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -69,3 +69,6 @@ xhci-dbctty-disable-echo-flag-by-default.patch xhci-dbc-flush-queued-requests-before-stopping-dbc.patch xhci-disable-stream-for-xhc-controller-with-xhci_broken_streams.patch usb-cdnsp-do-not-disable-slot-for-disabled-slot.patch +dma-buf-fix-timeout-handling-in-dma_resv_wait_timeout-v2.patch +i2c-designware-fix-an-initialization-issue.patch +logitech-c-270-even-more-broken.patch -- 2.47.2