From: Jens Axboe <axboe@fb.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>,
DRI Development <dri-devel@lists.freedesktop.org>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
Rob Clark <robdclark@gmail.com>,
stable@vger.kernel.org, Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH] drm: Fix locking for sysfs dpms file
Date: Tue, 29 Sep 2015 08:37:23 -0600 [thread overview]
Message-ID: <560AA223.4080001@fb.com> (raw)
In-Reply-To: <1443513413-28873-1-git-send-email-daniel.vetter@ffwll.ch>
On 09/29/2015 01:56 AM, Daniel Vetter wrote:
> With atomic drivers we need to make sure that (at least in general)
> property reads hold the right locks. But the legacy dpms property is
> special and can be read locklessly. Since userspace loves to just
> randomly look at that all the time (like with "status") do that.
>
> To make it clear that we play tricks use the READ_ONCE compiler
> barrier (and also for paranoia).
>
> Note that there's not really anything bad going on since even with the
> new atomic paths we eventually end up not chasing any pointers (and
> hence possibly freed memory and other fun stuff). The locking WARNING
> has been added in
>
> commit 88a48e297b3a3bac6022c03babfb038f1a886cea
> Author: Rob Clark <robdclark@gmail.com>
> Date: Thu Dec 18 16:01:50 2014 -0500
>
> drm: add atomic properties
>
> but since drivers are converting not everyone will have seen this from
> the start.
>
> Jens reported this and submitted a patch to just grab the
> mode_config.connection_mutex, but we can do a bit better.
>
> v2: Remove unused variables I failed to git add for real.
>
> Reported-by: Jens Axboe <axboe@fb.com>
> Cc: Jens Axboe <axboe@fb.com>
> Cc: Rob Clark <robdclark@gmail.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Works for me, thanks Daniel.
Tested-by: Jens Axboe <axboe@fb.com>
--
Jens Axboe
next prev parent reply other threads:[~2015-09-29 14:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-29 7:37 [PATCH] drm: Fix locking for sysfs dpms file Daniel Vetter
2015-09-29 7:56 ` Daniel Vetter
2015-09-29 13:30 ` Jani Nikula
2015-09-29 14:37 ` Jens Axboe [this message]
2015-09-29 8:06 ` [PATCH 1/3] drm/sysfs: Annote lockless show functions with READ_ONCE Daniel Vetter
2015-09-29 8:06 ` [PATCH 2/3] drm/sysfs: Grab lock for edid/modes_show Daniel Vetter
2015-10-02 8:39 ` [PATCH] " Daniel Vetter
2015-10-02 11:01 ` Daniel Vetter
2015-10-02 12:08 ` Emil Velikov
2015-11-19 16:22 ` Daniel Vetter
2015-10-02 15:02 ` Julia Lawall
2015-09-29 8:06 ` [PATCH 3/3] drm/sysfs: Nuke TV/DVI property files Daniel Vetter
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=560AA223.4080001@fb.com \
--to=axboe@fb.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=robdclark@gmail.com \
--cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).