From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:34663 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbbI2Ohb (ORCPT ); Tue, 29 Sep 2015 10:37:31 -0400 Subject: Re: [PATCH] drm: Fix locking for sysfs dpms file To: Daniel Vetter , DRI Development References: <1443512228-10764-1-git-send-email-daniel.vetter@ffwll.ch> <1443513413-28873-1-git-send-email-daniel.vetter@ffwll.ch> CC: Intel Graphics Development , Rob Clark , , Daniel Vetter From: Jens Axboe Message-ID: <560AA223.4080001@fb.com> Date: Tue, 29 Sep 2015 08:37:23 -0600 MIME-Version: 1.0 In-Reply-To: <1443513413-28873-1-git-send-email-daniel.vetter@ffwll.ch> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: 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 > 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 > Cc: Jens Axboe > Cc: Rob Clark > Cc: stable@vger.kernel.org > Signed-off-by: Daniel Vetter Works for me, thanks Daniel. Tested-by: Jens Axboe -- Jens Axboe