Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1006293ybg; Wed, 29 Jul 2020 03:27:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjrsxW5bv1RcQiQTE0w8chWbIGFXfKeqcF+7d4LwcSxvtGUDAdGFDNZdsdpDpwtP3L+qNw X-Received: by 2002:a50:8749:: with SMTP id 9mr30499455edv.80.1596018448871; Wed, 29 Jul 2020 03:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596018448; cv=none; d=google.com; s=arc-20160816; b=J14UUJpAMxgXx2YFBqojpm6SqUI3GIXxd1nM9naKQs1810fdbSV7OyNaEcf29uBuQo Rlf5oOsNhyGPBaSs1MES20blbtbN3fh8yzr3IbxVKYH+B1N0qDknFD2nkXhYPyrEmbOq 5jqVnEv/Ccloy9/llzNgwnoRFLlvhQ7CKYn8fADFBuSnd3k2riopA2YaZ+zxQR4Ld7jG YowJKGhig8sNrofuWA1FRZlmXlCQSjZwQgH5GbSFQFxMuF0+c0iZa2VV3+IHiq3Jlk9M XRz4EXSS5q42k98jLS3UqTJbe0XJZKt9KjZYQS4jhGEPbAzKSmAoePCMuMq2x25LzcQ4 XUlQ== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=MPTSG+n/0Vm1h1PIQ5D8rTUTLY8/JFmBqw35qwYcLvU=; b=gYyoMljVLp7zwJnqGAPSfc5w1T587rcARRa2EUDrEX1qgIsAbTAvUmcZH5iIl01+nt cEwvXyGIat+J2+3b6sx2yrC/8nD8bPccBs/e+nUTOAfFtYD2pDm/ag68zxmtRSue1BXH 3xsdri4D7shoCI75sDNmXVQblyzY5a1KYyAh6FecCf7mAmgfMkm7AJLiNMTjEIRxxlnI vbRw043K1ZtF7DWNjJB0wXlddeSCw1mWNNe+87GP5DOcq+wOnAYvOL8rLpvy6VJ9O4Dr JZI5/lZK2x9xQH/wkf7y13JR2NnPm+3F0YjqAgzDIG459xNxUIxsTbTz867a0cnIjyT9 YXXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Ht1Tea7i; 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=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v8si797043ejc.311.2020.07.29.03.27.05; Wed, 29 Jul 2020 03:27:28 -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=@mediatek.com header.s=dk header.b=Ht1Tea7i; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726497AbgG2K0W (ORCPT + 99 others); Wed, 29 Jul 2020 06:26:22 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:42699 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726336AbgG2K0V (ORCPT ); Wed, 29 Jul 2020 06:26:21 -0400 X-UUID: 680459401b4f419e828516d7b472f464-20200729 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=MPTSG+n/0Vm1h1PIQ5D8rTUTLY8/JFmBqw35qwYcLvU=; b=Ht1Tea7iLahWge2y/SdW44LdMcFc2GkR+fD57eB8qiyI290WFNy4nA0YuJBAEVjA2mmBPUgAHGQAvhQPx2F+hPVI88vBrtqK5BYGwVOTZe+dy3QLMIudlr1LZqM7EwqAhGCoBj0jBejJQIUSS+l3TQIjxXkevz63ForIRltypes=; X-UUID: 680459401b4f419e828516d7b472f464-20200729 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 946186892; Wed, 29 Jul 2020 18:26:16 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 29 Jul 2020 18:26:12 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 29 Jul 2020 18:26:13 +0800 Message-ID: <1596018374.17247.41.camel@mtkswgap22> Subject: Re: [PATCH v2] scsi: ufs: Fix possible infinite loop in ufshcd_hold From: Stanley Chu To: Can Guo CC: , , , , , , , , , , , , , , , , , Date: Wed, 29 Jul 2020 18:26:14 +0800 In-Reply-To: References: <20200729024037.23105-1-stanley.chu@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-TM-SNTS-SMTP: 5E697B60209E19EE040B75CE5B8A822265815B3269B1B7FDF6F122FDED418EC42000:8 X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SGkgQ2FuLA0KDQpPbiBXZWQsIDIwMjAtMDctMjkgYXQgMTY6NDMgKzA4MDAsIENhbiBHdW8gd3Jv dGU6DQo+IEhpIFN0YW5sZXksDQo+IA0KPiBPbiAyMDIwLTA3LTI5IDEwOjQwLCBTdGFubGV5IENo dSB3cm90ZToNCj4gPiBJbiB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