Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752697AbcD0F16 (ORCPT ); Wed, 27 Apr 2016 01:27:58 -0400 Received: from mga04.intel.com ([192.55.52.120]:49473 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752211AbcD0F15 (ORCPT ); Wed, 27 Apr 2016 01:27:57 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,540,1455004800"; d="asc'?scan'208";a="92664687" From: Felipe Balbi To: Jisheng Zhang , mathias.nyman@intel.com, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, yendapally.reddy@broadcom.com, Jisheng Zhang , Gregory CLEMENT , Thomas Petazzoni Subject: Re: [RESEND PATCH v2 1/7] usb: xhci: plat: Fix suspend/resume when the optional clk exists In-Reply-To: <1461675460-2295-2-git-send-email-jszhang@marvell.com> References: <1461675460-2295-1-git-send-email-jszhang@marvell.com> <1461675460-2295-2-git-send-email-jszhang@marvell.com> User-Agent: Notmuch/0.21+96~g9bbc54b (http://notmuchmail.org) Emacs/25.0.90.3 (x86_64-pc-linux-gnu) Date: Wed, 27 Apr 2016 08:25:38 +0300 Message-ID: <87shy7pqr1.fsf@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3688 Lines: 115 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, (since you're fixing somebody else's commit, it's nice to Cc authors) Jisheng Zhang writes: > Commit 4718c1774051 ("usb: host: xhci-plat: add clock support") adds > optional clk support, but it forgets to prepare/disable and ^^^^^^^^^^^^^^^ prepare/enable ? > enable/unprepare the clk in the resume/suspend path. This path fixes ^^^^^^^^^^^^^^^^ ^^^^ disable/unprepare ? patch > this issue by adding missing clk related calls. frankly, I'm not sure this patch is entirely correct. At minimum, it's not necessarily a bug fix. Original commit had no intent in gating clocks during suspend/resume and, IMHO, that might not be what *all* XHCI implementations want, though I'm not entirely sure. > Signed-off-by: Jisheng Zhang > Fixes: 4718c1774051 ("usb: host: xhci-plat: add clock support") Assuming this is, indeed, a fix; you need to Cc stable here. Just add: Cc: # v3.16+ > --- > drivers/usb/host/xhci-plat.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c > index 474b5fa..8cb46cb 100644 > --- a/drivers/usb/host/xhci-plat.c > +++ b/drivers/usb/host/xhci-plat.c > @@ -295,6 +295,7 @@ static int xhci_plat_remove(struct platform_device *d= ev) > #ifdef CONFIG_PM_SLEEP > static int xhci_plat_suspend(struct device *dev) > { > + int ret; this would look neater after hcd and xhci declarations below > struct usb_hcd *hcd =3D dev_get_drvdata(dev); > struct xhci_hcd *xhci =3D hcd_to_xhci(hcd); >=20=20 > @@ -306,14 +307,25 @@ static int xhci_plat_suspend(struct device *dev) > * reconsider this when xhci_plat_suspend enlarges its scope, e.g., > * also applies to runtime suspend. > */ > - return xhci_suspend(xhci, device_may_wakeup(dev)); > + ret =3D xhci_suspend(xhci, device_may_wakeup(dev)); > + if (ret) > + return ret; > + > + clk_disable_unprepare(xhci->clk); > + > + return ret; > } >=20=20 > static int xhci_plat_resume(struct device *dev) > { > + int ret; ditto > struct usb_hcd *hcd =3D dev_get_drvdata(dev); > struct xhci_hcd *xhci =3D hcd_to_xhci(hcd); >=20=20 > + ret =3D clk_prepare_enable(xhci->clk); > + if (ret) > + return ret; > + > return xhci_resume(xhci, 0); > } >=20=20 > --=20 > 2.8.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXIE1SAAoJEIaOsuA1yqREwyMP/jp1LS6JNeDJDZm4xOSRiltR U3NHhqHoiojB4C5KCcPWXrC1Xvw41szl8aMENTNMguXs/4dgH6pGwFMXbzmfyYeQ 2L4EYC5hVbOqcd3eqSMCQhHVAtMKnaKWSdPuY+2leFWoHEFwmxe8m4UvEmA4KXxZ PuxTN8BK5M2W+NoZlI351tLh+Jt6kn72KfyLfdIOmMEWUibyubZtU+vnjMmbz6Tk 2NkdCzO8AFim+TMrMLwf663+90fHyvcdqBrPHD+mQtq5xxB3G6Cn4/1QeiWL6O4N q9pPbW8TblONhifInrJPrPvYgmiNmuhC0euDIM3jHNCt6LA+Xos+gq8blsqoiNBz dJn2qxBWvcXbuCqsHYS6pWDFqNbEL+PL9DVSnqqFwlxZb4dl9JXveTaMqd/2wn+V FwaIrHfF92paoJ8Cpscr5yKSw+f5J4Xcuvcia/1OssRsAFIYHt5PctaqrOK+fSGZ enW3Met8xnlWDpW4VH72hcXgzAPz4UfIMVm8HTBIFor5Cqz+tB/imqiI1vVB7tTa I4ZEXbGufM5V4bG5jF8sMFf975R3W8t5i2Jz1jkjrL8odsceG2DBWVDFZ/QF5/4+ MVZ2FO/DvLVhBoqAnHXBchBRY69nF2zfyHl+NrJD5MMObSVHMpcRmQ6RSDT5eZoD CLkvf7Eg3bFe4onECBml =VO+p -----END PGP SIGNATURE----- --=-=-=--