Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9044850pxu; Mon, 28 Dec 2020 05:17:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNZlOUJ19ZneLueXzXvkcaAnsXGNrK2Sjtuo2xuK4X6KKhEqZJc+rrL6wK0f4Z8m2g88e+ X-Received: by 2002:a17:906:e212:: with SMTP id gf18mr42277408ejb.551.1609161430282; Mon, 28 Dec 2020 05:17:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609161430; cv=none; d=google.com; s=arc-20160816; b=OgqdRI1UnSIatmuo7pkaBBXTgce/YuWTPibScp6EcZOmqvCPeEf7G4myI7SoHizuKj iQGCElYvWSG+kLK37u4P9mittCqLYSkkAu0pd6kN5BSVVP3JLiCpcfSjiLAZXRVA4B3I mVILHmCA3TnVI8m4Mz08/sBmGJLpVPiAV0wNOPxgFbgrzr9xQG6ZdX185XXUTZE+73kx CxyPiUqOls5k8hzaBacz7m2EpyWRw0LMJnh3yvVVVmJHyHmYJCZkL8h61nl5zMJiXG4k 0ZkUnci/qjjFI8F0Z4H7L8/jEsggva32a8FAALmljg6bDIeGtxUxyCSZtAya9kSJo7uF QvQQ== 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=QSGQlKK0Mqh7/NSQNIgxTAfJJpkBmjO2Ue4hXsof6Gk=; b=pO+ISD1pqtef2g4vNdz/OCXsHzM5ro8S+WRvMKIPJQBCxY3DD29wVwIKrcRhKj3VAI 1zxhevJyWMJA7q91C1IPvmpuuyD3tCAaUEOG1YyhA1ePj9fC36GAnZ1qyhw9deUhJRyI XuR7UvDQUJk/RSVW7gGN7v+BZ7MwmaYXeOqHo9AtLP01Wa6tzFeOy+JFGz4bubEsw+// qNUPJ2ECW4ccB8fZD3SzZktmOAbyhM/3JU0bWPRjM2hlEtYjo13puY+l7eGFVZjbkIHi gebYtbJIVQUzbgyLpUVCOnj1QGWOzC/KGCVVk466qQ2Fy5CfpkxdB3rlEbNfnE1doOhn AoDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YNVXuKvE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m14si18818814ejr.242.2020.12.28.05.16.47; Mon, 28 Dec 2020 05:17:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YNVXuKvE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732556AbgL1NOp (ORCPT + 99 others); Mon, 28 Dec 2020 08:14:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:42650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731428AbgL1NOg (ORCPT ); Mon, 28 Dec 2020 08:14:36 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1D03722583; Mon, 28 Dec 2020 13:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161235; bh=EhnV4EG3T2F0XxZ18kiCQA35xmBeDZIkXQj9UKroSeg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YNVXuKvEE3+B6FWTfURMn95GNl+YkbN+yg7C6ioa1DkvaRDkeoGzaqWRq8aAB4etD VrnwQH6emiijfT46vZKzJ8oZ6OUkg8TABRIGctMWFhc71I8m3pJZBeUgaFF7rAfW8X Zsc7Lbi63DpgzcE1689AET0XzkBnhxfx1QQfISos= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Lynch , Michael Ellerman , Sasha Levin Subject: [PATCH 4.14 148/242] powerpc/pseries/hibernation: drop pseries_suspend_begin() from suspend ops Date: Mon, 28 Dec 2020 13:49:13 +0100 Message-Id: <20201228124911.992206968@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Lynch [ Upstream commit 52719fce3f4c7a8ac9eaa191e8d75a697f9fbcbc ] There are three ways pseries_suspend_begin() can be reached: 1. When "mem" is written to /sys/power/state: kobj_attr_store() -> state_store() -> pm_suspend() -> suspend_devices_and_enter() -> pseries_suspend_begin() This never works because there is no way to supply a valid stream id using this interface, and H_VASI_STATE is called with a stream id of zero. So this call path is useless at best. 2. When a stream id is written to /sys/devices/system/power/hibernate. pseries_suspend_begin() is polled directly from store_hibernate() until the stream is in the "Suspending" state (i.e. the platform is ready for the OS to suspend execution): dev_attr_store() -> store_hibernate() -> pseries_suspend_begin() 3. When a stream id is written to /sys/devices/system/power/hibernate (continued). After #2, pseries_suspend_begin() is called once again from the pm core: dev_attr_store() -> store_hibernate() -> pm_suspend() -> suspend_devices_and_enter() -> pseries_suspend_begin() This is redundant because the VASI suspend state is already known to be Suspending. The begin() callback of platform_suspend_ops is optional, so we can simply remove that assignment with no loss of function. Fixes: 32d8ad4e621d ("powerpc/pseries: Partition hibernation support") Signed-off-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20201207215200.1785968-18-nathanl@linux.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/platforms/pseries/suspend.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c index 89726f07d2492..33077ad106cf0 100644 --- a/arch/powerpc/platforms/pseries/suspend.c +++ b/arch/powerpc/platforms/pseries/suspend.c @@ -224,7 +224,6 @@ static struct bus_type suspend_subsys = { static const struct platform_suspend_ops pseries_suspend_ops = { .valid = suspend_valid_only_mem, - .begin = pseries_suspend_begin, .prepare_late = pseries_prepare_late, .enter = pseries_suspend_enter, }; -- 2.27.0