All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org
To: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 3/3] spi: bcm2835: add module parameter to configure minimum length for dma
Date: Sun, 24 Mar 2019 09:58:27 +0100	[thread overview]
Message-ID: <238F2E81-BC34-4652-89CE-C00E04C12378@martin.sperl.org> (raw)
In-Reply-To: <20190322123610.ndwxoivsprc643f5-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>


> On 22.03.2019, at 13:36, Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org> wrote:
> 
> On Sun, Feb 24, 2019 at 04:23:11PM +0000, kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org wrote:
>> +/* define dma min number of bytes to use in dma mode with value validation */
>> +static int dma_min_bytes_limit_set(const char *val,
>> +				   const struct kernel_param *kp)
>> +{
>> +	unsigned int v;
>> +
>> +	if (kstrtouint(val, 10, &v))
>> +		return -EINVAL;
>> +	/* value needs to be a multiple of 4 */
>> +	if (v % 4) {
>> +		pr_err("dma_min_bytes_limit needs to be a multiple of 4\n");
>> +		return -EINVAL;
>> +	}
> 
> Transfers don't need to be a multiple of 4 to be eligible for DMA,
> so this check can be dropped.

I definitely did not want to write a custom module argument parser
but if i remember correctly there is one limitation on the transmission path
where you would hit some inefficiencies in the DMA code when you run
transfers that are not a multiple of 4 - especially for short transfers.

That is why it was implemented.

But I can leave this precaution out.

Martin

WARNING: multiple messages have this Message-ID (diff)
From: kernel@martin.sperl.org
To: Lukas Wunner <lukas@wunner.de>
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
	linux-spi@vger.kernel.org, Eric Anholt <eric@anholt.net>,
	Mark Brown <broonie@kernel.org>,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/3] spi: bcm2835: add module parameter to configure minimum length for dma
Date: Sun, 24 Mar 2019 09:58:27 +0100	[thread overview]
Message-ID: <238F2E81-BC34-4652-89CE-C00E04C12378@martin.sperl.org> (raw)
In-Reply-To: <20190322123610.ndwxoivsprc643f5@wunner.de>


> On 22.03.2019, at 13:36, Lukas Wunner <lukas@wunner.de> wrote:
> 
> On Sun, Feb 24, 2019 at 04:23:11PM +0000, kernel@martin.sperl.org wrote:
>> +/* define dma min number of bytes to use in dma mode with value validation */
>> +static int dma_min_bytes_limit_set(const char *val,
>> +				   const struct kernel_param *kp)
>> +{
>> +	unsigned int v;
>> +
>> +	if (kstrtouint(val, 10, &v))
>> +		return -EINVAL;
>> +	/* value needs to be a multiple of 4 */
>> +	if (v % 4) {
>> +		pr_err("dma_min_bytes_limit needs to be a multiple of 4\n");
>> +		return -EINVAL;
>> +	}
> 
> Transfers don't need to be a multiple of 4 to be eligible for DMA,
> so this check can be dropped.

I definitely did not want to write a custom module argument parser
but if i remember correctly there is one limitation on the transmission path
where you would hit some inefficiencies in the DMA code when you run
transfers that are not a multiple of 4 - especially for short transfers.

That is why it was implemented.

But I can leave this precaution out.

Martin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-03-24  8:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-24 16:23 [PATCH 1/3] spi: bcm2835: add driver stats to debugfs kernel-TqfNSX0MhmxHKSADF0wUEw
2019-02-24 16:23 ` kernel
     [not found] ` <20190224162311.23899-1-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2019-02-24 16:23   ` [PATCH 2/3] spi: bcm2835: avoid 64 bit arithmetic and allow to configure polling limit kernel-TqfNSX0MhmxHKSADF0wUEw
2019-02-24 16:23     ` kernel
2019-02-24 16:23   ` [PATCH 3/3] spi: bcm2835: add module parameter to configure minimum length for dma kernel-TqfNSX0MhmxHKSADF0wUEw
2019-02-24 16:23     ` kernel
     [not found]     ` <20190224162311.23899-3-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2019-02-24 19:10       ` Stefan Wahren
2019-02-24 19:10         ` Stefan Wahren
2019-03-24  8:52         ` kernel
2019-03-24  8:52           ` kernel
     [not found]           ` <20190324101552.brc7ojrfrsgyr77d@wunner.de>
2019-03-24 11:23             ` kernel
     [not found]     ` <20190322123610.ndwxoivsprc643f5@wunner.de>
     [not found]       ` <20190322123610.ndwxoivsprc643f5-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2019-03-24  8:58         ` kernel-TqfNSX0MhmxHKSADF0wUEw [this message]
2019-03-24  8:58           ` kernel

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=238F2E81-BC34-4652-89CE-C00E04C12378@martin.sperl.org \
    --to=kernel-tqfnsx0mhmxhksadf0wuew@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lukas-JFq808J9C/izQB+pC5nmwQ@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.