Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9112857pxu; Mon, 28 Dec 2020 06:59:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwaDDnFCn5vdYX/yX3ouNcsL6YBoM+Iea+AlAgPRvY6u8X1Sc20iJwsnNmWxlw9R19njXRm X-Received: by 2002:a17:906:fa8b:: with SMTP id lt11mr41895171ejb.94.1609167587529; Mon, 28 Dec 2020 06:59:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167587; cv=none; d=google.com; s=arc-20160816; b=c/m7ce3Ym7yEol29h8hwVbKBUVYFK4vYfLAMexkJkWPtu0uuy6ozsbR/j4SVyiC5+p qS7FvIy9Yjlty6pMmbWFbTovnxcqu5hjWBANU/2qKt3/dNDl0xISE4lOrqrwVbJu1+sR dWs8UzIGCoOQdNMdtn+FFi1EFnvS+PpkDBF/RR9sS8tP1uRtZFZVkLCyrGTCQ2xu7LTE RK6UHyjCxpg61vvJSVm1NVd4P41iBMufvYMM3L7jw90ttx0VWTyW/hPJMUxBU0FhLTfz zu7wZdRXIukjCg5l2uPjABQGWgX3KPOznpZeAXUs0UdDClcGFuXAHgq9MDL3iQP5Uh5A fLLg== 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=7NQvjwZXqt2HS5AaY96tdMbd/YGs9ilpZ82D3zI/JGw=; b=CD9stKFSO0SN5jKsIqElm3usIgTfkagFw+7xLfqT6K6budylrh08RQf0Ny49tgzMn7 EjMnN6+SeNZ/RCRA/FFs8+mLxLvulwiD0bqZKANP9W/ulDxBLpHrIq3scdAoxudtLUXI 8Td9G4d7lsn/QMmXKxI1aBobCBElMyaur5L9eYjUc2KZkyLVYo0RTqRn+4zXb/s+mVK2 mqKcCSo3yOFkGtdvJNO+DSSAe8YbV7eQtMFUcNS59Mc3m4QbJmWChNuccHO9To3rK2fr 0T8FdJsDcutKMoRnXJ3SUG2Iby3tGxeAl8zaNxLWbBVgCUh9gFWCNLscQZaXMZfws0mL +9HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jOIQPOyE; 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 hp33si17568485ejc.250.2020.12.28.06.59.19; Mon, 28 Dec 2020 06:59:47 -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=jOIQPOyE; 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 S2504191AbgL1O4s (ORCPT + 99 others); Mon, 28 Dec 2020 09:56:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:50990 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2441192AbgL1OQ1 (ORCPT ); Mon, 28 Dec 2020 09:16:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8278B22583; Mon, 28 Dec 2020 14:16:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164972; bh=WwQZgz85Hxcv0lpZP4RPu7pywIyi+Pa/yJYPGnHR5IQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jOIQPOyEY/Qdr3pNGBru08A7t4TMaunhClIhayevfDypWtuUhK7Y/T1mHL1jJyKml TpN6L4fsE/vhudn7/aFExByuznqFbfe8U6C+2qZ91Dmt/4Ms7XBkyrNCfCk5bs86Yt C8N2uNeX/kSWrnd0PdDN2MTiDKei4ghZvyLI40OI= 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 5.10 364/717] powerpc/pseries/hibernation: drop pseries_suspend_begin() from suspend ops Date: Mon, 28 Dec 2020 13:46:02 +0100 Message-Id: <20201228125038.454025599@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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 81e0ac58d6204..3eaa9d59dc7ab 100644 --- a/arch/powerpc/platforms/pseries/suspend.c +++ b/arch/powerpc/platforms/pseries/suspend.c @@ -187,7 +187,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