Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2586070ybz; Sun, 3 May 2020 04:36:38 -0700 (PDT) X-Google-Smtp-Source: APiQypKL6MTQxvHsTD+4f+6nNBDTgzUxQ0+G6B9Vd0fBm3Q8d4qX7ZhHeaFKRJsYLn9646pKPcbk X-Received: by 2002:a17:906:ca49:: with SMTP id jx9mr10429170ejb.246.1588505798434; Sun, 03 May 2020 04:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588505798; cv=none; d=google.com; s=arc-20160816; b=tM5ezzpK49SPaTAMfXKSxLXRksuvi/MjmQeOO+5M2CfBviiKLFLtKizWrJLQYsCuSt y0CSDvQxBX2GFmLi3syPSNbqxs7OY0j9rNBLVZYUpsSX+FA8cbGGg2r7jouRs29wlpBw bmdecq4yk1RE70jWkyp5mzkZENHISBTDRDyDoh9w+W90wbaiNpGdIiV8QVcex+UieDHV ws2e2w9yutf81hWplCDMnENfEgumHiEffezE3BtuSFGtsrgmHoAJF1E3jDC69WSGU2JP pZDYFKUfqlr83SG99cYaQZsgLs+KPwHD+zAmK5EsNX0F6Qfv1R89B3geLrLUcPsacrBo bdRQ== 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=43njin1vrQcshqccPuO6P0B782ptgqsgZdx0R2qdBjo=; b=Z8jnyysTzcv3jJD+i4WZraRHK2/zS9rYr7zlbV1PGQbqy0LTNtflYHzHWLu43jGNTO JKBcL0G75jWfHqMV+u6uiTZVi+w2Rg7O6ThuLdTPBMSNRqQgMJWUaHNpnwdaKywc3054 Z5QZBQChmuZE2z9dqbrb5L//v6LGqPfg6e80I51UyQ28D/WV6IXT38lNYWAf6MlUIXYn i4g/PviLAJKWStD3Dk1MNBsvEzTHvkrwAf8ysfBzt2VHfjGCR32OgFPKLPWACvWfrVSz 0kUJY0u4pASaAvtZp7OCwAsYxMnOYcd7wGmIZmiVKJzqrifHseuUraB/lb7Elt2Juy2F DvUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=JMj08QqA; 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 h2si5566273edl.564.2020.05.03.04.36.15; Sun, 03 May 2020 04:36:38 -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=JMj08QqA; 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 S1728359AbgECLem (ORCPT + 99 others); Sun, 3 May 2020 07:34:42 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:8374 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727773AbgECLea (ORCPT ); Sun, 3 May 2020 07:34:30 -0400 X-UUID: 03c8f673dc9d4717b58c03b466303e1c-20200503 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=43njin1vrQcshqccPuO6P0B782ptgqsgZdx0R2qdBjo=; b=JMj08QqAGS4hlzrSo7cKD6+GTSLHy15CHAHtHm6sUVZTGXSmIGyY99px8/e2kIuHCEd+2/I5SPZt2C2acP+hiCf/k3RNwTX0P1lEX3S3BRr1lrZU3SRBc32rwcBA1Lp8VUt6Cwi4dMhroTQgP4bsAzTIpaGP5g6M9FsmvYp77zE=; X-UUID: 03c8f673dc9d4717b58c03b466303e1c-20200503 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 548597131; Sun, 03 May 2020 19:34:25 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 3 May 2020 19:34:17 +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; Sun, 3 May 2020 19:34:16 +0800 From: Stanley Chu To: , , , , , CC: , , , , , , , , , , , Stanley Chu Subject: [PATCH v5 6/8] scsi: ufs: add LU Dedicated buffer mode support for WriteBooster Date: Sun, 3 May 2020 19:34:13 +0800 Message-ID: <20200503113415.21034-7-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200503113415.21034-1-stanley.chu@mediatek.com> References: <20200503113415.21034-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 QWNjb3JkaW5nIHRvIFVGUyBzcGVjaWZpY2F0aW9uLCB0aGVyZSBhcmUgdHdvIFdyaXRlQm9vc3Rl ciBtb2RlIG9mDQpvcGVyYXRpb25zOiAiTFUgZGVkaWNhdGVkIGJ1ZmZlciIgbW9kZSBhbmQgInNo YXJlZCBidWZmZXIiIG1vZGUuDQpJbiB0aGUgIkxVIGRlZGljYXRlZCBidWZmZXIiIG1vZGUsIHRo ZSBXcml0ZUJ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