From patchwork Thu Jul 25 10:53:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: manjunath.goudar@linaro.org X-Patchwork-Id: 18559 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9DEBA25DF6 for ; Thu, 25 Jul 2013 10:54:21 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id o19sf1013104qap.3 for ; Thu, 25 Jul 2013 03:54:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=T+CP/MsfSkcqDJLIa7R/+iyA9ilCPHRpHTxohO+vZg8=; b=VwPN/7yhoYpuks267e0HIgyF1gfHzIcA7lGadxfNBiNbVTfnPWjKNis8GgUC6ZBGVX FZTw2hSGh2UYhqA5b85ocPJwcjA4bCRYHszMUQOeeHoYLb6cFVl4xtYONPNSFTDmTlDC sMnhloroC21rhpX2VqDI83kLjwtWT55w/xC1hwlbxfVXOuADZjG4KX4eHtHFm+V1/NpF M6NUKUM9WHCSCW105F0vgNmUMYk3sA6A5BqpM+tEXMYA1SE2ev7px1p0tHnrbrLimLGY mXyKa26XwU7xNtl+5o+w57IvU93rUjuAP1txF2Ao7Owp+h9+IYYPEEroHQsIDl72ALPk 69hQ== X-Received: by 10.236.110.168 with SMTP id u28mr22781460yhg.32.1374749661386; Thu, 25 Jul 2013 03:54:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.84.170 with SMTP id a10ls97346qez.20.gmail; Thu, 25 Jul 2013 03:54:21 -0700 (PDT) X-Received: by 10.220.195.195 with SMTP id ed3mr218421vcb.33.1374749661225; Thu, 25 Jul 2013 03:54:21 -0700 (PDT) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id pa20si12169399veb.14.2013.07.25.03.54.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.50; Received: by mail-vb0-f50.google.com with SMTP id w16so373446vbb.9 for ; Thu, 25 Jul 2013 03:54:21 -0700 (PDT) X-Received: by 10.220.17.206 with SMTP id t14mr220238vca.15.1374749661141; Thu, 25 Jul 2013 03:54:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp71147veb; Thu, 25 Jul 2013 03:54:20 -0700 (PDT) X-Received: by 10.68.201.6 with SMTP id jw6mr47458026pbc.202.1374749659981; Thu, 25 Jul 2013 03:54:19 -0700 (PDT) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx.google.com with ESMTPS id bw4si29868920pbc.13.2013.07.25.03.54.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.220.45; Received: by mail-pa0-f45.google.com with SMTP id bg4so1844367pad.18 for ; Thu, 25 Jul 2013 03:54:19 -0700 (PDT) X-Received: by 10.68.170.4 with SMTP id ai4mr31304702pbc.86.1374749659605; Thu, 25 Jul 2013 03:54:19 -0700 (PDT) Received: from localhost.localdomain ([223.239.156.49]) by mx.google.com with ESMTPSA id nm10sm53355013pbc.28.2013.07.25.03.54.15 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:18 -0700 (PDT) From: Manjunath Goudar To: manjunath.goudar@linaro.org Cc: arnd@linaro.org, patches@linaro.org Subject: [PATCH V4 01/11] USB: OHCI: Properly handle OHCI controller suspend Date: Thu, 25 Jul 2013 16:23:50 +0530 Message-Id: <1374749640-30062-2-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374749640-30062-1-git-send-email-manjunath.goudar@linaro.org> References: <1374749640-30062-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQnE5NYepBL0lie9jMEpiSmLasuoEBxNDbaSm/WmUDdbSRtj8sSy8BBq2P3jCS2m2EmXOFN3 X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Suspend scenario in case of OHCI was not properly handled in ochi_suspend()routine. This does proper handling of suspend scenario. Signed-off-by: Manjunath Goudar Acked-by: Alan Stern Cc: Arnd Bergmann Cc: Greg KH Cc: linux-usb@vger.kernel.org V3: New patch. V4: No change. --- drivers/usb/host/ohci-hcd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index b69a49e..f3dcaa2 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -1034,6 +1034,7 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup) { struct ohci_hcd *ohci = hcd_to_ohci (hcd); unsigned long flags; + int rc = 0; /* Disable irq emission and mark HW unaccessible. Use * the spinlock to properly synchronize with possible pending @@ -1046,7 +1047,13 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup) clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); spin_unlock_irqrestore (&ohci->lock, flags); - return 0; + synchronize_irq(hcd->irq); + + if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) { + ohci_resume(hcd, false); + rc = -EBUSY; + } + return rc; } EXPORT_SYMBOL_GPL(ohci_suspend);