LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] slimbus: patches for v6.10
@ 2024-04-30  8:50 srinivas.kandagatla
  2024-04-30  8:50 ` [PATCH 1/4] slimbus: qcom-ngd-ctrl: Add timeout for wait operation srinivas.kandagatla
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: srinivas.kandagatla @ 2024-04-30  8:50 UTC (permalink / raw
  To: gregkh; +Cc: linux-kernel, Srinivas Kandagatla

From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

Here are few patches in slimbus for 6.10 that includes
- fixing autoloading.
- coverting driver remove to return void
- some timeout fixes on wait operation.

Please note that, I have also included a fix at the start of this series
rather than sending another email thread. I hope that is okay with you.

Can you please queue them up for 6.10

Thanks,
Srini

MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit


Krzysztof Kozlowski (1):
  slimbus: qcom-ctrl: fix module autoloading

Uwe Kleine-König (1):
  slimbus: Convert to platform remove callback returning void

Viken Dadhaniya (2):
  slimbus: qcom-ngd-ctrl: Add timeout for wait operation
  slimbus: qcom-ngd-ctrl: Reduce auto suspend delay

 drivers/slimbus/qcom-ctrl.c     |  6 +++---
 drivers/slimbus/qcom-ngd-ctrl.c | 20 ++++++++++----------
 2 files changed, 13 insertions(+), 13 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/4] slimbus: qcom-ngd-ctrl: Add timeout for wait operation
  2024-04-30  8:50 [PATCH 0/4] slimbus: patches for v6.10 srinivas.kandagatla
@ 2024-04-30  8:50 ` srinivas.kandagatla
  2024-04-30  8:50 ` [PATCH 2/4] slimbus: qcom-ngd-ctrl: Reduce auto suspend delay srinivas.kandagatla
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: srinivas.kandagatla @ 2024-04-30  8:50 UTC (permalink / raw
  To: gregkh
  Cc: linux-kernel, Viken Dadhaniya, stable, Konrad Dybcio,
	Srinivas Kandagatla

From: Viken Dadhaniya <quic_vdadhani@quicinc.com>

In current driver qcom_slim_ngd_up_worker() indefinitely
waiting for ctrl->qmi_up completion object. This is
resulting in workqueue lockup on Kthread.

Added wait_for_completion_interruptible_timeout to
allow the thread to wait for specific timeout period and
bail out instead waiting infinitely.

Fixes: a899d324863a ("slimbus: qcom-ngd-ctrl: add Sub System Restart support")
Cc: stable@vger.kernel.org
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Viken Dadhaniya <quic_vdadhani@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/slimbus/qcom-ngd-ctrl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index efeba8275a66..a09a26bf4988 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1451,7 +1451,11 @@ static void qcom_slim_ngd_up_worker(struct work_struct *work)
 	ctrl = container_of(work, struct qcom_slim_ngd_ctrl, ngd_up_work);
 
 	/* Make sure qmi service is up before continuing */
-	wait_for_completion_interruptible(&ctrl->qmi_up);
+	if (!wait_for_completion_interruptible_timeout(&ctrl->qmi_up,
+						       msecs_to_jiffies(MSEC_PER_SEC))) {
+		dev_err(ctrl->dev, "QMI wait timeout\n");
+		return;
+	}
 
 	mutex_lock(&ctrl->ssr_lock);
 	qcom_slim_ngd_enable(ctrl, true);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/4] slimbus: qcom-ngd-ctrl: Reduce auto suspend delay
  2024-04-30  8:50 [PATCH 0/4] slimbus: patches for v6.10 srinivas.kandagatla
  2024-04-30  8:50 ` [PATCH 1/4] slimbus: qcom-ngd-ctrl: Add timeout for wait operation srinivas.kandagatla
@ 2024-04-30  8:50 ` srinivas.kandagatla
  2024-04-30  8:50 ` [PATCH 3/4] slimbus: Convert to platform remove callback returning void srinivas.kandagatla
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: srinivas.kandagatla @ 2024-04-30  8:50 UTC (permalink / raw
  To: gregkh; +Cc: linux-kernel, Viken Dadhaniya, Konrad Dybcio, Srinivas Kandagatla

From: Viken Dadhaniya <quic_vdadhani@quicinc.com>

Currently we have auto suspend delay of 1s which is
very high and it takes long time to driver for runtime
suspend after use case is done.

Hence to optimize runtime PM ops, reduce auto suspend
delay to 100ms.

Signed-off-by: Viken Dadhaniya <quic_vdadhani@quicinc.com>
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/slimbus/qcom-ngd-ctrl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index a09a26bf4988..ce28ac35b2b6 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -81,7 +81,6 @@
 #define SLIM_USR_MC_DISCONNECT_PORT	0x2E
 #define SLIM_USR_MC_REPEAT_CHANGE_VALUE	0x0
 
-#define QCOM_SLIM_NGD_AUTOSUSPEND	MSEC_PER_SEC
 #define SLIM_RX_MSGQ_TIMEOUT_VAL	0x10000
 
 #define SLIM_LA_MGR	0xFF
@@ -1575,7 +1574,7 @@ static int qcom_slim_ngd_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, ctrl);
 	pm_runtime_use_autosuspend(dev);
-	pm_runtime_set_autosuspend_delay(dev, QCOM_SLIM_NGD_AUTOSUSPEND);
+	pm_runtime_set_autosuspend_delay(dev, 100);
 	pm_runtime_set_suspended(dev);
 	pm_runtime_enable(dev);
 	pm_runtime_get_noresume(dev);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/4] slimbus: Convert to platform remove callback returning void
  2024-04-30  8:50 [PATCH 0/4] slimbus: patches for v6.10 srinivas.kandagatla
  2024-04-30  8:50 ` [PATCH 1/4] slimbus: qcom-ngd-ctrl: Add timeout for wait operation srinivas.kandagatla
  2024-04-30  8:50 ` [PATCH 2/4] slimbus: qcom-ngd-ctrl: Reduce auto suspend delay srinivas.kandagatla
@ 2024-04-30  8:50 ` srinivas.kandagatla
  2024-04-30  8:50 ` [PATCH 4/4] slimbus: qcom-ctrl: fix module autoloading srinivas.kandagatla
  2024-04-30  8:56 ` [PATCH 0/4] slimbus: patches for v6.10 Greg KH
  4 siblings, 0 replies; 8+ messages in thread
From: srinivas.kandagatla @ 2024-04-30  8:50 UTC (permalink / raw
  To: gregkh; +Cc: linux-kernel, Uwe Kleine-König, Srinivas Kandagatla

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert the slimbus drivers from always returning zero in the
remove callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/slimbus/qcom-ctrl.c     |  5 ++---
 drivers/slimbus/qcom-ngd-ctrl.c | 11 ++++-------
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/slimbus/qcom-ctrl.c b/drivers/slimbus/qcom-ctrl.c
index 400b7b385a44..7d632fad1300 100644
--- a/drivers/slimbus/qcom-ctrl.c
+++ b/drivers/slimbus/qcom-ctrl.c
@@ -626,7 +626,7 @@ static int qcom_slim_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int qcom_slim_remove(struct platform_device *pdev)
+static void qcom_slim_remove(struct platform_device *pdev)
 {
 	struct qcom_slim_ctrl *ctrl = platform_get_drvdata(pdev);
 
@@ -635,7 +635,6 @@ static int qcom_slim_remove(struct platform_device *pdev)
 	clk_disable_unprepare(ctrl->rclk);
 	clk_disable_unprepare(ctrl->hclk);
 	destroy_workqueue(ctrl->rxwq);
-	return 0;
 }
 
 /*
@@ -721,7 +720,7 @@ static const struct of_device_id qcom_slim_dt_match[] = {
 
 static struct platform_driver qcom_slim_driver = {
 	.probe = qcom_slim_probe,
-	.remove = qcom_slim_remove,
+	.remove_new = qcom_slim_remove,
 	.driver	= {
 		.name = "qcom_slim_ctrl",
 		.of_match_table = qcom_slim_dt_match,
diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index ce28ac35b2b6..e0b21f0f79c1 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1678,14 +1678,12 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int qcom_slim_ngd_ctrl_remove(struct platform_device *pdev)
+static void qcom_slim_ngd_ctrl_remove(struct platform_device *pdev)
 {
 	platform_driver_unregister(&qcom_slim_ngd_driver);
-
-	return 0;
 }
 
-static int qcom_slim_ngd_remove(struct platform_device *pdev)
+static void qcom_slim_ngd_remove(struct platform_device *pdev)
 {
 	struct qcom_slim_ngd_ctrl *ctrl = platform_get_drvdata(pdev);
 
@@ -1700,7 +1698,6 @@ static int qcom_slim_ngd_remove(struct platform_device *pdev)
 
 	kfree(ctrl->ngd);
 	ctrl->ngd = NULL;
-	return 0;
 }
 
 static int __maybe_unused qcom_slim_ngd_runtime_idle(struct device *dev)
@@ -1743,7 +1740,7 @@ static const struct dev_pm_ops qcom_slim_ngd_dev_pm_ops = {
 
 static struct platform_driver qcom_slim_ngd_ctrl_driver = {
 	.probe = qcom_slim_ngd_ctrl_probe,
-	.remove = qcom_slim_ngd_ctrl_remove,
+	.remove_new = qcom_slim_ngd_ctrl_remove,
 	.driver	= {
 		.name = "qcom,slim-ngd-ctrl",
 		.of_match_table = qcom_slim_ngd_dt_match,
@@ -1752,7 +1749,7 @@ static struct platform_driver qcom_slim_ngd_ctrl_driver = {
 
 static struct platform_driver qcom_slim_ngd_driver = {
 	.probe = qcom_slim_ngd_probe,
-	.remove = qcom_slim_ngd_remove,
+	.remove_new = qcom_slim_ngd_remove,
 	.driver	= {
 		.name = QCOM_SLIM_NGD_DRV_NAME,
 		.pm = &qcom_slim_ngd_dev_pm_ops,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/4] slimbus: qcom-ctrl: fix module autoloading
  2024-04-30  8:50 [PATCH 0/4] slimbus: patches for v6.10 srinivas.kandagatla
                   ` (2 preceding siblings ...)
  2024-04-30  8:50 ` [PATCH 3/4] slimbus: Convert to platform remove callback returning void srinivas.kandagatla
@ 2024-04-30  8:50 ` srinivas.kandagatla
  2024-04-30  8:56 ` [PATCH 0/4] slimbus: patches for v6.10 Greg KH
  4 siblings, 0 replies; 8+ messages in thread
From: srinivas.kandagatla @ 2024-04-30  8:50 UTC (permalink / raw
  To: gregkh
  Cc: linux-kernel, Krzysztof Kozlowski, Konrad Dybcio,
	Srinivas Kandagatla

From: Krzysztof Kozlowski <krzk@kernel.org>

Add MODULE_DEVICE_TABLE(), so the module could be properly autoloaded
based on the alias from of_device_id table.  Pin controllers are
considered core components, so usually they are built-in, however these

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/slimbus/qcom-ctrl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/slimbus/qcom-ctrl.c b/drivers/slimbus/qcom-ctrl.c
index 7d632fad1300..0274bc285b60 100644
--- a/drivers/slimbus/qcom-ctrl.c
+++ b/drivers/slimbus/qcom-ctrl.c
@@ -717,6 +717,7 @@ static const struct of_device_id qcom_slim_dt_match[] = {
 	{ .compatible = "qcom,slim", },
 	{}
 };
+MODULE_DEVICE_TABLE(of, qcom_slim_dt_match);
 
 static struct platform_driver qcom_slim_driver = {
 	.probe = qcom_slim_probe,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] slimbus: patches for v6.10
  2024-04-30  8:50 [PATCH 0/4] slimbus: patches for v6.10 srinivas.kandagatla
                   ` (3 preceding siblings ...)
  2024-04-30  8:50 ` [PATCH 4/4] slimbus: qcom-ctrl: fix module autoloading srinivas.kandagatla
@ 2024-04-30  8:56 ` Greg KH
  2024-04-30  9:03   ` Srinivas Kandagatla
  4 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2024-04-30  8:56 UTC (permalink / raw
  To: srinivas.kandagatla; +Cc: linux-kernel

On Tue, Apr 30, 2024 at 09:50:03AM +0100, srinivas.kandagatla@linaro.org wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> 
> Here are few patches in slimbus for 6.10 that includes
> - fixing autoloading.
> - coverting driver remove to return void
> - some timeout fixes on wait operation.
> 
> Please note that, I have also included a fix at the start of this series
> rather than sending another email thread. I hope that is okay with you.
> 
> Can you please queue them up for 6.10

Shouldn't the first commit go to 6.9?  If so, why include it here?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] slimbus: patches for v6.10
  2024-04-30  8:56 ` [PATCH 0/4] slimbus: patches for v6.10 Greg KH
@ 2024-04-30  9:03   ` Srinivas Kandagatla
  2024-04-30  9:09     ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Srinivas Kandagatla @ 2024-04-30  9:03 UTC (permalink / raw
  To: Greg KH; +Cc: linux-kernel



On 30/04/2024 09:56, Greg KH wrote:
> On Tue, Apr 30, 2024 at 09:50:03AM +0100, srinivas.kandagatla@linaro.org wrote:
>> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>>
>> Here are few patches in slimbus for 6.10 that includes
>> - fixing autoloading.
>> - coverting driver remove to return void
>> - some timeout fixes on wait operation.
>>
>> Please note that, I have also included a fix at the start of this series
>> rather than sending another email thread. I hope that is okay with you.
>>
>> Can you please queue them up for 6.10
> 
> Shouldn't the first commit go to 6.9?  If so, why include it here?

Yes, first commit should go to 6.9, Do you want me to resend the series 
without that patch or are you okay to pick it this time?

I sent the fix with this series because it was just one patch, and we 
are almost near to rc7.


thanks for your help.

-srini
> 
> thanks,
> 
> greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] slimbus: patches for v6.10
  2024-04-30  9:03   ` Srinivas Kandagatla
@ 2024-04-30  9:09     ` Greg KH
  0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2024-04-30  9:09 UTC (permalink / raw
  To: Srinivas Kandagatla; +Cc: linux-kernel

On Tue, Apr 30, 2024 at 10:03:38AM +0100, Srinivas Kandagatla wrote:
> 
> 
> On 30/04/2024 09:56, Greg KH wrote:
> > On Tue, Apr 30, 2024 at 09:50:03AM +0100, srinivas.kandagatla@linaro.org wrote:
> > > From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> > > 
> > > Here are few patches in slimbus for 6.10 that includes
> > > - fixing autoloading.
> > > - coverting driver remove to return void
> > > - some timeout fixes on wait operation.
> > > 
> > > Please note that, I have also included a fix at the start of this series
> > > rather than sending another email thread. I hope that is okay with you.
> > > 
> > > Can you please queue them up for 6.10
> > 
> > Shouldn't the first commit go to 6.9?  If so, why include it here?
> 
> Yes, first commit should go to 6.9, Do you want me to resend the series
> without that patch or are you okay to pick it this time?

Please do so, send 2 series, one with one patch and one with the rest.
Remember, tools like 'b4' want to take the whole series at once.

> I sent the fix with this series because it was just one patch, and we are
> almost near to rc7.

It's ok, I have other fixes to send for -final.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-04-30  9:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-30  8:50 [PATCH 0/4] slimbus: patches for v6.10 srinivas.kandagatla
2024-04-30  8:50 ` [PATCH 1/4] slimbus: qcom-ngd-ctrl: Add timeout for wait operation srinivas.kandagatla
2024-04-30  8:50 ` [PATCH 2/4] slimbus: qcom-ngd-ctrl: Reduce auto suspend delay srinivas.kandagatla
2024-04-30  8:50 ` [PATCH 3/4] slimbus: Convert to platform remove callback returning void srinivas.kandagatla
2024-04-30  8:50 ` [PATCH 4/4] slimbus: qcom-ctrl: fix module autoloading srinivas.kandagatla
2024-04-30  8:56 ` [PATCH 0/4] slimbus: patches for v6.10 Greg KH
2024-04-30  9:03   ` Srinivas Kandagatla
2024-04-30  9:09     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).