* [PATCH] usb: roles: intel_xhci: Fix Unbalanced pm_runtime_enable
@ 2018-10-09 4:52 wan.ahmad.zainie.wan.mohamad
2018-10-10 11:08 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: wan.ahmad.zainie.wan.mohamad @ 2018-10-09 4:52 UTC (permalink / raw)
To: hdegoede, gregkh, mathias.nyman
Cc: linux-usb, linux-kernel, wan.ahmad.zainie.wan.mohamad
From: Wan Ahmad Zainie <wan.ahmad.zainie.wan.mohamad@intel.com>
Add missing pm_runtime_disable() to remove(), in order to avoid
an Unbalanced pm_runtime_enable when the module is removed and
re-probed.
Error log:
root@intel-corei7-64:~# modprobe -r intel_xhci_usb_role_switch
root@intel-corei7-64:~# modprobe intel_xhci_usb_role_switch
intel_xhci_usb_sw intel_xhci_usb_sw: Unbalanced pm_runtime_enable!
Fixes: cb2968468605 (usb: roles: intel_xhci: Enable runtime PM)
Cc: <stable@vger.kernel.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Wan Ahmad Zainie <wan.ahmad.zainie.wan.mohamad@intel.com>
---
drivers/usb/roles/intel-xhci-usb-role-switch.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/roles/intel-xhci-usb-role-switch.c b/drivers/usb/roles/intel-xhci-usb-role-switch.c
index 1fb3dd0f1dfa..277de96181f9 100644
--- a/drivers/usb/roles/intel-xhci-usb-role-switch.c
+++ b/drivers/usb/roles/intel-xhci-usb-role-switch.c
@@ -161,6 +161,8 @@ static int intel_xhci_usb_remove(struct platform_device *pdev)
{
struct intel_xhci_usb_data *data = platform_get_drvdata(pdev);
+ pm_runtime_disable(&pdev->dev);
+
usb_role_switch_unregister(data->role_sw);
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: roles: intel_xhci: Fix Unbalanced pm_runtime_enable
2018-10-09 4:52 [PATCH] usb: roles: intel_xhci: Fix Unbalanced pm_runtime_enable wan.ahmad.zainie.wan.mohamad
@ 2018-10-10 11:08 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2018-10-10 11:08 UTC (permalink / raw)
To: wan.ahmad.zainie.wan.mohamad, gregkh, mathias.nyman
Cc: linux-usb, linux-kernel
Hi,
On 09-10-18 06:52, wan.ahmad.zainie.wan.mohamad@intel.com wrote:
> From: Wan Ahmad Zainie <wan.ahmad.zainie.wan.mohamad@intel.com>
>
> Add missing pm_runtime_disable() to remove(), in order to avoid
> an Unbalanced pm_runtime_enable when the module is removed and
> re-probed.
>
> Error log:
> root@intel-corei7-64:~# modprobe -r intel_xhci_usb_role_switch
> root@intel-corei7-64:~# modprobe intel_xhci_usb_role_switch
> intel_xhci_usb_sw intel_xhci_usb_sw: Unbalanced pm_runtime_enable!
>
> Fixes: cb2968468605 (usb: roles: intel_xhci: Enable runtime PM)
> Cc: <stable@vger.kernel.org>
> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Signed-off-by: Wan Ahmad Zainie <wan.ahmad.zainie.wan.mohamad@intel.com>
Thank you for the patch, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> drivers/usb/roles/intel-xhci-usb-role-switch.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/roles/intel-xhci-usb-role-switch.c b/drivers/usb/roles/intel-xhci-usb-role-switch.c
> index 1fb3dd0f1dfa..277de96181f9 100644
> --- a/drivers/usb/roles/intel-xhci-usb-role-switch.c
> +++ b/drivers/usb/roles/intel-xhci-usb-role-switch.c
> @@ -161,6 +161,8 @@ static int intel_xhci_usb_remove(struct platform_device *pdev)
> {
> struct intel_xhci_usb_data *data = platform_get_drvdata(pdev);
>
> + pm_runtime_disable(&pdev->dev);
> +
> usb_role_switch_unregister(data->role_sw);
> return 0;
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-10 11:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-09 4:52 [PATCH] usb: roles: intel_xhci: Fix Unbalanced pm_runtime_enable wan.ahmad.zainie.wan.mohamad
2018-10-10 11:08 ` Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).