From patchwork Tue Oct 17 21:13:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10012879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BA311600CC for ; Tue, 17 Oct 2017 21:14:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACAA928560 for ; Tue, 17 Oct 2017 21:14:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A17BC28620; Tue, 17 Oct 2017 21:14:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 20E9528560 for ; Tue, 17 Oct 2017 21:14:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9DA136E78C; Tue, 17 Oct 2017 21:14:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) by gabe.freedesktop.org (Postfix) with ESMTPS id E747C6E78C for ; Tue, 17 Oct 2017 21:14:13 +0000 (UTC) Received: by mail-io0-x235.google.com with SMTP id n137so3813453iod.6 for ; Tue, 17 Oct 2017 14:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=al9pXYBDApLyiY2uSthCCJuBjJ0BT4SFW4SDNnk6WZw=; b=FKU+Gcgj5q83Po0YddJNLc2zYhC74+KwexwvFRc9lEfOnjwJrXESsZUfAlwHQUwf5O tZoq5MKvl1FDHTRLCkAtgUa3DVMM/P/Z5mlLYungBaACslSvUsB68SfEr8+qr6WiiZKe ZOxZQuv/nDt7qSDBuB5Y/5cg/+hZYu97ClUqI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=al9pXYBDApLyiY2uSthCCJuBjJ0BT4SFW4SDNnk6WZw=; b=PKNAB3ndRuz8erQOMu+apg6svoVFNwgmVj5lsb7oS9VXw217UmzrLJj0nQCChuyqHZ ySThl+crRV5uvjmUpNS0f4sG7bOq2fLIIz3pvbr7bqMnB+tjzNSKMdHZtP+GiMix5wVa PSHkkTfSWOWQVNyA4laeDbQAVYQrDY616tgbXXXshvcF8XShVjCDzltNBcuw5ejr41WW splGkO6zIZ3ElDFOphwn2htlMOQR57GPWgJ+34QyivNDylBVHFD7pJUEJBjibVayI0pe aULgeYcED4gLK0l7GgsjYYkdOSXBNjmEBk2VXmTBlTkhNnQZj6kWpO7yvqhR6NF5uAQD 2jrg== X-Gm-Message-State: AMCzsaUNx/OO4rGWkC6kYf+n4ty3n6WsMAQYG142AdNOWx5aR1nfW+2r oMLDVMnK/4fSnSREmrE3SRX5CoYL5lI= X-Google-Smtp-Source: AOwi7QBN4b8QLm2NRsvn7vWDf4K3Yzg7cdXzRbWWMSWs+cmG6Zu0kum/eyAk7lS1dUvkBILjD/FNAg== X-Received: by 10.107.179.67 with SMTP id c64mr18736620iof.281.1508274852884; Tue, 17 Oct 2017 14:14:12 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:0:f685:3152:9ba1:429a]) by smtp.gmail.com with ESMTPSA id f2sm5220677ioj.73.2017.10.17.14.14.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Oct 2017 14:14:12 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 08/12] drm/panel: otm8009a: Properly sequence [un]prepare with backlight Date: Tue, 17 Oct 2017 17:13:11 -0400 Message-Id: <20171017211321.7992-9-seanpaul@chromium.org> X-Mailer: git-send-email 2.15.0.rc1.287.g2b38de12cc-goog In-Reply-To: <20171017211321.7992-1-seanpaul@chromium.org> References: <20171017211321.7992-1-seanpaul@chromium.org> Cc: thierry.reding@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP I noticed while removing the enabled flag that backlight update checks prepared in such a way that could race with hardware turning on/off. This patch adds a mutex to ensure these races don't happen. In addition to the lock, this patch also renames prepared to initialized to better reflect what it means when used in the backlight hook. Signed-off-by: Sean Paul --- No changes since v1 drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 43 ++++++++++++++++-------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c index 0a5898fd4502..d099af3c91df 100644 --- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c +++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c @@ -11,6 +11,7 @@ #include #include #include +#include #include