From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f67.google.com ([209.85.208.67]:34556 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731581AbfGWHiZ (ORCPT ); Tue, 23 Jul 2019 03:38:25 -0400 Received: by mail-ed1-f67.google.com with SMTP id s49so8062622edb.1 for ; Tue, 23 Jul 2019 00:38:24 -0700 (PDT) Date: Tue, 23 Jul 2019 09:38:20 +0200 From: Daniel Vetter Subject: Re: [PATCH] vt: Grab console_lock around con_is_bound in show_bind Message-ID: <20190723073820.GU15868@phenom.ffwll.local> References: <20190718080903.22622-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190718080903.22622-1-daniel.vetter@ffwll.ch> Sender: linux-s390-owner@vger.kernel.org List-ID: To: Intel Graphics Development Cc: Daniel Vetter , Jens Remus , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-s390@vger.kernel.org, Greg Kroah-Hartman , Nicolas Pitre , Martin Hostettler , Adam Borowski , Mikulas Patocka , Daniel Vetter , Sam Ravnborg Hi Greg, Do you plan to pick this up in your console/vt/whatever-fixes branch? There's no reason for me to route this through drm-fixes. -Daniel On Thu, Jul 18, 2019 at 10:09:03AM +0200, Daniel Vetter wrote: > Not really harmful not to, but also not harm in grabbing the lock. And > this shuts up a new WARNING I introduced in commit ddde3c18b700 ("vt: > More locking checks"). > > Reported-by: Jens Remus > Cc: linux-kernel@vger.kernel.org > Cc: dri-devel@lists.freedesktop.org > Cc: linux-fbdev@vger.kernel.org > Cc: linux-s390@vger.kernel.org > Cc: Greg Kroah-Hartman > Cc: Nicolas Pitre > Cc: Martin Hostettler > Cc: Adam Borowski > Cc: Mikulas Patocka > Signed-off-by: Daniel Vetter > Cc: Daniel Vetter > Cc: Sam Ravnborg > --- > drivers/tty/vt/vt.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c > index ec92f36ab5c4..34aa39d1aed9 100644 > --- a/drivers/tty/vt/vt.c > +++ b/drivers/tty/vt/vt.c > @@ -3771,7 +3771,11 @@ static ssize_t show_bind(struct device *dev, struct device_attribute *attr, > char *buf) > { > struct con_driver *con = dev_get_drvdata(dev); > - int bind = con_is_bound(con->con); > + int bind; > + > + console_lock(); > + bind = con_is_bound(con->con); > + console_unlock(); > > return snprintf(buf, PAGE_SIZE, "%i\n", bind); > } > -- > 2.20.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch