Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Riana Tauro <riana.tauro@intel.com>
To: Karthik Poosa <karthik.poosa@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: <anshuman.gupta@intel.com>, <badal.nilawar@intel.com>
Subject: Re: [PATCH] drm/xe: Fix static analysis tool reported errors
Date: Mon, 25 Mar 2024 11:48:16 +0530	[thread overview]
Message-ID: <4091039f-b735-4526-897f-892e17cfeb55@intel.com> (raw)
In-Reply-To: <20240325035322.3192576-1-karthik.poosa@intel.com>

Hi Karthik

On 3/25/2024 9:23 AM, Karthik Poosa wrote:
> Add a NULL pointer check.
> 
> v2: Release resources before returning error. (Riana)
> 
> v3: Change drm_err to XE_WARN_ON. (Anshuman)
> 
> Fixes: 09d88e3beb64 ("drm/xe/pm: Init pcode and restore vram on power lost")
> Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_pm.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
> index cc650a92c2fc..bbb2ec25aee4 100644
> --- a/drivers/gpu/drm/xe/xe_pm.c
> +++ b/drivers/gpu/drm/xe/xe_pm.c
> @@ -383,6 +383,12 @@ int xe_pm_runtime_resume(struct xe_device *xe)
>   	 * really lost power. Detecting primary Gt power is sufficient.
>   	 */
>   	gt = xe_device_get_gt(xe, 0);
> +	if (!gt) {
> +		XE_WARN_ON(gt);
I don't think this is right. Shouldn't it be XE_WARN_ON(!gt).
Also i think the review comment was to add it in the if statement.

if (XE_WARN_ON(!gt)) {
	err= -ENXIO;
	goto out;
}

Thanks,
Riana
> +		err = -ENXIO;
> +		goto out;
> +	}
> +
>   	xe->d3cold.power_lost = xe_guc_in_reset(&gt->uc.guc);
>   
>   	if (xe->d3cold.allowed && xe->d3cold.power_lost) {

  parent reply	other threads:[~2024-03-25  6:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25  3:53 [PATCH] drm/xe: Fix static analysis tool reported errors Karthik Poosa
2024-03-25  3:48 ` ✓ CI.Patch_applied: success for drm/xe: Fix static analysis tool reported errors (rev4) Patchwork
2024-03-25  3:48 ` ✓ CI.checkpatch: " Patchwork
2024-03-25  3:49 ` ✓ CI.KUnit: " Patchwork
2024-03-25  4:00 ` ✓ CI.Build: " Patchwork
2024-03-25  4:03 ` ✓ CI.Hooks: " Patchwork
2024-03-25  4:04 ` ✓ CI.checksparse: " Patchwork
2024-03-25  4:31 ` ✓ CI.BAT: " Patchwork
2024-03-25  6:18 ` Riana Tauro [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-25  8:05 [PATCH] drm/xe: Fix static analysis tool reported errors Karthik Poosa
2024-03-25  9:44 ` Jani Nikula
2024-03-25  9:45   ` Jani Nikula
2024-03-25 12:00 ` Riana Tauro
2024-03-25 13:29 ` Nilawar, Badal
2024-03-25 13:39   ` Poosa, Karthik
2024-03-25 13:55     ` Poosa, Karthik
2024-03-23 12:13 Karthik Poosa
2024-03-23 10:53 Karthik Poosa
2024-03-24  4:00 ` Gupta, Anshuman
2024-03-23  4:48 Karthik Poosa
2024-03-23  5:07 ` Nilawar, Badal

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=4091039f-b735-4526-897f-892e17cfeb55@intel.com \
    --to=riana.tauro@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=karthik.poosa@intel.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