From patchwork Mon Sep 4 19:56:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 111606 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp1935259qge; Mon, 4 Sep 2017 12:57:51 -0700 (PDT) X-Received: by 10.84.211.46 with SMTP id b43mr1766395pli.161.1504555071357; Mon, 04 Sep 2017 12:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504555071; cv=none; d=google.com; s=arc-20160816; b=nJKpCxSiT8c9uRTK2hCsyltjOuY3j+8+/7NQp9meOAVGXW1ceReqqgTLQ7Er2dc7Bb 8CFlufH2014m0Q/OFx6+XpKlJhKXeDxeb44Q9qGotxZmB7Oq7iYWocD0PhI5dmjRKw9n edI/cYXrLHub3Vn4al4H0ds9VHRk4M5J3rxcccIQuPYLD6rJ/mU6FjsBjrdiXT7U+hFn tij/vJU7rM0Pno7u9oJrRQtPlZ5Hjdg4hMPB0DX52rwTFQf3h7ZGlZar1v10fo1OZ5hl m7HLTjOmOJShG68lNNK8UPevELMGxSTUrUOzg4jCrgxOrGlpFLUe13ueZHaORosqutNd h5Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=hu9AHyaZ046I9ZgSTrpmNxghB1bERyxm+xqdqK7QvI8=; b=rmV/g++YwqFZKTd04WWGtxVflol3QNoQoiyrj2BRb2QFfeUeG2o8yI9juT+NqTBpb4 2iIrw5WPNQDHzOdhjb4mzUAzD5FhRbcZ/RVty3ppQ1wReP0MkUvAiM0hOAF2EJF+rwlv jhs6Ap7PNt1/xu6fvMr5TAJ2bpX6y9FH0AkZwe/1LF87cj5NcUuTLJsO46ODuVtr6Esc Rxn0+wN49EUwo+Lmsv4nGEYRz8VxoB/u3Sdwy+bBseza20dNU3x/iP/Rrq/QLLxXjJCR bhICQZ7p/FzuOAx1fOfR0lVOTN4/vGKenpBOl24VFIRa4aUAqrGTWGogOnp2Hn/mZV5h 2vhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CZiTPKRC; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si5992406pln.738.2017.09.04.12.57.50; Mon, 04 Sep 2017 12:57:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=@linaro.org header.s=google header.b=CZiTPKRC; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753984AbdIDT5s (ORCPT + 12 others); Mon, 4 Sep 2017 15:57:48 -0400 Received: from mail-wr0-f170.google.com ([209.85.128.170]:35516 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754011AbdIDT5l (ORCPT ); Mon, 4 Sep 2017 15:57:41 -0400 Received: by mail-wr0-f170.google.com with SMTP id y15so4043260wrc.2 for ; Mon, 04 Sep 2017 12:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hu9AHyaZ046I9ZgSTrpmNxghB1bERyxm+xqdqK7QvI8=; b=CZiTPKRCwM6tV7fgb9m4q6ZM/w3LrIe+AT5PAazm1lkjztr3Bqi/8wqyQ3wlLApzl7 j9a/wEvafrJISCk4jWyNaxjEfYxDbcUZtOUbqG2+N/FAhMUhblUGjEb+QuiiAgauzAfd rFD5u39P5jfEaG79I/TN8c5HRCdOGb0TabwB4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hu9AHyaZ046I9ZgSTrpmNxghB1bERyxm+xqdqK7QvI8=; b=g7TLwEGZqNWS1l7PCEP1Ei0Av011k9b9GFMMBLcB713Tg+TUGS+Dv5JI+tDW/hZrfa CpXEm2OQIhsP1h4rLVf3jts5oHOA9NcMsNTVoLtOD5NLyTvXXsV1hocDKBzzfhk2LzIe iyUlu48BB8W6Kk3kj7z1RLXryEA/JV1x0pu9TUgXKhisVE96C4HMsxwoCtKxCgGuDeqr jo4LTOwOv1WMsm+PT687l3/qZY8W89wTnH4Xc8Cum0Wx+qnAvJAP8F4dGq+XOQ/ioENo XyNjs5INNUXeq0/k4igrCHOiNuvAm74Fz+E4HaNgEPmHPus3mIzjWZ86c19BHE+pD00r Dxlg== X-Gm-Message-State: AHPjjUg1s6pkLlfUSqiYUkL1vLI6UzfILv2Bu0nutfxcJYJltnhTq4wD N9bJXT75KU+GvxPL X-Google-Smtp-Source: ADKCNb6CjttE++STvowzu0ruZXU199OguDpahOn6jCScHXgNn3t0b+pEkom6guF/XTpFPyQUMMiVGw== X-Received: by 10.223.129.133 with SMTP id 5mr869205wra.231.1504555060773; Mon, 04 Sep 2017 12:57:40 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:f567:7c41:be9d:9286]) by smtp.gmail.com with ESMTPSA id 23sm10798976wrt.44.2017.09.04.12.57.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Sep 2017 12:57:40 -0700 (PDT) From: Daniel Lezcano To: rui.zhang@intel.com, edubezval@gmail.com Cc: daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, kevin.wangtao@linaro.org, leo.yan@linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 06/13] thermal/drivers/hisi: Remove pointless lock Date: Mon, 4 Sep 2017 21:56:05 +0200 Message-Id: <1504554972-2624-6-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504554972-2624-1-git-send-email-daniel.lezcano@linaro.org> References: <1504554972-2624-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The threaded interrupt inspect the sensors structure to look in the temp threshold field, but this field is read-only in all the code, except in the probe function before the threaded interrupt is set. In other words there is not race window in the threaded interrupt when reading the field value. Signed-off-by: Daniel Lezcano Reviewed-by: Leo Yan --- drivers/thermal/hisi_thermal.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- 2.7.4 diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index f523197..9ec5f29 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -221,14 +221,10 @@ static irqreturn_t hisi_thermal_alarm_irq(int irq, void *dev) static irqreturn_t hisi_thermal_alarm_irq_thread(int irq, void *dev) { struct hisi_thermal_data *data = dev; - struct hisi_thermal_sensor *sensor; - - mutex_lock(&data->thermal_lock); - sensor = &data->sensors; + struct hisi_thermal_sensor *sensor = &data->sensors; dev_crit(&data->pdev->dev, "THERMAL ALARM: T > %d\n", sensor->thres_temp); - mutex_unlock(&data->thermal_lock); thermal_zone_device_update(data->sensors.tzd, THERMAL_EVENT_UNSPECIFIED);