From: Jani Nikula <jani.nikula@linux.intel.com>
To: Paulo Zanoni <przanoni@gmail.com>, Imre Deak <imre.deak@intel.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: get runtime PM reference around GEM set_caching IOCTL
Date: Mon, 16 Nov 2015 15:33:29 +0200 [thread overview]
Message-ID: <876112f4ra.fsf@intel.com> (raw)
In-Reply-To: <CA+gsUGSMRg4eEFg2iXHkknKpmyd=nVyJjXWUdpjm5qM+eYh=LA@mail.gmail.com>
On Wed, 04 Nov 2015, Paulo Zanoni <przanoni@gmail.com> wrote:
> 2015-11-04 17:25 GMT-02:00 Imre Deak <imre.deak@intel.com>:
>> After Damien's D3 fix I started to get runtime suspend residency for the
>> first time and that revealed a breakage on the set_caching IOCTL path
>> that accesses the HW but doesn't take an RPM ref. Fix this up.
>
> Oh, well, that's the the RPM problem that prevents me from sleeping at
> night: how can we be 100% sure we wrapped every single possible driver
> entry point? At least we shout errors and warns when we detect the
> problem.
>
> By the way, we already have some tests for specific IOCTLs on
> igt/pm_rpm, so adding a new one for this IOCTL wouldn't hurt :)
>
> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Pushed to drm-intel-fixes, thanks for the patch and review.
BR,
Jani.
>
>>
>> Signed-off-by: Imre Deak <imre.deak@intel.com>
>> ---
>> drivers/gpu/drm/i915/i915_gem.c | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
>> index f1e3fde..56cd501 100644
>> --- a/drivers/gpu/drm/i915/i915_gem.c
>> +++ b/drivers/gpu/drm/i915/i915_gem.c
>> @@ -3829,6 +3829,7 @@ int i915_gem_get_caching_ioctl(struct drm_device *dev, void *data,
>> int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,
>> struct drm_file *file)
>> {
>> + struct drm_i915_private *dev_priv = dev->dev_private;
>> struct drm_i915_gem_caching *args = data;
>> struct drm_i915_gem_object *obj;
>> enum i915_cache_level level;
>> @@ -3857,9 +3858,11 @@ int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,
>> return -EINVAL;
>> }
>>
>> + intel_runtime_pm_get(dev_priv);
>> +
>> ret = i915_mutex_lock_interruptible(dev);
>> if (ret)
>> - return ret;
>> + goto rpm_put;
>>
>> obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
>> if (&obj->base == NULL) {
>> @@ -3872,6 +3875,9 @@ int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,
>> drm_gem_object_unreference(&obj->base);
>> unlock:
>> mutex_unlock(&dev->struct_mutex);
>> +rpm_put:
>> + intel_runtime_pm_put(dev_priv);
>> +
>> return ret;
>> }
>>
>> --
>> 2.1.4
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-11-16 13:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-04 19:25 [PATCH] drm/i915: get runtime PM reference around GEM set_caching IOCTL Imre Deak
2015-11-04 19:47 ` Paulo Zanoni
2015-11-16 13:33 ` Jani Nikula [this message]
2015-11-17 19:00 ` Daniel Vetter
2015-11-17 19:22 ` Imre Deak
2015-11-04 20:57 ` Chris Wilson
2015-11-05 11:28 ` Imre Deak
2015-11-05 11:56 ` Chris Wilson
2015-11-05 22:57 ` Imre Deak
2015-11-05 23:24 ` Imre Deak
2015-11-06 8:54 ` Chris Wilson
2015-11-09 13:09 ` Imre Deak
2015-11-09 13:25 ` Chris Wilson
2015-11-09 13:36 ` Imre Deak
2015-11-09 13:43 ` Chris Wilson
2015-11-17 22:16 ` Daniel Vetter
2015-11-17 22:38 ` Chris Wilson
2015-11-17 22:49 ` Imre Deak
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=876112f4ra.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=przanoni@gmail.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