Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp68314ybp; Thu, 3 Oct 2019 10:16:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiCx+Lg97HU6eysbu1q8wc9n1Z201r39rgxlot+3ka3s8s8rCPK2epDwJGOFiYXqweR9kh X-Received: by 2002:a50:8a9a:: with SMTP id j26mr10765419edj.251.1570122980766; Thu, 03 Oct 2019 10:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570122980; cv=none; d=google.com; s=arc-20160816; b=T9t6CZ544H25Sxm3ihqsnvt9PozPJFjJ6RQGRPYHjjfSsodQ6ZDpye02xb5PPRzgVw Vp1amhhMGVBb3P9y5MqI3k9kwkzuPGOQ07O3q636/eYuot4v9iQ5G5eV1BKysLDFLWAx 9/EfB7pnaRhQexNmJYIas5indgwK4VBebJJCGsA8gInF+BWVYlo4qYgw3J6EfJg74pMW aGWxTYxp3ls0wn6cXFmnjGAunK96KkAVFz8k8wwi12R16KH1N5H/4IJOG7wV00vItEav VIgArJh640t8ytLsIrE/tcvKD9AKIjO/mH4Kj03n/0YfJa3pXMMAW+ByrQjUUFU/+k4z opww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0W0eTrEZBzAKX8C5wDZ1usMeOjbiTkXOLl+SQmn7uJE=; b=mniQbtfISkDluGZxrYE6I8Hr+J34SUn4gnpc5cqg/813BV6Y0fjF72SgC9x5Mchi5/ 0bF7iRElkYnohQFSmd7EEH24QsE+ch1+Cces8/2IFDMbg33ImIoaixgCvV4T//FXuLw6 v+TUkI8zDIcWYAZubUGr7/UCHW1vnOyH7D0fevGjl25EDDe/sA18D+Xsu0xikWh8OnWB 2yjOhQ3T75vE6nV7Ku/nhSHDcVvmi048EkIg4MfrjXsSXcjuJMLxwLWhYMvwvR61CUSy 1PvKSWXy9un3i3d1N7fe+cWCJjNY3RXLWW6FVNybhpm0WNzK9Wxsj30GN2uts+vm1lGI AlSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eX1NDbqm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j51si1864660ede.301.2019.10.03.10.15.56; Thu, 03 Oct 2019 10:16:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eX1NDbqm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732416AbfJCRMg (ORCPT + 99 others); Thu, 3 Oct 2019 13:12:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:35768 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391647AbfJCQaB (ORCPT ); Thu, 3 Oct 2019 12:30:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 49031222C4; Thu, 3 Oct 2019 16:30:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120200; bh=WytRyuAeD8r+lZci6Ro91yBin+ytXB3SZAzTOmA8unM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eX1NDbqmbj7AqakPwX1jNEQP7b0DQDdpoKez0sAoeNeIUJ5jKtvPet4NhJ7bZ4Ndr BbJw5Ulk0G+jP7o7QMFu5Vp+KzqCfQ+HRKDYpR6osWzpkyfMBIicMqefWvCQ6GRyD5 1GMTHFl3G4rky3nGij5YVJe3aWv02wQ+s8dSmVgw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Simon Horman , Ulf Hansson , Sasha Levin Subject: [PATCH 5.2 135/313] soc: renesas: rmobile-sysc: Set GENPD_FLAG_ALWAYS_ON for always-on domain Date: Thu, 3 Oct 2019 17:51:53 +0200 Message-Id: <20191003154546.185363470@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven [ Upstream commit af0bc634728c0bc6a3f66f911f227d5c6396db88 ] Currently the R-Mobile "always-on" PM Domain is implemented by returning -EBUSY from the generic_pm_domain.power_off() callback, and doing nothing in the generic_pm_domain.power_on() callback. However, this means the PM Domain core code is not aware of the semantics of this special domain, leading to boot warnings like the following on SH/R-Mobile SoCs: sh_cmt e6130000.timer: PM domain c5 will not be powered off Fix this by making the always-on nature of the domain explicit instead, by setting the GENPD_FLAG_ALWAYS_ON flag. This removes the need for the domain to provide power control callbacks. Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman Reviewed-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/soc/renesas/rmobile-sysc.c | 31 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/soc/renesas/rmobile-sysc.c b/drivers/soc/renesas/rmobile-sysc.c index 421ae1c887d82..54b616ad4a62a 100644 --- a/drivers/soc/renesas/rmobile-sysc.c +++ b/drivers/soc/renesas/rmobile-sysc.c @@ -48,12 +48,8 @@ struct rmobile_pm_domain *to_rmobile_pd(struct generic_pm_domain *d) static int rmobile_pd_power_down(struct generic_pm_domain *genpd) { struct rmobile_pm_domain *rmobile_pd = to_rmobile_pd(genpd); - unsigned int mask; + unsigned int mask = BIT(rmobile_pd->bit_shift); - if (rmobile_pd->bit_shift == ~0) - return -EBUSY; - - mask = BIT(rmobile_pd->bit_shift); if (rmobile_pd->suspend) { int ret = rmobile_pd->suspend(); @@ -80,14 +76,10 @@ static int rmobile_pd_power_down(struct generic_pm_domain *genpd) static int __rmobile_pd_power_up(struct rmobile_pm_domain *rmobile_pd) { - unsigned int mask; + unsigned int mask = BIT(rmobile_pd->bit_shift); unsigned int retry_count; int ret = 0; - if (rmobile_pd->bit_shift == ~0) - return 0; - - mask = BIT(rmobile_pd->bit_shift); if (__raw_readl(rmobile_pd->base + PSTR) & mask) return ret; @@ -122,11 +114,15 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd) struct dev_power_governor *gov = rmobile_pd->gov; genpd->flags |= GENPD_FLAG_PM_CLK | GENPD_FLAG_ACTIVE_WAKEUP; - genpd->power_off = rmobile_pd_power_down; - genpd->power_on = rmobile_pd_power_up; - genpd->attach_dev = cpg_mstp_attach_dev; - genpd->detach_dev = cpg_mstp_detach_dev; - __rmobile_pd_power_up(rmobile_pd); + genpd->attach_dev = cpg_mstp_attach_dev; + genpd->detach_dev = cpg_mstp_detach_dev; + + if (!(genpd->flags & GENPD_FLAG_ALWAYS_ON)) { + genpd->power_off = rmobile_pd_power_down; + genpd->power_on = rmobile_pd_power_up; + __rmobile_pd_power_up(rmobile_pd); + } + pm_genpd_init(genpd, gov ? : &simple_qos_governor, false); } @@ -270,6 +266,11 @@ static void __init rmobile_setup_pm_domain(struct device_node *np, break; case PD_NORMAL: + if (pd->bit_shift == ~0) { + /* Top-level always-on domain */ + pr_debug("PM domain %s is always-on domain\n", name); + pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; + } break; } -- 2.20.1