From: niclas.karlsson@enea.se (Niclas Karlsson)
To: linux-arm-kernel@lists.infradead.org
Subject: Getting a lot of zero values from a driver using DMA. D-cache is not updated?
Date: Wed, 27 Apr 2011 18:27:39 +0200 [thread overview]
Message-ID: <1303921659.19857.141.camel@SESTOWS194> (raw)
Hi!
I'm running linux on a custom made harware based on AT91SAM9263-ek
(evaluation board from Atmel). A touchcontroller (ads7846) is connected
to the SPI bus. When I read data
(cat /sys/bus/spi/devices/spi0.1/in0_input or in1_input) from the two
extra AD-channels in the ads7846 chip I get a zero value very often. The
ads7846 driver uses the atmel_spi driver. The ads7846 driver allocates
memory with kzalloc(). the atmel_spi then uses dma_map_single() before
starting the transfer with PDC (Peripheral Dma Controller). When the
transfer has finished, an interrupt is fired from the SPI.
dma_unmap_single() is then called and the value from the ADC should be
in the allocated buffer, but it's not. The buffer is still zero. If I
add a delay (like printk("wait\n")) the value from the ADC can be read
in the buffer. How do I fix this? Could it be that the d-cache is not
updated with the new value which is written by the PDC? If so, how do I
update the cache with the value the PDC just wrote to RAM?
Best regard
Niclas
next reply other threads:[~2011-04-27 16:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-27 16:27 Niclas Karlsson [this message]
2011-04-28 16:45 ` Getting a lot of zero values from a driver using DMA. D-cache is not updated? Russell King - ARM Linux
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=1303921659.19857.141.camel@SESTOWS194 \
--to=niclas.karlsson@enea.se \
--cc=linux-arm-kernel@lists.infradead.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