From patchwork Mon Jul 22 09:32:38 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: 18471 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 331CF25E1F for ; Mon, 22 Jul 2013 09:33:16 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id 2sf8685861qea.9 for ; Mon, 22 Jul 2013 02:33:15 -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=AnYR41uYB1Gds00iF1w9+GSBR8rMqolw7yIIKK/gCCH/D3OpBfuaGE2y6YVtJFHViT QrjzU4pM04IrkJhYtaS97dt3XWVPk2joPsFkRpFQUCxeCXrMBQdukVWIx3B3fet1zCyY 8eVTOT3pKYRq8CZlfWIRFMrMDMfAKBRaO1m3wON3QkAuir9kDg6iPolClqwj+Q71eRCT Lrek730PYfdWjYkNlEQ9dFUBDdrabCZILQ+FqB3AZiwQrPFGjUAPhTbT4edB9yy6D/Oo Xw81K7wcLYpyNBGJguU51CqZZNv3ITOzn9PV2qePhUhUMkpN8vwujvF90V94J2OQSaID ZmfA== X-Received: by 10.236.119.227 with SMTP id n63mr15641737yhh.38.1374485595712; Mon, 22 Jul 2013 02:33:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.97.136 with SMTP id ea8ls2526333qeb.43.gmail; Mon, 22 Jul 2013 02:33:15 -0700 (PDT) X-Received: by 10.58.217.167 with SMTP id oz7mr587177vec.15.1374485595604; Mon, 22 Jul 2013 02:33:15 -0700 (PDT) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by mx.google.com with ESMTPS id ex7si6839618vdb.96.2013.07.22.02.33.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.46 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.46; Received: by mail-vb0-f46.google.com with SMTP id 10so4647457vbe.33 for ; Mon, 22 Jul 2013 02:33:15 -0700 (PDT) X-Received: by 10.52.77.5 with SMTP id o5mr7591915vdw.46.1374485595521; Mon, 22 Jul 2013 02:33:15 -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 yu8csp46432veb; Mon, 22 Jul 2013 02:33:14 -0700 (PDT) X-Received: by 10.66.25.133 with SMTP id c5mr18467571pag.4.1374485594517; Mon, 22 Jul 2013 02:33:14 -0700 (PDT) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by mx.google.com with ESMTPS id ap1si19268091pad.103.2013.07.22.02.33.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:14 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.44 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.160.44; Received: by mail-pb0-f44.google.com with SMTP id uo1so6870525pbc.17 for ; Mon, 22 Jul 2013 02:33:14 -0700 (PDT) X-Received: by 10.68.113.2 with SMTP id iu2mr29709662pbb.108.1374485594097; Mon, 22 Jul 2013 02:33:14 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.229]) by mx.google.com with ESMTPSA id bb1sm24977759pbc.10.2013.07.22.02.33.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:13 -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 03/11] USB: OHCI: Properly handle ohci-s3c2410 suspend Date: Mon, 22 Jul 2013 15:02:38 +0530 Message-Id: <1374485566-3997-4-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: ALoCoQk/8/CnKNUArpmxq+f+2YJm5zH2BAJZqR/1MEDNt+JLejQncjtmDBaq4e7v1tjKAvzDlXGb X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.46 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; }