All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH] From: Xu Rao <raoxu@uniontech.com> Subject: [PATCH] usb: xhci: Add debugfs support for xHCI port bandwidth
Date: Fri, 7 Mar 2025 15:23:14 +0800	[thread overview]
Message-ID: <202503071516.tj5UBRqT-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20250303095837.16332-1-raoxu@uniontech.com>
References: <20250303095837.16332-1-raoxu@uniontech.com>
TO: raoxu <raoxu@uniontech.com>
TO: mathias.nyman@intel.com
TO: gregkh@linuxfoundation.org
CC: linux-usb@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: wangyuli@uniontech.com
CC: zhanjun@uniontech.com
CC: Xu Rao <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.14-rc5 next-20250306]
[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/From-Xu-Rao-raoxu-uniontech-com-Subject-PATCH-usb-xhci-Add-debugfs-support-for-xHCI-port-bandwidth/20250303-180107
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
patch link:    https://lore.kernel.org/r/20250303095837.16332-1-raoxu%40uniontech.com
patch subject: [PATCH] From: Xu Rao <raoxu@uniontech.com> Subject: [PATCH] usb: xhci: Add debugfs support for xHCI port bandwidth
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: riscv-randconfig-r072-20250306 (https://download.01.org/0day-ci/archive/20250307/202503071516.tj5UBRqT-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202503071516.tj5UBRqT-lkp@intel.com/

New smatch warnings:
drivers/usb/host/xhci.c:3120 xhci_get_port_bandwidth() error: uninitialized symbol 'flags'.

Old smatch warnings:
arch/riscv/include/asm/atomic.h:218 arch_atomic_fetch_add_unless() warn: inconsistent indenting

vim +/flags +3120 drivers/usb/host/xhci.c

f94e0186312b0f drivers/usb/host/xhci-hcd.c Sarah Sharp 2009-04-27  3090  
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3091  /* Get the available bandwidth of the ports under the xhci roothub,
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3092   * including USB 2.0 port and USB 3.0 port.
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3093   */
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3094  int xhci_get_port_bandwidth(struct xhci_hcd *xhci, u8 *bw_table)
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3095  {
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3096  	unsigned int		num_ports;
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3097  	unsigned int		i;
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3098  	struct xhci_command	*cmd;
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3099  	dma_addr_t		dma_handle;
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3100  	void			*dma_buf;
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3101  	int			ret;
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3102  	unsigned long		flags;
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3103  	struct device		*dev  = xhci_to_hcd(xhci)->self.sysdev;
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3104  
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3105  	num_ports = HCS_MAX_PORTS(xhci->hcs_params1);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3106  
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3107  	cmd = xhci_alloc_command(xhci, true, GFP_KERNEL);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3108  	if (!cmd)
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3109  		return -ENOMEM;
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3110  
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3111  	dma_buf = dma_alloc_coherent(dev, xhci->page_size, &dma_handle,
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3112  					GFP_KERNEL);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3113  	if (!dma_buf) {
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3114  		xhci_free_command(xhci, cmd);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3115  		return -ENOMEM;
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3116  	}
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3117  
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3118  	/* get xhci hub usb3 port bandwidth */
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3119  	/* refer to xhci rev1_2 protocol 4.6.15*/
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03 @3120  	spin_unlock_irqrestore(&xhci->lock, flags);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3121  	ret = xhci_queue_get_rh_port_bw(xhci, cmd, dma_handle, USB_SPEED_SUPER,
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3122  					0, false);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3123  	if (ret < 0) {
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3124  		spin_unlock_irqrestore(&xhci->lock, flags);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3125  		goto out;
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3126  	}
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3127  	xhci_ring_cmd_db(xhci);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3128  	spin_unlock_irqrestore(&xhci->lock, flags);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3129  
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3130  	wait_for_completion(cmd->completion);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3131  
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3132  	/* refer to xhci rev1_2 protocol 6.2.6 , byte 0 is reserved */
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3133  	for (i = 1; i < num_ports+1; i++) {
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3134  		if (((u8 *)dma_buf)[i])
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3135  			bw_table[i] = ((u8 *)dma_buf)[i];
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3136  	}
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3137  
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3138  	/* get xhci hub usb2 port bandwidth */
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3139  	/* refer to xhci rev1_2 protocol 4.6.15*/
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3140  	spin_unlock_irqrestore(&xhci->lock, flags);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3141  	ret = xhci_queue_get_rh_port_bw(xhci, cmd, dma_handle, USB_SPEED_HIGH,
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3142  					0, false);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3143  	if (ret < 0) {
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3144  		spin_unlock_irqrestore(&xhci->lock, flags);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3145  		goto out;
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3146  	}
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3147  	xhci_ring_cmd_db(xhci);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3148  	spin_unlock_irqrestore(&xhci->lock, flags);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3149  
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3150  	wait_for_completion(cmd->completion);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3151  
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3152  	/* refer to xhci rev1_2 protocol 6.2.6 , byte 0 is reserved */
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3153  	for (i = 1; i < num_ports+1; i++) {
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3154  		if (((u8 *)dma_buf)[i])
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3155  			bw_table[i] = ((u8 *)dma_buf)[i];
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3156  	}
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3157  
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3158  out:
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3159  	dma_free_coherent(dev, xhci->page_size, dma_buf, dma_handle);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3160  	xhci_free_command(xhci, cmd);
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3161  
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3162  	return ret;
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3163  }
01a36d597b1902 drivers/usb/host/xhci.c     Xu Rao      2025-03-03  3164  

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

             reply	other threads:[~2025-03-07  7:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-07  7:23 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-03  9:58 [PATCH] From: Xu Rao <raoxu@uniontech.com> Subject: [PATCH] usb: xhci: Add debugfs support for xHCI port bandwidth raoxu
2025-03-03 10:36 ` Greg KH
2025-03-07  7:43 ` Dan Carpenter

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=202503071516.tj5UBRqT-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.