From patchwork Mon Jul 22 09:32:36 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: 18469 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7EFDC25E1F for ; Mon, 22 Jul 2013 09:33:05 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id a1sf8288401qcx.2 for ; Mon, 22 Jul 2013 02:33:05 -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=YaOH60R66oQagwO/ERb+WpaW5f/Zazwozpu2rDlZhJqGuHn1eax5xWqPa6niMNbivU BDDz27mCRwY7crwFuEo9FyfyAcHKaIHKE8CXsJb8k30VNePBo7LfvBPb6Bh8NkBk58TF bdoOfFeTGKOZ3jsg5FXJnWQwiS1UiWWRb+7QrHlFK7sC4juMGxrL+4MPiiKOckPx2UNf 3+mh9MOP2AvHRudPIaVZwRk5cOpZ9IZd1Unvt4JTAyITX5e1RjrNFSq/b3Iur6MkSPOK PLkn04+KfmHnr+aWU7+6qFWHDj/NLV7tSCka7aEWU0M3+Y6zbIVTPYs61tmh4l38UP8A zC8w== X-Received: by 10.236.135.66 with SMTP id t42mr15404712yhi.36.1374485585154; Mon, 22 Jul 2013 02:33:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.95.138 with SMTP id dk10ls2615956qeb.4.gmail; Mon, 22 Jul 2013 02:33:05 -0700 (PDT) X-Received: by 10.58.67.9 with SMTP id j9mr9242387vet.22.1374485584693; Mon, 22 Jul 2013 02:33:04 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id im6si6845969vdb.33.2013.07.22.02.33.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:04 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id m1so4962473ves.0 for ; Mon, 22 Jul 2013 02:33:04 -0700 (PDT) X-Received: by 10.58.119.233 with SMTP id kx9mr9210415veb.3.1374485584617; Mon, 22 Jul 2013 02:33:04 -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 yu8csp46425veb; Mon, 22 Jul 2013 02:33:03 -0700 (PDT) X-Received: by 10.68.235.9 with SMTP id ui9mr29894604pbc.85.1374485583558; Mon, 22 Jul 2013 02:33:03 -0700 (PDT) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by mx.google.com with ESMTPS id pf2si19222284pac.331.2013.07.22.02.33.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.43 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.220.43; Received: by mail-pa0-f43.google.com with SMTP id hz11so6816151pad.2 for ; Mon, 22 Jul 2013 02:33:03 -0700 (PDT) X-Received: by 10.68.240.72 with SMTP id vy8mr29593037pbc.161.1374485582985; Mon, 22 Jul 2013 02:33:02 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.229]) by mx.google.com with ESMTPSA id bb1sm24977759pbc.10.2013.07.22.02.32.57 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:02 -0700 (PDT) From: Manjunath Goudar To: linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, patches@linaro.org, stern@rowland.harvard.edu, arnd@linaro.org, manjunath.goudar@linaro.org, linaro-kernel@lists.linaro.org, Arnd Bergmann , Greg KH Subject: [PATCH 01/11] USB: OHCI: Properly handle OHCI controller suspend Date: Mon, 22 Jul 2013 15:02:36 +0530 Message-Id: <1374485566-3997-2-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374485566-3997-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1374485566-3997-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQn6SDdGEth/OTn/Ia/k473EvRQaA49ErhxbWyOgtZyVORflgHjx6fHcpPOYyc2aSQ1Uaf5e X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 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);