LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Haavard Skinnemoen <hskinnemoen@atmel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux@maxim.org.za, linux@bohmer.net, coldwell@redhat.com,
marc.pignat@hevs.ch, david-b@pacbell.net,
linux-kernel@vger.kernel.org, alan@lxorguk.ukuu.org.uk
Subject: Re: [PATCH -mm v4 7/9] atmel_serial: Add DMA support
Date: Mon, 28 Jan 2008 12:41:25 +0100 [thread overview]
Message-ID: <20080128124125.5c4e0a31@dhcp-252-066.norway.atmel.com> (raw)
In-Reply-To: <20080128022000.82ac86ab.akpm@linux-foundation.org>
On Mon, 28 Jan 2008 02:20:00 -0800
Andrew Morton <akpm@linux-foundation.org> wrote:
> On Mon, 28 Jan 2008 10:59:09 +0100 Haavard Skinnemoen <hskinnemoen@atmel.com> wrote:
>
> > > ho-hum. The generic uart buffer-handling code does ringbuffers the wrong
> > > way. Maybe it has to handle non-power-of-two buffer sizes.
> >
> > Hmm...I don't understand. What does it do wrong?
>
> An faq ;) If the buffer size is a power-of-two it's better to allow the
> head and tail indices wrap through 0xffffffff and only mask them when
> subscripting. It ends up faster (usually) and you can use all of the
> elements of the buffer (rather than all-1) and you get nice things like:
>
> is_empty = (head == tail)
> is_full = (tail - head == size)
> nr_items_in_ring = (tail - head)
Ok, that makes sense. Thanks for explaining. Not sure if want to start
improving things right now, although I'm pretty sure the circ stuff
can't handle non-power-of-two buffer size currently so it should be
possible.
> > > All those uart_circ_*() macros reference their arg more than once and ...
> > > you know the deal.
> >
> > Yeah. Would you like a patch that inline-ifies <linux/circ.h>?
>
> uh, if you're feeling especially keen. We have bigger problems than this.
Well, if you put it like that; no, not really.
I'll post a fix for the other things you pointed out shortly.
Haavard
next prev parent reply other threads:[~2008-01-28 11:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-24 12:41 [PATCH -mm v4 0/9] atmel_serial cleanups and improvements Haavard Skinnemoen
2008-01-24 12:41 ` [PATCH -mm v4 1/9] MAINTAINERS: Add myself as maintainer of the atmel_serial driver Haavard Skinnemoen
2008-01-24 12:41 ` [PATCH -mm v4 2/9] atmel_serial: Clean up the code Haavard Skinnemoen
2008-01-24 12:41 ` [PATCH -mm v4 3/9] atmel_serial: Use cpu_relax() when busy-waiting Haavard Skinnemoen
2008-01-24 12:41 ` [PATCH -mm v4 4/9] atmel_serial: Use existing console options only if BRG is running Haavard Skinnemoen
2008-01-24 12:41 ` [PATCH -mm v4 5/9] atmel_serial: Fix bugs in probe() error path and remove() Haavard Skinnemoen
2008-01-24 12:41 ` [PATCH -mm v4 6/9] atmel_serial: Split the interrupt handler Haavard Skinnemoen
2008-01-24 12:41 ` [PATCH -mm v4 7/9] atmel_serial: Add DMA support Haavard Skinnemoen
2008-01-24 12:41 ` [PATCH -mm v4 8/9] atmel_serial: Use container_of instead of direct cast Haavard Skinnemoen
2008-01-24 12:41 ` [PATCH -mm v4 9/9] atmel_serial: Show tty name in /proc/interrupts Haavard Skinnemoen
2008-01-27 6:02 ` [PATCH -mm v4 7/9] atmel_serial: Add DMA support Andrew Morton
2008-01-28 9:59 ` Haavard Skinnemoen
2008-01-28 10:20 ` Andrew Morton
2008-01-28 11:41 ` Haavard Skinnemoen [this message]
2008-01-28 11:48 ` [PATCH -mm] atmel_serial dma: Misc fixes and cleanups Haavard Skinnemoen
2008-01-24 13:32 ` [PATCH -mm v4 0/9] atmel_serial cleanups and improvements Marc Pignat
2008-01-24 15:07 ` Haavard Skinnemoen
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=20080128124125.5c4e0a31@dhcp-252-066.norway.atmel.com \
--to=hskinnemoen@atmel.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=coldwell@redhat.com \
--cc=david-b@pacbell.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@bohmer.net \
--cc=linux@maxim.org.za \
--cc=marc.pignat@hevs.ch \
--subject='Re: [PATCH -mm v4 7/9] atmel_serial: Add DMA support' \
/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
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).