From patchwork Wed Oct 3 14:38:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 148058 Delivered-To: patches@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp6557499lji; Wed, 3 Oct 2018 07:38:44 -0700 (PDT) X-Received: by 2002:a2e:8589:: with SMTP id b9-v6mr1422464lji.122.1538577524852; Wed, 03 Oct 2018 07:38:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538577524; cv=none; d=google.com; s=arc-20160816; b=F8aO15j//IagIgPIxx36ZgLKnZ+UR5JPviijwJ1n49zNa6dsZMOAo5qmqf+sytgOBa iUTZt2oy+IolPYRVYf5tLkbuNyIWC8/99wdLuJl0u3/2d2aovZGav1eiMv+350ZPpM8T QMdLP7LjZFKcqRJ6gxwemRsAWX/fPQ0xyhh1Cxys/yAl4J8W0NUk42rWrnr2FgcWu9GZ 6H9odrrm72dsDxs/NfyyipX5KUxfjdeFsfLY26tTFvYS5T/JBVCnOqFAAcprUl2HBYa4 DD5cMBYjSjmOHVyORNIDlAWfy2F2efsX1q2fQ3NEzYo1USIrWYMTceETjxuaNnl9YO62 R8+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Az8HN+a97vIgrScBCEqR/rzOTiI9JWpLJgNiF/xNs1Y=; b=sUN1MUbnTUA19L/SF4bMfrOyOzuLp4slZLXCtw2o06TOGicCwjf8ZV87wsIsTs4+G3 t+4wrfoNnOw4FWVr3GH4afhf1NxiOEX8aPOfzZ3xOiB9jyXYvwzqoLZFt1t+stA8jiGZ 3MfkMNRYn3JKM1o+N5xEYemwq4UjDxpEOHbqeKw1+RnmWRUMdxO0OilA+Q6gxWBS2BKe 0Wu+CdPDxjc1KKMZ5Eh9z/ag1U/Kmz7Phf+q7NCDcBn9cYVJZSbH4nmPtJlCZU0cPKFL /D1x5vsAOSQf+a7z72VwASH24mBiZ7oXzqCQXxoFdN2vrirNuI0f6TLJ+5qnfXZuKlzn eEjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fwrq5zIZ; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h65-v6sor959551lji.34.2018.10.03.07.38.44 for (Google Transport Security); Wed, 03 Oct 2018 07:38:44 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fwrq5zIZ; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Az8HN+a97vIgrScBCEqR/rzOTiI9JWpLJgNiF/xNs1Y=; b=Fwrq5zIZgGrEsBsxyR54t24qFEqHXkC4DSb+7TXhUtrfB3IWXrdMfuwFYzFi7XS+ud Ha8AaviFQc7guk7xMwsdCNQll3VLrH5kZKgOsnkQHvs6/B/eWYplidelM/qkMrzO2BV9 KWzKRwxQgixw+ofsPAuPI3+F3/iZy0QnSjLRA= 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; bh=Az8HN+a97vIgrScBCEqR/rzOTiI9JWpLJgNiF/xNs1Y=; b=OjMa1lG8CDWcIF+ZxGC54WJA9LsxTuYCSTW+5xnw0Ml2IQVgRa8W0OV6cfnkfiU1t/ cNZt9slOzJS+1+Q9TQSkL0ldnfHtflCX10LX0QXlVz1zvYWQ2LW8xI2gvLABr0m6fnvS GHs9F53zyBU32AsOiXelI6c5sSCFqH8UDZj/uoIk/tWF2QiRzYoXd/XS3p77ttNWQ1My owqt0WoGAK4Ej4v77LMufANCu2SXWm8eFh/LNK6VafR7WFS3OAv+LeiKWkoVXF+o4GaJ JF4lrqTvpzrrLQHgeujV6AkTI5dDczZDXzyk54utWwj6XE4IzjoYPYM1ofwO+mNB8QfW WCAg== X-Gm-Message-State: ABuFfogNyDc+AQb4/p+fHLHJBp1vi2aOwZJ4qROSE813s1Fc+xqAV2Ny R/h+BzniindR9yHw1MLAs0PThARh X-Google-Smtp-Source: ACcGV63ZCUlRFuzoFUlWb1bs+KEJI66Yb1IoBIe4epyTsr714kZsnJnvwgbB3Aut6FDAYv3Eilj24g== X-Received: by 2002:a2e:2d0a:: with SMTP id t10-v6mr1494652ljt.8.1538577524605; Wed, 03 Oct 2018 07:38:44 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id 18-v6sm380867ljo.74.2018.10.03.07.38.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Oct 2018 07:38:44 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , Lorenzo Pieralisi , Mark Rutland , Daniel Lezcano , linux-pm@vger.kernel.org Cc: Tony Lindgren , Kevin Hilman , Lina Iyer , Ulf Hansson , Rob Herring , Viresh Kumar , Vincent Guittot , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v9 03/11] PM / Domains: Document flags for genpd Date: Wed, 3 Oct 2018 16:38:16 +0200 Message-Id: <20181003143824.13059-4-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181003143824.13059-1-ulf.hansson@linaro.org> References: <20181003143824.13059-1-ulf.hansson@linaro.org> The current documented description of the GENPD_FLAG_* flags, are too simplified, so let's extend them. Signed-off-by: Ulf Hansson --- include/linux/pm_domain.h | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 776c546d581a..3b5d7280e52e 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -17,11 +17,36 @@ #include #include -/* Defines used for the flags field in the struct generic_pm_domain */ -#define GENPD_FLAG_PM_CLK (1U << 0) /* PM domain uses PM clk */ -#define GENPD_FLAG_IRQ_SAFE (1U << 1) /* PM domain operates in atomic */ -#define GENPD_FLAG_ALWAYS_ON (1U << 2) /* PM domain is always powered on */ -#define GENPD_FLAG_ACTIVE_WAKEUP (1U << 3) /* Keep devices active if wakeup */ +/* + * Flags to control the behaviour of a genpd. + * + * These flags may be set in the struct generic_pm_domain's flags field by a + * genpd backend driver. The flags must be set before it calls pm_genpd_init(), + * which initializes a genpd. + * + * GENPD_FLAG_PM_CLK: Instructs genpd to use the PM clk framework, + * while powering on/off attached devices. + * + * GENPD_FLAG_IRQ_SAFE: This informs genpd that its backend callbacks, + * ->power_on|off(), doesn't sleep. Hence, these + * can be invoked from within atomic context, which + * enables genpd to power on/off the PM domain, + * even when pm_runtime_is_irq_safe() returns true, + * for any of its attached devices. Note that, a + * genpd having this flag set, requires its + * masterdomains to also have it set. + * + * GENPD_FLAG_ALWAYS_ON: Instructs genpd to always keep the PM domain + * powered on. + * + * GENPD_FLAG_ACTIVE_WAKEUP: Instructs genpd to keep the PM domain powered + * on, in case any of its attached devices is used + * in the wakeup path to serve system wakeups. + */ +#define GENPD_FLAG_PM_CLK (1U << 0) +#define GENPD_FLAG_IRQ_SAFE (1U << 1) +#define GENPD_FLAG_ALWAYS_ON (1U << 2) +#define GENPD_FLAG_ACTIVE_WAKEUP (1U << 3) enum gpd_status { GPD_STATE_ACTIVE = 0, /* PM domain is active */