From: kernel test robot <lkp@intel.com>
To: raoxu <raoxu@uniontech.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
gregkh@linuxfoundation.org, kenny@panix.com,
linux-usb@vger.kernel.org, mathias.nyman@linux.intel.com,
michal.pecio@gmail.com, niklas.neronin@linux.intel.com,
zhanjun@uniontech.com
Subject: Re: [PATCH v10 2/2] usb: xhci: enable secondary interrupters and route
Date: Mon, 26 Jan 2026 22:49:15 +0800 [thread overview]
Message-ID: <202601262208.UybEjc9X-lkp@intel.com> (raw)
In-Reply-To: <1FCECDEA86461C52+20260126085828.803972-1-raoxu@uniontech.com>
Hi raoxu,
kernel test robot noticed the following build warnings:
[auto build test WARNING on usb/usb-testing]
[also build test WARNING on usb/usb-next usb/usb-linus linus/master v6.19-rc7 next-20260123]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/raoxu/usb-xhci-refactor-IRQ-interrupter-plumbing-for/20260126-170049
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
patch link: https://lore.kernel.org/r/1FCECDEA86461C52%2B20260126085828.803972-1-raoxu%40uniontech.com
patch subject: [PATCH v10 2/2] usb: xhci: enable secondary interrupters and route
config: i386-defconfig (https://download.01.org/0day-ci/archive/20260126/202601262208.UybEjc9X-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260126/202601262208.UybEjc9X-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601262208.UybEjc9X-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/usb/host/xhci-mem.c:2513:6: warning: variable 'secondary_intr_num' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
2513 | if (xhci->max_interrupters > 1)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/host/xhci-mem.c:2518:19: note: uninitialized use occurs here
2518 | for (i = 1; i <= secondary_intr_num; i++) {
| ^~~~~~~~~~~~~~~~~~
drivers/usb/host/xhci-mem.c:2513:2: note: remove the 'if' if its condition is always true
2513 | if (xhci->max_interrupters > 1)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2514 | secondary_intr_num = min_t(unsigned int,
drivers/usb/host/xhci-mem.c:2414:33: note: initialize the variable 'secondary_intr_num' to silence this warning
2414 | unsigned int secondary_intr_num;
| ^
| = 0
1 warning generated.
vim +2513 drivers/usb/host/xhci-mem.c
2409
2410 int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
2411 {
2412 struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
2413 dma_addr_t dma;
2414 unsigned int secondary_intr_num;
2415 int i;
2416
2417 /*
2418 * xHCI section 5.4.6 - Device Context array must be
2419 * "physically contiguous and 64-byte (cache line) aligned".
2420 */
2421 xhci->dcbaa = dma_alloc_coherent(dev, sizeof(*xhci->dcbaa), &dma, flags);
2422 if (!xhci->dcbaa)
2423 goto fail;
2424
2425 xhci->dcbaa->dma = dma;
2426 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
2427 "Device context base array address = 0x%pad (DMA), %p (virt)",
2428 &xhci->dcbaa->dma, xhci->dcbaa);
2429
2430 /*
2431 * Initialize the ring segment pool. The ring must be a contiguous
2432 * structure comprised of TRBs. The TRBs must be 16 byte aligned,
2433 * however, the command ring segment needs 64-byte aligned segments
2434 * and our use of dma addresses in the trb_address_map radix tree needs
2435 * TRB_SEGMENT_SIZE alignment, so we pick the greater alignment need.
2436 */
2437 if (xhci->quirks & XHCI_TRB_OVERFETCH)
2438 /* Buggy HC prefetches beyond segment bounds - allocate dummy space at the end */
2439 xhci->segment_pool = dma_pool_create("xHCI ring segments", dev,
2440 TRB_SEGMENT_SIZE * 2, TRB_SEGMENT_SIZE * 2, xhci->page_size * 2);
2441 else
2442 xhci->segment_pool = dma_pool_create("xHCI ring segments", dev,
2443 TRB_SEGMENT_SIZE, TRB_SEGMENT_SIZE, xhci->page_size);
2444 if (!xhci->segment_pool)
2445 goto fail;
2446
2447 /* See Table 46 and Note on Figure 55 */
2448 xhci->device_pool = dma_pool_create("xHCI input/output contexts", dev, 2112, 64,
2449 xhci->page_size);
2450 if (!xhci->device_pool)
2451 goto fail;
2452
2453 /*
2454 * Linear stream context arrays don't have any boundary restrictions,
2455 * and only need to be 16-byte aligned.
2456 */
2457 xhci->small_streams_pool = dma_pool_create("xHCI 256 byte stream ctx arrays",
2458 dev, SMALL_STREAM_ARRAY_SIZE, 16, 0);
2459 if (!xhci->small_streams_pool)
2460 goto fail;
2461
2462 /*
2463 * Any stream context array bigger than MEDIUM_STREAM_ARRAY_SIZE will be
2464 * allocated with dma_alloc_coherent().
2465 */
2466
2467 xhci->medium_streams_pool = dma_pool_create("xHCI 1KB stream ctx arrays",
2468 dev, MEDIUM_STREAM_ARRAY_SIZE, 16, 0);
2469 if (!xhci->medium_streams_pool)
2470 goto fail;
2471
2472 /*
2473 * refer to xhci rev1_2 protocol 5.3.3 max ports is 255.
2474 * refer to xhci rev1_2 protocol 6.4.3.14 port bandwidth buffer need
2475 * to be 16-byte aligned.
2476 */
2477 xhci->port_bw_pool = dma_pool_create("xHCI 256 port bw ctx arrays",
2478 dev, GET_PORT_BW_ARRAY_SIZE, 16, 0);
2479 if (!xhci->port_bw_pool)
2480 goto fail;
2481
2482 /* Set up the command ring to have one segments for now. */
2483 xhci->cmd_ring = xhci_ring_alloc(xhci, 1, TYPE_COMMAND, 0, flags);
2484 if (!xhci->cmd_ring)
2485 goto fail;
2486
2487 xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Allocated command ring at %p", xhci->cmd_ring);
2488 xhci_dbg_trace(xhci, trace_xhci_dbg_init, "First segment DMA is 0x%pad",
2489 &xhci->cmd_ring->first_seg->dma);
2490
2491 /*
2492 * Reserve one command ring TRB for disabling LPM.
2493 * Since the USB core grabs the shared usb_bus bandwidth mutex before
2494 * disabling LPM, we only need to reserve one TRB for all devices.
2495 */
2496 xhci->cmd_ring_reserved_trbs++;
2497
2498 /* Allocate and set up primary interrupter 0 with an event ring. */
2499 xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Allocating primary event ring");
2500 xhci->interrupters = kcalloc_node(xhci->max_interrupters, sizeof(*xhci->interrupters),
2501 flags, dev_to_node(dev));
2502 if (!xhci->interrupters)
2503 goto fail;
2504
2505 xhci->interrupters[0] = xhci_alloc_interrupter(xhci, 0, flags);
2506 if (!xhci->interrupters[0])
2507 goto fail;
2508
2509 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
2510 "Allocating secondary event ring");
2511 xhci->secondary_irqs_alloc = 0;
2512
> 2513 if (xhci->max_interrupters > 1)
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2026-01-26 14:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 8:55 [PATCH v10 0/2] usb:xhc:route device to secondary interrupters raoxu
2026-01-26 8:58 ` [PATCH v10 1/2] usb: xhci: refactor IRQ/interrupter plumbing for raoxu
2026-01-26 9:06 ` Greg KH
2026-01-26 8:58 ` [PATCH v10 2/2] usb: xhci: enable secondary interrupters and route raoxu
2026-01-26 9:10 ` Greg KH
2026-01-26 14:49 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202601262208.UybEjc9X-lkp@intel.com \
--to=lkp@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=kenny@panix.com \
--cc=linux-usb@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mathias.nyman@linux.intel.com \
--cc=michal.pecio@gmail.com \
--cc=niklas.neronin@linux.intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=raoxu@uniontech.com \
--cc=zhanjun@uniontech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox