Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org,
	krzk+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v2 09/16] drm/tidss: Add external data and sync signal edge configuration
Date: Thu, 14 May 2026 07:57:43 +0000	[thread overview]
Message-ID: <20260514075744.8B39AC2BCB7@smtp.kernel.org> (raw)
In-Reply-To: <20260513-beagley-ai-display-v2-9-9e9bcefde6bc@ideasonboard.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Incorrect error check for missing syscon property causes driver probe failure on platforms without it.
- [Medium] Using regmap_write() on a syscon MMR register overwrites the entire register, potentially clearing reserved or unhandled bits.
- [Low] Evaluating PTR_ERR() on a potentially valid pointer without a preceding IS_ERR() check violates API semantics.
--

commit 6ff2a14021d4cf3eead5f27440ae73dbed474911
Author: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

drm/tidss: Add external data and sync signal edge configuration

This commit adds support to configure the DPI output data and sync signal
edges via a syscon register. It looks up the syscon regmap using the
ti,dpi-io-ctrl property and writes the required clock inversion bits
during the video port preparation phase.

> diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c
> --- a/drivers/gpu/drm/tidss/tidss_dispc.c
> +++ b/drivers/gpu/drm/tidss/tidss_dispc.c

[ ... ]

> @@ -1201,6 +1203,13 @@ void dispc_vp_prepare(struct dispc_device *dispc, u32 hw_videoport,
>  				  mode->crtc_hdisplay - 1) |
>  		       FIELD_PREP(DISPC_VP_SIZE_SCREEN_VDISPLAY_MASK,
>  				  mode->crtc_vdisplay - 1));
> +
> +	if (dispc->vp_data[hw_videoport].dpi_output && dispc->syscon_dpi_io_ctrl) {
> +		regmap_write(dispc->syscon_dpi_io_ctrl,
> +			     dispc->syscon_dpi_io_ctrl_offset + 0x0,
> +			     (!ipc ? DPI0_CLK_CTRL_DATA_CLK_INVDIS : 0) |
> +			     (rf ? DPI0_CLK_CTRL_SYNC_CLK_INVDIS : 0));
> +	}
>  }

Could this regmap_write() overwrite other important fields in the syscon MMR
register? 

Using regmap_write() unconditionally writes 0 to all other bits. Should this
be a read-modify-write using regmap_update_bits() with an explicit mask for
bits 8 and 9 to preserve the rest of the register state?

[ ... ]

> @@ -2989,6 +2998,18 @@ int dispc_init(struct tidss_device *tidss)
>  
>  	dispc_init_errata(dispc);
>  
> +	dispc->syscon_dpi_io_ctrl =
> +		syscon_regmap_lookup_by_phandle_args(tidss->dev->of_node,
> +						     "ti,dpi-io-ctrl", 1,
> +						     &dispc->syscon_dpi_io_ctrl_offset);
> +
> +	if (PTR_ERR(dispc->syscon_dpi_io_ctrl) == -ENODEV)

Is it safe to evaluate PTR_ERR() before verifying that the pointer is actually
an error using IS_ERR()?

Also, when the ti,dpi-io-ctrl property is absent from the device tree,
syscon_regmap_lookup_by_phandle_args() returns -ENOENT, not -ENODEV.

Will this cause the driver to evaluate the missing property case as false,
fall through to the IS_ERR() block, and trigger dev_err_probe(), breaking
display initialization on platforms that do not provide this optional
configuration?

> +		dispc->syscon_dpi_io_ctrl = NULL;
> +	else if (IS_ERR(dispc->syscon_dpi_io_ctrl))
> +		return dev_err_probe(dispc->dev,
> +				     PTR_ERR(dispc->syscon_dpi_io_ctrl),
> +				     "DISPC: syscon_regmap_lookup_by_phandle failed.\n");
> +
>  	dispc->fourccs = devm_kcalloc(dev, ARRAY_SIZE(dispc_color_formats),

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260513-beagley-ai-display-v2-0-9e9bcefde6bc@ideasonboard.com?part=9

  reply	other threads:[~2026-05-14  7:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 13:17 [PATCH v2 00/16] drm/tidss: Add BeagleY-AI display support (and some more) Tomi Valkeinen
2026-05-13 13:17 ` [PATCH v2 01/16] dt-bindings: display: ti: Move ti,am62l-dss binding to a new binding file Tomi Valkeinen
2026-05-13 13:17 ` [PATCH v2 02/16] dt-bindings: display: ti,am65x-dss: Simplify binding Tomi Valkeinen
2026-05-13 13:17 ` [PATCH v2 03/16] dt-bindings: display: ti,am625-oldi: Add optional power-domain for OLDI Tomi Valkeinen
2026-05-13 13:17 ` [PATCH v2 04/16] dt-bindings: display: ti,am65x-dss: Add ti,dpi-io-ctrl Tomi Valkeinen
2026-05-13 13:17 ` [PATCH v2 05/16] dt-bindings: display: ti,am65x-dss: Add AM62P DSS Tomi Valkeinen
2026-05-13 13:17 ` [PATCH v2 06/16] drm/tidss: Remove extra pm_runtime_mark_last_busy Tomi Valkeinen
2026-05-13 13:17 ` [PATCH v2 07/16] drm/tidss: oldi: Remove define for unused register OLDI_LB_CTRL Tomi Valkeinen
2026-05-13 13:17 ` [PATCH v2 08/16] drm/tidss: Add mechanism to detect DPI output Tomi Valkeinen
2026-05-13 13:17 ` [PATCH v2 09/16] drm/tidss: Add external data and sync signal edge configuration Tomi Valkeinen
2026-05-14  7:57   ` sashiko-bot [this message]
2026-05-13 13:17 ` [PATCH v2 10/16] drm/tidss: Add support for DPIENABLE bit Tomi Valkeinen
2026-05-14  8:36   ` sashiko-bot
2026-05-13 13:17 ` [PATCH v2 11/16] drm/tidss: oldi: Fix OLDI signal polarities Tomi Valkeinen
2026-05-13 13:17 ` [PATCH v2 12/16] drm/tidss: oldi: Convert OLDI to an aux driver Tomi Valkeinen
2026-05-14 10:55   ` sashiko-bot
2026-05-13 13:17 ` [PATCH v2 13/16] drm/tidss: Add support for AM62P display subsystem Tomi Valkeinen
2026-05-13 13:17 ` [PATCH v2 14/16] arm64: dts: ti: k3-am62p-j722s-common-main: Make main_conf a syscon Tomi Valkeinen
2026-05-14 11:19   ` sashiko-bot
2026-05-13 13:17 ` [PATCH v2 15/16] arm64: dts: ti: k3-am62p-j722s-common-main: Add support for DSS Tomi Valkeinen
2026-05-14 11:32   ` sashiko-bot
2026-05-13 13:17 ` [PATCH v2 16/16] arm64: dts: ti: beagley-ai: Enable HDMI display and audio Tomi Valkeinen
2026-05-14 11:56   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260514075744.8B39AC2BCB7@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tomi.valkeinen@ideasonboard.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox