Skip to contentSkip to conversation

arm32 build failure after abe882a39a9c ("drm/amd/display: fix issue with eDP not detected on driver load")

PATCH In review Nathan Chancellor 6 participants 6 messages Jun 18, 2019 – Jun 25, 2019 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

After commit abe882a39a9c ("drm/amd/display: fix issue with eDP not detected on driver load") in -next, arm32 allyesconfig builds start failing at link time:

arm-linux-gnueabi-ld: drivers/gpu/drm/amd/display/dc/core/dc_link.o: in function `dc_link_detect':
dc_link.c:(.text+0x260c): undefined reference to `__bad_udelay'

arm32 only allows a udelay value of up to 2000, see arch/arm/include/asm/delay.h for more info.

Please look into this when you have a chance!
Nathan

maintainer
#1 lore raw

Hi Alex,

please resolve this ASAP, I cannot pull your tree without this fixed as it breaks my arm builds here.

an 8 second delay there seems pointless and arbitary, an 8 sec delay there without a comment, seems like a lack of review.

Dave.

Quoted 11 lines · Nathan Chancellor

Hi all,

After commit abe882a39a9c ("drm/amd/display: fix issue with eDP not detected on driver load") in -next, arm32 allyesconfig builds start failing at link time:

arm-linux-gnueabi-ld: drivers/gpu/drm/amd/display/dc/core/dc_link.o: in function `dc_link_detect':
dc_link.c:(.text+0x260c): undefined reference to `__bad_udelay'

Quoted 5 lines

arm32 only allows a udelay value of up to 2000, see arch/arm/include/asm/delay.h for more info.

Please look into this when you have a chance!
Nathan

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

maintainer
#2 lore raw

PATCH 1/1 drm/amd/display: Use msleep instead of udelay for 8ms wait

arm32's udelay only allows values up to 2000 microseconds. msleep does the trick for us here as there is no problem if this isn't microsecond accurate and takes a tad longer.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
index 4c31930f1cdf..f5d02f89b3f9 100644
@@ -548,7 +548,7 @@ static void read_edp_current_link_settings_on_detect(struct dc_link *link)
 			break;
 		}
 
-		udelay(8000);
+		msleep(8);
 	}
 
 	ASSERT(status == DC_OK);
Signature · 6 lines
2.22.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by
#4 lore raw

Re: [PATCH] drm/amd/display: Use msleep instead of udelay for 8ms wait

In reply to a message not in the archive

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Harry Wentland <[email protected]>
Sent: Tuesday, June 25, 2019 10:00 AM
To: [email protected]; [email protected]
Cc: Zhou, David(ChunMing); Li, Sun peng (Leo); Koo, Anthony; [email protected]; [email protected]; dri-devel-PD4FTy7X32lNgt0PjOBp9/[email protected]; Wentland, Harry; Deucher, Alexander; Lei, Jun; Lakha, Bhawanpreet; Koenig, Christian
Subject: [PATCH] drm/amd/display: Use msleep instead of udelay for 8ms wait

arm32's udelay only allows values up to 2000 microseconds. msleep does the trick for us here as there is no problem if this isn't microsecond accurate and takes a tad longer.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
index 4c31930f1cdf..f5d02f89b3f9 100644
@@ -548,7 +548,7 @@ static void read_edp_current_link_settings_on_detect(struct dc_link *link)
                         break;
                 }
 
-               udelay(8000);
+               msleep(8);
         }
 
         ASSERT(status == DC_OK);

--
2.22.0

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#5 lore raw

Re: [PATCH] drm/amd/display: Use msleep instead of udelay for 8ms wait

In reply to Harry Wentland

Hi Harry,

Am Dienstag, den 25.06.2019, 10:00 -0400 schrieb Harry Wentland:

Quoted 3 lines

arm32's udelay only allows values up to 2000 microseconds. msleep does the trick for us here as there is no problem if this isn't microsecond accurate and takes a tad longer.

A "tad" longer in this case means likely double the intended wait. Please see "SLEEPING FOR ~USECS OR SMALL MSECS ( 10us - 20ms)" in Documentation/timers/timers-howto.txt.

The sleep here should use usleep_range. In general the DC code seems to use quite a lot of the udelay busy waits. I doubt that many of those occurrences are in atomic context, so could easily use a sleeping wait.

Digging further this seems to apply across amdgpu, not only DC.

Regards,
Lucas

Quoted 20 lines

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
index 4c31930f1cdf..f5d02f89b3f9 100644
@@ -548,7 +548,7 @@ static void
 read_edp_current_link_settings_on_detect(struct dc_link *link)
  			break;
  		}

drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
-		udelay(8000);
+		msleep(8);

  }

  ASSERT(status == DC_OK);

#6 lore raw

Re: [PATCH] drm/amd/display: Use msleep instead of udelay for 8ms wait

Am 25.06.19 um 16:12 schrieb Lucas Stach:

Quoted 9 lines

Hi Harry,

Am Dienstag, den 25.06.2019, 10:00 -0400 schrieb Harry Wentland:

Quoted 3 lines

arm32's udelay only allows values up to 2000 microseconds. msleep does the trick for us here as there is no problem if this isn't microsecond accurate and takes a tad longer.

A "tad" longer in this case means likely double the intended wait. Please see "SLEEPING FOR ~USECS OR SMALL MSECS ( 10us - 20ms)" in Documentation/timers/timers-howto.txt.

Oh, thanks so much for the link! I was searching desperately for this the last time this came up and couldn't find it.

Clearly going to remember now where to find that.

Thanks,
Christian.

Quoted 25 lines

The sleep here should use usleep_range. In general the DC code seems to use quite a lot of the udelay busy waits. I doubt that many of those occurrences are in atomic context, so could easily use a sleeping wait.

Digging further this seems to apply across amdgpu, not only DC.

Regards,
Lucas

Quoted 15 lines
---
  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
index 4c31930f1cdf..f5d02f89b3f9 100644
@@ -548,7 +548,7 @@ static void
 read_edp_current_link_settings_on_detect(struct dc_link *link)
  			break;
  		}
 
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
-		udelay(8000);
+		msleep(8);
  	}
 

  ASSERT(status == DC_OK);

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel