From: Matt Roper <matthew.d.roper@intel.com>
To: Karthik Poosa <karthik.poosa@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, <anshuman.gupta@intel.com>,
<badal.nilawar@intel.com>, <riana.tauro@intel.com>
Subject: Re: [PATCH 1/2] drm/xe: Fix static analysis tool reported errors
Date: Mon, 25 Mar 2024 10:22:30 -0700 [thread overview]
Message-ID: <20240325172230.GY718896@mdroper-desk1.amr.corp.intel.com> (raw)
In-Reply-To: <20240322143523.2531519-2-karthik.poosa@intel.com>
On Fri, Mar 22, 2024 at 08:05:22PM +0530, Karthik Poosa wrote:
> Add a NULL pointer check.
> Release resources before returning error. (Riana).
Runtime PM doesn't get initialized until after we've gone through
xe_device_probe and initialized the GTs, so it shouldn't be possible to
be resuming from runtime PM with no GTs setup. And every Intel platform
has at least one GT, so we would have aborted probe if that GT failed to
come up.
Matt
>
> Fixes: 09d88e3beb64 ("drm/xe/pm: Init pcode and restore vram on power lost")
> Signed-off-by: Karthik Poosa <karthik.poosa@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..46abf63bc37b 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) {
> + drm_err(&xe->drm, "xe_gt pointer NULL in xe_device\n");
> + err = -ENXIO;
> + goto out;
> + }
> +
> xe->d3cold.power_lost = xe_guc_in_reset(>->uc.guc);
>
> if (xe->d3cold.allowed && xe->d3cold.power_lost) {
> --
> 2.25.1
>
--
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation
next prev parent reply other threads:[~2024-03-25 17:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 14:35 [PATCH 0/2] drm/xe: Fix issues reported by static analysis tool Karthik Poosa
2024-03-22 14:31 ` ✓ CI.Patch_applied: success for drm/xe: Fix issues reported by static analysis tool (rev2) Patchwork
2024-03-22 14:32 ` ✓ CI.checkpatch: " Patchwork
2024-03-22 14:33 ` ✓ CI.KUnit: " Patchwork
2024-03-22 14:35 ` [PATCH 1/2] drm/xe: Fix static analysis tool reported errors Karthik Poosa
2024-03-25 17:22 ` Matt Roper [this message]
2024-03-22 14:35 ` [PATCH 2/2] drm/xe/hwmon: Fix static analysis tool reported issues Karthik Poosa
2024-03-22 14:43 ` ✓ CI.Build: success for drm/xe: Fix issues reported by static analysis tool (rev2) Patchwork
2024-03-22 14:46 ` ✓ CI.Hooks: " Patchwork
2024-03-22 14:47 ` ✓ CI.checksparse: " Patchwork
2024-03-22 15:10 ` ✓ CI.BAT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2024-03-21 10:46 [PATCH 0/2] drm/xe: Fix issues reported by static analysis tool Karthik Poosa
2024-03-21 10:46 ` [PATCH 1/2] drm/xe: Fix static analysis tool reported errors Karthik Poosa
2024-03-22 6:04 ` Gupta, Anshuman
2024-03-22 6:20 ` Riana Tauro
2024-03-22 6:36 ` Poosa, Karthik
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=20240325172230.GY718896@mdroper-desk1.amr.corp.intel.com \
--to=matthew.d.roper@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=badal.nilawar@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=karthik.poosa@intel.com \
--cc=riana.tauro@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