Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4978460pxy; Tue, 27 Apr 2021 17:39:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzma+bLkccBVGlCu+c3vC/PZup9d2KiMRqaEJ6w7Uo6SLrzFbnq+WWpquIIrnmCBy83p1Nr X-Received: by 2002:a17:907:397:: with SMTP id ss23mr8728165ejb.298.1619570373503; Tue, 27 Apr 2021 17:39:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619570373; cv=none; d=google.com; s=arc-20160816; b=uOmYvGKc2l6kPLPm3YBmittGtrlHY/mGESK+1bpIEeuMmPORr2/p/3PW/hoL6WBzUG S0ROyMRHyqTYrEX11YAwX9D6ummH4itMFGvJycBsLUwXfOElfZrre/224UOQ0CW3Axdd JBnqU87wuYbISZyKRKaVdstS07QObm7MLkwXww4NTmH7W6XH7wHnHRR+xIqUTU07K/Rq teCGXI3yNPJ8FnrrgH9RL1DxDOKIDKjMJ7JJ1FSD90vsLFu72E0Tuo+6l0wCQN+iz7y2 W54bwoh/B1F9wR0fop/YekDhESh34C9Jz46ZzqSRXCzO47CB65ngQD2jb2luyu+yy41D RhdQ== 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:in-reply-to:cc:to:from :sender:reply-to:subject:mime-version:dkim-signature:dkim-filter; bh=MyzbAvy2TEp0LhpPA5JdGl6Gnb8RzdSt8fE8YmMeFh0=; b=ytzia4WEHWojWbe96nmIxtlka7Jq27nHmx+060cf8585ZBT6dNPcWRDZv/JXkykDFy gX+ltMzJvhW6yENsCcHNgyQtxaKOPfwnOKSACtLaEhI66XLsL79QU5+UaSmEpQaPUnpI YxdERKDc8uYD19julxXqs3MpiEjlPCO3IseDCVhZ1G/dWaYuDNY+QNYMztDVlA/Gb3Qx 41Mi4xxtEnEKu33xdBuUDHDjRQ+gOjX1nM/7x18afZidNHwOnxKRf0zGtrGT5kSvX+lt 9SF/I2IIinm6CPpjZW+o5j697uCnw7tKvPBmzBMWkKNONYKtnlMzfR9iEo2ZZqo4AIKf N76Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="iOwyY8d/"; 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=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d14si4173361edx.122.2021.04.27.17.39.08; Tue, 27 Apr 2021 17:39:33 -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=@samsung.com header.s=mail20170921 header.b="iOwyY8d/"; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230460AbhD1AiB (ORCPT + 99 others); Tue, 27 Apr 2021 20:38:01 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:16377 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230368AbhD1Ah7 (ORCPT ); Tue, 27 Apr 2021 20:37:59 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20210428003713epoutp010c0b256e3409c5a442026431b62ce02a~53ov4OrLc2542325423epoutp01M for ; Wed, 28 Apr 2021 00:37:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20210428003713epoutp010c0b256e3409c5a442026431b62ce02a~53ov4OrLc2542325423epoutp01M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1619570233; bh=MyzbAvy2TEp0LhpPA5JdGl6Gnb8RzdSt8fE8YmMeFh0=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=iOwyY8d/uIJTI6hdjweUCDhBU0nlNaJ8cjPsxe9L7JFa8yFFxJA9gatxJfjevEdAg fAE0QWJEs6pGgqy8l+g2ynWEORlD+buSuQbv69/sMcMOGmks8PqCij/O8A3cepdkBN jb3yUE4eM77ha2wUXBXKdRWOCpNs15J0h0NP/b+Y= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20210428003712epcas2p329b19bde528f1ec0ed8ae4fbb4313dce~53ou4AsRF3033430334epcas2p3X; Wed, 28 Apr 2021 00:37:12 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.40.183]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4FVKTK6tPzz4x9Q1; Wed, 28 Apr 2021 00:37:09 +0000 (GMT) X-AuditID: b6c32a46-e17ff700000025de-1e-6088ae350fc1 Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 6C.7A.09694.53EA8806; Wed, 28 Apr 2021 09:37:09 +0900 (KST) Mime-Version: 1.0 Subject: RE: RE: [PATCH v32 4/4] scsi: ufs: Add HPB 2.0 support Reply-To: daejun7.park@samsung.com Sender: Daejun Park From: Daejun Park To: Avri Altman , Daejun Park , Greg KH , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "asutoshd@codeaurora.org" , "stanley.chu@mediatek.com" , "cang@codeaurora.org" , "bvanassche@acm.org" , "huobean@gmail.com" , ALIM AKHTAR CC: "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , JinHwan Park , Javier Gonzalez , Sung-Jun Park , Jinyoung CHOI , Dukhyun Kwon , Keoseong Park , Jaemyung Lee , Jieon Seol X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: 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: <20210428003709epcms2p2e183e74e64b388d5feb5dd45396393dc@epcms2p2> Date: Wed, 28 Apr 2021 09:37:09 +0900 X-CMS-MailID: 20210428003709epcms2p2e183e74e64b388d5feb5dd45396393dc Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOJsWRmVeSWpSXmKPExsWy7bCmqa7puo4EgzPNZhYP5m1js9jbdoLd 4uXPq2wW0z78ZLb4tH4Zq8XLQ5oWuw4eZLNY9SDconnxejaLOWcbmCx6+7eyWWw+uIHZ4vGd z+wWi25sY7Lo/9fOYrHts6DF8ZPvGC0u75rDZtF9fQebxfLj/5gslm69yWjROX0Ni4OYx+Ur 3h6X+3qZPHbOusvuMWHRAUaP/XPXsHu0nNzP4vHx6S0Wj74tqxg9Pm+S82g/0M0UwBWVY5OR mpiSWqSQmpecn5KZl26r5B0c7xxvamZgqGtoaWGupJCXmJtqq+TiE6DrlpkD9KaSQlliTilQ KCCxuFhJ386mKL+0JFUhI7+4xFYptSAlp8DQsECvODG3uDQvXS85P9fK0MDAyBSoMiEnY0nn E+aCTu6KuVv2sjYwfmHvYuTkkBAwkXj69gxbFyMXh5DADkaJxqUPgRwODl4BQYm/O4RBTGEB e4kTC8xAyoUElCTWX5wF1iosoCdx6+EaRhCbTUBHYvqJ++wgY0QEfjNLXHw7jRXEYRY4zyyx 50Y7I8QyXokZ7U9ZIGxpie3Lt4LFOQViJT7PeAUV15D4sayXGcIWlbi5+i07jP3+2HyoOSIS rffOQtUISjz4uRsqLilxbPcHJgi7XmLrnV+MIEdICPQwShzeeYsVIqEvca1jI9gyXgFfie7e BjCbRUBV4vbjiewgH0sIuEjs+1gIEmYWkJfY/nYOM0iYWUBTYv0ufYgKZYkjt1hgvmrY+Jsd nc0swCfRcfgvXHzHvCdQl6lJrPu5nmkCo/IsREDPQrJrFsKuBYzMqxjFUguKc9NTi40KjJDj dhMjOMVrue1gnPL2g94hRiYOxkOMEhzMSiK8bLtaE4R4UxIrq1KL8uOLSnNSiw8xmgI9OZFZ SjQ5H5hl8kriDU2NzMwMLE0tTM2MLJTEeX+m1iUICaQnlqRmp6YWpBbB9DFxcEo1MG3UcOB6 fqTxyi+LrUqPHu6wu/a+Y1OL4VJxu6UPzh8qUDtmk3zDc0lw7LlDStxGH3fv9qk4f39TnYj5 ipM8T148i1g6+UBywc1JKc2Ls5/9XmygmP41pSTjOseWzuCntau8eoOc+1/WB2orKC8NOOe1 g99GVMejsXrnTLaNDuwueyYXfDxx6NLGBFYFFtGgDtVZjrc0F5pqRNSrWi+w0pOOPCu+YrtT p5VE1sruNYxXLFeFc8utMTt/kPcb541TgdPe9p4JfNgd+JfT5NATz5VJmf84Z5dvnScwuSFT Za5yfMfqWIMn51PcnlysOvX8esa5yfysIhyaWfOVWr/7PWvz7frAd7jqZ0TluQW72pVYijMS DbWYi4oTAaDebnJ6BAAA DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210331011526epcms2p37684869a9781d1eb45bfcbfe9babd217 References: <20210331011526epcms2p37684869a9781d1eb45bfcbfe9babd217@epcms2p3> <20210331011839epcms2p45d3d059fcd9e85a548014a79c3f388bc@epcms2p4> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Avri, >> @@ -1653,6 +2148,7 @@ void ufshpb_destroy_lu(struct ufs_hba *hba, struct >> scsi_device *sdev) >> >> ufshpb_cancel_jobs(hpb); >> >> + ufshpb_pre_req_mempool_destroy(hpb); >> ufshpb_destroy_region_tbl(hpb); >> >> kmem_cache_destroy(hpb->map_req_cache); >> @@ -1692,6 +2188,7 @@ static void ufshpb_hpb_lu_prepared(struct ufs_hba >> *hba) >> ufshpb_set_state(hpb, HPB_PRESENT); >> if ((hpb->lu_pinned_end - hpb->lu_pinned_start) > 0) >> queue_work(ufshpb_wq, &hpb->map_work); >> + ufshpb_issue_umap_all_req(hpb); >> } else { >> dev_err(hba->dev, "destroy HPB lu %d\n", hpb->lun); >> ufshpb_destroy_lu(hba, sdev); >Here in lu_prepare, ufshpb_remove can be called without destroy_lu, >and while there are jobs running. If init_success is false, ufshpb_destroy_lu and ufshpb_remove are called. If init_success is true, ufshpb_destroy_lu and ufshpb_remove are not called in this function. So I think it is not problem. Thanks, Daejun >How about calling destroy_lu as part of ufshpb_remove? >Calling it again when __scsi_remove_device, hostdata is already null so it won't matter. > >Again, only after we know where all this is going to. > >Thanks, >Avri > > >