Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3809130pxb; Mon, 8 Feb 2021 00:09:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBge2XFb71/jSkyEfj37bhLH5TYDAjQY6g/ynRsYQOCGtduHT0NdnWfILZGgcm/OwEkAgU X-Received: by 2002:a05:6402:50c6:: with SMTP id h6mr15792889edb.117.1612771755477; Mon, 08 Feb 2021 00:09:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612771755; cv=none; d=google.com; s=arc-20160816; b=V+jP2wJpnNmAoo0pRsAl0sGDVf0McX++K7vSWSi9GAzPminP4ZS65HzORbSIqeRMrw OE6HiEMrSNrk2bIbvzyUlIc4nUWBZnGjxXtZ8D9FtVwGrntNffy9PAj3VL+uiVGnNsFY jtCvQBPEau5WtlPnpaA/n+RNu/+7jb6HLqgaNXxYDLqmQdF+wQOy3fXZ8Enh32k6a2Pk wwMBK1TenxKkE0GeIkqyiltrPWuDoT8fiwnOcNFRr4TnbB8fo8vAHcIJQT/jE1P7pZxi zcCzpqfKHqks3fxyqi59QUaZk/BOVXgHePAGMG1fgnypI1g/zZNlfsaBuDG9fX59sVBc 0Fxg== 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=+IQbcwYHHKAKbr2oo3oYjCL3PaagPDjw+o+axqX9N/w=; b=FmpVVWJalfGWGFBOOUWm/1mRXCYUfssPubghQj86F8PQecxzE+czceZTrOl9HWAhhd A7c/KWsvGvYr/53lbY8iujwv02pk7SuwZ5tDNQlqCdzbOG8NsdhpH04aZ+VtruCSrXm8 JBiakyiEZCBrFu5LhSkwCxnmdXedqpGlcX88+dkqXhQYs7wGxVky0oJJDwEMEq2eRzKp K6kjaYUz5U/cp/3wXWrgzmXa9FUE5vZUW/uaNoYqWBeWYjZ3vcXM660w8sc7feIwoCJc 0FEJ/CwD1kozw4ut2g9g4Fiyf87XzV/pttsd6u8hfF3WuR1k2oSJ4RpyxJcy8M3WrTCJ n66A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=tGrpubLs; 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 ly19si9244362ejb.16.2021.02.08.00.08.51; Mon, 08 Feb 2021 00:09:15 -0800 (PST) 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=tGrpubLs; 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 S229771AbhBHIFM (ORCPT + 99 others); Mon, 8 Feb 2021 03:05:12 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:44371 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229590AbhBHIEW (ORCPT ); Mon, 8 Feb 2021 03:04:22 -0500 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20210208080339epoutp0408c1a230a08f4db960f284f4cef6f0f6~htw_e2ZWA2468424684epoutp04V for ; Mon, 8 Feb 2021 08:03:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20210208080339epoutp0408c1a230a08f4db960f284f4cef6f0f6~htw_e2ZWA2468424684epoutp04V DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1612771419; bh=+IQbcwYHHKAKbr2oo3oYjCL3PaagPDjw+o+axqX9N/w=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=tGrpubLslTtJWVydzbRsZcUQzN5Z+pzF1W0NBtJyakxdzSfQD8bDUAyc1bELpecij e4WAtpFbIbcnbs+zD/eemex2utMOPEyro7TcCpESMpsG7RZ0WMoSK1opY+cVu2HONW jLD+26IMnaAgj44j3Z/IRXNqAtqna+3apN27BdlY= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20210208080337epcas2p32404be3d7313909405c470e483d47de6~htw9GbX9e2452724527epcas2p3B; Mon, 8 Feb 2021 08:03:37 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.40.185]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4DYz6v08hvz4x9QG; Mon, 8 Feb 2021 08:03:35 +0000 (GMT) X-AuditID: b6c32a46-777d6a800000dbf8-ab-6020f0566e7e Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id A1.4A.56312.650F0206; Mon, 8 Feb 2021 17:03:34 +0900 (KST) Mime-Version: 1.0 Subject: RE: Re: [PATCH v19 2/3] scsi: ufs: L2P map management for HPB read Reply-To: daejun7.park@samsung.com Sender: Daejun Park From: Daejun Park To: Can Guo , Daejun Park CC: Greg KH , "avri.altman@wdc.com" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "asutoshd@codeaurora.org" , "stanley.chu@mediatek.com" , "huobean@gmail.com" , "bvanassche@acm.org" , ALIM AKHTAR , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Sung-Jun Park , yongmyung lee , Jinyoung CHOI , BoRam Shin , SEUNGUK SHIN X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <5bd43da52369a56f18867fa18efb3020@codeaurora.org> 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: <20210208080333epcms2p59403f0acbc9730c9a605d265836a956d@epcms2p5> Date: Mon, 08 Feb 2021 17:03:33 +0900 X-CMS-MailID: 20210208080333epcms2p59403f0acbc9730c9a605d265836a956d 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+NgFrrBJsWRmVeSWpSXmKPExsWy7bCmuW7YB4UEgw+bWS0ezNvGZrG37QS7 xcufV9ksDt9+x24x7cNPZotP65exWrw8pGmx6kG4RfPi9WwWc842MFn09m9ls1h0YxuTxeVd c9gsuq/vYLNYfvwfk8XtLVwWS7feZLTonL6GxWLRwt0sDsIel694e1zu62Xy2DnrLrvHhEUH GD32z13D7tFycj+Lx8ent1g8+rasYvT4vEnOo/1AN1MAV1SOTUZqYkpqkUJqXnJ+SmZeuq2S d3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7QX0oKZYk5pUChgMTiYiV9O5ui/NKSVIWM /OISW6XUgpScAkPDAr3ixNzi0rx0veT8XCtDAwMjU6DKhJyMc7POsBSc5ah4cn0BewPjY7Yu Rk4OCQETiR9nD7N2MXJxCAnsYJR4eu4JkMPBwSsgKPF3hzBIjbCAt8Sv7iYmEFtIQEli/cVZ 7BBxPYlbD9cwgthsAjoS00/cB4uLCHhKfJ28Gmwms0ADm0TbqeWsEMt4JWa0P2WBsKUlti/f CtbMKWAn8X/eREaIuIbEj2W9zBC2qMTN1W/ZYez3x+ZD1YhItN47C1UjKPHg526ouKTEsd0f mCDseomtd34xghwhIdDDKHF45y2oI/QlrnVsZIF40lfiwiURkDCLgKrE9RN9UCUuEpM+bQKb zywgL7H97RxmkHJmAU2J9bv0QUwJAWWJI7dYYL5q2PibHZ3NLMAn0XH4L1x8x7wnUJepSaz7 uZ5pAqPyLERAz0KyaxbCrgWMzKsYxVILinPTU4uNCoyQ43YTIziJa7ntYJzy9oPeIUYmDsZD jBIczEoivIGdcglCvCmJlVWpRfnxRaU5qcWHGE2BvpzILCWanA/MI3kl8YamRmZmBpamFqZm RhZK4rzFBg/ihQTSE0tSs1NTC1KLYPqYODilGph2GQppzeTfv4Gj+WnZjkbv+x+tti86GNGw fTLnswBne5cVPnuiJrs8nDhhWeWRsIAoDQWe7guzHki6TNcNdTLPeiD+8OR0G56TN2fpVUQv O9vpN3vhk4utSdMm1TV1NCut2PGebWqPcO2ErfXs0j8tPwdsKYzIOdwYr6F+knvLDZGnRdEp QmVyrR/eLQo4I7Ekt0Ni41WLnuzC6JjZaW3WE13v1edVfJuw1rowSaFwc9rdXX9PfV3JUCSo +qI/ck3GD+sO5uvyand1vxzz/x/5fP3mXeZcja/0FrVdkOt5qhI64Rz/v54ZnvsPaW9cLmYj YsWefziPSTt7m4PKu6zVjYWdu9Vab//s0bll36DEUpyRaKjFXFScCADcNu3dawQAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210129052848epcms2p6e5797efd94e6282b76ad9ae6c99e3ab5 References: <5bd43da52369a56f18867fa18efb3020@codeaurora.org> <20210129052848epcms2p6e5797efd94e6282b76ad9ae6c99e3ab5@epcms2p6> <20210129053005epcms2p323338fbb83459d2786fc0ef92701b147@epcms2p3> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -342,13 +1208,14 @@ void ufshpb_suspend(struct ufs_hba *hba) > > struct scsi_device *sdev; > > > > shost_for_each_device(sdev, hba->host) { > > - hpb = sdev->hostdata; > > + hpb = ufshpb_get_hpb_data(sdev); > > if (!hpb) > > continue; > > > > if (ufshpb_get_state(hpb) != HPB_PRESENT) > > continue; > > ufshpb_set_state(hpb, HPB_SUSPEND); > > + ufshpb_cancel_jobs(hpb); > > Here may have a dead lock problem - in the case of runtime suspend, > when ufshpb_suspend() is invoked, all of hba's children scsi devices > are in RPM_SUSPENDED state. When this line tries to cancel a running > map work, i.e. when ufshpb_get_map_req() calls below lines, it will > be stuck at blk_queue_enter(). > > req = blk_get_request(hpb->sdev_ufs_lu->request_queue, > REQ_OP_SCSI_IN, 0); > > Please check block layer power management, and see also commit d55d15a33 > ("scsi: block: Do not accept any requests while suspended"). I am agree with your comment. How about add BLK_MQ_REQ_NOWAIT flag on blk_get_request() to avoid hang? Thanks, Daejun