Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2789960pxa; Mon, 17 Aug 2020 20:17:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmXa9FK6wvYZ6iQNx5H/qwOVHsJSMd4bmkb7aSqxjXAmSpkswl0ph7gW8NPlzhilF45dS2 X-Received: by 2002:a05:6402:22d5:: with SMTP id dm21mr17392804edb.211.1597720620348; Mon, 17 Aug 2020 20:17:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597720620; cv=none; d=google.com; s=arc-20160816; b=08ijVDRPvgjupPyqleILGYG80IlqPQvoDJ1japVwJX8xdbWDjkVUBdijxSsmcxz409 RtH40J9clCtu6zPBrdQpxryw7pEAeay7u/OyKZiS8yz9bLHO9L651+4kGAkReSbEJ4tw pQHBV34wxkSXS2dhKGVOsjaHv011A7s+DZWONR4FxcGdJcZszxhVn+gCRNQo5Ovxa3A+ CvChoSMo5gIKbpQPvMIAj+KiJw5y6FBKiG59eCT4BZzuj5Fm2OLIBQZqF4sTyBYl+QPa YIkajsqDUL7K01p5w7pcDs34AwYVlIDUSMkP1qfHUJXcCWC3cL7zByHSr1YD+HoVXSXp c4Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5yqBFvVmP7SjhOSQr96od3VpcBjEYTPTrY/Nozi0giY=; b=yBWx1ERks/rpUZY1eMl/6ihHdrO1Sn5ibN4XglSARVbqVp/H8UpseYTVBZZpkJETj4 b+gAcaUMgsBMpN8AK2+KHUZg3uRIAZ6olgYr2oHY6UTM72P9bz8P0ZC2xEGslinHrCFd JoRFFfMeICSUFbnA9B/NoGLVE/K55rEUvQJuwoezf/OwAzyHP7C4x9ebYqvmFlEew1rm ZeZDf4nMZINfHlTmNx3M6L7Rn44oWALIe1BfyUmZFiui+R/ukLdq26TvFOF6znATg2dy YEBz5ylQ0J2/hnL9pPALmFQ9UXfx+8riAVFvnnwiTtz7qGlcsmIe5eaiRm3tfvj761Yd rK9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=CV4M+oT9; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si12180731eds.470.2020.08.17.20.16.36; Mon, 17 Aug 2020 20:17:00 -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=@oracle.com header.s=corp-2020-01-29 header.b=CV4M+oT9; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726741AbgHRDNP (ORCPT + 99 others); Mon, 17 Aug 2020 23:13:15 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:57790 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726738AbgHRDNO (ORCPT ); Mon, 17 Aug 2020 23:13:14 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07I38RM6134878; Tue, 18 Aug 2020 03:12:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=5yqBFvVmP7SjhOSQr96od3VpcBjEYTPTrY/Nozi0giY=; b=CV4M+oT9gFZ/4cLx2nRYuV+NF5q6hCIbtSlJ8q6q3Q9ERb1DEUbhsRDdex3LFs1VynU5 FSz5pdOSVxsicyYqPFR3xXO4Q0iueEj3p4qJbThdX+9a75M8579YCKhOPBDuAdUDAm6Y vltGvZFdWlSME9ssHdfc+t4CgthOpHi7xDUkyw8Cz7HR1HCPhrGtui64EtP7EEEZPyts zfEaIAbs1nSIHahA/801pf5uH/V5tF2jqAzu5jx5btIZvEJ5zu5avgyz5vn+r6uXzToB 64YSHjzXNPFSMUA1tWj28j8lxC4Kk1jMRRab+Zv0o/hDrn4vTu8+DVGLHIjdev8uU3oe gg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 32x74r27dx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 18 Aug 2020 03:12:50 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07I37iiN111582; Tue, 18 Aug 2020 03:12:49 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 32xsm1q4xt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Aug 2020 03:12:49 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 07I3CmlQ029865; Tue, 18 Aug 2020 03:12:48 GMT Received: from ca-mkp.ca.oracle.com (/10.156.108.201) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 17 Aug 2020 20:12:48 -0700 From: "Martin K. Petersen" To: linux-scsi@vger.kernel.org, bvanassche@acm.org, avri.altman@wdc.com, jejb@linux.ibm.com, alim.akhtar@samsung.com, Stanley Chu Cc: "Martin K . Petersen" , linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com, chaotian.jing@mediatek.com, peter.wang@mediatek.com, linux-arm-kernel@lists.infradead.org, cc.chou@mediatek.com, kuohong.wang@mediatek.com, andy.teng@mediatek.com, asutoshd@codeaurora.org, cang@codeaurora.org, beanhuo@micron.com, linux-kernel@vger.kernel.org, chun-hung.wu@mediatek.com Subject: Re: [PATCH v3] scsi: ufs: Fix possible infinite loop in ufshcd_hold Date: Mon, 17 Aug 2020 23:12:32 -0400 Message-Id: <159772029325.19587.9193434104087348194.b4-ty@oracle.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200809050734.18740-1-stanley.chu@mediatek.com> References: <20200809050734.18740-1-stanley.chu@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9716 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 malwarescore=0 mlxscore=0 phishscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008180022 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9716 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 mlxlogscore=999 priorityscore=1501 phishscore=0 spamscore=0 mlxscore=0 adultscore=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008180022 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 9 Aug 2020 13:07:34 +0800, Stanley Chu wrote: > In ufshcd_suspend(), after clk-gating is suspended and link is set > as Hibern8 state, ufshcd_hold() is still possibly invoked before > ufshcd_suspend() returns. For example, MediaTek's suspend vops may > issue UIC commands which would call ufshcd_hold() during the command > issuing flow. > > Now if UFSHCD_CAP_HIBERN8_WITH_CLK_GATING capability is enabled, > then ufshcd_hold() may enter infinite loops because there is no > clk-ungating work scheduled or pending. In this case, ufshcd_hold() > shall just bypass, and keep the link as Hibern8 state. Applied to 5.9/scsi-fixes, thanks! [1/1] scsi: ufs: Fix possible infinite loop in ufshcd_hold https://git.kernel.org/mkp/scsi/c/93b6c5db0602 -- Martin K. Petersen Oracle Linux Engineering