All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Saranya Gopal <saranya.gopal@intel.com>
Cc: kbuild-all@01.org, hdegoede@redhat.com,
	heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org,
	mathias.nyman@intel.com, linux-usb@vger.kernel.org,
	Saranya Gopal <saranya.gopal@intel.com>,
	Balaji Manoharan <m.balaji@intel.com>
Subject: Re: [PATCH v3 2/2] usb: roles: intel: Enable static DRD mode for role switch
Date: Thu, 29 Aug 2019 04:29:42 +0800	[thread overview]
Message-ID: <201908290407.itbGWD9q%lkp@intel.com> (raw)
In-Reply-To: <1567011332-22839-2-git-send-email-saranya.gopal@intel.com>

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

Hi Saranya,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.3-rc6 next-20190827]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Saranya-Gopal/xhci-ext-caps-c-Add-property-to-disable-Intel-SW-switch/20190829-031957
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-11) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/usb/roles/intel-xhci-usb-role-switch.c: In function 'intel_xhci_usb_set_role':
>> drivers/usb/roles/intel-xhci-usb-role-switch.c:55:16: warning: 'drd_config' may be used uninitialized in this function [-Wmaybe-uninitialized]
     u32 glk, val, drd_config;
                   ^~~~~~~~~~

vim +/drd_config +55 drivers/usb/roles/intel-xhci-usb-role-switch.c

    49	
    50	static int intel_xhci_usb_set_role(struct device *dev, enum usb_role role)
    51	{
    52		struct intel_xhci_usb_data *data = dev_get_drvdata(dev);
    53		unsigned long timeout;
    54		acpi_status status;
  > 55		u32 glk, val, drd_config;
    56	
    57		/*
    58		 * On many CHT devices ACPI event (_AEI) handlers read / modify /
    59		 * write the cfg0 register, just like we do. Take the ACPI lock
    60		 * to avoid us racing with the AML code.
    61		 */
    62		status = acpi_acquire_global_lock(ACPI_WAIT_FOREVER, &glk);
    63		if (ACPI_FAILURE(status) && status != AE_NOT_CONFIGURED) {
    64			dev_err(dev, "Error could not acquire lock\n");
    65			return -EIO;
    66		}
    67	
    68		pm_runtime_get_sync(dev);
    69	
    70		/*
    71		 * Set idpin value as requested.
    72		 * Since some devices rely on firmware setting DRD_CONFIG and
    73		 * SW_SWITCH_EN bits to be zero for role switch,
    74		 * do not set these bits for those devices.
    75		 */
    76		val = readl(data->base + DUAL_ROLE_CFG0);
    77		switch (role) {
    78		case USB_ROLE_NONE:
    79			val |= SW_IDPIN;
    80			val &= ~SW_VBUS_VALID;
    81			drd_config = DRD_CONFIG_DYNAMIC;
    82			break;
    83		case USB_ROLE_HOST:
    84			val &= ~SW_IDPIN;
    85			val &= ~SW_VBUS_VALID;
    86			drd_config = DRD_CONFIG_STATIC_HOST;
    87			break;
    88		case USB_ROLE_DEVICE:
    89			val |= SW_IDPIN;
    90			val |= SW_VBUS_VALID;
    91			drd_config = DRD_CONFIG_STATIC_DEVICE;
    92			break;
    93		}
    94		val |= SW_IDPIN_EN;
    95		if (data->enable_sw_switch) {
    96			val &= ~DRD_CONFIG_MASK;
    97			val |= SW_SWITCH_EN | drd_config;
    98		}
    99		writel(val, data->base + DUAL_ROLE_CFG0);
   100	
   101		acpi_release_global_lock(glk);
   102	
   103		/* In most case it takes about 600ms to finish mode switching */
   104		timeout = jiffies + msecs_to_jiffies(DUAL_ROLE_CFG1_POLL_TIMEOUT);
   105	
   106		/* Polling on CFG1 register to confirm mode switch.*/
   107		do {
   108			val = readl(data->base + DUAL_ROLE_CFG1);
   109			if (!!(val & HOST_MODE) == (role == USB_ROLE_HOST)) {
   110				pm_runtime_put(dev);
   111				return 0;
   112			}
   113	
   114			/* Interval for polling is set to about 5 - 10 ms */
   115			usleep_range(5000, 10000);
   116		} while (time_before(jiffies, timeout));
   117	
   118		pm_runtime_put(dev);
   119	
   120		dev_warn(dev, "Timeout waiting for role-switch\n");
   121		return -ETIMEDOUT;
   122	}
   123	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

  reply	other threads:[~2019-08-28 20:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28 16:55 [PATCH v3 1/2] xhci-ext-caps.c: Add property to disable Intel SW switch Saranya Gopal
2019-08-28 16:55 ` [PATCH v3 2/2] usb: roles: intel: Enable static DRD mode for role switch Saranya Gopal
2019-08-28 20:29   ` kbuild test robot [this message]
2019-08-29  7:53   ` Heikki Krogerus

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=201908290407.itbGWD9q%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=kbuild-all@01.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.balaji@intel.com \
    --cc=mathias.nyman@intel.com \
    --cc=saranya.gopal@intel.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.