Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp412975ybl; Wed, 29 Jan 2020 02:54:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwTywTGO9mHAibkUD3mabS5yXRhLMEfr3xYr1nzh6mAJ11WjZTaaPV+kNriZ5zilSnG1CPu X-Received: by 2002:aca:514e:: with SMTP id f75mr6194355oib.103.1580295291676; Wed, 29 Jan 2020 02:54:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580295291; cv=none; d=google.com; s=arc-20160816; b=tyshB56aTKd/FZMlWAWAnmLOuqRwirUtPIZRM9sIWxFfYybf5vTkwrXSzkBq/3R3Mv z364qLVsI3rHcVlqPgbhJZZV+FmRlT2YADHaHxlvUJ+nlk1I3NmXdTGiLfPZFNFdJgap 6+64+FzhqI1XAQG6J41ChdBwRAoWRHcZnxE47yc9DvPqqUAoM3r1ZvZfExTiRuZx4lQS dg+0vFoxhNLMaM8SGYNpaYiRCS/aqZK3H3pJVnygKdtHCQX9J96Mm8+BSm60vSORRdYP /xIet3/goh1/WeUP4gfJ2qhLle/iW087DQ7wAoz5fyGwo7cXliczwq++sKCPCkNImnO2 uRUg== 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=ihJg6nDDfiwxmrOIMOxnedl2OexPLbIqUMUcg8QFLQA=; b=Wb/qxYRVUtnSMe0A+iQ8o22VkXtdzTl3WxTsPYQeti1q6DhLgYs7puksafMaioecGK fsgXfr47caujHgUtTu8w2iQ9HC53phnAlGEeLko058RfWcvZpWjafisq0pgd/8fGqrF/ yWANxDsXtzUqFqcTbILZ9S9IaRQneNfiScjHIfAmRjPWIQqzePFn/sdoWVup14kgL8q/ xf1hTZNayAx69pzz+ok9cIBM4vCzbJrtsmx6tkZUxkVMWNFfsLbyDKzGEN4xKGBZlEQW H9/vLm87f7JWUvA/kNAePO4allGxL0aQ9vyEZZPXuCuj5kvLdchOWGPMzYgepFakYyQC dYbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=LIVUqA5r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id d197si793351oig.115.2020.01.29.02.54.39; Wed, 29 Jan 2020 02:54:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=LIVUqA5r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726719AbgA2KxI (ORCPT + 99 others); Wed, 29 Jan 2020 05:53:08 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:41405 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726339AbgA2KxE (ORCPT ); Wed, 29 Jan 2020 05:53:04 -0500 X-UUID: 6dc9189c1cab48e58716733ed2186b3c-20200129 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=ihJg6nDDfiwxmrOIMOxnedl2OexPLbIqUMUcg8QFLQA=; b=LIVUqA5rsg6BwvqJkFRLpEKQS21AfjCybP1q4Z49omySD9eTdninREET9XUR+EBdm1Z73qijaf0e7C98FXLOZxeQghRT+d5vdGq7bigq35gZ4pGPebgvpRv1fwknlrv7QVzSr0o9l0tlVI9ZicWHOYASWkGo/lLMOHjXuzmNqMk=; X-UUID: 6dc9189c1cab48e58716733ed2186b3c-20200129 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 261555422; Wed, 29 Jan 2020 18:52:54 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 29 Jan 2020 18:52:09 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 29 Jan 2020 18:53:00 +0800 From: Stanley Chu To: , , , , , CC: , , , , , , , , , , , Stanley Chu Subject: [PATCH RESEND v3 4/4] scsi: ufs-mediatek: gate ref-clk during Auto-Hibern8 Date: Wed, 29 Jan 2020 18:52:51 +0800 Message-ID: <20200129105251.12466-5-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200129105251.12466-1-stanley.chu@mediatek.com> References: <20200129105251.12466-1-stanley.chu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain 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 SW4gY3VycmVudCBVRlMgZHJpdmVyIGRlc2lnbiwgaGJhLT51aWNfbGlua19zdGF0ZSB3aWxsIG5v dA0KYmUgY2hhbmdlZCBhZnRlciBsaW5rIGVudGVycyBIaWJlcm44IHN0YXRlIGJ5IEF1dG8tSGli ZXJuOCBtZWNoYW5pc20uDQpJbiB0aGlzIGNhc2UsIHJlZmVyZW5jZSBjbG9jayBnYXR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