New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 810200 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Kevin: WARNING: "PM domains can only be changed for unbound devices" on USB unplug

Project Member Reported by briannorris@chromium.org, Feb 8 2018

Issue description

This CL introduced a new warning:

https://chromium-review.googlesource.com/891041

which we promptly hit in our DWC3 driver as soon as we unplug a USB device (which unbinds the entire USB device).

[   64.393889] xhci-hcd xhci-hcd.2.auto: USB bus 5 deregistered
[   64.400168] PM domains can only be changed for unbound devices
[   64.406072] ------------[ cut here ]------------
[   64.410710] WARNING: CPU: 1 PID: 101 at /mnt/host/source/src/third_party/kernel/v4.4/drivers/base/power/common.c:150 dev_pm_domain_set+0x54/0x5c
[   64.423646] Modules linked in: rfcomm cmac btusb btrtl btbcm btintel bluetooth uinput ip6table_filter zram uvcvideo mwifiex_pcie mwifiex bridge stp llc ipt_MASQUERADE nf_nat_masquerade_ipv4 fuse xt_mark snd_seq_dummy snd_seq snd_seq_device cfg80211 cdc_ether usbnet r8152 mii joydev
[   64.448954] 
[   64.450449] CPU: 1 PID: 101 Comm: kworker/1:1 Not tainted 4.4.114 #2
[   64.456795] Hardware name: Google Kevin (DT)
[   64.461071] Workqueue: events dwc3_rockchip_otg_extcon_evt_work
[   64.466999] task: ffffffc0ee5f9a00 ti: ffffffc0ede2c000 task.ti: ffffffc0ede2c000
[   64.474477] PC is at dev_pm_domain_set+0x54/0x5c
[   64.479093] LR is at dev_pm_domain_set+0x54/0x5c
...
[   66.011079] ---[ end trace e990d69eadf57238 ]---
[   66.015696] Call trace:
[   66.018158] [<ffffffc0005f4be4>] dev_pm_domain_set+0x54/0x5c
[   66.023823] [<ffffffc0005fe7d4>] pm_genpd_remove_device+0xc8/0xf4
[   66.029916] [<ffffffc0005ff824>] genpd_dev_pm_detach+0x4c/0xd8
[   66.035745] [<ffffffc0005f4b84>] dev_pm_domain_detach+0x34/0x40
[   66.041666] [<ffffffc0005ed7d4>] platform_drv_remove+0x40/0x50
[   66.047497] [<ffffffc0005eb774>] device_release_driver_internal+0x120/0x1b0
[   66.054453] [<ffffffc0005eb828>] device_release_driver+0x24/0x30
[   66.060454] [<ffffffc0005e9b40>] bus_remove_device+0xd8/0xf0
[   66.066108] [<ffffffc0005e7418>] device_del+0x16c/0x284
[   66.071328] [<ffffffc0005ed550>] platform_device_del+0x20/0x7c
[   66.077156] [<ffffffc0005ed1cc>] platform_device_unregister+0x1c/0x30
[   66.083593] [<ffffffc00076292c>] of_platform_device_destroy+0x78/0xa8
[   66.090026] [<ffffffc0005e769c>] device_for_each_child+0x54/0xa4
[   66.096033] [<ffffffc000762898>] of_platform_depopulate+0x38/0x54
[   66.102130] [<ffffffc000667e70>] dwc3_rockchip_of_depopulate+0x24/0x34
[   66.108653] [<ffffffc000667ddc>] dwc3_rockchip_otg_extcon_evt_work+0xc0/0xf8
[   66.115702] [<ffffffc0002db194>] worker_thread+0x23c/0x748
[   66.121188] [<ffffffc00023b3f0>] kthread+0xe0/0xf0
[   66.125978] [<ffffffc000202dd0>] ret_from_fork+0x10/0x40
[   66.133222] rockchip-dwc3 usb@fe800000: USB HOST disconnected
 
Hi brian,

CL uploaded:
 https://chromium-review.googlesource.com/#/c/chromiumos/third_party/kernel/+/907771 UPSTREAM: PM: Avoid false-positive warnings in dev_pm_domain_set()     

sorry, i'll go through other CLs and check did i miss any other fixes...
Project Member

Comment 2 by bugdroid1@chromium.org, Feb 8 2018

Labels: merge-merged-chromeos-4.4
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/ec22bec75d68e4bad3328e4155752a45059f7630

commit ec22bec75d68e4bad3328e4155752a45059f7630
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date: Thu Feb 08 09:24:34 2018

UPSTREAM: PM: Avoid false-positive warnings in dev_pm_domain_set()

There is a WARN_ON() in dev_pm_domain_set() that triggers on attempts
to set the pm_domain pointer for devices with a driver bound.

However, that WARN_ON() triggers on attempts to clear the pointer
too and the test it uses is based on checking the device's
p->knode_driver pointer which still is set when the device bus
type's/driver's ->remove callback has been executed.  This
leads to false-positive warnings when bus type code calls
dev_pm_domain_set() to clear the pm_domain pointer after
invoking the driver's ->remove() callback.

To avoid those false-positives, make dev_pm_domain_set() check
if the pointer passed to it is NULL and skip the warning in
that case.

Fixes: 989561de9b51 (PM / Domains: add setter for dev.pm_domain)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Sinan Kaya <okaya@codeaurora.org>
Tested-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit e79aee49bcf9ad005b3f2f4cf68b17dc2c22d9c2)

BUG= chromium:810200 
TEST=Build and boot

Change-Id: I772ceae402b2568b8f596bf812422335c9404848
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/907771
Commit-Ready: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>

[modify] https://crrev.com/ec22bec75d68e4bad3328e4155752a45059f7630/drivers/base/power/common.c

Status: Fixed (was: Untriaged)

Sign in to add a comment