Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp270182ybl; Tue, 28 Jan 2020 23:40:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxi4mA/k9ToJ2lsl+lqQvdr9P6XSt1CEy+xWRzJ6iLKQU4amAIjQKKd3p8eRyGEQN4yHTOU X-Received: by 2002:a9d:811:: with SMTP id 17mr20116282oty.369.1580283625457; Tue, 28 Jan 2020 23:40:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580283625; cv=none; d=google.com; s=arc-20160816; b=srJTzpAULJ3hLl9Rg9u3Lz5d+LbHPo0+cojrrEPkQVxTrL0Mae99oDQRTuZCkwa5d+ 8Di7eRikt1kbLZsfku1bIgETOpbTPPJ+6PU8Bv6uH2x4fJ/kzu3/2+quLerVAnhrD3Mc LFgvx4/X15c2EdBpVV7cXbRInamQntU4Zw4QxKIg/wctOZWZgsjsSGbKdyGNblLbUvTw ZT4xbAU2hg37g8dwHnDFor/bGKvqplM6HLRy3xsIV32YjF03P3x/FH/C2ylrD/1iUXFc NhzrZUlTlIn+CbKxPbZ7W78n+Pm30S7RQFuj1Vxz2/8E6hI/o9yVox6Q0EO0Dqqw1J6F UKBg== 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=Xy2D9jF1z1baHVxYAkUcGFfOU0hc53Z24abQbQNSlKIC5UShsi50rilmTEIHdBeQzo b2mWZgzw8p69EaIaPNsS6rf4slLkQK+5fG2qPdpWfCr7l71+0GTMucaz2vPGZvOLTvzk e0ucxRuvtMeuKyBHiBKQbJKN+7rZkMv+s+2wfR1nZ7FnVP9ZtP6LXLA24qOPvngrcUtQ N9xqwgt7XSmCMh7TFo9XUf5Q32TlzrcDxfBSCPWo/duYiUfkl946d6UKPF2L7rvJuc9A GOCMBe0Pdc4QiHtEqXNIUlYq+m3UbZBi6aRkUOyaHW0uVZaMxVKQQ8g1p1H0ljcdZA+1 TUZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=SCBPwcpc; 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 z1si722211otq.21.2020.01.28.23.40.13; Tue, 28 Jan 2020 23:40:25 -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=SCBPwcpc; 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 S1726330AbgA2HjT (ORCPT + 99 others); Wed, 29 Jan 2020 02:39:19 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:15399 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726245AbgA2HjP (ORCPT ); Wed, 29 Jan 2020 02:39:15 -0500 X-UUID: 10b6da7c35194dc5835daaa543df793e-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=SCBPwcpcolSaFPCrFKTMHaZ7FCb3H6BfW2x1QLm2jwZrEvbQpnlb8zmQgwbVelZSqA2QZE/5kMVdWdFsOV4/Y2jNGHW9nIk+viZ8l/nVevhRvMOx1w1d5wdC4B5PdUztwhs/itRbg2JOu5QTK/pYCbYnu+fDo0RZ7A5VnX/NpnY=; X-UUID: 10b6da7c35194dc5835daaa543df793e-20200129 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1642458441; Wed, 29 Jan 2020 15:39:06 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 29 Jan 2020 15:37:55 +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 15:39:12 +0800 From: Stanley Chu To: , , , , , CC: , , , , , , , , , , , Stanley Chu Subject: [PATCH v3 4/4] scsi: ufs-mediatek: gate ref-clk during Auto-Hibern8 Date: Wed, 29 Jan 2020 15:39:02 +0800 Message-ID: <20200129073902.5786-5-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200129073902.5786-1-stanley.chu@mediatek.com> References: <20200129073902.5786-1-stanley.chu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 93F3D5635F3DD161DD5DA950D7204A42ABF40BAE1E4F29319C737A0899891C622000: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 SW4gY3VycmVudCBVRlMgZHJpdmVyIGRlc2lnbiwgaGJhLT51aWNfbGlua19zdGF0ZSB3aWxsIG5v dA0KYmUgY2hhbmdlZCBhZnRlciBsaW5rIGVudG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