All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: shut up #warning for compile testing
@ 2017-02-01 15:59 ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2017-02-01 15:59 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Arnd Bergmann, Christian König, David Airlie, Chunming Zhou,
	Flora Cui, Michel Dänzer, Nicolai Hähnle, Junwei Zhang,
	amd-gfx, dri-devel, linux-kernel

My randconfig tests on linux-next showed a newly introduced warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c: In function 'amdgpu_bo_create_restricted':
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:377:2: error: #warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance thanks to write-combining [-Werror=cpp]

Generally speaking, warnings about bad kernel configuration are not particularly
helpful. We could enforce the selection of X86_PAT through Kconfig, so the driver
cannot even be used unless it is enabled, or we could just rely on the runtime
warning that is also there.

In this version, I'm making the warning conditional on CONFIG_COMPILE_TEST, which
shuts it up for me, but not people that may actually want to run the kernel
as a compromize.

Fixes: a2e2f29970aa ("drm/amdgpu: Bring bo creation in line with radeon driver (v2)")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index d1aa291b2638..da3a53a39d0b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -374,8 +374,10 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev,
 	 * See https://bugs.freedesktop.org/show_bug.cgi?id=88758
 	 */
 
+#ifndef CONFIG_COMPILE_TEST
 #warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance \
 	 thanks to write-combining
+#endif
 
 	if (bo->flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC)
 		DRM_INFO_ONCE("Please enable CONFIG_MTRR and CONFIG_X86_PAT for "
-- 
2.9.0

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

* [PATCH] drm/amdgpu: shut up #warning for compile testing
@ 2017-02-01 15:59 ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2017-02-01 15:59 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Nicolai Hähnle, Arnd Bergmann, Michel Dänzer,
	linux-kernel, amd-gfx, dri-devel, Junwei Zhang, Flora Cui,
	Christian König

My randconfig tests on linux-next showed a newly introduced warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c: In function 'amdgpu_bo_create_restricted':
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:377:2: error: #warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance thanks to write-combining [-Werror=cpp]

Generally speaking, warnings about bad kernel configuration are not particularly
helpful. We could enforce the selection of X86_PAT through Kconfig, so the driver
cannot even be used unless it is enabled, or we could just rely on the runtime
warning that is also there.

In this version, I'm making the warning conditional on CONFIG_COMPILE_TEST, which
shuts it up for me, but not people that may actually want to run the kernel
as a compromize.

Fixes: a2e2f29970aa ("drm/amdgpu: Bring bo creation in line with radeon driver (v2)")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index d1aa291b2638..da3a53a39d0b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -374,8 +374,10 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev,
 	 * See https://bugs.freedesktop.org/show_bug.cgi?id=88758
 	 */
 
+#ifndef CONFIG_COMPILE_TEST
 #warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance \
 	 thanks to write-combining
+#endif
 
 	if (bo->flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC)
 		DRM_INFO_ONCE("Please enable CONFIG_MTRR and CONFIG_X86_PAT for "
-- 
2.9.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/amdgpu: shut up #warning for compile testing
  2017-02-01 15:59 ` Arnd Bergmann
@ 2017-02-02  6:09   ` Michel Dänzer
  -1 siblings, 0 replies; 10+ messages in thread
From: Michel Dänzer @ 2017-02-02  6:09 UTC (permalink / raw)
  To: Arnd Bergmann, Alex Deucher
  Cc: Chunming Zhou, Nicolai Hähnle, David Airlie,
	Michel Dänzer, linux-kernel, amd-gfx, dri-devel,
	Junwei Zhang, Flora Cui, Christian König

On 02/02/17 12:59 AM, Arnd Bergmann wrote:
> My randconfig tests on linux-next showed a newly introduced warning:
> 
> drivers/gpu/drm/amd/amdgpu/amdgpu_object.c: In function 'amdgpu_bo_create_restricted':
> drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:377:2: error: #warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance thanks to write-combining [-Werror=cpp]
> 
> Generally speaking, warnings about bad kernel configuration are not particularly
> helpful. We could enforce the selection of X86_PAT through Kconfig, so the driver
> cannot even be used unless it is enabled,

Making AMDGPU depend on X86_PAT would be wrong I think, and any fancier
Kconfig solution might be overkill.


> or we could just rely on the runtime warning that is also there.

That might make sense, since the runtime warning is only triggered when
the lack of PAT actually makes a difference.

OTOH the people running the kernel aren't always the same people
building it, so the downside is that this would potentially delay
getting X86_PAT enabled.


> In this version, I'm making the warning conditional on CONFIG_COMPILE_TEST, which
> shuts it up for me, but not people that may actually want to run the kernel
> as a compromize.

This is fine with me as well.


Whichever way we end up going for this, it should be applied to the
radeon driver as well.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

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

* Re: [PATCH] drm/amdgpu: shut up #warning for compile testing
@ 2017-02-02  6:09   ` Michel Dänzer
  0 siblings, 0 replies; 10+ messages in thread
From: Michel Dänzer @ 2017-02-02  6:09 UTC (permalink / raw)
  To: Arnd Bergmann, Alex Deucher
  Cc: Nicolai Hähnle, Michel Dänzer, linux-kernel, amd-gfx,
	dri-devel, Junwei Zhang, Flora Cui, Christian König

On 02/02/17 12:59 AM, Arnd Bergmann wrote:
> My randconfig tests on linux-next showed a newly introduced warning:
> 
> drivers/gpu/drm/amd/amdgpu/amdgpu_object.c: In function 'amdgpu_bo_create_restricted':
> drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:377:2: error: #warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance thanks to write-combining [-Werror=cpp]
> 
> Generally speaking, warnings about bad kernel configuration are not particularly
> helpful. We could enforce the selection of X86_PAT through Kconfig, so the driver
> cannot even be used unless it is enabled,

Making AMDGPU depend on X86_PAT would be wrong I think, and any fancier
Kconfig solution might be overkill.


> or we could just rely on the runtime warning that is also there.

That might make sense, since the runtime warning is only triggered when
the lack of PAT actually makes a difference.

OTOH the people running the kernel aren't always the same people
building it, so the downside is that this would potentially delay
getting X86_PAT enabled.


> In this version, I'm making the warning conditional on CONFIG_COMPILE_TEST, which
> shuts it up for me, but not people that may actually want to run the kernel
> as a compromize.

This is fine with me as well.


Whichever way we end up going for this, it should be applied to the
radeon driver as well.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/amdgpu: shut up #warning for compile testing
  2017-02-02  6:09   ` Michel Dänzer
@ 2017-02-02  9:36     ` Christian König
  -1 siblings, 0 replies; 10+ messages in thread
From: Christian König @ 2017-02-02  9:36 UTC (permalink / raw)
  To: Michel Dänzer, Arnd Bergmann, Alex Deucher
  Cc: Chunming Zhou, Nicolai Hähnle, David Airlie,
	Michel Dänzer, linux-kernel, amd-gfx, dri-devel,
	Junwei Zhang, Flora Cui

Am 02.02.2017 um 07:09 schrieb Michel Dänzer:
> [SNIP]
> OTOH the people running the kernel aren't always the same people
> building it, so the downside is that this would potentially delay
> getting X86_PAT enabled.

And exactly for this reason I would rather like to keep the warning.

Regards,
Christian.

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

* Re: [PATCH] drm/amdgpu: shut up #warning for compile testing
@ 2017-02-02  9:36     ` Christian König
  0 siblings, 0 replies; 10+ messages in thread
From: Christian König @ 2017-02-02  9:36 UTC (permalink / raw)
  To: Michel Dänzer, Arnd Bergmann, Alex Deucher
  Cc: Nicolai Hähnle, Michel Dänzer, linux-kernel, amd-gfx,
	dri-devel, Junwei Zhang, Flora Cui

Am 02.02.2017 um 07:09 schrieb Michel Dänzer:
> [SNIP]
> OTOH the people running the kernel aren't always the same people
> building it, so the downside is that this would potentially delay
> getting X86_PAT enabled.

And exactly for this reason I would rather like to keep the warning.

Regards,
Christian.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/amdgpu: shut up #warning for compile testing
  2017-02-02  9:36     ` Christian König
@ 2017-02-03 10:15       ` Michel Dänzer
  -1 siblings, 0 replies; 10+ messages in thread
From: Michel Dänzer @ 2017-02-03 10:15 UTC (permalink / raw)
  To: Christian König, Arnd Bergmann, Alex Deucher
  Cc: Chunming Zhou, Nicolai Hähnle, David Airlie,
	Michel Dänzer, linux-kernel, amd-gfx, dri-devel,
	Junwei Zhang, Flora Cui

On 02/02/17 06:36 PM, Christian König wrote:
> Am 02.02.2017 um 07:09 schrieb Michel Dänzer:
>> [SNIP]
>> OTOH the people running the kernel aren't always the same people
>> building it, so the downside is that this would potentially delay
>> getting X86_PAT enabled.
> 
> And exactly for this reason I would rather like to keep the warning.

Right, so let's take the patch as is:

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>


Arnd, can you make the corresponding patch for radeon as well? Otherwise
I can probably do it next week.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

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

* Re: [PATCH] drm/amdgpu: shut up #warning for compile testing
@ 2017-02-03 10:15       ` Michel Dänzer
  0 siblings, 0 replies; 10+ messages in thread
From: Michel Dänzer @ 2017-02-03 10:15 UTC (permalink / raw)
  To: Christian König, Arnd Bergmann, Alex Deucher
  Cc: Nicolai Hähnle, Michel Dänzer, linux-kernel, amd-gfx,
	dri-devel, Junwei Zhang, Flora Cui

On 02/02/17 06:36 PM, Christian König wrote:
> Am 02.02.2017 um 07:09 schrieb Michel Dänzer:
>> [SNIP]
>> OTOH the people running the kernel aren't always the same people
>> building it, so the downside is that this would potentially delay
>> getting X86_PAT enabled.
> 
> And exactly for this reason I would rather like to keep the warning.

Right, so let's take the patch as is:

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>


Arnd, can you make the corresponding patch for radeon as well? Otherwise
I can probably do it next week.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/amdgpu: shut up #warning for compile testing
  2017-02-03 10:15       ` Michel Dänzer
@ 2017-02-09  5:20         ` Alex Deucher
  -1 siblings, 0 replies; 10+ messages in thread
From: Alex Deucher @ 2017-02-09  5:20 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: Christian König, Arnd Bergmann, Alex Deucher,
	Nicolai Hähnle, Michel Dänzer, LKML, amd-gfx list,
	Maling list - DRI developers, Junwei Zhang, Flora Cui

On Fri, Feb 3, 2017 at 5:15 AM, Michel Dänzer <michel@daenzer.net> wrote:
> On 02/02/17 06:36 PM, Christian König wrote:
>> Am 02.02.2017 um 07:09 schrieb Michel Dänzer:
>>> [SNIP]
>>> OTOH the people running the kernel aren't always the same people
>>> building it, so the downside is that this would potentially delay
>>> getting X86_PAT enabled.
>>
>> And exactly for this reason I would rather like to keep the warning.
>
> Right, so let's take the patch as is:
>
> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
>

Applied.  thanks!

Alex

>
> Arnd, can you make the corresponding patch for radeon as well? Otherwise
> I can probably do it next week.
>
>
> --
> Earthling Michel Dänzer               |               http://www.amd.com
> Libre software enthusiast             |             Mesa and X developer
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/amdgpu: shut up #warning for compile testing
@ 2017-02-09  5:20         ` Alex Deucher
  0 siblings, 0 replies; 10+ messages in thread
From: Alex Deucher @ 2017-02-09  5:20 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: Arnd Bergmann, Nicolai Hähnle, Michel Dänzer, LKML,
	amd-gfx list, Junwei Zhang, Maling list - DRI developers,
	Alex Deucher, Flora Cui, Christian König

On Fri, Feb 3, 2017 at 5:15 AM, Michel Dänzer <michel@daenzer.net> wrote:
> On 02/02/17 06:36 PM, Christian König wrote:
>> Am 02.02.2017 um 07:09 schrieb Michel Dänzer:
>>> [SNIP]
>>> OTOH the people running the kernel aren't always the same people
>>> building it, so the downside is that this would potentially delay
>>> getting X86_PAT enabled.
>>
>> And exactly for this reason I would rather like to keep the warning.
>
> Right, so let's take the patch as is:
>
> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
>

Applied.  thanks!

Alex

>
> Arnd, can you make the corresponding patch for radeon as well? Otherwise
> I can probably do it next week.
>
>
> --
> Earthling Michel Dänzer               |               http://www.amd.com
> Libre software enthusiast             |             Mesa and X developer
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2017-02-09  5:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-01 15:59 [PATCH] drm/amdgpu: shut up #warning for compile testing Arnd Bergmann
2017-02-01 15:59 ` Arnd Bergmann
2017-02-02  6:09 ` Michel Dänzer
2017-02-02  6:09   ` Michel Dänzer
2017-02-02  9:36   ` Christian König
2017-02-02  9:36     ` Christian König
2017-02-03 10:15     ` Michel Dänzer
2017-02-03 10:15       ` Michel Dänzer
2017-02-09  5:20       ` Alex Deucher
2017-02-09  5:20         ` Alex Deucher

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.