From: Alexander Stein <alexander.stein@systec-electronic.com>
To: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Anatolij Gustschin <agust@denx.de>
Subject: Re: [PATCH 1/2] ads7846: Make buffers in ads7846_read12_ser and ads7845_read12_ser DMA save
Date: Wed, 4 May 2011 17:55:23 +0200 [thread overview]
Message-ID: <201105041755.24184.alexander.stein@systec-electronic.com> (raw)
In-Reply-To: <4DC175A4.6060401@cam.ac.uk>
Hello,
Am Mittwoch, 4. Mai 2011, 17:49:56 schrieb Jonathan Cameron:
> On 05/04/11 16:22, Alexander Stein wrote:
> > req.sample needs its own cacheline otherwise accessing req.msg fetches
> > it in again.
> > Put req onto stack as it doesn't need to be DMA save.
> > req.sample is kzalloced itself for DMA access.
> > req.command doesn't need own cache line because it will only be written
> > to memory on dma_map_single. req.scratch is unsed at all.
> >
> > Note: This effect doesn't occur if the underlying SPI driver doesn't use
> > DMA at all.
>
> How about using ____cacheline_aligned having moved 'sample' to the end of
> the structure?
>
> e.g.
>
> ...
> struct spi_transfer xfer[6];
> __be16 sample ____cacheline_aligned;
> }
>
> Rather smaller patch when you get down to it.
Mh, I didn't know I had to reorder the struct elements to use
____cacheline_aligned. I originally had a solution in mind with a smaller
memory footprint in mind, but rethinking about it, this might be negligible if
there is one at all.
So, if ____cacheline_aligned is the more sane approach I'll resend a patch
using it.
Alexander
next prev parent reply other threads:[~2011-05-04 15:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-04 14:02 ads7846: ads7846_read12_ser is not DMA save Alexander Stein
2011-05-04 14:17 ` Hennerich, Michael
2011-05-04 15:22 ` [PATCH 1/2] ads7846: Make buffers in ads7846_read12_ser and ads7845_read12_ser " Alexander Stein
2011-05-04 15:49 ` Jonathan Cameron
2011-05-04 15:55 ` Jonathan Cameron
2011-05-04 15:55 ` Alexander Stein [this message]
2011-05-04 16:07 ` Jonathan Cameron
2011-05-05 1:31 ` Dmitry Torokhov
2011-05-04 15:22 ` [PATCH 2/2] ads7846: Remove unused variable from struct ads7845_ser_req Alexander Stein
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=201105041755.24184.alexander.stein@systec-electronic.com \
--to=alexander.stein@systec-electronic.com \
--cc=Michael.Hennerich@analog.com \
--cc=agust@denx.de \
--cc=dmitry.torokhov@gmail.com \
--cc=jic23@cam.ac.uk \
--cc=linux-input@vger.kernel.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).