Linux USB
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>, migo.oravec@gmail.com
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-usb@vger.kernel.org, gregkh@linuxfoundation.org,
	Mathias Nyman <mathias.nyman@linux.intel.com>
Subject: Re: [RFT PATCH] usb: early: xhci-dbc: Try smaller early_ioremap size if original size fails
Date: Sun, 26 Oct 2025 10:32:52 +0800	[thread overview]
Message-ID: <202510261010.UvV0M6f5-lkp@intel.com> (raw)
In-Reply-To: <20251024154157.40800-1-mathias.nyman@linux.intel.com>

Hi Mathias,

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 westeri-thunderbolt/next linus/master v6.18-rc2 next-20251024]
[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/Mathias-Nyman/usb-early-xhci-dbc-Try-smaller-early_ioremap-size-if-original-size-fails/20251024-234429
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
patch link:    https://lore.kernel.org/r/20251024154157.40800-1-mathias.nyman%40linux.intel.com
patch subject: [RFT PATCH] usb: early: xhci-dbc: Try smaller early_ioremap size if original size fails
config: i386-randconfig-004-20251026 (https://download.01.org/0day-ci/archive/20251026/202510261010.UvV0M6f5-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/20251026/202510261010.UvV0M6f5-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/202510261010.UvV0M6f5-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/usb/early/xhci-dbc.c:665:55: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
     665 |                                 pr_warn("Bad DbC offset 0x%x, max 0x%lx", offset, xdbc.xhci_length);
         |                                                                     ~~~           ^~~~~~~~~~~~~~~~
         |                                                                     %zx
   include/linux/printk.h:565:37: note: expanded from macro 'pr_warn'
     565 |         printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
         |                                    ~~~     ^~~~~~~~~~~
   include/linux/printk.h:512:60: note: expanded from macro 'printk'
     512 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
         |                                                     ~~~    ^~~~~~~~~~~
   include/linux/printk.h:484:19: note: expanded from macro 'printk_index_wrap'
     484 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
         |                         ~~~~    ^~~~~~~~~~~
   1 warning generated.


vim +665 drivers/usb/early/xhci-dbc.c

   610	
   611	int __init early_xdbc_parse_parameter(char *s, int keep_early)
   612	{
   613		unsigned long dbgp_num = 0;
   614		u32 bus, dev, func, offset = 0;
   615		u32 val;
   616		char *e;
   617		int ret;
   618	
   619		if (!early_pci_allowed())
   620			return -EPERM;
   621	
   622		early_console_keep = keep_early;
   623	
   624		if (xdbc.xdbc_reg)
   625			return 0;
   626	
   627		if (*s) {
   628		       dbgp_num = simple_strtoul(s, &e, 10);
   629		       if (s == e)
   630			       dbgp_num = 0;
   631		}
   632	
   633		pr_notice("dbgp_num: %lu\n", dbgp_num);
   634	
   635		/* Locate the host controller: */
   636		ret = xdbc_find_dbgp(dbgp_num, &bus, &dev, &func);
   637		if (ret) {
   638			pr_notice("failed to locate xhci host\n");
   639			return -ENODEV;
   640		}
   641	
   642		xdbc.vendor	= read_pci_config_16(bus, dev, func, PCI_VENDOR_ID);
   643		xdbc.device	= read_pci_config_16(bus, dev, func, PCI_DEVICE_ID);
   644		xdbc.bus	= bus;
   645		xdbc.dev	= dev;
   646		xdbc.func	= func;
   647	
   648		/* Map the IO memory: */
   649		xdbc.xhci_base = xdbc_map_pci_mmio(bus, dev, func);
   650		if (!xdbc.xhci_base)
   651			return -EINVAL;
   652	
   653		/* Locate DbC registers: */
   654		if (xdbc.xhci_length == xdbc.xhci_orig_length) {
   655			offset = xhci_find_next_ext_cap(xdbc.xhci_base, 0, XHCI_EXT_CAPS_DEBUG);
   656		} else {
   657			/*
   658			 * Mapped mmio size cut short from what xhci needs.
   659			 * Check if this dBc capability is withing the new cut size.
   660			 * DbC capability needs 64 bytes from its capabilty offset.
   661			 */
   662			do {
   663				offset = xhci_find_next_ext_cap(xdbc.xhci_base, offset, 0);
   664				if (!offset || (offset + 64 >= xdbc.xhci_length)) {
 > 665					pr_warn("Bad DbC offset 0x%x, max 0x%lx", offset, xdbc.xhci_length);
   666					offset = 0;
   667					break;
   668				}
   669				pr_warn("Looking for DbC capability at offset 0x%x", offset);
   670				val = readl(xdbc.xhci_base + offset);
   671			} while (XHCI_EXT_CAPS_ID(val) != XHCI_EXT_CAPS_DEBUG);
   672		}
   673	
   674		if (!offset) {
   675			pr_warn("xhci host doesn't support debug capability\n");
   676			early_iounmap(xdbc.xhci_base, xdbc.xhci_length);
   677			xdbc.xhci_base = NULL;
   678			xdbc.xhci_length = 0;
   679	
   680			return -ENODEV;
   681		}
   682		pr_warn("DbC capability found at offset 0x%x", offset);
   683	
   684		xdbc.xdbc_reg = (struct xdbc_regs __iomem *)(xdbc.xhci_base + offset);
   685	
   686		return 0;
   687	}
   688	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  reply	other threads:[~2025-10-26  2:33 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAAcb1K_MJKWz+BYJmx0FDgrBOzzXm71-M7sgHDUOmBRppXWNzA@mail.gmail.com>
2025-10-15  7:43 ` Fwd: USB DBC hang during earlyprintk initialization Milan Oravec
2025-10-15  9:13   ` Greg KH
2025-10-15 19:11     ` Milan Oravec
2025-10-16 13:42       ` Mathias Nyman
2025-10-16 14:31         ` Milan Oravec
2025-10-16 20:49           ` Mathias Nyman
2025-10-20  6:43             ` Milan Oravec
2025-10-24 15:36               ` Mathias Nyman
2025-10-24 15:41                 ` [RFT PATCH] usb: early: xhci-dbc: Try smaller early_ioremap size if original size fails Mathias Nyman
2025-10-26  2:32                   ` kernel test robot [this message]
2025-10-24 18:48                 ` Fwd: USB DBC hang during earlyprintk initialization Milan Oravec
2025-10-27  9:34                   ` Mathias Nyman
2025-10-28 10:13                     ` Mathias Nyman
2025-10-28 13:29                       ` Milan Oravec
2025-10-28 17:19                         ` Mathias Nyman
2025-10-28 18:10                           ` Milan Oravec
2025-10-31 13:15                             ` Milan Oravec
2025-12-04 20:46                               ` Mathias Nyman
2025-12-05  7:18                                 ` Milan Oravec
2025-12-05 18:49                                   ` Milan Oravec
2025-12-17  9:20                                     ` Mathias Nyman
2025-12-18 20:03                                       ` Milan Oravec
2026-01-19  8:18                                         ` Milan Oravec
2026-01-19 11:01                                           ` Milan Oravec
2026-04-01 15:58                                             ` Milan Oravec

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=202510261010.UvV0M6f5-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mathias.nyman@linux.intel.com \
    --cc=migo.oravec@gmail.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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