Re: [PATCH 1/3] ARM: Introduce atomic MMIO clear/set

2013-08-20 Thread Will Deacon
On Tue, Aug 20, 2013 at 03:52:00PM +0100, Ezequiel Garcia wrote: > On Tue, Aug 20, 2013 at 09:32:13AM -0500, Matt Sealey wrote: > > On Mon, Aug 19, 2013 at 11:59 AM, Ezequiel Garcia > > wrote: > > > On Mon, Aug 12, 2013 at 07:29:42PM +0100, Will Deacon wrote: > > >> I suggest adding an iowmb after

Re: [PATCH 1/3] ARM: Introduce atomic MMIO clear/set

2013-08-20 Thread Ezequiel Garcia
On Tue, Aug 20, 2013 at 09:32:13AM -0500, Matt Sealey wrote: > On Mon, Aug 19, 2013 at 11:59 AM, Ezequiel Garcia > wrote: > > On Mon, Aug 12, 2013 at 07:29:42PM +0100, Will Deacon wrote: > > > >> This means that you don't have ordering guarantees between the two accesses > >> outside of the CPU, p

Re: [PATCH 1/3] ARM: Introduce atomic MMIO clear/set

2013-08-20 Thread Matt Sealey
On Mon, Aug 19, 2013 at 11:59 AM, Ezequiel Garcia wrote: > On Mon, Aug 12, 2013 at 07:29:42PM +0100, Will Deacon wrote: > >> This means that you don't have ordering guarantees between the two accesses >> outside of the CPU, potentially giving you: >> >> spin_lock(&__io_lock); >> spin_u

Re: [PATCH 1/3] ARM: Introduce atomic MMIO clear/set

2013-08-19 Thread Ezequiel Garcia
On Mon, Aug 12, 2013 at 07:29:42PM +0100, Will Deacon wrote: > On Sat, Aug 10, 2013 at 01:43:00PM +0100, Ezequiel Garcia wrote: > > Some SoC have MMIO regions that are shared across orthogonal > > subsystems. This commit implements a possible solution for the > > thread-safe access of such regions

Re: [PATCH 1/3] ARM: Introduce atomic MMIO clear/set

2013-08-12 Thread Will Deacon
On Sat, Aug 10, 2013 at 01:43:00PM +0100, Ezequiel Garcia wrote: > Some SoC have MMIO regions that are shared across orthogonal > subsystems. This commit implements a possible solution for the > thread-safe access of such regions through a spinlock-protected API > with clear-set semantics. > > Con

Re: [PATCH 1/3] ARM: Introduce atomic MMIO clear/set

2013-08-12 Thread Ezequiel Garcia
Sebastian, On Mon, Aug 12, 2013 at 06:44:10PM +0200, Sebastian Hesselbarth wrote: > On 08/12/13 17:46, Ezequiel Garcia wrote: > >> Indeed, syscon looks like a nice match for this use case. > >> (although it still looks like an overkill to me). > >> > >> I've been trying to implement a working solu

Re: [PATCH 1/3] ARM: Introduce atomic MMIO clear/set

2013-08-12 Thread Sebastian Hesselbarth
On 08/12/13 17:46, Ezequiel Garcia wrote: Indeed, syscon looks like a nice match for this use case. (although it still looks like an overkill to me). I've been trying to implement a working solution based in syscon but I'm unable to overcome an issue. The problem is that we need the register/re

Re: [PATCH 1/3] ARM: Introduce atomic MMIO clear/set

2013-08-12 Thread Ezequiel Garcia
On Sat, Aug 10, 2013 at 12:55:53PM -0300, Ezequiel Garcia wrote: > On Sat, Aug 10, 2013 at 07:43:08PM +0400, Alexander Shiyan wrote: > > > On Sat, Aug 10, 2013 at 11:02:38AM -0300, Ezequiel Garcia wrote: > > > > On Sat, Aug 10, 2013 at 04:49:28PM +0400, Alexander Shiyan wrote: > > > > > > Some SoC

Re: [PATCH 1/3] ARM: Introduce atomic MMIO clear/set

2013-08-10 Thread Ezequiel Garcia
On Sat, Aug 10, 2013 at 07:43:08PM +0400, Alexander Shiyan wrote: > > On Sat, Aug 10, 2013 at 11:02:38AM -0300, Ezequiel Garcia wrote: > > > On Sat, Aug 10, 2013 at 04:49:28PM +0400, Alexander Shiyan wrote: > > > > > Some SoC have MMIO regions that are shared across orthogonal > > > > > subsystems.

Re: [PATCH 1/3] ARM: Introduce atomic MMIO clear/set

2013-08-10 Thread Alexander Shiyan
> On Sat, Aug 10, 2013 at 11:02:38AM -0300, Ezequiel Garcia wrote: > > On Sat, Aug 10, 2013 at 04:49:28PM +0400, Alexander Shiyan wrote: > > > > Some SoC have MMIO regions that are shared across orthogonal > > > > subsystems. This commit implements a possible solution for the > > > > thread-safe ac

Re: [PATCH 1/3] ARM: Introduce atomic MMIO clear/set

2013-08-10 Thread Ezequiel Garcia
On Sat, Aug 10, 2013 at 11:02:38AM -0300, Ezequiel Garcia wrote: > On Sat, Aug 10, 2013 at 04:49:28PM +0400, Alexander Shiyan wrote: > > > Some SoC have MMIO regions that are shared across orthogonal > > > subsystems. This commit implements a possible solution for the > > > thread-safe access of su

Re: [PATCH 1/3] ARM: Introduce atomic MMIO clear/set

2013-08-10 Thread Ezequiel Garcia
On Sat, Aug 10, 2013 at 04:49:28PM +0400, Alexander Shiyan wrote: > > Some SoC have MMIO regions that are shared across orthogonal > > subsystems. This commit implements a possible solution for the > > thread-safe access of such regions through a spinlock-protected API > > with clear-set semantics.

Re: [PATCH 1/3] ARM: Introduce atomic MMIO clear/set

2013-08-10 Thread Alexander Shiyan
> Some SoC have MMIO regions that are shared across orthogonal > subsystems. This commit implements a possible solution for the > thread-safe access of such regions through a spinlock-protected API > with clear-set semantics. > > Concurrent access is protected with a single spinlock for the > enti