Re: [RFC v4 04/12] drm/vblank: Add vblank works

0 views
Skip to first unread message

kbuild test robot

unread,
May 9, 2020, 11:04:40 PM5/9/20
to Lyude Paul, kbuil...@lists.01.org, clang-bu...@googlegroups.com
Hi Lyude,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on drm-exynos/exynos-drm-next]
[also build test ERROR on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next tegra-drm/drm/tegra/for-next linus/master drm/drm-next v5.7-rc4 next-20200508]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Lyude-Paul/drm-nouveau-Introduce-CRC-support-for-gf119/20200509-083258
base: https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git exynos-drm-next
config: x86_64-randconfig-a004-20200510 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 68a9356bdea69dbcec1233f8b1fab47e72fca991)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <l...@intel.com>

All errors (new ones prefixed by >>):

In file included from include/linux/fs.h:34:
In file included from include/linux/percpu-rwsem.h:7:
In file included from include/linux/rcuwait.h:6:
In file included from include/linux/sched/signal.h:6:
include/linux/signal.h:177:1: warning: array index 2 is past the end of the array (which contains 1 element) [-Warray-bounds]
_SIG_SET_OP(signotset, _sig_not)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/signal.h:165:3: note: expanded from macro '_SIG_SET_OP'
set->sig[2] = op(set->sig[2]); \
^ ~
arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
unsigned long sig[_NSIG_WORDS];
^
In file included from drivers/gpu/drm/drm_vblank.c:32:
In file included from include/drm/drm_crtc.h:31:
In file included from include/linux/fb.h:10:
In file included from include/linux/fs.h:34:
In file included from include/linux/percpu-rwsem.h:7:
In file included from include/linux/rcuwait.h:6:
In file included from include/linux/sched/signal.h:6:
include/linux/signal.h:177:1: warning: array index 1 is past the end of the array (which contains 1 element) [-Warray-bounds]
_SIG_SET_OP(signotset, _sig_not)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/signal.h:167:27: note: expanded from macro '_SIG_SET_OP'
case 2: set->sig[1] = op(set->sig[1]); \
^ ~
include/linux/signal.h:176:24: note: expanded from macro '_sig_not'
#define _sig_not(x) (~(x))
^
arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
unsigned long sig[_NSIG_WORDS];
^
In file included from drivers/gpu/drm/drm_vblank.c:32:
In file included from include/drm/drm_crtc.h:31:
In file included from include/linux/fb.h:10:
In file included from include/linux/fs.h:34:
In file included from include/linux/percpu-rwsem.h:7:
In file included from include/linux/rcuwait.h:6:
In file included from include/linux/sched/signal.h:6:
include/linux/signal.h:177:1: warning: array index 1 is past the end of the array (which contains 1 element) [-Warray-bounds]
_SIG_SET_OP(signotset, _sig_not)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/signal.h:167:10: note: expanded from macro '_SIG_SET_OP'
case 2: set->sig[1] = op(set->sig[1]); \
^ ~
arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
unsigned long sig[_NSIG_WORDS];
^
In file included from drivers/gpu/drm/drm_vblank.c:32:
In file included from include/drm/drm_crtc.h:31:
In file included from include/linux/fb.h:10:
In file included from include/linux/fs.h:34:
In file included from include/linux/percpu-rwsem.h:7:
In file included from include/linux/rcuwait.h:6:
In file included from include/linux/sched/signal.h:6:
include/linux/signal.h:188:10: warning: array index 1 is past the end of the array (which contains 1 element) [-Warray-bounds]
case 2: set->sig[1] = 0;
^ ~
arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
unsigned long sig[_NSIG_WORDS];
^
In file included from drivers/gpu/drm/drm_vblank.c:32:
In file included from include/drm/drm_crtc.h:31:
In file included from include/linux/fb.h:10:
In file included from include/linux/fs.h:34:
In file included from include/linux/percpu-rwsem.h:7:
In file included from include/linux/rcuwait.h:6:
In file included from include/linux/sched/signal.h:6:
include/linux/signal.h:201:10: warning: array index 1 is past the end of the array (which contains 1 element) [-Warray-bounds]
case 2: set->sig[1] = -1;
^ ~
arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
unsigned long sig[_NSIG_WORDS];
^
In file included from drivers/gpu/drm/drm_vblank.c:32:
In file included from include/drm/drm_crtc.h:31:
In file included from include/linux/fb.h:10:
In file included from include/linux/fs.h:34:
In file included from include/linux/percpu-rwsem.h:7:
In file included from include/linux/rcuwait.h:6:
In file included from include/linux/sched/signal.h:6:
include/linux/signal.h:232:10: warning: array index 1 is past the end of the array (which contains 1 element) [-Warray-bounds]
case 2: set->sig[1] = 0;
^ ~
arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
unsigned long sig[_NSIG_WORDS];
^
In file included from drivers/gpu/drm/drm_vblank.c:32:
In file included from include/drm/drm_crtc.h:31:
In file included from include/linux/fb.h:10:
In file included from include/linux/fs.h:34:
In file included from include/linux/percpu-rwsem.h:7:
In file included from include/linux/rcuwait.h:6:
In file included from include/linux/sched/signal.h:6:
include/linux/signal.h:244:10: warning: array index 1 is past the end of the array (which contains 1 element) [-Warray-bounds]
case 2: set->sig[1] = -1;
^ ~
arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
unsigned long sig[_NSIG_WORDS];
^
>> drivers/gpu/drm/drm_vblank.c:2376:2: error: indirection requires pointer operand ('void' invalid)
DEFINE_KTHREAD_FLUSH_WORK(fwork);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kthread.h:146:36: note: expanded from macro 'DEFINE_KTHREAD_FLUSH_WORK'
struct kthread_flush_work fwork = KTHREAD_FLUSH_WORK_INIT(fwork);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kthread.h:132:2: note: expanded from macro 'KTHREAD_FLUSH_WORK_INIT'
COMPLETION_INITIALIZER_ONSTACK((fwork).done), \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/completion.h:43:3: note: expanded from macro 'COMPLETION_INITIALIZER_ONSTACK'
(*({ init_completion(&work); &work; }))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49 warnings and 2 errors generated.

vim +2376 drivers/gpu/drm/drm_vblank.c

2364
2365 /**
2366 * drm_vblank_work_flush - wait for a scheduled vblank work to finish
2367 * executing
2368 * @work: vblank work to flush
2369 *
2370 * Wait until @work has finished executing once.
2371 */
2372 void drm_vblank_work_flush(struct drm_vblank_work *work)
2373 {
2374 struct drm_vblank_crtc *vblank = work->vblank;
2375 bool scheduled;
> 2376 DEFINE_KTHREAD_FLUSH_WORK(fwork);

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuil...@lists.01.org
.config.gz

Nick Desaulniers

unread,
May 12, 2020, 1:56:15 PM5/12/20
to Lyude Paul, kbuil...@lists.01.org, clang-built-linux, kbuild test robot
Hi Lyude,
Sorry for the noise. This report is unrelated to your patch. It has
to do with Clang validating dead code. At least now we have a
randconfig to reliably reproduce.
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-li...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/202005101057.9xhrjs8z%25lkp%40intel.com.



--
Thanks,
~Nick Desaulniers

Nathan Chancellor

unread,
May 12, 2020, 2:31:47 PM5/12/20
to Nick Desaulniers, Lyude Paul, kbuil...@lists.01.org, clang-built-linux, kbuild test robot
On Tue, May 12, 2020 at 10:56:01AM -0700, 'Nick Desaulniers' via Clang Built Linux wrote:
> Hi Lyude,
> Sorry for the noise. This report is unrelated to your patch. It has
> to do with Clang validating dead code. At least now we have a
> randconfig to reliably reproduce.

The -Warray-bounds, yes but...
This one ^

is definitely related to that patch.

Clang's error is kind of stupid here... GCC makes it much clearer what
is going on:

$ make -j$(nproc) -s CROSS_COMPILE=x86_64-linux- O=out/x86_64 olddefconfig drivers/gpu/drm/drm_vblank.o
In file included from drivers/gpu/drm/drm_vblank.c:28:
include/linux/kthread.h:110:20: error: field 'done' has incomplete type
110 | struct completion done;
| ^~~~

This fixes it for me:

diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index c6fee200fced..824ba7573100 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -4,6 +4,7 @@
/* Simple interface for creating and stopping kernel threads without mess. */
#include <linux/err.h>
#include <linux/sched.h>
+#include <linux/completion.h>

__printf(4, 5)
struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),

> > 2364
> > 2365 /**
> > 2366 * drm_vblank_work_flush - wait for a scheduled vblank work to finish
> > 2367 * executing
> > 2368 * @work: vblank work to flush
> > 2369 *
> > 2370 * Wait until @work has finished executing once.
> > 2371 */
> > 2372 void drm_vblank_work_flush(struct drm_vblank_work *work)
> > 2373 {
> > 2374 struct drm_vblank_crtc *vblank = work->vblank;
> > 2375 bool scheduled;
> > > 2376 DEFINE_KTHREAD_FLUSH_WORK(fwork);
> >
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > https://lists.01.org/hyperkitty/list/kbuil...@lists.01.org
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-li...@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/202005101057.9xhrjs8z%25lkp%40intel.com.
>
>
>
> --
> Thanks,
> ~Nick Desaulniers
>

Cheers,
Nathan
Reply all
Reply to author
Forward
0 new messages