From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 06/11] dma: amba-pl08x: Keep LLIs aligned to 4-word boundary
Date: Mon, 17 Jun 2013 11:28:57 -0700 (PDT) [thread overview]
Message-ID: <1689769.rtxlYhhpTQ@flatron> (raw)
In-Reply-To: <CACRpkdYzag=sKo87i6H3M_fSQuRiTX3_2-ZhQA+4S7ejZN5j4A@mail.gmail.com>
On Monday 17 of June 2013 15:51:20 Linus Walleij wrote:
> On Sun, Jun 16, 2013 at 10:54 PM, Tomasz Figa <tomasz.figa@gmail.com>
wrote:
> > PL080 reference manual states that to LLI entries should be aligned
> > to 4-word boundary to make LLI fetches more efficient. This patch adds
> > a 3-word padding to the LLi struct to make this condition true.
> >
> > Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
> > ---
> >
> > drivers/dma/amba-pl08x.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
> > index eb10eb8..0da5539 100644
> > --- a/drivers/dma/amba-pl08x.c
> > +++ b/drivers/dma/amba-pl08x.c
> > @@ -127,6 +127,7 @@ struct pl08x_lli {
> >
> > u32 lli;
> > u32 cctl;
> > u32 cctl1;
> >
> > + u32 dummy[3];
>
> Atleast put a comment into the code explaining what this is all
> about. Or someone will add another member to the struct and
> all is lost. Call it "padding" rather than dummy.
>
> > };
>
> So it used to be like this before you added cctl1:
>
> struct pl08x_lli {
> u32 src;
> u32 dst;
> u32 lli;
> u32 cctl;
> };
>
> Meaning it was 3 words.
>
> And now you make it take 8 words for everyone.
>
> Atleast this patch should be squashed into the patch
> adding cctl1.
>
> But I really don't like this fragile way of casting structs right
> into memory, and I don't like that teh other PL080's also have
> to waste 8 words when their LLIs fit so nicely into 4.
>
> I would have solved this problem by creating a
> marshalling function that just allocate the number of bytes the
> LLI entry shall have and fill it in by assigning directly to the
> precise target memory cell. This way the LLIs will take
> 4 words on the original variants and you can use some
> nice logic to pad out to 8 words on the PL080S variant.
Definitely a valid point. I'll see what I can do about it.
I was thinking about it originally, but I couldn't find any really good
solution for this so I just went with this extremely simple approach as a
proof of concept and to show the problem. :)
Best regards,
Tomasz
next prev parent reply other threads:[~2013-06-17 18:28 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-16 20:54 [RFC PATCH 00/11] ARM: s3c64xx: Let amba-pl08x driver handle DMA Tomasz Figa
2013-06-16 20:54 ` [RFC PATCH 01/11] dma: amba-pl08x: Use bitmap to pass variant specific quirks Tomasz Figa
2013-06-17 13:25 ` Linus Walleij
2013-06-17 18:48 ` Russell King - ARM Linux
2013-06-17 18:56 ` Tomasz Figa
2013-06-18 7:47 ` Linus Walleij
2013-06-18 13:33 ` Arnd Bergmann
2013-06-16 20:54 ` [RFC PATCH 02/11] dma: amba-pl08x: Refactor pl08x_getbytes_chan() to lower indentation Tomasz Figa
2013-06-17 13:29 ` Linus Walleij
2013-06-16 20:54 ` [RFC PATCH 03/11] dma: amba-pl08x: Add support for different offset of CONFIG register Tomasz Figa
2013-06-17 13:31 ` Linus Walleij
2013-06-17 18:52 ` Russell King - ARM Linux
2013-06-17 19:02 ` Tomasz Figa
2013-06-16 20:54 ` [RFC PATCH 04/11] dma: amba-pl08x: Add support for PL080S variant Tomasz Figa
2013-06-17 13:39 ` Linus Walleij
2013-06-17 18:22 ` Tomasz Figa
2013-06-16 20:54 ` [RFC PATCH 05/11] dma: amba-pl08x: Add support for different maximum transfer size Tomasz Figa
2013-06-17 13:42 ` Linus Walleij
2013-06-17 18:27 ` Tomasz Figa
2013-06-16 20:54 ` [RFC PATCH 06/11] dma: amba-pl08x: Keep LLIs aligned to 4-word boundary Tomasz Figa
2013-06-17 13:51 ` Linus Walleij
2013-06-17 18:28 ` Tomasz Figa [this message]
2013-06-17 19:01 ` Russell King - ARM Linux
2013-06-16 20:54 ` [RFC PATCH 07/11] dmaengine: PL08x: Fix reading the byte count in cctl Tomasz Figa
2013-06-17 13:53 ` Linus Walleij
2013-06-17 18:32 ` Tomasz Figa
2013-06-17 19:03 ` Russell King - ARM Linux
2013-06-16 20:54 ` [RFC PATCH 08/11] dmaengine: PL08x: Add cyclic transfer support Tomasz Figa
2013-06-17 13:57 ` Linus Walleij
2013-06-17 18:52 ` Tomasz Figa
2013-06-17 18:56 ` Russell King - ARM Linux
2013-06-16 20:54 ` [RFC PATCH 09/11] spi: s3c64xx: Do not require legacy DMA API in case of S3C64XX Tomasz Figa
2013-06-17 13:59 ` Linus Walleij
2013-06-17 16:06 ` Mark Brown
2013-06-17 19:36 ` Tomasz Figa
2013-06-16 20:54 ` [RFC PATCH 10/11] ASoC: samsung: " Tomasz Figa
2013-06-17 14:01 ` Linus Walleij
2013-06-16 20:54 ` [RFC PATCH 11/11] ARM: s3c64xx: Add support for DMA using generic amba-pl08x driver Tomasz Figa
2013-06-17 14:04 ` Linus Walleij
2013-06-19 18:23 ` Tomasz Figa
2013-06-19 19:50 ` Linus Walleij
2013-06-17 14:06 ` [RFC PATCH 00/11] ARM: s3c64xx: Let amba-pl08x driver handle DMA Linus Walleij
2013-06-17 19:38 ` Tomasz Figa
2013-06-19 17:40 ` Mark Brown
2013-06-19 18:26 ` Tomasz Figa
2013-06-19 19:01 ` Arnd Bergmann
2013-06-19 19:24 ` Mark Brown
2013-06-19 19:22 ` Mark Brown
2013-06-19 19:32 ` Tomasz Figa
2013-06-19 22:48 ` Mark Brown
2013-06-20 9:24 ` Phil Carmody
2013-06-20 10:35 ` Mark Brown
2013-06-20 11:14 ` Phil Carmody
2013-06-21 9:47 ` Mark Brown
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=1689769.rtxlYhhpTQ@flatron \
--to=tomasz.figa@gmail.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).