Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1714048ioo; Mon, 23 May 2022 01:14:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcx8+6tAIf1V5RVZr0b9bSPquOI/wlYzPvlDriF0oTrVHsf+1Yqr4qymnMGFMBlUKoLYNC X-Received: by 2002:a17:90b:3b4c:b0:1e0:3354:5e5d with SMTP id ot12-20020a17090b3b4c00b001e033545e5dmr8341032pjb.239.1653293696515; Mon, 23 May 2022 01:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653293696; cv=none; d=google.com; s=arc-20160816; b=aA7Zj1InCoMvR0X7y2hzFQK296YucKPR/byTrRm4dImvZzbimGadL9ocIUMFlhZeqn zEQijNmYfpiuWj9K9mgh+qfbAGrFK1it9mSLdup7KzX7VvPtwMRaFyXr1g1+hbwZ/pxO 76+IAufaZL+hltGY17C2YKzMtWsIsTGJE27v5fUT7JyyV5KwOWpa407qbm32HYHtZhVx IZYalLgAj6kBYrAjQ15V6g4OlCUBIn0FTeLR2ysApYNxzvrQKhf1pLzvAmzTsrnAbGI0 mPTj7GgW/+cSfkYWdPe3RGhdEmNumsEo+zFfp0OOz7PexeViU+zZMzhBbOJ+kkJ/NwYL SVtg== 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-language :thread-index:content-transfer-encoding:mime-version:message-id:date :subject:in-reply-to:to:from:dkim-signature:dkim-filter; bh=pA/oh00VW5BYtnIAPos+Rl3OXf5h4kl7QqAwkIfF1oA=; b=cB0BNwW2D0siNju73CQr6DvM+M+tx9TzLGFWqvKrYJOzS2y4ZATWGeKF88w9KjkWJn /POgifeXWPa7FBayQMdvLteAGTRetipwRCl/DRWKxd5jtG0P98zIdvPZqAXRj/jiLenL 8SApyGkBnVV4vWR2IioVsz8R4N/BzHmpjRHvXBmOR6tQl98d9V1mhTDWT/mPx+CBgedt Cubwh4wnW6aqPmBlSdO/kVnXXSRP/CLoA1GhZgjYEnJFvBuMybX35H5AD3AQLh3dbfdX FwEl4kGqEMhvdGYvsyoQHo9gQEOGyIxoZRtRpT5j6oYEuZLbQb+e3QPv5FT8al/T7qm/ UpGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="Cz/8O4u3"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 191-20020a6216c8000000b0050822e94cefsi11668819pfw.369.2022.05.23.01.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 01:14:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="Cz/8O4u3"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 65A4D6E8EC; Mon, 23 May 2022 00:09:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229814AbiEWFub (ORCPT + 99 others); Mon, 23 May 2022 01:50:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232298AbiEWFuT (ORCPT ); Mon, 23 May 2022 01:50:19 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA66D2CCB8 for ; Sun, 22 May 2022 22:50:17 -0700 (PDT) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20220523055015epoutp047cf6261b466c406a2732aa55c9fa2b63~xpfZMrxw91227812278epoutp04T for ; Mon, 23 May 2022 05:50:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20220523055015epoutp047cf6261b466c406a2732aa55c9fa2b63~xpfZMrxw91227812278epoutp04T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1653285015; bh=pA/oh00VW5BYtnIAPos+Rl3OXf5h4kl7QqAwkIfF1oA=; h=From:To:In-Reply-To:Subject:Date:References:From; b=Cz/8O4u3/2i6uVnkr3R8kLYex8x9tLropJtwjA255Ledja1ZowHY0Ptolnh4DGPpE ALTsB61ZzKolK86NYRiot9Os267HXFR5Dd9/UOFxv9w3WTcS9d3OyaIWiQXI79Rqcm KUlEszj8v6AmL1ZejcJ1chMhHZMXXMqE+p4hsFD0= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20220523055015epcas2p31401698dcf419c43915aa32487c96d57~xpfYwDQG72228522285epcas2p3-; Mon, 23 May 2022 05:50:15 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.100]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4L65yW5dQwz4x9QZ; Mon, 23 May 2022 05:50:11 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 82.22.09764.1902B826; Mon, 23 May 2022 14:50:09 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20220523055008epcas2p4b3c935a52b6b362f1bd84a8a57949b3e~xpfTH7w_H0414604146epcas2p4w; Mon, 23 May 2022 05:50:08 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220523055008epsmtrp2b1ee6aa9b949dcc80073bcaa5c24124e~xpfTG7zMY2587425874epsmtrp2b; Mon, 23 May 2022 05:50:08 +0000 (GMT) X-AuditID: b6c32a46-79619a8000002624-89-628b20911f9c Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id FA.05.08924.0902B826; Mon, 23 May 2022 14:50:08 +0900 (KST) Received: from KORDO040863 (unknown [10.229.8.56]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220523055008epsmtip2ae963e12a700d380b6eb784abdcad9ed~xpfS-wqnw1425914259epsmtip2M; Mon, 23 May 2022 05:50:08 +0000 (GMT) From: "Hoyoung SEO" To: "'SEO HOYOUNG'" , , In-Reply-To: <20220522171847.66373-1-hy50.seo@samsung.com> Subject: RE: [RESEND PATCH v1] scsi: ufs: Change the shutting_down flag setting position Date: Mon, 23 May 2022 14:50:08 +0900 Message-ID: <221501d86e68$f5e613a0$e1b23ae0$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHYKRR1NoX3jnWOYKYl5kKfNMG5oQK7eI1prRai7gA= Content-Language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCKsWRmVeSWpSXmKPExsWy7bCmqe5Ehe4kgyUTRS1WL37AYnF51xw2 i+7rO9gcmD36tqxi9Pi8SS6AKSrbJiM1MSW1SCE1Lzk/JTMv3VbJOzjeOd7UzMBQ19DSwlxJ IS8xN9VWycUnQNctMwdoh5JCWWJOKVAoILG4WEnfzqYov7QkVSEjv7jEVim1ICWnwLxArzgx t7g0L10vL7XEytDAw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i+7rO9gcmD36tqxi9Pi8SS6AKYrLJiU1J7MstUjfLoEr4/7y62wFr4UqZm5+wtjAeI+/i5GT Q0LAROJO/yTmLkYuDiGBHYwSh2dNZYZISEj8X9zEBGELS9xvOcIKUfSUUaLh80OwIjYBLYnr E9+C2SICORJLFu2HmtTNKLHt6zQWkASngJVEz+FLYJOEBSIkWr53soLYLAKqEs0rN4HV8ApY Siy6ORHKFpQ4OfMJmM0soC3R+7CVEcKWl9j+dg7UdQoSO86+ZoRYbCXxYPoRqBoRidmdbcwT GIVmIRk1C8moWUhGzULSsoCRZRWjZGpBcW56brFhgVFearlecWJucWleul5yfu4mRnDIa2nt YNyz6oPeIUYmDsZDjBIczEoivNsTO5KEeFMSK6tSi/Lji0pzUosPMUpzsCiJ817oOhkvJJCe WJKanZpakFoEk2Xi4JRqYNIOtOlbPcs2zs3t3jdHGR5zptkrlY+2nErhWHxdIv7ItYJLTBH7 de7PriuOuvPQbr1LR9bfp92WJ5UCZ4kpfjtlYOxyKSv9Sd7fa8utOHjNY5gldJrOVYWlf0x1 P9gWlr4/sXCOYVzN1h9/1Uwj6xvk1/87LBM851dndHLu7ZoH/e0T7340fM6eyv7v2o+GNUz3 pj73eHb2k0WxsFOJxMrjR1WqdG9l9pUeOZEQuy93+0GDKe5rpx4+ekTUyoNnj6fkXt2e43Oa NuioNz0+J/hmgREX5zQutdbaKn2X04tYXc40eX+c1sPUyJj6inOfkrzszdKY65pfTglMY7j9 dJXgjceLeq16VvlJnFp4WomlOCPRUIu5qDgRAB/JW2boAgAA X-CMS-MailID: 20220523055008epcas2p4b3c935a52b6b362f1bd84a8a57949b3e X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220523053658epcas2p2400c4c92126baa05d5fb4b5d6ed7e274 References: <20220522171847.66373-1-hy50.seo@samsung.com> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 > -----Original Message----- > From: SEO HOYOUNG [mailto:hy50.seo@samsung.com] > Sent: Monday, May 23, 2022 2:19 AM > To: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; > alim.akhtar@samsung.com; avri.altman@wdc.com; jejb@linux.ibm.com; > martin.petersen@oracle.com; beanhuo@micron.com; asutoshd@codeaurora.org; > cang@codeaurora.org; bvanassche@acm.org; bhoon95.kim@samsung.com; > kwmad.kim@samsung.com > Cc: SEO HOYOUNG > Subject: [RESEND PATCH v1] scsi: ufs: Change the shutting_down flag > setting position > > When System shutdown, will called ufshcd_wl_shutdown(). > Then the shutting_down falg set to 1 at ufshcd_wl_shutdown(). > And send to SSU cmd at ufshcd_wl_shutdown()->__ufshcd_wl_suspend()-> > ufshcd_set_dev_pwr_mode() function. > > If occurred fail during send SSU cmd, > then will called ufshcd_err_handler for recovery. > But already set shutting_down to 1, so ufs driver could not recovery. > Then System wait for SSU cmd to be completed and eventaully it will tak > Hang. > So changed the position where shutting_down is set. > > Signed-off-by: SEO HOYOUNG > --- > drivers/scsi/ufs/ufshcd.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index > 1fb3a8b9b03e..65d47cd5afbe 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -9235,10 +9235,6 @@ static void ufshcd_wl_shutdown(struct device *dev) > > hba = shost_priv(sdev->host); > > - down(&hba->host_sem); > - hba->shutting_down = true; > - up(&hba->host_sem); > - > /* Turn on everything while shutting down */ > ufshcd_rpm_get_sync(hba); > scsi_device_quiesce(sdev); > @@ -9248,6 +9244,10 @@ static void ufshcd_wl_shutdown(struct device *dev) > scsi_device_quiesce(sdev); > } > __ufshcd_wl_suspend(hba, UFS_SHUTDOWN_PM); > + > + down(&hba->host_sem); > + hba->shutting_down = true; > + up(&hba->host_sem); > } > > /** > -- > 2.26.0 Hi, It seems that same patch below this. https://lore.kernel.org/lkml/74cade30-6dde-c5f7-e009-b34423d22c12@intel.com/ I think that will occurred error with called __ufshcd_wl_suspend(). So the hba->shutting_down need to set after call __ufshcd_wl_suspend(). Otherwise, the error_handler cannot operate when an error occurs. Please give opinion. Thanks.