The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Mikko Perttunen <mperttunen@nvidia.com>
To: Thierry Reding <thierry.reding@kernel.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Ion Agorria <ion@agorria.com>,
	Svyatoslav Ryhel <clamor95@gmail.com>,
	Svyatoslav Ryhel <clamor95@gmail.com>
Cc: dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] drm/tegra: gr2d/gr3d: Initialize address register map before HOST1X client is registered
Date: Fri, 15 May 2026 11:56:52 +0900	[thread overview]
Message-ID: <Z7wT8y6gQPWQUiz9Yr77Fw@nvidia.com> (raw)
In-Reply-To: <20260503163842.213489-2-clamor95@gmail.com>

On Monday, May 4, 2026 1:38 AM Svyatoslav Ryhel wrote:
> The host1x_client_register() function is called just prior to register map
> initialization loop, making the device available to userspace. This may
> result in userspace attempting to submits a job before the register map is
> initialized. Address this by moving register initialization before host1x
> client registration.
> 
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
>  drivers/gpu/drm/tegra/gr2d.c | 8 ++++----
>  drivers/gpu/drm/tegra/gr3d.c | 8 ++++----
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tegra/gr2d.c b/drivers/gpu/drm/tegra/gr2d.c
> index 21f4dd0fa6af..e4148b034af7 100644
> --- a/drivers/gpu/drm/tegra/gr2d.c
> +++ b/drivers/gpu/drm/tegra/gr2d.c
> @@ -276,16 +276,16 @@ static int gr2d_probe(struct platform_device *pdev)
>  	if (err)
>  		return err;
>  
> +	/* initialize address register map */
> +	for (i = 0; i < ARRAY_SIZE(gr2d_addr_regs); i++)
> +		set_bit(gr2d_addr_regs[i], gr2d->addr_regs);
> +
>  	err = host1x_client_register(&gr2d->client.base);
>  	if (err < 0) {
>  		dev_err(dev, "failed to register host1x client: %d\n", err);
>  		return err;
>  	}
>  
> -	/* initialize address register map */
> -	for (i = 0; i < ARRAY_SIZE(gr2d_addr_regs); i++)
> -		set_bit(gr2d_addr_regs[i], gr2d->addr_regs);
> -
>  	return 0;
>  }
>  
> diff --git a/drivers/gpu/drm/tegra/gr3d.c b/drivers/gpu/drm/tegra/gr3d.c
> index 42e9656ab80c..47b0c6c56bfd 100644
> --- a/drivers/gpu/drm/tegra/gr3d.c
> +++ b/drivers/gpu/drm/tegra/gr3d.c
> @@ -506,6 +506,10 @@ static int gr3d_probe(struct platform_device *pdev)
>  	if (err)
>  		return err;
>  
> +	/* initialize address register map */
> +	for (i = 0; i < ARRAY_SIZE(gr3d_addr_regs); i++)
> +		set_bit(gr3d_addr_regs[i], gr3d->addr_regs);
> +
>  	err = host1x_client_register(&gr3d->client.base);
>  	if (err < 0) {
>  		dev_err(&pdev->dev, "failed to register host1x client: %d\n",
> @@ -513,10 +517,6 @@ static int gr3d_probe(struct platform_device *pdev)
>  		return err;
>  	}
>  
> -	/* initialize address register map */
> -	for (i = 0; i < ARRAY_SIZE(gr3d_addr_regs); i++)
> -		set_bit(gr3d_addr_regs[i], gr3d->addr_regs);
> -
>  	return 0;
>  }
>  
> -- 
> 2.51.0
> 
> 

Acked-by: Mikko Perttunen <mperttunen@nvidia.com>




      parent reply	other threads:[~2026-05-15  2:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260503163842.213489-1-clamor95@gmail.com>
     [not found] ` <20260503163842.213489-3-clamor95@gmail.com>
     [not found]   ` <CAPVz0n1N4YHDPW=gsUZWZmRZbt8xQB1V8JWn6cyM75fo7H020w@mail.gmail.com>
2026-05-14  4:07     ` [PATCH v2 2/2] drm/tegra: gr2d/gr3d: Contain PM in the gr*d_probe/gr*d_remove Mikko Perttunen
2026-05-15  7:36       ` Svyatoslav Ryhel
     [not found] ` <20260503163842.213489-2-clamor95@gmail.com>
2026-05-15  2:56   ` Mikko Perttunen [this message]

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=Z7wT8y6gQPWQUiz9Yr77Fw@nvidia.com \
    --to=mperttunen@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=clamor95@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ion@agorria.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=thierry.reding@kernel.org \
    /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