mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Gregory Clement <gregory.clement@free-electrons.com>,
	Lior Amsalem <alior@marvell.com>,
	Baruch Siach <baruch@tkos.co.il>,
	Will Deacon <will.deacon@arm.com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Russell King <linux@arm.linux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>
Subject: Re: [PATCH v4 1/4] lib: Introduce atomic MMIO modify
Date: Wed, 28 Aug 2013 12:33:52 -0700	[thread overview]
Message-ID: <20130828123352.b9beff5237dfde2571a5779e@linux-foundation.org> (raw)
In-Reply-To: <20130828102422.GA2348@localhost>

On Wed, 28 Aug 2013 07:24:23 -0300 Ezequiel Garcia <ezequiel.garcia@free-electrons.com> wrote:

> On Tue, Aug 27, 2013 at 01:37:09PM -0700, Andrew Morton wrote:
> > On Sat, 24 Aug 2013 12:35:29 -0300 Ezequiel Garcia <ezequiel.garcia@free-electrons.com> wrote:
> > 
> > > Some platforms 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.
> > 
> > Seem sensible.  Perhaps.
> > 
> > It only works if both subsystems agree to use atomic_io_modify().  And
> > if they're both capable of doing that, they are both capable of
> > implementing an agreed-upon internal locking scheme, so why bother?
> > 
> 
> One of the scenarios where this could be helpful and an agreed-upon
> lock seemed difficult to design is this: a watchdog driver that shares
> some control register with *two* different clocksource drivers.
> 
> So, one first solution is to have a function in the two clocksource
> drivers (with matching prototype) and have the watchdog access
> the register through it.
> 
> However, because of multiplatform builds, both these clocksource drivers
> could be built at the same time. Therefore we would have a symbol
> collision, doubly-defined, in each driver.
> 
> How would that work? What other internal locking scheme could we
> implement?

I guess the locking would need to be in a standalone module which the
various driver modules would then depend upon.  I'm not really
advocating doing this - I'm just making noise.

> [..]
> > 
> > I disagree with the presence of the ifndef.  If
> > __HAVE_ARCH_ATOMIC_IO_MODIFY is undefined, the architecture must still
> > implement the identical function signature.  The best way to ensure that
> > is to use the same prototype in both cases.
> > 
> 
> I agree, but how can this be done?

Just remove the ifndefs.  Then remove the identical function prototype
from the arm header.



  reply	other threads:[~2013-08-28 19:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-24 15:35 [PATCH v4 0/4] " Ezequiel Garcia
2013-08-24 15:35 ` [PATCH v4 1/4] lib: " Ezequiel Garcia
2013-08-24 18:27   ` richard -rw- weinberger
2013-08-24 19:58     ` Ezequiel Garcia
2013-08-24 20:35       ` Richard Weinberger
2013-08-24 20:49         ` Ezequiel Garcia
2013-08-24 20:53           ` Richard Weinberger
2013-08-24 23:15       ` Russell King - ARM Linux
2013-08-27 14:37   ` Ezequiel Garcia
2013-08-27 20:37   ` Andrew Morton
2013-08-28 10:24     ` Ezequiel Garcia
2013-08-28 19:33       ` Andrew Morton [this message]
2013-08-29  8:03         ` Thomas Petazzoni
2013-08-28 10:37   ` Ezequiel Garcia
2013-08-28 16:16     ` Linus Torvalds
2013-08-24 15:35 ` [PATCH v4 2/4] ARM: Add atomic_io_modify optimized routines Ezequiel Garcia
2013-08-28  8:53   ` Catalin Marinas
2013-08-28  9:49     ` Ezequiel Garcia
2013-08-28 10:01       ` Thomas Petazzoni
2013-08-28 11:39         ` Catalin Marinas
2013-08-24 15:35 ` [PATCH v4 3/4] clocksource: orion: Use atomic access for shared registers Ezequiel Garcia
2013-08-24 15:35 ` [PATCH v4 4/4] watchdog: " Ezequiel Garcia

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=20130828123352.b9beff5237dfde2571a5779e@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=alior@marvell.com \
    --cc=baruch@tkos.co.il \
    --cc=catalin.marinas@arm.com \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=gregory.clement@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=will.deacon@arm.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

Powered by JetHome