[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87qzz5d3le.fsf@minerva.mail-host-address-is-not-set>
Date: Fri, 27 Jun 2025 09:51:41 +0200
From: Javier Martinez Canillas <javierm@...hat.com>
To: Luca Weiss <luca.weiss@...rphone.com>, Hans de Goede
<hdegoede@...hat.com>, Maarten Lankhorst
<maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>, Rob Herring <robh@...nel.org>, Krzysztof
Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Helge
Deller <deller@....de>
Cc: linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, Luca Weiss
<luca.weiss@...rphone.com>
Subject: Re: [PATCH v2 3/5] drm/sysfb: simpledrm: Add support for
interconnect paths
Luca Weiss <luca.weiss@...rphone.com> writes:
> Some devices might require keeping an interconnect path alive so that
> the framebuffer continues working. Add support for that by setting the
> bandwidth requirements appropriately for all provided interconnect
> paths.
>
> Reviewed-by: Thomas Zimmermann <tzimmermann@...e.de>
> Signed-off-by: Luca Weiss <luca.weiss@...rphone.com>
> ---
> drivers/gpu/drm/sysfb/simpledrm.c | 83 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 83 insertions(+)
>
> diff --git a/drivers/gpu/drm/sysfb/simpledrm.c b/drivers/gpu/drm/sysfb/simpledrm.c
> index 349219330314e3421a6bb26ad5cf39a679a5cb7a..47d213e20cab1dd1e19528674a95edea00f4bb30 100644
> --- a/drivers/gpu/drm/sysfb/simpledrm.c
> +++ b/drivers/gpu/drm/sysfb/simpledrm.c
> @@ -2,6 +2,7 @@
>
> #include <linux/aperture.h>
> #include <linux/clk.h>
> +#include <linux/interconnect.h>
> #include <linux/minmax.h>
> #include <linux/of_address.h>
> #include <linux/of_clk.h>
> @@ -225,6 +226,10 @@ struct simpledrm_device {
> struct device **pwr_dom_devs;
> struct device_link **pwr_dom_links;
> #endif
Can you add a /* interconnects */ comment here? Similarly how there is one
for clocks, regulators, power domains, etc.
> +#if defined CONFIG_OF && defined CONFIG_INTERCONNECT
> + unsigned int icc_count;
> + struct icc_path **icc_paths;
> +#endif
>
...
> +static int simpledrm_device_attach_icc(struct simpledrm_device *sdev)
> +{
> + struct device *dev = sdev->sysfb.dev.dev;
> + int ret, count, i;
> +
> + count = of_count_phandle_with_args(dev->of_node, "interconnects",
> + "#interconnect-cells");
> + if (count < 0)
> + return 0;
> +
> + /* An interconnect path consists of two elements */
> + if (count % 2) {
> + drm_err(&sdev->sysfb.dev,
> + "invalid interconnects value\n");
> + return -EINVAL;
> + }
> + sdev->icc_count = count / 2;
> +
> + sdev->icc_paths = devm_kcalloc(dev, sdev->icc_count,
> + sizeof(*sdev->icc_paths),
> + GFP_KERNEL);
> + if (!sdev->icc_paths)
> + return -ENOMEM;
> +
> + for (i = 0; i < sdev->icc_count; i++) {
> + sdev->icc_paths[i] = of_icc_get_by_index(dev, i);
> + if (IS_ERR_OR_NULL(sdev->icc_paths[i])) {
> + ret = PTR_ERR(sdev->icc_paths[i]);
> + if (ret == -EPROBE_DEFER)
> + goto err;
> + drm_err(&sdev->sysfb.dev, "failed to get interconnect path %u: %d\n",
> + i, ret);
You could use dev_err_probe() instead that already handles the -EPROBE_DEFER
case and also will get this message in the /sys/kernel/debug/devices_deferred
debugfs entry, as the reason why the probe deferral happened.
Reviewed-by: Javier Martinez Canillas <javierm@...hat.com>
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
Powered by blists - more mailing lists