[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170817130103.GR20805@n2100.armlinux.org.uk>
Date: Thu, 17 Aug 2017 14:01:03 +0100
From: Russell King - ARM Linux <linux@...linux.org.uk>
To: Danilo Krummrich <danilokrummrich@...develop.de>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Will Deacon <will.deacon@....com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Linux Input <linux-input@...r.kernel.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
devicetree@...r.kernel.org
Subject: Re: [PATCH] serio: PS2 gpio bit banging driver for the serio bus
On Thu, Aug 17, 2017 at 12:51:33PM +0200, Danilo Krummrich wrote:
> That having the correct execution order is not enough on some buses because
> of buffering is really something to be aware of, thanks again for pointing
> this out.
PCI guarantees the order of writes to a device, but there are situations
on SoCs where you can't rely on that - for instance, if the writes go
over different buses to different devices (eg, write to a peripheral
vs write to an interrupt controller.)
Even then, with interrupts delivered by message (eg, MSI) there's
issues.
> So for the scenario I was concerned about I would expect the irqchip driver
> guarantees the write actually hits the the hardware (if necessary read it
> back) before the function (disable_irq_nosync()) returns, is that correct?
> Though, having the need should be very unlikely.
Well, disable_irq_nosync() doesn't guarantee that the interrupt handler
isn't running - a CPU may have just received the interrupt and is just
entering the interrupt handler when disable_irq_nosync() returns. The
hint is the "nosync" - there's no synchronisation. If you need to
guarantee that the interrupt handler is not running, disable_irq() does
that. By implication, however, disable_irq() can not be called from
within the same interrupt handler for the interrupt that is being
disabled.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
Powered by blists - more mailing lists