Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1179590pxf; Fri, 9 Apr 2021 01:56:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/lGi+eQPsuFJNz2x08pSA6M44WCX5Or1EwffZTtRYTnrEUnl7N7RoLHYeyQF5Z5tF8Fzw X-Received: by 2002:a17:90a:a78c:: with SMTP id f12mr6134356pjq.219.1617958569440; Fri, 09 Apr 2021 01:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617958569; cv=none; d=google.com; s=arc-20160816; b=IM1t8RXGgIY5MrVH0T3ZNP2crXjcSG3fOGaG8wisVuCenS+2mDxa8mHrTkg0Oc82qM hrW/DQ6G1JuNI1+xLRV7tb/XZUPnPIv1+0gMgZMkx3FMAo1CNYyRmGo9oVLst+JtCNw+ ER7VSgYEeqRbaEmVisdafIz5+QabyAyN25+ifnVvOQmOHBJGVQ0F+JwMdViJs3vUCzMu LxmAN9U6uMOJYE4XegnwZ5n+pg4SQnznXVhCHCWDHa55RTSp2770d2tDMUX133Tdo+c+ SwEYZiSzUK5zHZefVS6uJQKcY2+8W3NKiiNv37XIbykzCBbG/USPzk3E81J0bsI+e6Sv oOsA== 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=oviF6B2XHEc0gjJer4+QL5nQMHvwmGBgc6/SotDIrzg=; b=xvVyaxsnm7rcMzHIUiYCJ2F5SYAmpDk6AJaylvve2D8WDe/w/9O0JmvOweXdKUlqdi /Uv1N8H3Db7khfLBmJjusbkFBdmU/+Ggij0Mq8M9owrQ5xRbrdUoWaJrIITXJSniPCGc SE9P7jiNYd9GDvKuvAfiFzxeEx5fWYBefhYQ8gxnoa7Cv1LyHTBmru1spSGbcU9imGNh xs0nC3j14tBWmKboFDAMkNvY+7OKFHb4NW1VzO8RI0UO/mMBrFOkp/MIHf1EIRumyCdN x5BxnAMX7+ZwyzpGb2E4JJXESi0UO4ej1t6S57mtip184HueVYAdu8NvenCtjXjy2PHN f9zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=DXjk3qx4; 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 c73si2233207pfb.228.2021.04.09.01.55.58; Fri, 09 Apr 2021 01:56:09 -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=DXjk3qx4; 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 S232087AbhDIIy0 (ORCPT + 99 others); Fri, 9 Apr 2021 04:54:26 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:19441 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229846AbhDIIyZ (ORCPT ); Fri, 9 Apr 2021 04:54:25 -0400 X-UUID: 0d867fe264a24d65a17a8d44b7d5db87-20210409 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=oviF6B2XHEc0gjJer4+QL5nQMHvwmGBgc6/SotDIrzg=; b=DXjk3qx4zx/5sCDa/YlXDdxO7WFXz6VXWnYwxSSxB/k4a9ZYmBLXeCaa9kO4f3S9A3yZ1szn87Sex5jToDePzLcHhVdtatXMCBWW084848G+wvr7bHdaOKAj7ZnQN4bGQhxMnCoWX2BVR7vaTesmoFMNhs8TvdLoT95XJzhxs2M=; X-UUID: 0d867fe264a24d65a17a8d44b7d5db87-20210409 Received: from mtkcas35.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 1608391862; Fri, 09 Apr 2021 16:54:07 +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; Fri, 9 Apr 2021 16:54:03 +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; Fri, 9 Apr 2021 16:54:01 +0800 Message-ID: <1617958441.12105.39.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: Fri, 9 Apr 2021 16:54:01 +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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 93FCC168EC43BD1B8BF808165D3556FFE042B130743B1DD39B245B43971F16BF2000:8 X-MTK: N Content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JvYmUoc3RydWN0IHBsYXRmb3JtX2RldmljZSAqcGRldikNCj4gPiAgICAgICAg IHN0cnVjdCByZXNvdXJjZSAqcmVzOw0KPiA+ICAgICAgICAgc3RydWN0IHVzYl9oY2QgKmhjZDsN Cj4gPiAgICAgICAgIGludCByZXQgPSAtRU5PREVWOw0KPiA+ICsgICAgICAgaW50IHdha2V1cF9p cnE7DQo+ID4gICAgICAgICBpbnQgaXJxOw0KPiA+DQo+ID4gICAgICAgICBpZiAodXNiX2Rpc2Fi bGVkKCkpDQo+ID4gQEAgLTQ4NSw2ICs0ODYsMjEgQEAgc3RhdGljIGludCB4aGNpX210a19wcm9i ZShzdHJ1Y3QgcGxhdGZvcm1fZGV2aWNlICpwZGV2KQ0KPiA+ICAgICAgICAgaWYgKHJldCkNCj4g PiAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDsNCj4gPg0KPiA+ICsgICAgICAgaXJxID0gcGxh dGZvcm1fZ2V0X2lycV9ieW5hbWVfb3B0aW9uYWwocGRldiwgImhvc3QiKTsNCj4gPiArICAgICAg IGlmIChpcnEgPCAwKSB7DQo+ID4gKyAgICAgICAgICAgICAgIGlmIChpcnEgPT0gLUVQUk9CRV9E RUZFUikNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXJxOw0KPiA+ICsNCj4g PiArICAgICAgICAgICAgICAgLyogZm9yIGJhY2t3YXJkIGNvbXBhdGliaWxpdHkgKi8NCj4gPiAr ICAgICAgICAgICAgICAgaXJxID0gcGxhdGZvcm1fZ2V0X2lycShwZGV2LCAwKTsNCj4gPiArICAg ICAgICAgICAgICAgaWYgKGlycSA8IDApDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgcmV0 dXJuIGlycTsNCj4gPiArICAgICAgIH0NCj4gPiArDQo+ID4gKyAgICAgICB3YWtldXBfaXJxID0g cGxhdGZvcm1fZ2V0X2lycV9ieW5hbWVfb3B0aW9uYWwocGRldiwgIndha2V1cCIpOw0KPiA+ICsg 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oY2lfbXRrX3Byb2JlKHN0cnVjdCBwbGF0Zm9ybV9kZXZp Y2UgKnBkZXYpDQo+ID4gICAgICAgICBpZiAocmV0KQ0KPiA+ICAgICAgICAgICAgICAgICBnb3Rv IGRpc2FibGVfbGRvczsNCj4gPg0KPiA+IC0gICAgICAgaXJxID0gcGxhdGZvcm1fZ2V0X2lycShw ZGV2LCAwKTsNCj4gPiAtICAgICAgIGlmIChpcnEgPCAwKSB7DQo+ID4gLSAgICAgICAgICAgICAg IHJldCA9IGlycTsNCj4gPiAtICAgICAgICAgICAgICAgZ290byBkaXNhYmxlX2NsazsNCj4gPiAt ICAgICAgIH0NCj4gPiAtDQo+ID4gICAgICAgICBoY2QgPSB1c2JfY3JlYXRlX2hjZChkcml2ZXIs IGRldiwgZGV2X25hbWUoZGV2KSk7DQo+ID4gICAgICAgICBpZiAoIWhjZCkgew0KPiA+ICAgICAg ICAgICAgICAgICByZXQgPSAtRU5PTUVNOw0KPiA+IEBAIC01NzksOCArNTkxLDI2IEBAIHN0YXRp YyBpbnQgeGhjaV9tdGtfcHJvYmUoc3RydWN0IHBsYXRmb3JtX2RldmljZSAqcGRldikNCj4gPiAg ICAgICAgIGlmIChyZXQpDQo+ID4gICAgICAgICAgICAgICAgIGdvdG8gZGVhbGxvY191c2IyX2hj ZDsNCj4gPg0KPiA+ICsgICAgICAgaWYgKHdha2V1cF9pcnEgPiAwKSB7DQo+ID4gKyAgICAgICAg ICAgICAgIHJldCA9IGRldl9wbV9zZXRfZGVkaWNhdGVkX3dha2VfaXJxKGRldiwgd2FrZXVwX2ly cSk7DQo+ID4gKyAgICAgICAgICAgICAgIGlmIChyZXQpIHsNCj4gPiArICAgICAgICAgICAgICAg ICAgICAgICBkZXZfZXJyKGRldiwgInNldCB3YWtldXAgaXJxICVkIGZhaWxlZFxuIiwgd2FrZXVw X2lycSk7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgZ290byBkZWFsbG9jX3VzYjNfaGNk Ow0KPiA+ICs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9oY2QgKnhoY2kgPSBoY2RfdG9feGhjaShtdGstPmhjZCk7DQo+ ID4gKyAgICAgICBpbnQgcmV0ID0gMDsNCj4gPiArDQo+ID4gKyAgICAgICBpZiAoeGhjaS0+eGhj X3N0YXRlKQ0KPiA+ICsgICAgICAgICAgICAgICByZXR1cm4gLUVTSFVURE9XTjsNCj4gPiArDQo+ ID4gKyAgICAgICBpZiAoZGV2aWNlX21heV93YWtldXAoZGV2KSkgew0KPiA+ICsgICAgICAgICAg ICAgICByZXQgPSBjaGVja19idXNfc3RhdHVzKHhoY2kpOw0KPiA+ICsgICAgICAgICAgICAgICBp ZiAoIXJldCkNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICByZXQgPSB4aGNpX210a19zdXNw ZW5kKGRldik7DQo+ID4gKyAgICAgICB9DQo+ID4gKw0KPiA+ICsgICAgICAgLyogLUVCVVNZOiBs ZXQgUE0gYXV0b21hdGljYWxseSByZXNjaGVkdWxlIGFub3RoZXIgYXV0b3N1c3BlbmQgKi8NCj4g PiArICAgICAgIHJldHVybiByZXQgPyAtRUJVU1kgOiAwOw0KPiA+ICt9DQo+ID4gKw0KPiA+ICtz dGF0aWMgaW50IF9fbWF5YmVfdW51c2VkIHhoY2lfbXRrX3J1bnRpbWVfcmVzdW1lKHN0cnVjdCBk ZXZpY2UgKmRldikNCj4gPiArew0KPiA+ICsgICAgICAgc3RydWN0IHhoY2lfaGNkX210ayAgKm10 ayA9IGRldl9nZXRfZHJ2ZGF0YShkZXYpOw0KPiA+ICsgICAgICAgc3RydWN0IHhoY2lfaGNkICp4 aGNpID0gaGNkX3RvX3hoY2kobXRrLT5oY2QpOw0KPiA+ICsgICAgICAgaW50IHJldCA9IDA7DQo+ ID4gKw0KPiA+ICsgICAgICAgaWYgKHhoY2ktPnhoY19zdGF0ZSkNCj4gPiArICAgICAgICAgICAg ICAgcmV0dXJuIC1FU0hVVERPV047DQo+ID4gKw0KPiA+ICsgICAgICAgaWYgKGRldmljZV9tYXlf d2Fr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