Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4683616iob; Sun, 8 May 2022 21:53:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGSY+3NvIYnYZ96ChbdBJ9V3C2z+Olsjvx/Ftw93XOFvu8w0mefoiMkTli2HJ9J4D46foV X-Received: by 2002:a63:8343:0:b0:3c6:b375:9584 with SMTP id h64-20020a638343000000b003c6b3759584mr3678768pge.546.1652072036845; Sun, 08 May 2022 21:53:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652072036; cv=none; d=google.com; s=arc-20160816; b=PRPHa8MNd+BY6yEGabXCjhguL55fbUlQ3GMGG3N2OUxs4vmvjLpMoFpl9aF/nWU8X5 VavEo5eG0mw29f5mf/9R+8PW0rrDrL648/RUt0oEK9QsS9ABAuqUhGmRGAaFld8LEKtZ C61jebWVjbVuNfjQanK6Id+cjlJuTAuOKOR+wyLor8yw1zO2P1vefcIN5p+q51ctsBLG w9hn++2IusJ/JkTly3om0scpkE3E6ZMVpU8oPdA8Vea0wfVBuD15sqmUZLk/6MtnxrN1 NaPQBxH3xDfxMjzPGVTSPfroZzt9TRC+V5brLVIF/2oakeGWMUeIx8J2FonnICGw5hVf vU0Q== 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=Eh1Es/0bsUYzGnoX444OkVNVqjMZVbI86qZ5pnwn+ec=; b=o7CBYZn7ixpqGZ6l4P2ixrjJxHd+kyXcWvXUmzEX8OK8Bj09bZRiRAfk/Y2ClYitLe QNGM84yGscvAMatip9eUe8MLyjSjlWz+0SnvshrnKiexZSqo0X+xNVXyvxDPdC/PaO0J LUMt3WxI8ohG6GZv6B/BHW48Wb6bR4+/dY64rWUzOcxJn9VvVaG2imdo4bua6KxEjUWi GQUa7tbzFBz2ttWu+foD1uwm0zYZ11bMTvYZjH/g2R6ZYwmnZY2cSoaTVUkHTM0LpEwv r7+xp0KbFRBbVSF/pDjkUF8mcibvW1pgSUO52gzIjJnUANgR+uRxThO5IHvtFsG1r5EH tdNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RaJnfb0J; 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 x21-20020a056a00189500b004fa3a8e0039si13278069pfh.240.2022.05.08.21.53.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 21:53:56 -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=RaJnfb0J; 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 9221513480E; Sun, 8 May 2022 21:53:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357682AbiEDRPL (ORCPT + 99 others); Wed, 4 May 2022 13:15:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355295AbiEDREQ (ORCPT ); Wed, 4 May 2022 13:04:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 757874E392; Wed, 4 May 2022 09:52:56 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 47158617BE; Wed, 4 May 2022 16:52:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90CB9C385AA; Wed, 4 May 2022 16:52:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683170; bh=Exter9JfEyqxzaKEQ7kAEKeLUzK+9ANC15n6zUEY+oU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RaJnfb0JP9NWqVfYfkJSwdKP/Ns0L2H1WX3Zyyt4p3YPN4voMN1xvU4F+ofKEFwe7 KeGFsN67rbQoYBbFbKIvfyyiRi0qth5QwaEgTfmhsEAbmwd+4WgspBuWSraCPh2lPu Su9PkL0yFW30BAw6WMO+8Fwp0VitDnX4qZZZR0bw= 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.15 035/177] bus: mhi: host: pci_generic: Add missing poweroff() PM callback Date: Wed, 4 May 2022 18:43:48 +0200 Message-Id: <20220504153056.110873955@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153053.873100034@linuxfoundation.org> References: <20220504153053.873100034@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 @@ -1045,6 +1045,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 };