Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp376489lqc; Thu, 7 Mar 2024 23:12:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVMK5rN/cB3fNUG1rWC4vTLCUL4BJOqc3/fGZUkXamet81m+5YNpI5Aq4ZCDlgLGXhFDE7oV7egNb7FjV+vXYS56OYqnPgOQo5S9dAw4A== X-Google-Smtp-Source: AGHT+IFTzvnEElBZXAKA2vG9lc525aImAQe8iDqrnsjZG4oNZTRfvGMlVb+ejZKWd5tdjULU4rUs X-Received: by 2002:a50:a6c3:0:b0:566:f5d6:4b4 with SMTP id f3-20020a50a6c3000000b00566f5d604b4mr1103460edc.12.1709881967023; Thu, 07 Mar 2024 23:12:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709881967; cv=pass; d=google.com; s=arc-20160816; b=m5P3CrHeBeW+LpbkX25W4O0r5Sx9v2FBssqhME2EHaIfi4UY+3f01GHacyRU3ypnVM YoOTjEQABTzuVKtZCvR4jGOS1vfcDe8ptFCmI8QSWuoVAPNo+4O++gTlj4UfkckyEoeV kt16yQP4o0FPUCeQv+JQ/zj+G3oKhCPmDvUDFJmTYzmy3uKl+UnWCH2T00FZj1syXnwh eQsYdLHPaAcUXIr9HVjr4LaEBPU39avMNXdW00jUjI+Nh4Lv0l9StFYo31XlXrjDRGDZ slVPvMbf4mxGmpie1WQmJWK1gUdAcVB3Jy9/jlV3u5Ylc4DUZtR45GidFTGB8Bu50Hwa ldWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=3eAw1MxLJ/Z1C/F1OCuVuEQ3bEvjcOElWxZRU5ARRak=; fh=AjhJhCbd83UpWXze22h6DFZCEgHYo439CHpqgcL0jQg=; b=jcY5iADfTa/hEv5Xg6OYZ5l+z2i1UjFM6Jb7D5cd8Ha/2kvv4/w4aNWyTBsekEMbsB 13IclusQ8HYqo5kYCCb9/Bx6+o0Pt79nGMzKuCEIJ8TjE9p3+zmwaqhU1Wkocz3qdXXH Boh64ya1V3q02SIaTgjrXU+lC5s+QRpGhruQCxW2UFAH0fkRIvM7TZPVlnUKj+nC5u17 nZwSGEAh8TyqC0VAQheSXUu4e2W1PcXiZ0uwyHUEkdQRrPu+qpMB8MTns45c1rWHXMgN 12wUUSRzUXKK3si7Te+pxRc+n+IzUlIIaU99SkKfdywZ23G71ldIzxGoPiG9wZI9TFpB bRhg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=XPXwAzt4; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-96558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96558-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ew11-20020a056402538b00b005682441f895si700135edb.419.2024.03.07.23.12.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 23:12:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=XPXwAzt4; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-96558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96558-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C7F601F232D4 for ; Fri, 8 Mar 2024 07:03:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 087904EB4D; Fri, 8 Mar 2024 07:02:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="XPXwAzt4" Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D16834E1DC; Fri, 8 Mar 2024 07:02:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709881373; cv=none; b=l4bbQfDVB3u2wHPaamYgsDavSnKH9FCB4DN+y3fspFX9EGAKYTiN+WH8r4qSR2y6qad9OJCzkHINe0Y7CMtpgHfAlMFgMuKE1GNCDPybBZ2b6oTaCa4Y/IU3fXwdZ6zKmk2cH881TuWC0MfFqs16Y9STziBLMK/scm4Hxtgf0MQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709881373; c=relaxed/simple; bh=PAoomouKbOdQvIndHg/4IvzufyezdIjPnsSPwvJBt1c=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=QtW2E5lhxLtlWKQcQu8rp7ZVBQPIn8P3JT2OmPa+74UQMFYiFmhbz5ged8Tv5y1BMMsvXt8A/GbSQGlv8rSM78RfHzX4GFrhHHGDcSb4Q6DLA9i/ujuqazZKUpKhZ2MkEKsTfyBWUNDc8YuAGTtaUBR/4ogJr5h8KVsFHgXY1ME= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=XPXwAzt4; arc=none smtp.client-ip=60.244.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com X-UUID: dc880b94dd1911eeb8927bc1f75efef4-20240308 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=3eAw1MxLJ/Z1C/F1OCuVuEQ3bEvjcOElWxZRU5ARRak=; b=XPXwAzt4pz0BM4rqsG0CkBudjsPIJeagw03r4YscMRSxx/haN5Vb3JThuJmJi1eDD0DXAmVVOni+lWKhOkh9ra8isgSFj/NWTCfWcsq95jIf94HnRpauI35L8G7oUVvbULDXTFLpVQfnvAvOgrN/XZsNbeL9a1J21t+IIJyI5VY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:53a474fa-9a44-49d8-8091-d614da0a7632,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:6f543d0,CLOUDID:ec99a8ff-c16b-4159-a099-3b9d0558e447,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: dc880b94dd1911eeb8927bc1f75efef4-20240308 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1202741839; Fri, 08 Mar 2024 15:02:43 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 8 Mar 2024 15:02:42 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 8 Mar 2024 15:02:42 +0800 From: PoShao Chen To: , CC: , , , , , , , , , , , , , Subject: [PATCH 1/2] PM: EM: Add macro em_is_microwatts() Date: Fri, 8 Mar 2024 14:59:21 +0800 Message-ID: <20240308065922.10329-1-poshao.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain This patch adds a new macro, em_is_microwatts(), which checks if the EM_PERF_DOMAIN_MICROWATTS flag is set for a given Energy Model. This macro enables other parts of the kernel, such as cooling devices, to easily determine the unit of power used by the Energy Model and to perform the necessary conversions if the values are provided in microwatts. Signed-off-by: PoShao Chen --- include/linux/energy_model.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h index 770755df852f..68145b4368d1 100644 --- a/include/linux/energy_model.h +++ b/include/linux/energy_model.h @@ -92,6 +92,7 @@ struct em_perf_domain { #define em_span_cpus(em) (to_cpumask((em)->cpus)) #define em_is_artificial(em) ((em)->flags & EM_PERF_DOMAIN_ARTIFICIAL) +#define em_is_microwatts(em) ((em)->flags & EM_PERF_DOMAIN_MICROWATTS) #ifdef CONFIG_ENERGY_MODEL /* -- 2.18.0