linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Fix 32-bit divide error in wait_for_alt_mode
@ 2019-08-20 23:57 Nathan Chancellor
  2019-08-21  3:44 ` Randy Dunlap
  2019-08-21 16:40 ` Harry Wentland
  0 siblings, 2 replies; 4+ messages in thread
From: Nathan Chancellor @ 2019-08-20 23:57 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Alex Deucher, Christian König,
	David (ChunMing) Zhou
  Cc: amd-gfx, dri-devel, linux-kernel, Nathan Chancellor, Randy Dunlap

When building arm32 allyesconfig:

ld.lld: error: undefined symbol: __aeabi_uldivmod
>>> referenced by dc_link.c
>>> gpu/drm/amd/display/dc/core/dc_link.o:(wait_for_alt_mode) in archive drivers/built-in.a
>>> referenced by dc_link.c
>>> gpu/drm/amd/display/dc/core/dc_link.o:(wait_for_alt_mode) in archive drivers/built-in.a

time_taken_in_ns is of type unsigned long long so we need to use div_u64
to avoid this error.

Fixes: b5b1f4554904 ("drm/amd/display: Enable type C hotplug")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index f2d78d7b089e..8634923b4444 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -721,7 +721,7 @@ bool wait_for_alt_mode(struct dc_link *link)
 			time_taken_in_ns = dm_get_elapse_time_in_ns(
 				link->ctx, finish_timestamp, enter_timestamp);
 			DC_LOG_WARNING("Alt mode entered finished after %llu ms\n",
-				       time_taken_in_ns / 1000000);
+				       div_u64(time_taken_in_ns, 1000000));
 			return true;
 		}
 
@@ -730,7 +730,7 @@ bool wait_for_alt_mode(struct dc_link *link)
 	time_taken_in_ns = dm_get_elapse_time_in_ns(link->ctx, finish_timestamp,
 						    enter_timestamp);
 	DC_LOG_WARNING("Alt mode has timed out after %llu ms\n",
-			time_taken_in_ns / 1000000);
+			div_u64(time_taken_in_ns, 1000000));
 	return false;
 }
 
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: Fix 32-bit divide error in wait_for_alt_mode
  2019-08-20 23:57 [PATCH] drm/amd/display: Fix 32-bit divide error in wait_for_alt_mode Nathan Chancellor
@ 2019-08-21  3:44 ` Randy Dunlap
  2019-08-21 16:40 ` Harry Wentland
  1 sibling, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2019-08-21  3:44 UTC (permalink / raw)
  To: Nathan Chancellor, Harry Wentland, Leo Li, Alex Deucher,
	Christian König, David (ChunMing) Zhou
  Cc: amd-gfx, dri-devel, linux-kernel

On 8/20/19 4:57 PM, Nathan Chancellor wrote:
> When building arm32 allyesconfig:
> 
> ld.lld: error: undefined symbol: __aeabi_uldivmod
>>>> referenced by dc_link.c
>>>> gpu/drm/amd/display/dc/core/dc_link.o:(wait_for_alt_mode) in archive drivers/built-in.a
>>>> referenced by dc_link.c
>>>> gpu/drm/amd/display/dc/core/dc_link.o:(wait_for_alt_mode) in archive drivers/built-in.a
> 
> time_taken_in_ns is of type unsigned long long so we need to use div_u64
> to avoid this error.
> 
> Fixes: b5b1f4554904 ("drm/amd/display: Enable type C hotplug")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

Thanks.

> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> index f2d78d7b089e..8634923b4444 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> @@ -721,7 +721,7 @@ bool wait_for_alt_mode(struct dc_link *link)
>  			time_taken_in_ns = dm_get_elapse_time_in_ns(
>  				link->ctx, finish_timestamp, enter_timestamp);
>  			DC_LOG_WARNING("Alt mode entered finished after %llu ms\n",
> -				       time_taken_in_ns / 1000000);
> +				       div_u64(time_taken_in_ns, 1000000));
>  			return true;
>  		}
>  
> @@ -730,7 +730,7 @@ bool wait_for_alt_mode(struct dc_link *link)
>  	time_taken_in_ns = dm_get_elapse_time_in_ns(link->ctx, finish_timestamp,
>  						    enter_timestamp);
>  	DC_LOG_WARNING("Alt mode has timed out after %llu ms\n",
> -			time_taken_in_ns / 1000000);
> +			div_u64(time_taken_in_ns, 1000000));
>  	return false;
>  }
>  
> 


-- 
~Randy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: Fix 32-bit divide error in wait_for_alt_mode
  2019-08-20 23:57 [PATCH] drm/amd/display: Fix 32-bit divide error in wait_for_alt_mode Nathan Chancellor
  2019-08-21  3:44 ` Randy Dunlap
@ 2019-08-21 16:40 ` Harry Wentland
  2019-08-22  2:12   ` Alex Deucher
  1 sibling, 1 reply; 4+ messages in thread
From: Harry Wentland @ 2019-08-21 16:40 UTC (permalink / raw)
  To: Nathan Chancellor, Wentland, Harry, Li, Sun peng (Leo),
	Deucher, Alexander, Koenig, Christian, Zhou, David(ChunMing)
  Cc: amd-gfx, dri-devel, linux-kernel, Randy Dunlap

On 2019-08-20 7:57 p.m., Nathan Chancellor wrote:
> When building arm32 allyesconfig:
> 
> ld.lld: error: undefined symbol: __aeabi_uldivmod
>>>> referenced by dc_link.c
>>>> gpu/drm/amd/display/dc/core/dc_link.o:(wait_for_alt_mode) in archive drivers/built-in.a
>>>> referenced by dc_link.c
>>>> gpu/drm/amd/display/dc/core/dc_link.o:(wait_for_alt_mode) in archive drivers/built-in.a
> 
> time_taken_in_ns is of type unsigned long long so we need to use div_u64
> to avoid this error.
> 
> Fixes: b5b1f4554904 ("drm/amd/display: Enable type C hotplug")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> index f2d78d7b089e..8634923b4444 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> @@ -721,7 +721,7 @@ bool wait_for_alt_mode(struct dc_link *link)
>  			time_taken_in_ns = dm_get_elapse_time_in_ns(
>  				link->ctx, finish_timestamp, enter_timestamp);
>  			DC_LOG_WARNING("Alt mode entered finished after %llu ms\n",
> -				       time_taken_in_ns / 1000000);
> +				       div_u64(time_taken_in_ns, 1000000));
>  			return true;
>  		}
>  
> @@ -730,7 +730,7 @@ bool wait_for_alt_mode(struct dc_link *link)
>  	time_taken_in_ns = dm_get_elapse_time_in_ns(link->ctx, finish_timestamp,
>  						    enter_timestamp);
>  	DC_LOG_WARNING("Alt mode has timed out after %llu ms\n",
> -			time_taken_in_ns / 1000000);
> +			div_u64(time_taken_in_ns, 1000000));
>  	return false;
>  }
>  
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: Fix 32-bit divide error in wait_for_alt_mode
  2019-08-21 16:40 ` Harry Wentland
@ 2019-08-22  2:12   ` Alex Deucher
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2019-08-22  2:12 UTC (permalink / raw)
  To: Harry Wentland
  Cc: Nathan Chancellor, Wentland, Harry, Li, Sun peng (Leo),
	Deucher, Alexander, Koenig, Christian, Zhou, David(ChunMing),
	Randy Dunlap, dri-devel, amd-gfx, linux-kernel

Applied.  thanks!

Alex

On Wed, Aug 21, 2019 at 12:40 PM Harry Wentland <hwentlan@amd.com> wrote:
>
> On 2019-08-20 7:57 p.m., Nathan Chancellor wrote:
> > When building arm32 allyesconfig:
> >
> > ld.lld: error: undefined symbol: __aeabi_uldivmod
> >>>> referenced by dc_link.c
> >>>> gpu/drm/amd/display/dc/core/dc_link.o:(wait_for_alt_mode) in archive drivers/built-in.a
> >>>> referenced by dc_link.c
> >>>> gpu/drm/amd/display/dc/core/dc_link.o:(wait_for_alt_mode) in archive drivers/built-in.a
> >
> > time_taken_in_ns is of type unsigned long long so we need to use div_u64
> > to avoid this error.
> >
> > Fixes: b5b1f4554904 ("drm/amd/display: Enable type C hotplug")
> > Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
>
> > ---
> >  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > index f2d78d7b089e..8634923b4444 100644
> > --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > @@ -721,7 +721,7 @@ bool wait_for_alt_mode(struct dc_link *link)
> >                       time_taken_in_ns = dm_get_elapse_time_in_ns(
> >                               link->ctx, finish_timestamp, enter_timestamp);
> >                       DC_LOG_WARNING("Alt mode entered finished after %llu ms\n",
> > -                                    time_taken_in_ns / 1000000);
> > +                                    div_u64(time_taken_in_ns, 1000000));
> >                       return true;
> >               }
> >
> > @@ -730,7 +730,7 @@ bool wait_for_alt_mode(struct dc_link *link)
> >       time_taken_in_ns = dm_get_elapse_time_in_ns(link->ctx, finish_timestamp,
> >                                                   enter_timestamp);
> >       DC_LOG_WARNING("Alt mode has timed out after %llu ms\n",
> > -                     time_taken_in_ns / 1000000);
> > +                     div_u64(time_taken_in_ns, 1000000));
> >       return false;
> >  }
> >
> >
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-22  2:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-20 23:57 [PATCH] drm/amd/display: Fix 32-bit divide error in wait_for_alt_mode Nathan Chancellor
2019-08-21  3:44 ` Randy Dunlap
2019-08-21 16:40 ` Harry Wentland
2019-08-22  2:12   ` Alex Deucher

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).