Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1676605ioo; Mon, 23 May 2022 00:00:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3e98tTCGCRjiij+XhsJqLFzv+nyRT62I2V3ipt74POCTc1yzzt9TKlAR/O50+PyX4nX+U X-Received: by 2002:a17:902:eb42:b0:161:faa6:e3ac with SMTP id i2-20020a170902eb4200b00161faa6e3acmr13186806pli.37.1653289242867; Mon, 23 May 2022 00:00:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653289242; cv=none; d=google.com; s=arc-20160816; b=MtlgcUvi+U5JqsAEG32d8ncMEmEBKpk9qNax7sMGIl48cM1O3EWg4TsCU6nnxOVzES r2vNFYjn2sNuf+1zlLX3c5+aiXUxjxe5F9dM24GstoL2a7zwiLN+RTBgHzwzU5w2BPTv 1GE7f4nngtF1qcigsYP+tedhNYI5bima+0XQxmNmpea+4K16Vd9ppcPtdZENMHE9cbuC iA+nuYRdp65dtkAfayDBZMDORSCdYfORkQADukGTdvYLqYp6YpDP/f7Qbo0Ib/zjf48b qW1gdZ+SX8oRLzpkRvWzB+oSoh8g3GYMUNrA4vNQi/Bc/6w3+V/N+jLCckxbMicYdRWN pQLQ== 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:mime-version:message-id:date:subject:cc :to:from:dkim-signature:dkim-filter; bh=nvsl+YDNSD25J27UmI22kYRLW5G9VeRNNKiYPPDwC0g=; b=Sn/MlESM72yp9WJclrVprqnGfoV5iBMlA4xD7TQDqLkkhQX3i6wptxm8wrlwNz/cAf qm1ViCJOD4ER2bHfOD3TBpez2KidIYZA203NCoapNendJeeXjpZqsopybUc/OKqJyxOm i1vK9hNdw4JV3RCet/DSg/UdVeagLa9HBR8ehjBxz1pNxluPtPdA1pS7FRjbO+sF1ydL zJFl13MFXvz0PC+22cjK1PsuuebwFAn2e0C6ciff3MklH02AHuA+5T7x/WaxxnUD7S91 15KvcEqCi296FClK47S0KSgvFdY+v4W9+cBhR3TTsZYw51z3+K3+OqHkSt9z5QU30mCw +t0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=jGsQEFUL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 28-20020a63195c000000b003f5e1e9389fsi9283026pgz.83.2022.05.23.00.00.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:00:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=jGsQEFUL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 C6778AE63; Sun, 22 May 2022 23:25:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350848AbiEWFhQ (ORCPT + 99 others); Mon, 23 May 2022 01:37:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237949AbiEWFhM (ORCPT ); Mon, 23 May 2022 01:37:12 -0400 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CD8621265 for ; Sun, 22 May 2022 22:37:08 -0700 (PDT) Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20220523053704epoutp03630fdb8f3f0bcee6951e34634facc2f8~xpT4v_-fC2233422334epoutp03o for ; Mon, 23 May 2022 05:37:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20220523053704epoutp03630fdb8f3f0bcee6951e34634facc2f8~xpT4v_-fC2233422334epoutp03o DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1653284224; bh=nvsl+YDNSD25J27UmI22kYRLW5G9VeRNNKiYPPDwC0g=; h=From:To:Cc:Subject:Date:References:From; b=jGsQEFULGIUnMTNtxkMq0VN5+axr6WkuYqq0p8RF6V5dSCkiq0rcWkOGauCzlKYSY 7u3SDZ8AWS3/uhVzNkfuVe1F6GNapBI1gFZou0fbO9J62pggb+/t+1wuqKky//hK5z 8aquVq3BtwkEfgFe7o5gDudQGIeF6/fWS38ddOl8= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20220523053703epcas2p419ff7582a3c43c4f092d0bafdec1b0ee~xpT4CoaVE2886028860epcas2p44; Mon, 23 May 2022 05:37:03 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.70]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4L65gK45sHz4x9Pw; Mon, 23 May 2022 05:37:01 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 7B.1E.10028.A7D1B826; Mon, 23 May 2022 14:36:58 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20220523053658epcas2p2400c4c92126baa05d5fb4b5d6ed7e274~xpTyy1Twt0582905829epcas2p2G; Mon, 23 May 2022 05:36:58 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220523053658epsmtrp18475f5df623d61d6f147d76da960c0e3~xpTyx7oVh1003610036epsmtrp1N; Mon, 23 May 2022 05:36:58 +0000 (GMT) X-AuditID: b6c32a47-573ff7000000272c-d1-628b1d7a06a4 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id F0.D3.08924.A7D1B826; Mon, 23 May 2022 14:36:58 +0900 (KST) Received: from rack03.dsn.sec.samsung.com (unknown [10.229.95.126]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220523053658epsmtip28545488884d487133517520ffa5783c9~xpTyl9IDR0665706657epsmtip2Y; Mon, 23 May 2022 05:36:58 +0000 (GMT) From: SEO HOYOUNG 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 Date: Mon, 23 May 2022 02:18:47 +0900 Message-Id: <20220522171847.66373-1-hy50.seo@samsung.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFJsWRmVeSWpSXmKPExsWy7bCmhW6VbHeSwbTLhhYP5m1js9jbdoLd 4uXPq2wWBx92slh8XfqM1WLah5/MFp/WL2O1WL34AYvFohvbmCxubjnKYnF51xw2i+7rO9gs lh//x+TA63H5irfH5b5eJo8Jiw4wenxf38Hm8fHpLRaPvi2rGD0+b5LzaD/QzRTA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b4b5d6ed7e274 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: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DATE_IN_PAST_12_24, 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=no 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 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