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: 9859049 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 0A25460385 for ; Mon, 24 Jul 2017 09:52:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFBF3285A3 for ; Mon, 24 Jul 2017 09:52:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E31E7285AB; Mon, 24 Jul 2017 09:52:50 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33125285A3 for ; Mon, 24 Jul 2017 09:52:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752799AbdGXJwr (ORCPT ); Mon, 24 Jul 2017 05:52:47 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:38229 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751328AbdGXJwq (ORCPT ); Mon, 24 Jul 2017 05:52:46 -0400 Received: by mail-lf0-f65.google.com with SMTP id y15so3160289lfd.5; Mon, 24 Jul 2017 02:52:45 -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=K5hX8/WVqFBTsTPn+Uhr6xDLp7kuK0bAggSJrz1v+9/jBS4M6Li82RJRgatvUckCjb 8ZnwWOgfl3QnWdewOVlZOL+0lTi8NBiD2p8z+bnbjsEkzuhguyCEqWE5q6Sz2B17X+93 kKWTGfbrKcbsVXndoxiLY5iBU5I+6/3jnDuKxd1Zc0WF1YEjLYtSacXXgS2fOAkqGT+f wVlHC0JyfaF/K+UXjMojjryLoaIQ9VftuH2mFRrOaityRxl7Ld76Rsyw+3UxMmraBtBk /ox8o3mDuBdKpzU/hAMK20et/ysIfuWJ5ORe/rZoc+tKZ6CgjjiTuRFn4uFVlnmiuyRl QSmw== X-Gm-Message-State: AIVw110Y29MMzd9A9XinV1t6i8FVXrhuCvB57DY5kPBfX8Wsozosf1hF S2PCDR3R2VCpPg== 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 Cc: Russell King , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Alan Stern , Dave Gerlach , Kevin Hilman , Nishanth Menon , "Rafael J . Wysocki" , Ulf Hansson 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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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); }