linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: santosh.shilimkar@ti.com (Santosh Shilimkar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: l2x0: Errata fix for flush by Wayoperationcan cause data corruption
Date: Mon, 7 Mar 2011 17:55:22 +0530	[thread overview]
Message-ID: <491849bc08797fc8c4d0def52dd6308a@mail.gmail.com> (raw)
In-Reply-To: <000a01cbdcc0$3d0dfeb0$b729fc10$@deacon@arm.com>

Thanks Will for reporting it.

> -----Original Message-----
> From: linux-arm-kernel-bounces at lists.infradead.org [mailto:linux-
> arm-kernel-bounces at lists.infradead.org] On Behalf Of Will Deacon
> Sent: Monday, March 07, 2011 5:38 PM
> To: 'Santosh Shilimkar'; Russell King - ARM Linux
> Cc: tony at atomide.com; Catalin Marinas; linux-omap at vger.kernel.org;
> linux-arm-kernel at lists.infradead.org
> Subject: RE: [PATCH 1/2] ARM: l2x0: Errata fix for flush by
> Wayoperationcan cause data corruption
>
> Hi Santosh,
>
> > > On Sun, Feb 27, 2011 at 12:00:21PM +0000, Russell King - ARM
> Linux
> > > wrote:
> > > > > +#else
> > > > > +/* Optimised out for non-errata case */
> > > > > +static inline void debug_writel(unsigned long val)
> > > > > +{
> > > > >  }
> > > >
> > > > #define l2x0_set_debug	NULL
> > > >
> > > > > +#endif
> > >
> > > I notice you got rid of the inline function.  Have you tried
> > > building this without the errata enabled?
> >
> > I accidently dropped the inline function while
> > incorporating the comment from you. :(
> >
> > Fixed it. Updated version # 6770/1
>
> This version of the patch (as it appears in -next) is broken:
>
>
> +#define debug_writel(val)	outer_cache.set_debug(val)
> +
> +static void l2x0_set_debug(unsigned long val)
> +{
> +	writel(val, l2x0_base + L2X0_DEBUG_CTRL);

This should have been "writel_relaxed()" to avoid the
cache sync.

>  }
>
> [...]
>
> @@ -119,9 +120,11 @@ static void l2x0_flush_all(void)
>
>  	/* clean all ways */
>  	spin_lock_irqsave(&l2x0_lock, flags);
> +	debug_writel(0x03);
>  	writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_INV_WAY);
>  	cache_wait_way(l2x0_base + L2X0_CLEAN_INV_WAY, l2x0_way_mask);
>  	cache_sync();
> +	debug_writel(0x00);
>  	spin_unlock_irqrestore(&l2x0_lock, flags);
>  }
>
>
> This deadlocks because the writel forces an outer cache sync, which
> then tries to acquire the spinlock which is held by the calling
> function.
>
> If you change l2x0_set_debug to use writel_relaxed then you can
> avoid the problem.
>
Ya understood. I couldn't test non-errata case because
direct right doesn't work because of security and henced missed
it.

Below is the updated version. Also attached.

Russell,
Do you want me to push this to patch system or you can
apply this one?


Regards,
Santosh
------

  reply	other threads:[~2011-03-07 12:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-18 12:35 [PATCH 0/2] l2x0: Add PL310 Errata 727915 Santosh Shilimkar
2011-02-18 12:35 ` [PATCH 1/2] ARM: l2x0: Errata fix for flush by Way operation can cause data corruption Santosh Shilimkar
2011-02-21  9:46   ` Catalin Marinas
2011-02-27 12:00   ` Russell King - ARM Linux
2011-02-28  3:45     ` [PATCH 1/2] ARM: l2x0: Errata fix for flush by Way operationcan " Santosh Shilimkar
2011-02-28 10:13     ` [PATCH 1/2] ARM: l2x0: Errata fix for flush by Way operation can " Russell King - ARM Linux
2011-02-28 12:47       ` [PATCH 1/2] ARM: l2x0: Errata fix for flush by Way operationcan " Santosh Shilimkar
2011-03-07 12:07         ` Will Deacon
2011-03-07 12:25           ` Santosh Shilimkar [this message]
2011-03-07 19:10             ` [PATCH 1/2] ARM: l2x0: Errata fix for flush by Wayoperationcan " Russell King - ARM Linux
2011-03-08  6:00               ` [PATCH 1/2] ARM: l2x0: Errata fix for flush by Wayoperationcancause " Santosh Shilimkar
2011-02-18 12:35 ` [PATCH 2/2] omap4: l2x0: Populate set_debug() function and enable Errata 727915 Santosh Shilimkar

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=491849bc08797fc8c4d0def52dd6308a@mail.gmail.com \
    --to=santosh.shilimkar@ti.com \
    --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).