Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2257062iof; Wed, 8 Jun 2022 00:38:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0Q8PKQ5Gu3GNzmiRliWVwHVr+gDcAzWIdyNwLhNUNQYVEy2Izjdh2dHdO9R2OlofA33Eo X-Received: by 2002:a63:f405:0:b0:3fc:74c6:fa2 with SMTP id g5-20020a63f405000000b003fc74c60fa2mr29012282pgi.38.1654673881342; Wed, 08 Jun 2022 00:38:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654673881; cv=none; d=google.com; s=arc-20160816; b=LZj9Jhtj8BigmEryMPWtynoDp/8JMSmPE7pWeLEBmfbE/0yRHoSDBRDUeNOoASYPZa 4EZyg3RCxNH+mEe5/1Ddy/6Llqpulqbh/zz3XjUab3ZoUrbLJgYX3d4D2HedIpFAcWYu jaP7Jr/T5jcgku1yFb5aInBvJA1tJXFP1GlGoN420tMXsdgriJ6TxC8MycdfygQInF+l MU26BrQcrwaGR3SNDt59esRyYimYjOWctcrkpZU0G8O8B2rrT1HeL/y4yaILhe+MkT+h +Qgu4JC1ZmFvfMh7clLEpY6eAbMasQtOwPd+1jOwWI5Y8PgKomjh/nDyXj7FwtqMasGy NCIQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RaPJqGV5J/gEemSe5CrOZM34fQk8PLgyvmAMJyS8MuI=; b=Ea3xVWg713ohRYlcfeto+5mSuWBSqKzyirdGgpYhRe9/5d4YDsaTPVeaNWy1CrdrKz vQKsb3c6qpxv4ZCgiKG5Y9w49i4fnfjctTZu0OVMspw3OAqrlWGKTQUIbIGSWAQpatcJ znAH3p+Q0Kf3gFZcmm+b7/rA+W+ektxrQUMvgOlaxC9kGiQSvXX6qutSfJblPieH0PgC ZUb5+x9xW07KyZAnnbZu3IjJkVJW0rdlTa/rQldQ92gww+SCBUXfirBfIZVw8qSElHJR dEPiB/34JAnHAFCLyjonEpgY6qOHJqPdzR2y5uLxQCxkfTGEbP5XDuoOKp6bRAyittB2 Risw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Srv2o0r9; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id nk13-20020a17090b194d00b001d991dfad30si29919165pjb.153.2022.06.08.00.38.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 00:38:01 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Srv2o0r9; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7B2B6263E9A; Wed, 8 Jun 2022 00:08:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389167AbiFHAvF (ORCPT + 99 others); Tue, 7 Jun 2022 20:51:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382875AbiFGVwB (ORCPT ); Tue, 7 Jun 2022 17:52:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E12223F22D; Tue, 7 Jun 2022 12:09:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 20B58B823AE; Tue, 7 Jun 2022 19:09:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84890C385A2; Tue, 7 Jun 2022 19:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628989; bh=0Fo+vnLS+m2NgyDYTXErJyrh2tt8kExYo9NWHnEnXzo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Srv2o0r9w4f2RIWaltIY1ofVM3XKfdCnM25uLFH7y4LabN8xJV+naZNbW276eBOru iyRtVDwYm7pOZqenaXN6OY8QvcLjPjQjROvs4jPZOekC9rWsqLZBhy6X5O37kjOZtM 91lsyCPV4ItfY4n/bc7AOQAYFwF7XEsmuklLh18A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ulf Hansson , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.18 502/879] PM: domains: Fix initialization of genpds next_wakeup Date: Tue, 7 Jun 2022 19:00:20 +0200 Message-Id: <20220607165017.445605712@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Ulf Hansson [ Upstream commit 622d9b5577f19a6472db21df042fea8f5fefe244 ] In the genpd governor we walk the list of child-domains to take into account their next_wakeup. If the child-domain itself, doesn't have a governor assigned to it, we can end up using the next_wakeup value before it has been properly initialized. To prevent a possible incorrect behaviour in the governor, let's initialize next_wakeup to KTIME_MAX. Fixes: c79aa080fb0f ("PM: domains: use device's next wakeup to determine domain idle state") Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/base/power/domain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 1ee878d126fd..f0e4b0ea93e8 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1997,6 +1997,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd, genpd->device_count = 0; genpd->max_off_time_ns = -1; genpd->max_off_time_changed = true; + genpd->next_wakeup = KTIME_MAX; genpd->provider = NULL; genpd->has_provider = false; genpd->accounting_time = ktime_get(); -- 2.35.1