All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: michal.wajdeczko@intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [bug report] drm/i915/guc: Add support for data reporting in GuC responses
Date: Fri, 18 Jun 2021 10:38:16 +0300	[thread overview]
Message-ID: <YMxNaH5MQakeg1L7@mwanda> (raw)

Hello Michal Wajdeczko,

The patch b839a869dfc9: "drm/i915/guc: Add support for data reporting
in GuC responses" from Mar 26, 2018, leads to the following static
checker warning:

	drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c:307 intel_guc_ct_enable()
	error: passing non negative 4095 to ERR_PTR

drivers/gpu/drm/i915/gt/uc/.intel_guc.c
   405          intel_guc_notify(guc);
   406  
   407          /*
   408           * No GuC command should ever take longer than 10ms.
   409           * Fast commands should still complete in 10us.
   410           */
   411          ret = __intel_wait_for_register_fw(uncore,
   412                                             guc_send_reg(guc, 0),
   413                                             INTEL_GUC_MSG_TYPE_MASK,
   414                                             INTEL_GUC_MSG_TYPE_RESPONSE <<
   415                                             INTEL_GUC_MSG_TYPE_SHIFT,
   416                                             10, 10, &status);
   417          /* If GuC explicitly returned an error, convert it to -EIO */
   418          if (!ret && !INTEL_GUC_MSG_IS_RESPONSE_SUCCESS(status))
   419                  ret = -EIO;

If __intel_wait_for_register_fw() fails then either "ret" is set or
"status" status has a code and "ret" becomes -EIO.

   420  
   421          if (ret) {
   422                  DRM_ERROR("MMIO: GuC action %#x failed with error %d %#x\n",
   423                            action[0], ret, status);
   424                  goto out;

So if there is any errors we return here.

   425          }
   426  
   427          if (response_buf) {
   428                  int count = min(response_buf_size, guc->send_regs.count - 1);
   429  
   430                  for (i = 0; i < count; i++)
   431                          response_buf[i] = intel_uncore_read(uncore,
   432                                                              guc_send_reg(guc, i + 1));
   433          }
   434  
   435          /* Use data from the GuC response as our return value */
   436          ret = INTEL_GUC_MSG_TO_DATA(status);

But this is setting "ret" to something positive in the 0xffff range.
The caller treats it as an error code.

   437  
   438  out:
   439          intel_uncore_forcewake_put(uncore, guc->send_regs.fw_domains);
   440          mutex_unlock(&guc->send_mutex);
   441  
   442          return ret;
   443  }

regards,
dan carpenter
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2021-06-18  8:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18  7:38 Dan Carpenter [this message]
2021-06-18 11:37 ` [Intel-gfx] [bug report] drm/i915/guc: Add support for data reporting in GuC responses Michal Wajdeczko

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=YMxNaH5MQakeg1L7@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=michal.wajdeczko@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.