From: kernel test robot <lkp@intel.com>
To: Elson Roy Serrao <quic_eserrao@quicinc.com>,
gregkh@linuxfoundation.org, Thinh.Nguyen@synopsys.com,
balbi@kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
quic_wcheng@quicinc.com, quic_jackp@quicinc.com,
Elson Roy Serrao <quic_eserrao@quicinc.com>
Subject: Re: [PATCH v3 2/5] usb: dwc3: Add remote wakeup handling
Date: Tue, 7 Feb 2023 18:45:57 +0800 [thread overview]
Message-ID: <202302071850.VZRjtYXx-lkp@intel.com> (raw)
In-Reply-To: <1675710806-9735-3-git-send-email-quic_eserrao@quicinc.com>
Hi Elson,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on usb/usb-testing]
[also build test WARNING on usb/usb-next usb/usb-linus linus/master v6.2-rc7 next-20230207]
[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/Elson-Roy-Serrao/usb-gadget-Properly-configure-the-device-for-remote-wakeup/20230207-031528
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
patch link: https://lore.kernel.org/r/1675710806-9735-3-git-send-email-quic_eserrao%40quicinc.com
patch subject: [PATCH v3 2/5] usb: dwc3: Add remote wakeup handling
config: i386-randconfig-a002-20230206 (https://download.01.org/0day-ci/archive/20230207/202302071850.VZRjtYXx-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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-lab-lkp/linux/commit/e0d9f3f5f168e36cdb599617634010326a1412af
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Elson-Roy-Serrao/usb-gadget-Properly-configure-the-device-for-remote-wakeup/20230207-031528
git checkout e0d9f3f5f168e36cdb599617634010326a1412af
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/usb/dwc3/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/usb/dwc3/gadget.c:2318:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case DWC3_LINK_STATE_RESET:
^
drivers/usb/dwc3/gadget.c:2318:2: note: insert 'break;' to avoid fall-through
case DWC3_LINK_STATE_RESET:
^
break;
1 warning generated.
vim +2318 drivers/usb/dwc3/gadget.c
72246da40f3719af Felipe Balbi 2011-08-19 2291
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2292 static int __dwc3_gadget_wakeup(struct dwc3 *dwc, bool async)
72246da40f3719af Felipe Balbi 2011-08-19 2293 {
d6011f6fc21b4d4a Nicolas Saenz Julienne 2016-08-16 2294 int retries;
72246da40f3719af Felipe Balbi 2011-08-19 2295
218ef7b647e3367c Felipe Balbi 2016-04-04 2296 int ret;
72246da40f3719af Felipe Balbi 2011-08-19 2297 u32 reg;
72246da40f3719af Felipe Balbi 2011-08-19 2298
72246da40f3719af Felipe Balbi 2011-08-19 2299 u8 link_state;
72246da40f3719af Felipe Balbi 2011-08-19 2300
72246da40f3719af Felipe Balbi 2011-08-19 2301 /*
72246da40f3719af Felipe Balbi 2011-08-19 2302 * According to the Databook Remote wakeup request should
72246da40f3719af Felipe Balbi 2011-08-19 2303 * be issued only when the device is in early suspend state.
72246da40f3719af Felipe Balbi 2011-08-19 2304 *
72246da40f3719af Felipe Balbi 2011-08-19 2305 * We can check that via USB Link State bits in DSTS register.
72246da40f3719af Felipe Balbi 2011-08-19 2306 */
72246da40f3719af Felipe Balbi 2011-08-19 2307 reg = dwc3_readl(dwc->regs, DWC3_DSTS);
72246da40f3719af Felipe Balbi 2011-08-19 2308
72246da40f3719af Felipe Balbi 2011-08-19 2309 link_state = DWC3_DSTS_USBLNKST(reg);
72246da40f3719af Felipe Balbi 2011-08-19 2310
72246da40f3719af Felipe Balbi 2011-08-19 2311 switch (link_state) {
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2312 case DWC3_LINK_STATE_U3: /* in HS, means SUSPEND */
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2313 if (!dwc->rw_configured) {
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2314 dev_err(dwc->dev,
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2315 "device not configured for remote wakeup\n");
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2316 return -EINVAL;
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2317 }
d0550cd20e52558e Thinh Nguyen 2020-01-31 @2318 case DWC3_LINK_STATE_RESET:
72246da40f3719af Felipe Balbi 2011-08-19 2319 case DWC3_LINK_STATE_RX_DET: /* in HS, means Early Suspend */
c560e76319a94a3b Thinh Nguyen 2021-04-19 2320 case DWC3_LINK_STATE_U2: /* in HS, means Sleep (L1) */
c560e76319a94a3b Thinh Nguyen 2021-04-19 2321 case DWC3_LINK_STATE_U1:
d0550cd20e52558e Thinh Nguyen 2020-01-31 2322 case DWC3_LINK_STATE_RESUME:
72246da40f3719af Felipe Balbi 2011-08-19 2323 break;
72246da40f3719af Felipe Balbi 2011-08-19 2324 default:
218ef7b647e3367c Felipe Balbi 2016-04-04 2325 return -EINVAL;
72246da40f3719af Felipe Balbi 2011-08-19 2326 }
72246da40f3719af Felipe Balbi 2011-08-19 2327
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2328 if (async)
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2329 dwc3_gadget_enable_linksts_evts(dwc, true);
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2330
8598bde7fa125e85 Felipe Balbi 2012-01-02 2331 ret = dwc3_gadget_set_link_state(dwc, DWC3_LINK_STATE_RECOV);
8598bde7fa125e85 Felipe Balbi 2012-01-02 2332 if (ret < 0) {
8598bde7fa125e85 Felipe Balbi 2012-01-02 2333 dev_err(dwc->dev, "failed to put link in Recovery\n");
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2334 dwc3_gadget_enable_linksts_evts(dwc, false);
218ef7b647e3367c Felipe Balbi 2016-04-04 2335 return ret;
8598bde7fa125e85 Felipe Balbi 2012-01-02 2336 }
72246da40f3719af Felipe Balbi 2011-08-19 2337
802fde983e8a3391 Paul Zimmerman 2012-04-27 2338 /* Recent versions do this automatically */
9af21dd6faeba593 Thinh Nguyen 2020-04-11 2339 if (DWC3_VER_IS_PRIOR(DWC3, 194A)) {
72246da40f3719af Felipe Balbi 2011-08-19 2340 /* write zeroes to Link Change Request */
fcc023c726b5879d Felipe Balbi 2012-05-24 2341 reg = dwc3_readl(dwc->regs, DWC3_DCTL);
72246da40f3719af Felipe Balbi 2011-08-19 2342 reg &= ~DWC3_DCTL_ULSTCHNGREQ_MASK;
72246da40f3719af Felipe Balbi 2011-08-19 2343 dwc3_writel(dwc->regs, DWC3_DCTL, reg);
802fde983e8a3391 Paul Zimmerman 2012-04-27 2344 }
72246da40f3719af Felipe Balbi 2011-08-19 2345
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2346 /*
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2347 * Since link status change events are enabled we will receive
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2348 * an U0 event when wakeup is successful. So bail out.
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2349 */
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2350 if (async)
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2351 return 0;
e0d9f3f5f168e36c Elson Roy Serrao 2023-02-06 2352
1d046793958f128d Paul Zimmerman 2012-02-15 2353 /* poll until Link State changes to ON */
d6011f6fc21b4d4a Nicolas Saenz Julienne 2016-08-16 2354 retries = 20000;
72246da40f3719af Felipe Balbi 2011-08-19 2355
d6011f6fc21b4d4a Nicolas Saenz Julienne 2016-08-16 2356 while (retries--) {
72246da40f3719af Felipe Balbi 2011-08-19 2357 reg = dwc3_readl(dwc->regs, DWC3_DSTS);
72246da40f3719af Felipe Balbi 2011-08-19 2358
72246da40f3719af Felipe Balbi 2011-08-19 2359 /* in HS, means ON */
72246da40f3719af Felipe Balbi 2011-08-19 2360 if (DWC3_DSTS_USBLNKST(reg) == DWC3_LINK_STATE_U0)
72246da40f3719af Felipe Balbi 2011-08-19 2361 break;
72246da40f3719af Felipe Balbi 2011-08-19 2362 }
72246da40f3719af Felipe Balbi 2011-08-19 2363
72246da40f3719af Felipe Balbi 2011-08-19 2364 if (DWC3_DSTS_USBLNKST(reg) != DWC3_LINK_STATE_U0) {
72246da40f3719af Felipe Balbi 2011-08-19 2365 dev_err(dwc->dev, "failed to send remote wakeup\n");
218ef7b647e3367c Felipe Balbi 2016-04-04 2366 return -EINVAL;
72246da40f3719af Felipe Balbi 2011-08-19 2367 }
72246da40f3719af Felipe Balbi 2011-08-19 2368
218ef7b647e3367c Felipe Balbi 2016-04-04 2369 return 0;
218ef7b647e3367c Felipe Balbi 2016-04-04 2370 }
218ef7b647e3367c Felipe Balbi 2016-04-04 2371
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next prev parent reply other threads:[~2023-02-07 10:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-06 19:13 [PATCH v3 0/5] Add function suspend/resume and remote wakeup support Elson Roy Serrao
2023-02-06 19:13 ` [PATCH v3 1/5] usb: gadget: Properly configure the device for remote wakeup Elson Roy Serrao
2023-02-06 20:14 ` Alan Stern
2023-02-06 20:30 ` Elson Serrao
2023-02-07 0:24 ` Thinh Nguyen
2023-02-06 19:13 ` [PATCH v3 2/5] usb: dwc3: Add remote wakeup handling Elson Roy Serrao
2023-02-07 0:48 ` Thinh Nguyen
2023-02-07 22:41 ` Elson Serrao
2023-02-08 1:10 ` Thinh Nguyen
2023-02-08 1:51 ` Elson Serrao
2023-02-08 2:11 ` Thinh Nguyen
2023-02-10 1:36 ` Elson Serrao
2023-02-10 2:27 ` Thinh Nguyen
2023-02-10 3:43 ` Elson Serrao
2023-02-07 10:45 ` kernel test robot [this message]
2023-02-06 19:13 ` [PATCH v3 3/5] usb: gadget: Add function wakeup support Elson Roy Serrao
2023-02-07 1:14 ` Thinh Nguyen
2023-02-07 5:56 ` Greg KH
2023-02-06 19:13 ` [PATCH v3 4/5] usb: dwc3: Add function suspend and " Elson Roy Serrao
2023-02-06 19:13 ` [PATCH v3 5/5] usb: gadget: f_ecm: Add suspend/resume and remote " Elson Roy Serrao
2023-02-07 1:24 ` [PATCH v3 0/5] Add function " Thinh Nguyen
2023-02-07 2:14 ` Elson Serrao
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=202302071850.VZRjtYXx-lkp@intel.com \
--to=lkp@intel.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=quic_eserrao@quicinc.com \
--cc=quic_jackp@quicinc.com \
--cc=quic_wcheng@quicinc.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 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.