tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-4.4
head: 517550f651234b0e27057d8108908f58f07fa357
commit: 89b98416110c0196f7b692b367d908a5ef10df30 [73/103] bdc: Fix bug causing crash after
multiple disconnects
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 7.5.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
git checkout 89b98416110c0196f7b692b367d908a5ef10df30
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/bitops.h:18:0,
from include/linux/kernel.h:10,
from include/linux/list.h:8,
from include/linux/module.h:9,
from drivers/usb/gadget/udc/bdc/bdc_core.c:14:
arch/m68k/include/asm/bitops.h: In function 'find_first_zero_bit':
arch/m68k/include/asm/bitops.h:340:13: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
return res < size ? res : size;
^
arch/m68k/include/asm/bitops.h:340:26: warning: signed and unsigned type in conditional
expression [-Wsign-compare]
return res < size ? res : size;
^
arch/m68k/include/asm/bitops.h: In function 'find_first_bit':
arch/m68k/include/asm/bitops.h:395:13: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
return res < size ? res : size;
^
arch/m68k/include/asm/bitops.h:395:26: warning: signed and unsigned type in conditional
expression [-Wsign-compare]
return res < size ? res : size;
^
In file included from include/linux/nodemask.h:92:0,
from include/linux/mmzone.h:16,
from include/linux/gfp.h:5,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from drivers/usb/gadget/udc/bdc/bdc_core.c:14:
include/linux/bitmap.h: In function 'bitmap_empty':
include/linux/bitmap.h:300:36: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
return find_first_bit(src, nbits) == nbits;
^~
include/linux/bitmap.h: In function 'bitmap_full':
include/linux/bitmap.h:308:41: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
return find_first_zero_bit(src, nbits) == nbits;
^~
In file included from arch/m68k/include/asm/io_mm.h:26:0,
from arch/m68k/include/asm/io.h:4,
from include/linux/io.h:25,
from drivers/usb/gadget/udc/bdc/bdc_core.c:21:
arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsb':
arch/m68k/include/asm/raw_io.h:96:7: warning: variable '__w' set but not used
[-Wunused-but-set-variable]
({u8 __w, __v = (b); u32 _addr = ((u32) (addr)); \
^
arch/m68k/include/asm/raw_io.h:412:3: note: in expansion of macro 'rom_out_8'
rom_out_8(port, *buf++);
^~~~~~~~~
arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw':
arch/m68k/include/asm/raw_io.h:99:8: warning: variable '__w' set but not used
[-Wunused-but-set-variable]
({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
^
arch/m68k/include/asm/raw_io.h:430:3: note: in expansion of macro
'rom_out_be16'
rom_out_be16(port, *buf++);
^~~~~~~~~~~~
arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw_swapw':
arch/m68k/include/asm/raw_io.h:103:8: warning: variable '__w' set but not used
[-Wunused-but-set-variable]
({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
^
arch/m68k/include/asm/raw_io.h:448:3: note: in expansion of macro
'rom_out_le16'
rom_out_le16(port, *buf++);
^~~~~~~~~~~~
In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/list.h:4,
from include/linux/module.h:9,
from drivers/usb/gadget/udc/bdc/bdc_core.c:14:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:171:49: warning: ordered comparison of pointer with
null pointer [-Wextra]
#define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET &&
(void *)(kaddr) < high_memory)
^
include/linux/compiler.h:182:42: note: in definition of macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
include/linux/scatterlist.h:140:2: note: in expansion of macro 'BUG_ON'
BUG_ON(!virt_addr_valid(buf));
^~~~~~
include/linux/scatterlist.h:140:10: note: in expansion of macro
'virt_addr_valid'
BUG_ON(!virt_addr_valid(buf));
^~~~~~~~~~~~~~~
drivers/usb/gadget/udc/bdc/bdc_core.c: In function 'bdc_mem_init':
> drivers/usb/gadget/udc/bdc/bdc_core.c:300:17: warning: comparison
between signed and unsigned integer expressions [-Wsign-compare]
for (i = 1; i
< bdc->num_eps; ++i)
^
vim +300 drivers/usb/gadget/udc/bdc/bdc_core.c
218
219 /* Initialize the HW regs and internal data structures */
220 static void bdc_mem_init(struct bdc *bdc, bool reinit)
221 {
222 u8 size = 0;
223 u32 usb2_pm;
224 u32 low32;
225 u32 upp32;
226 u32 temp;
227
228 dev_dbg(bdc->dev, "%s ()\n", __func__);
229 bdc->ep0_state = WAIT_FOR_SETUP;
230 bdc->dev_addr = 0;
231 bdc->srr.eqp_index = 0;
232 bdc->srr.dqp_index = 0;
233 bdc->zlp_needed = false;
234 bdc->delayed_status = false;
235
236 bdc_writel(bdc->regs, BDC_SPBBAL, bdc->scratchpad.sp_dma);
237 /* Init the SRR */
238 temp = BDC_SRR_RWS | BDC_SRR_RST;
239 /* Reset the SRR */
240 bdc_writel(bdc->regs, BDC_SRRINT(0), temp);
241 dev_dbg(bdc->dev, "bdc->srr.sr_bds =%p\n", bdc->srr.sr_bds);
242 temp = lower_32_bits(bdc->srr.dma_addr);
243 size = fls(NUM_SR_ENTRIES) - 2;
244 temp |= size;
245 dev_dbg(bdc->dev, "SRRBAL[0]=%08x NUM_SR_ENTRIES:%d size:%d\n",
246 temp, NUM_SR_ENTRIES, size);
247
248 low32 = lower_32_bits(temp);
249 upp32 = upper_32_bits(bdc->srr.dma_addr);
250 cpu_to_le32s(&low32);
251 cpu_to_le32s(&upp32);
252
253 /* Write the dma addresses into regs*/
254 bdc_writel(bdc->regs, BDC_SRRBAL(0), low32);
255 bdc_writel(bdc->regs, BDC_SRRBAH(0), upp32);
256
257 temp = bdc_readl(bdc->regs, BDC_SRRINT(0));
258 temp |= BDC_SRR_IE;
259 temp &= ~(BDC_SRR_RST | BDC_SRR_RWS);
260 bdc_writel(bdc->regs, BDC_SRRINT(0), temp);
261
262 /* Set the Interrupt Coalescence ~500 usec */
263 temp = bdc_readl(bdc->regs, BDC_INTCTLS(0));
264 temp &= ~0xffff;
265 temp |= INT_CLS;
266 bdc_writel(bdc->regs, BDC_INTCTLS(0), temp);
267
268 usb2_pm = bdc_readl(bdc->regs, BDC_USPPM2);
269 dev_dbg(bdc->dev, "usb2_pm=%08x", usb2_pm);
270 /* Enable hardware LPM Enable */
271 usb2_pm |= BDC_HLE;
272 bdc_writel(bdc->regs, BDC_USPPM2, usb2_pm);
273
274 /* readback for debug */
275 usb2_pm = bdc_readl(bdc->regs, BDC_USPPM2);
276 dev_dbg(bdc->dev, "usb2_pm=%08x\n", usb2_pm);
277
278 /* Disable any unwanted SR's on SRR */
279 temp = bdc_readl(bdc->regs, BDC_BDCSC);
280 /* We don't want Microframe counter wrap SR */
281 temp |= BDC_MASK_MCW;
282 bdc_writel(bdc->regs, BDC_BDCSC, temp);
283
284 /*
285 * In some error cases, driver has to reset the entire BDC controller
286 * in that case reinit is passed as 1
287 */
288 if (reinit) {
289 int i;
290 /* Enable interrupts */
291 temp = bdc_readl(bdc->regs, BDC_BDCSC);
292 temp |= BDC_GIE;
293 bdc_writel(bdc->regs, BDC_BDCSC, temp);
294 /* Init scratchpad to 0 */
295 memset(bdc->scratchpad.buff, 0, bdc->sp_buff_size);
296 /* Initialize SRR to 0 */
297 memset(bdc->srr.sr_bds, 0,
298 NUM_SR_ENTRIES * sizeof(struct bdc_bd));
299 /* clear ep flags to avoid post disconnect stops/deconfigs */
300 for (i = 1; i < bdc->num_eps; ++i)
301 bdc->bdc_ep_array[i]->flags = 0;
302 } else {
303 /* One time initiaization only */
304 /* Enable status report function pointers */
305 bdc->sr_handler[0] = bdc_sr_xsf;
306 bdc->sr_handler[1] = bdc_sr_uspc;
307
308 /* EP0 status report function pointers */
309 bdc->sr_xsf_ep0[0] = bdc_xsf_ep0_setup_recv;
310 bdc->sr_xsf_ep0[1] = bdc_xsf_ep0_data_start;
311 bdc->sr_xsf_ep0[2] = bdc_xsf_ep0_status_start;
312 }
313 }
314
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org