[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170320134921.GO22463@ulmo.ba.sec>
Date: Mon, 20 Mar 2017 14:49:21 +0100
From: Thierry Reding <thierry.reding@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Ralph Sennhauser <ralph.sennhauser@...il.com>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
Imre Kaloz <kaloz@...nwrt.org>,
Alexandre Courbot <gnurou@...il.com>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"David S. Miller" <davem@...emloft.net>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Guenter Roeck <linux@...ck-us.net>,
"open list:PWM SUBSYSTEM" <linux-pwm@...r.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/4] gpio: mvebu: Add limited PWM support
On Sat, Mar 18, 2017 at 04:37:53PM +0100, Andrew Lunn wrote:
> > > +static void mvebu_pwm_free(struct pwm_chip *chip, struct pwm_device *pwmd)
> > > +{
> > > + struct mvebu_pwm *pwm = to_mvebu_pwm(chip);
> > > + struct gpio_desc *desc = gpio_to_desc(pwmd->pwm);
> > > + unsigned long flags;
> > > +
> > > + spin_lock_irqsave(&pwm->lock, flags);
> > > + gpiod_free(desc);
> > > + pwm->used = false;
> > > + spin_unlock_irqrestore(&pwm->lock, flags);
> > > +}
> >
> > No need to set the output value to zero or something here?
> > And turn off blinking? Or is that done some other way?
>
> Hi Linus
>
> The disable op will turn of blinking. I've not checked, but i assume
> the PWM core will not allow you to free an enabled PWM?
Actually it will. It's probably a good idea to add a WARN_ON() to the
PWM core if that situation arises. I don't think going as far as
prohibiting it will do any good, though. It's not like drivers will
have much of a choice if pwm_put() fails. Typically they'd do that in
their ->remove() call, at which point failure is difficult to deal with.
> > I think both of these need to be tagged __maybe_unused to not give
> > noise in randconfig builds.
>
> I've not seen any 0-day patch emails giving warnings. So i suspect it
> is O.K.
Linus was probably referring to !PM configurations. I'm not sure how
often they'll get run, but as long as it doesn't make it into linux-next
the chances aren't very high (I don't think the 0-day builder executes
randconfig builds).
Thierry
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists