Re: [PATCH] drm/i915/guc: Assert we have the doorbell before setting it up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/02/2018 02:11 AM, Chris Wilson wrote:
Quoting Michel Thierry (2018-05-01 15:21:53)
On 5/1/2018 12:52 AM, Chris Wilson wrote:
As our early doorbell is split between early allocation and a late setup
after we have a channel to the GuC, it may happen due to a lapse of
programmer judgement that we try to setup an invalid doorbell. Make use
of our has_doorbell() function to check the doorbell does exist for the
client before we try and tell the guc about it. In doing so, we prevent
the compiler from warning about the otherwise unused function in some
configurations.


Looks ok to me, but the new place has_doorbell is called is inside a
GEM_BUG_ON...
So the warning will still be there when CONFIG_DRM_I915_DEBUG_GEM=n, right?

@@ -224,6 +223,9 @@ static int create_doorbell(struct intel_guc_client *client)
   {
       int ret;
+ if (WARN_ON(!has_doorbell(client)))
+             return -ENODEV; /* internal setup error, should never happen */

Sorry, somehow I read that line as GEM_WARN_ON...


This is the one I added to make sure we had at least one user. If it
weren't for the compiler warning I'd be happy for this to be
GEM_BUG_ON() as well.
-Chris


Reviewed-by: Michel Thierry <michel.thierry@xxxxxxxxx>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux