linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] pinctrl: cherryview: Serialize all register access
Date: Thu, 13 Aug 2015 15:43:46 +0300	[thread overview]
Message-ID: <20150813124346.GC1541@lahna.fi.intel.com> (raw)
In-Reply-To: <CACRpkdYj_gBQpRqPP4S3c-cPhzRGnGUahh+1L8G5qUxwG=cx0g@mail.gmail.com>

On Thu, Aug 13, 2015 at 01:24:13PM +0200, Linus Walleij wrote:
> On Mon, Aug 3, 2015 at 11:46 AM, Mika Westerberg
> <mika.westerberg@linux.intel.com> wrote:
> 
> > There is a hardware issue in Intel Braswell/Cherryview where concurrent
> > GPIO register access might results reads of 0xffffffff and writes might get
> > dropped.
> >
> > Prevent this from happening by taking the serializing lock for all places
> > where it is possible that more than one thread might be accessing the
> > hardware concurrently.
> >
> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> 
> Patch applied.

Thanks!

> When we are on the topic of this spinlock, I noticed that you
> take it in some IRQ functions:
> 
> static void chv_gpio_irq_ack(struct irq_data *d)
> {
>         struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
>         struct chv_pinctrl *pctrl = gpiochip_to_pinctrl(gc);
>         int pin = chv_gpio_offset_to_pin(pctrl, irqd_to_hwirq(d));
>         u32 intr_line;
> 
>         spin_lock(&pctrl->lock);
> (...)
> 
> The Realtime tree have recently started to push raw spinlocks
> into GPIO drivers that handle IRQs. Can you look into this
> for the Intel drivers, I think maybe this needs to be a raw
> spinlock to play nicely with realtime.
> 
> Cf:
> http://marc.info/?l=linux-gpio&m=143749603401220&w=2

Sure, I'll look into that.

      reply	other threads:[~2015-08-13 12:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03  9:46 [PATCH] pinctrl: cherryview: Serialize all register access Mika Westerberg
2015-08-13 11:24 ` Linus Walleij
2015-08-13 12:43   ` Mika Westerberg [this message]

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=20150813124346.GC1541@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).