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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 6B243C2B9F4 for ; Tue, 22 Jun 2021 18:33:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 43E3561164 for ; Tue, 22 Jun 2021 18:33:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232537AbhFVSfq (ORCPT ); Tue, 22 Jun 2021 14:35:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232427AbhFVSfo (ORCPT ); Tue, 22 Jun 2021 14:35:44 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65F74C06175F for ; Tue, 22 Jun 2021 11:33:28 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id w21so28240015qkb.9 for ; Tue, 22 Jun 2021 11:33:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pumBvi+qi7d1sRM6cwo7R1W/BHxp1boGJK8L9dh8S7I=; b=Gnb/8JfrLJ+yvZfpmSoMuJKpnj9MskU5T49YYM3w8+ZW9IypPBpCVKfYBZ02l5sZS0 52RS8k1paGyZM5BA6bltHp9N0Sq2IWSZwbT/ojCUlljFvnkTkQmcIHt74VxA+KVyV8lY wiVJcA1DfdRMryKyocv7WRfaVD9tANv1RWGyU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pumBvi+qi7d1sRM6cwo7R1W/BHxp1boGJK8L9dh8S7I=; b=FDftCqRoRxlKa0eYOXs2ndd2rRc7ibvtSwLTjNO+dgL28ymw05cmXOFhhc3LTN0hGU FQOiIIN3eMLPOX/PKANc596EXvp7BO++NH17oWtsPnsCAZN/oevEWUFJsVMddgXhJ8VC JGRcu8C/ykpYhdFDVbLzy48TqHI6+iqNsdHhtPK58njCSEkBN0Ol/Drh0Irsq+8iyyPo SPsdVZRpfBqls7DFV2vC7sxIyGBMY/t7XeMCnGL2G4nQS0SGH2MwYNAqISRut9iVCNSk 7qtvvGehW7URLiKNrrlUTK0fxQCnhRcpwJc6nG2titHukwtaVQ1QP1qs0un0aOBpZZYZ mSow== X-Gm-Message-State: AOAM532Ej6sDzb9oTV4xJCt8pF63jym/JJhvJIkgvxtIsK4WiWUmWpVu lS2y8X/sM3weYZyXim/2Warj8ttJGbTioA== X-Google-Smtp-Source: ABdhPJxCyWCZOEEiNfbqhJAG+6NcM5ri1cgovQEDJ4BT5S3oSB/RAMNKYqfoEHS8DWCDZ4C+zVdc3A== X-Received: by 2002:a05:620a:2099:: with SMTP id e25mr5835768qka.487.1624386807457; Tue, 22 Jun 2021 11:33:27 -0700 (PDT) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com. [209.85.222.176]) by smtp.gmail.com with ESMTPSA id f1sm1836065qkh.75.2021.06.22.11.33.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Jun 2021 11:33:26 -0700 (PDT) Received: by mail-qk1-f176.google.com with SMTP id q190so39386630qkd.2 for ; Tue, 22 Jun 2021 11:33:25 -0700 (PDT) X-Received: by 2002:a5b:54a:: with SMTP id r10mr6520278ybp.476.1624386805037; Tue, 22 Jun 2021 11:33:25 -0700 (PDT) MIME-Version: 1.0 References: <1624099230-20899-1-git-send-email-rajeevny@codeaurora.org> <1624099230-20899-2-git-send-email-rajeevny@codeaurora.org> <20210620093141.GA703072@ravnborg.org> <20210621183828.GA918146@ravnborg.org> In-Reply-To: <20210621183828.GA918146@ravnborg.org> From: Doug Anderson Date: Tue, 22 Jun 2021 11:33:13 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [v7 1/5] drm/panel: add basic DP AUX backlight support To: Sam Ravnborg Cc: Rajeev Nandan , dri-devel , linux-arm-msm , freedreno , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , Thierry Reding , Rob Clark , Lyude Paul , Jani Nikula , Rob Herring , Laurent Pinchart , Andrzej Hajda , Daniel Thompson , "Kristian H. Kristensen" , Abhinav Kumar , Sean Paul , Kalyan Thota , Krishna Manikandan , Lee Jones , Jingoo Han , linux-fbdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Jun 21, 2021 at 11:38 AM Sam Ravnborg wrote: > > > > I cannot see why you need the extra check on ->enabled? > > > Would it be sufficient to check backlight_is_blank() only? > > > > This extra check on bl->enabled flag is added to avoid enabling/disabling > > backlight again if it is already enabled/disabled. > > Using this flag way can know the transition between backlight blank and > > un-blank, and decide when to enable/disable the backlight. > > My point is that this should really not be needed, as it would cover up > for some other bug whaere we try to do something twice that is not > needed. But I am less certain here so if you think it is needed, keep > it as is. I haven't tested this myself, but I believe that it is needed. I don't think the backlight update_status() function is like an enable/disable function. I believe it can be called more than one time even while the backlight is disabled. For instance, you can see that backlight_update_status() just blindly calls through to update the status. That function can be called for a number of reasons. Perhaps Rajeev can put some printouts to confirm but I think that if the backlight is "blanked" for whatever reason and you write to sysfs and change the backlight level you'll still get called again even though the backlight is still "disabled". -Doug