From patchwork Fri Oct 18 08:51:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 11197819 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9453B17E1 for ; Fri, 18 Oct 2019 08:52:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 627E221897 for ; Fri, 18 Oct 2019 08:52:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="lTsXurNK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2442232AbfJRIwR (ORCPT ); Fri, 18 Oct 2019 04:52:17 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42468 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2442244AbfJRIwR (ORCPT ); Fri, 18 Oct 2019 04:52:17 -0400 Received: by mail-pf1-f193.google.com with SMTP id q12so3443165pff.9 for ; Fri, 18 Oct 2019 01:52:15 -0700 (PDT) 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 :in-reply-to:references; bh=Sa4xZAx/AZis8Bith/bcGJfRn7RQ+aAIMqtybRUr7Os=; b=lTsXurNKTYLDEE0SwwsqiJT0OyzmCa9BCTZgXPIo12WVhfKNguSizgglpk5iGYkpKX Uuh/HxVVMdDbVznllp28i58olYO+JQqua10Ir8j3vDgFUdNS0p2Jjsh1wO4bHUrT7W/Y SZoGJqYaa+87P/qTpcNCT428TBQZ/KNW23iWZHDJDRgR9L9iVVcHz/7JgHnVOLFKNco1 6GYSTuFYZFwBdGxwiwC7JEWCDSwchR13aV1ZroA+875ZoqeLNh6In41hMFsnbRGklFUO ImqUbsmUYZyzCRIYAMJl58OiIYN7/bkXUztcmkpCxRvkwH8YHrohXbfHTCwNSSWy9V9W nzIQ== 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:in-reply-to:references; bh=Sa4xZAx/AZis8Bith/bcGJfRn7RQ+aAIMqtybRUr7Os=; b=VrfgartT7QXG+M4xnnkJbzNp/nse+hpARh4BnilvqzGJVClZ4V3WqfxZRZwrQqFrw0 Po87WFQzJ07Z58j0DG2cJDo2WXkXM9dvVuXev0SSLGkFI1XGbI2M/jdMlIUlFFqqnbvw lWpqFWbKLWcq0hz1gRk5tn8C3i3XFGMWd1/fozgm8ST64nQqRo3a/zXfRbuguDpkSqIU RB7hsqKCCahDhnNvmB+zKVY/dHSZEuuSV567ZlQLKYTIzMXqsiqIV3jSy568I+sXF+Iy eSXXkKEulX2dS3813r4zc2rc4tGi0Gfus2VAwGFgH5/Xbeztpf9tgFovJ6a2k4DAISl6 6GHw== X-Gm-Message-State: APjAAAXxxLq0Nk80hwV3j5GrdQ4aG8fIUl+GI7qyRxM37eMOhTDtViUo +i9BX/3N3teUXRkv2R5hYxFIEg== X-Google-Smtp-Source: APXvYqzurDAMMBm7Nz2fZ+nPuZ7egqv61ZuJaPX7gCvZlG1c3dsUNUmcm3fh4kjhT2Rm2E6YVL2piA== X-Received: by 2002:a17:90a:868c:: with SMTP id p12mr10031253pjn.45.1571388734516; Fri, 18 Oct 2019 01:52:14 -0700 (PDT) Received: from localhost ([49.248.178.134]) by smtp.gmail.com with ESMTPSA id a21sm5440978pfi.0.2019.10.18.01.52.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Oct 2019 01:52:14 -0700 (PDT) From: Amit Kucheria To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, daniel.lezcano@linaro.org, viresh.kumar@linaro.org, sudeep.holla@arm.com, bjorn.andersson@linaro.org, edubezval@gmail.com, agross@kernel.org, tdas@codeaurora.org, swboyd@chromium.org, ilina@codeaurora.org, "Rafael J. Wysocki" , Amit Kucheria , Ben Segall , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Steven Rostedt , Vincent Guittot , Zhang Rui Cc: linux-doc@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v4 1/6] thermal: Remove netlink support Date: Fri, 18 Oct 2019 14:21:58 +0530 Message-Id: <8ff02cf62186c7a54fff325fad40a2e9ca3affa6.1571387352.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org There are no users of netlink messages for thermal inside the kernel. Remove the code and adjust the documentation. Signed-off-by: Amit Kucheria Acked-by: Viresh Kumar --- .../driver-api/thermal/sysfs-api.rst | 26 ++--- drivers/thermal/thermal_core.c | 101 +----------------- include/linux/thermal.h | 11 -- 3 files changed, 7 insertions(+), 131 deletions(-) diff --git a/Documentation/driver-api/thermal/sysfs-api.rst b/Documentation/driver-api/thermal/sysfs-api.rst index fab2c9b36d084..b40b1f8391481 100644 --- a/Documentation/driver-api/thermal/sysfs-api.rst +++ b/Documentation/driver-api/thermal/sysfs-api.rst @@ -725,24 +725,10 @@ method, the sys I/F structure will be built like this:: |---temp1_input: 37000 |---temp1_crit: 100000 -4. Event Notification +4. Export Symbol APIs ===================== -The framework includes a simple notification mechanism, in the form of a -netlink event. Netlink socket initialization is done during the _init_ -of the framework. Drivers which intend to use the notification mechanism -just need to call thermal_generate_netlink_event() with two arguments viz -(originator, event). The originator is a pointer to struct thermal_zone_device -from where the event has been originated. An integer which represents the -thermal zone device will be used in the message to identify the zone. The -event will be one of:{THERMAL_AUX0, THERMAL_AUX1, THERMAL_CRITICAL, -THERMAL_DEV_FAULT}. Notification can be sent when the current temperature -crosses any of the configured thresholds. - -5. Export Symbol APIs -===================== - -5.1. get_tz_trend +4.1. get_tz_trend ----------------- This function returns the trend of a thermal zone, i.e the rate of change @@ -751,14 +737,14 @@ are supposed to implement the callback. If they don't, the thermal framework calculated the trend by comparing the previous and the current temperature values. -5.2. get_thermal_instance +4.2. get_thermal_instance ------------------------- This function returns the thermal_instance corresponding to a given {thermal_zone, cooling_device, trip_point} combination. Returns NULL if such an instance does not exist. -5.3. thermal_notify_framework +4.3. thermal_notify_framework ----------------------------- This function handles the trip events from sensor drivers. It starts @@ -768,14 +754,14 @@ and does actual throttling for other trip points i.e ACTIVE and PASSIVE. The throttling policy is based on the configured platform data; if no platform data is provided, this uses the step_wise throttling policy. -5.4. thermal_cdev_update +4.4. thermal_cdev_update ------------------------ This function serves as an arbitrator to set the state of a cooling device. It sets the cooling device to the deepest cooling state if possible. -6. thermal_emergency_poweroff +5. thermal_emergency_poweroff ============================= On an event of critical trip temperature crossing. Thermal framework diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index d4481cc8958fe..cced0638b686f 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -19,8 +19,6 @@ #include #include #include -#include -#include #include #define CREATE_TRACE_POINTS @@ -1464,97 +1462,6 @@ struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name) } EXPORT_SYMBOL_GPL(thermal_zone_get_zone_by_name); -#ifdef CONFIG_NET -static const struct genl_multicast_group thermal_event_mcgrps[] = { - { .name = THERMAL_GENL_MCAST_GROUP_NAME, }, -}; - -static struct genl_family thermal_event_genl_family __ro_after_init = { - .module = THIS_MODULE, - .name = THERMAL_GENL_FAMILY_NAME, - .version = THERMAL_GENL_VERSION, - .maxattr = THERMAL_GENL_ATTR_MAX, - .mcgrps = thermal_event_mcgrps, - .n_mcgrps = ARRAY_SIZE(thermal_event_mcgrps), -}; - -int thermal_generate_netlink_event(struct thermal_zone_device *tz, - enum events event) -{ - struct sk_buff *skb; - struct nlattr *attr; - struct thermal_genl_event *thermal_event; - void *msg_header; - int size; - int result; - static unsigned int thermal_event_seqnum; - - if (!tz) - return -EINVAL; - - /* allocate memory */ - size = nla_total_size(sizeof(struct thermal_genl_event)) + - nla_total_size(0); - - skb = genlmsg_new(size, GFP_ATOMIC); - if (!skb) - return -ENOMEM; - - /* add the genetlink message header */ - msg_header = genlmsg_put(skb, 0, thermal_event_seqnum++, - &thermal_event_genl_family, 0, - THERMAL_GENL_CMD_EVENT); - if (!msg_header) { - nlmsg_free(skb); - return -ENOMEM; - } - - /* fill the data */ - attr = nla_reserve(skb, THERMAL_GENL_ATTR_EVENT, - sizeof(struct thermal_genl_event)); - - if (!attr) { - nlmsg_free(skb); - return -EINVAL; - } - - thermal_event = nla_data(attr); - if (!thermal_event) { - nlmsg_free(skb); - return -EINVAL; - } - - memset(thermal_event, 0, sizeof(struct thermal_genl_event)); - - thermal_event->orig = tz->id; - thermal_event->event = event; - - /* send multicast genetlink message */ - genlmsg_end(skb, msg_header); - - result = genlmsg_multicast(&thermal_event_genl_family, skb, 0, - 0, GFP_ATOMIC); - if (result) - dev_err(&tz->device, "Failed to send netlink event:%d", result); - - return result; -} -EXPORT_SYMBOL_GPL(thermal_generate_netlink_event); - -static int __init genetlink_init(void) -{ - return genl_register_family(&thermal_event_genl_family); -} - -static void genetlink_exit(void) -{ - genl_unregister_family(&thermal_event_genl_family); -} -#else /* !CONFIG_NET */ -static inline int genetlink_init(void) { return 0; } -static inline void genetlink_exit(void) {} -#endif /* !CONFIG_NET */ - static int thermal_pm_notify(struct notifier_block *nb, unsigned long mode, void *_unused) { @@ -1607,13 +1514,9 @@ static int __init thermal_init(void) if (result) goto unregister_governors; - result = genetlink_init(); - if (result) - goto unregister_class; - result = of_parse_thermal_zones(); if (result) - goto exit_netlink; + goto unregister_class; result = register_pm_notifier(&thermal_pm_nb); if (result) @@ -1622,8 +1525,6 @@ static int __init thermal_init(void) return 0; -exit_netlink: - genetlink_exit(); unregister_class: class_unregister(&thermal_class); unregister_governors: diff --git a/include/linux/thermal.h b/include/linux/thermal.h index e45659c759209..d9111aebb97d6 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -544,15 +544,4 @@ static inline void thermal_notify_framework(struct thermal_zone_device *tz, { } #endif /* CONFIG_THERMAL */ -#if defined(CONFIG_NET) && IS_ENABLED(CONFIG_THERMAL) -extern int thermal_generate_netlink_event(struct thermal_zone_device *tz, - enum events event); -#else -static inline int thermal_generate_netlink_event(struct thermal_zone_device *tz, - enum events event) -{ - return 0; -} -#endif - #endif /* __THERMAL_H__ */ From patchwork Fri Oct 18 08:51:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 11197823 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB51513B1 for ; Fri, 18 Oct 2019 08:52:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BAE77222CD for ; Fri, 18 Oct 2019 08:52:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dmfM6j4A" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2632926AbfJRIwU (ORCPT ); Fri, 18 Oct 2019 04:52:20 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:38168 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2442244AbfJRIwT (ORCPT ); Fri, 18 Oct 2019 04:52:19 -0400 Received: by mail-pl1-f195.google.com with SMTP id w8so2525223plq.5 for ; Fri, 18 Oct 2019 01:52:19 -0700 (PDT) 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 :in-reply-to:references; bh=OV9GCJs4s7auzZpPSYG5QvReU/tq3thTyE+8LoeVN7Y=; b=dmfM6j4ABh73a19Lql/07zj2f/0Iwn3aie8/jiCr1K6Vb5Ytac72LE/hl62BYZwskf QBwjojv+SJ1y1JjFxvkRx0+t3VRWbQXLB4bs1jv9Bgr6T1w7haFGcRELPXqQh8cLsO9Q o/LW/pGLKqF1eb3h0BDTea7w3frkGKdGJ1fc8F3C3UyetgUMZBobiCcynMF0g6pUJd5+ uelEYgHFlec1Kc0m2bSBsZ/9BmMTMOFHR35jIjaxBSH3+KO1kKE1rm8v1Y4A9HPOZB5N 6u8HtAVKYO42M0csV83e7fwx0jGrnSAMPeHvLPR8wH6PomL1eIVbxOHmIwYfaHBw2nhj +fxA== 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:in-reply-to:references; bh=OV9GCJs4s7auzZpPSYG5QvReU/tq3thTyE+8LoeVN7Y=; b=nV3xSi1e32vDN9ZGhN+mDl7XKX5DQMtXOurHPOUbLGhRCQmi7JIeKHOFrHqqEgdgyY ULuuqtDTIWFw6bktvIU7dtJt4lTduPhRvu8MIbkZFnurX0Gxm5HP7bLVgHPcfh9yJI/R 4TrSnDhOiuxpQKZtWFQUJYPkWnjZmXha6rLSBKmPOXKemTFdp5dPiLfwhshpq7qb6Y5z 3Uaf/HbhBb15YElsKoz4v3UKqxtSfwGX+8Qb953njxhBm+fHtMqNhTdKLf3JwwM7N+tD s3gVioRFPh37uohZzQC+3i2KXnZ63Xpo3gTrR8qzEfEafTbCz0tlrcFdrbgFyBShRPyi xWYg== X-Gm-Message-State: APjAAAWRvKtDN+9sod+v6XENsjCEYhNvu5re8kFBPPNTtSLuImyRgkbm 7ALFQSIrVh/PRw9U2dDGHxPvbg== X-Google-Smtp-Source: APXvYqxSXKnzx+2EEFL8oM5GrGOtshkcJz4Aom/KrgOWjvBC/g0YvXv1JagKhBDGg1PhBCmj3qhHyQ== X-Received: by 2002:a17:902:8505:: with SMTP id bj5mr8309860plb.296.1571388738714; Fri, 18 Oct 2019 01:52:18 -0700 (PDT) Received: from localhost ([49.248.178.134]) by smtp.gmail.com with ESMTPSA id x5sm5246107pfi.32.2019.10.18.01.52.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Oct 2019 01:52:18 -0700 (PDT) From: Amit Kucheria To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, daniel.lezcano@linaro.org, viresh.kumar@linaro.org, sudeep.holla@arm.com, bjorn.andersson@linaro.org, edubezval@gmail.com, agross@kernel.org, tdas@codeaurora.org, swboyd@chromium.org, ilina@codeaurora.org, "Rafael J. Wysocki" , Amit Kucheria , Ben Segall , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Steven Rostedt , Vincent Guittot , Zhang Rui Cc: linux-pm@vger.kernel.org Subject: [PATCH v4 2/6] thermal: Initialize thermal subsystem earlier Date: Fri, 18 Oct 2019 14:21:59 +0530 Message-Id: <511b47ab70f6be4ba0f2d7f69217ee593a0bcfd8.1571387352.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Now that the thermal framework is built-in, in order to facilitate thermal mitigation as early as possible in the boot cycle, move the thermal framework initialization to core_initcall. Signed-off-by: Amit Kucheria Acked-by: Viresh Kumar --- drivers/thermal/thermal_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index cced0638b686f..69fcd54f8a83e 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1537,4 +1537,4 @@ static int __init thermal_init(void) mutex_destroy(&poweroff_lock); return result; } -fs_initcall(thermal_init); +core_initcall(thermal_init); From patchwork Fri Oct 18 08:52:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 11197827 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B468013B1 for ; Fri, 18 Oct 2019 08:52:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 940C6222C6 for ; Fri, 18 Oct 2019 08:52:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="W0/ZDYAS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2632966AbfJRIwZ (ORCPT ); Fri, 18 Oct 2019 04:52:25 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40821 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2632963AbfJRIwY (ORCPT ); Fri, 18 Oct 2019 04:52:24 -0400 Received: by mail-pg1-f195.google.com with SMTP id e13so2986433pga.7 for ; Fri, 18 Oct 2019 01:52:24 -0700 (PDT) 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 :in-reply-to:references; bh=pOGwcMchIXdaRlZBtyBhTrAkf1RWijM6eAT3n0JAvC8=; b=W0/ZDYASOJLvNqpxJwakFyLljNCg9m3gU0qus8PbZv80d4MBYV61s6YgkTZ2o092HT l6Hox1rxqw02mP0hkE4dmTIBOWuWzQnun3CAx8iQoBX+ieOgLqXuGkwjkkOBDHTp5Ej+ bSnCeOZpuByrGXv865yvZBGp5e3L4VUeAZx+58RmXzR2DvP9GDKFU1ygQ9w2uMVTfPcz smHMCtUiUzR34xEfz0yeFzUvh94kWKg6jMr4+OVdRPZ10fXTx3dQH2GQTaOGk6Ngx4Uk IMX2iqAmFPlLvk2rQBvqd8zGqL8L0dUK+Ga6BJIMHRfiL0VXN79mrWTRE45HPF/mmQAF dwcw== 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:in-reply-to:references; bh=pOGwcMchIXdaRlZBtyBhTrAkf1RWijM6eAT3n0JAvC8=; b=sXwd6Uz9z9alJi7+BKnqV7smGboXUuiWlfpcL5xS60SSA8oYMBKJNVUFHUpmaBvJk0 CLaMxAJf2FfUxVPRUE7u84JM4oedEwjr7nEmx2XpKEdItmIqySvGSF/vm4aUpvN8S/8N td2VHPUt9rr+ANlI+EEW0hcJGb9CNCV5qN2yQE3VrY68pZfR4KhTPv8oHn6lUGgZVOUr tlPgglzdPd/YfKRzXwdOuGh8hblk/vPfiAYWcz5DSempxKF8hXYjosHjIu4CpKuWL4St /l0ZuN2qQD5S/28gXmBCkcLLcq4i1QCI3v+N6irFUmY/+YDTbrsK60c16cbzQgfKRFOS AzLg== X-Gm-Message-State: APjAAAVeEj5KE9A9aFhtY7NJjBfHSZexCgNwVNGIMhPzAANT89Xg19+2 xTM35n3DeIBySBfMa3lCsXblPUDJeT5Eyw== X-Google-Smtp-Source: APXvYqwoQ5ESE21BX6wAak+ChcC8b4+hgljou3Np9qGufEF8scYDPgxmkBTLTmXkiWYDrLsXbM03IA== X-Received: by 2002:a17:90a:bd8e:: with SMTP id z14mr9466041pjr.40.1571388743507; Fri, 18 Oct 2019 01:52:23 -0700 (PDT) Received: from localhost ([49.248.178.134]) by smtp.gmail.com with ESMTPSA id c34sm5688183pgb.35.2019.10.18.01.52.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Oct 2019 01:52:23 -0700 (PDT) From: Amit Kucheria To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, daniel.lezcano@linaro.org, viresh.kumar@linaro.org, sudeep.holla@arm.com, bjorn.andersson@linaro.org, edubezval@gmail.com, agross@kernel.org, tdas@codeaurora.org, swboyd@chromium.org, ilina@codeaurora.org, "Rafael J. Wysocki" , Amit Kucheria , Ben Segall , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Steven Rostedt , Vincent Guittot , Zhang Rui Cc: linux-pm@vger.kernel.org Subject: [PATCH v4 3/6] cpufreq: Initialise the governors in core_initcall Date: Fri, 18 Oct 2019 14:22:00 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Initialise the cpufreq governors earlier to allow for earlier performance control during the boot process. Signed-off-by: Amit Kucheria Acked-by: Viresh Kumar Reviewed-by: Rafael J. Wysocki --- drivers/cpufreq/cpufreq_conservative.c | 2 +- drivers/cpufreq/cpufreq_ondemand.c | 2 +- drivers/cpufreq/cpufreq_performance.c | 2 +- drivers/cpufreq/cpufreq_powersave.c | 2 +- drivers/cpufreq/cpufreq_userspace.c | 2 +- kernel/sched/cpufreq_schedutil.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index b66e81c06a575..737ff3b9c2c09 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -346,7 +346,7 @@ struct cpufreq_governor *cpufreq_default_governor(void) return CPU_FREQ_GOV_CONSERVATIVE; } -fs_initcall(cpufreq_gov_dbs_init); +core_initcall(cpufreq_gov_dbs_init); #else module_init(cpufreq_gov_dbs_init); #endif diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index dced033875bf8..82a4d37ddecb3 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -483,7 +483,7 @@ struct cpufreq_governor *cpufreq_default_governor(void) return CPU_FREQ_GOV_ONDEMAND; } -fs_initcall(cpufreq_gov_dbs_init); +core_initcall(cpufreq_gov_dbs_init); #else module_init(cpufreq_gov_dbs_init); #endif diff --git a/drivers/cpufreq/cpufreq_performance.c b/drivers/cpufreq/cpufreq_performance.c index aaa04dfcacd9d..def9afe0f5b86 100644 --- a/drivers/cpufreq/cpufreq_performance.c +++ b/drivers/cpufreq/cpufreq_performance.c @@ -50,5 +50,5 @@ MODULE_AUTHOR("Dominik Brodowski "); MODULE_DESCRIPTION("CPUfreq policy governor 'performance'"); MODULE_LICENSE("GPL"); -fs_initcall(cpufreq_gov_performance_init); +core_initcall(cpufreq_gov_performance_init); module_exit(cpufreq_gov_performance_exit); diff --git a/drivers/cpufreq/cpufreq_powersave.c b/drivers/cpufreq/cpufreq_powersave.c index c143dc237d878..1ae66019eb835 100644 --- a/drivers/cpufreq/cpufreq_powersave.c +++ b/drivers/cpufreq/cpufreq_powersave.c @@ -43,7 +43,7 @@ struct cpufreq_governor *cpufreq_default_governor(void) return &cpufreq_gov_powersave; } -fs_initcall(cpufreq_gov_powersave_init); +core_initcall(cpufreq_gov_powersave_init); #else module_init(cpufreq_gov_powersave_init); #endif diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c index cbd81c58cb8f0..b43e7cd502c58 100644 --- a/drivers/cpufreq/cpufreq_userspace.c +++ b/drivers/cpufreq/cpufreq_userspace.c @@ -147,7 +147,7 @@ struct cpufreq_governor *cpufreq_default_governor(void) return &cpufreq_gov_userspace; } -fs_initcall(cpufreq_gov_userspace_init); +core_initcall(cpufreq_gov_userspace_init); #else module_init(cpufreq_gov_userspace_init); #endif diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 86800b4d5453f..322ca8860f548 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -915,7 +915,7 @@ static int __init sugov_register(void) { return cpufreq_register_governor(&schedutil_gov); } -fs_initcall(sugov_register); +core_initcall(sugov_register); #ifdef CONFIG_ENERGY_MODEL extern bool sched_energy_update; From patchwork Fri Oct 18 08:52:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 11197833 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2561413B1 for ; Fri, 18 Oct 2019 08:52:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 045E7222C5 for ; Fri, 18 Oct 2019 08:52:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="npNq6UNt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2632979AbfJRIw3 (ORCPT ); Fri, 18 Oct 2019 04:52:29 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:37146 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394154AbfJRIw3 (ORCPT ); Fri, 18 Oct 2019 04:52:29 -0400 Received: by mail-pf1-f196.google.com with SMTP id y5so3450224pfo.4 for ; Fri, 18 Oct 2019 01:52:28 -0700 (PDT) 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 :in-reply-to:references; bh=tSzJEpJmDmeHOSEU0I3AfQXPKpO46HQzH7+Mdke63aU=; b=npNq6UNtXYpoaXJ3I7t2IdXdGe06e+rEdJhFxtv6H/2c3gYxsM311WsUfYe2YPeLXv 768UOT5TJugLFh5EWKwXxgf4gtmYK6e7eIRLahWH2yT1KURVAnfccBCO2XbYoIymgvLe oZst0d+algxp9nI8DMjO10QY+hsuBXYeJ6RYVcE51TeViEB0PkvV9xzBvleJJJZps71V lsDlm3yKkeYTjOg9cL7X6UdsU62Tc0D0PP1k+7cqUcXlI4ONOObK0fbVD9B6cNngIhZ0 kSh+IrH7TnmolNGlzhyO0VOTLYEfDqPxcS8iRqahIyPJVRFKb6+MQ/gJ++/MrcAHG6sG aDNg== 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:in-reply-to:references; bh=tSzJEpJmDmeHOSEU0I3AfQXPKpO46HQzH7+Mdke63aU=; b=tzWxdbhQbnGeZLM3qS8LkoWAeuv5b0xMgvEXfTRAtORaRS/K/zSVdWGrUhCqQE5VJw qWeU4TCDjfX1Vnx2JfACBJGT9aHe9ByDVtggbfIh9JEjassniSQAPS7XMd0uBQMIN2mJ tCV+vt/yuq87nH02DWUG+eU3PmErkpPEy1fdF9JCwVMeDRoqbR3ITBGYmoYPmIllHOPT beGOiy41hylmaltujifShxfAAv+7UFBd1KlyLZHoNfgmCX7vGBjFwL+eIBaOG6mZElDI V5jaW8/jdJ7XATZvr5JiYM3aV0stJ+FptGFsuivQoGQOYj9h2u/URyQnZ3AJtM47sDhA yNbg== X-Gm-Message-State: APjAAAVCD3phYIrSU4o2vT4m14EAucnTGE8BXozKXrcFNvFqP/qDVkfG +ekA+Sxn92NT4eTJL2K1xzRXhg== X-Google-Smtp-Source: APXvYqwZ9DcorsT0otODsjVhMRV+5vmVK01y/h76Hpz5XctIkGGXzAYAJLgHoIMc38KZoHfdcV+AJw== X-Received: by 2002:a63:6b0a:: with SMTP id g10mr8500894pgc.296.1571388747372; Fri, 18 Oct 2019 01:52:27 -0700 (PDT) Received: from localhost ([49.248.178.134]) by smtp.gmail.com with ESMTPSA id x19sm8025248pgc.59.2019.10.18.01.52.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Oct 2019 01:52:26 -0700 (PDT) From: Amit Kucheria To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, daniel.lezcano@linaro.org, viresh.kumar@linaro.org, sudeep.holla@arm.com, bjorn.andersson@linaro.org, edubezval@gmail.com, agross@kernel.org, tdas@codeaurora.org, swboyd@chromium.org, ilina@codeaurora.org, "Rafael J. Wysocki" , Amit Kucheria , Ben Segall , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Steven Rostedt , Vincent Guittot , Zhang Rui Cc: linux-pm@vger.kernel.org Subject: [PATCH v4 4/6] cpufreq: Initialize cpufreq-dt driver earlier Date: Fri, 18 Oct 2019 14:22:01 +0530 Message-Id: <66d8ae593ce7936a5f492d0c6855c1ac225b64ee.1571387352.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This allows HW drivers that depend on cpufreq-dt to initialise earlier. Signed-off-by: Amit Kucheria Acked-by: Viresh Kumar --- drivers/cpufreq/cpufreq-dt-platdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c index bca8d1f47fd2c..3282defe14d41 100644 --- a/drivers/cpufreq/cpufreq-dt-platdev.c +++ b/drivers/cpufreq/cpufreq-dt-platdev.c @@ -180,4 +180,4 @@ static int __init cpufreq_dt_platdev_init(void) -1, data, sizeof(struct cpufreq_dt_platform_data))); } -device_initcall(cpufreq_dt_platdev_init); +core_initcall(cpufreq_dt_platdev_init); From patchwork Fri Oct 18 08:52:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 11197839 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D43713B1 for ; Fri, 18 Oct 2019 08:52:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0BDE5222CC for ; Fri, 18 Oct 2019 08:52:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mbBsczHQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633002AbfJRIwh (ORCPT ); Fri, 18 Oct 2019 04:52:37 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43574 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394802AbfJRIwg (ORCPT ); Fri, 18 Oct 2019 04:52:36 -0400 Received: by mail-pf1-f195.google.com with SMTP id a2so3442267pfo.10 for ; Fri, 18 Oct 2019 01:52:36 -0700 (PDT) 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 :in-reply-to:references; bh=Pg58XqMrgMUueF1t0WSUT94hNH4L7QyXjN2jFD44ecQ=; b=mbBsczHQ7geTZHLUH4glHa/GX3d3C6ZLa1u5dvWDZVaHWaS2JW7g3tU6SDyLxy6o1u Ds+uGnMxFI1XvqwwerVewsBsOJm0LG3yhE5/CfT0nTve6T4lYLg/BgbpeWs9FCp3bkP/ 2Ibs1iUqmJT+tkwK3dSKnVoWyVL0cPq9GW2PyGPwzyZQKgs07xKmYmo06UC3UTN9b1TI 6DN0X7GFdOLHiURDDIY1mq6bMBwOnZi5VaudeF59RJejJJtl3JcMLLSqmVEKZh12MXZO O9krPHLIXRIT3dWmX/RwRshSQBwsyDEVqof8bpki2b5GXrFYAUiuAvb6PPcfNflVbqGI UBcQ== 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:in-reply-to:references; bh=Pg58XqMrgMUueF1t0WSUT94hNH4L7QyXjN2jFD44ecQ=; b=mUReFG5kgg0mhwyhyv0jBDTuN/jRnbPSsHdoWaiaqVxJKq9/c+ghhR+3o4FlT+Rx0w 9rdM3OLrmLC/XNmDIVls54UyHYevOmOEEt8p01SBvO7FlzxtIYxDl9wqiG7CG050Hh4h 4+2vaGKHdyFfDqUymHeb995zlDXE6BvduzbHWd/VtFodjFWDNZzmyw6lyRM9wFSIf78w kzIaE9arpDm7/vHD6iH0d33cIsd7nSLJ/BX/x2JfPXXkPfwE8eEGhG8+ikxG3d6fd1cb FqwkQ5spMHFmq7URVLjQTGsCPqRZuhhqfVd6AApMcQCxdlNuz56tR0XXxB2cYib4BK/O 2MWQ== X-Gm-Message-State: APjAAAWzJTKUUigsTE873ZSPOLADUcoM7lXyalJASVJRHvJEcsaRjcPQ AYl+3yvbmy2Pi9acLDMIYkiF1w== X-Google-Smtp-Source: APXvYqx8Mpcrks1BZxeEuPxaAnWhLPj55ZV7f4Bw1XHAjGHH8rk1ne6dxHoD9m6lONZAOPVwKvp1Fg== X-Received: by 2002:a62:4ed6:: with SMTP id c205mr5321495pfb.208.1571388755817; Fri, 18 Oct 2019 01:52:35 -0700 (PDT) Received: from localhost ([49.248.178.134]) by smtp.gmail.com with ESMTPSA id s1sm4662870pgi.52.2019.10.18.01.52.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Oct 2019 01:52:35 -0700 (PDT) From: Amit Kucheria To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, daniel.lezcano@linaro.org, viresh.kumar@linaro.org, sudeep.holla@arm.com, bjorn.andersson@linaro.org, edubezval@gmail.com, agross@kernel.org, tdas@codeaurora.org, swboyd@chromium.org, ilina@codeaurora.org, "Rafael J. Wysocki" , Amit Kucheria , Ben Segall , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Steven Rostedt , Vincent Guittot , Zhang Rui Cc: linux-pm@vger.kernel.org Subject: [PATCH v4 6/6] cpufreq: qcom-hw: Move driver initialisation earlier Date: Fri, 18 Oct 2019 14:22:03 +0530 Message-Id: <3d367762ba72fa1cbd6391dc55d94b3284f6c00c.1571387352.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Allow qcom-hw driver to initialise right after the cpufreq and thermal subsystems are initialised in core_initcall so we get earlier access to thermal mitigation. Signed-off-by: Amit Kucheria Acked-by: Daniel Lezcano Acked-by: Taniya Das Acked-by: Viresh Kumar --- drivers/cpufreq/qcom-cpufreq-hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index a9ae2f84a4efc..fc92a8842e252 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -334,7 +334,7 @@ static int __init qcom_cpufreq_hw_init(void) { return platform_driver_register(&qcom_cpufreq_hw_driver); } -device_initcall(qcom_cpufreq_hw_init); +postcore_initcall(qcom_cpufreq_hw_init); static void __exit qcom_cpufreq_hw_exit(void) {