Hi Abhilash,
FYI, the error/warning still remains.
tree:
https://github.com/intel/linux-intel-lts.git 4.19/android_r
head: 072f407465e8e25a3c2c22590e1ab72ccf335151
commit: 570daed7a2103fdef146a86d30df849a01ea01a9 [18603/22631] usb: xhci: dbc: Add a dbc
raw driver to provide a raw interface on DbC
config: alpha-allmodconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
#
https://github.com/intel/linux-intel-lts/commit/570daed7a2103fdef146a86d3...
git remote add intel-linux-intel-lts
https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 4.19/android_r
git checkout 570daed7a2103fdef146a86d30df849a01ea01a9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/usb/host/xhci-dbgraw.c:48:21: warning: no previous prototype for
'xhci_dbc_alloc_requests' [-Wmissing-prototypes]
48 | struct dbc_request *xhci_dbc_alloc_requests(struct dbc_ep *dep,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/host/xhci-dbgraw.c: In function 'dbc_read':
> drivers/usb/host/xhci-dbgraw.c:144:7: error: implicit declaration
of function 'copy_to_user'; did you mean 'sg_copy_to_buffer'?
[-Werror=implicit-function-declaration]
144 | r = copy_to_user(buf,
req->buf, xfer);
| ^~~~~~~~~~~~
| sg_copy_to_buffer
drivers/usb/host/xhci-dbgraw.c: In function 'dbc_write':
> drivers/usb/host/xhci-dbgraw.c:185:8: error: implicit declaration
of function 'copy_from_user'; did you mean 'kfifo_from_user'?
[-Werror=implicit-function-declaration]
185 | ret =
copy_from_user(req->buf, buf, xfer);
| ^~~~~~~~~~~~~~
| kfifo_from_user
In file included from drivers/usb/host/xhci-dbgraw.c:13:
drivers/usb/host/xhci-dbgraw.c: At top level:
include/linux/module.h:133:6: warning: 'init_module' specifies less restrictive
attribute than its target 'xhci_dbc_raw_init': 'cold'
[-Wmissing-attributes]
133 | int init_module(void) __attribute__((alias(#initfn)));
| ^~~~~~~~~~~
include/linux/module.h:123:28: note: in expansion of macro 'module_init'
123 | #define late_initcall(fn) module_init(fn)
| ^~~~~~~~~~~
drivers/usb/host/xhci-dbgraw.c:360:1: note: in expansion of macro
'late_initcall'
360 | late_initcall(xhci_dbc_raw_init);
| ^~~~~~~~~~~~~
drivers/usb/host/xhci-dbgraw.c:350:19: note: 'init_module' target declared
here
350 | static int __init xhci_dbc_raw_init(void)
| ^~~~~~~~~~~~~~~~~
In file included from drivers/usb/host/xhci-dbgraw.c:13:
include/linux/module.h:139:7: warning: 'cleanup_module' specifies less
restrictive attribute than its target 'xhci_dbc_raw_fini': 'cold'
[-Wmissing-attributes]
139 | void cleanup_module(void) __attribute__((alias(#exitfn)));
| ^~~~~~~~~~~~~~
drivers/usb/host/xhci-dbgraw.c:361:1: note: in expansion of macro
'module_exit'
361 | module_exit(xhci_dbc_raw_fini);
| ^~~~~~~~~~~
drivers/usb/host/xhci-dbgraw.c:355:20: note: 'cleanup_module' target declared
here
355 | static void __exit xhci_dbc_raw_fini(void)
| ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +144 drivers/usb/host/xhci-dbgraw.c
47
48 struct dbc_request *xhci_dbc_alloc_requests(struct dbc_ep *dep,
49 void (*fn)(struct xhci_hcd *, struct dbc_request *))
50 {
51 struct dbc_request *req;
52
53 req = dbc_alloc_request(dep, GFP_KERNEL);
54 if (!req)
55 return req;
56
57 req->length = DBC_RAW_BULK_BUFFER_SIZE;
58 req->buf = kmalloc(req->length, GFP_KERNEL);
59 if (!req->buf)
60 xhci_dbc_free_req(dep, req);
61
62 req->complete = fn;
63
64 return req;
65 }
66
67 static void dbc_complete_in(struct xhci_hcd *xhci,
68 struct dbc_request *req)
69 {
70 struct xhci_dbc *dbc = (struct xhci_dbc *) xhci->dbc;
71 struct dbc_dev *dev = (struct dbc_dev *) dbc->func_priv;
72
73 if (req->status)
74 dev->error = req->status;
75
76 wake_up(&dev->write_wq);
77 }
78
79 static void dbc_complete_out(struct xhci_hcd *xhci,
80 struct dbc_request *req)
81 {
82 struct xhci_dbc *dbc = (struct xhci_dbc *) xhci->dbc;
83 struct dbc_dev *dev = (struct dbc_dev *) dbc->func_priv;
84
85 if (req->status)
86 dev->error = req->status;
87
88 wake_up(&dev->read_wq);
89 }
90
91 static ssize_t dbc_read(struct file *fp, char __user *buf,
92 size_t count, loff_t *pos)
93 {
94 int status = 0;
95 struct dbc_dev *dev = (struct dbc_dev *) fp->private_data;
96 struct xhci_dbc *dbc = dev->dbc;
97 struct dbc_request *req;
98 struct dbc_port *port = &dbc->port;
99 int r = count, xfer;
100 int ret;
101
102 if (dbc->state != DS_CONFIGURED)
103 return -EAGAIN;
104
105 port->in = get_in_ep(dbc->xhci);
106
107 mutex_lock(&dev->read_excl);
108
109 req = xhci_dbc_alloc_requests(port->in, dbc_complete_out);
110 if (!req) {
111 r = -ENOMEM;
112 goto alloc_fail;
113 }
114
115 req->actual = 0;
116
117 xfer = min_t(size_t, count, DBC_RAW_BULK_BUFFER_SIZE);
118 req->length = xfer;
119
120 status = dbc_ep_queue(port->in, req, GFP_ATOMIC);
121 if (status) {
122 dev->error = status;
123 r = status;
124 goto request_fail;
125 }
126
127 ret = wait_event_interruptible(dev->read_wq,
128 (req->status != -EINPROGRESS));
129
130 if (ret < 0) {
131 r = ret;
132 goto request_fail;
133 }
134
135 if (dev->error) {
136 r = dev->error;
137 goto request_fail;
138 }
139
140 xfer = (req->actual < count) ? req->actual : count;
141 if (!req->actual) {
142 r = 0;
143 } else {
144 r = copy_to_user(buf, req->buf, xfer);
145 if
(!r)
146 r = xfer;
147 }
148
149 request_fail:
150 xhci_dbc_free_req(port->in, req);
151 alloc_fail:
152 mutex_unlock(&dev->read_excl);
153
154 return r;
155 }
156
157 static ssize_t dbc_write(struct file *fp, const char __user *buf,
158 size_t count, loff_t *pos)
159 {
160 int status = 0;
161 struct dbc_dev *dev = (struct dbc_dev *) fp->private_data;
162 struct xhci_dbc *dbc = dev->dbc;
163 struct dbc_request *req = 0;
164 struct dbc_port *port = &dbc->port;
165 int r = count, xfer;
166 int ret;
167
168 if (dbc->state != DS_CONFIGURED)
169 return -EAGAIN;
170
171 port->out = get_out_ep(dbc->xhci);
172
173 mutex_lock(&dev->write_excl);
174
175 /* get an idle tx request to use */
176 req = xhci_dbc_alloc_requests(port->out, dbc_complete_in);
177 if (!req) {
178 r = -ENOMEM;
179 goto alloc_fail;
180 }
181
182 req->actual = 0;
183 xfer = min_t(size_t, count, DBC_RAW_BULK_BUFFER_SIZE);
184
185 ret = copy_from_user(req->buf, buf, xfer);
186 if
(ret) {
187 r = ret;
188 goto request_fail;
189 }
190 r = xfer;
191 req->length = xfer;
192 status = dbc_ep_queue(port->out, req, GFP_ATOMIC);
193 if (status) {
194 dev->error = status;
195 r = status;
196 goto request_fail;
197 }
198
199 ret = wait_event_interruptible(dev->write_wq,
200 (req->status != -EINPROGRESS));
201 if (ret < 0)
202 r = ret;
203
204 request_fail:
205 xhci_dbc_free_req(port->out, req);
206 alloc_fail:
207 mutex_unlock(&dev->write_excl);
208
209 return r;
210 }
211
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org