From patchwork Fri Oct 17 17:16:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38985 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4A132202DB for ; Fri, 17 Oct 2014 17:20:02 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id p9sf727154lbv.0 for ; Fri, 17 Oct 2014 10:20:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=xvAthhuwF0sdGDqhQuUiePV8fivr/vFv7J4HYQWKnSw=; b=Dh1jKayVI4IQH/27C3L4wRxXL2gTwyLBfh+Oxb9QI1uC/DvqhWwXq8wsmkyC4Mheu3 KXW/0NZZXGOYv1FLebcBtm4pJP1KqbU+DYyU9agKTMwSY2jjsG6xqTQgxE3wM2PMCteX vanyNwr7nnbIsCv6mcwxTqV6MGSHrnjT6VchE8wAGzJupRdM5lcglRJohqqDyRUY9mrc a3iqKESRaWhwKO0ybMQxe+GJzxmgJ1lzGEHjdYHA4ImLQhyTQNzSnMCMC/O+Vd4aAX+y Cyb+58lraIwyKOKYYBOWGFv86caZo88l3k41O8bgTJltcqmKj9X/bsahxhqVX6XCyJ7P sjAQ== X-Gm-Message-State: ALoCoQn+6rDrnRb9GyOgE52HT6RgEMoenWX2lyPh7unWcUUVejS6vSOueH0xRhqxCyA4ouogn9Xl X-Received: by 10.180.74.130 with SMTP id t2mr59152wiv.4.1413566401119; Fri, 17 Oct 2014 10:20:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.201 with SMTP id je9ls287175lac.92.gmail; Fri, 17 Oct 2014 10:20:00 -0700 (PDT) X-Received: by 10.152.28.134 with SMTP id b6mr10604675lah.12.1413566400871; Fri, 17 Oct 2014 10:20:00 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id xt10si3057867lab.4.2014.10.17.10.20.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 10:20:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id p9so1029774lbv.7 for ; Fri, 17 Oct 2014 10:20:00 -0700 (PDT) X-Received: by 10.112.97.135 with SMTP id ea7mr10379727lbb.46.1413566400802; Fri, 17 Oct 2014 10:20:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp268408lbz; Fri, 17 Oct 2014 10:20:00 -0700 (PDT) X-Received: by 10.66.228.106 with SMTP id sh10mr9872746pac.108.1413566399127; Fri, 17 Oct 2014 10:19:59 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ap1si1616281pbc.152.2014.10.17.10.19.58 for ; Fri, 17 Oct 2014 10:19:59 -0700 (PDT) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753859AbaJQRT4 (ORCPT + 3 others); Fri, 17 Oct 2014 13:19:56 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:55958 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752943AbaJQRRw (ORCPT ); Fri, 17 Oct 2014 13:17:52 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s9HHHhE6029245; Fri, 17 Oct 2014 12:17:43 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHHhoc000747; Fri, 17 Oct 2014 12:17:43 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Fri, 17 Oct 2014 12:17:43 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHHg5K030873; Fri, 17 Oct 2014 12:17:43 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Greg KH , , Paul Zimmerman , , , , , , , George Cherian , Felipe Balbi Subject: [PATCH 16/67] usb: dwc3: dwc3-omap: get rid of ->prepare()/->complete() Date: Fri, 17 Oct 2014 12:16:23 -0500 Message-ID: <1413566234-13537-17-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1413566234-13537-1-git-send-email-balbi@ti.com> References: <1413566234-13537-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: George Cherian Enabling the core interrupts in complete is too late for XHCI, and stops it from proper operation. The root of the problem is due to a disagreement between dwc3-omap and XHCI about when IRQs should be enabled. As it turns out, ->resume's documentation states that: "... generally the driver is expected to start working again, responding to hardware events and software requests (the device itself may be left in a low-power state, waiting for a runtime resume to occur) ..." >From that we infer that IRQs must be unmasked by the end of ->resume(). Due to that, we will remove ->prepare() and ->complete() and disable/enable interrupts in ->suspend()/->resume(). Acked-by: Roger Quadros Signed-off-by: George Cherian Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/dwc3-omap.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index a0aa9f3..172d64e 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -593,27 +593,12 @@ static const struct of_device_id of_dwc3_match[] = { MODULE_DEVICE_TABLE(of, of_dwc3_match); #ifdef CONFIG_PM_SLEEP -static int dwc3_omap_prepare(struct device *dev) -{ - struct dwc3_omap *omap = dev_get_drvdata(dev); - - dwc3_omap_disable_irqs(omap); - - return 0; -} - -static void dwc3_omap_complete(struct device *dev) -{ - struct dwc3_omap *omap = dev_get_drvdata(dev); - - dwc3_omap_enable_irqs(omap); -} - static int dwc3_omap_suspend(struct device *dev) { struct dwc3_omap *omap = dev_get_drvdata(dev); omap->utmi_otg_status = dwc3_omap_read_utmi_status(omap); + dwc3_omap_disable_irqs(omap); return 0; } @@ -623,6 +608,7 @@ static int dwc3_omap_resume(struct device *dev) struct dwc3_omap *omap = dev_get_drvdata(dev); dwc3_omap_write_utmi_status(omap, omap->utmi_otg_status); + dwc3_omap_enable_irqs(omap); pm_runtime_disable(dev); pm_runtime_set_active(dev); @@ -632,8 +618,6 @@ static int dwc3_omap_resume(struct device *dev) } static const struct dev_pm_ops dwc3_omap_dev_pm_ops = { - .prepare = dwc3_omap_prepare, - .complete = dwc3_omap_complete, SET_SYSTEM_SLEEP_PM_OPS(dwc3_omap_suspend, dwc3_omap_resume) };