Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1157720ybk; Thu, 14 May 2020 01:48:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwd6g5ydnTW9jJsuA+TqyAgt8JlvjsPFtycJtZnmHVnT/UZ4BYMPUvviKzw+LjSzvK+KRIi X-Received: by 2002:a50:9eac:: with SMTP id a41mr3076750edf.120.1589446086196; Thu, 14 May 2020 01:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589446086; cv=none; d=google.com; s=arc-20160816; b=SqIwK6v5vTz/NBvucLA5O/oapQtW4ygzQ2AMFLmYrYZiQTrEHfxTWW9G9ZUK80tqyq QgUzftfpO78AvRnF+c+u+BhpzZy42eaJamACoshJF52tJ+bpvjRjWzHDZOxld7WvMgAi EXs+1A7jv1dB6O53Ais0F5hp0JMA5KLhlwx0QVrynycENWTH3bz9yRA7/lXN8T+5MAXy n3WPhgL19GNYT9EOMGfqkHlIinPsmUrnbqU/4rYt4EovECU8HTrDN852Z23MOS01zkh9 qWi5ubrS+PUjWMQ1Ei30yCbe6FlXfoc2bsAqXq+NS2fzhJmN+W9ZSVd/aplbCLpjyicL uBzQ== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=amTnrBYThMWNAzE4kOQNiwnF8Vg1s+F3MbsxdNh/feY=; b=eHzcJmPMSVNN/vRcZB3PNZRnOXG8LbiPopGpsmutBeEfkYWKo10vF5315m/mT15geP P+cg6JxdxbasJpQedPR8t8dy5im8sL0XigcVj7kmwlh/px7eQ1w9ObPo6lWoNf4okfVG Buar6jQdeMJaDi7zNFyGpc5YY2YGoOLP7s8bO51fgsa0HB3pKmmmaLN0qqkqzBT6oxOG RQalpW0ncweMVw9JvzZLeox5U5QgBr2tDFRvGxguKbtJBhsWo8ES5D0w1W85dfUfIVIh 0rCCTJEcZ1ocqwZjEQjy7AB27kbfZiFb7PXMR4lbw7o+jWV642dPQTMD0dpiRywatEB8 +dZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=s128ETBu; 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 bx7si1329328ejc.55.2020.05.14.01.47.42; Thu, 14 May 2020 01:48:06 -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=s128ETBu; 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 S1726037AbgENIqQ (ORCPT + 99 others); Thu, 14 May 2020 04:46:16 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:30495 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725878AbgENIqQ (ORCPT ); Thu, 14 May 2020 04:46:16 -0400 X-UUID: 51b8e2dc7501438591721c3eaf364e1f-20200514 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=amTnrBYThMWNAzE4kOQNiwnF8Vg1s+F3MbsxdNh/feY=; b=s128ETBuz9FD/mVq4JlwleSWyXx6P6KK0+iAcdwMRIbKp9IQn4QZ/2GfzLYj3+28XrHb94cTOBqIw8dmdWMXITLRG8mGdw6qg6ZDBE9NPErWddCGg1EvMERCfsXaiWwgmmlNRzQYxg8ASfJEXxI8nQ6bt7pIDhwfa69j5lZfxfY=; X-UUID: 51b8e2dc7501438591721c3eaf364e1f-20200514 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1686435404; Thu, 14 May 2020 16:46:06 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 14 May 2020 16:46:04 +0800 Received: from [172.21.84.99] (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 14 May 2020 16:46:04 +0800 Message-ID: <1589445965.21630.1.camel@mtksdccf07> Subject: Re: [RESEND PATCH] thermal: mediatek: add suspend/resume callback From: Michael Kao To: Zhang Rui , Daniel Lezcano CC: Eduardo Valentin , Daniel Lezcano , Rob Herring , Mark Rutland , Matthias Brugger , "hsinyi@chromium.org" , "linux-pm@vger.kernel.org" , srv_heupstream , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mediatek@lists.infradead.org" , Louis Yu =?UTF-8?Q?=28=E6=B8=B8=E6=94=BF=E9=8C=95=29?= Date: Thu, 14 May 2020 16:46:05 +0800 In-Reply-To: <20200408090558.12410-2-michael.kao@mediatek.com> References: <20200408090558.12410-1-michael.kao@mediatek.com> <20200408090558.12410-2-michael.kao@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 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 T24gV2VkL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KTsNCj4gKyAgICAgICBtdGtfdGhlcm1hbF9s b2NrX2JhbmsoYmFuayk7DQo+IA0KPiAgICAgICAgIC8qIGJ1cyBjbG9jayA2Nk0gY291bnRpbmcg dW5pdCBpcyAxMiAqIDE1LjE1bnMgKiAyNTYgPSA0Ni41NDB1cyAqLw0KPiAgICAgICAgIHdyaXRl bChURU1QX01PTkNUTDFfUEVSSU9EX1VOSVQoMTIpLCBjb250cm9sbGVyX2Jhc2UgKyBURU1QX01P TkNUTDEpOw0KPiBAQCAtNzQzLDcgKzc1NCw0MyBAQCBzdGF0aWMgdm9pZCBtdGtfdGhlcm1hbF9p bml0X2Jhbmsoc3RydWN0IG10a190aGVybWFsICptdCwgaW50IG51bSwNCj4gICAgICAgICAgICAg ICAgVEVNUF9BRENXUklURUNUUkxfQURDX01VWF9XUklURSwNCj4gICAgICAgICAgICAgICAgY29u dHJvbGxlcl9iYXNlICsgVEVNUF9BRENXUklURUNUUkwpOw0KPiANCj4gLSAgICAgICBtdGtfdGhl cm1hbF9wdXRfYmFuayhiYW5rKTsNCj4gKyAgICAgICBtdGtfdGhlcm1hbF91bmxvY2tfYmFuayhi YW5rKTsNCj4gK30NCj4gKw0KPiArc3RhdGljIGludCBtdGtfdGhlcm1hbF9kaXNhYmxlX3NlbnNp bmcoc3RydWN0IG10a190aGVybWFsICptdCwgaW50IG51bSkNCj4gK3sNCj4gKyAgICAgICBzdHJ1 Y3QgbXRrX3RoZXJtYWxfYmFuayAqYmFuayA9ICZtdC0+YmFua3NbbnVtXTsNCj4gKyAgICAgICB1 MzIgdmFsOw0KPiArICAgICAgIHVuc2lnbmVkIGxvbmcgdGltZW91dDsNCj4gKyAgICAgICB2b2lk IF9faW9tZW0gKmFkZHI7DQo+ICsgICAgICAgaW50IHJldCA9IDA7DQo+ICsNCj4gKyAgICAgICBi YW5rLT5pZCA9IG51bTsNCj4gKyAgICAgICBiYW5rLT5tdCA9IG10Ow0KPiArDQo+ICsgICAgICAg bXRrX3RoZXJtY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VybWFsX3Byb2JlKHN0cnVjdCBwbGF0Zm9ybV9kZXZpY2UgKnBkZXYpDQo+ICAgICAgICAg cmV0ID0gY2xrX3ByZXBhcmVfZW5hYmxlKG10LT5jbGtfYXV4YWRjKTsNCj4gICAgICAgICBpZiAo cmV0KSB7DQo+ICAgICAgICAgICAgICAgICBkZXZfZXJyKCZwZGV2LT5kZXYsICJDYW4ndCBlbmFi bGUgYXV4YWRjIGNsazogJWRcbiIsIHJldCk7DQo+IC0gICAgICAgICAgICAgICByZXR1cm4gcmV0 Ow0KPiArICAgICAgICAgICAgICAgZ290byBlcnJfZGlzYWJsZV9jbGtfYXV4YWRjOw0KPiAgICAg ICAgIH0NCj4gDQo+ICAgICAgICAgcmV0ID0gY2xrX3ByZXBhcmVfZW5hYmxlKG10LT5jbGtfcGVy aV90aGVybSk7DQo+ICAgICAgICAgaWYgKHJldCkgew0KPiAgICAgICAgICAgICAgICAgZGV2X2Vy cigmcGRldi0+ZGV2LCAiQ2FuJ3QgZW5hYmxlIHBlcmkgY2xrOiAlZFxuIiwgcmV0KTsNCj4gLSAg ICAgICAgICAgICAgIGdvdG8gZXJyX2Rpc2FibGVfY2xrX2F1eGFkYzsNCj4gKyAgICAgICAgICAg ICAgIGdvdG8gZXJyX2Rpc2FibGVfY2xrX3BlcmlfdGhlcm07DQo+ICAgICAgICAgfQ0KPiANCj4g ICAgICAgICBmb3IgKGN0cmxfaWQgPSAwOyBjdHJsX2lkIDwgbXQtPmNvbmYtPm51bV9jb250cm9s bGVyIDsgY3RybF9pZCsrKQ0KPiAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG10LT5j b25mLT5udW1fYmFua3M7IGkrKykNCj4gLSAgICAgICAgICAgICAgICAgICAgICAgbXRrX3RoZXJt YWxfaW5pdF9iYW5rKG10LCBpLCBhcG1peGVkX3BoeXNfYmFzZSwNCj4gLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1eGFkY19waHlzX2Jhc2UsIGN0cmxfaWQp Ow0KPiArICAgICAgICAgICAgICAgICAgICAgICBtdGtfdGhlcm1hbF9pbml0X2JhbmsobXQsIGks IG10LT5hcG1peGVkX3BoeXNfYmFzZSwNCj4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIG10LT5hdXhhZGNfcGh5c19iYXNlLCBjdHJsX2lkKTsNCj4gDQo+ICAg ICAgICAgcGxhdGZvcm1fc2V0X2RydmRhdGEocGRldiwgbXQpOw0KPiANCj4gQEAgLTk3OCwxMSAr MTAyNSw4MCBAQCBzdGF0aWMgaW50IG10a190aGVybWFsX3JlbW92ZShzdHJ1Y3QgcGxhdGZvcm1f ZGV2aWNlICpwZGV2KQ0KPiAgICAgICAgIHJldHVybiAwOw0KPiAgfQ0KPiANCj4gK3N0YXRpYyBp bnQgX19tYXliZV91bnVzZWQgbXRrX3RoZXJtYWxfc3VzcGVuZChzdHJ1Y3QgZGV2aWNlICpkZXYp DQo+ICt7DQo+ICsgICAgICAgc3RydWN0IHBsYXRmb3JtX2RldmljZSAqcGRldiA9IHRvX3BsYXRm b3JtX2RldmljZShkZXYpOw0KPiArICAgICAgIHN0cnVjdCBtdGtfdGhlcm1hbCAqbXQgPSBwbGF0 Zm9ybV9nZXRfZHJ2ZGF0YShwZGV2KTsNCj4gKyAgICAgICBpbnQgaSwgcmV0Ow0KPiArDQo+ICsg ICAgICAgZm9yIChpID0gMDsgaSA8IG10LT5jb25mLT5udW1fYmFua3M7IGkrKykgew0KPiArICAg ICAgICAgICAgICAgcmV0ID0gbXRrX3RoZXJtYWxfZGlzYWJsZV9zZW5zaW5nKG10LCBpKTsNCj4g KyAgICAgICAgICAgICAgIGlmIChyZXQpDQo+ICsgICAgICAgICAgICAgICAgICAgICAgIGdvdG8g b3V0Ow0KPiArICAgICAgIH0NCj4gKw0KPiArICAgICAgIC8qIGRpc2FibGUgYnVmZmVyICovDQo+ ICsgICAgICAgd3JpdGVsKHJlYWRsK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iArICAgICAg ICAgICAgICAgZGV2X2VycigmcGRldi0+ZGV2LCAiQ2FuJ3QgZW5hYmxlIGF1eGFkYyBjbGs6ICVk XG4iLCByZXQpOw0KPiArICAgICAgICAgICAgICAgZ290byBlcnJfZGlzYWJsZV9jbGtfYXV4YWRj Ow0KPiArICAgICAgIH0NCj4gKw0KPiArICAgICAgIHJldCA9IGNsa19wcmVwYXJlX2VuYWJsZSht dC0+Y2xrX3BlcmlfdGhlcm0pOw0KPiArICAgICAgIGlmIChyZXQpIHsNCj4gKyAgICAgICAgICAg ICAgIGRldl9lcnIoJnBkZXYtPmRldiwgIkNhbid0IGVuYWJsZSBwZXJpIGNsazogJWRcbiIsIHJl dCk7DQo+ICsgICAgICAgICAgICAgICBnb3RvIGVycl9kaXNhYmxlX2Nsa19wZXJpX3RoZXJtOw0K PiArICAgICAgIH0NCj4gKw0KPiArICAgICAgIGZvciAoY3RybF9pZCA9IDA7IGN0cmxfaWQgPCBt dC0+Y29uZi0+bnVtX2NvbnRyb2xsZXIgOyBjdHJsX2lkKyspDQo+ICsgICAgICAgICAgICAgICBm b3IgKGkgPSAwOyBpIDwgbXQtPmNvbmYtPm51bV9iYW5rczsgaSsrKQ0KPiArICAgICAgICAgICAg ICAgICAgICAgICBtdGtfdGhlcm1hbF9pbml0X2JhbmsobXQsIGksIG10LT5hcG1peGVkX3BoeXNf YmFzZSwNCj4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG10 LT5hdXhhZGNfcGh5c19iYXNlLCBjdHJsX2lkKTsNCj4gKw0KPiArICAgICAgIHJldHVybiAwOw0K PiArDQo+ICtlcnJfZGlzYWJsZV9jbGtfcGVyaV90aGVybToNCj4gKyAgICAgICBjbGtfZGlzYWJs ZV91bnByZXBhcmUobXQtPmNsa19wZXJpX3RoZXJtKTsNCj4gK2Vycl9kaXNhYmxlX2Nsa19hdXhh ZGM6DQo+ICsgICAgICAgY2xrX2Rpc2FibGVfdW5wcmVwYXJlKG10LT5jbGtfYXV4YWRjKTsNCj4g Kw0KPiArICAgICAgIHJldHVybiByZXQ7DQo+ICt9DQo+ICsNCj4gK3N0YXRpYyBTSU1QTEVfREVW X1BNX09QUyhtdGtfdGhlcm1hbF9wbV9vcHMsDQo+ICsgICAgICAgICAgICAgICAgICAgICAgICBt dGtfdGhlcm1hbF9zdXNwZW5kLCBtdGtfdGhlcm1hbF9yZXN1bWUpOw0KPiArDQo+ICBzdGF0aWMg c3RydWN0IHBsYXRmb3JtX2RyaXZlciBtdGtfdGhlcm1hbF9kcml2ZXIgPSB7DQo+ICAgICAgICAg LnByb2JlID0gbXRrX3RoZXJtYWxfcHJvYmUsDQo+ICAgICAgICAgLnJlbW92ZSA9IG10a190aGVy bWFsX3JlbW92ZSwNCj4gICAgICAgICAuZHJpdmVyID0gew0KPiAgICAgICAgICAgICAgICAgLm5h bWUgPSAibXRrLXRoZXJtYWwiLA0KPiArICAgICAgICAgICAgICAgLnBtID0gJm10a190aGVybWFs X3BtX29wcywNCj4gICAgICAgICAgICAgICAgIC5vZl9tYXRjaF90YWJsZSA9IG10a190aGVybWFs X29mX21hdGNoLA0KPiAgICAgICAgIH0sDQo+ICB9Ow0KPiAtLQ0KPiAyLjE4LjANCj4gDQpIaSBE YW5pZWwsDQpKdXN0IGdlbnRseSBwaW5nLiAgICBNYW55IHRoYW5rcy4NCg==