From patchwork Mon Apr 14 05:38:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 28303 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 122D520822 for ; Mon, 14 Apr 2014 05:40:01 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id if11sf26818000vcb.8 for ; Sun, 13 Apr 2014 22:40:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=70wHIIiHwt+lE/5d5uomKl0xik5FsPzPfOSYO8QXHoU=; b=Lm7iYU6OuJedbuncZCkh9HE1dYBSUi/UUKwfNJPNCkcpmyK1sOXAwGLdEGb793XK5V OxGJ5bix39JAIqq3QNlahD2EmS0ycIQfkKbaZqRGeDmp/TpCkY5TXoSvjVFjCedPKxBd 8joz2NjgzZjA17zdqiTv5Kla5ZRv61m2/h4IhGy/hMf5QqORZwEkIEitlRjYihTmeA18 kZRWClWeZ6UB1vPuxVyPXirZg9Lah47Dg2sUVDRVIbWLcqFD2qO3xSYg/2MyhsKn5zoY NcrksdhWeOpphOoHXcoG5LnBqkI3bp6mYA68FeZqGvPBlJFUACr/eY9tUt82sF0CF8w8 69Cw== X-Gm-Message-State: ALoCoQl0n8m4yM0jKqjiG32l3rgC5vE8F9YxgjxBb8QhgkuDKPaEuqFQ3PnxzJi7oLqRt0jD3ACQ X-Received: by 10.236.4.201 with SMTP id 49mr17364611yhj.47.1397454001583; Sun, 13 Apr 2014 22:40:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.33.197 with SMTP id j63ls2514310qgj.4.gmail; Sun, 13 Apr 2014 22:40:01 -0700 (PDT) X-Received: by 10.53.1.69 with SMTP id be5mr542617vdd.27.1397454001474; Sun, 13 Apr 2014 22:40:01 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id ud8si2051554vdc.33.2014.04.13.22.40.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 13 Apr 2014 22:40:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id il7so6797039vcb.4 for ; Sun, 13 Apr 2014 22:40:01 -0700 (PDT) X-Received: by 10.52.175.166 with SMTP id cb6mr28871888vdc.1.1397454001372; Sun, 13 Apr 2014 22:40:01 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp121013vcb; Sun, 13 Apr 2014 22:40:00 -0700 (PDT) X-Received: by 10.68.198.36 with SMTP id iz4mr42331537pbc.109.1397454000458; Sun, 13 Apr 2014 22:40:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pu6si6077632pac.348.2014.04.13.22.39.59; Sun, 13 Apr 2014 22:39:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750905AbaDNFjH (ORCPT + 8 others); Mon, 14 Apr 2014 01:39:07 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:59343 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750731AbaDNFjF (ORCPT ); Mon, 14 Apr 2014 01:39:05 -0400 Received: by mail-pd0-f180.google.com with SMTP id v10so7718664pde.11 for ; Sun, 13 Apr 2014 22:39:04 -0700 (PDT) X-Received: by 10.66.160.34 with SMTP id xh2mr41835437pab.109.1397453944435; Sun, 13 Apr 2014 22:39:04 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id de5sm31283339pbc.66.2014.04.13.22.39.01 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 13 Apr 2014 22:39:03 -0700 (PDT) From: Tushar Behera To: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org Cc: rui.zhang@intel.com, eduardo.valentin@ti.com Subject: [PATCH] thermal: samsung: Only update available threshold limits Date: Mon, 14 Apr 2014 11:08:15 +0530 Message-Id: <1397453895-6688-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: tushar.behera@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Currently the threshold limits are updated in 2 stages, once for all software trigger levels and again for hardware trip point. While updating the software trigger levels, it overwrites the threshold limit for hardware trip point thereby forcing the Exynos core to issue an emergency shutdown. Updating only the required fields in threshold register fixes this issue. Signed-off-by: Tushar Behera Acked-by: Amit Daniel Kachhap --- Based on v3.15-rc1. drivers/thermal/samsung/exynos_tmu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 0d96a51..ffccc89 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -225,6 +225,8 @@ skip_calib_data: trigger_levs++; } + rising_threshold = readl(data->base + reg->threshold_th0); + if (data->soc == SOC_ARCH_EXYNOS4210) { /* Write temperature code for threshold */ threshold_code = temp_to_code(data, pdata->threshold); @@ -249,6 +251,7 @@ skip_calib_data: ret = threshold_code; goto out; } + rising_threshold &= ~(0xff << 8 * i); rising_threshold |= threshold_code << 8 * i; if (pdata->threshold_falling) { threshold_code = temp_to_code(data, @@ -281,6 +284,7 @@ skip_calib_data: } if (i == EXYNOS_MAX_TRIGGER_PER_REG - 1) { /* 1-4 level to be assigned in th0 reg */ + rising_threshold &= ~(0xff << 8 * i); rising_threshold |= threshold_code << 8 * i; writel(rising_threshold, data->base + reg->threshold_th0);