From patchwork Mon Sep 15 14:39:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 37414 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 57E26203E6 for ; Mon, 15 Sep 2014 14:39:46 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id bs8sf2130055wib.2 for ; Mon, 15 Sep 2014 07:39:45 -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 :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=ld3hiPCPK6G6VP+ohGtl/XK2ZIiIZDq/j8fSmu9wDMI=; b=BiQpMIx6EbAPZlqn8rj6CYlapoytsEih7xduKdTO+aMYUYobSmUZW+o4x6ftIZFvAv hGOAJ6lNpiVIem2CeRQTYSGwf3Q+ul+zY8ess33UoY+fBgQfoNaBb/cq+zh7U+9Wm7nR p9Bv8VVNnKh9K0C7SI5jBoHG7/UhKVx45f9Q1RFpVvhtoQCDbsKs3QfnwkHGe9Wrr39q AgGgcUbxcTmQD37tuWaCl1EZlxoRd7bb11dfgbNYfr/WPsgFTksNEsmwDesX+Bto2oiJ hKJLz1ybTB4ePIRb3rPZcAUJ8IZztvYnIWF3wij9lYBEoQflAdxzzwx9akHz/9Bh5ei2 KSPA== X-Gm-Message-State: ALoCoQnsavE4IVNoM+O45cNqYiIZXrH0NcDS9+UvK5rl9lRwHhjJBYnBNQulP1ZBnmgby1gvhEKq X-Received: by 10.180.99.74 with SMTP id eo10mr5502950wib.2.1410791985596; Mon, 15 Sep 2014 07:39:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.8 with SMTP id f8ls99792lah.85.gmail; Mon, 15 Sep 2014 07:39:45 -0700 (PDT) X-Received: by 10.112.24.104 with SMTP id t8mr27654752lbf.46.1410791985444; Mon, 15 Sep 2014 07:39:45 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com [209.85.215.42]) by mx.google.com with ESMTPS id m1si19353821lbs.55.2014.09.15.07.39.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Sep 2014 07:39:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id hz20so4904864lab.29 for ; Mon, 15 Sep 2014 07:39:45 -0700 (PDT) X-Received: by 10.112.76.6 with SMTP id g6mr27320267lbw.22.1410791985371; Mon, 15 Sep 2014 07:39:45 -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.130.169 with SMTP id of9csp220346lbb; Mon, 15 Sep 2014 07:39:44 -0700 (PDT) X-Received: by 10.70.133.231 with SMTP id pf7mr45143554pdb.20.1410791982963; Mon, 15 Sep 2014 07:39:42 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bo15si23390237pdb.172.2014.09.15.07.39.42 for ; Mon, 15 Sep 2014 07:39:42 -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 S1753204AbaIOOjf (ORCPT + 2 others); Mon, 15 Sep 2014 10:39:35 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:47309 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752575AbaIOOje (ORCPT ); Mon, 15 Sep 2014 10:39:34 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s8FEdVvj013139; Mon, 15 Sep 2014 09:39:31 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s8FEdVN0026106; Mon, 15 Sep 2014 09:39:31 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Mon, 15 Sep 2014 09:39:31 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s8FEdUxL016256; Mon, 15 Sep 2014 09:39:31 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Daniel Mack , Felipe Balbi , Subject: [PATCH] usb: musb: dsps: kill OTG timer on suspend Date: Mon, 15 Sep 2014 09:39:09 -0500 Message-ID: <1410791949-32460-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.0.1.563.g66f467c 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.215.42 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: , if we don't make sure to kill the timer, it could expire after we have already gated our clocks. That will trigger a Data Abort exception because we would try to access register while clock is gated. Fix that bug. Cc: # v3.14+ Fixes 869c597 (usb: musb: dsps: add support for suspend and resume) Tested-by: Dave Gerlach Signed-off-by: Felipe Balbi --- I'll send this one together with my v3.18 pull. drivers/usb/musb/musb_dsps.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index c791ba5..154bcf1 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c @@ -870,6 +870,7 @@ static int dsps_suspend(struct device *dev) struct musb *musb = platform_get_drvdata(glue->musb); void __iomem *mbase = musb->ctrl_base; + del_timer_sync(&glue->timer); glue->context.control = dsps_readl(mbase, wrp->control); glue->context.epintr = dsps_readl(mbase, wrp->epintr_set); glue->context.coreintr = dsps_readl(mbase, wrp->coreintr_set); @@ -895,6 +896,7 @@ static int dsps_resume(struct device *dev) dsps_writel(mbase, wrp->mode, glue->context.mode); dsps_writel(mbase, wrp->tx_mode, glue->context.tx_mode); dsps_writel(mbase, wrp->rx_mode, glue->context.rx_mode); + setup_timer(&glue->timer, otg_timer, (unsigned long) musb); return 0; }