All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michal Wajdeczko" <michal.wajdeczko@intel.com>
To: intel-gfx@lists.freedesktop.org, Chris Wilson <chris@chris-wilson.co.uk>
Subject: Re: [PATCH 3/3] drm/i915/huc: Update HuC status codes
Date: Thu, 23 May 2019 00:25:00 +0200	[thread overview]
Message-ID: <op.z17pvyetxaggs7@mwajdecz-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <155855638733.28319.12683765369044811987@skylake-alporthouse-com>

On Wed, 22 May 2019 22:19:47 +0200, Chris Wilson  
<chris@chris-wilson.co.uk> wrote:

> Quoting Michal Wajdeczko (2019-05-22 20:00:57)
>> Without breaking existing usage, slightly update HuC status codes
>> to provide more info to the clients:
>>  1 if HuC firmware is loaded and verified,
>>  0 if HuC firmware is not enabled,
>>  -ENOPKG if HuC firmware is not loaded,
>>  -ENODEV if HuC is not present on this platform.
>>
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Tony Ye <tony.ye@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_huc.c | 13 +++++++++----
>>  1 file changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_huc.c  
>> b/drivers/gpu/drm/i915/intel_huc.c
>> index aac17916e130..98deb4ee60a7 100644
>> --- a/drivers/gpu/drm/i915/intel_huc.c
>> +++ b/drivers/gpu/drm/i915/intel_huc.c
>> @@ -150,9 +150,11 @@ int intel_huc_auth(struct intel_huc *huc)
>>   * intel_huc_check_status() - check HuC status
>>   * @huc: intel_huc structure
>>   *
>> - * Returns: 1 if HuC firmware is loaded and verified,
>> - * 0 if HuC firmware is not loaded and -ENODEV if HuC
>> - * is not present on this platform.
>> + * Return:
>> + * * 1 if HuC firmware is loaded and verified,
>> + * * 0 if HuC firmware is not enabled,
>> + * * -ENOPKG if HuC firmware is not loaded,
>> + * * -ENODEV if HuC is not present on this platform.
>>   */
>>  int intel_huc_check_status(struct intel_huc *huc)
>>  {
>> @@ -161,5 +163,8 @@ int intel_huc_check_status(struct intel_huc *huc)
>>         if (!HAS_HUC(i915))
>>                 return -ENODEV;
>>
>> -       return huc->verified;
>> +       if (!USES_HUC(i915))
>> +               return 0;
>> +
>> +       return huc->verified ? 1 : -ENOPKG;
>
> I still think EOPNOTSUPP is a better error though for the user
> preventing the huc being loaded -- as opposed to the result of
> verification being the non-error value.
>
> error == unable to setup huc
> 0/1 == result from talking to huc

but your 0 here overlaps with unable to setup huc error,
so from the ABI perspective, imho, is bad.

also, from media team pov, as they want to have HuC always on,
the only non-error case is when user explicitly decided otherwise.

>
> Better ask someone else for a third opinion.

Check end of the message [1] but I'm fine waiting for more opinions.

[1] https://lists.freedesktop.org/archives/intel-gfx/2019-May/199066.html

Michal
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-05-22 22:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22 19:00 [PATCH 0/3] drm/i915: HuC updates Michal Wajdeczko
2019-05-22 19:00 ` [PATCH 1/3] drm/i915/uc: Make uc_sanitize part of gt_sanitize Michal Wajdeczko
2019-05-22 20:11   ` Chris Wilson
2019-05-22 19:00 ` [PATCH 2/3] drm/i915/huc: Check HuC firmware status only once Michal Wajdeczko
2019-05-22 20:13   ` Chris Wilson
2019-05-23 11:58     ` Ye, Tony
2019-05-22 19:00 ` [PATCH 3/3] drm/i915/huc: Update HuC status codes Michal Wajdeczko
2019-05-22 20:19   ` Chris Wilson
2019-05-22 22:25     ` Michal Wajdeczko [this message]
2019-05-31 10:13       ` Joonas Lahtinen
2019-05-31 19:06         ` Michal Wajdeczko
2019-05-22 19:50 ` ✓ Fi.CI.BAT: success for drm/i915: HuC updates Patchwork
2019-05-23 15:56 ` ✗ Fi.CI.IGT: 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=op.z17pvyetxaggs7@mwajdecz-mobl1.ger.corp.intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.