[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7fdf804a29d05bcfe57200de0f1fe049bdb91016.camel@intel.com>
Date: Sun, 17 Jul 2022 18:49:12 +0000
From: "Vivi, Rodrigo" <rodrigo.vivi@...el.com>
To: "linux@...ck-us.net" <linux@...ck-us.net>,
"jani.nikula@...ux.intel.com" <jani.nikula@...ux.intel.com>
CC: "Das, Nirmoy" <nirmoy.das@...el.com>,
"airlied@...ux.ie" <airlied@...ux.ie>,
"intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>,
"joonas.lahtinen@...ux.intel.com" <joonas.lahtinen@...ux.intel.com>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"Auld, Matthew" <matthew.auld@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"tvrtko.ursulin@...ux.intel.com" <tvrtko.ursulin@...ux.intel.com>,
"daniel@...ll.ch" <daniel@...ll.ch>
Subject: Re: [PATCH] drm/i915: Fix 32-bit build
On Sun, 2022-07-17 at 09:20 -0700, Guenter Roeck wrote:
> Commit aff1e0b09b54 ("drm/i915/ttm: fix sg_table construction")
> introduces
> an additional parameter to i915_rsgt_from_mm_node(). The parameter is
> used
> to calculate segment_pages. This in turn is used in DIV_ROUND_UP() as
> divisor. So far segment_pages was a constant and handled without
> divide
> operation. Since it is no longer constant, a divide operation is now
> necessary. This results in build errors on 32-bit builds.
>
> x86_64-linux-ld: drivers/gpu/drm/i915/i915_scatterlist.o:
> in function `i915_rsgt_from_mm_node':
> i915_scatterlist.c:(.text+0x196): undefined reference to `__udivdi3'
>
> Fix the problem by using DIV_ROUND_UP_ULL() instead of
> DIV_ROUND_UP().
>
> Fixes: aff1e0b09b54 ("drm/i915/ttm: fix sg_table construction")
> Cc: Matthew Auld <matthew.auld@...el.com>
> Cc: Nirmoy Das <nirmoy.das@...el.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@...el.com>
> Signed-off-by: Guenter Roeck <linux@...ck-us.net>
> ---
> I took a stab at the problem. Please ignore the noise if it has
> already
> been fixed with a different patch.
Thanks for your patch.
This was actually fixed already in our -next branches, but missed
on the fixes:
https://patchwork.freedesktop.org/patch/493637/?series=106260&rev=1
Thanks,
Rodrigo.
>
> drivers/gpu/drm/i915/i915_scatterlist.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_scatterlist.c
> b/drivers/gpu/drm/i915/i915_scatterlist.c
> index f63b50b71e10..b81d5658c222 100644
> --- a/drivers/gpu/drm/i915/i915_scatterlist.c
> +++ b/drivers/gpu/drm/i915/i915_scatterlist.c
> @@ -96,7 +96,7 @@ struct i915_refct_sgt *i915_rsgt_from_mm_node(const
> struct drm_mm_node *node,
>
> i915_refct_sgt_init(rsgt, node->size << PAGE_SHIFT);
> st = &rsgt->table;
> - if (sg_alloc_table(st, DIV_ROUND_UP(node->size,
> segment_pages),
> + if (sg_alloc_table(st, DIV_ROUND_UP_ULL(node->size,
> segment_pages),
> GFP_KERNEL)) {
> i915_refct_sgt_put(rsgt);
> return ERR_PTR(-ENOMEM);
Powered by blists - more mailing lists