All of lore.kernel.org
 help / color / mirror / Atom feed
* Error building v5.5-git on PowerPC32 - bisected to commit 7befe621ff81
@ 2020-02-06 22:46 Larry Finger
  2020-02-06 23:12 ` Arvind Sankar
  2020-02-07 13:12 ` Ville Syrjälä
  0 siblings, 2 replies; 7+ messages in thread
From: Larry Finger @ 2020-02-06 22:46 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: Tom Anderson, Hans Verkuil, Manasi Navare, LKML

When building post V5.5 on my PowerBook G4 Aluminum, the build failed with the 
following error:

drivers/gpu/drm/drm_edid.c: In function ‘cea_mode_alternate_timings’:
drivers/gpu/drm/drm_edid.c:3275:2: error: call to ‘__compiletime_assert_3282’ 
declared with attribute error: BUILD_BUG_ON failed: cea_mode_for_vic(8)->vtotal 
!= 262 || cea_mode_for_vic(9)->vtotal != 262 || cea_mode_for_vic(12)->vtotal != 
262 || cea_mode_for_vic(13)->vtotal != 262 || cea_mode_for_vic(23)->vtotal != 
312 || cea_mode_for_vic(24)->vtotal != 312 || cea_mode_for_vic(27)->vtotal != 
312 || cea_mode_for_vic(28)->vtotal != 312

This error was bisected to commit 7befe621ff81 ("drm/edid: Abstract away 
cea_edid_modes[]").

This problem is clearly a problem with the gcc compiler on the box, namely gcc 
(Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3. I had no success finding why the 
attributes were wrong, and finally settled on the following hack:

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 99769d6c9f84..062bbe2b254a 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3272,6 +3272,7 @@ cea_mode_alternate_timings(u8 vic, struct drm_display_mode 
*mode)
          * get the other variants by simply increasing the
          * vertical front porch length.
          */
+#ifndef CONFIG_PPC32
         BUILD_BUG_ON(cea_mode_for_vic(8)->vtotal != 262 ||
                      cea_mode_for_vic(9)->vtotal != 262 ||
                      cea_mode_for_vic(12)->vtotal != 262 ||
@@ -3280,6 +3281,7 @@ cea_mode_alternate_timings(u8 vic, struct drm_display_mode 
*mode)
                      cea_mode_for_vic(24)->vtotal != 312 ||
                      cea_mode_for_vic(27)->vtotal != 312 ||
                      cea_mode_for_vic(28)->vtotal != 312);
+#endif

         if (((vic == 8 || vic == 9 ||
               vic == 12 || vic == 13) && mode->vtotal < 263) ||

Disabling the build check allows me to build and test the post v5.5 versions.

Larry

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

* Re: Error building v5.5-git on PowerPC32 - bisected to commit 7befe621ff81
  2020-02-06 22:46 Error building v5.5-git on PowerPC32 - bisected to commit 7befe621ff81 Larry Finger
@ 2020-02-06 23:12 ` Arvind Sankar
  2020-02-06 23:33   ` Arvind Sankar
  2020-02-07 13:12 ` Ville Syrjälä
  1 sibling, 1 reply; 7+ messages in thread
From: Arvind Sankar @ 2020-02-06 23:12 UTC (permalink / raw)
  To: Larry Finger
  Cc: Ville Syrjälä, Tom Anderson, Hans Verkuil, Manasi Navare, LKML

On Thu, Feb 06, 2020 at 04:46:52PM -0600, Larry Finger wrote:
> When building post V5.5 on my PowerBook G4 Aluminum, the build failed with the 
> following error:
> 
> drivers/gpu/drm/drm_edid.c: In function ‘cea_mode_alternate_timings’:
> drivers/gpu/drm/drm_edid.c:3275:2: error: call to ‘__compiletime_assert_3282’ 
> declared with attribute error: BUILD_BUG_ON failed: cea_mode_for_vic(8)->vtotal 
> != 262 || cea_mode_for_vic(9)->vtotal != 262 || cea_mode_for_vic(12)->vtotal != 
> 262 || cea_mode_for_vic(13)->vtotal != 262 || cea_mode_for_vic(23)->vtotal != 
> 312 || cea_mode_for_vic(24)->vtotal != 312 || cea_mode_for_vic(27)->vtotal != 
> 312 || cea_mode_for_vic(28)->vtotal != 312
> 
> This error was bisected to commit 7befe621ff81 ("drm/edid: Abstract away 
> cea_edid_modes[]").
> 
> This problem is clearly a problem with the gcc compiler on the box, namely gcc 
> (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3. I had no success finding why the 
> attributes were wrong, and finally settled on the following hack:
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 99769d6c9f84..062bbe2b254a 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3272,6 +3272,7 @@ cea_mode_alternate_timings(u8 vic, struct drm_display_mode 
> *mode)
>           * get the other variants by simply increasing the
>           * vertical front porch length.
>           */
> +#ifndef CONFIG_PPC32
>          BUILD_BUG_ON(cea_mode_for_vic(8)->vtotal != 262 ||
>                       cea_mode_for_vic(9)->vtotal != 262 ||
>                       cea_mode_for_vic(12)->vtotal != 262 ||
> @@ -3280,6 +3281,7 @@ cea_mode_alternate_timings(u8 vic, struct drm_display_mode 
> *mode)
>                       cea_mode_for_vic(24)->vtotal != 312 ||
>                       cea_mode_for_vic(27)->vtotal != 312 ||
>                       cea_mode_for_vic(28)->vtotal != 312);
> +#endif
> 
>          if (((vic == 8 || vic == 9 ||
>                vic == 12 || vic == 13) && mode->vtotal < 263) ||
> 
> Disabling the build check allows me to build and test the post v5.5 versions.
> 
> Larry

It's not that the attributes are wrong. The problem is that BUILD_BUG_ON
requires a compile-time evaluatable condition. gcc-4.6 is apparently not
good enough at optimizing to reduce that expression to a constant,
though it was able to do it with the array accesses.

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

* Re: Error building v5.5-git on PowerPC32 - bisected to commit 7befe621ff81
  2020-02-06 23:12 ` Arvind Sankar
@ 2020-02-06 23:33   ` Arvind Sankar
  2020-02-07  0:29     ` Larry Finger
  0 siblings, 1 reply; 7+ messages in thread
From: Arvind Sankar @ 2020-02-06 23:33 UTC (permalink / raw)
  To: Arvind Sankar
  Cc: Larry Finger, Ville Syrjälä,
	Tom Anderson, Hans Verkuil, Manasi Navare, LKML

On Thu, Feb 06, 2020 at 06:12:13PM -0500, Arvind Sankar wrote:
> On Thu, Feb 06, 2020 at 04:46:52PM -0600, Larry Finger wrote:
> > When building post V5.5 on my PowerBook G4 Aluminum, the build failed with the 
> > following error:
> 
> It's not that the attributes are wrong. The problem is that BUILD_BUG_ON
> requires a compile-time evaluatable condition. gcc-4.6 is apparently not
> good enough at optimizing to reduce that expression to a constant,
> though it was able to do it with the array accesses.

Should have noted, it fails on x86 too with gcc-4.6.4, not specific to PPC.

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

* Re: Error building v5.5-git on PowerPC32 - bisected to commit 7befe621ff81
  2020-02-06 23:33   ` Arvind Sankar
@ 2020-02-07  0:29     ` Larry Finger
  2020-02-07  4:18       ` Arvind Sankar
  0 siblings, 1 reply; 7+ messages in thread
From: Larry Finger @ 2020-02-07  0:29 UTC (permalink / raw)
  To: Arvind Sankar
  Cc: Ville Syrjälä, Tom Anderson, Hans Verkuil, Manasi Navare, LKML

On 2/6/20 5:33 PM, Arvind Sankar wrote:
> On Thu, Feb 06, 2020 at 06:12:13PM -0500, Arvind Sankar wrote:
>> On Thu, Feb 06, 2020 at 04:46:52PM -0600, Larry Finger wrote:
>>> When building post V5.5 on my PowerBook G4 Aluminum, the build failed with the
>>> following error:
>>
>> It's not that the attributes are wrong. The problem is that BUILD_BUG_ON
>> requires a compile-time evaluatable condition. gcc-4.6 is apparently not
>> good enough at optimizing to reduce that expression to a constant,
>> though it was able to do it with the array accesses.
> 
> Should have noted, it fails on x86 too with gcc-4.6.4, not specific to PPC.

What pre-processor test would be correct to skip the test for gcc4?

Larry


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

* Re: Error building v5.5-git on PowerPC32 - bisected to commit 7befe621ff81
  2020-02-07  0:29     ` Larry Finger
@ 2020-02-07  4:18       ` Arvind Sankar
  0 siblings, 0 replies; 7+ messages in thread
From: Arvind Sankar @ 2020-02-07  4:18 UTC (permalink / raw)
  To: Larry Finger
  Cc: Arvind Sankar, Ville Syrjälä,
	Tom Anderson, Hans Verkuil, Manasi Navare, LKML

On Thu, Feb 06, 2020 at 06:29:42PM -0600, Larry Finger wrote:
> On 2/6/20 5:33 PM, Arvind Sankar wrote:
> > On Thu, Feb 06, 2020 at 06:12:13PM -0500, Arvind Sankar wrote:
> >> On Thu, Feb 06, 2020 at 04:46:52PM -0600, Larry Finger wrote:
> >>> When building post V5.5 on my PowerBook G4 Aluminum, the build failed with the
> >>> following error:
> >>
> >> It's not that the attributes are wrong. The problem is that BUILD_BUG_ON
> >> requires a compile-time evaluatable condition. gcc-4.6 is apparently not
> >> good enough at optimizing to reduce that expression to a constant,
> >> though it was able to do it with the array accesses.
> > 
> > Should have noted, it fails on x86 too with gcc-4.6.4, not specific to PPC.
> 
> What pre-processor test would be correct to skip the test for gcc4?
> 
> Larry
> 

I think the patch you bisected to is broken. It should not use
BUILD_BUG_ON with a condition that is not obviously compile-time
evaluatable.

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

* Re: Error building v5.5-git on PowerPC32 - bisected to commit 7befe621ff81
  2020-02-06 22:46 Error building v5.5-git on PowerPC32 - bisected to commit 7befe621ff81 Larry Finger
  2020-02-06 23:12 ` Arvind Sankar
@ 2020-02-07 13:12 ` Ville Syrjälä
  2020-02-07 16:22   ` Larry Finger
  1 sibling, 1 reply; 7+ messages in thread
From: Ville Syrjälä @ 2020-02-07 13:12 UTC (permalink / raw)
  To: Larry Finger; +Cc: Tom Anderson, Hans Verkuil, Manasi Navare, LKML

On Thu, Feb 06, 2020 at 04:46:52PM -0600, Larry Finger wrote:
> When building post V5.5 on my PowerBook G4 Aluminum, the build failed with the 
> following error:

It shouldn't be in 5.5

There's a fix queued
https://cgit.freedesktop.org/drm-misc/commit/?h=drm-misc-next-fixes&id=e1cf35b94c5fd122a8780587559fc6da9fc2dd12

Does that work for you?

> 
> drivers/gpu/drm/drm_edid.c: In function ‘cea_mode_alternate_timings’:
> drivers/gpu/drm/drm_edid.c:3275:2: error: call to ‘__compiletime_assert_3282’ 
> declared with attribute error: BUILD_BUG_ON failed: cea_mode_for_vic(8)->vtotal 
> != 262 || cea_mode_for_vic(9)->vtotal != 262 || cea_mode_for_vic(12)->vtotal != 
> 262 || cea_mode_for_vic(13)->vtotal != 262 || cea_mode_for_vic(23)->vtotal != 
> 312 || cea_mode_for_vic(24)->vtotal != 312 || cea_mode_for_vic(27)->vtotal != 
> 312 || cea_mode_for_vic(28)->vtotal != 312
> 
> This error was bisected to commit 7befe621ff81 ("drm/edid: Abstract away 
> cea_edid_modes[]").
> 
> This problem is clearly a problem with the gcc compiler on the box, namely gcc 
> (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3. I had no success finding why the 
> attributes were wrong, and finally settled on the following hack:
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 99769d6c9f84..062bbe2b254a 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3272,6 +3272,7 @@ cea_mode_alternate_timings(u8 vic, struct drm_display_mode 
> *mode)
>           * get the other variants by simply increasing the
>           * vertical front porch length.
>           */
> +#ifndef CONFIG_PPC32
>          BUILD_BUG_ON(cea_mode_for_vic(8)->vtotal != 262 ||
>                       cea_mode_for_vic(9)->vtotal != 262 ||
>                       cea_mode_for_vic(12)->vtotal != 262 ||
> @@ -3280,6 +3281,7 @@ cea_mode_alternate_timings(u8 vic, struct drm_display_mode 
> *mode)
>                       cea_mode_for_vic(24)->vtotal != 312 ||
>                       cea_mode_for_vic(27)->vtotal != 312 ||
>                       cea_mode_for_vic(28)->vtotal != 312);
> +#endif
> 
>          if (((vic == 8 || vic == 9 ||
>                vic == 12 || vic == 13) && mode->vtotal < 263) ||
> 
> Disabling the build check allows me to build and test the post v5.5 versions.
> 
> Larry

-- 
Ville Syrjälä
Intel

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

* Re: Error building v5.5-git on PowerPC32 - bisected to commit 7befe621ff81
  2020-02-07 13:12 ` Ville Syrjälä
@ 2020-02-07 16:22   ` Larry Finger
  0 siblings, 0 replies; 7+ messages in thread
From: Larry Finger @ 2020-02-07 16:22 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: Tom Anderson, Hans Verkuil, Manasi Navare, LKML

On 2/7/20 7:12 AM, Ville Syrjälä wrote:
> On Thu, Feb 06, 2020 at 04:46:52PM -0600, Larry Finger wrote:
>> When building post V5.5 on my PowerBook G4 Aluminum, the build failed with the
>> following error:
> 
> It shouldn't be in 5.5

It isn't in 5.5, but in the transitional code between v5.5 and v5.6.0-rc1.
> 
> There's a fix queued
> https://cgit.freedesktop.org/drm-misc/commit/?h=drm-misc-next-fixes&id=e1cf35b94c5fd122a8780587559fc6da9fc2dd12
> 
> Does that work for you?

Yes it does fix the problem.

Thanks,

Larry

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

end of thread, other threads:[~2020-02-07 16:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-06 22:46 Error building v5.5-git on PowerPC32 - bisected to commit 7befe621ff81 Larry Finger
2020-02-06 23:12 ` Arvind Sankar
2020-02-06 23:33   ` Arvind Sankar
2020-02-07  0:29     ` Larry Finger
2020-02-07  4:18       ` Arvind Sankar
2020-02-07 13:12 ` Ville Syrjälä
2020-02-07 16:22   ` Larry Finger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.