Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4545599ybv; Mon, 17 Feb 2020 01:05:59 -0800 (PST) X-Google-Smtp-Source: APXvYqw1ig8ARIAJqMaZNU7h9TLIVRfCPKPcs2QnxHEV0XV0c7nw071hFtNgAf8vwOtOXtK63OQ8 X-Received: by 2002:a9d:7f11:: with SMTP id j17mr12112856otq.281.1581930359591; Mon, 17 Feb 2020 01:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581930359; cv=none; d=google.com; s=arc-20160816; b=Zk3fYcg4pn0jeT2TVmkWZOJ208mTd+zLO/XGbCjBdDRILp2frPWPYng++1CyUQ1jPl nD9w6uRjdyTaauACSE92sPVXtcFokl7mwsiRPwLJf9xU8jIpRCr3pvbFCC90tgqgaB7C tmxmj62M6YOAhWpEwrKu3L91ORjXeP9XKlMDKWRBrn5Xtre9u/kLdQmLZdzw9qDv+uwR FcLDwcv3cszGaJFTiaQjQ6DnOCVsIYJkPVe5tCTetYfIVV/Pnw3ZtlTyPv3To6Jy0/9n UCKD+AwjX3jvmzJBWNoAlqCA7PTuZ/b2RcDVh50oefbdoJ1ZQ8Ru4dZbrUVnAl90QUln gejQ== 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=I3Oim7gZHvMV9Qef+8S9vRrpbkNgTWn+GySP5pP9Xs4=; b=iCQAt3WElVt4JdRIrEyZ+nzAgpTz5jr4XTLDY/V4Oh5WNaSZWfh1GPKfO6KYB8sGVy 3qW1A7u/3QApjxdWyR9uaw0yySXCEE/TwmpFCC0nITy6MAer9syVAjzLmu10TKSelROe xglb3QH/Aocc9oTvGSqOV+Y2juAO7GAIO63GmOA9RekvudTd55CaJITVGJkjPRffHQqM I9ebLEC5Y9iSLwxIGF3mQ2iV9Bsq9YxIkY7+1tvSdhAluNLgJETqRGphcicwiOeEO1oV Y3N1ESsdtRJuNTXiR4uWT5QcFxHrkYh3Y2dUA82hJb8wyVsJA1w9sXLtt9RzWCCjs8Ar Z5lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="VgOHmY9/"; 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 73si5960439oii.60.2020.02.17.01.05.47; Mon, 17 Feb 2020 01:05:59 -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="VgOHmY9/"; 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 S1728689AbgBQJFi (ORCPT + 99 others); Mon, 17 Feb 2020 04:05:38 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:42498 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728272AbgBQJFi (ORCPT ); Mon, 17 Feb 2020 04:05:38 -0500 X-UUID: 37d5a81288844bd48585cebfe0914bbe-20200217 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=I3Oim7gZHvMV9Qef+8S9vRrpbkNgTWn+GySP5pP9Xs4=; b=VgOHmY9/vyqGbxp3NtNb80kXHOXkz99xqU3Yx4wYe6vrpmytUFPPlDuVT+OzLTWxbSMkBZQcqKUm0uIdJvJLN+Viw0nBTG++rjLZPeCKEEvfwAGFis77uCeKiqiVR406C0iGVj7fLH3R/ndUA86k46me5gS5RFfn7nvNINd8N5M=; X-UUID: 37d5a81288844bd48585cebfe0914bbe-20200217 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 567318527; Mon, 17 Feb 2020 17:05:35 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 17 Feb 2020 17:04:49 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 17 Feb 2020 17:03:36 +0800 From: Bibby Hsieh To: Jassi Brar , Matthias Brugger , Rob Herring , CK HU CC: , , , , , Nicolas Boichat , Dennis-YC Hsieh , Houlong Wei , Bibby Hsieh Subject: [PATCH v1 2/3] mailbox: mediatek: implement flush function Date: Mon, 17 Feb 2020 17:05:31 +0800 Message-ID: <20200217090532.16019-3-bibby.hsieh@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200217090532.16019-1-bibby.hsieh@mediatek.com> References: <20200217090532.16019-1-bibby.hsieh@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 Rm9yIGNsaWVudCBkcml2ZXIgd2hpY2ggbmVlZCB0byByZW9yZ2FuaXplIHRoZSBjb21tYW5kIGJ1 ZmZlciwgaXQgY291bGQNCnVzZSB0aGlzIGZ1bmN0aW9uIHRvIGZsdXNoI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