public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: pl330: set subsys_initcall level
       [not found] <CGME20231031035024epcas2p240760f064c90e017a3ada73d9271e9c9@epcas2p2.samsung.com>
@ 2023-10-31  3:48 ` Bumyong Lee
  2023-11-07 10:03   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 4+ messages in thread
From: Bumyong Lee @ 2023-10-31  3:48 UTC (permalink / raw)
  To: Vinod Koul, Philipp Zabel; +Cc: dmaengine, linux-kernel, Bumyong Lee

module_amba_driver is macro for module_init/exit
module_init is device_initcall level when it configured
with built-in driver.

pl330 is dmaengine driver. because slave drivers depend on
dmaengine drivers, dmaengine drivers is more appropriate
subsys_initcall.

Signed-off-by: Bumyong Lee <bumyong.lee@samsung.com>
---
 drivers/dma/pl330.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 3cf0b38387ae..4970830d7ab0 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -3270,7 +3270,17 @@ static struct amba_driver pl330_driver = {
 	.remove = pl330_remove,
 };
 
-module_amba_driver(pl330_driver);
+static int __init pl330_init(void)
+{
+	return amba_driver_register(&pl330_driver);
+}
+subsys_initcall(pl330_init);
+
+static void __exit pl330_exit(void)
+{
+	amba_driver_unregister(&pl330_driver);
+}
+module_exit(pl330_exit);
 
 MODULE_AUTHOR("Jaswinder Singh <jassisinghbrar@gmail.com>");
 MODULE_DESCRIPTION("API Driver for PL330 DMAC");
-- 
2.42.0


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

* Re: [PATCH] dmaengine: pl330: set subsys_initcall level
  2023-10-31  3:48 ` [PATCH] dmaengine: pl330: set subsys_initcall level Bumyong Lee
@ 2023-11-07 10:03   ` Krzysztof Kozlowski
  2023-11-09  4:34     ` bumyong.lee
  0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2023-11-07 10:03 UTC (permalink / raw)
  To: Bumyong Lee, Vinod Koul, Philipp Zabel; +Cc: dmaengine, linux-kernel

On 31/10/2023 04:48, Bumyong Lee wrote:
> module_amba_driver is macro for module_init/exit
> module_init is device_initcall level when it configured
> with built-in driver.
> 
> pl330 is dmaengine driver. because slave drivers depend on
> dmaengine drivers, dmaengine drivers is more appropriate
> subsys_initcall.

The same is true for all resource providers and we do not manually order
them via initcalls. Sorry, this was fine as is. Implement defer for your
drivers, not hack initcalls. If you upstreamed them, then it could even
work out of the box for you .

Best regards,
Krzysztof


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

* RE: [PATCH] dmaengine: pl330: set subsys_initcall level
  2023-11-07 10:03   ` Krzysztof Kozlowski
@ 2023-11-09  4:34     ` bumyong.lee
  2023-11-09  8:49       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 4+ messages in thread
From: bumyong.lee @ 2023-11-09  4:34 UTC (permalink / raw)
  To: 'Krzysztof Kozlowski', 'Vinod Koul',
	'Philipp Zabel'
  Cc: dmaengine, linux-kernel

> On 31/10/2023 04:48, Bumyong Lee wrote:
> > module_amba_driver is macro for module_init/exit module_init is
> > device_initcall level when it configured with built-in driver.
> >
> > pl330 is dmaengine driver. because slave drivers depend on dmaengine
> > drivers, dmaengine drivers is more appropriate subsys_initcall.
> 
> The same is true for all resource providers and we do not manually order
> them via initcalls. Sorry, this was fine as is. Implement defer for your
> drivers, not hack initcalls. If you upstreamed them, then it could even
> work out of the box for you .
> 
> Best regards,
> Krzysztof

I agree with your opinion that the drivers using dma-engine should implement to defer probe when dma is not initialized yet in their probe function execution.
But if dma-engine driver and slave driver is the same initcall level, then a lot of slave drivers should defer probe every time of boot.

I think it's better to use subsys_initcall for pl330 like other dmaengine drivers regardless of slave driver's implementation in order to reduce defer operations.

Best regards
Bumyong Lee


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

* Re: [PATCH] dmaengine: pl330: set subsys_initcall level
  2023-11-09  4:34     ` bumyong.lee
@ 2023-11-09  8:49       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2023-11-09  8:49 UTC (permalink / raw)
  To: bumyong.lee, 'Vinod Koul', 'Philipp Zabel'
  Cc: dmaengine, linux-kernel

On 09/11/2023 05:34, bumyong.lee wrote:
>> On 31/10/2023 04:48, Bumyong Lee wrote:
>>> module_amba_driver is macro for module_init/exit module_init is
>>> device_initcall level when it configured with built-in driver.
>>>
>>> pl330 is dmaengine driver. because slave drivers depend on dmaengine
>>> drivers, dmaengine drivers is more appropriate subsys_initcall.
>>
>> The same is true for all resource providers and we do not manually order
>> them via initcalls. Sorry, this was fine as is. Implement defer for your
>> drivers, not hack initcalls. If you upstreamed them, then it could even
>> work out of the box for you .
>>
>> Best regards,
>> Krzysztof
> 
> I agree with your opinion that the drivers using dma-engine should implement to defer probe when dma is not initialized yet in their probe function execution.

Please wrap your emails to match mailing list discussion style.

> But if dma-engine driver and slave driver is the same initcall level, then a lot of slave drivers should defer probe every time of boot.

Which and how many drivers have this problem?

> 
> I think it's better to use subsys_initcall for pl330 like other dmaengine drivers regardless of slave driver's implementation in order to reduce defer operations.

pl330 requires other resources, so manual ordering via initcalls leads
to other problems. You solve one, create others. And no analysis of
practical impact was provided in commit msg.

Best regards,
Krzysztof


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

end of thread, other threads:[~2023-11-09  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20231031035024epcas2p240760f064c90e017a3ada73d9271e9c9@epcas2p2.samsung.com>
2023-10-31  3:48 ` [PATCH] dmaengine: pl330: set subsys_initcall level Bumyong Lee
2023-11-07 10:03   ` Krzysztof Kozlowski
2023-11-09  4:34     ` bumyong.lee
2023-11-09  8:49       ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox