Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4590378iob; Sun, 8 May 2022 18:27:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ8wv9X6OK5NQt1UeCfS9EM9nLmAZCgCDhDfNStZSWlB2rC7G4RtfF1JqkSz/jry0GZYjj X-Received: by 2002:a17:903:18a:b0:15e:c983:7c2e with SMTP id z10-20020a170903018a00b0015ec9837c2emr13719411plg.29.1652059633123; Sun, 08 May 2022 18:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652059633; cv=none; d=google.com; s=arc-20160816; b=fNgMI4xVK1T+fMw1K7A5sggleArjvESZWJIJu1E/POXNIb9rR95TowAR1tk30pdyVA ziCALxMhP1AoxlHJxRPQaftOt9DNQglRXKLozwsyOz42RWIFlCwAOhn9DG1+IdG5dqCi cnj+CP93CkaDPNez6H9nb5no1hrQpCxUn8lOhOcs/B8P5cwNs471beDBJqFe29h+u/5k mtUjdoZ+Tzk0ORsxDzAkseFicnnMhLmP1eqfsdHK//TpxLpOBYEXegQUetJaYQt9Xary qfjFiDLY3d18NMEmGYCWEz0tMaNG84NHkzgVQV+UpNJOMPudjP8ht/ZEuQ8PD77y2NJK S9xA== 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=2GYTJGg7LRHG6tiTEu3+B5rNnY04RDOO2FmWBeJpK5c=; b=eSpjnHhRBhEwMayMlXDY0Hb6j5J45v+cwklt86zOTD3NHciq7UhTOPkuEYHTr7P34u Z5o63unx5XtCBX+U6Ls5AAJLD4/DCIAqpx5qHPl743RMqZCTuvVJqv+eOU5lDgTVWS3r 9LyYCwCmY2C1NbRxj+hK7Er/SnUZGKPG6jY45+QNQ97XioEe6iHiBrXl7Lr78A8OrbpF dNRcjvENMozp5vZCNlhRGs+gT8UZazvjZgMHcI2IFTzKpbfieM9ixMhqCdhtGFIeL6nC HlFarPzdbwtCtg2GlcertooHpO7fm5pEJ26Ya/6GU5304b2EWq2lZp4HVl4mkki8wU5k dFJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ensa036+; 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 s15-20020a17090ad48f00b001bf35bf24d7si15573533pju.63.2022.05.08.18.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 18:27:13 -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=ensa036+; 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 BF7C315A3B; Sun, 8 May 2022 18:26:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243588AbiEDRhf (ORCPT + 99 others); Wed, 4 May 2022 13:37:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356875AbiEDRJr (ORCPT ); Wed, 4 May 2022 13:09:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECF37443C4; Wed, 4 May 2022 09:56:13 -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 9EBEAB82795; Wed, 4 May 2022 16:56:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46A49C385AA; Wed, 4 May 2022 16:56:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683371; bh=64AJ4qdk/b55bLZ0FpkDpOa0tmr6z4FH7U3T6pElt1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ensa036+atoGZTJviQHo2iM1J12ZYwlz2Ng20RjMEC8li/gJHk8OtjDV6vCatxt+Y FNyEnNoX5OEbniRLLLrjaJpTKAjjksXuuEnCFXLIoAh2PorKzfSeLiMlAOo9LHLY4G PKfrGFsPYunNlrTGVDR8ydoLybOHJejFf6zSIXpg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hemant Kumar , Manivannan Sadhasivam Subject: [PATCH 5.17 042/225] bus: mhi: host: pci_generic: Add missing poweroff() PM callback Date: Wed, 4 May 2022 18:44:40 +0200 Message-Id: <20220504153113.904051485@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153110.096069935@linuxfoundation.org> References: <20220504153110.096069935@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=-2.6 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: Manivannan Sadhasivam commit e64d5fa5044f225ac87d96a7e4be11389999c4c6 upstream. During hibernation process, once thaw() stage completes, the MHI endpoint devices will be in M0 state post recovery. After that, the devices will be powered down so that the system can enter the target sleep state. During this stage, the PCI core will put the devices in D3hot. But this transition is allowed by the MHI spec. The devices can only enter D3hot when it is in M3 state. So for fixing this issue, let's add the poweroff() callback that will get executed before putting the system in target sleep state during hibernation. This callback will power down the device properly so that it could be restored during restore() or thaw() stage. Cc: stable@vger.kernel.org Fixes: 5f0c2ee1fe8d ("bus: mhi: pci-generic: Fix hibernation") Reported-by: Hemant Kumar Suggested-by: Hemant Kumar Link: https://lore.kernel.org/r/20220405125907.5644-1-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Greg Kroah-Hartman --- drivers/bus/mhi/pci_generic.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/bus/mhi/pci_generic.c +++ b/drivers/bus/mhi/pci_generic.c @@ -1085,6 +1085,7 @@ static const struct dev_pm_ops mhi_pci_p .resume = mhi_pci_resume, .freeze = mhi_pci_freeze, .thaw = mhi_pci_restore, + .poweroff = mhi_pci_freeze, .restore = mhi_pci_restore, #endif };