lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <p53hbl4vt7vy6srctswjpmlj2rsvnyop4zcszlwrwdd4nogsj3@utqc25oaccfb>
Date: Mon, 17 Mar 2025 11:16:31 +0100
From: Sebastian Reichel <sre@...nel.org>
To: Andy Yan <andyshrk@....com>
Cc: heiko@...ech.de, cristian.ciocaltea@...labora.com, hjc@...k-chips.com, 
	dri-devel@...ts.freedesktop.org, linux-arm-kernel@...ts.infradead.org, 
	linux-kernel@...r.kernel.org, linux-rockchip@...ts.infradead.org, 
	Andy Yan <andy.yan@...k-chips.com>
Subject: Re: [PATCH] drm/rockchip: dw_hdmi_qp: Fix io init for
 dw_hdmi_qp_rockchip_resume

Hi,

On Mon, Mar 17, 2025 at 04:20:39PM +0800, Andy Yan wrote:
> From: Andy Yan <andy.yan@...k-chips.com>
> 
> Use cfg->ctrl_ops->io_init callback make it work for all platform.
> 
> Fixes: 3f60dbd40d3f ("drm/rockchip: dw_hdmi_qp: Add platform ctrl callback")
> Signed-off-by: Andy Yan <andy.yan@...k-chips.com>
> ---

It also gets rid of code duplication :)

> 
>  .../gpu/drm/rockchip/dw_hdmi_qp-rockchip.c    | 23 +++----------------
>  1 file changed, 3 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
> index 3d1dddb34603..631a7080862b 100644
> --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
> @@ -600,27 +600,10 @@ static void dw_hdmi_qp_rockchip_remove(struct platform_device *pdev)
>  static int __maybe_unused dw_hdmi_qp_rockchip_resume(struct device *dev)
>  {
>  	struct rockchip_hdmi_qp *hdmi = dev_get_drvdata(dev);
> -	u32 val;
> -
> -	val = HIWORD_UPDATE(RK3588_SCLIN_MASK, RK3588_SCLIN_MASK) |
> -	      HIWORD_UPDATE(RK3588_SDAIN_MASK, RK3588_SDAIN_MASK) |
> -	      HIWORD_UPDATE(RK3588_MODE_MASK, RK3588_MODE_MASK) |
> -	      HIWORD_UPDATE(RK3588_I2S_SEL_MASK, RK3588_I2S_SEL_MASK);
> -	regmap_write(hdmi->vo_regmap,
> -		     hdmi->port_id ? RK3588_GRF_VO1_CON6 : RK3588_GRF_VO1_CON3,
> -		     val);
> -
> -	val = HIWORD_UPDATE(RK3588_SET_HPD_PATH_MASK,
> -			    RK3588_SET_HPD_PATH_MASK);
> -	regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON7, val);
> +	const struct rockchip_hdmi_qp_cfg *cfg;
>  
> -	if (hdmi->port_id)
> -		val = HIWORD_UPDATE(RK3588_HDMI1_GRANT_SEL,
> -				    RK3588_HDMI1_GRANT_SEL);
> -	else
> -		val = HIWORD_UPDATE(RK3588_HDMI0_GRANT_SEL,
> -				    RK3588_HDMI0_GRANT_SEL);
> -	regmap_write(hdmi->vo_regmap, RK3588_GRF_VO1_CON9, val);
> +	cfg = of_device_get_match_data(dev);
> +	cfg->ctrl_ops->io_init(hdmi);

I think it would be better to store the ctrl_ops (or io_init)
callback in struct rockchip_hdmi_qp during driver probe and avoid
another lookup of the match_data, which involves string comparisons.

Otherwise:

Reviewed-by: Sebastian Reichel <sebastian.reichel@...labora.com>

Greetings,

-- Sebastian

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ