From patchwork Tue Jul 7 12:58:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 234993 Delivered-To: patches@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp889135ilg; Tue, 7 Jul 2020 05:58:23 -0700 (PDT) X-Received: by 2002:a19:8c47:: with SMTP id i7mr19656025lfj.32.1594126703496; Tue, 07 Jul 2020 05:58:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594126703; cv=none; d=google.com; s=arc-20160816; b=g7nbTsuSkkT4GuPHdpiK4bvgCxxCxGrm5fLWr/VU2lh034U63ypwF8h6tQHc/fm9e4 zlo3AzthRoRAS0wO0ffYPS6NgnxbpqJA7NIOLdjyMrpn3IYBsUfUN4vj+qrtABeslzRq JtGe3fOvI7NH9dgK/mExk8Dm7sjDSd7J90MP8xK7n8RZ2UHY5HOT7POCFfHzpzJVd+FT cyuFNSo5I34Xfo52BwPVfBzL1uCRVmSKb3/QpWvVcBT/bgm/al/Qus5pRS1qZR68GIib L+IaON4uuMfNcK8wF3496plAWM9B+cnBCUsors9qI5HqJP//ulTiEuXN/iGdDqWkJbQV b+Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Tyb4FTg+dS/M/U030tOYrYBkxinzi9TyZY+2pXYSj8s=; b=m86cxDUDznS8e+fQk1IAfUAAIl1X5fLAZ42TTCZhPJLq6pCU5zsaYksWF7sO/Di6LR Z8aOxf3B6N2ciLgkNp42F+hq/jmjrXWsNwdb/2bmIGjgbEXhJUzDIf7gv4fPkIrqIAcX y/EGf1at41aqo9vBC162YeR6Df2bMHqGq/ouUSKGkgW3EjsEqhgp2U8a7xLAGvQBMcj5 m6H3VTXrdWVfeAStGJ3fbyr7oG4jcXwZX0fCKSOpCnZjyRGRRtauTj706lJPUbsVm495 hwvO36eTscdDwlii4ap0Ecd9f38Owy2UfhirXFuK8zvRY0DKEGfzPLsCndsV9cQpDi0l M9Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WcTZPDyr; 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 j19sor7680205lja.25.2020.07.07.05.58.23 for (Google Transport Security); Tue, 07 Jul 2020 05:58:23 -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=WcTZPDyr; 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 :mime-version:content-transfer-encoding; bh=Tyb4FTg+dS/M/U030tOYrYBkxinzi9TyZY+2pXYSj8s=; b=WcTZPDyrGuD+JpLr2CvFSOW4wI/84AB9XBsPM+jNP55/QXFFMDJ2Kcuad7JKSuEgl4 CMsJcDQJheQ23rJe96pFp9zvexdXKEVqmJE+BhjbytMKWA3ME0ZHKt6RLTMMacnHJqX2 eHz9Jr/J9Itm7q4oL7NVLhg9l448S2Q49iTD4WdSJCSYCeU5QUE0K3iXcaJ0Y2WYHFGZ XQj2KfRpp0yZshd2s60tgduYEi8cCEBXVk/68tYWIKGTQCdf3nT3UUM+49atzgZzQd/F NEWIC0yJKMlERT7u2126WmBfK+sVr1OqaCYc11UQHPCZl/pL+tJtV+RipTMslbw9Rv7W GhPg== 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=Tyb4FTg+dS/M/U030tOYrYBkxinzi9TyZY+2pXYSj8s=; b=EPS3WDv5YpgjcyQWVSwRFAzF5M8YPMHzeDGEw7hhbC+b/ppj8Lht2jIhN8CUoJ9aTu T+GMK5+jGb2hMExbJGbD+EqtyhachzZRLPr2gr0QGwUuqlsZckviwbWnWpBfK1x28Su1 +7a/rsFWvM2F8DoxFIWu4jBZtWHwwgHO4QKQtMWsCgB0TfCpdWqTcKJTAAuZaK1h/qFA AK9gK+tVV3fQmi3MuYNLMTCPAAqp+3ILrwpRU+D2tRt1jqFbcsrb1K8UAHQ2A55z/O/I ytHg4RoP2BweURb094UMpD+eY80mCKUO3v1BH8psO7UiJGHRt498SOi9dJUawMN1Bwwb 6L+A== X-Gm-Message-State: AOAM530Ge5SDnrDbu0A2yg+jsqatCes3xvnyVkWvGJ8Kw6l8scMB+4M9 B45WbcVDFGeXbvs0dgZUDQfeNFSQ X-Google-Smtp-Source: ABdhPJylq0jjpwH2fsuo8vkN+Gf9ZYpUxI0iRGTwMhIxlrERcqaj5/+hQ1rGx4VxvHtG/4ViNKkMrA== X-Received: by 2002:a2e:9a8d:: with SMTP id p13mr6597746lji.36.1594126703088; Tue, 07 Jul 2020 05:58:23 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-98-128-181-7.NA.cust.bahnhof.se. [98.128.181.7]) by smtp.gmail.com with ESMTPSA id 11sm9554395lfz.78.2020.07.07.05.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 05:58:21 -0700 (PDT) From: Ulf Hansson To: Sudeep Holla , Lorenzo Pieralisi , linux-pm@vger.kernel.org Cc: "Rafael J . Wysocki" , Daniel Lezcano , Lina Iyer , Lukasz Luba , Vincent Guittot , Stephen Boyd , Bjorn Andersson , Benjamin Gaignard , Saravana Kannan , Ulf Hansson , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/5] cpuidle: psci: Fail cpuidle registration if set OSI mode failed Date: Tue, 7 Jul 2020 14:58:01 +0200 Message-Id: <20200707125804.13030-3-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200707125804.13030-1-ulf.hansson@linaro.org> References: <20200707125804.13030-1-ulf.hansson@linaro.org> MIME-Version: 1.0 Currently we allow the cpuidle driver registration to succeed, even if we failed to enable the OSI mode when the hierarchical DT layout is used. This means running in a degraded mode, by using the available idle states per CPU, while also preventing the domain idle states. Moving forward, this behaviour looks quite questionable to maintain, as complexity seems to grow around it, especially when trying to add support for deferred probe, for example. Therefore, let's make the cpuidle driver registration to fail in this situation, thus relying on the default architectural cpuidle backend for WFI to be used. Reviewed-by: Lina Iyer Signed-off-by: Ulf Hansson --- drivers/cpuidle/cpuidle-psci-domain.c | 5 ----- 1 file changed, 5 deletions(-) -- 2.20.1 diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c index 423f03bbeb74..f07786aad673 100644 --- a/drivers/cpuidle/cpuidle-psci-domain.c +++ b/drivers/cpuidle/cpuidle-psci-domain.c @@ -26,7 +26,6 @@ struct psci_pd_provider { }; static LIST_HEAD(psci_pd_providers); -static bool osi_mode_enabled __initdata; static int psci_pd_power_off(struct generic_pm_domain *pd) { @@ -272,7 +271,6 @@ static int __init psci_idle_init_domains(void) goto remove_pd; } - osi_mode_enabled = true; of_node_put(np); pr_info("Initialized CPU PM domain topology\n"); return pd_count; @@ -293,9 +291,6 @@ struct device __init *psci_dt_attach_cpu(int cpu) { struct device *dev; - if (!osi_mode_enabled) - return NULL; - dev = dev_pm_domain_attach_by_name(get_cpu_device(cpu), "psci"); if (IS_ERR_OR_NULL(dev)) return dev;