Re: [PATCH] lockdep: Use different indentation in print_lock_class_header/print_lock_trace
by kbuild test robot
Hi Joe,
I love your patch! Yet something to improve:
[auto build test ERROR on tip/locking/core]
[also build test ERROR on v5.7-rc6 next-20200519]
[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/Joe-Perches/lockdep-Use-differen...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 23b5ae2e8e1326c91b5dfdbb6ebcd5a6820074ae
config: arm-randconfig-r002-20200519 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
kernel//locking/lockdep.c:687:4: warning: format specifies type 'short' but the argument has type 'int' [-Wformat]
class->wait_type_outer ?: class->wait_type_inner,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> kernel//locking/lockdep.c:1965:41: error: expected ')'
depth + 3 + strlen(usage_str[bit]);
^
kernel//locking/lockdep.c:1964:20: note: to match this '('
print_lock_trace(class->usage_traces[bit],
^
1 warning and 1 error generated.
vim +1965 kernel//locking/lockdep.c
1949
1950 static void print_lock_class_header(struct lock_class *class, int depth)
1951 {
1952 int bit;
1953
1954 printk("%*s->", depth, "");
1955 print_lock_name(class);
1956 #ifdef CONFIG_DEBUG_LOCKDEP
1957 printk(KERN_CONT " ops: %lu", debug_class_ops_read(class));
1958 #endif
1959 printk(KERN_CONT " {\n");
1960
1961 for (bit = 0; bit < LOCK_USAGE_STATES; bit++) {
1962 if (class->usage_mask & (1 << bit)) {
1963 printk("%*s %s at:\n", depth, "", usage_str[bit]);
1964 print_lock_trace(class->usage_traces[bit],
> 1965 depth + 3 + strlen(usage_str[bit]);
1966 }
1967 }
1968 printk("%*s }\n", depth, "");
1969
1970 printk("%*s ... key at: [<%px>] %pS\n",
1971 depth, "", class->key, class->key);
1972 }
1973
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [PATCH net-next 2/4] net: phy: dp83869: Set opmode from straps
by kbuild test robot
Hi Dan,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
[also build test WARNING on robh/for-next sparc-next/master net/master linus/master v5.7-rc6 next-20200518]
[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/Dan-Murphy/DP83869-Enhancements/...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 5cdfe8306631b2224e3f81fc5a1e2721c7a1948b
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
drivers/net/phy/dp83869.c: In function 'dp83869_set_strapped_mode':
>> drivers/net/phy/dp83869.c:171:10: warning: comparison is always false due to limited range of data type [-Wtype-limits]
171 | if (val < 0)
| ^
vim +171 drivers/net/phy/dp83869.c
164
165 static int dp83869_set_strapped_mode(struct phy_device *phydev)
166 {
167 struct dp83869_private *dp83869 = phydev->priv;
168 u16 val;
169
170 val = phy_read_mmd(phydev, DP83869_DEVADDR, DP83869_STRAP_STS1);
> 171 if (val < 0)
172 return val;
173
174 dp83869->mode = val & DP83869_STRAP_OP_MODE_MASK;
175
176 return 0;
177 }
178
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [PATCHv2 3/5] Input: EXC3000: add EXC80H60 and EXC80H84 support
by kbuild test robot
Hi Sebastian,
I love your patch! Yet something to improve:
[auto build test ERROR on input/next]
[also build test ERROR on v5.7-rc6 next-20200519]
[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/Sebastian-Reichel/EXC3000-Update...
base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
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 <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/input/touchscreen/exc3000.c:48:13: error: use of undeclared identifier 'SZ_4K'
.max_xy = SZ_4K - 1,
^
>> drivers/input/touchscreen/exc3000.c:52:13: error: use of undeclared identifier 'SZ_16K'
.max_xy = SZ_16K - 1,
^
drivers/input/touchscreen/exc3000.c:56:13: error: use of undeclared identifier 'SZ_16K'
.max_xy = SZ_16K - 1,
^
drivers/input/touchscreen/exc3000.c:99:28: error: use of undeclared identifier 'SZ_16K'
if (data->info->max_xy == SZ_16K - 1)
^
4 errors generated.
vim +/SZ_4K +48 drivers/input/touchscreen/exc3000.c
44
45 static struct eeti_dev_info exc3000_info[] = {
46 [EETI_EXC3000] = {
47 .name = "EETI EXC3000 Touch Screen",
> 48 .max_xy = SZ_4K - 1,
49 },
50 [EETI_EXC80H60] = {
51 .name = "EETI EXC80H60 Touch Screen",
> 52 .max_xy = SZ_16K - 1,
53 },
54 [EETI_EXC80H84] = {
55 .name = "EETI EXC80H84 Touch Screen",
56 .max_xy = SZ_16K - 1,
57 },
58 };
59
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [PATCH v2 bpf-next 1/7] bpf: implement BPF ring buffer and verifier support for it
by kbuild test robot
Hi Andrii,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bpf-next/master]
[also build test WARNING on next-20200519]
[cannot apply to bpf/master rcu/dev v5.7-rc6]
[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/Andrii-Nakryiko/BPF-ring-buffer/...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: arm-randconfig-r006-20200519 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> kernel/bpf/ringbuf.c:133:14: warning: result of comparison of constant 68719464448 with expression of type 'size_t' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
if (data_sz > RINGBUF_MAX_DATA_SZ)
~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
1 warning generated.
vim +133 kernel/bpf/ringbuf.c
125
126 static struct bpf_ringbuf *bpf_ringbuf_alloc(size_t data_sz, int numa_node)
127 {
128 struct bpf_ringbuf *rb;
129
130 if (!data_sz || !PAGE_ALIGNED(data_sz))
131 return ERR_PTR(-EINVAL);
132
> 133 if (data_sz > RINGBUF_MAX_DATA_SZ)
134 return ERR_PTR(-E2BIG);
135
136 rb = bpf_ringbuf_area_alloc(data_sz, numa_node);
137 if (!rb)
138 return ERR_PTR(-ENOMEM);
139
140 spin_lock_init(&rb->spinlock);
141 init_waitqueue_head(&rb->waitq);
142 init_irq_work(&rb->work, bpf_ringbuf_notify);
143
144 rb->mask = data_sz - 1;
145 rb->consumer_pos = 0;
146 rb->producer_pos = 0;
147
148 return rb;
149 }
150
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [PATCHv2 3/5] Input: EXC3000: add EXC80H60 and EXC80H84 support
by kbuild test robot
Hi Sebastian,
I love your patch! Perhaps something to improve:
[auto build test WARNING on input/next]
[also build test WARNING on v5.7-rc6 next-20200519]
[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/Sebastian-Reichel/EXC3000-Update...
base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: openrisc-randconfig-r024-20200519 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=openrisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
drivers/input/touchscreen/exc3000.c:48:13: error: 'SZ_4K' undeclared here (not in a function)
48 | .max_xy = SZ_4K - 1,
| ^~~~~
drivers/input/touchscreen/exc3000.c:52:13: error: 'SZ_16K' undeclared here (not in a function)
52 | .max_xy = SZ_16K - 1,
| ^~~~~~
In file included from arch/openrisc/include/asm/bitops.h:25,
from include/linux/bitops.h:29,
from drivers/input/touchscreen/exc3000.c:10:
drivers/input/touchscreen/exc3000.c: In function 'exc3000_read_frame':
drivers/input/touchscreen/exc3000.c:99:25: warning: comparison between pointer and integer
99 | if (data->info->max_xy == SZ_16K - 1)
| ^~
include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
>> drivers/input/touchscreen/exc3000.c:99:2: note: in expansion of macro 'if'
99 | if (data->info->max_xy == SZ_16K - 1)
| ^~
drivers/input/touchscreen/exc3000.c:99:25: warning: comparison between pointer and integer
99 | if (data->info->max_xy == SZ_16K - 1)
| ^~
include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
>> drivers/input/touchscreen/exc3000.c:99:2: note: in expansion of macro 'if'
99 | if (data->info->max_xy == SZ_16K - 1)
| ^~
drivers/input/touchscreen/exc3000.c:99:25: warning: comparison between pointer and integer
99 | if (data->info->max_xy == SZ_16K - 1)
| ^~
include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
69 | (cond) ? | ^~~~
include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
>> drivers/input/touchscreen/exc3000.c:99:2: note: in expansion of macro 'if'
99 | if (data->info->max_xy == SZ_16K - 1)
| ^~
vim +/if +99 drivers/input/touchscreen/exc3000.c
> 10 #include <linux/bitops.h>
11 #include <linux/device.h>
12 #include <linux/i2c.h>
13 #include <linux/input.h>
14 #include <linux/input/mt.h>
15 #include <linux/input/touchscreen.h>
16 #include <linux/interrupt.h>
17 #include <linux/module.h>
18 #include <linux/of.h>
19 #include <linux/timer.h>
20 #include <asm/unaligned.h>
21
22 #define EXC3000_NUM_SLOTS 10
23 #define EXC3000_SLOTS_PER_FRAME 5
24 #define EXC3000_LEN_FRAME 66
25 #define EXC3000_LEN_POINT 10
26
27 #define EXC3000_MT1_EVENT 0x06
28 #define EXC3000_MT2_EVENT 0x18
29
30 #define EXC3000_TIMEOUT_MS 100
31
32 static const struct i2c_device_id exc3000_id[];
33
34 struct eeti_dev_info {
35 const char *name;
36 int max_xy;
37 };
38
39 enum eeti_dev_id {
40 EETI_EXC3000,
41 EETI_EXC80H60,
42 EETI_EXC80H84,
43 };
44
45 static struct eeti_dev_info exc3000_info[] = {
46 [EETI_EXC3000] = {
47 .name = "EETI EXC3000 Touch Screen",
48 .max_xy = SZ_4K - 1,
49 },
50 [EETI_EXC80H60] = {
51 .name = "EETI EXC80H60 Touch Screen",
52 .max_xy = SZ_16K - 1,
53 },
54 [EETI_EXC80H84] = {
55 .name = "EETI EXC80H84 Touch Screen",
56 .max_xy = SZ_16K - 1,
57 },
58 };
59
60 struct exc3000_data {
61 struct i2c_client *client;
62 const struct eeti_dev_info *info;
63 struct input_dev *input;
64 struct touchscreen_properties prop;
65 struct timer_list timer;
66 u8 buf[2 * EXC3000_LEN_FRAME];
67 };
68
69 static void exc3000_report_slots(struct input_dev *input,
70 struct touchscreen_properties *prop,
71 const u8 *buf, int num)
72 {
73 for (; num--; buf += EXC3000_LEN_POINT) {
74 if (buf[0] & BIT(0)) {
75 input_mt_slot(input, buf[1]);
76 input_mt_report_slot_state(input, MT_TOOL_FINGER, true);
77 touchscreen_report_pos(input, prop,
78 get_unaligned_le16(buf + 2),
79 get_unaligned_le16(buf + 4),
80 true);
81 }
82 }
83 }
84
85 static void exc3000_timer(struct timer_list *t)
86 {
87 struct exc3000_data *data = from_timer(data, t, timer);
88
89 input_mt_sync_frame(data->input);
90 input_sync(data->input);
91 }
92
93 static int exc3000_read_frame(struct exc3000_data *data, u8 *buf)
94 {
95 struct i2c_client *client = data->client;
96 u8 expected_event = EXC3000_MT1_EVENT;
97 int ret;
98
> 99 if (data->info->max_xy == SZ_16K - 1)
100 expected_event = EXC3000_MT2_EVENT;
101
102 ret = i2c_master_send(client, "'", 2);
103 if (ret < 0)
104 return ret;
105
106 if (ret != 2)
107 return -EIO;
108
109 ret = i2c_master_recv(client, buf, EXC3000_LEN_FRAME);
110 if (ret < 0)
111 return ret;
112
113 if (ret != EXC3000_LEN_FRAME)
114 return -EIO;
115
116 if (get_unaligned_le16(buf) != EXC3000_LEN_FRAME)
117 return -EINVAL;
118
119 if (buf[2] != expected_event)
120 return -EINVAL;
121
122 return 0;
123 }
124
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [linux-next:master 5639/6402] net/ipv4/tcp_output.c:188:3: warning: result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned char') is always false
by Li, Philip
> Subject: Re: [linux-next:master 5639/6402] net/ipv4/tcp_output.c:188:3: warning:
> result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned
> char') is always false
>
> On Wed, May 20, 2020 at 12:09:47AM +0800, kbuild test robot wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > head: dfd71d381f7e1aa118e0368774aa05f5c4a48870
> > commit: 2b195850128f5bafde177b12489d9fa27962cc1e [5639/6402] tcp: add tp-
> >dup_ack_counter
> > config: x86_64-randconfig-r012-20200519 (attached as .config)
> > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project
> 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
> > 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
> > git checkout 2b195850128f5bafde177b12489d9fa27962cc1e
> > # 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 <lkp(a)intel.com>
> >
> > All warnings (new ones prefixed by >>, old ones prefixed by <<):
> >
> > >> net/ipv4/tcp_output.c:188:3: warning: result of comparison of constant -1 with
> expression of type 'u8' (aka 'unsigned char') is always false [-Wtautological-
> constant-out-of-range-compare]
> > NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPACKCOMPRESSED,
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > include/net/ip.h:293:41: note: expanded from macro 'NET_ADD_STATS'
> > #define NET_ADD_STATS(net, field, adnd) SNMP_ADD_STATS((net)-
> >mib.net_statistics, field, adnd)
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > include/net/snmp.h:143:4: note: expanded from macro 'SNMP_ADD_STATS'
> > this_cpu_add(mib->mibs[field], addend)
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > include/linux/percpu-defs.h:509:33: note: expanded from macro 'this_cpu_add'
> > #define this_cpu_add(pcp, val) __pcpu_size_call(this_cpu_add_, pcp, val)
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see
> all)
> > <scratch space>:292:1: note: expanded from here
> > this_cpu_add_8
> > ^
> > arch/x86/include/asm/percpu.h:492:35: note: expanded from macro
> 'this_cpu_add_8'
> > #define this_cpu_add_8(pcp, val) percpu_add_op(volatile, (pcp), val)
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > arch/x86/include/asm/percpu.h:131:31: note: expanded from macro
> 'percpu_add_op'
> > ((val) == 1 || (val) == -1)) ? ~~~~~ ^ ~~
> > 1 warning generated.
>
> This warning is supposed to be disabled under a regular build, is W=1
> being turned on (see scripts/Makefile.extrawarn)?
Yes, this is turned on. Do you have any suggestion/comments for this, we can
further tune the make command?
>
> Cheers,
> Nathan
2 years, 4 months
Re: [RFC PATCH 2/4] gpu: dxgkrnl: hook up dxgkrnl
by kbuild test robot
Hi Sasha,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on linus/master]
[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/Sasha-Levin/DirectX-on-Linux/202...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 642b151f45dd54809ea00ecd3976a56c1ec9b53d
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/printk.h:326:0,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/gpu/dxgkrnl/dxgmodule.c:14:
drivers/gpu/dxgkrnl/dxgmodule.c: In function 'dxgglobal_getiospace':
>> drivers/gpu/dxgkrnl/misc.h:215:22: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 6 has type 'resource_size_t {aka unsigned int}' [-Wformat=]
#define pr_fmt2(fmt) "dxgk:err: " fmt
^
include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
func(&id, ##__VA_ARGS__); ^~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:2: note: in expansion of macro 'dev_dbg'
dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:24: note: in expansion of macro 'pr_fmt2'
dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/dxgmodule.c:305:2: note: in expansion of macro 'TRACE_DEBUG'
TRACE_DEBUG(1, "mmio allocated %llx %llx %llx %llxn",
^~~~~~~~~~~
drivers/gpu/dxgkrnl/dxgmodule.c:305:47: note: format string is defined here
TRACE_DEBUG(1, "mmio allocated %llx %llx %llx %llxn",
~~~^
%x
In file included from include/linux/printk.h:326:0,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/gpu/dxgkrnl/dxgmodule.c:14:
drivers/gpu/dxgkrnl/misc.h:215:22: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 7 has type 'resource_size_t {aka unsigned int}' [-Wformat=]
#define pr_fmt2(fmt) "dxgk:err: " fmt
^
include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
func(&id, ##__VA_ARGS__); ^~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:2: note: in expansion of macro 'dev_dbg'
dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:24: note: in expansion of macro 'pr_fmt2'
dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/dxgmodule.c:305:2: note: in expansion of macro 'TRACE_DEBUG'
TRACE_DEBUG(1, "mmio allocated %llx %llx %llx %llxn",
^~~~~~~~~~~
drivers/gpu/dxgkrnl/dxgmodule.c:305:52: note: format string is defined here
TRACE_DEBUG(1, "mmio allocated %llx %llx %llx %llxn",
~~~^
%x
drivers/gpu/dxgkrnl/dxgmodule.c: At top level:
drivers/gpu/dxgkrnl/dxgmodule.c:509:4: error: 'HV_GPUP_DXGK_VGPU_GUID' undeclared here (not in a function); did you mean 'HV_KVP_GUID'?
{ HV_GPUP_DXGK_VGPU_GUID },
^~~~~~~~~~~~~~~~~~~~~~
HV_KVP_GUID
drivers/gpu/dxgkrnl/dxgmodule.c:511:4: error: 'HV_GPUP_DXGK_GLOBAL_GUID' undeclared here (not in a function); did you mean 'HV_GPUP_DXGK_VGPU_GUID'?
{ HV_GPUP_DXGK_GLOBAL_GUID },
^~~~~~~~~~~~~~~~~~~~~~~~
HV_GPUP_DXGK_VGPU_GUID
--
In file included from include/linux/printk.h:7:0,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/fcntl.h:5,
from include/linux/eventfd.h:12,
from drivers/gpu/dxgkrnl/ioctl.c:14:
drivers/gpu/dxgkrnl/ioctl.c: In function 'dxgk_create_allocation':
include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'unsigned int' [-Wformat=]
#define KERN_SOH "001" /* ASCII Start Of Header */
^
include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
#define KERN_ERR KERN_SOH "3" /* error conditions */
^~~~~~~~
include/linux/printk.h:299:9: note: in expansion of macro 'KERN_ERR'
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~
>> drivers/gpu/dxgkrnl/ioctl.c:1265:4: note: in expansion of macro 'pr_err'
pr_err("private data size is too big: %d %d %ld",
^~~~~~
drivers/gpu/dxgkrnl/ioctl.c:1265:50: note: format string is defined here
pr_err("private data size is too big: %d %d %ld",
~~^
%d
drivers/gpu/dxgkrnl/ioctl.c: At top level:
drivers/gpu/dxgkrnl/ioctl.c:1568:5: warning: no previous prototype for 'validate_alloc' [-Wmissing-prototypes]
int validate_alloc(struct dxgallocation *alloc0,
^~~~~~~~~~~~~~
drivers/gpu/dxgkrnl/ioctl.c: In function 'dxgk_create_sync_object':
drivers/gpu/dxgkrnl/ioctl.c:2493:7: warning: variable 'host_event_added' set but not used [-Wunused-but-set-variable]
bool host_event_added = false;
^~~~~~~~~~~~~~~~
drivers/gpu/dxgkrnl/ioctl.c: In function 'dxgk_signal_sync_object':
>> drivers/gpu/dxgkrnl/ioctl.c:2973:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
NULL, (void *)host_event_id, 0);
^
drivers/gpu/dxgkrnl/ioctl.c: In function 'dxgk_signal_sync_object_gpu2':
drivers/gpu/dxgkrnl/ioctl.c:3199:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(void *)host_event_id, 0);
^
drivers/gpu/dxgkrnl/ioctl.c: At top level:
drivers/gpu/dxgkrnl/ioctl.c:4734:5: warning: no previous prototype for 'assign_resource_handles' [-Wmissing-prototypes]
int assign_resource_handles(struct dxgprocess *process,
^~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/dxgkrnl/ioctl.c:4793:5: warning: no previous prototype for 'open_resource' [-Wmissing-prototypes]
int open_resource(struct dxgprocess *process,
^~~~~~~~~~~~~
--
drivers/gpu/dxgkrnl/dxgvmbus.c:108:6: warning: no previous prototype for 'signal_guest_event' [-Wmissing-prototypes]
void signal_guest_event(struct dxgkvmb_command_host_to_vm *packet,
^~~~~~~~~~~~~~~~~~
drivers/gpu/dxgkrnl/dxgvmbus.c:126:6: warning: no previous prototype for 'process_inband_packet' [-Wmissing-prototypes]
void process_inband_packet(struct dxgvmbuschannel *channel,
^~~~~~~~~~~~~~~~~~~~~
drivers/gpu/dxgkrnl/dxgvmbus.c:158:6: warning: no previous prototype for 'process_completion_packet' [-Wmissing-prototypes]
void process_completion_packet(struct dxgvmbuschannel *channel,
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/dxgkrnl/dxgvmbus.c:785:5: warning: no previous prototype for 'create_existing_sysmem' [-Wmissing-prototypes]
int create_existing_sysmem(struct dxgdevice *device,
^~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/printk.h:326:0,
from include/linux/kernel.h:15,
from drivers/gpu/dxgkrnl/dxgvmbus.c:14:
drivers/gpu/dxgkrnl/dxgvmbus.c: In function 'dxgvmb_send_create_allocation':
>> drivers/gpu/dxgkrnl/misc.h:215:22: warning: format '%ld' expects argument of type 'long int', but argument 6 has type 'unsigned int' [-Wformat=]
#define pr_fmt2(fmt) "dxgk:err: " fmt
^
include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
func(&id, ##__VA_ARGS__); ^~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:2: note: in expansion of macro 'dev_dbg'
dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:24: note: in expansion of macro 'pr_fmt2'
dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/dxgvmbus.c:1139:2: note: in expansion of macro 'TRACE_DEBUG'
TRACE_DEBUG(1, "command size, driver_data_size %d %d %ld %ld",
^~~~~~~~~~~
drivers/gpu/dxgkrnl/dxgvmbus.c:1139:57: note: format string is defined here
TRACE_DEBUG(1, "command size, driver_data_size %d %d %ld %ld",
~~^
%d
In file included from include/linux/printk.h:326:0,
from include/linux/kernel.h:15,
from drivers/gpu/dxgkrnl/dxgvmbus.c:14:
drivers/gpu/dxgkrnl/misc.h:215:22: warning: format '%ld' expects argument of type 'long int', but argument 7 has type 'unsigned int' [-Wformat=]
#define pr_fmt2(fmt) "dxgk:err: " fmt
^
include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
func(&id, ##__VA_ARGS__); ^~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt,__dynamic_dev_dbg, ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:2: note: in expansion of macro 'dev_dbg'
dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/misc.h:254:24: note: in expansion of macro 'pr_fmt2'
dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)
^~~~~~~
>> drivers/gpu/dxgkrnl/dxgvmbus.c:1139:2: note: in expansion of macro 'TRACE_DEBUG'
TRACE_DEBUG(1, "command size, driver_data_size %d %d %ld %ld",
^~~~~~~~~~~
drivers/gpu/dxgkrnl/dxgvmbus.c:1139:61: note: format string is defined here
TRACE_DEBUG(1, "command size, driver_data_size %d %d %ld %ld",
~~^
%d
drivers/gpu/dxgkrnl/dxgvmbus.c: In function 'dxgvmb_send_signal_sync_object':
>> drivers/gpu/dxgkrnl/dxgvmbus.c:1632:31: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
command->cpu_event_handle = (winhandle) cpu_event_handle;
^
drivers/gpu/dxgkrnl/dxgvmbus.c: In function 'dxgvmb_send_lock2':
drivers/gpu/dxgkrnl/dxgvmbus.c:1797:32: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
args->data = dxg_map_iospace((uint64_t) result.
^
vim +215 drivers/gpu/dxgkrnl/misc.h
9cc562c3695b5b44 Sasha Levin 2020-05-19 212
9cc562c3695b5b44 Sasha Levin 2020-05-19 213 #undef pr_fmt
9cc562c3695b5b44 Sasha Levin 2020-05-19 214 #define pr_fmt(fmt) "dxgk:err: " fmt
9cc562c3695b5b44 Sasha Levin 2020-05-19 @215 #define pr_fmt2(fmt) "dxgk:err: " fmt
9cc562c3695b5b44 Sasha Levin 2020-05-19 216
9cc562c3695b5b44 Sasha Levin 2020-05-19 217 #define DXGKDEBUG 1
9cc562c3695b5b44 Sasha Levin 2020-05-19 218 /* #define USEPRINTK 1 */
9cc562c3695b5b44 Sasha Levin 2020-05-19 219
9cc562c3695b5b44 Sasha Levin 2020-05-19 220 #ifndef DXGKDEBUG
9cc562c3695b5b44 Sasha Levin 2020-05-19 221 #define TRACE_DEBUG(...)
9cc562c3695b5b44 Sasha Levin 2020-05-19 222 #define TRACE_DEFINE(...)
9cc562c3695b5b44 Sasha Levin 2020-05-19 223 #define TRACE_FUNC_ENTER(...)
9cc562c3695b5b44 Sasha Levin 2020-05-19 224 #define TRACE_FUNC_EXIT(...)
9cc562c3695b5b44 Sasha Levin 2020-05-19 225 #else
9cc562c3695b5b44 Sasha Levin 2020-05-19 226 #ifdef USEPRINTK
9cc562c3695b5b44 Sasha Levin 2020-05-19 227 #define TRACE_DEBUG(level, fmt, ...)\
9cc562c3695b5b44 Sasha Levin 2020-05-19 228 printk(KERN_DEBUG pr_fmt2(fmt), ##__VA_ARGS__);
9cc562c3695b5b44 Sasha Levin 2020-05-19 229
9cc562c3695b5b44 Sasha Levin 2020-05-19 230 #define TRACE_DEBUG2(level, offset, fmt, ...) \
9cc562c3695b5b44 Sasha Levin 2020-05-19 231 do { \
9cc562c3695b5b44 Sasha Levin 2020-05-19 232 if (offset == 0) \
9cc562c3695b5b44 Sasha Levin 2020-05-19 233 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
9cc562c3695b5b44 Sasha Levin 2020-05-19 234 else \
9cc562c3695b5b44 Sasha Levin 2020-05-19 235 printk(KERN_DEBUG pr_fmt2(fmt), ##__VA_ARGS__); \
9cc562c3695b5b44 Sasha Levin 2020-05-19 236 } while (false)
9cc562c3695b5b44 Sasha Levin 2020-05-19 237
9cc562c3695b5b44 Sasha Levin 2020-05-19 238 #define TRACE_FUNC_ENTER(msg) \
9cc562c3695b5b44 Sasha Levin 2020-05-19 239 printk(KERN_DEBUG "dxgk: %s", msg)
9cc562c3695b5b44 Sasha Levin 2020-05-19 240 #define TRACE_FUNC_EXIT(msg, ret) \
9cc562c3695b5b44 Sasha Levin 2020-05-19 241 do { \
9cc562c3695b5b44 Sasha Levin 2020-05-19 242 if (!NT_SUCCESS(ret)) \
9cc562c3695b5b44 Sasha Levin 2020-05-19 243 dxg_pr_err("%s %x %d", msg, ret, ret); \
9cc562c3695b5b44 Sasha Levin 2020-05-19 244 else \
9cc562c3695b5b44 Sasha Levin 2020-05-19 245 printk(KERN_DEBUG "dxgk: %s end", msg); \
9cc562c3695b5b44 Sasha Levin 2020-05-19 246 } while (false)
9cc562c3695b5b44 Sasha Levin 2020-05-19 247 #define TRACE_FUNC_EXIT_ERR(msg, ret) \
9cc562c3695b5b44 Sasha Levin 2020-05-19 248 do { \
9cc562c3695b5b44 Sasha Levin 2020-05-19 249 if (!NT_SUCCESS(ret)) \
9cc562c3695b5b44 Sasha Levin 2020-05-19 250 dxg_pr_err("%s %x", msg, ret); \
9cc562c3695b5b44 Sasha Levin 2020-05-19 251 } while (false)
9cc562c3695b5b44 Sasha Levin 2020-05-19 252 #else
9cc562c3695b5b44 Sasha Levin 2020-05-19 253 #define TRACE_DEBUG(level, fmt, ...)\
9cc562c3695b5b44 Sasha Levin 2020-05-19 @254 dev_dbg(dxgglobaldev, pr_fmt2(fmt), ##__VA_ARGS__)
9cc562c3695b5b44 Sasha Levin 2020-05-19 255
:::::: The code at line 215 was first introduced by commit
:::::: 9cc562c3695b5b44c0c931c76bdc24e8c4f33587 gpu: dxgkrnl: core code
:::::: TO: Sasha Levin <sashal(a)kernel.org>
:::::: CC: 0day robot <lkp(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [RFC PATCH 2/4] gpu: dxgkrnl: hook up dxgkrnl
by kbuild test robot
Hi Sasha,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on linus/master]
[also build test WARNING on v5.7-rc6 next-20200519]
[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/Sasha-Levin/DirectX-on-Linux/202...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 642b151f45dd54809ea00ecd3976a56c1ec9b53d
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
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 <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/gpu/dxgkrnl/hmgr.c:91:6: warning: no previous prototype for function 'get_instance' [-Wmissing-prototypes]
uint get_instance(d3dkmt_handle h)
^
drivers/gpu/dxgkrnl/hmgr.c:91:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
uint get_instance(d3dkmt_handle h)
^
static
>> drivers/gpu/dxgkrnl/hmgr.c:178:6: warning: no previous prototype for function 'print_status' [-Wmissing-prototypes]
void print_status(struct hmgrtable *table)
^
drivers/gpu/dxgkrnl/hmgr.c:178:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void print_status(struct hmgrtable *table)
^
static
>> drivers/gpu/dxgkrnl/hmgr.c:549:21: warning: no previous prototype for function 'hmgrtable_get_entry_type' [-Wmissing-prototypes]
enum hmgrentry_type hmgrtable_get_entry_type(struct hmgrtable *table,
^
drivers/gpu/dxgkrnl/hmgr.c:549:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
enum hmgrentry_type hmgrtable_get_entry_type(struct hmgrtable *table,
^
static
drivers/gpu/dxgkrnl/hmgr.c:173:20: warning: unused function 'is_empty' [-Wunused-function]
static inline bool is_empty(struct hmgrtable *table)
^
4 warnings generated.
--
>> drivers/gpu/dxgkrnl/dxgadapter.c:281:6: warning: no previous prototype for function 'dxgdevice_mark_destroyed' [-Wmissing-prototypes]
void dxgdevice_mark_destroyed(struct dxgdevice *device)
^
drivers/gpu/dxgkrnl/dxgadapter.c:281:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void dxgdevice_mark_destroyed(struct dxgdevice *device)
^
static
>> drivers/gpu/dxgkrnl/dxgadapter.c:664:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
refcount_inc_not_zero(&resource->refcount);
^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
drivers/gpu/dxgkrnl/dxgadapter.c:1326:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
refcount_inc_not_zero(&syncobj->refcount);
^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
3 warnings generated.
--
In file included from drivers/gpu/dxgkrnl/ioctl.c:21:
drivers/gpu/dxgkrnl/dxgvmbus.h:826:26: warning: implicit conversion from enumeration type 'enum dxgkvmb_commandtype' to different enumeration type 'enum dxgkvmb_commandtype_global' [-Wenum-conversion]
command->command_type = DXGK_VMBCOMMAND_INVALID;
~ ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/dxgkrnl/ioctl.c:1568:5: warning: no previous prototype for function 'validate_alloc' [-Wmissing-prototypes]
int validate_alloc(struct dxgallocation *alloc0,
^
drivers/gpu/dxgkrnl/ioctl.c:1568:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int validate_alloc(struct dxgallocation *alloc0,
^
static
>> drivers/gpu/dxgkrnl/ioctl.c:4734:5: warning: no previous prototype for function 'assign_resource_handles' [-Wmissing-prototypes]
int assign_resource_handles(struct dxgprocess *process,
^
drivers/gpu/dxgkrnl/ioctl.c:4734:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int assign_resource_handles(struct dxgprocess *process,
^
static
>> drivers/gpu/dxgkrnl/ioctl.c:4793:5: warning: no previous prototype for function 'open_resource' [-Wmissing-prototypes]
int open_resource(struct dxgprocess *process,
^
drivers/gpu/dxgkrnl/ioctl.c:4793:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int open_resource(struct dxgprocess *process,
^
static
4 warnings generated.
--
In file included from drivers/gpu/dxgkrnl/dxgvmbus.c:22:
drivers/gpu/dxgkrnl/dxgvmbus.h:826:26: warning: implicit conversion from enumeration type 'enum dxgkvmb_commandtype' to different enumeration type 'enum dxgkvmb_commandtype_global' [-Wenum-conversion]
command->command_type = DXGK_VMBCOMMAND_INVALID;
~ ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/dxgkrnl/dxgvmbus.c:108:6: warning: no previous prototype for function 'signal_guest_event' [-Wmissing-prototypes]
void signal_guest_event(struct dxgkvmb_command_host_to_vm *packet,
^
drivers/gpu/dxgkrnl/dxgvmbus.c:108:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void signal_guest_event(struct dxgkvmb_command_host_to_vm *packet,
^
static
>> drivers/gpu/dxgkrnl/dxgvmbus.c:126:6: warning: no previous prototype for function 'process_inband_packet' [-Wmissing-prototypes]
void process_inband_packet(struct dxgvmbuschannel *channel,
^
drivers/gpu/dxgkrnl/dxgvmbus.c:126:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void process_inband_packet(struct dxgvmbuschannel *channel,
^
static
>> drivers/gpu/dxgkrnl/dxgvmbus.c:158:6: warning: no previous prototype for function 'process_completion_packet' [-Wmissing-prototypes]
void process_completion_packet(struct dxgvmbuschannel *channel,
^
drivers/gpu/dxgkrnl/dxgvmbus.c:158:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void process_completion_packet(struct dxgvmbuschannel *channel,
^
static
>> drivers/gpu/dxgkrnl/dxgvmbus.c:785:5: warning: no previous prototype for function 'create_existing_sysmem' [-Wmissing-prototypes]
int create_existing_sysmem(struct dxgdevice *device,
^
drivers/gpu/dxgkrnl/dxgvmbus.c:785:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int create_existing_sysmem(struct dxgdevice *device,
^
static
drivers/gpu/dxgkrnl/dxgvmbus.c:88:20: warning: unused function 'command_vm_to_host_init0' [-Wunused-function]
static inline void command_vm_to_host_init0(struct dxgkvmb_command_vm_to_host
^
6 warnings generated.
vim +/get_instance +91 drivers/gpu/dxgkrnl/hmgr.c
9cc562c3695b5b Sasha Levin 2020-05-19 90
9cc562c3695b5b Sasha Levin 2020-05-19 @91 uint get_instance(d3dkmt_handle h)
9cc562c3695b5b Sasha Levin 2020-05-19 92 {
9cc562c3695b5b Sasha Levin 2020-05-19 93 return (h & HMGRHANDLE_INSTANCE_MASK) >> HMGRHANDLE_INSTANCE_SHIFT;
9cc562c3695b5b Sasha Levin 2020-05-19 94 }
9cc562c3695b5b Sasha Levin 2020-05-19 95
9cc562c3695b5b Sasha Levin 2020-05-19 96 static bool is_handle_valid(struct hmgrtable *table, d3dkmt_handle h,
9cc562c3695b5b Sasha Levin 2020-05-19 97 bool ignore_destroyed, enum hmgrentry_type t)
9cc562c3695b5b Sasha Levin 2020-05-19 98 {
9cc562c3695b5b Sasha Levin 2020-05-19 99 uint index = get_index(h);
9cc562c3695b5b Sasha Levin 2020-05-19 100 uint unique = get_unique(h);
9cc562c3695b5b Sasha Levin 2020-05-19 101 struct hmgrentry *entry;
9cc562c3695b5b Sasha Levin 2020-05-19 102
9cc562c3695b5b Sasha Levin 2020-05-19 103 if (index >= table->table_size) {
9cc562c3695b5b Sasha Levin 2020-05-19 104 pr_err("%s Invalid index %x %d\n", __func__, h, index);
9cc562c3695b5b Sasha Levin 2020-05-19 105 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 106 }
9cc562c3695b5b Sasha Levin 2020-05-19 107
9cc562c3695b5b Sasha Levin 2020-05-19 108 entry = &table->entry_table[index];
9cc562c3695b5b Sasha Levin 2020-05-19 109 if (unique != entry->unique) {
9cc562c3695b5b Sasha Levin 2020-05-19 110 pr_err("%s Invalid unique %x %d %d %d %p",
9cc562c3695b5b Sasha Levin 2020-05-19 111 __func__, h, unique, entry->unique,
9cc562c3695b5b Sasha Levin 2020-05-19 112 index, entry->object);
9cc562c3695b5b Sasha Levin 2020-05-19 113 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 114 }
9cc562c3695b5b Sasha Levin 2020-05-19 115
9cc562c3695b5b Sasha Levin 2020-05-19 116 if (entry->destroyed && !ignore_destroyed) {
9cc562c3695b5b Sasha Levin 2020-05-19 117 pr_err("%s Invalid destroyed", __func__);
9cc562c3695b5b Sasha Levin 2020-05-19 118 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 119 }
9cc562c3695b5b Sasha Levin 2020-05-19 120
9cc562c3695b5b Sasha Levin 2020-05-19 121 if (entry->type == HMGRENTRY_TYPE_FREE) {
9cc562c3695b5b Sasha Levin 2020-05-19 122 pr_err("%s Entry is freed %x %d", __func__, h, index);
9cc562c3695b5b Sasha Levin 2020-05-19 123 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 124 }
9cc562c3695b5b Sasha Levin 2020-05-19 125
9cc562c3695b5b Sasha Levin 2020-05-19 126 if (t != HMGRENTRY_TYPE_FREE && t != entry->type) {
9cc562c3695b5b Sasha Levin 2020-05-19 127 pr_err("%s type mismatch %x %d %d", __func__, h,
9cc562c3695b5b Sasha Levin 2020-05-19 128 t, entry->type);
9cc562c3695b5b Sasha Levin 2020-05-19 129 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 130 }
9cc562c3695b5b Sasha Levin 2020-05-19 131
9cc562c3695b5b Sasha Levin 2020-05-19 132 return true;
9cc562c3695b5b Sasha Levin 2020-05-19 133 }
9cc562c3695b5b Sasha Levin 2020-05-19 134
9cc562c3695b5b Sasha Levin 2020-05-19 135 static d3dkmt_handle build_handle(uint index, uint unique, uint instance)
9cc562c3695b5b Sasha Levin 2020-05-19 136 {
9cc562c3695b5b Sasha Levin 2020-05-19 137 uint handle_bits;
9cc562c3695b5b Sasha Levin 2020-05-19 138
9cc562c3695b5b Sasha Levin 2020-05-19 139 handle_bits = (index << HMGRHANDLE_INDEX_SHIFT) & HMGRHANDLE_INDEX_MASK;
9cc562c3695b5b Sasha Levin 2020-05-19 140 handle_bits |= (unique << HMGRHANDLE_UNIQUE_SHIFT) &
9cc562c3695b5b Sasha Levin 2020-05-19 141 HMGRHANDLE_UNIQUE_MASK;
9cc562c3695b5b Sasha Levin 2020-05-19 142 handle_bits |= (instance << HMGRHANDLE_INSTANCE_SHIFT) &
9cc562c3695b5b Sasha Levin 2020-05-19 143 HMGRHANDLE_INSTANCE_MASK;
9cc562c3695b5b Sasha Levin 2020-05-19 144
9cc562c3695b5b Sasha Levin 2020-05-19 145 return (d3dkmt_handle) handle_bits;
9cc562c3695b5b Sasha Levin 2020-05-19 146 }
9cc562c3695b5b Sasha Levin 2020-05-19 147
9cc562c3695b5b Sasha Levin 2020-05-19 148 inline uint hmgrtable_get_used_entry_count(struct hmgrtable *table)
9cc562c3695b5b Sasha Levin 2020-05-19 149 {
9cc562c3695b5b Sasha Levin 2020-05-19 150 DXGKRNL_ASSERT(table->table_size >= table->free_count);
9cc562c3695b5b Sasha Levin 2020-05-19 151 return (table->table_size - table->free_count);
9cc562c3695b5b Sasha Levin 2020-05-19 152 }
9cc562c3695b5b Sasha Levin 2020-05-19 153
9cc562c3695b5b Sasha Levin 2020-05-19 154 bool hmgrtable_mark_destroyed(struct hmgrtable *table, d3dkmt_handle h)
9cc562c3695b5b Sasha Levin 2020-05-19 155 {
9cc562c3695b5b Sasha Levin 2020-05-19 156 if (!is_handle_valid(table, h, false, HMGRENTRY_TYPE_FREE))
9cc562c3695b5b Sasha Levin 2020-05-19 157 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 158
9cc562c3695b5b Sasha Levin 2020-05-19 159 table->entry_table[get_index(h)].destroyed = true;
9cc562c3695b5b Sasha Levin 2020-05-19 160 return true;
9cc562c3695b5b Sasha Levin 2020-05-19 161 }
9cc562c3695b5b Sasha Levin 2020-05-19 162
9cc562c3695b5b Sasha Levin 2020-05-19 163 bool hmgrtable_unmark_destroyed(struct hmgrtable *table, d3dkmt_handle h)
9cc562c3695b5b Sasha Levin 2020-05-19 164 {
9cc562c3695b5b Sasha Levin 2020-05-19 165 if (!is_handle_valid(table, h, true, HMGRENTRY_TYPE_FREE))
9cc562c3695b5b Sasha Levin 2020-05-19 166 return true;
9cc562c3695b5b Sasha Levin 2020-05-19 167
9cc562c3695b5b Sasha Levin 2020-05-19 168 DXGKRNL_ASSERT(table->entry_table[get_index(h)].destroyed);
9cc562c3695b5b Sasha Levin 2020-05-19 169 table->entry_table[get_index(h)].destroyed = 0;
9cc562c3695b5b Sasha Levin 2020-05-19 170 return true;
9cc562c3695b5b Sasha Levin 2020-05-19 171 }
9cc562c3695b5b Sasha Levin 2020-05-19 172
9cc562c3695b5b Sasha Levin 2020-05-19 173 static inline bool is_empty(struct hmgrtable *table)
9cc562c3695b5b Sasha Levin 2020-05-19 174 {
9cc562c3695b5b Sasha Levin 2020-05-19 175 return (table->free_count == table->table_size);
9cc562c3695b5b Sasha Levin 2020-05-19 176 }
9cc562c3695b5b Sasha Levin 2020-05-19 177
9cc562c3695b5b Sasha Levin 2020-05-19 @178 void print_status(struct hmgrtable *table)
9cc562c3695b5b Sasha Levin 2020-05-19 179 {
9cc562c3695b5b Sasha Levin 2020-05-19 180 int i;
9cc562c3695b5b Sasha Levin 2020-05-19 181
9cc562c3695b5b Sasha Levin 2020-05-19 182 TRACE_DEBUG(1, "hmgrtable head, tail %p %d %d\n",
9cc562c3695b5b Sasha Levin 2020-05-19 183 table, table->free_handle_list_head,
9cc562c3695b5b Sasha Levin 2020-05-19 184 table->free_handle_list_tail);
9cc562c3695b5b Sasha Levin 2020-05-19 185 if (table->entry_table == NULL)
9cc562c3695b5b Sasha Levin 2020-05-19 186 return;
9cc562c3695b5b Sasha Levin 2020-05-19 187 for (i = 0; i < 3; i++) {
9cc562c3695b5b Sasha Levin 2020-05-19 188 if (table->entry_table[i].type != HMGRENTRY_TYPE_FREE)
9cc562c3695b5b Sasha Levin 2020-05-19 189 TRACE_DEBUG(1, "hmgrtable entry %p %d %p\n",
9cc562c3695b5b Sasha Levin 2020-05-19 190 table, i, table->entry_table[i].object);
9cc562c3695b5b Sasha Levin 2020-05-19 191 else
9cc562c3695b5b Sasha Levin 2020-05-19 192 TRACE_DEBUG(1, "hmgrtable entry %p %d %d %d\n",
9cc562c3695b5b Sasha Levin 2020-05-19 193 table, i,
9cc562c3695b5b Sasha Levin 2020-05-19 194 table->entry_table[i].next_free_index,
9cc562c3695b5b Sasha Levin 2020-05-19 195 table->entry_table[i].prev_free_index);
9cc562c3695b5b Sasha Levin 2020-05-19 196 }
9cc562c3695b5b Sasha Levin 2020-05-19 197 }
9cc562c3695b5b Sasha Levin 2020-05-19 198
:::::: The code at line 91 was first introduced by commit
:::::: 9cc562c3695b5b44c0c931c76bdc24e8c4f33587 gpu: dxgkrnl: core code
:::::: TO: Sasha Levin <sashal(a)kernel.org>
:::::: CC: 0day robot <lkp(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[linux-next:master 7920/10701] drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1775:21: warning: variable 'msta' set but not used
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: fb57b1fabcb28f358901b2df90abd2b48abc1ca8
commit: 89029a85482cbcf68026a89fc974e8f6898d6b37 [7920/10701] mt76: mt7915: add Tx beamformer support
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 89029a85482cbcf68026a89fc974e8f6898d6b37
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c: In function 'mt7915_mcu_sta_txbf_type':
>> drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1775:21: warning: variable 'msta' set but not used [-Wunused-but-set-variable]
1775 | struct mt7915_sta *msta;
| ^~~~
vim +/msta +1775 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
1770
1771 static u8
1772 mt7915_mcu_sta_txbf_type(struct mt7915_phy *phy, struct ieee80211_vif *vif,
1773 struct ieee80211_sta *sta)
1774 {
> 1775 struct mt7915_sta *msta;
1776 u8 type = 0;
1777
1778 if (vif->type != NL80211_IFTYPE_STATION &&
1779 vif->type != NL80211_IFTYPE_AP)
1780 return 0;
1781
1782 msta = (struct mt7915_sta *)sta->drv_priv;
1783
1784 if (sta->he_cap.has_he) {
1785 struct ieee80211_he_cap_elem *pe;
1786 const struct ieee80211_he_cap_elem *ve;
1787 const struct ieee80211_sta_he_cap *vc;
1788
1789 pe = &sta->he_cap.he_cap_elem;
1790 vc = mt7915_get_he_phy_cap(phy, vif);
1791 ve = &vc->he_cap_elem;
1792
1793 if ((HE_PHY(CAP3_SU_BEAMFORMER, ve->phy_cap_info[3]) ||
1794 HE_PHY(CAP4_MU_BEAMFORMER, ve->phy_cap_info[4])) &&
1795 HE_PHY(CAP4_SU_BEAMFORMEE, pe->phy_cap_info[4]))
1796 type |= MT_STA_BFER;
1797 } else if (sta->vht_cap.vht_supported) {
1798 struct ieee80211_sta_vht_cap *pc;
1799 struct ieee80211_sta_vht_cap *vc;
1800 u32 cr, ce;
1801
1802 pc = &sta->vht_cap;
1803 vc = &phy->mt76->sband_5g.sband.vht_cap;
1804 cr = IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE |
1805 IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE;
1806 ce = IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
1807 IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE;
1808
1809 if ((vc->cap & cr) && (pc->cap & ce))
1810 type |= MT_STA_BFER;
1811 } else if (sta->ht_cap.ht_supported) {
1812 /* TODO: iBF */
1813 }
1814
1815 return type;
1816 }
1817
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [RFC v2 PATCH 5/8] qaic: Implement data path
by kbuild test robot
Hi Jeffrey,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on soc/for-next linus/master v5.7-rc6 next-20200519]
[cannot apply to linux/master]
[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/Jeffrey-Hugo/Qualcomm-Cloud-AI-1...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 57c76221d5af648c8355a55c09b050c5d8d38189
config: x86_64-allmodconfig (attached as .config)
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-193-gb8fad4bc-dirty
# save the attached .config to linux build tree
make C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/misc/qaic/qaic_data.c:455:26: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le64 [usertype] db_data @@ got restricted __le64 [usertype] db_data @@
>> drivers/misc/qaic/qaic_data.c:455:26: sparse: expected restricted __le64 [usertype] db_data
>> drivers/misc/qaic/qaic_data.c:455:26: sparse: got restricted __le32 [usertype]
>> drivers/misc/qaic/qaic_data.c:465:16: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] req_id @@ got resunsigned short [usertype] req_id @@
>> drivers/misc/qaic/qaic_data.c:465:16: sparse: expected unsigned short [usertype] req_id
>> drivers/misc/qaic/qaic_data.c:465:16: sparse: got restricted __le16 [usertype]
>> drivers/misc/qaic/qaic_data.c:506:37: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] req_id @@ got tricted __le16 [usertype] req_id @@
>> drivers/misc/qaic/qaic_data.c:506:37: sparse: expected restricted __le16 [usertype] req_id
>> drivers/misc/qaic/qaic_data.c:506:37: sparse: got unsigned short [usertype] req_id
>> drivers/misc/qaic/qaic_data.c:556:30: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] db_data @@ got restricted __le32 [usertype] db_data @@
>> drivers/misc/qaic/qaic_data.c:556:30: sparse: expected restricted __le32 [usertype] db_data
>> drivers/misc/qaic/qaic_data.c:556:30: sparse: got restricted __le64 [usertype] db_data
>> drivers/misc/qaic/qaic_data.c:595:20: sparse: sparse: cast to restricted __le32
drivers/misc/qaic/qaic_data.c:596:20: sparse: sparse: cast to restricted __le32
>> drivers/misc/qaic/qaic_data.c:637:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int val @@ got restricted __le3unsigned int val @@
>> drivers/misc/qaic/qaic_data.c:637:9: sparse: expected unsigned int val
drivers/misc/qaic/qaic_data.c:637:9: sparse: got restricted __le32 [usertype]
drivers/misc/qaic/qaic_data.c:789:16: sparse: sparse: cast to restricted __le32
drivers/misc/qaic/qaic_data.c:790:16: sparse: sparse: cast to restricted __le32
drivers/misc/qaic/qaic_data.c:833:17: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int val @@ got restricted __le3unsigned int val @@
drivers/misc/qaic/qaic_data.c:833:17: sparse: expected unsigned int val
drivers/misc/qaic/qaic_data.c:833:17: sparse: got restricted __le32 [usertype]
vim +455 drivers/misc/qaic/qaic_data.c
448
449 static int encode_execute(struct qaic_device *qdev, struct mem_handle *mem,
450 struct qaic_execute *exec, u16 req_id)
451 {
452 u8 cmd = BULK_XFER;
453 __le64 db_addr = cpu_to_le64(exec->db_addr);
454 u8 db_len;
> 455 __le64 db_data = cpu_to_le32(exec->db_data);
456 struct scatterlist *sg;
457 u64 dev_addr;
458 int presync_sem;
459 int i;
460
461 if (!mem->no_xfer)
462 cmd |= (exec->dir == DMA_TO_DEVICE ? INBOUND_XFER :
463 OUTBOUND_XFER);
464
> 465 req_id = cpu_to_le16(req_id);
466
467 if (exec->db_len && !IS_ALIGNED(exec->db_addr, exec->db_len / 8))
468 return -EINVAL;
469
470 presync_sem = exec->sem0.presync + exec->sem1.presync +
471 exec->sem2.presync + exec->sem3.presync;
472 if (presync_sem > 1)
473 return -EINVAL;
474
475 presync_sem = exec->sem0.presync << 0 | exec->sem1.presync << 1 |
476 exec->sem2.presync << 2 | exec->sem3.presync << 3;
477
478 switch (exec->db_len) {
479 case 32:
480 db_len = BIT(7);
481 break;
482 case 16:
483 db_len = BIT(7) | 1;
484 break;
485 case 8:
486 db_len = BIT(7) | 2;
487 break;
488 case 0:
489 db_len = 0; /* doorbell is not active for this command */
490 break;
491 default:
492 return -EINVAL; /* should never hit this */
493 }
494
495 /*
496 * When we end up splitting up a single request (ie a mem handle) into
497 * multiple DMA requests, we have to manage the sync data carefully.
498 * There can only be one presync sem. That needs to be on every xfer
499 * so that the DMA engine doesn't transfer data before the receiver is
500 * ready. We only do the doorbell and postsync sems after the xfer.
501 * To guarantee previous xfers for the request are complete, we use a
502 * fence.
503 */
504 dev_addr = exec->dev_addr;
505 for_each_sg(mem->sgt->sgl, sg, mem->nents, i) {
> 506 mem->reqs[i].req_id = req_id;
507 mem->reqs[i].cmd = cmd;
508 mem->reqs[i].src_addr =
509 cpu_to_le64(exec->dir == DMA_TO_DEVICE ?
510 sg_dma_address(sg) : dev_addr);
511 mem->reqs[i].dest_addr =
512 cpu_to_le64(exec->dir == DMA_TO_DEVICE ?
513 dev_addr : sg_dma_address(sg));
514 mem->reqs[i].len = cpu_to_le32(sg_dma_len(sg));
515 switch (presync_sem) {
516 case BIT(0):
517 mem->reqs[i].sem_cmd0 = cpu_to_le32(
518 ENCODE_SEM(exec->sem0.val,
519 exec->sem0.index,
520 exec->sem0.presync,
521 exec->sem0.cmd,
522 exec->sem0.flags));
523 break;
524 case BIT(1):
525 mem->reqs[i].sem_cmd1 = cpu_to_le32(
526 ENCODE_SEM(exec->sem1.val,
527 exec->sem1.index,
528 exec->sem1.presync,
529 exec->sem1.cmd,
530 exec->sem1.flags));
531 break;
532 case BIT(2):
533 mem->reqs[i].sem_cmd2 = cpu_to_le32(
534 ENCODE_SEM(exec->sem2.val,
535 exec->sem2.index,
536 exec->sem2.presync,
537 exec->sem2.cmd,
538 exec->sem2.flags));
539 break;
540 case BIT(3):
541 mem->reqs[i].sem_cmd3 = cpu_to_le32(
542 ENCODE_SEM(exec->sem3.val,
543 exec->sem3.index,
544 exec->sem3.presync,
545 exec->sem3.cmd,
546 exec->sem3.flags));
547 break;
548 }
549 dev_addr += sg_dma_len(sg);
550 }
551 /* add post transfer stuff to last segment */
552 i--;
553 mem->reqs[i].cmd |= GEN_COMPLETION;
554 mem->reqs[i].db_addr = db_addr;
555 mem->reqs[i].db_len = db_len;
> 556 mem->reqs[i].db_data = db_data;
557 exec->sem0.flags |= (exec->dir == DMA_TO_DEVICE ? SEM_INSYNCFENCE :
558 SEM_OUTSYNCFENCE);
559 mem->reqs[i].sem_cmd0 = cpu_to_le32(ENCODE_SEM(exec->sem0.val,
560 exec->sem0.index,
561 exec->sem0.presync,
562 exec->sem0.cmd,
563 exec->sem0.flags));
564 mem->reqs[i].sem_cmd1 = cpu_to_le32(ENCODE_SEM(exec->sem1.val,
565 exec->sem1.index,
566 exec->sem1.presync,
567 exec->sem1.cmd,
568 exec->sem1.flags));
569 mem->reqs[i].sem_cmd2 = cpu_to_le32(ENCODE_SEM(exec->sem2.val,
570 exec->sem2.index,
571 exec->sem2.presync,
572 exec->sem2.cmd,
573 exec->sem2.flags));
574 mem->reqs[i].sem_cmd3 = cpu_to_le32(ENCODE_SEM(exec->sem3.val,
575 exec->sem3.index,
576 exec->sem3.presync,
577 exec->sem3.cmd,
578 exec->sem3.flags));
579
580 return 0;
581 }
582
583 static int commit_execute(struct qaic_device *qdev, struct mem_handle *mem,
584 u32 dbc_id)
585 {
586 /**
587 * Use _relaxed accessors because we don't need barriers. This is
588 * part of our critical path - the faster we can submit work to the
589 * device, the faster the device can generate our output. At this point
590 * we haven't accessed the device, so we don't need to sync with
591 * previous activity, and we just need both values back, but it really
592 * doesn't matter which comes back first.
593 */
594 struct dma_bridge_chan *dbc = &qdev->dbc[dbc_id];
> 595 u32 head = le32_to_cpu(readl_relaxed(dbc->dbc_base + REQHP_OFF));
596 u32 tail = le32_to_cpu(readl_relaxed(dbc->dbc_base + REQTP_OFF));
597 u32 avail = head - tail;
598 struct dbc_req *reqs = mem->reqs;
599 bool two_copy = tail + mem->nents > dbc->nelem;
600
601 if (head == U32_MAX || tail == U32_MAX)
602 /* PCI link error */
603 return -ENODEV;
604
605 if (head <= tail)
606 avail += dbc->nelem;
607
608 --avail;
609
610 if (avail < mem->nents)
611 return -EAGAIN;
612
613 if (two_copy) {
614 avail = dbc->nelem - tail;
615 avail = min_t(u32, avail, mem->nents);
616 memcpy(dbc->req_q_base + tail * get_dbc_req_elem_size(),
617 reqs, sizeof(*reqs) * avail);
618 reqs += avail;
619 avail = mem->nents - avail;
620 if (avail)
621 memcpy(dbc->req_q_base, reqs, sizeof(*reqs) * avail);
622 } else {
623 memcpy(dbc->req_q_base + tail * get_dbc_req_elem_size(),
624 reqs, sizeof(*reqs) * mem->nents);
625 }
626
627 init_completion(&mem->xfer_done);
628 list_add_tail(&mem->list, &dbc->xfer_list);
629 tail = (tail + mem->nents) % dbc->nelem;
630 /**
631 * Use _relaxed because this is a critical path and we don't need a
632 * barrier. The data going to the device is in DMA coherent memory,
633 * thus the flushing of that data to memory is already handled and
634 * we don't need additional wait before we kick the device to process
635 * the request we just queued.
636 */
> 637 writel_relaxed(cpu_to_le32(tail), dbc->dbc_base + REQTP_OFF);
638 return 0;
639 }
640
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months