From: kernel test robot <lkp@intel.com>
To: Badhri Jagan Sridharan <badhri@google.com>,
gregkh@linuxfoundation.org, stern@rowland.harvard.edu,
colin.i.king@gmail.com, xuetao09@huawei.com,
quic_eserrao@quicinc.com, water.zhangjiantao@huawei.com,
peter.chen@freescale.com, balbi@ti.com
Cc: oe-kbuild-all@lists.linux.dev, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Badhri Jagan Sridharan <badhri@google.com>
Subject: Re: [PATCH v2 1/2] usb: gadget: udc: core: Invoke usb_gadget_connect only when started
Date: Thu, 6 Apr 2023 17:26:48 +0800 [thread overview]
Message-ID: <202304061758.Tz5RJDZU-lkp@intel.com> (raw)
In-Reply-To: <20230406062549.2461917-1-badhri@google.com>
Hi Badhri,
kernel test robot noticed the following build warnings:
[auto build test WARNING on d629c0e221cd99198b843d8351a0a9bfec6c0423]
url: https://github.com/intel-lab-lkp/linux/commits/Badhri-Jagan-Sridharan/usb-gadget-udc-core-Prevent-redundant-calls-to-pullup/20230406-142708
base: d629c0e221cd99198b843d8351a0a9bfec6c0423
patch link: https://lore.kernel.org/r/20230406062549.2461917-1-badhri%40google.com
patch subject: [PATCH v2 1/2] usb: gadget: udc: core: Invoke usb_gadget_connect only when started
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20230406/202304061758.Tz5RJDZU-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 12.1.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
# https://github.com/intel-lab-lkp/linux/commit/2f12e8b0c9bf3d25df88c73b614c3e8d84bd7338
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Badhri-Jagan-Sridharan/usb-gadget-udc-core-Prevent-redundant-calls-to-pullup/20230406-142708
git checkout 2f12e8b0c9bf3d25df88c73b614c3e8d84bd7338
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash drivers/usb/gadget/udc/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304061758.Tz5RJDZU-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/usb/gadget/udc/core.c:696:5: warning: no previous prototype for 'usb_gadget_connect_locked' [-Wmissing-prototypes]
696 | int usb_gadget_connect_locked(struct usb_gadget *gadget)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/usb/gadget/udc/core.c:749:5: warning: no previous prototype for 'usb_gadget_disconnect_locked' [-Wmissing-prototypes]
749 | int usb_gadget_disconnect_locked(struct usb_gadget *gadget)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/usb_gadget_connect_locked +696 drivers/usb/gadget/udc/core.c
694
695 /* Internal version of usb_gadget_connect needs to be called with udc_connect_control_lock held. */
> 696 int usb_gadget_connect_locked(struct usb_gadget *gadget)
697 {
698 int ret = 0;
699
700 if (!gadget->ops->pullup) {
701 ret = -EOPNOTSUPP;
702 goto out;
703 }
704
705 if (gadget->deactivated || !gadget->udc->started) {
706 /*
707 * If gadget is deactivated we only save new state.
708 * Gadget will be connected automatically after activation.
709 *
710 * udc first needs to be started before gadget can be pulled up.
711 */
712 gadget->connected = true;
713 goto out;
714 }
715
716 ret = gadget->ops->pullup(gadget, 1);
717 if (!ret)
718 gadget->connected = 1;
719
720 out:
721 trace_usb_gadget_connect(gadget, ret);
722
723 return ret;
724 }
725
726 /**
727 * usb_gadget_connect - software-controlled connect to USB host
728 * @gadget:the peripheral being connected
729 *
730 * Enables the D+ (or potentially D-) pullup. The host will start
731 * enumerating this gadget when the pullup is active and a VBUS session
732 * is active (the link is powered).
733 *
734 * Returns zero on success, else negative errno.
735 */
736 int usb_gadget_connect(struct usb_gadget *gadget)
737 {
738 int ret;
739
740 mutex_lock(&gadget->udc->connect_lock);
741 ret = usb_gadget_connect_locked(gadget);
742 mutex_unlock(&gadget->udc->connect_lock);
743
744 return ret;
745 }
746 EXPORT_SYMBOL_GPL(usb_gadget_connect);
747
748 /* Internal version of usb_gadget_disconnect needs to be called with udc->connect_lock held. */
> 749 int usb_gadget_disconnect_locked(struct usb_gadget *gadget)
750 {
751 int ret = 0;
752
753 if (!gadget->ops->pullup) {
754 ret = -EOPNOTSUPP;
755 goto out;
756 }
757
758 if (!gadget->connected)
759 goto out;
760
761 if (gadget->deactivated || !gadget->udc->started) {
762 /*
763 * If gadget is deactivated we only save new state.
764 * Gadget will stay disconnected after activation.
765 *
766 * udc should have been started before gadget being pulled down.
767 */
768 gadget->connected = false;
769 goto out;
770 }
771
772 ret = gadget->ops->pullup(gadget, 0);
773 if (!ret)
774 gadget->connected = 0;
775
776 mutex_lock(&udc_lock);
777 if (gadget->udc->driver)
778 gadget->udc->driver->disconnect(gadget);
779 mutex_unlock(&udc_lock);
780
781 out:
782 trace_usb_gadget_disconnect(gadget, ret);
783
784 return ret;
785 }
786
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next prev parent reply other threads:[~2023-04-06 9:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-06 6:25 [PATCH v2 1/2] usb: gadget: udc: core: Invoke usb_gadget_connect only when started Badhri Jagan Sridharan
2023-04-06 6:25 ` [PATCH v2 2/2] usb: gadget: udc: core: Prevent redundant calls to pullup Badhri Jagan Sridharan
2023-04-06 6:37 ` [PATCH v2 1/2] usb: gadget: udc: core: Invoke usb_gadget_connect only when started Greg KH
2023-04-07 3:10 ` Badhri Jagan Sridharan
2023-04-06 9:26 ` kernel test robot [this message]
2023-04-06 10:08 ` kernel test robot
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=202304061758.Tz5RJDZU-lkp@intel.com \
--to=lkp@intel.com \
--cc=badhri@google.com \
--cc=balbi@ti.com \
--cc=colin.i.king@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=peter.chen@freescale.com \
--cc=quic_eserrao@quicinc.com \
--cc=stable@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=water.zhangjiantao@huawei.com \
--cc=xuetao09@huawei.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