From patchwork Tue Feb 7 19:59:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 54071 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3061312wrn; Tue, 7 Feb 2023 12:30:31 -0800 (PST) X-Google-Smtp-Source: AK7set+U0DS8omCHifMAh59E1hzNK5c6AUyVsJ8RAoqUX+JZ0J4rbhfbt2yIGuEywQUR55+oWJ6c X-Received: by 2002:a50:d0d1:0:b0:49c:96f9:417e with SMTP id g17-20020a50d0d1000000b0049c96f9417emr5498402edf.2.1675801830810; Tue, 07 Feb 2023 12:30:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675801830; cv=none; d=google.com; s=arc-20160816; b=B4OpDCUjDWi50nqkQY0PQhZ//94w1EFLDkJ3klY++f8ZrNI9z1xcSNhgJCHpVzzkg5 0VDiaW9W5QDHUpw3pKJX5gpFi57UN68yLHlhSFtnxgVU8CdbQk7ho5HKQrtQfYb7GsVP YbaFTXci4OXJR0XwJy3isC2ooA7Z+LdjgHs+TBe0RCACU/59j52xuBlvXVy4y0gwZBY3 6G5tcoJ2vVOOo+RmJJaKPk64mnqyK+Ocoygf02lfNGiz6ttz/CFd9w4X2H25kaZVCqQU +82+6MMRf5fkJoh/uRW7EB2GoBp/DKpuJaWeA0UqOc81WKLtlradyZndocMEvim+k0Bc 1OgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=v4HQWFimexAe9nSHHuP6NE7y2xVbxuaQSoWqyLryx+I=; b=DZm1ChD/12I8HD0DM60A0oJf9QtNtqNNQzpzgC3rvw3Kf/M1rwiv7Mm91hC46uhLbm 8pWl9lYKOoeRp0STnOrbYwlFxc/rPbYo0/cP8djqGPe7o7zLJx8Zumt967dEsxz9A/eU gIYVH4yO2+MLPuKP9qrWFVHJnAeIeMV81yvnqVaAYsZA/Ft9fIkX33eLvfaV5g9pnrSN 4Hp5RgtVMNHnRx3s7x4KVinujOJdaFbqvzBPaXGKQUTyzEzJLEbSrUhp1NsA/KWgfvFp WnZSxlQJbwqGR0VqYdfZJH+deZz7TIeDBVCTtCWfpRMvMXWJkGh9DcT06d1VF0fR8lyx QtRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h15-20020a0564020e0f00b004a2424d1c19si18796684edh.8.2023.02.07.12.30.05; Tue, 07 Feb 2023 12:30:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232053AbjBGUAK (ORCPT + 99 others); Tue, 7 Feb 2023 15:00:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbjBGUAI (ORCPT ); Tue, 7 Feb 2023 15:00:08 -0500 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 377391EBF3; Tue, 7 Feb 2023 12:00:05 -0800 (PST) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.1.0) id b9af761efef1130f; Tue, 7 Feb 2023 21:00:01 +0100 Received: from kreacher.localnet (unknown [213.134.163.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id AE11566F913; Tue, 7 Feb 2023 21:00:00 +0100 (CET) From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Zhang Rui , Artem Bityutskiy Subject: [PATCH v1] cpuidle: driver: Update microsecond values of state parameters as needed Date: Tue, 07 Feb 2023 20:59:59 +0100 Message-ID: <2676828.mvXUDI8C0e@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 213.134.163.116 X-CLIENT-HOSTNAME: 213.134.163.116 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrudegkedguddvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeffffffkefgheehffelteeiveeffeevhfelteejvddvieejjeelvdeiheeuveeuffenucfkphepvddufedrudefgedrudeifedrudduieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrdduieefrdduudeipdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeegpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomhdprhgtphhtthhopegrrhhtvghmrdgsihhthihuthhskhhihieslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=4 Fuz1=4 Fuz2=4 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757205580217915412?= X-GMAIL-MSGID: =?utf-8?q?1757205580217915412?= From: Rafael J. Wysocki If the cpuidle driver provides the target residency and exit latency in nanoseconds, the corresponding values in microseconds need to be set to reflect the provided numbers in order for the sysfs interface to show them correctly, so make __cpuidle_driver_init() do that. Signed-off-by: Rafael J. Wysocki Tested-by: Artem Bityutskiy --- drivers/cpuidle/driver.c | 4 ++++ 1 file changed, 4 insertions(+) Index: linux-pm/drivers/cpuidle/driver.c =================================================================== --- linux-pm.orig/drivers/cpuidle/driver.c +++ linux-pm/drivers/cpuidle/driver.c @@ -183,11 +183,15 @@ static void __cpuidle_driver_init(struct s->target_residency_ns = s->target_residency * NSEC_PER_USEC; else if (s->target_residency_ns < 0) s->target_residency_ns = 0; + else + s->target_residency = s->target_residency_ns / NSEC_PER_USEC; if (s->exit_latency > 0) s->exit_latency_ns = s->exit_latency * NSEC_PER_USEC; else if (s->exit_latency_ns < 0) s->exit_latency_ns = 0; + else + s->exit_latency = s->exit_latency_ns / NSEC_PER_USEC; } }