public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mmc:dcache: Cache line size aligned internal MMC buffers
Date: Mon, 22 Aug 2011 18:52:44 +0200	[thread overview]
Message-ID: <201108221852.45161.marek.vasut@gmail.com> (raw)
In-Reply-To: <CAF6FioV5yBAtkw5-H0kdL0KiA1hnaEmSBSA++M4Ff5-FcLVNLQ@mail.gmail.com>

On Monday, August 22, 2011 06:42:06 PM Anton Staaf wrote:
> On Mon, Aug 22, 2011 at 9:08 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> > On Monday, August 22, 2011 03:29:52 Lukasz Majewski wrote:
> >> On Fri, 19 Aug 2011 11:35:50 -0400 Mike Frysinger wrote:
> >> > On Friday, August 19, 2011 11:28:18 Lukasz Majewski wrote:
> >> > > On Fri, 19 Aug 2011 09:57:10 -0400 Mike Frysinger wrote:
> >> > > > On Friday, August 19, 2011 05:25:13 Lukasz Majewski wrote:
> >> > > > also, what is the code size increase with your patch ?
> >> > > 
> >> > > Code size overhead (s5p_goni target):
> >> > > Without proposed changes: 167928 B (u-boot.bin)
> >> > > With changes: 168208 B (u-boot.bin)
> >> > > 
> >> > > Delta: 280 B
> >> > 
> >> > np if it gives significant (more than system noise) speedups.  any
> >> > details on that ?
> >> 
> >> No tests performed yet. The goal of those patches is to preserve the
> >> MMC subsystem functionality when dcache is enabled (the ext_csd[512]
> >> corruption is observed with d-cache enabled).
> > 
> > so you're papering over a bug in some controller's cache handling ?
> >  shouldnt you fix the controller in question by having it flush its
> > caches ?  aligning random buffers to make cache issues "go away" isnt
> > the right way for anything. -mike
> 
> No, this isn't something that can be fixed in the controller driver
> code.  This is a fundamental problem with buffers in U-Boot that needs
> to be resolved by aligning all buffers used for DMA.  The main problem
> is that invalidating a non-cache line aligned buffer is not a safe
> operation.  There have been a number of threads discussing this.  The
> general consensus was to make attempting to invalidate an unaligned
> buffer an error and then to clean up the unaligned buffers as we find
> them.
> 
> Lukasz, I also have been using memalign to clean up accesses in local
> patches, so you've got my vote there. I am curious as to whether we
> should provide a single block allocation API or if each subsection
> should add lazy memalign allocations to create aligned buffers when
> they are needed...

Maybe some dma_allocate_aligned() would be cool. And probably control the 
alignment with some #define CONFIG PLATFORM_ALIGNMENT_SIZE ?

Cheers
> 
> Thanks,
>     Anton
> 
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot at lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

  reply	other threads:[~2011-08-22 16:52 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-19  9:25 [U-Boot] [PATCH] mmc:dcache: Cache line size aligned internal MMC buffers Lukasz Majewski
2011-08-19 13:57 ` Mike Frysinger
2011-08-19 15:28   ` Lukasz Majewski
2011-08-19 15:35     ` Mike Frysinger
2011-08-22  7:29       ` Lukasz Majewski
2011-08-22 16:08         ` Mike Frysinger
2011-08-22 16:42           ` Anton Staaf
2011-08-22 16:52             ` Marek Vasut [this message]
2011-08-22 17:17             ` Mike Frysinger
2011-08-22 18:15               ` Anton Staaf
2011-08-22 18:31                 ` Mike Frysinger
2011-08-22 18:57                   ` Anton Staaf
2011-08-23  9:19                     ` Lukasz Majewski
2011-08-23 17:00                       ` Anton Staaf
2011-08-23 17:30                       ` Mike Frysinger
2011-08-23 18:12                         ` Anton Staaf
2011-08-23 18:35                           ` Mike Frysinger
2011-08-23 18:36                           ` Mike Frysinger
2011-08-23 18:46                             ` Anton Staaf
2011-08-23 20:12                           ` Wolfgang Denk
2011-08-23 20:27                             ` Anton Staaf
2011-08-23 20:37                               ` Mike Frysinger
2011-08-23 21:06                                 ` Anton Staaf
2011-08-23 21:32                                   ` Mike Frysinger
2011-08-23 21:09                                 ` Wolfgang Denk
2011-08-23 21:32                                   ` Mike Frysinger
2011-08-23 21:48                                     ` Anton Staaf
2011-08-24 16:16                                       ` Mike Frysinger
2011-08-23 22:42                                     ` Wolfgang Denk
2011-08-24  3:00                                       ` Mike Frysinger
2011-08-24 10:07                                         ` Lukasz Majewski
2011-08-24 13:25                                           ` Wolfgang Denk
2011-08-24 14:31                                             ` Lukasz Majewski
2011-08-24 16:20                                             ` Mike Frysinger
2011-08-24 17:27                                             ` Anton Staaf
2011-08-24 18:06                                               ` Mike Frysinger
2011-08-24 18:12                                               ` Wolfgang Denk
2011-08-24 18:25                                                 ` Anton Staaf
2011-08-24 19:04                                                   ` Wolfgang Denk
2011-08-24 20:12                                                     ` Anton Staaf
2011-08-24 19:18                                                   ` Lukasz Majewski
2011-08-24 20:13                                                     ` Anton Staaf
2011-08-29 20:12                                                       ` Anton Staaf
2011-08-29 20:35                                                         ` Wolfgang Denk
2011-08-29 21:08                                                           ` Anton Staaf
2011-08-29 20:47                                                         ` Scott Wood
2011-08-29 20:58                                                           ` Anton Staaf
2011-08-29 21:23                                                             ` Scott Wood
2011-08-29 21:54                                                               ` Anton Staaf
2011-08-29 22:03                                                                 ` Scott Wood
2011-08-29 22:49                                                                   ` Anton Staaf
2011-08-29 23:01                                                                     ` Scott Wood
2011-08-29 23:05                                                                       ` Anton Staaf
2011-08-23 20:35                             ` Mike Frysinger
2011-08-23  8:42           ` Lukasz Majewski

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=201108221852.45161.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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