Message ID | 20230425031721epcms2p5d4de65616478c967d466626e20c42a3a@epcms2p5 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3151191vqo; Mon, 24 Apr 2023 20:40:56 -0700 (PDT) X-Google-Smtp-Source: AKy350bEVLFicSSILE0VX0px8tAkiq8rKUNSAGlE/NrSDihTxFU1mBEhpOqrV4Ud14PrlyZXdxfx X-Received: by 2002:a05:6a21:33aa:b0:f0:4a5e:b686 with SMTP id yy42-20020a056a2133aa00b000f04a5eb686mr9757458pzb.29.1682394055996; Mon, 24 Apr 2023 20:40:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682394055; cv=none; d=google.com; s=arc-20160816; b=X3AVgj7NfbcQNpTtVcjCqIomm/5o5G5pe6LqUHtohV6M5CUULD97YVOJH1V+vjhwRH FCeFrUWBuKMfOtSE5ygNcADQay8TSflLQqDcFAJxixO9H7YoYNO5bbcvSeInC6Fnkl6v 2cub98+P7JQbWIRXytstEyWeTZ71Wmiw021NsbW7Ti6LvwDJgrt7HDa70CCPWVmpviVS 6Fu+GpV2QLA6D/TO/J0BBMW/ekd3XFDoQ8XUx49U0kO7A3tbUZ0GdFcCUWQTI/wnqsQS Gc/LiM/TW7tylFDTT6vmo2rUZLctzfxaBrjagQoaK5PCPfSb7pQ64v8qyGUKCKU6GhVq 1e4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type :content-transfer-encoding:date:message-id:to:from:sender:reply-to :subject:mime-version:dkim-signature:dkim-filter; bh=LL+GI3W9ZUGQXmaZW3ulzguaUQvF3QNMBbc3SULMfVI=; b=E4Anqa6seOPFaPCP9z2a0YkbzUhnfMnc1cLZwgr2QTFyA4nG0YBW5WaXnQI8VDd0sW EpwXqbUfEOdEJE/itu0oeDd/3d9fYOPWX8YjXqUGzLzZ5rxB1vSBunxCEqRgL/zP5yb6 wUTDT6f5elTaVrkZh2w1KIqeaG+L5WnymsUGvdklbdOjf9eJVfb9r13CmBanPNDcWOAt sTJPkrxQNKVkPm/FGo5DpM4oZRUQl7LWfg5H0lEp5opT/4rtwahHlaSR2cz/CJbahfj5 tRRI6Cu0B523AmtKJuEdahVG9B4zWrVbqTVLe7Sf3+oSyzGbHxibR8WIAkXo8v2lH6NB cbbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="Eg8wnN/J"; 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=samsung.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s8-20020aa78bc8000000b006262bc88219si12265564pfd.160.2023.04.24.20.40.40; Mon, 24 Apr 2023 20:40:55 -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=@samsung.com header.s=mail20170921 header.b="Eg8wnN/J"; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233013AbjDYDR5 (ORCPT <rfc822;fengqi706@gmail.com> + 99 others); Mon, 24 Apr 2023 23:17:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233309AbjDYDRb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 24 Apr 2023 23:17:31 -0400 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3F70AD2A for <linux-kernel@vger.kernel.org>; Mon, 24 Apr 2023 20:17:27 -0700 (PDT) Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20230425031723epoutp03ed7b9cfaec521405f20cb6a47a4893f9~ZDzIAVVeP1415114151epoutp03N for <linux-kernel@vger.kernel.org>; Tue, 25 Apr 2023 03:17:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20230425031723epoutp03ed7b9cfaec521405f20cb6a47a4893f9~ZDzIAVVeP1415114151epoutp03N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1682392643; bh=LL+GI3W9ZUGQXmaZW3ulzguaUQvF3QNMBbc3SULMfVI=; h=Subject:Reply-To:From:To:Date:References:From; b=Eg8wnN/J2i6wJfoAL0DudQu2GHSpeYwByFrETJoYq08B7ZqOav2IkJQVvZvbUx0tq dvJYiCJC5LGttaGIGZrp1XisDv9G/tbOljFn0X0lloy8gedT2xXPqKdZjk2Ubid0Qo eTzW1dN2pF91WRlACs/WrXfmR5dIRz9G9RMHle2g= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20230425031722epcas2p386a22d99c48d6a0d16225bb67b92b73c~ZDzHm6g0g2434324343epcas2p3Z; Tue, 25 Apr 2023 03:17:22 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.92]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4Q56cd73Gtz4x9Px; Tue, 25 Apr 2023 03:17:21 +0000 (GMT) X-AuditID: b6c32a47-e99fd70000002007-c9-644746417835 Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id D1.3A.08199.14647446; Tue, 25 Apr 2023 12:17:21 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH] scsi: ufs: core: Fix IO hang that occurs when BKOPS fails in W-LUN suspend Reply-To: keosung.park@samsung.com Sender: Keoseong Park <keosung.park@samsung.com> From: Keoseong Park <keosung.park@samsung.com> To: ALIM AKHTAR <alim.akhtar@samsung.com>, "avri.altman@wdc.com" <avri.altman@wdc.com>, "bvanassche@acm.org" <bvanassche@acm.org>, "jejb@linux.ibm.com" <jejb@linux.ibm.com>, "martin.petersen@oracle.com" <martin.petersen@oracle.com>, "beanhuo@micron.com" <beanhuo@micron.com>, "stanley.chu@mediatek.com" <stanley.chu@mediatek.com>, "quic_asutoshd@quicinc.com" <quic_asutoshd@quicinc.com>, "adrian.hunter@intel.com" <adrian.hunter@intel.com>, "quic_cang@quicinc.com" <quic_cang@quicinc.com>, "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> X-Priority: 3 X-Content-Kind-Code: NORMAL X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20230425031721epcms2p5d4de65616478c967d466626e20c42a3a@epcms2p5> Date: Tue, 25 Apr 2023 12:17:21 +0900 X-CMS-MailID: 20230425031721epcms2p5d4de65616478c967d466626e20c42a3a Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P X-CPGSPASS: Y X-CPGSPASS: Y X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPJsWRmVeSWpSXmKPExsWy7bCmha6jm3uKwbpzFhYnn6xhs3gwbxub xcufV9ksDj7sZLGY9uEns8XLQ5oWj24/Y7RYdGMbk8XlXXPYLLqv72CzWH78H5PFwo65LBaT rm1gs1i69SajA5/H5SveHov3vGTymLDoAKNHy8n9LB7f13eweXx8eovFY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2Bx+Vy9+Wu5nUbx3QeWTpxbPrm7sy jM6oKbEUZyQaajEXFScCAMfFwUhSBAAA DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230425031721epcms2p5d4de65616478c967d466626e20c42a3a References: <CGME20230425031721epcms2p5d4de65616478c967d466626e20c42a3a@epcms2p5> X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764118029483133857?= X-GMAIL-MSGID: =?utf-8?q?1764118029483133857?= |
Series |
scsi: ufs: core: Fix IO hang that occurs when BKOPS fails in W-LUN suspend
|
|
Commit Message
Keoseong Park
April 25, 2023, 3:17 a.m. UTC
Even when urgent BKOPS fails, the consumer will get stuck in runtime
suspend status. Like commit 1a5665fc8d7a ("scsi: ufs: core: WLUN suspend
SSU/enter hibern8 fail recovery"), trigger the error handler and return
-EBUSY to break the suspend.
Fixes: b294ff3e3449 ("scsi: ufs: core: Enable power management for wlun")
Signed-off-by: Keoseong Park <keosung.park@samsung.com>
---
drivers/ufs/core/ufshcd.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
Comments
> Even when urgent BKOPS fails, the consumer will get stuck in runtime > suspend status. Like commit 1a5665fc8d7a ("scsi: ufs: core: WLUN suspend > SSU/enter hibern8 fail recovery"), trigger the error handler and return > -EBUSY to break the suspend. > > Fixes: b294ff3e3449 ("scsi: ufs: core: Enable power management for wlun") > Signed-off-by: Keoseong Park <keosung.park@samsung.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Thanks, Avri > --- > drivers/ufs/core/ufshcd.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c > index 9434328ba323..24966e9af720 100644 > --- a/drivers/ufs/core/ufshcd.c > +++ b/drivers/ufs/core/ufshcd.c > @@ -9457,8 +9457,16 @@ static int __ufshcd_wl_suspend(struct ufs_hba > *hba, enum ufs_pm_op pm_op) > * that performance might be impacted. > */ > ret = ufshcd_urgent_bkops(hba); > - if (ret) > + if (ret) { > + /* > + * If return err in suspend flow, IO will hang. > + * Trigger error handler and break suspend for > + * error recovery. > + */ > + ufshcd_force_error_recovery(hba); > + ret = -EBUSY; > goto enable_scaling; > + } > } else { > /* make sure that auto bkops is disabled */ > ufshcd_disable_auto_bkops(hba); > -- > 2.17.1
On Tue, 25 Apr 2023 12:17:21 +0900, Keoseong Park wrote: > Even when urgent BKOPS fails, the consumer will get stuck in runtime > suspend status. Like commit 1a5665fc8d7a ("scsi: ufs: core: WLUN suspend > SSU/enter hibern8 fail recovery"), trigger the error handler and return > -EBUSY to break the suspend. > > Applied to 6.4/scsi-fixes, thanks! [1/1] scsi: ufs: core: Fix IO hang that occurs when BKOPS fails in W-LUN suspend https://git.kernel.org/mkp/scsi/c/1a7edd041f2d
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 9434328ba323..24966e9af720 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -9457,8 +9457,16 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) * that performance might be impacted. */ ret = ufshcd_urgent_bkops(hba); - if (ret) + if (ret) { + /* + * If return err in suspend flow, IO will hang. + * Trigger error handler and break suspend for + * error recovery. + */ + ufshcd_force_error_recovery(hba); + ret = -EBUSY; goto enable_scaling; + } } else { /* make sure that auto bkops is disabled */ ufshcd_disable_auto_bkops(hba);