From patchwork Wed Nov 2 14:21:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 14280 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3670242wru; Wed, 2 Nov 2022 08:02:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7PHsFguvsYMyettsk4adfeMafhelb/qYQ0GpqsdGOez2xI07MDJfvdh/JAshj0ZE+Y2q+g X-Received: by 2002:a17:90a:7786:b0:214:2a4a:4a28 with SMTP id v6-20020a17090a778600b002142a4a4a28mr4634396pjk.132.1667401345959; Wed, 02 Nov 2022 08:02:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667401345; cv=none; d=google.com; s=arc-20160816; b=Oez8NjktiL+h4F+8P+isgOWK/MMA9jsUsU6NgOymyaut7PvbAqpgEPcjVj+IyZ7FRg TvXFVyRm6Hi07/bADsEnj9mYakCSxmnMWT//GGYLlDRvX20NIG0XOJgZFaoci6yc8hm8 f9eqb63T2wPFrtNL6/QzSqiAz5GcS6H/SZ9jjxiyS4vzoHKWzXHS0YzuiT57Y7/7Ookb 9DTanlmZ9Pb73Vf1dDEFBuP8GBhVVyVm7tlsNeMdi0pYIcYaKW57oFq0zV2cMGjWl0B0 ndRSQtYapErlToFj/BB0O0htL8ZsJvtRWnqp5R2918nmvrdJXx4cJCK8G2Uc7gocvKvi QOLA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ODaPlzoiM2wGPR3JeVuPfzDqwHYUcKlkdeyiRb2Q0lw=; b=s9f42Mk8FaFtAxQjL7dAVm7oHQ+fGt+B1iYdanyJ/dW+ZzB5swpV83AWez5u/GSi7e 2n/48wFQZ5Tn9vg5s1gXV80AxspqCsX0V3P0pKjSLkpSTIKZRIzGytT5NhUqiHhkjWB3 i+JizwQKFpYbvZYyKqKYmB4PC/ZwC5bmROVEZASdzrKczD22HXckmWooZahHGdPqmYY9 rhQGM+QILENNpf8OUGbVXIeNe8XN1VQqfIcVJ8u2Ycbu+mSx7Jl7ZwZXRnMQScYxDGXz okLEyX+eYw9McbhbUK4nsqAPY+7/tE2iKU6hut8pgSkmt+eisiXXV1K9dsboy7by/PBn rFQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dak2HCVp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y127-20020a623285000000b0053836f22d73si14942927pfy.214.2022.11.02.08.02.11; Wed, 02 Nov 2022 08:02:25 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=dak2HCVp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230320AbiKBOWB (ORCPT + 99 others); Wed, 2 Nov 2022 10:22:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231466AbiKBOVs (ORCPT ); Wed, 2 Nov 2022 10:21:48 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A89D29C9D for ; Wed, 2 Nov 2022 07:21:46 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id k7so7000319pll.6 for ; Wed, 02 Nov 2022 07:21:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ODaPlzoiM2wGPR3JeVuPfzDqwHYUcKlkdeyiRb2Q0lw=; b=dak2HCVpbEaeVp7CSu+TOT5ppVs2qsQOQoQSzIcU5YzTb/X4cctoidWvx1Y+mWXgJC rXX14WjJcAycOPiZAuyD4EzZv2OO5H4Q/wDFdS3UAgSZdiPyC2TKLzRvcKzZBENjx8ru 5e2yu0z4x08FDLahkeTp4/kViprl7KWaAGk2SlNTVWpTrZ62TIDl1s8J5d+EFO3dSFky SI+BDDgi1kOnposCaxtKTnpGtgGRzbqLpkduGlzGqiNb1rKPmGgVaMh4lLPGhknmmoWv njo7EXv22zsqXyOUBlSzmhOAs2/e0UMzhM4TXQP7R76rtCXpCKE/QzvkWvarmcNiUYhJ NWTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ODaPlzoiM2wGPR3JeVuPfzDqwHYUcKlkdeyiRb2Q0lw=; b=kiKMhCWAfmpFBw567y+t86SYYgn5Ts+qikx0z+lMsegX16nNzs7ZOq/39Ak+plBUdh bvH4PWNmhstYNj1M+2DWUOGBN7q3tAXRn1R6MW0GJrd5dwhhCHk5kuiBzwcDPC4e0tsD SKfHQjIvYbuGtkclBpO5dVGacidsdaHAOC5RDRuFhO/sDG0keWvlFfAqz4tZ3tQafTcy 1rNmZOkRMBXZadk8yozYXAceV4JybcilrliWTnt95e84H+1No9Q16zqqow45L28sJCO2 FO+yVHWKMWJ9AaePkv4yedv1PVP3RY6Dh4Tjgkmw7S+0/3qkIfKkvDRSiZ2dlWlv+lIH gK8A== X-Gm-Message-State: ACrzQf1U6mg8UVI9bfNJlFKg8yoEd+qQkgIcidrqbF03irdC5u1K9qU8 S50AHhRjQ/sSbbjDAXi44uj9fw== X-Received: by 2002:a17:90b:164d:b0:213:6a84:2529 with SMTP id il13-20020a17090b164d00b002136a842529mr26114236pjb.32.1667398905990; Wed, 02 Nov 2022 07:21:45 -0700 (PDT) Received: from localhost.localdomain (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id o28-20020aa7979c000000b0056b8181861esm8817773pfp.19.2022.11.02.07.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 07:21:45 -0700 (PDT) From: Shawn Guo To: "Rafael J . Wysocki" Cc: Kevin Hilman , Ulf Hansson , Len Brown , Pavel Machek , Greg Kroah-Hartman , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo Subject: [PATCH v3 1/4] PM: domains: Drop genpd status manipulation for hibernate restore Date: Wed, 2 Nov 2022 22:21:01 +0800 Message-Id: <20221102142104.2006554-2-shawn.guo@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221102142104.2006554-1-shawn.guo@linaro.org> References: <20221102142104.2006554-1-shawn.guo@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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?1748397033768402129?= X-GMAIL-MSGID: =?utf-8?q?1748397033768402129?= The genpd status manipulation for hibernate restore has really never worked as intended. For example, if the genpd->status was GENPD_STATE_ON, the parent domain's `sd_count` must have been increased, so it needs to be adjusted too. So drop this status manipulation. Suggested-by: Ulf Hansson Signed-off-by: Shawn Guo Reviewed-by: Ulf Hansson --- drivers/base/power/domain.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 6471b559230e..97deae1d4e77 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1374,20 +1374,7 @@ static int genpd_restore_noirq(struct device *dev) if (IS_ERR(genpd)) return -EINVAL; - /* - * At this point suspended_count == 0 means we are being run for the - * first time for the given domain in the present cycle. - */ genpd_lock(genpd); - if (genpd->suspended_count++ == 0) { - /* - * The boot kernel might put the domain into arbitrary state, - * so make it appear as powered off to genpd_sync_power_on(), - * so that it tries to power it on in case it was really off. - */ - genpd->status = GENPD_STATE_OFF; - } - genpd_sync_power_on(genpd, true, 0); genpd_unlock(genpd);