From patchwork Mon Jul 24 09:52:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 9859055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 20B6B60385 for ; Mon, 24 Jul 2017 09:53:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E2E528403 for ; Mon, 24 Jul 2017 09:53:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02E6128583; Mon, 24 Jul 2017 09:53:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6A9BD285AA for ; Mon, 24 Jul 2017 09:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=+eQnDyPG+ERR501zhBZPnJaUw9+wtu+6y1WsdFkEB5g=; b=hEq Y8e5Z1KrZmOalQK6cAsZCf80lcsdTp+fI3JlHPn417YF5qrOpV1e/tRyIM+lO26ephnHft3xk0UbD loIBINXyQi4o8nf53k31qQzkJle3lPKz01UGdlWFsqc4DNQCT+ig9lOpBKZZXmmM1euUlKzuJYvP0 BKM2wDMeDl6smJIKDK067fokeEXVpa/wWBDkgTZUBWJKfX7B6crwCYHeee4wemluTFJo9IPsN0wr3 vvFb8U8rXgmQ4fjXKQ3UiZoiDEWWBDrw9lEymxwJWHPHeHYqqdUxv5s8Y0swTSpuWxq0Xks8RjkL/ CHHCJCyfRJcauClWOR1cQro0Usem4LA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dZa36-00083p-Ly; Mon, 24 Jul 2017 09:53:12 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dZa32-0007s4-3G for linux-arm-kernel@lists.infradead.org; Mon, 24 Jul 2017 09:53:10 +0000 Received: by mail-lf0-x242.google.com with SMTP id d80so1180845lfg.1 for ; Mon, 24 Jul 2017 02:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=mTXfkhppArFT2OnA3iUAUG+A2ScCK4AGoUrwyorGJW8=; b=Mo84jahBO1oHrshnRSJTavQOSOwoBwnjrKF+IjTirxgaXDIVKigmQVRIwJ+grmNLRc 3Ue9ui94ALl3tgp3Ax0kPAzyPOyrsIusYE7NOLiO8VrkMqzyjOiHUifr8YSWo8zhIFKi 6wzld0RankN6aj8BtZEOeZ1mgUggYJBjTkBpBDtKH0H253T5twz5c+qCi094UmVJLVHU THPUmE459bnPD48UfLF6mAOkITKrWspxCI0kIIWOOc245ax7oB2YPY2nvK5qVmZLN+yo GQuO6eouwLrre3Yg98ofzLFFiouVDL7XNV3oYdLm90hb/qSLSoBdOF/t5h9+F77CUtjb shUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=mTXfkhppArFT2OnA3iUAUG+A2ScCK4AGoUrwyorGJW8=; b=AXINSo1fstKMIsu8kYx9XcLMOFGub3xjPWJaNOH4Nq9XhwA0uqMWIfLz102xtYWFF6 bltFEzrs9KbrjyVAUYN+B7N52b34YBacGeU5KS02DLwQUoi8faDXfbH6mE9c5kRgQmZq yKIBf8hJ4z5GTCB5pMP7rlY5xOGfCZnTA0kaQ0+9K5Oqcf3vxPMrVFrHOakjB6jf03QV k3jj1TMsPrFkujtckiWk7WjS9W/ipMOzOQeM2TyduJ2O5U4eStSRv9Mb9HP6gJAug8KW 3lGvgtVGHRxogakNIRWWbgITS8SU5AMeC2oFwN25ti+b7R/z9SFVHTvRmKUjLswC15ZU VznQ== X-Gm-Message-State: AIVw112drUqQr+VMdkZqVb59kc9Kz2jTaMaCDXMMrDHAAQiD+MjuHkMh 50LYl+TmKnAgeA== X-Received: by 10.46.1.81 with SMTP id 78mr678617ljb.67.1500889964744; Mon, 24 Jul 2017 02:52:44 -0700 (PDT) Received: from xi.terra (c-42c8e255.07-184-6d6c6d4.cust.bredbandsbolaget.se. [85.226.200.66]) by smtp.gmail.com with ESMTPSA id l1sm2180220lfe.25.2017.07.24.02.52.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jul 2017 02:52:44 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.89) (envelope-from ) id 1dZa2Y-0005d7-CN; Mon, 24 Jul 2017 11:52:38 +0200 From: Johan Hovold To: Tony Lindgren Subject: [PATCH] ARM: OMAP2+: omap_device: drop broken RPM status update from suspend_noirq Date: Mon, 24 Jul 2017 11:52:01 +0200 Message-Id: <20170724095201.21601-1-johan@kernel.org> X-Mailer: git-send-email 2.13.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170724_025308_361723_9492105D X-CRM114-Status: GOOD ( 10.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishanth Menon , Ulf Hansson , linux-pm@vger.kernel.org, Kevin Hilman , Dave Gerlach , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, Johan Hovold , Alan Stern , Russell King , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Since commit a8636c89648a ("PM / Runtime: Don't allow to suspend a device with an active child"), which went into 4.10, it is no longer permitted to set RPM_SUSPENDED state for a device with active children (unless power.ignore_children is set). This specifically means that the attempts to do just that from the omap pm-domain suspend_noirq callback have since been failing whenever a child is active, for example: am335x-usb-childs 47400000.usb: runtime PM trying to suspend device but active child Silence this warning by dropping the broken pm_runtime_set_suspended() call from the omap suspend_noirq callback along with the redundant pm_runtime_set_active() in resume_noirq. This effectively reverts commit 3522bf7bfa24 ("ARM: OMAP2+: omap_device: maintain sane runtime pm status around suspend/resume"), which started updating the RPM state after the runtime_suspend callback (!) for active omap devices had been called during system suspend. The rationale was that a later pm_runtime_get_sync() would then fail (even after runtime pm had been disabled) and that this in turn would avoid any external aborts when accessing registers with clocks disabled. (See also commit 6f3c77b040fc ("PM / Runtime: let rpm_resume() succeed if RPM_ACTIVE, even when disabled, v2"). But during the suspend_noirq phase all children would already have been suspended and their drivers would specifically not attempt any further register accesses. And if this was all just a workaround for random device drivers doing cross-tree calls during system suspend, those drivers should be fixed and updated to explicitly model such dependencies using device-links instead (and either way, any such calls have been causing crashes since 4.10). Fixes: 3522bf7bfa24 ("ARM: OMAP2+: omap_device: maintain sane runtime pm status around suspend/resume") Fixes: a8636c89648a ("PM / Runtime: Don't allow to suspend a device with an active child") Cc: Alan Stern Cc: Dave Gerlach Cc: Kevin Hilman Cc: Nishanth Menon Cc: Rafael J. Wysocki Cc: Tony Lindgren Cc: Ulf Hansson Signed-off-by: Johan Hovold --- arch/arm/mach-omap2/omap_device.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index ef9ffb8ac912..acbede082b5b 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -672,7 +672,6 @@ static int _od_suspend_noirq(struct device *dev) if (!ret && !pm_runtime_status_suspended(dev)) { if (pm_generic_runtime_suspend(dev) == 0) { - pm_runtime_set_suspended(dev); omap_device_idle(pdev); od->flags |= OMAP_DEVICE_SUSPENDED; } @@ -689,15 +688,6 @@ static int _od_resume_noirq(struct device *dev) if (od->flags & OMAP_DEVICE_SUSPENDED) { od->flags &= ~OMAP_DEVICE_SUSPENDED; omap_device_enable(pdev); - /* - * XXX: we run before core runtime pm has resumed itself. At - * this point in time, we just restore the runtime pm state and - * considering symmetric operations in resume, we donot expect - * to fail. If we failed, something changed in core runtime_pm - * framework OR some device driver messed things up, hence, WARN - */ - WARN(pm_runtime_set_active(dev), - "Could not set %s runtime state active\n", dev_name(dev)); pm_generic_runtime_resume(dev); }