From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Yuan Yao <yao.yuan@freescale.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org,
linux-serial@vger.kernel.org
Subject: Re: [PATCH] the eDMA support for the LPUART send driver
Date: Sun, 5 Jan 2014 14:50:32 +0000 [thread overview]
Message-ID: <20140105145031.GB27432@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <201401051544.50036.arnd@arndb.de>
On Sun, Jan 05, 2014 at 03:44:49PM +0100, Arnd Bergmann wrote:
> On Friday 27 December 2013, Yuan Yao wrote:
> > + dma_phys = dma_map_single(sport->port.dev,
> > + sport->port.state->xmit.buf,
> > + UART_XMIT_SIZE, DMA_TO_DEVICE);
>
> This is wrong: Since the dma is performed by the dma engine rather
> than the uart, the first argument here needs to be the dma device
> pointer. In fact, dma_map_single is normally supposed to fail on
> the uart device as the dma_mask value should be zero. Not sure
> why this worked.
>
> > + if (!dma_phys) {
> > + dev_err(sport->port.dev, "Dma_phys single failed\n");
> > + return -ENOMEM;
> > + }
>
> Please also change all references to "phys" -- it's not a phys
> address but a bus address. These are often the same, but that's
> not for the driver to know.
This is also not how you test for failure of dma_map_single(). I
recommend reading the documentation for the APIs you're trying to
use... Hint: dma_mapping_error().
--
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up. Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".
next prev parent reply other threads:[~2014-01-05 14:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-27 11:24 [PATCH] the eDMA support for the LPUART send driver Yuan Yao
2014-01-05 14:44 ` Arnd Bergmann
2014-01-05 14:50 ` Russell King - ARM Linux [this message]
2014-01-07 6:32 ` Yao Yuan
2014-01-07 8:53 ` Arnd Bergmann
2014-01-07 9:49 ` Yao Yuan
2014-01-06 5:37 ` Shawn Guo
2014-01-07 9:44 ` Yao Yuan
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=20140105145031.GB27432@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-serial@vger.kernel.org \
--cc=yao.yuan@freescale.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