linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 04/12] arm: mm: cache-l2x0: add l2x0 suspend and resume functions
Date: Fri, 29 Jan 2010 19:03:55 +0000	[thread overview]
Message-ID: <20100129190355.GA19882@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1264789772.1818.8.camel@c-dwalke-linux.qualcomm.com>

On Fri, Jan 29, 2010 at 10:29:32AM -0800, Daniel Walker wrote:
> On Fri, 2010-01-29 at 10:23 -0800, Ruan, Willie wrote:
> > > From: Daniel Walker [mailto:dwalker at codeaurora.org] 
> > > Sent: Friday, January 29, 2010 9:59 AM
> > >
> > > What if there are multiple cpu's calling cache_sync() at the same time?
> > > Disable interrupt wouldn't prevent it ..
> > 
> > cache_sync() is calling sync_writel(), which is using spin_lock_irqsave().
> > So, each call of cache_sync() and sync_writel() is SMP safe individually
> > in l2x0_flush_all() as in l2x0_inv_all(), unless we need to protect the
> > two calls together, which seems not necessary to me.
> 
> This is the current version,
> 
> static inline void cache_wait(void __iomem *reg, unsigned long mask)
> {
>         /* wait for the operation to complete */
>         while (readl(reg) & mask)
>                 ;
> }
> 
> static inline void cache_sync(void)
> {
>         void __iomem *base = l2x0_base;
>         writel(0, base + L2X0_CACHE_SYNC);
>         cache_wait(base + L2X0_CACHE_SYNC, 1);
> }
> 
> Maybe cache_sync was recently changed to "writel" instead sync_writel()
> due it getting called with the lock already held.

It's pointless discussing what the current code does, because that's
not what mainline does _today_ - the locking in this file has
completely changed.

  reply	other threads:[~2010-01-29 19:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-28 22:59 [RFC PATCH 04/12] arm: mm: cache-l2x0: add l2x0 suspend and resume functions Daniel Walker
2010-01-29  6:49 ` Pavel Machek
2010-01-29 17:54   ` Ruan, Willie
2010-01-29 11:08 ` [RFC PATCH 04/12] arm: mm: cache-l2x0: add l2x0 suspend and resumefunctions Catalin Marinas
2010-01-29 17:55   ` [RFC PATCH 04/12] arm: mm: cache-l2x0: add l2x0 suspend and resume functions Ruan, Willie
2010-01-29 17:59     ` Daniel Walker
2010-01-29 18:23       ` Ruan, Willie
2010-01-29 18:29         ` Daniel Walker
2010-01-29 19:03           ` Russell King - ARM Linux [this message]
2010-01-29 19:12             ` Daniel Walker
2010-01-29 19:43               ` Russell King - ARM Linux
2010-01-29 20:01                 ` Daniel Walker
2010-01-29 14:14 ` Russell King - ARM Linux
2010-01-29 14:35   ` Daniel Walker

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=20100129190355.GA19882@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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).