linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: add PrimeCell generic DMA to MMCI/PL180 v10
Date: Thu, 12 Aug 2010 15:30:02 +0100	[thread overview]
Message-ID: <20100812143002.GA31982@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <AANLkTimriY-NerBUBeuPf_qX_01iZvntH3TMVdkn7wJv@mail.gmail.com>

On Thu, Aug 12, 2010 at 03:58:08PM +0200, Linus Walleij wrote:
> 2010/8/11 Rabin Vincent <rabin@rab.in>:
> >> + ? ? sglen = dma_map_sg(mmc_dev(host->mmc), data->sg,
> >> + ? ? ? ? ? ? ? ? ? ? ? ?data->sg_len, direction);
> >> + ? ? if (sglen != data->sg_len)
> >> + ? ? ? ? ? ? goto unmap_exit;
> >
> > sglen < data->sg_len is not an error condition.
> 
> In arch/arm/mm/dma-mapping.c
> dma_map_sg() returns 0 on a mapping error, and the same as
> passed in the third parameter on success.

Rabin is right - dma_map_sg() is allowed to return fewer entries than
was passed as it is allowed to coalesce entries together.  Please don't
use the implementation as a source of how things should behave, instead
read the documentation in Documentation/DMA-API.txt:

        int
        dma_map_sg(struct device *dev, struct scatterlist *sg,
                int nents, enum dma_data_direction direction)

Returns: the number of physical segments mapped (this may be shorter
than <nents> passed in if some elements of the scatter/gather list are
physically or virtually adjacent and an IOMMU maps them with a single
entry).

  reply	other threads:[~2010-08-12 14:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10 15:32 [PATCH] ARM: add PrimeCell generic DMA to MMCI/PL180 v10 Linus Walleij
2010-08-11 14:48 ` Rabin Vincent
2010-08-12 13:58   ` Linus Walleij
2010-08-12 14:30     ` Russell King - ARM Linux [this message]
2010-08-12 15:58       ` Linus Walleij

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=20100812143002.GA31982@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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;
as well as URLs for NNTP newsgroup(s).