From: Ben Skeggs <skeggsb@gmail.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
David Airlie <airlied@linux.ie>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/nouveau: use post-decrement in error handling
Date: Fri, 19 Feb 2016 13:32:55 +1000 [thread overview]
Message-ID: <56C68CE7.30104@gmail.com> (raw)
In-Reply-To: <1455561708-32390-3-git-send-email-linux@rasmusvillemoes.dk>
[-- Attachment #1: Type: text/plain, Size: 1003 bytes --]
On 02/16/2016 04:41 AM, Rasmus Villemoes wrote:
> We need to use post-decrement to get the dma_map_page undone also for
> i==0, and to avoid some very unpleasant behaviour if dma_map_page
> failed already at i==0.
>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
> ---
> drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
> index 78f520d05de9..e3acc35e3805 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> @@ -1520,7 +1520,7 @@ nouveau_ttm_tt_populate(struct ttm_tt *ttm)
> DMA_BIDIRECTIONAL);
>
> if (dma_mapping_error(pdev, addr)) {
> - while (--i) {
> + while (i--) {
> dma_unmap_page(pdev, ttm_dma->dma_address[i],
> PAGE_SIZE, DMA_BIDIRECTIONAL);
> ttm_dma->dma_address[i] = 0;
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-02-19 3:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-15 18:41 [PATCH 0/3] drm: more pre-decrement fixes Rasmus Villemoes
2016-02-15 18:41 ` [PATCH 1/3] drm/amdgpu: use post-decrement in error handling Rasmus Villemoes
2016-02-15 18:41 ` [PATCH 2/3] drm/nouveau: " Rasmus Villemoes
2016-02-19 3:32 ` Ben Skeggs [this message]
2016-02-15 18:41 ` [PATCH 3/3] drm/radeon: " Rasmus Villemoes
2016-02-16 8:21 ` [PATCH 0/3] drm: more pre-decrement fixes Christian König
2016-02-16 15:06 ` Alex Deucher
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=56C68CE7.30104@gmail.com \
--to=skeggsb@gmail.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
/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).