From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53DB2C47425 for ; Mon, 5 Oct 2020 05:08:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F3DC720796 for ; Mon, 5 Oct 2020 05:08:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DrACB0aM"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gfNreHzW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3DC720796 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9VJLGeWv3ha0kkXR06M8Gt1ihiw86/pLkQ5u7Rkgivg=; b=DrACB0aMgr04CyCBQAiVLtL4G i0TGtDZRKi3njFba6m3f6fhKmgy/nZLlOYvlNOwtgaocBp9iqiwBe4dQfhyue0qwNU388DqJvDFyF MQXXH8AU9zGTIoy+w9A9/Nvbmp0QXSuixhpa/7/akPyLIFNJk3EhK2INH9z3aPnFSeXl0cWIcQ2xQ 56qE+P9GPP3v85kPjAMCy5J6endtK+oaYfP2kB/FvrFJMnPhTDH60YhbTxrV+mv7jiPcn2qy5sy6Z CWPP27KM0iTwTtE1l5TGIQqotHiyPhSifLE/l2vkUNmefu9PkNjfa8IuaozLIfHTb+tEdrlvcQ+YE +ComNxWwQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPIi5-00059e-Pa; Mon, 05 Oct 2020 05:06:53 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPIi1-000593-UF for linux-arm-kernel@lists.infradead.org; Mon, 05 Oct 2020 05:06:51 +0000 Received: by mail-pf1-x442.google.com with SMTP id n136so66234pfd.11 for ; Sun, 04 Oct 2020 22:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=dxt0ysy04CUIuZwj7WZsE2Z9ZTrTyYeaScGu6k5Gpj0=; b=gfNreHzWt4TPfz/30KqlxE3MmSR0uk0mNv4BhxD1qrqJU0kKDdXnMMbeoKiZ0cDo9n zw3xJ9K8H22DaXnZrAlKWHNLkgYI/AEBTnGiW70jS/x9rp8plOxdERg7bBxCEXxSH5Dj YXHXkr4RUDj+NIT4fSnmTepF7er3jlNAirotlQ0SapEZD6bEVaPAM05Vmf91Wyzz3NyE juXio4hcz9qeyUkl2tVR5TsqeKh5CaQSQ7eP6wPww+qzVBDAl9juAUdkOYXFZUNkJ388 pG/3UC6TExI4FXwx/TM1GB4E2cvgU0V7QZ3nDxfm6/syOWz1HtnL208EUdiy+R9io2kT OeaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=dxt0ysy04CUIuZwj7WZsE2Z9ZTrTyYeaScGu6k5Gpj0=; b=p82VIPCUlJBNz0i5Gu8xb217ZFYgDNhDRPoaXB0beCNv9ZGHvRPSOxIVZu/sWmeowh XuhuvK8+nzPeUx3SgwE+3HALAVRL7nrpfJL4BHBbZW0dE8eOlWUwMdFrclM8N9s6VbpL 0xzEreef+G8b/AX5cAGlYgfwEE1fejJDsOdwqFO7qM2k8JIsxxp/OCX9jTRGvhqVNQUY EBXio4HusiD+r6WnTmyc2tojciTHDmK+A+ZYsfz660283ib/es2l3Ew5crnFzfo/sSGz xyoMT0+zoWMNMUgbkd7v2pUEpZcNcEtlaz4XyiI3sDxE0v/lv0RO1064mi7/OJ11AF9K U6KA== X-Gm-Message-State: AOAM5336NOY9RhB5OK75Wcy3bKote4HFVHATlzlv3feTJqBokj3yIsAD WGclx+YzXUZWWOl+u19Nte8= X-Google-Smtp-Source: ABdhPJwKCvznRcFib6nkD+RO0m57F4NQznJJCICJJkM3Pz3kXgehY0ax8kdg9YjCt0l6aqeH/wrt+Q== X-Received: by 2002:a65:4cc1:: with SMTP id n1mr4035788pgt.404.1601874406624; Sun, 04 Oct 2020 22:06:46 -0700 (PDT) Received: from dtor-ws ([2620:15c:202:201:a6ae:11ff:fe11:fcc3]) by smtp.gmail.com with ESMTPSA id m11sm4684586pfa.69.2020.10.04.22.06.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Oct 2020 22:06:45 -0700 (PDT) Date: Sun, 4 Oct 2020 22:06:42 -0700 From: Dmitry Torokhov To: Andrzej Pietrasiewicz Subject: Re: [PATCH v4 4/7] ACPI: button: Use input_device_enabled() helper Message-ID: <20201005050642.GH1009802@dtor-ws> References: <2336e15d-ff4b-bbb6-c701-dbf3aa110fcd@redhat.com> <20200608112211.12125-1-andrzej.p@collabora.com> <20200608112211.12125-5-andrzej.p@collabora.com> <20200625052446.GF248110@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200625052446.GF248110@dtor-ws> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201005_010649_991405_8FE2BF2E X-CRM114-Status: GOOD ( 22.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@collabora.com, Nick Dyer , linux-iio@vger.kernel.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, Laxman Dewangan , Peter Meerwald-Stadler , Peter Hutterer , Fabio Estevam , linux-samsung-soc@vger.kernel.org, Krzysztof Kozlowski , Jonathan Hunter , linux-acpi@vger.kernel.org, Kukjin Kim , NXP Linux Team , linux-input@vger.kernel.org, Len Brown , Michael Hennerich , linux-pm@vger.kernel.org, Sascha Hauer , Sylvain Lemieux , Henrique de Moraes Holschuh , Vladimir Zapolskiy , Hans de Goede , Lars-Peter Clausen , linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Barry Song , Ferruh Yigit , patches@opensource.cirrus.com, "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, Thierry Reding , Sangwon Jee , Pengutronix Kernel Team , Hartmut Knaack , Shawn Guo , Jonathan Cameron Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 24, 2020 at 10:24:46PM -0700, Dmitry Torokhov wrote: > On Mon, Jun 08, 2020 at 01:22:08PM +0200, Andrzej Pietrasiewicz wrote: > > A new helper is available, so use it. > > > > Signed-off-by: Andrzej Pietrasiewicz > > --- > > drivers/acpi/button.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c > > index ff7ab291f678..4deb2b48d03c 100644 > > --- a/drivers/acpi/button.c > > +++ b/drivers/acpi/button.c > > @@ -411,7 +411,7 @@ static void acpi_button_notify(struct acpi_device *device, u32 event) > > input = button->input; > > if (button->type == ACPI_BUTTON_TYPE_LID) { > > mutex_lock(&button->input->mutex); > > - users = button->input->users; > > + users = input_device_enabled(button->input); > > mutex_unlock(&button->input->mutex); > > if (users) > > This chunk (pre-patch) is really wrong. 'users' value is obsolete and > can not be trusted the moment we unlocked the mutex. "if" needs to be > inside critical section. So looking at this patch and the previous one again, I believe this driver is wrong to key the behavior off input->users and we should not apply either of the patches. I'll post another patch fixing this. Thanks. -- Dmitry _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel