Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1404849
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Alan Stern <stern@rowland.harvard.edu> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] usb: host: ehci-msm: Conditionally call ehci suspend/resume |
| Date | Sat, 21 May 2016 16:40:02 +0200 |
| Message-ID | <rBgem-4Gi-15@gated-at.bofh.it> (permalink) |
| References | <rB0jg-2Q7-5@gated-at.bofh.it> |
| X-X-Sender | stern@netrider.rowland.org |
| MIME-Version | 1.0 |
| Content-Type | TEXT/PLAIN; charset=US-ASCII |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 52 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Greg Kroah-Hartman <gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>, <srinivas.kandagatla@linaro.org> |
| X-Original-Date | Sat, 21 May 2016 10:30:58 -0400 (EDT) |
| X-Original-Message-ID | <Pine.LNX.4.44L0.1605211030460.31016-100000@netrider.rowland.org> |
| X-Original-References | <1463780107-12792-1-git-send-email-andy.gross@linaro.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1404849 |
Show key headers only | View raw
On Fri, 20 May 2016, Andy Gross wrote:
> This patch fixes a suspend/resume issue where the driver is blindly
> calling ehci_suspend/resume functions when the ehci hasn't been setup.
> This results in a crash during suspend/resume operations.
>
> Signed-off-by: Andy Gross <andy.gross@linaro.org>
> ---
> drivers/usb/host/ehci-msm.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
> index 3e226ef..9996a60 100644
> --- a/drivers/usb/host/ehci-msm.c
> +++ b/drivers/usb/host/ehci-msm.c
> @@ -179,22 +179,32 @@ static int ehci_msm_remove(struct platform_device *pdev)
> static int ehci_msm_pm_suspend(struct device *dev)
> {
> struct usb_hcd *hcd = dev_get_drvdata(dev);
> + struct ehci_hcd *ehci = hcd_to_ehci(hcd);
> bool do_wakeup = device_may_wakeup(dev);
>
> dev_dbg(dev, "ehci-msm PM suspend\n");
>
> - return ehci_suspend(hcd, do_wakeup);
> + /* Only call ehci_suspend if ehci_setup has been done */
> + if (ehci->sbrn)
> + return ehci_suspend(hcd, do_wakeup);
> +
> + return 0;
> }
>
> static int ehci_msm_pm_resume(struct device *dev)
> {
> struct usb_hcd *hcd = dev_get_drvdata(dev);
> + struct ehci_hcd *ehci = hcd_to_ehci(hcd);
>
> dev_dbg(dev, "ehci-msm PM resume\n");
> - ehci_resume(hcd, false);
> +
> + /* Only call ehci_resume if ehci_setup has been done */
> + if (ehci->sbrn)
> + ehci_resume(hcd, false);
>
> return 0;
> }
> +
> #else
> #define ehci_msm_pm_suspend NULL
> #define ehci_msm_pm_resume NULL
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] usb: host: ehci-msm: Conditionally call ehci suspend/resume Andy Gross <andy.gross@linaro.org> - 2016-05-20 23:40 +0200 Re: [PATCH] usb: host: ehci-msm: Conditionally call ehci suspend/resume Alan Stern <stern@rowland.harvard.edu> - 2016-05-21 16:40 +0200 Re: [PATCH] usb: host: ehci-msm: Conditionally call ehci suspend/resume Pramod Gurav <pramod.gurav@linaro.org> - 2016-05-26 09:00 +0200
csiph-web