From: Sasha Levin Date: Mon, 12 Jun 2023 03:51:42 +0000 (-0400) Subject: Fixes for 4.19 X-Git-Tag: v4.14.318~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe22071c1370a40c0dcbabc02979e0d7f54e7a21;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/i2c-sprd-delete-i2c-adapter-in-.remove-s-error-path.patch b/queue-4.19/i2c-sprd-delete-i2c-adapter-in-.remove-s-error-path.patch new file mode 100644 index 00000000000..68687d2b332 --- /dev/null +++ b/queue-4.19/i2c-sprd-delete-i2c-adapter-in-.remove-s-error-path.patch @@ -0,0 +1,50 @@ +From 1a6cdd2579c3bfa698cb260ea1d8f3c39e9164ab Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 9 Mar 2023 10:58:19 +0100 +Subject: i2c: sprd: Delete i2c adapter in .remove's error path +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Uwe Kleine-König + +[ Upstream commit ca0aa17f2db3468fd017038d23a78e17388e2f67 ] + +If pm runtime resume fails the .remove callback used to exit early. This +resulted in an error message by the driver core but the device gets +removed anyhow. This lets the registered i2c adapter stay around with an +unbound parent device. + +So only skip clk disabling if resume failed, but do delete the adapter. + +Fixes: 8b9ec0719834 ("i2c: Add Spreadtrum I2C controller driver") +Signed-off-by: Uwe Kleine-König +Reviewed-by: Andi Shyti +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-sprd.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-sprd.c b/drivers/i2c/busses/i2c-sprd.c +index bb1478e781c42..6c95b809abdc4 100644 +--- a/drivers/i2c/busses/i2c-sprd.c ++++ b/drivers/i2c/busses/i2c-sprd.c +@@ -581,10 +581,12 @@ static int sprd_i2c_remove(struct platform_device *pdev) + + ret = pm_runtime_get_sync(i2c_dev->dev); + if (ret < 0) +- return ret; ++ dev_err(&pdev->dev, "Failed to resume device (%pe)\n", ERR_PTR(ret)); + + i2c_del_adapter(&i2c_dev->adap); +- clk_disable_unprepare(i2c_dev->clk); ++ ++ if (ret >= 0) ++ clk_disable_unprepare(i2c_dev->clk); + + pm_runtime_put_noidle(i2c_dev->dev); + pm_runtime_disable(i2c_dev->dev); +-- +2.39.2 + diff --git a/queue-4.19/series b/queue-4.19/series index c23c4eece32..43c9184066b 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -16,3 +16,4 @@ drm-amdgpu-fix-xclk-freq-on-chip_stoney.patch ceph-fix-use-after-free-bug-for-inodes-when-flushing-capsnaps.patch bluetooth-fix-use-after-free-in-hci_remove_ltk-hci_remove_irk.patch pinctrl-meson-axg-add-missing-gpioa_18-gpio-group.patch +i2c-sprd-delete-i2c-adapter-in-.remove-s-error-path.patch