Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp524101imp; Wed, 20 Feb 2019 04:32:55 -0800 (PST) X-Google-Smtp-Source: AHgI3IYOG7fsNwx8Tsf0Grgavfg94LHBoYx0TIN9SvDWagLdAkQG7kl2CR4QzR642U3FCcKEFAU/ X-Received: by 2002:a17:902:e090:: with SMTP id cb16mr35233454plb.32.1550665974947; Wed, 20 Feb 2019 04:32:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550665974; cv=none; d=google.com; s=arc-20160816; b=oSRyUGjR/yk6AsCsBBUAaZtHCQfAVLM+NqcLBSyx07T1qDNoxxZSl22eHD6DWQc3B4 FIJOeH1p8w7BMPo9JirFjeH/S5Xv1G5DJhzVWgOpH/KiAwasY/g9eIwnDWppnk3/Myqu MqcJjZd5d3NdKSuO5Of98lFkoAxz90VZTuwzmNA7knK6TJ6+XhYV+h4Zymy7JJ7X3clR F7KAc+IByF561qsVppnLaqhsJfyWNjy5am6xk36981RNOlgBi8ndGP+/kuruyeQtgVc+ p1LjEIbsuwwAALlP00usnWdeI1xi7omb2+bimkLdHynoaPX146jbLtG25Rus4Eqk4NmE ZilA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=J8xM9qFRGOsf8uyqm6PA/E5ZTeZs8o60KXjvl6RQc/o=; b=EfbveUeT2g0N7OJbKGzLQx905NhnILloLDdnqN1jf3a97mlVTxz9B9LYeL9v3G6tXX Zba7elpxqaPBPIBmQR6NWLY6ti4ad0HFMW3eFF6nfKmcdszzR9mHJnGZT/fjY7Mjd8y3 gMAk9eVhM9BLa36BJqKfIbUeVRoM0CSACELTdqlE1CLaGo9fTBrFOmfLs+l5LrKM0GUf JMEhFEA1+8Of03K0Uc78xQ9QeSiaXBIB9GlJB2hgBl8Jubor1r+SfMrMWEtjslc5NbRf VUZEi1wJK3KVvvoiyxsFslIW7vKQqIwagaDOyYW77u4+euNMU/mIfmOc4nQ6AMZCJWVp Ac4w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si438429pfj.71.2019.02.20.04.32.39; Wed, 20 Feb 2019 04:32:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727751AbfBTMbq (ORCPT + 99 others); Wed, 20 Feb 2019 07:31:46 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:4670 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727383AbfBTMbn (ORCPT ); Wed, 20 Feb 2019 07:31:43 -0500 X-UUID: 3b63007c39284641bccdd5adcf67e8a5-20190220 X-UUID: 3b63007c39284641bccdd5adcf67e8a5-20190220 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1633328183; Wed, 20 Feb 2019 20:31:37 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 20 Feb 2019 20:31:35 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 20 Feb 2019 20:31:35 +0800 From: To: Zhang Rui , Eduardo Valentin , Daniel Lezcano , Rob Herring , Mark Rutland , Matthias Brugger CC: , , , , , Michael Kao Subject: [PATCH v2,1/7] thermal: mediatek: fix register index error Date: Wed, 20 Feb 2019 20:31:27 +0800 Message-ID: <1550665893-22561-2-git-send-email-michael.kao@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550665893-22561-1-git-send-email-michael.kao@mediatek.com> References: <1550665893-22561-1-git-send-email-michael.kao@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 591575A619FE216BB06779DD3A56371685AB6E05F5185A35D8CEAD0ACAB0B3DA2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Kao The index of msr and adcpnp should match the sensor which belongs to the selected bank in the for loop. Fixes: b7cf0053738c ("thermal: Add Mediatek thermal driver for mt2701.") Signed-off-by: Michael Kao --- drivers/thermal/mtk_thermal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c index 0691f26..f646436 100644 --- a/drivers/thermal/mtk_thermal.c +++ b/drivers/thermal/mtk_thermal.c @@ -431,7 +431,8 @@ static int mtk_thermal_bank_temperature(struct mtk_thermal_bank *bank) u32 raw; for (i = 0; i < conf->bank_data[bank->id].num_sensors; i++) { - raw = readl(mt->thermal_base + conf->msr[i]); + raw = readl(mt->thermal_base + + conf->msr[conf->bank_data[bank->id].sensors[i]]); temp = raw_to_mcelsius(mt, conf->bank_data[bank->id].sensors[i], @@ -568,7 +569,8 @@ static void mtk_thermal_init_bank(struct mtk_thermal *mt, int num, for (i = 0; i < conf->bank_data[num].num_sensors; i++) writel(conf->sensor_mux_values[conf->bank_data[num].sensors[i]], - mt->thermal_base + conf->adcpnp[i]); + mt->thermal_base + + conf->adcpnp[conf->bank_data[num].sensors[i]]); writel((1 << conf->bank_data[num].num_sensors) - 1, mt->thermal_base + TEMP_MONCTL0); -- 1.9.1