Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1947853iob; Thu, 5 May 2022 11:32:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFZtuvhJq305wYhds613VWDcgkq036gZGERYVR9R86pTrevfY4Fa91Wm17RGGCqB14zsQY X-Received: by 2002:a17:902:a502:b0:15e:c251:b769 with SMTP id s2-20020a170902a50200b0015ec251b769mr11148224plq.115.1651775571454; Thu, 05 May 2022 11:32:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651775571; cv=none; d=google.com; s=arc-20160816; b=ol7iCaKa954obfOp/ZOt3SC4WxwN51/mbIQryqmTmUEAquIZP1plyJTOy+80UrdEul WigoefopN06lVPeOPm6u8TuZFNOBzH9d3RnyebxpomJp/gDt8rLzdL3ZEiTGSZeJe5ot CSFWHEVh+I9mbcUVGtyHb9bVbTNx4gV4byQFV53d5v9ErhwItQ6rpP1gbltmB1x5aC3r 4Py1MP2ZmAlctal4dxPe0spRAvcXRtYKuHZaOaaX6sAD+56FytQcPjs9x667ke50xVLD aY08MYll8Vlcd2Bi/AMaHOQ4DaEwb2rMJOPw3zw54N+bCwKG8gq+vjyN6aS5hGOE2/qJ Yl6Q== 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=h73ZgzafRjO8IhfAf+4qmX8V8cazs5baq3pJnSG8HDo=; b=P4V7NAuhX79B9ygk/tNRuFpjnXY9aH3DEXQIgCkEZDXcJhAAVre7bCTwqylG7cdrpZ gok9iPJ3+y3XfLUNA2nmrjLucOnJIAQTxGlHQe3wH9IuKGBZnuC80fuC7t+9IzyhVMxb DRvFfMWe98CiolZkqpWUx4svX8S03P/JNurbIXrnwI+0z+kpPz9m6DNGCS0NxIXJrpTx Dv1484pgWmX9gpgnf7znvuYNI4gwsgPHtDClBsQoIe5w96drLSNyiueNmbL8FtfGy5Md fLsPVPmLgh+p526vnP3hyxrRffWVX+ERtk7xQMSumPo0ir/Z50khtGxwyagcPb/sKB4f rV6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D9TTw3vb; 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 g11-20020a170902740b00b00153b2d164f9si2424736pll.257.2022.05.05.11.32.34; Thu, 05 May 2022 11:32:51 -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=D9TTw3vb; 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 S1356411AbiEDRhk (ORCPT + 99 others); Wed, 4 May 2022 13:37:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356876AbiEDRJr (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 2406C44747; Wed, 4 May 2022 09:56:15 -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 B6ADBB827A1; Wed, 4 May 2022 16:56:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E75AC385A4; Wed, 4 May 2022 16:56:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683372; bh=z8W341Ff4rmUGeYvixTSXtHcgH7Y0qDlJv67ciz3vJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D9TTw3vbD59G6y9KEer/ON4X3aaNkHwCPf9wgPOqFt/tRhv2G5fE6g+aCpiWZcGWe Ri9AEtO1+frDCfiSBvdIdGGumBliIGWRgzUdA93vyR8rgCMMXtkD34JLMM2oEHufMn MlaCnRhDqQfJ4GwBAFOBbbek1E+IuLF1dys7V5Do= 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.17 043/225] bus: mhi: host: pci_generic: Flush recovery worker during freeze Date: Wed, 4 May 2022 18:44:41 +0200 Message-Id: <20220504153113.980245250@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=-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 @@ -1060,6 +1060,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);