From: Jani Nikula <jani.nikula@linux.intel.com>
To: Koby Elbaz <kelbaz@habana.ai>, intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH v2 1/2] drm/xe: add skip_pcode flag
Date: Tue, 24 Oct 2023 13:40:11 +0300 [thread overview]
Message-ID: <8734y0b8xg.fsf@intel.com> (raw)
In-Reply-To: <20231022155727.717251-1-kelbaz@habana.ai>
On Sun, 22 Oct 2023, Koby Elbaz <kelbaz@habana.ai> wrote:
> Per device, set this flag to enable access to the PCODE uC or to skip it.
>
> Signed-off-by: Koby Elbaz <kelbaz@habana.ai>
> ---
> Changes in v2:
> - Added the flag 'skip_pcode' instead of 'has_pcode'
I don't know why change was made from positive to negative flag.
Generally it's better to use positive flags, because they just read
better. Negative flags often lead to double negatives in source, such as
!disable.
Please consider using a positive flag, even if it's not "has_something".
BR,
Jani.
>
> drivers/gpu/drm/xe/xe_device_types.h | 2 ++
> drivers/gpu/drm/xe/xe_pci.c | 2 ++
> drivers/gpu/drm/xe/xe_pcode.c | 9 +++++++++
> 3 files changed, 13 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
> index 44d622d4cc3a..29199671d9e8 100644
> --- a/drivers/gpu/drm/xe/xe_device_types.h
> +++ b/drivers/gpu/drm/xe/xe_device_types.h
> @@ -257,6 +257,8 @@ struct xe_device {
> u8 enable_display:1;
> /** @bypass_mtcfg: Bypass Multi-Tile configuration from MTCFG register */
> u8 bypass_mtcfg:1;
> + /** @skip_pcode: skip access to PCODE uC */
> + u8 skip_pcode:1;
> /** @supports_mmio_ext: supports MMIO extension/s */
> u8 supports_mmio_ext:1;
> /** @has_heci_gscfi: device has heci gscfi */
> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index 2fae45b9d88e..05b0aa9f2ab7 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -61,6 +61,7 @@ struct xe_device_desc {
>
> u8 has_llc:1;
> u8 bypass_mtcfg:1;
> + u8 skip_pcode:1;
> u8 supports_mmio_ext:1;
> };
>
> @@ -578,6 +579,7 @@ static int xe_info_init(struct xe_device *xe,
> xe->info.media_name = media_desc ? media_desc->name : "none";
> xe->info.has_llc = desc->has_llc;
> xe->info.bypass_mtcfg = desc->bypass_mtcfg;
> + xe->info.skip_pcode = desc->skip_pcode;
> xe->info.supports_mmio_ext = desc->supports_mmio_ext;
> xe->info.tile_mmio_ext_size = graphics_desc->tile_mmio_ext_size;
>
> diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
> index 4a240acf7625..b324dc2a5deb 100644
> --- a/drivers/gpu/drm/xe/xe_pcode.c
> +++ b/drivers/gpu/drm/xe/xe_pcode.c
> @@ -61,6 +61,9 @@ static int pcode_mailbox_rw(struct xe_gt *gt, u32 mbox, u32 *data0, u32 *data1,
> {
> int err;
>
> + if (gt_to_xe(gt)->info.skip_pcode)
> + return 0;
> +
> lockdep_assert_held(>->pcode.lock);
>
> if ((xe_mmio_read32(gt, PCODE_MAILBOX) & PCODE_READY) != 0)
> @@ -249,6 +252,9 @@ int xe_pcode_init(struct xe_gt *gt)
> int timeout_us = 180000000; /* 3 min */
> int ret;
>
> + if (gt_to_xe(gt)->info.skip_pcode)
> + return 0;
> +
> if (!IS_DGFX(gt_to_xe(gt)))
> return 0;
>
> @@ -280,6 +286,9 @@ int xe_pcode_probe(struct xe_gt *gt)
> {
> drmm_mutex_init(>_to_xe(gt)->drm, >->pcode.lock);
>
> + if (gt_to_xe(gt)->info.skip_pcode)
> + return 0;
> +
> if (!IS_DGFX(gt_to_xe(gt)))
> return 0;
--
Jani Nikula, Intel
next prev parent reply other threads:[~2023-10-24 10:40 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-22 15:57 [Intel-xe] [PATCH v2 1/2] drm/xe: add skip_pcode flag Koby Elbaz
2023-10-22 15:57 ` [Intel-xe] [PATCH v2 2/2] drm/xe: rename bypass_mtcfg to skip_mtcfg Koby Elbaz
2023-11-13 13:54 ` Rodrigo Vivi
2023-10-24 7:00 ` [Intel-xe] ✗ CI.Patch_applied: failure for series starting with [v2,1/2] drm/xe: add skip_pcode flag Patchwork
2023-10-24 10:40 ` Jani Nikula [this message]
2023-10-24 16:55 ` [Intel-xe] [PATCH v2 1/2] " Koby Elbaz
2023-10-24 17:15 ` Lucas De Marchi
2023-11-13 13:53 ` Rodrigo Vivi
2023-11-14 18:58 ` [Intel-xe] ✓ CI.Patch_applied: success for series starting with [v2,1/2] drm/xe: add skip_pcode flag (rev2) Patchwork
2023-11-14 18:58 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-11-14 18:59 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-11-14 19:07 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-11-14 19:07 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-11-14 19:08 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-11-14 19:44 ` [Intel-xe] ✗ CI.BAT: failure " Patchwork
2023-11-20 16:08 ` [Intel-xe] ✗ CI.Patch_applied: failure for series starting with [v2,1/2] drm/xe: add skip_pcode flag (rev3) Patchwork
2023-11-21 22:06 ` [Intel-xe] ✓ CI.Patch_applied: success for series starting with [v2,1/2] drm/xe: add skip_pcode flag (rev4) Patchwork
2023-11-21 22:06 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-11-21 22:08 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-11-21 22:15 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-11-21 22:15 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-11-21 22:17 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-11-21 22:46 ` [Intel-xe] ✗ CI.BAT: failure " Patchwork
2023-11-27 17:43 ` [Intel-xe] ✗ CI.Patch_applied: failure for series starting with [v2,1/2] drm/xe: add skip_pcode flag (rev5) 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=8734y0b8xg.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=kelbaz@habana.ai \
/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.