Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2578663pxb; Tue, 13 Apr 2021 05:30:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5qKxpa/E9/9gJ98batwO59Cq2nbi88bEx3pBVVVwT+Csb7ijQ7gfXRpyKZ2T30iWUEwSz X-Received: by 2002:aa7:c5d0:: with SMTP id h16mr23921959eds.7.1618317039551; Tue, 13 Apr 2021 05:30:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618317039; cv=none; d=google.com; s=arc-20160816; b=Mm2XSkUDyMqOlwEwzGC054zzHo83PdqBJxXRCbUZFgcz1Aw8MRgzqk2B5DSoj2/+hl PeT/N7QCEKx3ei3pBkKfxXihhDdLb7zTPZGHkudtu4BnsWMgOTnRJORXFSRx+DNJpPOx 0OhH747qn5H6ik+ARtA1vcAf/BgfyzdWGhtDVqQFdR1IMsNj9EpSeXvQUBqjgvxBR15d 6mN0X8jdFwz5rnlrLYeZd1D2Drn7TjMJXw9L2hNgH68E3FrdkxfMmW1PPNERV+D7C/j9 v5L3LozFUssktlqksA5ndTvLQ+bTV4d4U7f+7jXFZ0w5MlqBVEN7XN51PpDMsb1iGrnN 1umg== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=IG3yM/hhJgI4HS5wGt30gHoTh2N5TgYAPQd9CFSLGVU=; b=BVjiE6ISWkM+aUdm+XVTNyTDuLmavqkj4yT5auazv1n3D48w0HRHFB0etZdI1uqtfi cNDf7hlmORmAxv9A2CiL/KyehDQrGYsU1mznfOwlKu7to6fNrSBQJOYm3bZVv8Uit6mD S2w5Smhae65uT9vwmbHLcvf6LacCTqo0P1SEoCZcUcD1PLtgQ2/6eBzitWVY12yYr/QX ebzRwbZfjk2QNFdSvprIQ6bGGDmUInrOFO3HO6V4ijcFrSmZUG2hND/n3J5ql9dI82sw +OkzkplPHB7wEBhpgJsGf7UXs7PFLk39qh+622PHWcdSAKNvath4dYzaxC+CHBCFjsah MtSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=i8XHIhZm; 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 gx20si4251966ejc.378.2021.04.13.05.30.12; Tue, 13 Apr 2021 05:30:39 -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=i8XHIhZm; 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 S1344386AbhDMDgY (ORCPT + 99 others); Mon, 12 Apr 2021 23:36:24 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:50610 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S238980AbhDMDgX (ORCPT ); Mon, 12 Apr 2021 23:36:23 -0400 X-UUID: 7f31d8aaacd04ee98be674d7466c8656-20210413 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=IG3yM/hhJgI4HS5wGt30gHoTh2N5TgYAPQd9CFSLGVU=; b=i8XHIhZmfMskkSFm9k2AgslQZBZgOa32QS5qXZZbIvfe6lVKw7IyZ5f9zk8gV5sdQjI3iLdB1xpQICa8w7D1pcQn233o2PRZvRwvCqd5peRnPK6yWQ9k2C0rE1jnvZDTbWClSjZ8IGJFQXB2nHqodVBVPDaIeqa6eEHkev1ue7Q=; X-UUID: 7f31d8aaacd04ee98be674d7466c8656-20210413 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 652302494; Tue, 13 Apr 2021 11:36:00 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 13 Apr 2021 11:35:56 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 13 Apr 2021 11:35:55 +0800 Message-ID: <1618284955.25729.6.camel@mhfsdcap03> Subject: Re: [PATCH 4/6] usb: xhci-mtk: add support runtime PM From: Chunfeng Yun To: Ikjoon Jang CC: Rob Herring , Mathias Nyman , Greg Kroah-Hartman , Matthias Brugger , "Rafael J. Wysocki" , Len Brown , Pavel Machek , , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list , , Tony Lindgren , Tianping Fang , Eddie Hung , Nicolas Boichat Date: Tue, 13 Apr 2021 11:35:55 +0800 In-Reply-To: References: <1617874514-12282-1-git-send-email-chunfeng.yun@mediatek.com> <1617874514-12282-4-git-send-email-chunfeng.yun@mediatek.com> <1617958441.12105.39.camel@mhfsdcap03> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 0F74016DEA0EBF8425D7EB065E277E06D9AF29BCA93A4312D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