Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp259294pxx; Thu, 29 Oct 2020 01:46:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOLqv39coDgM7vKVxV1ecmbVJzrDuDiyCfxF1SK/gzl0vujgCFYoIWwrj5oqJigb+IVhuY X-Received: by 2002:a17:906:6409:: with SMTP id d9mr2971360ejm.344.1603961182039; Thu, 29 Oct 2020 01:46:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603961182; cv=none; d=google.com; s=arc-20160816; b=bzcagMvrqIL/yiIlw9R2IgRtPYDzAVEguN9g1b9b6PDD8kFvElromyRaIyvWI1n8qF VkV5TdsK+FG7Wj+v0WYGGu/bEvbRSxT/apGnMImMspzNP5YeMP0NKslRGfd30afHGnC/ u7eUWM0BWN529w89lyo2SqmVCP4DVtl7O8SwWiwv8P6ielEljNHCy1jAaEafboPYbl32 cPQYoiDiPFr0trG9Uavs9peXrwCuobeE8wqze8czD/hlOsLHYwmVhSmw0xeko1a6D3qC svv4xJ3WC9NhlGgGbJAJmpYMzlClYujsJTe0Mg1MDhAOrErDvEQOWSNO48vxxwqgRQ09 bE6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ujdVt5VMrFd483ldP8ff6NTFRc237VrH06AfNH0Wzx8=; b=f7ZsuL8hLi9R23E8VuoCL+8e0YRh9fsF99EowE6IWZDvIeL8kihAHGDeRHLpjlPGdg lzxzZebiIfuTbCTaDspXNbEir2RU+ujvXTh7EaqY1D5FRHF5xi+X4x2EaGAzqmghe6Qi u56DLMxGUZYpB35NDSSeOcTiMQO30C7A/NSwfexLmhv4z550DqVDa8OBjLJxmg40TmXm rRzr1QaGKO5AilmQNj6HuBRmyrWt9YfHG7u8Wv3zTkwbFiDY73Qaxrc7lpXYnLge3DMF r9A58+t4a6xj7U1ix5WavE528Js8XpFVZ2GdwvmfzIwsMsPucsbSUEtkrYtnSulAMx/7 2LIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=cB5wv06C; 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 s16si1330678ejy.687.2020.10.29.01.46.00; Thu, 29 Oct 2020 01:46:22 -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=cB5wv06C; 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 S1733164AbgJ2BTS (ORCPT + 99 others); Wed, 28 Oct 2020 21:19:18 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:59127 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730673AbgJ2BRj (ORCPT ); Wed, 28 Oct 2020 21:17:39 -0400 X-UUID: e1df620a5ca445cd8876ff682671fcaf-20201029 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:Message-ID:Date:Subject:CC:To:From; bh=ujdVt5VMrFd483ldP8ff6NTFRc237VrH06AfNH0Wzx8=; b=cB5wv06C6bAjln7t01d6gCkootzuL8rbhKGnJGv6FsFxCShp4IXLUWqRD/o0EMYQgsiAKWKlBni3XSpUWj9R/nEGW7bhRSCXdXRkJHfsuXH7mvqwsULH0jyaNhZzHBifSGMF62NgdEp+Dd+qB50fTbfRh7SM+atExCjNahKLj1c=; X-UUID: e1df620a5ca445cd8876ff682671fcaf-20201029 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 160379466; Thu, 29 Oct 2020 09:17:26 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 29 Oct 2020 09:17:24 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 29 Oct 2020 09:17:23 +0800 From: Irui Wang To: , , , CC: , , , , , , , , , , , , , Subject: [PATCH 1/2] media: mtk-vpu: VPU should be in idle state before system is suspended Date: Thu, 29 Oct 2020 09:17:20 +0800 Message-ID: <20201029011721.6705-1-irui.wang@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VlBVIHNob3VsZCBiZSBpbiBpZGxlIHN0YXRlIGJlZm9yZSBzeXN0ZW0gaXMgc3VzcGVuZGVkDQpv ciBpdCB3aWxsIHdvcmsgYWJub3JtYWxseSBsaWtlIFZQVSBwcm9ncmFtIGNvdW50ZXIgbm90DQpp biBhIGNvcnJlY3QgYWRkcmVzcyBvciBWUFUgcmVzZXQNCg0KU2lnbmVkLW9mZi1ieTogSXJ1aSBX YW5nIDxpcnVpLndhbmdAbWVkaWF0ZWsuY29tPg0KLS0tDQogZHJpdmVycy9tZWRpYS9wbGF0Zm9y bS9tdGstdnB1L210a192cHUuYyB8IDY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