Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1439544ybj; Fri, 8 May 2020 01:07:00 -0700 (PDT) X-Google-Smtp-Source: APiQypIvwSmCdl7I5gmx2HC0bZ6fGjloRNhDfA6i2ZWi7+GyVOTHT1DYTDHjLO8R02g0UKe2S6xA X-Received: by 2002:a50:f095:: with SMTP id v21mr1119976edl.103.1588925219896; Fri, 08 May 2020 01:06:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588925219; cv=none; d=google.com; s=arc-20160816; b=Q/dSW06HHVFNoZbBsm1M0rHIGmOf7vJGiKiCmja9oTVJ1vwtmEV/9URgPZ/umq/jx5 sSW3EyeAOOyw2+t9bi66HcGYyUzYqhnSA8AxruYSwDBGa8H3XivXcFHthpWQ7HGF+xVR pOQ3bNucAmBWX1paMDD7NtsFyWbezciHtU9VmZA/2exawhtZt/RlYW2kVpHIoooAqe9s wrkDaDRlCoFnammmX+bKhuxRJNffTHk/adPPpK0fMATqPhQGSbktYyixacSD3fAfzzvX P28U0P4OaLPl6V5KpACyjU9V8c4Y218TnBl5gBOTh8N4Ta5vyWncA+a4dU8IfiT6U1Ni iR4g== 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=8Pd0uRm3lQlcsdVh37MBSFoVODy8VZ4HotBEwpmWmFM=; b=g+nVbbU5EkLJaWriVOHWjEk8SFsY7x5qEPrvM+JBI4fZ47V6+K6jFqyz3J2QMOru8k fhQh4NkAKM3M6DbZR0b969UZlWZ6qhnc8G0lOOXLmmG4kjiIDUGI14wyL96ALGMcfGXu yk7go5/eUM3253sZ8pzdsgcthiAvtDm75BGLBYQZuIxT1nrYDAWtrPOGV9r4qJOsLfPZ Tjtz9QuFF+3oG1NU2pXUlYH9FYE2JkMzEeXAD8MB9FmWdteqMJQR2pGssxB9LLCTndnp PrLi96103HdW3Y0cKPOocUfx5QH75p47lSIyfCWwtH3o6tZjOyiMRCnhK419xsgLsRtf JRyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ttwi7d5U; 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 q9si556427edn.501.2020.05.08.01.06.36; Fri, 08 May 2020 01:06:59 -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=ttwi7d5U; 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 S1727841AbgEHIBh (ORCPT + 99 others); Fri, 8 May 2020 04:01:37 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:54699 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727105AbgEHIB2 (ORCPT ); Fri, 8 May 2020 04:01:28 -0400 X-UUID: e5d39010a9434bd28980aa03c86c1df4-20200508 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=8Pd0uRm3lQlcsdVh37MBSFoVODy8VZ4HotBEwpmWmFM=; b=ttwi7d5UOZTxiIsl740EkPKyZqFT+LcOCNVG9z4P2n61XX6AouCkCpMkfeRpaE8RNfpgrilXPxhQiZnX7bwo7gbbqMizpd0cLx02TpvWDzbsjlXm8rygY7VsLvGoENl0BtRCp4mg5vUw0Iv0OfI1aPFPkQJDYNjxwTTCE/ec63w=; X-UUID: e5d39010a9434bd28980aa03c86c1df4-20200508 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 516984954; Fri, 08 May 2020 16:01:20 +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.1497.2; Fri, 8 May 2020 16:01:16 +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.1497.2 via Frontend Transport; Fri, 8 May 2020 16:01:18 +0800 From: Stanley Chu To: , , , , , CC: , , , , , , , , , , , Stanley Chu Subject: [PATCH v8 1/8] scsi: ufs: enable WriteBooster on some pre-3.1 UFS devices Date: Fri, 8 May 2020 16:01:08 +0800 Message-ID: <20200508080115.24233-2-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200508080115.24233-1-stanley.chu@mediatek.com> References: <20200508080115.24233-1-stanley.chu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: E559295C58213B0A7FFFE37A9503FC4EA8DE076ABA9840E6C6460C9D51F303C92000: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 V3JpdGVCb29zdGVyIGZlYXR1cmUgY2FuIGJlIHN1cHBvcnRlZCBieSBzb21lIHByZS0zLjEgVUZT IGRldmljZXMNCmJ5IHVwZ3JhZGluZyBmaXJtd2FyZS4NCg0KVG8gZW5hYmxlIFdyaXRlQm9vc3Rl ciBmZWF0dXJlIGlu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