Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp430985pxb; Thu, 19 Aug 2021 03:05:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzA+4r3Bkc8F4ODTsvyiUQ6oaaaCIBvAWlAa26Awsxsf3NgpH3aeXPzJFghAxg1qM0CjUfK X-Received: by 2002:a17:906:3fd7:: with SMTP id k23mr14887280ejj.176.1629367534279; Thu, 19 Aug 2021 03:05:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629367534; cv=none; d=google.com; s=arc-20160816; b=gMa5Y0qYN5hHYu9scjCWUkXUD5UsFiwrDLgoowR1G+9ASFXLqtCp7tCHmTXAzyrtbM dX8FWg8Sx3XVegwKQ+77IcS4BZf4FWlSkJ4/K8pnGUpyTet1ycKobRc1lF1gxNohcgsV j7+D3jn9D4R0/QPTj6ixNoadHFLlQ10ttm8QpDwqqhQzGjFJI+YTKCm7obAuR/gnomEv gA93JpWzeZcfi4htrUCfjqv4ymvcA9jTVi9sEtiyvj5d9KEWZHsIk/q6OSoWkj/K7mZP PCPp8kqckpUhA5+tgZJWz+EKqfibK0TlCUQFrzo0b/cs9QElSWvp6kq4g59hNq5Qlosb p44w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=xtunD2GxO/8/vmP/JIhc/Q4AXeVK5pzMLPGPI0WktNo=; b=oXLiWxnIu2KNLOLtv90lZR10dZtspZO4cjVztnmYD1Q6F8KwPoyQytDA2QKKxgB1zk noRayADzqvMRRO82Samz6JBUnQ7AyliYSaay2KpzsayjX9E9ALyi+vOiOtwgQf4zYSjx SvmRYefRqjG1QD8xbMkBINcRO7fR0PdXp020mvBnGGnA9doHRPp9TYnNZxGJWPUe3YkF QY6yHAX7B+amLfDql47RRj6DYzQcKYzL9omcQKJmPjmI5HrqZ2/gDDZpPi8iR7gdwlGL 0ZPZHpQ2UtiJqa5bUwbKTbY+eyUqPwb636xC5RJskjuzlQpFFI8IlR3Hn/DLlA8U2bbJ mERA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ULGrdUlL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si2761360edp.178.2021.08.19.03.05.04; Thu, 19 Aug 2021 03:05:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ULGrdUlL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237746AbhHSKAK (ORCPT + 99 others); Thu, 19 Aug 2021 06:00:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238011AbhHSKAJ (ORCPT ); Thu, 19 Aug 2021 06:00:09 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 602C8C061575 for ; Thu, 19 Aug 2021 02:59:33 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id l11so8197027wrx.4 for ; Thu, 19 Aug 2021 02:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=xtunD2GxO/8/vmP/JIhc/Q4AXeVK5pzMLPGPI0WktNo=; b=ULGrdUlLjfonZ9gXeFBZL1uRfDlE0SqvpHLPwuyDblWuDL6n7yMagTIZsgstsvo+qS r2ts6k9+C4pXp8Sju0Va2gPM+ieguklAU4b9hD9AslIY+NgmsgLibrWbQ1LiZ0Qsk3rH F4JEmqWQWSRFqw+Y6qDkS74exs7H14uKfiSDwl74vGXJMZfBp4C9GqgKKDJXSQ/hupfn oURWGu3f4FfnLlPSov6wUBSXVnpJHIfk9oWzJA427L1hiGyatYZ/YU553dT38q8yqgAn d+ajJsiH6+zxUGDU4WyG1Nhdmg9w9s1BBQAhxibNshdCVsKc6AhrRapWUea8HkBS/5Ng uvpQ== 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:content-transfer-encoding :in-reply-to; bh=xtunD2GxO/8/vmP/JIhc/Q4AXeVK5pzMLPGPI0WktNo=; b=EDmttt+PkPJ07+Jafbi+gkTgLejlBo9yDrtndqvG0MGTtarDdF4BV5wiQBrMbLo8rH yKmgx9jhVZNM++eUgvGiZXqWeygyxMjvzViGJxPTbpwtMuqYVhvdQBQQ9MSQS+McGnDD h2wlwCMdBbTmuhcZ56aviLwKdwifs3xDwzhSc5RHvjHdvoZnE8uNuNWcYcowMSdIcszL OHf3Oq38Gs8S9D6aWs/+05+BYW/6kAAKBXJ6h36xa+3/squFlVMLATMlMiKaJcHgm1a9 raQwV6ANnCU72DTMCH9T2i3QjOg6WijZQTfeQai2vV1KRKIIsbowLvFmtXmW70JBcg9e 1gyA== X-Gm-Message-State: AOAM5321dfiazDkK0H97X3mZaGvhmJdTx3zUcllLioHYXnpvouvcQUS4 ofbIIRrCxcCMI/KNhiQHd1Y8/w== X-Received: by 2002:a5d:4290:: with SMTP id k16mr2749296wrq.224.1629367172037; Thu, 19 Aug 2021 02:59:32 -0700 (PDT) Received: from google.com ([2.31.167.59]) by smtp.gmail.com with ESMTPSA id z5sm7338694wmp.26.2021.08.19.02.59.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 02:59:31 -0700 (PDT) Date: Thu, 19 Aug 2021 10:59:29 +0100 From: Lee Jones To: Daniel Thompson Cc: Jingoo Han , Thierry Reding , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-pwm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Marek Vasut , stable@vger.kernel.org Subject: Re: [PATCH] backlight: pwm_bl: Improve bootloader/kernel device handover Message-ID: References: <20210722144623.1572816-1-daniel.thompson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210722144623.1572816-1-daniel.thompson@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 22 Jul 2021, Daniel Thompson wrote: > Currently there are (at least) two problems in the way pwm_bl starts > managing the enable_gpio pin. Both occur when the backlight is initially > off and the driver finds the pin not already in output mode and, as a > result, unconditionally switches it to output-mode and asserts the signal. > > Problem 1: This could cause the backlight to flicker since, at this stage > in driver initialisation, we have no idea what the PWM and regulator are > doing (an unconfigured PWM could easily "rest" at 100% duty cycle). > > Problem 2: This will cause us not to correctly honour the > post_pwm_on_delay (which also risks flickers). > > Fix this by moving the code to configure the GPIO output mode until after > we have examines the handover state. That allows us to initialize > enable_gpio to off if the backlight is currently off and on if the > backlight is on. > > Reported-by: Marek Vasut > Signed-off-by: Daniel Thompson > Cc: stable@vger.kernel.org > Acked-by: Marek Vasut > Tested-by: Marek Vasut > --- > drivers/video/backlight/pwm_bl.c | 54 +++++++++++++++++--------------- > 1 file changed, 28 insertions(+), 26 deletions(-) Applied, thanks. -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog