Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp120767lqb; Thu, 14 Mar 2024 07:06:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUfYQBvTQyd+n0DqaKoVQTV62luwvAKbr/ZaZ1C1os+MiUNgm5vTaVTqscPYFmmwb5khhaTwKgKii+tV5r+fkVP3fys3UaY+bJNEPHcjg== X-Google-Smtp-Source: AGHT+IEvGhh64gsfmymt04jvTPSNzrHo3slJcsCvZimX0IfHPFuy4+dgWBlQBK4piyhZ68xPTxa3 X-Received: by 2002:a05:622a:2991:b0:42f:3082:fa97 with SMTP id hd17-20020a05622a299100b0042f3082fa97mr1038998qtb.33.1710425166490; Thu, 14 Mar 2024 07:06:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710425166; cv=pass; d=google.com; s=arc-20160816; b=z3YIGZvD1WqaEbYrmPccNe4DKViflxECfFEaOLmHp7GEmeyVV1Psdc6mmPyflAZ3Hm KJlL3rfbY56zGWjldtAuWalwi2YVvcCHtRTeLqbgEyLUP+e8vSoec1PtIKD3O8/VRS9l Qc1nY+voorgdaheH/gDb4FsiTGDpFtv81AQEBzXNM9O9bQQSYfxcvrK3x2bC4LY8cpzl 152iSanetnwjOr/ZixLMIonmj0VDmctw2AW0wAlM3MpMIccJiXUvJpwJh4vs73VluyB0 SVBbFrF4/Lzv926uQj8EArCSfjpZSZGjtvz474ox0gEJ25zkn9fJTx1+Mtke12co/wuD uKAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=uFLAb0F25k8NRPb1i7faRr465nj8uyGIRN7Vrexl6dk=; fh=76fY95VCn/tTPDURHIWBg4FyCkia1KFHdPTfdxMrHno=; b=UijQl+TfWV7yoXtDweskaLL9vfdecYmwwX2gSXmNFBr6HTk1BmdCMletvzxs/brZVR hvS0CzKSkY0vTkxsmxKD/Gj5Zks3zl6yCZJxidNER36vT+pifJu6C+t74dpOL/qIlldH IIwtm5/w2EegdPfgB0clqxxaT2XKohzoA03XjGssMsn5sNFfSG7ROT65pshoiVRiSJPM V/wAE56ASOysLUrCsVqTzqFIEkN5exBqL51bYFmfpSyR4Hl4ytq5FDYUizRp637+hVUf h5zNvcXkN/TkSMp4P3sOGEhajqO1yVgPaCV9VdZkcdITGyWoB1ohdCAR69tVe8eRoHBF nLnw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-103349-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103349-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w3-20020a05622a134300b004309fbe2b5bsi973148qtk.235.2024.03.14.07.06.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 07:06:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103349-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-103349-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103349-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 04E1B1C223F8 for ; Thu, 14 Mar 2024 14:06:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CD6A71B32; Thu, 14 Mar 2024 14:04:57 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71F666FE1E; Thu, 14 Mar 2024 14:04:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710425096; cv=none; b=EynTQ8UAC4B+u3bCVnkbRG3+O3iIw2EW8dzVwSWWCGuGztGwkQXqlLEzoaOsNe4adYTnjOez92gKsP5YGXlCJyPM7VkaiRRSc6f8IVEJqXF/Z4M070RQuWe/zzfeRz3a/2ufFU8F/xb8Jr4LNyuzrJ+yOeBFFdv/lrXAzcjrA8A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710425096; c=relaxed/simple; bh=mzHk+OCGnE2cjK/GID6NafKHM6xvW+nmtg17CRUaB+w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=B2k5BU0YNIGxbRVoAygt3HuKUn9Tu9rT0H2Wm8I+pbMTVv3nptJHnq60Cnp8J7p689evomKtAmD3tjtKwKAiLU/ekIDqSqvooRo8VGW/wakycjpattZNu6XTV/+rdjWKajBNda+DF/RFtNORekav26dNaufA54U0d0N71Y4awjw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 340A61063; Thu, 14 Mar 2024 07:05:29 -0700 (PDT) Received: from e129166.arm.com (unknown [10.57.13.158]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4D8253F762; Thu, 14 Mar 2024 07:04:50 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: lukasz.luba@arm.com, dietmar.eggemann@arm.com, linux-arm-kernel@lists.infradead.org, sboyd@kernel.org, nm@ti.com, linux-samsung-soc@vger.kernel.org, daniel.lezcano@linaro.org, rafael@kernel.org, viresh.kumar@linaro.org, krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, m.szyprowski@samsung.com, mhiramat@kernel.org Subject: [PATCH 4/4] soc: samsung: exynos-asv: Update Energy Model after adjusting voltage Date: Thu, 14 Mar 2024 14:04:21 +0000 Message-Id: <20240314140421.3563571-5-lukasz.luba@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240314140421.3563571-1-lukasz.luba@arm.com> References: <20240314140421.3563571-1-lukasz.luba@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When the voltage for OPPs is adjusted there is a need to also update Energy Model framework. The EM data contains power values which depend on voltage values. The EM structure is used for thermal (IPA governor) and in scheduler task placement (EAS) so it should reflect the real HW model as best as possible to operate properly. Based on data on Exynos5422 ASV tables the maximum power difference might be ~29%. An Odroid-XU4 (with a random sample SoC in this chip lottery) showed power difference for some OPPs ~20%. Therefore, it's worth to update the EM. Signed-off-by: Lukasz Luba --- drivers/soc/samsung/exynos-asv.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/soc/samsung/exynos-asv.c b/drivers/soc/samsung/exynos-asv.c index d60af8acc3916..bd6bb2cab2cd8 100644 --- a/drivers/soc/samsung/exynos-asv.c +++ b/drivers/soc/samsung/exynos-asv.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -97,9 +98,17 @@ static int exynos_asv_update_opps(struct exynos_asv *asv) last_opp_table = opp_table; ret = exynos_asv_update_cpu_opps(asv, cpu); - if (ret < 0) + if (!ret) { + /* + * When the voltage for OPPs successfully + * changed, update the EM power values to + * reflect the reality and not use stale data + */ + em_dev_update_chip_binning(cpu); + } else { dev_err(asv->dev, "Couldn't udate OPPs for cpu%d\n", cpuid); + } } dev_pm_opp_put_opp_table(opp_table); -- 2.25.1