Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1566522iob; Thu, 5 May 2022 04:15:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdGzqCL4tfB6kLtto3TUuNw5AbCBB74NfV1NXHx+TwNvguYDOUsBGTYkBSd1msbP8krAOY X-Received: by 2002:a05:6a00:1352:b0:50d:ecff:f06c with SMTP id k18-20020a056a00135200b0050decfff06cmr18875560pfu.6.1651749313119; Thu, 05 May 2022 04:15:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651749313; cv=none; d=google.com; s=arc-20160816; b=CJOq1kE3f2Y6vRmGAXvpg5Fo8Ma44VmaQitbA9kyl/jQzWKRUs7DpAbpa/VUA4xPpK NuWL04yWZJgP1zjSV50BoUvc3IBfTiMnmoVhOYnukX5lGu4ijLEm7+YCvxOhmb8qiRyd bmy0NSQ/mtQfd5DoqjJTobd4OWs45wUD5ZEbtJ45kYl9fRRrfD4ffPSLMvjUN866ShDG fEWqdo5rUY1GtQjTMzrqp9yO9RO+enFl8yY9lO0fDUc1teyRB4qo2Yg6udNFEzVW2PQb 95vlpfoO/IwYEJQeY6UFU9Jn4UBG6CXMNHfqG9GLf/dyvYDmsnCp6OzES+kGb3e5XPGW zmGg== 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=ffiCw+jVzSDHQyLgPQeDvRbhzr9PcOiX3ohz217IO3Y=; b=iF4qmuuXI+Xfs0wWt4YlRLhbH6IQvoaYJU15xJ9hoNLnOFc1kGIXyUv+Xt4ptu9kpW 9VBk/Q2oHUez8MK2Vp74yd59OmZNQuBmEtjfV+Ki5rbv2AKEU9B5MXQZpvz8rGOc1f0D zC2roDn3FFyJvqTX7grrJNtlxR158uPRIsWcaRsXjHlbyKW4xRVBlckT7qbrbKVRt2nb fnHNl0s+k9SXsoia/L/7AvMGNDZibfF9IBmr7ENqhE+9jJeIDV6X1qA+pfqGnt5rsR5z bTIBun30ZYlu2nepZTxLe5HUDzkpEVsrmtByBl+tiiTT60MVaXB0ewDrP2Szj+wy83Zu u4XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dgCb10JE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pc10-20020a17090b3b8a00b001d2a6056609si6868886pjb.47.2022.05.05.04.14.57; Thu, 05 May 2022 04:15:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dgCb10JE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1357620AbiEDRYu (ORCPT + 99 others); Wed, 4 May 2022 13:24:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355356AbiEDRER (ORCPT ); Wed, 4 May 2022 13:04:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31D3D4ECD0; Wed, 4 May 2022 09:52:59 -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 DC04FB82792; Wed, 4 May 2022 16:52:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 912D3C385A5; Wed, 4 May 2022 16:52:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683171; bh=50t13TWnJkWNJqSYvgR68ZzAcfdUER8rrkJF4QqlJCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dgCb10JE1oABvSPJJld3Zq+/VbLzgWBP71vAfJBhMHE7PIEw1mRojZJGrSVlUCRIJ sBoKhb5fHfvPG8/4mmPH1YIMMMbjoY/zxgZ4DlG1PZSaHB2mR8kThS2JbdUZot9C9I eNQJmnWu4TEdwLpI4RdjX783j40ishixaKJ0ykgk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bhaumik Vasav Bhatt , Manivannan Sadhasivam Subject: [PATCH 5.15 036/177] bus: mhi: host: pci_generic: Flush recovery worker during freeze Date: Wed, 4 May 2022 18:43:49 +0200 Message-Id: <20220504153056.192191908@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=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 c38f83bae4037023827c85e045841d0421f85034 upstream. It is possible that the recovery work might be running while the freeze gets executed (during hibernation etc.,). Currently, we don't powerdown the stack if it is not up but if the recovery work completes after freeze, then the device will be up afterwards. This will not be a sane situation. So let's flush the recovery worker before trying to powerdown the device. Cc: stable@vger.kernel.org Fixes: 5f0c2ee1fe8d ("bus: mhi: pci-generic: Fix hibernation") Reported-by: Bhaumik Vasav Bhatt Reviewed-by: Bhaumik Vasav Bhatt Link: https://lore.kernel.org/r/20220408150039.17297-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 @@ -1020,6 +1020,7 @@ static int __maybe_unused mhi_pci_freeze * the intermediate restore kernel reinitializes MHI device with new * context. */ + flush_work(&mhi_pdev->recovery_work); if (test_and_clear_bit(MHI_PCI_DEV_STARTED, &mhi_pdev->status)) { mhi_power_down(mhi_cntrl, true); mhi_unprepare_after_power_down(mhi_cntrl);