Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1706140

Re: [PATCH v3 3/5] pwm-backlight: add support for PWM delays proprieties.

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Pavel Machek <pavel@ucw.cz>
Newsgroups linux.kernel
Subject Re: [PATCH v3 3/5] pwm-backlight: add support for PWM delays proprieties.
Date Tue, 08 Aug 2017 10:20:02 +0200
Message-ID <uc7U6-5eH-27@gated-at.bofh.it> (permalink)
References <u4lKx-1Tb-3@gated-at.bofh.it> <u4lKy-1Tb-23@gated-at.bofh.it> <u4x8Z-CI-7@gated-at.bofh.it> <u5eGZ-4x4-3@gated-at.bofh.it> <u5h2a-63o-15@gated-at.bofh.it>
MIME-Version 1.0
Content-Type multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DrWhICOqskFTAXiy"
Content-Disposition inline
User-Agent Mutt/1.5.23 (2014-03-12)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 71
Organization linux.* mail to news gateway
X-Original-Cc Enric Balletbo i Serra <enric.balletbo@collabora.com>, Thierry Reding <thierry.reding@gmail.com>, Lee Jones <lee.jones@linaro.org>, Jingoo Han <jingoohan1@gmail.com>, Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>, Rob Herring <robh+dt@kernel.org>, Richard Purdie <rpurdie@rpsys.net>, Jacek Anaszewski <jacek.anaszewski@gmail.com>, Heiko Stuebner <heiko@sntech.de>, linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, groeck@chromium.org, linux-rockchip@lists.infradead.org
X-Original-Date Tue, 8 Aug 2017 10:11:35 +0200
X-Original-Message-ID <20170808081135.GD12854@amd>
X-Original-References <20170717212811.25374-1-enric.balletbo@collabora.com> <20170717212811.25374-3-enric.balletbo@collabora.com> <d38fa016-ea9c-edf8-9684-5c1235d27c82@linaro.org> <20170720080656.GC13103@amd> <38adad8d-754b-d1dd-167a-913afd8075d6@linaro.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1706140

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu 2017-07-20 11:37:17, Daniel Thompson wrote:
> On 20/07/17 09:06, Pavel Machek wrote:
> >Hi!
> >
> >>>--- a/drivers/video/backlight/pwm_bl.c
> >>>+++ b/drivers/video/backlight/pwm_bl.c
> >>>@@ -10,6 +10,7 @@
> >>>   * published by the Free Software Foundation.
> >>>   */
> >>>+#include <linux/delay.h>
> >>>  #include <linux/gpio/consumer.h>
> >>>  #include <linux/gpio.h>
> >>>  #include <linux/module.h>
> >>>@@ -35,6 +36,7 @@ struct pwm_bl_data {
> >>>  	struct gpio_desc	*enable_gpio;
> >>>  	unsigned int		scale;
> >>>  	bool			legacy;
> >>>+	unsigned int		pwm_delay[2];
> >>
> >>Two named members would be better here (eliminating the "magic" 0
> >>and 1).
> >
> >My thought, too.
> >
> >>>@@ -56,6 +58,9 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness)
> >>>  	pwm_enable(pb->pwm);
> >>>+	if (pb->pwm_delay[0])
> >>>+		usleep_range(pb->pwm_delay[0], pb->pwm_delay[0] * 2);
> >
> >Plus I'd just do the delay unconditionally :-).
> 
> ... does this still apply if this code is switched to msleep()?

No.

> msleep() has no wait avoidance[1] and if lots of drivers are reckless about
> sleeping for 10ms it soon starts to show up in the boot time (especially
> optimized ones).
...
> [1] As it happens I can't see that many early bail out paths in
>     usleep_range() either.

Well, in usleep_range(1,2) should be fast enough operation, and
usleep_range(0,0) should be similar to usleep_range(1,2) at worst :-).
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH v3 3/5] pwm-backlight: add support for PWM delays  proprieties. Pavel Machek <pavel@ucw.cz> - 2017-08-08 10:20 +0200

csiph-web