From patchwork Wed Feb 12 23:51:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 212868 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E18CC3B187 for ; Wed, 12 Feb 2020 23:53:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 054DB206E5 for ; Wed, 12 Feb 2020 23:53:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lxqydUiP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729545AbgBLXw7 (ORCPT ); Wed, 12 Feb 2020 18:52:59 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:39140 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729370AbgBLXwT (ORCPT ); Wed, 12 Feb 2020 18:52:19 -0500 Received: by mail-lj1-f194.google.com with SMTP id o15so4437206ljg.6; Wed, 12 Feb 2020 15:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fS4gtNJrSYUjQQXOqqY/Oa93RASY09H9Tmcfh+YVDHY=; b=lxqydUiPnuXLChUwnee3i+KTHQwL+gubcerAHl5rh65Fzon23/BCEBKHAtoW2/clVR EwFx+n+eM0aj/UwPjhuj77J/gOwEn20HKTSwTUXvGApG8ciViGailWbVQAsmFSssToOz 8KcLhOuRpq3rxQQMxbHyjRBbVKdtBDtqWEREE8VqTXueKvp/d0imqQU35ZFdkP/ED+eF 7nL2WWoyICbj4b9PSQWDNnwEjY2wSh4810RgyfD/5OAvVC/x705DgTPCkKM5m9aqGvph FiJ6UcxSZ7FbgPi0rNOcUT6luSOwMVdPMLTcYlciTprqfIKjmugNP+UL/nGPLNiTHElt VseA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fS4gtNJrSYUjQQXOqqY/Oa93RASY09H9Tmcfh+YVDHY=; b=Odj0K6NJHxjS9G9BXI9FWSEdeny0lnMh4V11d+YLugVwCT2JdReVJbHFvpKQQn0neZ /gGonjwsG4JNU1wddLFxgJVF4pHCYZe/gZzpmzzJ9NhCDWghF3YZMlVHeUgoflVhQO6a zOiRIEV6X3gCN+Of2Pd8v0LDfV2j3Y1q8m+QC/c9PKISg+iwwzgC3QXfGti/kL9i2qWD QbTRVQi+UvdlPFemJMkjiQd5/Xntit3zzJxGYFvcg9buajgNyDCDDCzZj8VhepDkmOnj F1lTsbzrIOE0IJ3bOKTqcGNhTJmaH/mocmBDK1M8Orj9AciCSvRKb+UQ6tEyugdtPpSz IOgQ== X-Gm-Message-State: APjAAAUxEt3KuCfDMhOcf2IOvhB81s20Xd7FXFiQmq1rB5N7WGmrZzXD jsuHLNPSO5eLqf2y0c30iho= X-Google-Smtp-Source: APXvYqyrlY6DZo0Cd476tLwaHEZumaspt5hBJRv94qqezEburO4GEYyMUH4Ohjm0dZHpnq4qUwo7KQ== X-Received: by 2002:a2e:8015:: with SMTP id j21mr9099962ljg.172.1581551537702; Wed, 12 Feb 2020 15:52:17 -0800 (PST) Received: from localhost.localdomain (79-139-233-37.dynamic.spd-mgts.ru. [79.139.233.37]) by smtp.gmail.com with ESMTPSA id d5sm251686lfb.20.2020.02.12.15.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 15:52:17 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Peter De Schrijver , "Rafael J. Wysocki" , Daniel Lezcano , =?utf-8?q?Micha=C5=82_Miro?= =?utf-8?b?c8WCYXc=?= , Jasper Korten , David Heidelberg , Peter Geis Cc: linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v9 08/17] ARM: tegra: Make outer_disable() open-coded Date: Thu, 13 Feb 2020 02:51:25 +0300 Message-Id: <20200212235134.12638-9-digetx@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200212235134.12638-1-digetx@gmail.com> References: <20200212235134.12638-1-digetx@gmail.com> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The outer_disable() of Tegra's suspend code is open-coded now since that helper produces spurious warning message about secondary CPUs being online when CPU enters into LP2 from cpuidle. The secondaries are actually halted by the cpuidle driver on entering into LP2 idle-state, but the online status is not touched by the cpuidle. This fixes a storm of warnings once LP2 idling state is enabled on Tegra30. The outer_disable() helper has sanity checks for interrupts and secondary CPUs being disabled and we are pretty confident about the interrupts state during of CPU idling / system suspend. The rail-off status check is added in this patch as equivalent for the "num_online_cpus() > 1". Acked-by: Peter De Schrijver Tested-by: Peter Geis Tested-by: Jasper Korten Tested-by: David Heidelberg Signed-off-by: Dmitry Osipenko --- arch/arm/mach-tegra/pm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c index 7d9ef26e52a7..d1e1a61b12cf 100644 --- a/arch/arm/mach-tegra/pm.c +++ b/arch/arm/mach-tegra/pm.c @@ -138,6 +138,10 @@ void tegra_pm_set_cpu_in_lp2(void) static int tegra_sleep_cpu(unsigned long v2p) { + if (tegra_cpu_car_ops->rail_off_ready && + WARN_ON(!tegra_cpu_rail_off_ready())) + return -EBUSY; + /* * L2 cache disabling using kernel API only allowed when all * secondary CPU's are offline. Cache have to be disabled with @@ -146,9 +150,10 @@ static int tegra_sleep_cpu(unsigned long v2p) * if any of secondary CPU's is online and this is the LP2-idle * code-path only for Tegra20/30. */ - if (trusted_foundations_registered()) - outer_disable(); - +#ifdef CONFIG_OUTER_CACHE + if (trusted_foundations_registered() && outer_cache.disable) + outer_cache.disable(); +#endif /* * Note that besides of setting up CPU reset vector this firmware * call may also do the following, depending on the FW version: