Re: [PATCH 1/2] drm/i915/dmabuf: fix broken build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 27, 2021 at 05:23:59PM +0100, Matthew Auld wrote:
On Wed, 27 Oct 2021 at 15:54, Lucas De Marchi <lucas.demarchi@xxxxxxxxx> wrote:

On Wed, Oct 27, 2021 at 08:57:48AM +0100, Matthew Auld wrote:
>On Thu, 21 Oct 2021 at 13:54, Matthew Auld <matthew.auld@xxxxxxxxx> wrote:
>>
>> wbinvd_on_all_cpus() is only defined on x86 it seems, plus we need to
>> include asm/smp.h here.
>>
>> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>> Signed-off-by: Matthew Auld <matthew.auld@xxxxxxxxx>
>> Cc: Thomas Hellström <thomas.hellstrom@xxxxxxxxxxxxxxx>
>
>Jani, would it make sense to cherry-pick this to -fixes? The offending
>commit is in drm-next, and there have been a few reports around this.
>
>Fixes: a035154da45d ("drm/i915/dmabuf: add paranoid flush-on-acquire")
>
>
>> ---
>>  drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
>> index 1adcd8e02d29..a45d0ec2c5b6 100644
>> --- a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
>> +++ b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
>> @@ -12,6 +12,13 @@
>>  #include "i915_gem_object.h"
>>  #include "i915_scatterlist.h"
>>
>> +#if defined(CONFIG_X86)
>> +#include <asm/smp.h>
>> +#else
>> +#define wbinvd_on_all_cpus() \
>> +       pr_warn(DRIVER_NAME ": Missing cache flush in %s\n", __func__)


not sure I understand why this is a fix. Sure, it's true, but right now
this file can't be built on any other arch.

For clflush, wbind, etc, I'd rather change the code to use things from
drm_cache rather than ifdef it out locally. This is
"Reported-by: kernel test robot <lkp@xxxxxxxxx>", but what's the error?

I guess it depends on the kernel config, but it reported:
error: implicit declaration of function 'wbinvd_on_all_cpus'

oh, ok. The commit message was not very clear. Just checked and this also matches what is done
in gem/i915_gem_pm.c  (although gt/intel_ggtt.c just includes it
unconditionally)


AFAIK it's the missing <asm/smp.h>, the CONFIG_X86 thing is just for
good measure.

I didn't spot anything in drm_cache which just offers a simple wrapper
for wbinvd?

there isn't yet, but it's something we are adding as we add suppport for
other archs.

thanks
Lucas De Marchi



Lucas De Marchi

>> +#endif
>> +
>>  I915_SELFTEST_DECLARE(static bool force_different_devices;)
>>
>>  static struct drm_i915_gem_object *dma_buf_to_obj(struct dma_buf *buf)
>> --
>> 2.26.3
>>



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux