From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>,
intel-xe@lists.freedesktop.org
Cc: Badal Nilawar <badal.nilawar@intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH v6 01/25] drm/xe: Add member initialized_domains to xe_force_wake()
Date: Mon, 30 Sep 2024 21:51:06 +0200 [thread overview]
Message-ID: <bf859513-171b-4b2f-b342-1ca3c07f508b@intel.com> (raw)
In-Reply-To: <20240930053149.1246339-2-himal.prasad.ghimiray@intel.com>
On 30.09.2024 07:31, Himal Prasad Ghimiray wrote:
> This field serves as a bitmask representing all initialized forcewake
> domains on the GT.
>
> While at it, fix the datatype for awake_domains since it can have
> value different from enum xe_force_wake_domains.
up to maintainers, but for me this is unrelated change
>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Badal Nilawar <badal.nilawar@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> ---
> drivers/gpu/drm/xe/xe_force_wake.c | 24 +++++++++++++++++-------
> drivers/gpu/drm/xe/xe_force_wake_types.h | 4 +++-
> 2 files changed, 20 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_force_wake.c b/drivers/gpu/drm/xe/xe_force_wake.c
> index a64c14757c84..5ce9e912818a 100644
> --- a/drivers/gpu/drm/xe/xe_force_wake.c
> +++ b/drivers/gpu/drm/xe/xe_force_wake.c
> @@ -21,15 +21,25 @@ static const char *str_wake_sleep(bool wake)
> return wake ? "wake" : "sleep";
> }
>
> -static void domain_init(struct xe_force_wake_domain *domain,
> +static void mark_domain_initialized(struct xe_force_wake *fw,
> + enum xe_force_wake_domain_id id)
> +{
> + fw->initialized_domains |= BIT(id);
> +}
> +
> +static void domain_init(struct xe_force_wake *fw,
since this function is no longer taking 'domain' as param, then IMO it
should be named like:
init_domain(fw, id, reg, ack)
> enum xe_force_wake_domain_id id,
> struct xe_reg reg, struct xe_reg ack)
> {
> + struct xe_force_wake_domain *domain = &fw->domains[id];
> +
> domain->id = id;
> domain->reg_ctl = reg;
> domain->reg_ack = ack;
> domain->val = FORCEWAKE_MT(FORCEWAKE_KERNEL);
> domain->mask = FORCEWAKE_MT_MASK(FORCEWAKE_KERNEL);
> +
> + mark_domain_initialized(fw, id);
> }
>
> void xe_force_wake_init_gt(struct xe_gt *gt, struct xe_force_wake *fw)
> @@ -43,12 +53,12 @@ void xe_force_wake_init_gt(struct xe_gt *gt, struct xe_force_wake *fw)
> xe_gt_assert(gt, GRAPHICS_VER(gt_to_xe(gt)) >= 11);
>
> if (xe->info.graphics_verx100 >= 1270) {
> - domain_init(&fw->domains[XE_FW_DOMAIN_ID_GT],
> + domain_init(fw,
> XE_FW_DOMAIN_ID_GT,
> FORCEWAKE_GT,
> FORCEWAKE_ACK_GT_MTL);
likely above alignment could be optimized at least to:
init_domain(fw, XE_FW_DOMAIN_ID_GT,
FORCEWAKE_GT,
FORCEWAKE_ACK_GT_MTL);
> } else {
> - domain_init(&fw->domains[XE_FW_DOMAIN_ID_GT],
> + domain_init(fw,
> XE_FW_DOMAIN_ID_GT,
> FORCEWAKE_GT,
> FORCEWAKE_ACK_GT);
> @@ -63,7 +73,7 @@ void xe_force_wake_init_engines(struct xe_gt *gt, struct xe_force_wake *fw)
> xe_gt_assert(gt, GRAPHICS_VER(gt_to_xe(gt)) >= 11);
>
> if (!xe_gt_is_media_type(gt))
> - domain_init(&fw->domains[XE_FW_DOMAIN_ID_RENDER],
> + domain_init(fw,
> XE_FW_DOMAIN_ID_RENDER,
> FORCEWAKE_RENDER,
> FORCEWAKE_ACK_RENDER);
> @@ -72,7 +82,7 @@ void xe_force_wake_init_engines(struct xe_gt *gt, struct xe_force_wake *fw)
> if (!(gt->info.engine_mask & BIT(i)))
> continue;
>
> - domain_init(&fw->domains[XE_FW_DOMAIN_ID_MEDIA_VDBOX0 + j],
> + domain_init(fw,
> XE_FW_DOMAIN_ID_MEDIA_VDBOX0 + j,
> FORCEWAKE_MEDIA_VDBOX(j),
> FORCEWAKE_ACK_MEDIA_VDBOX(j));
> @@ -82,14 +92,14 @@ void xe_force_wake_init_engines(struct xe_gt *gt, struct xe_force_wake *fw)
> if (!(gt->info.engine_mask & BIT(i)))
> continue;
>
> - domain_init(&fw->domains[XE_FW_DOMAIN_ID_MEDIA_VEBOX0 + j],
> + domain_init(fw,
> XE_FW_DOMAIN_ID_MEDIA_VEBOX0 + j,
> FORCEWAKE_MEDIA_VEBOX(j),
> FORCEWAKE_ACK_MEDIA_VEBOX(j));
> }
>
> if (gt->info.engine_mask & BIT(XE_HW_ENGINE_GSCCS0))
> - domain_init(&fw->domains[XE_FW_DOMAIN_ID_GSC],
> + domain_init(fw,
> XE_FW_DOMAIN_ID_GSC,
> FORCEWAKE_GSC,
> FORCEWAKE_ACK_GSC);
> diff --git a/drivers/gpu/drm/xe/xe_force_wake_types.h b/drivers/gpu/drm/xe/xe_force_wake_types.h
> index ed0edc2cdf9f..fde17dc3d01e 100644
> --- a/drivers/gpu/drm/xe/xe_force_wake_types.h
> +++ b/drivers/gpu/drm/xe/xe_force_wake_types.h
> @@ -78,7 +78,9 @@ struct xe_force_wake {
> /** @lock: protects everything force wake struct */
> spinlock_t lock;
> /** @awake_domains: mask of all domains awake */
> - enum xe_force_wake_domains awake_domains;
> + unsigned int awake_domains;
> + /** @initialized_domains: mask of all initialized domains */
> + unsigned int initialized_domains;
> /** @domains: force wake domains */
> struct xe_force_wake_domain domains[XE_FW_DOMAIN_ID_COUNT];
> };
next prev parent reply other threads:[~2024-09-30 19:51 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-30 5:31 [PATCH v6 00/25] Fix xe_force_wake_get() failure handling Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 01/25] drm/xe: Add member initialized_domains to xe_force_wake() Himal Prasad Ghimiray
2024-09-30 19:51 ` Michal Wajdeczko [this message]
2024-10-01 5:03 ` Ghimiray, Himal Prasad
2024-09-30 5:31 ` [PATCH v6 02/25] drm/xe/forcewake: Add a helper xe_force_wake_ref_has_domain() Himal Prasad Ghimiray
2024-09-30 20:04 ` Michal Wajdeczko
2024-10-01 5:06 ` Ghimiray, Himal Prasad
2024-09-30 5:31 ` [PATCH v6 03/25] drm/xe: Error handling in xe_force_wake_get() Himal Prasad Ghimiray
2024-10-03 12:23 ` Nilawar, Badal
2024-10-03 16:10 ` Ghimiray, Himal Prasad
2024-10-04 7:40 ` Nilawar, Badal
2024-10-07 3:14 ` Ghimiray, Himal Prasad
2024-09-30 5:31 ` [PATCH v6 04/25] drm/xe: Modify xe_force_wake_put to handle _get returned mask Himal Prasad Ghimiray
2024-09-30 20:13 ` Michal Wajdeczko
2024-09-30 20:15 ` Michal Wajdeczko
2024-10-01 5:11 ` Ghimiray, Himal Prasad
2024-10-04 3:21 ` Nilawar, Badal
2024-09-30 22:13 ` Matt Roper
2024-10-01 5:31 ` Ghimiray, Himal Prasad
2024-09-30 5:31 ` [PATCH v6 05/25] drm/xe/device: Update handling of xe_force_wake_get return Himal Prasad Ghimiray
2024-10-04 7:18 ` Nilawar, Badal
2024-10-07 3:40 ` Ghimiray, Himal Prasad
2024-09-30 5:31 ` [PATCH v6 06/25] drm/xe/hdcp: " Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 07/25] drm/xe/gsc: " Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 08/25] drm/xe/gt: " Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 09/25] drm/xe/xe_gt_idle: " Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 10/25] drm/xe/devcoredump: " Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 11/25] drm/xe/tests/mocs: Update xe_force_wake_get() return handling Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 12/25] drm/xe/mocs: Update handling of xe_force_wake_get return Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 13/25] drm/xe/xe_drm_client: " Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 14/25] drm/xe/xe_gt_debugfs: " Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 15/25] drm/xe/guc: " Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 16/25] drm/xe/huc: " Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 17/25] drm/xe/oa: Handle force_wake_get failure in xe_oa_stream_init() Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 18/25] drm/xe/pat: Update handling of xe_force_wake_get return Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 19/25] drm/xe/gt_tlb_invalidation_ggtt: " Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 20/25] drm/xe/xe_reg_sr: " Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 21/25] drm/xe/query: " Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 22/25] drm/xe/vram: " Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 23/25] drm/xe: forcewake debugfs open fails on xe_forcewake_get failure Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 24/25] drm/xe: Ensure __must_check for xe_force_wake_get() return Himal Prasad Ghimiray
2024-09-30 5:31 ` [PATCH v6 25/25] drm/xe: Change return type to void for xe_force_wake_put Himal Prasad Ghimiray
2024-09-30 6:02 ` ✓ CI.Patch_applied: success for Fix xe_force_wake_get() failure handling (rev6) Patchwork
2024-09-30 6:03 ` ✓ CI.checkpatch: " Patchwork
2024-09-30 6:03 ` ✗ CI.KUnit: failure " Patchwork
2024-09-30 7:35 ` Ghimiray, Himal Prasad
2024-09-30 20:55 ` ✓ CI.Patch_applied: success for Fix xe_force_wake_get() failure handling (rev7) Patchwork
2024-09-30 20:55 ` ✓ CI.checkpatch: " Patchwork
2024-09-30 20:57 ` ✓ CI.KUnit: " Patchwork
2024-09-30 21:08 ` ✓ CI.Build: " Patchwork
2024-09-30 21:10 ` ✗ CI.Hooks: failure " Patchwork
2024-09-30 21:12 ` ✓ CI.checksparse: success " Patchwork
2024-09-30 21:39 ` ✗ CI.BAT: failure " Patchwork
2024-10-01 6:20 ` ✗ CI.FULL: " 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=bf859513-171b-4b2f-b342-1ca3c07f508b@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=badal.nilawar@intel.com \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=rodrigo.vivi@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