Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp479794pxj; Tue, 18 May 2021 07:39:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx3nhcMfJEm8M98VEDMl1bt7s1M5RlfC/2bPaDZVlHxdAyTWHEAh3ysBva8i34/N/Hvd+F X-Received: by 2002:a17:906:d89:: with SMTP id m9mr6651634eji.191.1621348768570; Tue, 18 May 2021 07:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621348768; cv=none; d=google.com; s=arc-20160816; b=oApitBGAPr//Y5kNScMnYqHYD8zvC6Sr+oi11z2k6pHu343xEzptITCMVrQpT1IlhE b/vVvmtxtE7jFht26oQZVhCIgutRurKX0+7wcLKsJ4y6mCrtxlfc1zYP64zgXFyrjFAH Oio5I1dtouy9fTocJEgJ64T5O6daJ3gZ+ifsCrGJIRT1tsUXMlvlpPDsKWg38NJE++Gt mZRwdI9lCIjHXnXdCLaIvvvLK8P6mfzvtHX+fldKU3QU6zxcxvaTMfyidWGIprkBX71Y bLT+hxxxF6RNUt2MKHc6it37XNT6OUheHy/FHcCSP6McvoS3lkInO1qCaurjb4YdO+dr 92Dw== 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=Sh3AtxDUKMI1I9NxtNpUrteTjou5jYEmDexCyW8vwAc=; b=mpnf+ZVFEzxLe3kzj1Q8FfCG0o44u5+9Uquj9OCOquR7yH9wId2is20DQ1AxdRGbO+ VdlVdKue0d+QYndTrviPBurcjN3I57kvae2RjGXdGswEApNrQ5A8V529ZAheaiNmAV9n AJxjh0r5LYE6shxHh8V/+1XVFZPjx+KOJfyo3PVb3De6W+n4D/t6tlwR/N4lPoeOObCG dqz9hDZQGD/2+ClYH98onttktAOG7ZPiPO7YFigtFoLevICT67kb5d4x3CzMW6AdgLBy uW04L0mgYpM+YXqXaaoK1l7MgQ/am9TslwlHeIYPtscEPCHsmwHsN+lGgy83x5ZKk8Kv jZog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D5XxEy4o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb5si2968603edb.276.2021.05.18.07.39.05; Tue, 18 May 2021 07:39:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D5XxEy4o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S245584AbhEQPs7 (ORCPT + 99 others); Mon, 17 May 2021 11:48:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:55194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244702AbhEQPce (ORCPT ); Mon, 17 May 2021 11:32:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1EA5661CCC; Mon, 17 May 2021 14:38:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262317; bh=mK5r0kOx9y1Xc7P5+IfiO+Zkaf0n4VtedVrTqK0Zg3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D5XxEy4oqLqF//s3E7iV7UtbaPlOFg7uDg/eZ0Eb4NNHLITXWle6rXv9sCjFtL6Mj lbMhCbh/mZ4hmjd0YnJbr6yehZpQySeOukopwQ2a39wZ4SjVHdd+ohYvbZtyZHmLRC cTPCfJrhuKV7i3Jrz15as+DOIJDp+XVQ1BzSMYec= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daejun Park , Can Guo , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.10 142/289] scsi: ufs: core: Cancel rpm_dev_flush_recheck_work during system suspend Date: Mon, 17 May 2021 16:01:07 +0200 Message-Id: <20210517140309.926715838@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Can Guo [ Upstream commit 637822e63b79ee8a729f7ba2645a26cf5a524ee4 ] During ufs system suspend, leaving rpm_dev_flush_recheck_work running or pending is risky because concurrency may happen between system suspend/resume and runtime resume routine. Fix this by cancelling rpm_dev_flush_recheck_work synchronously during system suspend. Link: https://lore.kernel.org/r/1619408921-30426-3-git-send-email-cang@codeaurora.org Fixes: 51dd905bd2f6 ("scsi: ufs: Fix WriteBooster flush during runtime suspend") Reviewed-by: Daejun Park Signed-off-by: Can Guo Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/ufs/ufshcd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index d1900ea31b0d..96f9c81d42b2 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -8819,6 +8819,8 @@ int ufshcd_system_suspend(struct ufs_hba *hba) if (!hba || !hba->is_powered) return 0; + cancel_delayed_work_sync(&hba->rpm_dev_flush_recheck_work); + if ((ufs_get_pm_lvl_to_dev_pwr_mode(hba->spm_lvl) == hba->curr_dev_pwr_mode) && (ufs_get_pm_lvl_to_link_pwr_state(hba->spm_lvl) == -- 2.30.2