Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp1269417pxw; Sat, 9 Apr 2022 17:53:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAD9LYy5Wfrp5i8OJiTnC3g+Fnd+M5TAJsz03WkDrRTtosNGN45Ni+1fW+FZQ0PxrkOIKL X-Received: by 2002:a50:9b11:0:b0:419:a8f:580c with SMTP id o17-20020a509b11000000b004190a8f580cmr26401009edi.292.1649551984480; Sat, 09 Apr 2022 17:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649551984; cv=none; d=google.com; s=arc-20160816; b=bJIehoVXjNmqc4WW63lFCmQHyc9ewSAfHJIkvyuOL5V3dA5QcRpMhg9WxrD9GzqhxH Q9mHLN/JQyfvkrN/K9+YYzJrcAXq6ZAmdTScyASL0iFmENNAh03TDwQ0Qe4+hQyrR6S0 LT0Ekayg8SMZpJibsPrRCjPVUeYP6q39MSSjOjfULKpqTba2XeWL0V++Fgm4Zojhv3FO HSBGFRPlqb0fk0RrnqI1mlxJPGQ4sleMnHliQv+W/OjSko9l8fPrJqfbbN6xiM9K6ZcU 3luHMvyBAVvysOZCcpa8XlnpbOERp04+qMmQFJrGD3oozJHYiaLV79gd5XschT+i9pvG 4oVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=bDFhoGDXqePTQJqvGLbZDWo79kAbHgp3RtD3xafy47g=; b=CTb5t2Gu+EwvT/5Vu5ELguFRoSPEe6Q27rN8W70hNUnnnqNYiNdJtxccGc3OGDBViE 8g/D7ry/DyfK+AxoBhjF43ShMhF7y58mXHBjGMLHtUVMYlOekvmOEQjtmo7zB0Wn3oXf yM3/KPxuQGnRFcMBXjmEbmpS9bC/is8oFk9yF/O01cjJfok+WTHnI+UFISVjhHCK1vl9 oRI5c0Dc6eOD9BmaQN+0S7vPBuL7rYpkPudNwow1/GLA0CMqfopzz2C1cArf0rT5sHoo jZUqU0wUAGxh4MtvHrJfk5bPAX1yCtjq4h62a35foDnV4hqtNCGhDwinsBfJ39vjqmtW tncg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=fJNiNC73; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u16-20020aa7d890000000b004191308f7b1si3528648edq.240.2022.04.09.17.52.39; Sat, 09 Apr 2022 17:53:04 -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=@quicinc.com header.s=qcdkim header.b=fJNiNC73; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238742AbiDHSdW (ORCPT + 99 others); Fri, 8 Apr 2022 14:33:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238759AbiDHScj (ORCPT ); Fri, 8 Apr 2022 14:32:39 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 838C512AFF; Fri, 8 Apr 2022 11:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1649442634; x=1680978634; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=bDFhoGDXqePTQJqvGLbZDWo79kAbHgp3RtD3xafy47g=; b=fJNiNC73H+hvQ2qhHUODh4d+iFxIl4+oA+OCBhD7juCVvR8ahZSu2zQT lzwh2q2ruYQM8CZVwmMd9lRsgjIrOMj7fXBjc5tOfNa8B03QA3X1M1Ht3 E0l/4bX8JTeocVSVpTFq4kDU2YF1u+5aaHNedEzIlimPj5NacGDeGbf7h o=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 08 Apr 2022 11:30:31 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2022 11:30:31 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 8 Apr 2022 11:30:30 -0700 Received: from [10.110.71.124] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 8 Apr 2022 11:30:30 -0700 Message-ID: Date: Fri, 8 Apr 2022 11:30:29 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v2] bus: mhi: host: pci_generic: Flush recovery worker during freeze Content-Language: en-US To: Manivannan Sadhasivam , CC: , , , , References: <20220408150039.17297-1-manivannan.sadhasivam@linaro.org> From: Bhaumik Vasav Bhatt In-Reply-To: <20220408150039.17297-1-manivannan.sadhasivam@linaro.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On 4/8/2022 8:00 AM, Manivannan Sadhasivam wrote: > 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 > Signed-off-by: Manivannan Sadhasivam > --- Reviewed-by: Bhaumik Vasav Bhatt > Changes in v2: > > * Switched to flush_work() as the workqueue used is global one. > > drivers/bus/mhi/host/pci_generic.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c > index ef85dbfb3216..541ced27d941 100644 > --- a/drivers/bus/mhi/host/pci_generic.c > +++ b/drivers/bus/mhi/host/pci_generic.c > @@ -1060,6 +1060,7 @@ static int __maybe_unused mhi_pci_freeze(struct device *dev) > * 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);