Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp459189ybl; Tue, 28 Jan 2020 06:18:26 -0800 (PST) X-Google-Smtp-Source: APXvYqw6iMcgKhGedzAhRu/6FQODEWd0L1RyzclDLB3AWdlaj/jFfIl2aSI8xgRcrMIpQUUnnMui X-Received: by 2002:a05:6830:114f:: with SMTP id x15mr16028114otq.291.1580221106270; Tue, 28 Jan 2020 06:18:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580221106; cv=none; d=google.com; s=arc-20160816; b=qRkAmBax/Jwy32pK9Ld14aILVr6NsuP5EGVDlPG2y1UnXTaCYabkb4+ClqO0MA9wZG 4C1gONdKTedPuF/iOxmpNv2qdWRXvQQX5YfGz9eFXC/iMKSjQRiEdJ5k0X44aD5w5yAF 260P3qx87iLh+ZrrXnwQo1v0wtyMQxBLQ/5WeWHTnoYORcBy0JGMl7mx6snnIpncBcAa Q66M6gH1cqa27CGBNw6IXc4dt1vGH9Lerryhxd22eRB5G9DAfwggh98PCtOjarXM4v6D 9tDjpT20y7dIFs/+1KU6fpkUjDzfmdzZLHuwpEf3MVcqu6xz41z2BjLgR3uNOCv3sWt7 n/Ow== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GCFLFdMe9efegUALCVXBejn/cbyAPevj1e2YP6Yap0Q=; b=a2LiY9VlJEJ5mO5wYg/rxpf+RgX9LUu7CQsQrcQDHzaNTZLbvO5Z0C2vihNQVKghxy PkabCQJAU7sUWUVpS5nOq6ogqwryJVTy3ESOZmbsM/fP1VyowFPFDbezO6FsFsW+STi5 BXHQPE8BaK+bEfOTqUuE/Bc1fsByPpigUAAtHTdggpietUZnsXwIqBUUolgIsSah7vL4 CTJExYmsZC0vgfT30vj6vcX4iAmJE81QxTQTnZCjE+PED1/hNz4x90NG/RhxPRlOGdjE 6BMsFInS4JW2vjDNuAv8OwrAMrTU1xw2LPfZo8eeDLNs1TVzy81LdIEiBwCKjz5exWOb 5pnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pck0V33l; 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 v145si4876755oia.68.2020.01.28.06.18.13; Tue, 28 Jan 2020 06:18:26 -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; dkim=pass header.i=@kernel.org header.s=default header.b=pck0V33l; 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 S1730484AbgA1ORP (ORCPT + 99 others); Tue, 28 Jan 2020 09:17:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:40876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730467AbgA1ORN (ORCPT ); Tue, 28 Jan 2020 09:17:13 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E84E72071E; Tue, 28 Jan 2020 14:17:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221032; bh=jBuyLlNp3zAb6ohXoJPeAtctGAMrGd1G7QiBMnwbUIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pck0V33lY9ppxh8xTsTdchLD/ObaAN77OdcRc0Y5itgecyxoz8ShMMnCQxawVR6zj J38zghHMBOplxKTJi8qacg6qpl7WJBUho9dWahor5fvfKcG0YwEIFXpmV9Vg8akKX2 WfGwxEHJgW+zN4QolImOd8kJ6XEyMtVBYgSafV7A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Kao , Eduardo Valentin , Sasha Levin Subject: [PATCH 4.9 060/271] thermal: mediatek: fix register index error Date: Tue, 28 Jan 2020 15:03:29 +0100 Message-Id: <20200128135857.098304444@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Kao [ Upstream commit eb9aecd90d1a39601e91cd08b90d5fee51d321a6 ] 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 Signed-off-by: Eduardo Valentin Signed-off-by: Sasha Levin --- 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 34169c32d4956..ea9558679634b 100644 --- a/drivers/thermal/mtk_thermal.c +++ b/drivers/thermal/mtk_thermal.c @@ -348,7 +348,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], @@ -485,7 +486,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); -- 2.20.1