From patchwork Thu Jul 25 10:53:52 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: 18561 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 760C925DF6 for ; Thu, 25 Jul 2013 10:54:27 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id bv4sf1013217qab.4 for ; Thu, 25 Jul 2013 03:54:27 -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=KcZv6qzE1TNfoGp7SaNQR+km6K95SfzS3EgEZ1WoQqs=; b=mT6L/PaOFkbjf8AlIiS77V/Q26CW/MBWUTTRT1XNYbfazbHLcXG5/BoXxLVK8A/ZCB eylRP902LCsSOUOWTW2ZvmllSghFWied7IJklCMx0k6OcVXXZRGeeJY6cO1khN0gcgEO jFnv+MVJzeBHZbqLj0HJPFiOgAKuMjEXwweEChErEfwtGSzwR7ZskWng9+yXuUK9bGTQ aywSrFSwaPgrdfVCUQfRAb/tGD4G5s1EmswQRzqJIWfJF4+MJusPso4cfigtmNflRSIY YSb1UkVBIxr9hdj+6aU7bia/24cQ66bDoMRYqxX+n9eb9PxL8T9REha2UsW00tBXmLrw mfZg== X-Received: by 10.236.92.7 with SMTP id i7mr22632855yhf.52.1374749667183; Thu, 25 Jul 2013 03:54:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.83.134 with SMTP id q6ls592808qey.89.gmail; Thu, 25 Jul 2013 03:54:27 -0700 (PDT) X-Received: by 10.58.89.147 with SMTP id bo19mr17414263veb.18.1374749667080; Thu, 25 Jul 2013 03:54:27 -0700 (PDT) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx.google.com with ESMTPS id tf3si12156544vec.144.2013.07.25.03.54.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.45 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.45; Received: by mail-vb0-f45.google.com with SMTP id p14so365567vbm.4 for ; Thu, 25 Jul 2013 03:54:27 -0700 (PDT) X-Received: by 10.58.45.70 with SMTP id k6mr17771375vem.9.1374749666989; Thu, 25 Jul 2013 03:54:26 -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 yu8csp71152veb; Thu, 25 Jul 2013 03:54:26 -0700 (PDT) X-Received: by 10.66.231.3 with SMTP id tc3mr48978803pac.167.1374749665984; Thu, 25 Jul 2013 03:54:25 -0700 (PDT) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx.google.com with ESMTPS id ph3si29851651pbc.104.2013.07.25.03.54.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.47 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.220.47; Received: by mail-pa0-f47.google.com with SMTP id kl13so1858331pab.34 for ; Thu, 25 Jul 2013 03:54:25 -0700 (PDT) X-Received: by 10.66.157.68 with SMTP id wk4mr36413406pab.72.1374749665575; Thu, 25 Jul 2013 03:54:25 -0700 (PDT) Received: from localhost.localdomain ([223.239.156.49]) by mx.google.com with ESMTPSA id nm10sm53355013pbc.28.2013.07.25.03.54.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:24 -0700 (PDT) From: Manjunath Goudar To: manjunath.goudar@linaro.org Cc: arnd@linaro.org, patches@linaro.org Subject: [PATCH V4 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Date: Thu, 25 Jul 2013 16:23:52 +0530 Message-Id: <1374749640-30062-4-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: ALoCoQmknlfDfQZmvdy3sS2yFXkj9IZX/eA7WnIiF3mDdKvY8kC8TdFpLD2Gl3clctScl1N1BPDj X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.45 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-s3c2410 glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_hcd_s3c2410_drv_suspend() will ensure 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 V2: -Incase ohci_suspend() fails, return right away without executing further. V3: -rid of unwanted code from ohci_hcd_s3c2410_drv_suspend() which already ohci_suspend() does it. V4: -The do_wakeup variable alignment is removed. --- drivers/usb/host/ohci-s3c2410.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index 48b5948..d4cdf9c 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c @@ -427,26 +427,15 @@ static int ohci_hcd_s3c2410_drv_suspend(struct device *dev) struct usb_hcd *hcd = dev_get_drvdata(dev); struct ohci_hcd *ohci = hcd_to_ohci(hcd); struct platform_device *pdev = to_platform_device(dev); + bool do_wakeup = device_may_wakeup(dev); unsigned long flags; int rc = 0; - /* - * Root hub was already suspended. Disable irq emission and - * mark HW unaccessible, bail out if RH has been resumed. Use - * the spinlock to properly synchronize with possible pending - * RH suspend or resume activity. - */ - spin_lock_irqsave(&ohci->lock, flags); - if (ohci->rh_state != OHCI_RH_SUSPENDED) { - rc = -EINVAL; - goto bail; - } - - clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); + rc = ohci_suspend(hcd, do_wakeup); + if (rc) + return rc; s3c2410_stop_hc(pdev); -bail: - spin_unlock_irqrestore(&ohci->lock, flags); return rc; }