All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH 13/15] usb: dwc2: Add exit hibernation mode before removing drive
Date: Thu, 15 Apr 2021 20:34:32 +0800	[thread overview]
Message-ID: <202104152012.r8uUkYwV-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 9588 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <d01d23e2473407af37c42acb6ca4815ae5fd256e.1618464534.git.Arthur.Petrosyan@synopsys.com>
References: <d01d23e2473407af37c42acb6ca4815ae5fd256e.1618464534.git.Arthur.Petrosyan@synopsys.com>
TO: Artur Petrosyan <Arthur.Petrosyan@synopsys.com>
TO: Felipe Balbi <balbi@kernel.org>
TO: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
TO: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
TO: linux-usb(a)vger.kernel.org
TO: linux-kernel(a)vger.kernel.org
CC: John Youn <John.Youn@synopsys.com>
CC: Artur Petrosyan <Arthur.Petrosyan@synopsys.com>

Hi Artur,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on usb/usb-testing]
[also build test WARNING on next-20210414]
[cannot apply to peter.chen-usb/for-usb-next linus/master balbi-usb/testing/next v5.12-rc7]
[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]

url:    https://github.com/0day-ci/linux/commits/Artur-Petrosyan/usb-dwc2-Update-exit-hibernation-when-port-reset-is-asserted/20210415-144021
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago
config: i386-randconfig-m021-20210415 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/usb/dwc2/platform.c:324 dwc2_driver_remove() error: potentially dereferencing uninitialized 'gr'.

vim +/gr +324 drivers/usb/dwc2/platform.c

09a75e85779014 drivers/usb/dwc2/platform.c     Marek Szyprowski   2015-10-14  304  
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  305  /**
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  306   * dwc2_driver_remove() - Called when the DWC_otg core is unregistered with the
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  307   * DWC_otg driver
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  308   *
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  309   * @dev: Platform device
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  310   *
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  311   * This routine is called, for example, when the rmmod command is executed. The
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  312   * device may or may not be electrically present. If it is present, the driver
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  313   * stops device processing. Any resources used on behalf of this device are
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  314   * freed.
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  315   */
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  316  static int dwc2_driver_remove(struct platform_device *dev)
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  317  {
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  318  	struct dwc2_hsotg *hsotg = platform_get_drvdata(dev);
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  319  	struct dwc2_gregs_backup *gr;
b46b1ef7b0da5c drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-08  320  	int ret = 0;
b46b1ef7b0da5c drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-08  321  
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  322  	/* Exit Hibernation when driver is removed. */
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  323  	if (hsotg->hibernated) {
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15 @324  		if (gr->gotgctl & GOTGCTL_CURMODE_HOST) {
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  325  			ret = dwc2_exit_hibernation(hsotg, 0, 0, 1);
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  326  			if (ret)
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  327  				dev_err(hsotg->dev,
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  328  					"exit hibernation failed.\n");
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  329  		} else {
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  330  			ret = dwc2_exit_hibernation(hsotg, 0, 0, 0);
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  331  			if (ret)
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  332  				dev_err(hsotg->dev,
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  333  					"exit hibernation failed.\n");
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  334  		}
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  335  	}
8e4dbc0200040a drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-15  336  
b46b1ef7b0da5c drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-08  337  	/* Exit Partial Power Down when driver is removed. */
b46b1ef7b0da5c drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-08  338  	if (hsotg->in_ppd) {
b46b1ef7b0da5c drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-08  339  		ret = dwc2_exit_partial_power_down(hsotg, 0, true);
b46b1ef7b0da5c drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-08  340  		if (ret)
b46b1ef7b0da5c drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-08  341  			dev_err(hsotg->dev,
b46b1ef7b0da5c drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-08  342  				"exit partial_power_down failed\n");
b46b1ef7b0da5c drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-08  343  	}
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  344  
401411bbc4e62b drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-13  345  	/* Exit clock gating when driver is removed. */
401411bbc4e62b drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-13  346  	if (hsotg->params.power_down == DWC2_POWER_DOWN_PARAM_NONE &&
401411bbc4e62b drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-13  347  	    hsotg->bus_suspended) {
401411bbc4e62b drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-13  348  		if (dwc2_is_device_mode(hsotg))
401411bbc4e62b drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-13  349  			dwc2_gadget_exit_clock_gating(hsotg, 0);
401411bbc4e62b drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-13  350  		else
401411bbc4e62b drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-13  351  			dwc2_host_exit_clock_gating(hsotg, 0);
401411bbc4e62b drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-13  352  	}
401411bbc4e62b drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-13  353  
f91eea447ac32d drivers/usb/dwc2/platform.c     Mian Yousaf Kaukab 2015-04-29  354  	dwc2_debugfs_exit(hsotg);
e39af88f18dfe9 drivers/usb/dwc2/platform.c     Marek Szyprowski   2015-03-10  355  	if (hsotg->hcd_enabled)
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  356  		dwc2_hcd_remove(hsotg);
e39af88f18dfe9 drivers/usb/dwc2/platform.c     Marek Szyprowski   2015-03-10  357  	if (hsotg->gadget_enabled)
1f91b4cc03556b drivers/usb/dwc2/platform.c     Felipe Balbi       2015-08-06  358  		dwc2_hsotg_remove(hsotg);
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  359  
17f934024e84e7 drivers/usb/dwc2/platform.c     Amelie Delaunay    2020-09-09  360  	dwc2_drd_exit(hsotg);
17f934024e84e7 drivers/usb/dwc2/platform.c     Amelie Delaunay    2020-09-09  361  
a415083a11cc76 drivers/usb/dwc2/platform.c     Amelie Delaunay    2020-01-24  362  	if (hsotg->params.activate_stm_id_vb_detection)
a415083a11cc76 drivers/usb/dwc2/platform.c     Amelie Delaunay    2020-01-24  363  		regulator_disable(hsotg->usb33d);
a415083a11cc76 drivers/usb/dwc2/platform.c     Amelie Delaunay    2020-01-24  364  
09a75e85779014 drivers/usb/dwc2/platform.c     Marek Szyprowski   2015-10-14  365  	if (hsotg->ll_hw_enabled)
09a75e85779014 drivers/usb/dwc2/platform.c     Marek Szyprowski   2015-10-14  366  		dwc2_lowlevel_hw_disable(hsotg);
09a75e85779014 drivers/usb/dwc2/platform.c     Marek Szyprowski   2015-10-14  367  
83f8da562f8b52 drivers/usb/dwc2/platform.c     Dinh Nguyen        2016-08-10  368  	reset_control_assert(hsotg->reset);
f2830ad455ec0f drivers/usb/dwc2/platform.c     Dinh Nguyen        2017-11-01  369  	reset_control_assert(hsotg->reset_ecc);
83f8da562f8b52 drivers/usb/dwc2/platform.c     Dinh Nguyen        2016-08-10  370  
b46b1ef7b0da5c drivers/usb/dwc2/platform.c     Artur Petrosyan    2021-04-08  371  	return ret;
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  372  }
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman  2013-04-22  373  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 39329 bytes --]

             reply	other threads:[~2021-04-15 12:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15 12:34 kernel test robot [this message]
     [not found] <cover.1618464534.git.Arthur.Petrosyan@synopsys.com>
2021-04-15  5:41 ` [PATCH 13/15] usb: dwc2: Add exit hibernation mode before removing drive Artur Petrosyan
2021-04-15  9:24   ` Sergei Shtylyov
2021-04-16  5:46     ` Artur Petrosyan
2021-04-15  9:50   ` kernel test robot
2021-04-15  9:50     ` kernel test robot
2021-04-15 13:40   ` 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=202104152012.r8uUkYwV-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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.