From: Nirmoy Das <nirmoy.das@linux.intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
Nirmoy Das <nirmoy.das@intel.com>,
intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 2/9] drm/xe/pat: Always call xe_force_wake_put/get in pairs
Date: Tue, 4 Jun 2024 15:06:05 +0200 [thread overview]
Message-ID: <1f0c994e-1ecc-4f47-9161-ceff346e35d1@linux.intel.com> (raw)
In-Reply-To: <ab9b7cd1-852a-4144-80bb-e41ef23c9d09@intel.com>
Hi Michal,
On 6/4/2024 2:54 PM, Michal Wajdeczko wrote:
>
> On 04.06.2024 13:02, Nirmoy Das wrote:
>> xe_force_wake_get() increments the domain ref regardless of success
>> or failure so call xe_force_wake_put() even on failure to keep ref
>> count accurate.
>>
>> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_pat.c | 10 +++++-----
>> 1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c
>> index 4ee32ee1cc88..a5bdf4de845c 100644
>> --- a/drivers/gpu/drm/xe/xe_pat.c
>> +++ b/drivers/gpu/drm/xe/xe_pat.c
>> @@ -190,9 +190,9 @@ static void xelp_dump(struct xe_gt *gt, struct drm_printer *p)
>> XELP_MEM_TYPE_STR_MAP[mem_type], pat);
>> }
>>
>> - err = xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
>> err_fw:
>> xe_assert(xe, !err);
>> + xe_assert(xe, !xe_force_wake_put(gt_to_fw(gt), XE_FW_GT));
> this is wrong as xe_assert() will be compiled out on the production
> builds, see [1]
>
> [1]
> https://www.kernel.org/doc/html/latest/gpu/xe/xe_debugging.html?highlight=xe_assert#debugging
Ah, yes! thanks for catching this.
Regards,
Nirmoy
>
>> }
>>
>> static const struct xe_pat_ops xelp_pat_ops = {
>> @@ -221,9 +221,9 @@ static void xehp_dump(struct xe_gt *gt, struct drm_printer *p)
>> XELP_MEM_TYPE_STR_MAP[mem_type], pat);
>> }
>>
>> - err = xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
>> err_fw:
>> xe_assert(xe, !err);
>> + xe_assert(xe, !xe_force_wake_put(gt_to_fw(gt), XE_FW_GT));
>> }
>>
>> static const struct xe_pat_ops xehp_pat_ops = {
>> @@ -250,9 +250,9 @@ static void xehpc_dump(struct xe_gt *gt, struct drm_printer *p)
>> REG_FIELD_GET(XEHPC_CLOS_LEVEL_MASK, pat), pat);
>> }
>>
>> - err = xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
>> err_fw:
>> xe_assert(xe, !err);
>> + xe_assert(xe, !xe_force_wake_put(gt_to_fw(gt), XE_FW_GT));
>> }
>>
>> static const struct xe_pat_ops xehpc_pat_ops = {
>> @@ -284,9 +284,9 @@ static void xelpg_dump(struct xe_gt *gt, struct drm_printer *p)
>> REG_FIELD_GET(XELPG_INDEX_COH_MODE_MASK, pat), pat);
>> }
>>
>> - err = xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
>> err_fw:
>> xe_assert(xe, !err);
>> + xe_assert(xe, !xe_force_wake_put(gt_to_fw(gt), XE_FW_GT));
>> }
>>
>> /*
>> @@ -366,9 +366,9 @@ static void xe2_dump(struct xe_gt *gt, struct drm_printer *p)
>> REG_FIELD_GET(XE2_COH_MODE, pat),
>> pat);
>>
>> - err = xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
>> err_fw:
>> xe_assert(xe, !err);
>> + xe_assert(xe, !xe_force_wake_put(gt_to_fw(gt), XE_FW_GT));
>> }
>>
>> static const struct xe_pat_ops xe2_pat_ops = {
next prev parent reply other threads:[~2024-06-04 13:06 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-04 11:02 [PATCH 0/9] Ensure xe_force_wake_put is always called after xe_force_wake_get Nirmoy Das
2024-06-04 11:02 ` [PATCH 1/9] drm/xe/display: Always call xe_force_wake_put/get in pairs Nirmoy Das
2024-06-04 11:41 ` Ghimiray, Himal Prasad
2024-06-04 11:02 ` [PATCH 2/9] drm/xe/pat: " Nirmoy Das
2024-06-04 12:54 ` Michal Wajdeczko
2024-06-04 13:06 ` Nirmoy Das [this message]
2024-06-04 11:02 ` [PATCH 3/9] drm/xe/xe_reg_sr: " Nirmoy Das
2024-06-04 13:12 ` Michal Wajdeczko
2024-06-04 14:21 ` Nirmoy Das
2024-06-04 21:13 ` Lucas De Marchi
2024-06-05 10:49 ` Nirmoy Das
2024-06-06 17:46 ` Rodrigo Vivi
2024-06-10 9:59 ` Nirmoy Das
2024-06-04 11:02 ` [PATCH 4/9] drm/xe/xe_gt: " Nirmoy Das
2024-06-04 11:02 ` [PATCH 5/9] drm/xe/uc: " Nirmoy Das
2024-06-04 11:02 ` [PATCH 6/9] drm/xe: Add xe_force_wake_tryget to simplify forcewake handling Nirmoy Das
2024-06-04 11:02 ` [PATCH 7/9] drm/xe: Use xe_force_wake_tryget when possible Nirmoy Das
2024-06-04 11:02 ` [PATCH 8/9] drm/xe/client: Check return value of xe_force_wake_get Nirmoy Das
2024-06-04 11:02 ` [PATCH 9/9] drm/xe: Add __must_check for xe_force_wake_get Nirmoy Das
2024-06-04 20:49 ` [PATCH 0/9] Ensure xe_force_wake_put is always called after xe_force_wake_get Lucas De Marchi
2024-06-05 1:06 ` ✓ CI.Patch_applied: success for " Patchwork
2024-06-05 1:07 ` ✓ CI.checkpatch: " Patchwork
2024-06-05 1:08 ` ✓ CI.KUnit: " Patchwork
2024-06-05 1:19 ` ✓ CI.Build: " Patchwork
2024-06-05 1:19 ` ✗ CI.Hooks: failure " Patchwork
2024-06-05 1:21 ` ✓ CI.checksparse: success " Patchwork
2024-06-05 1:48 ` ✓ CI.BAT: " Patchwork
2024-06-05 10:15 ` ✗ CI.FULL: failure " Patchwork
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=1f0c994e-1ecc-4f47-9161-ceff346e35d1@linux.intel.com \
--to=nirmoy.das@linux.intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=michal.wajdeczko@intel.com \
--cc=nirmoy.das@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.