* [PATCH 1/5] cdx: Enable compile testing
2025-04-25 6:54 [PATCH 0/5] cdx: Minor cleanups Krzysztof Kozlowski
@ 2025-04-25 6:54 ` Krzysztof Kozlowski
2025-04-25 6:54 ` [PATCH 2/5] cdx: controller: Simplify with dev_err_probe() Krzysztof Kozlowski
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2025-04-25 6:54 UTC (permalink / raw)
To: Nipun Gupta, Nikhil Agarwal, Greg Kroah-Hartman
Cc: linux-kernel, Krzysztof Kozlowski
There is no code limmited to ARM64 or OF/Devicetree in the CDX bus
driver, so it can be compile tested on all platforms.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/cdx/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cdx/Kconfig b/drivers/cdx/Kconfig
index a08958485e316a1a3e00390d90c7a9eaa518d0e8..1f1e360507d7d5c33671c601534e82f2d4de0424 100644
--- a/drivers/cdx/Kconfig
+++ b/drivers/cdx/Kconfig
@@ -7,7 +7,7 @@
config CDX_BUS
bool "CDX Bus driver"
- depends on OF && ARM64
+ depends on OF && ARM64 || COMPILE_TEST
help
Driver to enable Composable DMA Transfer(CDX) Bus. CDX bus
exposes Fabric devices which uses composable DMA IP to the
--
2.45.2
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 2/5] cdx: controller: Simplify with dev_err_probe()
2025-04-25 6:54 [PATCH 0/5] cdx: Minor cleanups Krzysztof Kozlowski
2025-04-25 6:54 ` [PATCH 1/5] cdx: Enable compile testing Krzysztof Kozlowski
@ 2025-04-25 6:54 ` Krzysztof Kozlowski
2025-04-25 6:54 ` [PATCH 3/5] cdx: controller: Drop useless probe success message Krzysztof Kozlowski
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2025-04-25 6:54 UTC (permalink / raw)
To: Nipun Gupta, Nikhil Agarwal, Greg Kroah-Hartman
Cc: linux-kernel, Krzysztof Kozlowski
Simplify printing probe failures and handling deferred probe with
dev_err_probe().
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/cdx/controller/cdx_controller.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cdx/controller/cdx_controller.c b/drivers/cdx/controller/cdx_controller.c
index d623f9c7517a86c06082c0db348688e7f33b7be6..3df35833f0e0a994af0606eee0dc1dfc9c7c22f9 100644
--- a/drivers/cdx/controller/cdx_controller.c
+++ b/drivers/cdx/controller/cdx_controller.c
@@ -195,15 +195,13 @@ static int xlnx_cdx_probe(struct platform_device *pdev)
/* Create MSI domain */
cdx->msi_domain = cdx_msi_domain_init(&pdev->dev);
if (!cdx->msi_domain) {
- dev_err(&pdev->dev, "cdx_msi_domain_init() failed");
- ret = -ENODEV;
+ ret = dev_err_probe(&pdev->dev, -ENODEV, "cdx_msi_domain_init() failed");
goto cdx_msi_fail;
}
ret = cdx_setup_rpmsg(pdev);
if (ret) {
- if (ret != -EPROBE_DEFER)
- dev_err(&pdev->dev, "Failed to register CDX RPMsg transport\n");
+ dev_err_probe(&pdev->dev, ret, "Failed to register CDX RPMsg transport\n");
goto cdx_rpmsg_fail;
}
--
2.45.2
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 3/5] cdx: controller: Drop useless probe success message
2025-04-25 6:54 [PATCH 0/5] cdx: Minor cleanups Krzysztof Kozlowski
2025-04-25 6:54 ` [PATCH 1/5] cdx: Enable compile testing Krzysztof Kozlowski
2025-04-25 6:54 ` [PATCH 2/5] cdx: controller: Simplify with dev_err_probe() Krzysztof Kozlowski
@ 2025-04-25 6:54 ` Krzysztof Kozlowski
2025-04-25 6:54 ` [PATCH 4/5] cdx: controller: Do not open-code module_platform_driver() Krzysztof Kozlowski
2025-04-25 6:54 ` [PATCH 5/5] cdx: MAINTAINERS: Explicitly mention Greg who handles patches Krzysztof Kozlowski
4 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2025-04-25 6:54 UTC (permalink / raw)
To: Nipun Gupta, Nikhil Agarwal, Greg Kroah-Hartman
Cc: linux-kernel, Krzysztof Kozlowski
Drivers should be silent on probe success, unless they print some useful
information. Printing "hey I probed" is not useful and kernel already
gives mechanism to investigate that (e.g. sysfs, tracing, initcall
debug).
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/cdx/controller/cdx_controller.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/cdx/controller/cdx_controller.c b/drivers/cdx/controller/cdx_controller.c
index 3df35833f0e0a994af0606eee0dc1dfc9c7c22f9..fce90926d3378ae60166426cbf8e4a4fe014af86 100644
--- a/drivers/cdx/controller/cdx_controller.c
+++ b/drivers/cdx/controller/cdx_controller.c
@@ -205,7 +205,6 @@ static int xlnx_cdx_probe(struct platform_device *pdev)
goto cdx_rpmsg_fail;
}
- dev_info(&pdev->dev, "Successfully registered CDX controller with RPMsg as transport\n");
return 0;
cdx_rpmsg_fail:
--
2.45.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 4/5] cdx: controller: Do not open-code module_platform_driver()
2025-04-25 6:54 [PATCH 0/5] cdx: Minor cleanups Krzysztof Kozlowski
` (2 preceding siblings ...)
2025-04-25 6:54 ` [PATCH 3/5] cdx: controller: Drop useless probe success message Krzysztof Kozlowski
@ 2025-04-25 6:54 ` Krzysztof Kozlowski
2025-04-25 6:59 ` Krzysztof Kozlowski
2025-04-25 6:54 ` [PATCH 5/5] cdx: MAINTAINERS: Explicitly mention Greg who handles patches Krzysztof Kozlowski
4 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2025-04-25 6:54 UTC (permalink / raw)
To: Nipun Gupta, Nikhil Agarwal, Greg Kroah-Hartman
Cc: linux-kernel, Krzysztof Kozlowski
Replace standard platform_driver_register() boilerplate with
module_platform_driver() to make code smaller.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/cdx/controller/cdx_controller.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/drivers/cdx/controller/cdx_controller.c b/drivers/cdx/controller/cdx_controller.c
index fce90926d3378ae60166426cbf8e4a4fe014af86..fca83141e3e66e68e6916077833db2b7d816395f 100644
--- a/drivers/cdx/controller/cdx_controller.c
+++ b/drivers/cdx/controller/cdx_controller.c
@@ -243,31 +243,13 @@ MODULE_DEVICE_TABLE(of, cdx_match_table);
static struct platform_driver cdx_pdriver = {
.driver = {
.name = "cdx-controller",
- .pm = NULL,
.of_match_table = cdx_match_table,
},
.probe = xlnx_cdx_probe,
.remove = xlnx_cdx_remove,
};
-static int __init cdx_controller_init(void)
-{
- int ret;
-
- ret = platform_driver_register(&cdx_pdriver);
- if (ret)
- pr_err("platform_driver_register() failed: %d\n", ret);
-
- return ret;
-}
-
-static void __exit cdx_controller_exit(void)
-{
- platform_driver_unregister(&cdx_pdriver);
-}
-
-module_init(cdx_controller_init);
-module_exit(cdx_controller_exit);
+module_platform_driver(cdx_pdriver);
MODULE_AUTHOR("AMD Inc.");
MODULE_DESCRIPTION("CDX controller for AMD devices");
--
2.45.2
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 4/5] cdx: controller: Do not open-code module_platform_driver()
2025-04-25 6:54 ` [PATCH 4/5] cdx: controller: Do not open-code module_platform_driver() Krzysztof Kozlowski
@ 2025-04-25 6:59 ` Krzysztof Kozlowski
0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2025-04-25 6:59 UTC (permalink / raw)
To: Nipun Gupta, Nikhil Agarwal, Greg Kroah-Hartman; +Cc: linux-kernel
On 25/04/2025 08:54, Krzysztof Kozlowski wrote:
> Replace standard platform_driver_register() boilerplate with
> module_platform_driver() to make code smaller.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> drivers/cdx/controller/cdx_controller.c | 20 +-------------------
> 1 file changed, 1 insertion(+), 19 deletions(-)
>
> diff --git a/drivers/cdx/controller/cdx_controller.c b/drivers/cdx/controller/cdx_controller.c
> index fce90926d3378ae60166426cbf8e4a4fe014af86..fca83141e3e66e68e6916077833db2b7d816395f 100644
> --- a/drivers/cdx/controller/cdx_controller.c
> +++ b/drivers/cdx/controller/cdx_controller.c
> @@ -243,31 +243,13 @@ MODULE_DEVICE_TABLE(of, cdx_match_table);
> static struct platform_driver cdx_pdriver = {
> .driver = {
> .name = "cdx-controller",
> - .pm = NULL,
Too big chunk in `git add -p`. This should be separate patch.
I will wait a day for more reviews and then send v2.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 5/5] cdx: MAINTAINERS: Explicitly mention Greg who handles patches
2025-04-25 6:54 [PATCH 0/5] cdx: Minor cleanups Krzysztof Kozlowski
` (3 preceding siblings ...)
2025-04-25 6:54 ` [PATCH 4/5] cdx: controller: Do not open-code module_platform_driver() Krzysztof Kozlowski
@ 2025-04-25 6:54 ` Krzysztof Kozlowski
4 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2025-04-25 6:54 UTC (permalink / raw)
To: Nipun Gupta, Nikhil Agarwal, Greg Kroah-Hartman
Cc: linux-kernel, Krzysztof Kozlowski
Patches for CDX bus drivers are applied by Greg Kroah-Hartman, so list
him in the maintainers entry because otherwise contributors would be
surprised their patches got lost.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index b2c3be5f6131432647dd01f22bbf4bf1c8bde9e6..505d7d45ad7d1c007e89a555264ff8cbeaf6e1f4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1008,6 +1008,7 @@ F: Documentation/devicetree/bindings/w1/amd,axi-1wire-host.yaml
F: drivers/w1/masters/amd_axi_w1.c
AMD CDX BUS DRIVER
+M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
M: Nipun Gupta <nipun.gupta@amd.com>
M: Nikhil Agarwal <nikhil.agarwal@amd.com>
S: Maintained
--
2.45.2
^ permalink raw reply [flat|nested] 7+ messages in thread