From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Roman Tereshonkov
<roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH 1/2] spi: Add support for dma_min_bytes configuration.
Date: Thu, 8 Apr 2010 00:26:54 -0600 [thread overview]
Message-ID: <z2rfa686aa41004072326z5ff8c044l46330b85dfd7ae74@mail.gmail.com> (raw)
In-Reply-To: <1270550389-30392-1-git-send-email-roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
Hi Roman,
On Tue, Apr 6, 2010 at 4:39 AM, Roman Tereshonkov
<roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org> wrote:
> This parameters defines the minimum number of bytes when dma is used.
>
> Signed-off-by: Roman Tereshonkov <roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
The intent of this feature is... ? Your patch needs a better
description as to why it is needed; especially considering that it
changes common code.
But, inferring from the code that is written, I can guess what you're
trying to do, if not why. Why would spi_devices care what the minimum
size of a DMA transfer is? The SPI bus driver is in a far better
position to make that determination.
Also, since this essentially adds a new 'knob' for spi_devices to
twiddle, what is the expected behaviour for SPI bus controllers that
don't support it? Is it a required feature for spi bus drivers to
implement if they support DMA?
Cheers,
g.
> ---
> drivers/spi/spi.c | 1 +
> include/linux/spi/spi.h | 3 +++
> 2 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index b76f246..5bf7992 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -347,6 +347,7 @@ struct spi_device *spi_new_device(struct spi_master *master,
> proxy->max_speed_hz = chip->max_speed_hz;
> proxy->mode = chip->mode;
> proxy->irq = chip->irq;
> + proxy->dma_min_bytes = chip->dma_min_bytes;
> strlcpy(proxy->modalias, chip->modalias, sizeof(proxy->modalias));
> proxy->dev.platform_data = (void *) chip->platform_data;
> proxy->controller_data = chip->controller_data;
> diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
> index 97b60b3..4e9961d 100644
> --- a/include/linux/spi/spi.h
> +++ b/include/linux/spi/spi.h
> @@ -84,6 +84,7 @@ struct spi_device {
> #define SPI_NO_CS 0x40 /* 1 dev/bus, no chipselect */
> #define SPI_READY 0x80 /* slave pulls low to pause */
> u8 bits_per_word;
> + int dma_min_bytes;
> int irq;
> void *controller_state;
> void *controller_data;
> @@ -727,6 +728,8 @@ struct spi_board_info {
> */
> u8 mode;
>
> + /* dma_min_bytes defines minimum bytes when dma is used */
> + u32 dma_min_bytes;
> /* ... may need additional spi_device chip config data here.
> * avoid stuff protocol drivers can set; but include stuff
> * needed to behave without being bound to a driver:
> --
> 1.6.2.rc1.3.g81d3f
>
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
next prev parent reply other threads:[~2010-04-08 6:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-06 10:39 [PATCH 1/2] spi: Add support for dma_min_bytes configuration Roman Tereshonkov
[not found] ` <1270550389-30392-1-git-send-email-roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2010-04-06 10:39 ` [PATCH 2/2] omap2_mcspi: Use dma_min_bytes parameter when it is configured Roman Tereshonkov
2010-04-08 6:26 ` Grant Likely [this message]
[not found] ` <z2rfa686aa41004072326z5ff8c044l46330b85dfd7ae74-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-08 10:33 ` [PATCH 1/2] spi: Add support for dma_min_bytes configuration roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w
[not found] ` <E1C7579D1379824DAE67858071C8103828208BC339-xJW1crHCIS+8kqYwC468Frtp2NbXvJi8gfoxzgwHRXE@public.gmane.org>
2010-04-08 15:08 ` Grant Likely
[not found] ` <s2vfa686aa41004080808o443dd6b7ge4d23c513a1f80a8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-08 15:25 ` roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w
[not found] ` <E1C7579D1379824DAE67858071C8103828208BC539-xJW1crHCIS+8kqYwC468Frtp2NbXvJi8gfoxzgwHRXE@public.gmane.org>
2010-04-08 16:27 ` Grant Likely
2010-04-09 4:05 ` Juuso Oikarinen
[not found] ` <1270785939.10120.1141.camel-gZysiALljqf+W+uuys5jPoH6Mc4MB0Vx@public.gmane.org>
2010-04-09 4:56 ` Grant Likely
2010-04-09 7:49 ` roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w
[not found] ` <E1C7579D1379824DAE67858071C8103828208BC90A-xJW1crHCIS+8kqYwC468Frtp2NbXvJi8gfoxzgwHRXE@public.gmane.org>
2010-04-09 7:52 ` Juuso Oikarinen
[not found] ` <1270799541.10120.1146.camel-gZysiALljqf+W+uuys5jPoH6Mc4MB0Vx@public.gmane.org>
2010-04-09 8:38 ` roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w
[not found] ` <E1C7579D1379824DAE67858071C8103828208BC96F-xJW1crHCIS+8kqYwC468Frtp2NbXvJi8gfoxzgwHRXE@public.gmane.org>
2010-04-09 14:52 ` Grant Likely
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=z2rfa686aa41004072326z5ff8c044l46330b85dfd7ae74@mail.gmail.com \
--to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
--cc=roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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).