From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752447AbcG2I2j (ORCPT ); Fri, 29 Jul 2016 04:28:39 -0400 Received: from mga04.intel.com ([192.55.52.120]:41551 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750844AbcG2I2h (ORCPT ); Fri, 29 Jul 2016 04:28:37 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,438,1464678000"; d="asc'?scan'208";a="1004758345" From: Felipe Balbi To: robert.foss@collabora.com, mathias.nyman@intel.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andrew Bresticker , Robert Foss Subject: Re: [PACTH v1 1/2] usb: xhci: plat: Enable runtime PM In-Reply-To: <1469740762-18234-2-git-send-email-robert.foss@collabora.com> References: <1469740762-18234-1-git-send-email-robert.foss@collabora.com> <1469740762-18234-2-git-send-email-robert.foss@collabora.com> User-Agent: Notmuch/0.22+58~g3a45d29 (https://notmuchmail.org) Emacs/25.0.95.2 (x86_64-pc-linux-gnu) Date: Fri, 29 Jul 2016 03:24:17 +0300 Message-ID: <87zip1s34e.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, robert.foss@collabora.com writes: > From: Andrew Bresticker > > Enable runtime PM for the xhci-plat device so that the parent device > may implement runtime PM. > > Signed-off-by: Andrew Bresticker > Tested-by: Robert Foss > Signed-off-by: Robert Foss > --- > drivers/usb/host/xhci-plat.c | 19 +++++++++++++++++-- > 1 file changed, 17 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c > index ed56bf9..fbd45c2 100644 > --- a/drivers/usb/host/xhci-plat.c > +++ b/drivers/usb/host/xhci-plat.c > @@ -246,6 +246,9 @@ static int xhci_plat_probe(struct platform_device *pd= ev) > if (ret) > goto dealloc_usb2_hcd; >=20=20 > + pm_runtime_set_active(&pdev->dev); > + pm_runtime_enable(&pdev->dev); > + > return 0; >=20=20 >=20=20 > @@ -274,6 +277,8 @@ static int xhci_plat_remove(struct platform_device *d= ev) > struct xhci_hcd *xhci =3D hcd_to_xhci(hcd); > struct clk *clk =3D xhci->clk; >=20=20 > + pm_runtime_disable(&dev->dev); > + > usb_remove_hcd(xhci->shared_hcd); > usb_phy_shutdown(hcd->usb_phy); >=20=20 > @@ -292,7 +297,9 @@ static int xhci_plat_suspend(struct device *dev) > { > struct usb_hcd *hcd =3D dev_get_drvdata(dev); > struct xhci_hcd *xhci =3D hcd_to_xhci(hcd); > + int ret; >=20=20 > + pm_runtime_get_sync(dev); you need to check for possible errors here. Ditto to the other occurence below. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXmqIyAAoJEIaOsuA1yqRExgwP/3O3IUYUmriANq5Ywaucmc62 q91NI/jjxjbiwT3po2l9Ds06NzwpHEMcovi4azHCOclgi24HAyuoNSd5tElHweE6 uj917AZd2q2cXmxFLryyitW/5vWKJiLJw4AvOh1DWg/g6i0Vmxo583TGs3VCNhye 25ep/acBQPFHtsf1t4oFZvoIpHa9w4ITO0jFl0Zfbzpoe+cxwOgp2ii3UaWPXSSX JYXI/1IV693BrLBFwo2X1URPa2mO8ot/5yTeh97LMpj2hXwOAf9x90lo06SBQfYb FPvdvQ5RBvSdxP4XjremP9Z6SOjL/+6YiQGPF1aR29t2g3ORc8b0lls1Rybrl1pb cpqS8NOZqZqrUCmgEGAgczk1g+E6bl4FojyCDf8Rq8ZjNHNfcbvttCUlfrBNOSsg G0rTItv08hf7srHRyI9y7UuMo0dIVBGqaii+9iK2NO5aJS6BVdm4KqpurmVq1KvF W6oNdGAx/Rj73T+W5FkLFkjbGUnPra02kJgoFOCS63jZ72nikoO9rig2Mt2Gsnxm 9tlkq+wgJZid+ywtwCrqTCH+aZLm6ncZ4B6+YEl0l3NShYyoOe1LrsacfYSY/ClT ADr8hj3h2gCyoNXrgduBSWmXK6NPr3e9uRMAgNX+XCOb1I9ZZT00nu4oNQ6PXVN2 1htPZqSZuXIEenU/ggoH =98gf -----END PGP SIGNATURE----- --=-=-=--