From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>,
Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald <pmeerw@pmeerw.net>
Cc: Octavian Purdila <octavian.purdila@intel.com>, linux-iio@vger.kernel.org
Subject: Re: [PATCH v3 1/6] iio: Set device watermark based on watermark of all attached buffers
Date: Sun, 25 Oct 2015 13:42:44 +0000 [thread overview]
Message-ID: <562CDC54.6060305@kernel.org> (raw)
In-Reply-To: <1444752629-3532-2-git-send-email-lars@metafoo.de>
On 13/10/15 17:10, Lars-Peter Clausen wrote:
> Currently the watermark of the device is only set based on the watermark
> that is set for the user space buffer. This doesn't consider the watermarks
> set on any attached in-kernel buffers.
>
> Change this so that the watermark of the device should be the minimum of
> the watermarks over all attached buffers.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied to the togreg branch of iio.git - initially pushed out as testing.
These have missed the coming merge window, but in someways I'm happier having
these have a very long bake in linux-next (and hopefully some user get added
before they mainline!)
Jonathan
> ---
> drivers/iio/industrialio-buffer.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index d7e908a..7340922 100644
> --- a/drivers/iio/industrialio-buffer.c
> +++ b/drivers/iio/industrialio-buffer.c
> @@ -610,6 +610,7 @@ static void iio_free_scan_mask(struct iio_dev *indio_dev,
>
> struct iio_device_config {
> unsigned int mode;
> + unsigned int watermark;
> const unsigned long *scan_mask;
> unsigned int scan_bytes;
> bool scan_timestamp;
> @@ -642,10 +643,14 @@ static int iio_verify_update(struct iio_dev *indio_dev,
> if (buffer == remove_buffer)
> continue;
> modes &= buffer->access->modes;
> + config->watermark = min(config->watermark, buffer->watermark);
> }
>
> - if (insert_buffer)
> + if (insert_buffer) {
> modes &= insert_buffer->access->modes;
> + config->watermark = min(config->watermark,
> + insert_buffer->watermark);
> + }
>
> /* Definitely possible for devices to support both of these. */
> if ((modes & INDIO_BUFFER_TRIGGERED) && indio_dev->trig) {
> @@ -743,6 +748,10 @@ static int iio_enable_buffers(struct iio_dev *indio_dev,
> }
> }
>
> + if (indio_dev->info->hwfifo_set_watermark)
> + indio_dev->info->hwfifo_set_watermark(indio_dev,
> + config->watermark);
> +
> indio_dev->currentmode = config->mode;
>
> if (indio_dev->setup_ops->postenable) {
> @@ -974,9 +983,6 @@ static ssize_t iio_buffer_store_watermark(struct device *dev,
> }
>
> buffer->watermark = val;
> -
> - if (indio_dev->info->hwfifo_set_watermark)
> - indio_dev->info->hwfifo_set_watermark(indio_dev, val);
> out:
> mutex_unlock(&indio_dev->mlock);
>
>
next prev parent reply other threads:[~2015-10-25 13:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-13 16:10 [PATCH v3 0/6] iio: Add DMA buffer support Lars-Peter Clausen
2015-10-13 16:10 ` [PATCH v3 1/6] iio: Set device watermark based on watermark of all attached buffers Lars-Peter Clausen
2015-10-25 13:42 ` Jonathan Cameron [this message]
2015-10-13 16:10 ` [PATCH v3 2/6] iio:iio_buffer_init(): Only set watermark if not already set Lars-Peter Clausen
2015-10-25 13:50 ` Jonathan Cameron
2015-10-13 16:10 ` [PATCH v3 3/6] iio: Add support for indicating fixed watermarks Lars-Peter Clausen
2015-10-25 13:51 ` Jonathan Cameron
2015-10-13 16:10 ` [PATCH v3 4/6] iio: Add buffer enable/disable callbacks Lars-Peter Clausen
2015-10-25 13:52 ` Jonathan Cameron
2015-10-13 16:10 ` [PATCH v3 5/6] iio: Add generic DMA buffer infrastructure Lars-Peter Clausen
2015-10-25 13:55 ` Jonathan Cameron
2015-10-13 16:10 ` [PATCH v3 6/6] iio: Add a DMAengine framework based buffer Lars-Peter Clausen
2015-10-25 13:56 ` Jonathan Cameron
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=562CDC54.6060305@kernel.org \
--to=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=octavian.purdila@intel.com \
--cc=pmeerw@pmeerw.net \
/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).