From: Daniel Vetter <daniel@ffwll.ch>
To: Michel Thierry <michel.thierry@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
Dan Carpenter <dan.carpenter@oracle.com>,
Mika Kuoppala <mika.kuoppala@intel.com>
Subject: Re: [PATCH v2] drm/i915: Fix i915_dma_map_single positive error code
Date: Tue, 24 Mar 2015 17:54:09 +0100 [thread overview]
Message-ID: <20150324165409.GO1349@phenom.ffwll.local> (raw)
In-Reply-To: <1427215478-8943-1-git-send-email-michel.thierry@intel.com>
On Tue, Mar 24, 2015 at 04:44:38PM +0000, Michel Thierry wrote:
> i915_dma_map_single relies on dma_mapping_error, which returns positive
> error codes. Found by static checker.
>
> Introduced by commit 678d96fbb3b5995a2fdff2bca5e1ab4a40b7e968
> ("drm/i915: Track GEN6 page table usage").
>
> v2: Return negative error code and rename commit title. (Dan)
>
> Cc: Dan Carpenter <dan.carpenter@oracle.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Still missing the reported-by. Giving credit where it's due is important,
especially when they work for other companies than Intel.
-Daniel
> Signed-off-by: Michel Thierry <michel.thierry@intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem_gtt.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 645c363..6bb31c8 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -311,7 +311,10 @@ static inline int i915_dma_map_page_single(struct page *page,
> struct device *device = &dev->pdev->dev;
>
> *daddr = dma_map_page(device, page, 0, 4096, PCI_DMA_BIDIRECTIONAL);
> - return dma_mapping_error(device, *daddr);
> + if (dma_mapping_error(device, *daddr))
> + return -ENOMEM;
> +
> + return 0;
> }
>
> static void unmap_and_free_pt(struct i915_page_table_entry *pt,
> --
> 2.1.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-03-24 16:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-24 15:46 [PATCH 0/5] Finish gen6/7 ppgtt dynamic page allocations Michel Thierry
2015-03-24 15:46 ` [PATCH 1/5] drm/i915: Prevent out of range pt in gen6_for_each_pde Michel Thierry
2015-03-24 15:46 ` [PATCH 2/5] drm/i915: i915_dma_map_single returns positive error codes Michel Thierry
2015-03-24 15:57 ` Dan Carpenter
2015-03-24 16:03 ` Dan Carpenter
2015-03-24 16:22 ` Michel Thierry
2015-03-24 16:44 ` [PATCH v2] drm/i915: Fix i915_dma_map_single positive error code Michel Thierry
2015-03-24 16:54 ` Daniel Vetter [this message]
2015-03-24 21:11 ` shuang.he
2015-03-24 17:06 ` [PATCH v3] " Michel Thierry
2015-03-24 21:10 ` shuang.he
2015-03-24 15:46 ` [PATCH 3/5] drm/i915: Remove unnecessary gen6_ppgtt_unmap_pages Michel Thierry
2015-03-24 15:46 ` [PATCH 4/5] drm/i915: Finish gen6/7 dynamic page table allocation Michel Thierry
2015-03-24 15:46 ` [PATCH 5/5] drm/i915: Add dynamic page trace events Michel Thierry
2015-03-24 19:03 ` shuang.he
2015-03-26 15:43 ` [PATCH 0/5] Finish gen6/7 ppgtt dynamic page allocations Mika Kuoppala
2015-03-27 8:26 ` Daniel Vetter
2015-03-27 15:01 ` Mika Kuoppala
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=20150324165409.GO1349@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=dan.carpenter@oracle.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=michel.thierry@intel.com \
--cc=mika.kuoppala@intel.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