Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9181190pxu; Mon, 28 Dec 2020 08:35:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxp5jYjW+aUayBO8pa/TBfsjGwI7uKz9ru5ViPj4u5q8/pJ7DvDExM1k7TDKB0yqXVnFbT X-Received: by 2002:aa7:d9c1:: with SMTP id v1mr43272945eds.115.1609173358031; Mon, 28 Dec 2020 08:35:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609173358; cv=none; d=google.com; s=arc-20160816; b=TS9+itCG34YkCKiGVE0JnlRYDjDXqj245q5Zl0fcRxzpMpZO7tHQLlga+x8CS1DacG +YbchLyeyG2ZYdUxpURsgHOZvpVxWmtzni9L7i94L4BPs8YLMHUk/IA0xJPwbUEGa+xS X4a54lD7xVFNQjL5ZVxDSX6hpw+KA6lAf+MBjkL6nVvgyDNWVr63xnWG86mRZA2FoP2H gz8DOm3lopWYG9m1QRGntNHcwbBNofSN+76ny1Ofg9k/hwdYtKtmqjdBbR4Xj+/nIOTe cv0ygkLeEKZ+e51XZoar7RoFgDHR43nfak/Aki8whxbo+TlmvFD9neslE6fm/cJyx32N 7kbQ== 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=ldQYeIagKiWaD2U/M4KVTSitEiAscD/3m7z7uI8f1kg=; b=tRl0Mq7LdZc0+V79IuBxTFhqjAYET9dzDH06JM+W5W832ucZThlAQx3AFU8ftAgrIQ 0TEekt2y5CAisZ3/OgTuz72CKcZGOCliKhri2+KWI9mItnrZ5Eh3EpxaPdn3zg4/o8xK T6SPcfJOl/r15scSVGv/RCeAhftWUIBnULBvoa8CceGnvk2tojCzbPIqSSpcmDA6y4Zt E4/+HzR52NCNsuSTIfwf3KiuqDQBZgutxKJqJcMrqhFaePkXVpBK8j0k/pXO1VhZOGDs 4EnEqziuCqpt9UxqDoweBRJTDTsl9r4NVmHG07zenplZlKwfPJls2ZSsdAtIUHIizkOO Dvdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aOzgsDoI; 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 ks23si4559440ejb.424.2020.12.28.08.35.34; Mon, 28 Dec 2020 08:35:58 -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=aOzgsDoI; 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 S2634096AbgL1QdY (ORCPT + 99 others); Mon, 28 Dec 2020 11:33:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:60124 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730326AbgL1NEA (ORCPT ); Mon, 28 Dec 2020 08:04:00 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 90E97207C9; Mon, 28 Dec 2020 13:03:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160599; bh=Wdwhs5Y5kdLWDSBFMmEc8WP8wop4/0dX/8rxrLoADWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aOzgsDoIZUJovsN+m2W/K1R2k/fTrQgOA4MEcVvgPrtYOszqqaBag1o/cobv21KUK CoR7qFvWnPGI9lRJ1msxdpsNb6r5PCbmC6pKPoSzWYLQM9951fLqtm8A/BlaTkrvYP Apiz/v1gC4fDy+dJb7z1HqXGyjY8dwz/CGV+5muU= 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.9 105/175] powerpc/pseries/hibernation: drop pseries_suspend_begin() from suspend ops Date: Mon, 28 Dec 2020 13:49:18 +0100 Message-Id: <20201228124858.338904074@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@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 e76aefae2aa2b..0a0e0c8256f67 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