From patchwork Thu Jul 25 10:53:51 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: 18560 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 99B7925DF6 for ; Thu, 25 Jul 2013 10:54:24 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hf12sf77506vcb.7 for ; Thu, 25 Jul 2013 03:54:24 -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=Rupa3nPABIo/iG43r5OpAHU6BNX/TALg2xmbU5OERls=; b=SmN6FJp5YkZHBAmzIBGTjeACyVujqhwf4tl+131MvT/OuUQIJqGfs6P/gBcbECCKaI s2wPf6kslkvGm/hATJKYS8WsrF5ZYz6CBh8926kP4RtTYzy8c8gLpyB0Pt38fygbbYk1 CaaOlxkFUIJ2XUIHvfKmJ7kyaTG6WWBe7UBdPucQ0/y/2HB+sUVGCjGgAF7K5/RZdSZl K4dJb8vDQabgyXaqYPeWRKtOLL3wwMgHSWfEj2Iw4b5hre2BQ9mzolGLAHsicXV+Dpwn tEWJG5fY3T8+GeNjxxxG5VTe8YQgsEGbs9yHMWavzgTLyJLY78S5nT0/p46+WTvo102B NXfg== X-Received: by 10.236.77.166 with SMTP id d26mr21832173yhe.40.1374749664305; Thu, 25 Jul 2013 03:54:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.1.227 with SMTP id 3ls589160qep.5.gmail; Thu, 25 Jul 2013 03:54:24 -0700 (PDT) X-Received: by 10.52.72.15 with SMTP id z15mr14509626vdu.91.1374749664189; Thu, 25 Jul 2013 03:54:24 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id n6si12170774ven.3.2013.07.25.03.54.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ha11so47891vcb.35 for ; Thu, 25 Jul 2013 03:54:24 -0700 (PDT) X-Received: by 10.220.67.10 with SMTP id p10mr217398vci.85.1374749664112; Thu, 25 Jul 2013 03:54:24 -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 yu8csp71149veb; Thu, 25 Jul 2013 03:54:23 -0700 (PDT) X-Received: by 10.68.90.99 with SMTP id bv3mr1621410pbb.108.1374749663135; Thu, 25 Jul 2013 03:54:23 -0700 (PDT) Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by mx.google.com with ESMTPS id co1si29823915pbc.258.2013.07.25.03.54.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.48 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.160.48; Received: by mail-pb0-f48.google.com with SMTP id md4so602934pbc.7 for ; Thu, 25 Jul 2013 03:54:22 -0700 (PDT) X-Received: by 10.66.219.135 with SMTP id po7mr48740892pac.21.1374749662739; Thu, 25 Jul 2013 03:54:22 -0700 (PDT) Received: from localhost.localdomain ([223.239.156.49]) by mx.google.com with ESMTPSA id nm10sm53355013pbc.28.2013.07.25.03.54.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:21 -0700 (PDT) From: Manjunath Goudar To: manjunath.goudar@linaro.org Cc: arnd@linaro.org, patches@linaro.org Subject: [PATCH V4 02/11] USB: OHCI: Properly handle ohci-at91 suspend Date: Thu, 25 Jul 2013 16:23:51 +0530 Message-Id: <1374749640-30062-3-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: ALoCoQnflYd4YBaSOOttAJEE5YF1tLGc+R28ErlijqgmX1P/sAChqrZr2AlyLqKdjmn6LBtR2d5T X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 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-at91 glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_hcd_at91_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: -Aligned variable "do_wakeup" and "ret". V4: - No change. --- drivers/usb/host/ohci-at91.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 08e28eb..008645c 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -618,8 +618,14 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct ohci_hcd *ohci = hcd_to_ohci(hcd); + bool do_wakeup = device_may_wakeup(&pdev->dev); + int ret; - if (device_may_wakeup(&pdev->dev)) + ret = ohci_suspend(hcd, do_wakeup); + if (ret) + return ret; + + if (do_wakeup) enable_irq_wake(hcd->irq); /* @@ -640,7 +646,7 @@ ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) at91_stop_clock(); } - return 0; + return ret; } static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)