linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rockchip spi: dma engine use buggy
@ 2014-12-01 13:26 Russell King - ARM Linux
  0 siblings, 0 replies; only message in thread
From: Russell King - ARM Linux @ 2014-12-01 13:26 UTC (permalink / raw)
  To: addy ke; +Cc: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA

While looking at a warning which came up in my nightly builds, I spotted
this:

+               rxconf.src_addr_width = rs->n_bytes;
+               rxconf.src_maxburst = rs->n_bytes;

+               txconf.dst_addr_width = rs->n_bytes;
+               txconf.dst_maxburst = rs->n_bytes;

which is incorrect.  The documentation for the maxburst fields says:

 * @src_maxburst: the maximum number of words (note: words, as in
 * units of the src_addr_width member, not bytes) that can be sent
 * in one burst to the device. Typically something like half the
 * FIFO depth on I/O peripherals so you don't overflow it. This
 * may or may not be applicable on memory sources.
 * @dst_maxburst: same as src_maxburst but for destination target
 * mutatis mutandis.

In other words, if n_bytes is:

- one, we tell the DMA engine that it can burst one byte.
- two, we tell the DMA engine that it can burst _two_ 16-bit words,
  in other words, four bytes.
- four, we tell the DMA engine that it can burst _four_ 32-bit words,
  in other words, 16 bytes.

Somehow, I don't think that's correct.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-12-01 13:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-01 13:26 rockchip spi: dma engine use buggy Russell King - ARM Linux

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).