Linux PWM subsystem development
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Sven Van Asbroeck <thesven73@gmail.com>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	YueHaibing <yuehaibing@huawei.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	linux-pwm@vger.kernel.org, kernel-janitors@vger.kernel.org,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] pwm: pca9685: Remove set but not used variable 'pwm'
Date: Mon, 3 Jun 2019 18:58:58 +0300	[thread overview]
Message-ID: <20190603155858.GF2781@lahna.fi.intel.com> (raw)
In-Reply-To: <CAGngYiVDCCjo6VKt660Uz5mbEGOBOZpcUWeRHWx_L=TapZgv_w@mail.gmail.com>

On Mon, Jun 03, 2019 at 11:08:06AM -0400, Sven Van Asbroeck wrote:
> On Mon, Jun 3, 2019 at 7:40 AM Mika Westerberg
> <mika.westerberg@linux.intel.com> wrote:
> >
> > I think you are right. pca9685_pwm_request() should take the mutex as
> > long as it is requesting PWM.
> 
> Yes, but things get hairy because pca9685_pwm_request() will have to
> give up the mutex when it returns. I cannot see a way to keep holding
> this mutex while the in-use flag is set by the pwm core ?

Right, I did not notice it's the PWM core that sets the flag.

> Alternatively, we could set (void *)1 pwm_data inside the pwm_request,
> wrapped inside the mutex.
> But then things get 'messy'.
> 
> > A flag would probably be easier to understand than the magic we have
> > now.
> 
> I have the feeling that a flag (plus a mutex) would be the clearest and
> safest way forward. I'll post a patch soon, you guys tell me what you
> think.

Sounds good thanks!

  reply	other threads:[~2019-06-03 15:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-01  3:57 [PATCH -next] pwm: pca9685: Remove set but not used variable 'pwm' YueHaibing
2019-06-01 13:03 ` Sven Van Asbroeck
2019-06-01 16:04   ` Uwe Kleine-König
2019-06-02 14:18     ` Sven Van Asbroeck
2019-06-03 11:40       ` Mika Westerberg
2019-06-03 15:08         ` Sven Van Asbroeck
2019-06-03 15:58           ` Mika Westerberg [this message]
2019-06-04 16:01           ` Andy Shevchenko
2019-06-06 15:11           ` Sven Van Asbroeck
2020-05-23 20:17             ` Uwe Kleine-König
2020-05-24  0:24               ` Sven Van Asbroeck
2020-05-24 10:21                 ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190603155858.GF2781@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thesven73@gmail.com \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox