public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rogier Wolff <R.E.Wolff@bitwizard.nl>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Martin Sperl <martin@sperl.org>,
	dmaengine@vger.kernel.org, vinod.koul@intel.com,
	linux-kernel@vger.kernel.org, jonathan@raspberrypi.org,
	linux-rpi-kernel@lists.infradead.org, dan.j.williams@intel.com
Subject: Re: [PATCH] dmaengine: bcm2835: Add slave dma support
Date: Thu, 16 Apr 2015 08:30:56 +0200	[thread overview]
Message-ID: <20150416063055.GH23239@bitwizard.nl> (raw)
In-Reply-To: <552EB393.4050609@tronnes.org>

On Wed, Apr 15, 2015 at 08:53:07PM +0200, Noralf Trønnes wrote:

> A 16-bit register can't hold a value of 65536.
> Either the max value is 65535 or the register is 17-bits wide.

It is common for hardware registers to have the value "0" mean 65536
in case of a 16-bit register.

The hardware would then FIRST decrement the register and THEN check
for zero. This results in the behaviour that "1" requires one cycle to
complete, "10" requires ten cycles, and "0" means the same as the
total number of bitpatterns possible in the register. (256 for an
8-bit register, 65536 for a 16-bit register).

Another way to implement such a register in hardware would "check for
zero" first, and not do antyhing if the register equals zero. This
results in differnet behaviour for the "0" value.

That said: IMHO, the overhead of setting up 2 transfers for each 64k
block as opposed to only one results in such a small performance
penalty that I'd prefer to play it safe unless you're very sure you
can adequately test it. (Another option would be to set the maximum
transfer size to 0xf000: 60kbytes. Less than 10% extra transfers in 
the long run than when aiming for the edge...)

	Roger. 

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 **
**    Delftechpark 26 2628 XH  Delft, The Netherlands. KVK: 27239233    **
*-- BitWizard writes Linux device drivers for any device you may have! --*
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

  reply	other threads:[~2015-04-16  6:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-15  9:56 [PATCH] dmaengine: bcm2835: Add slave dma support Noralf Trønnes
2015-04-15 14:37 ` Martin Sperl
2015-04-15 18:53   ` Noralf Trønnes
2015-04-16  6:30     ` Rogier Wolff [this message]
2015-04-16 17:28       ` Noralf Trønnes
2015-04-15 19:00 ` Stefan Wahren
2015-04-16 19:06   ` Alexander Stein
2015-04-16 22:03     ` Noralf Trønnes
2015-04-16 22:09   ` Noralf Trønnes
2015-04-17 17:08     ` Stefan Wahren
2015-04-17 17:19       ` Martin Sperl
2015-04-17 17:20       ` Noralf Trønnes

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=20150416063055.GH23239@bitwizard.nl \
    --to=r.e.wolff@bitwizard.nl \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=jonathan@raspberrypi.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=martin@sperl.org \
    --cc=noralf@tronnes.org \
    --cc=vinod.koul@intel.com \
    /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