From patchwork Thu Oct 19 17:05:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 116430 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp725337qgn; Thu, 19 Oct 2017 10:12:20 -0700 (PDT) X-Received: by 10.98.147.73 with SMTP id b70mr2153505pfe.347.1508433140322; Thu, 19 Oct 2017 10:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508433140; cv=none; d=google.com; s=arc-20160816; b=s6vat9zG1ZNuN/vScgCH+HlFQ8ww7NlS02xaU4eMkGa2reOLcsoAswWhxhQuqi7HAt Rv5OQ+B6nnvi+SH9M+3Y7PeewiL1NEgXqoVrg4qkQU9+qilhI9jfxDOLlfBWnfqUE2+Z AqDqv91GQ7Wi+Z4OfumE3Y4nSOvESX/UsOoKZUzJXws8L1mhrmtR6asGLhqi9ab5F4xo d3md8U4+YsPnpcE0n7aE3LvEe3EErOrjhmGo21i/nbqFnzRZxy9Gxs3Z5B06eNnNi6aL tWw2bNLDfX5xGo3nNy16eHAvKj3yxskqy0qypQTNw8zMfVfIvnr91lKwDQeHA3WSWnPe /73A== 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=RXq2HM2wsx+XsSvP5yIIgV1sF/W7OK4M6nuLfQ5ydXg=; b=zco10Xfa1EIBnSzfIkT6cCiJ/14eRElBC85rhCANoqCoT+v+t+u7ptw4Pyqzny/Xfz fFXCYcOLciQdRCb4t27ZRbIRGmweU1o49lWP30uLCt+RtKeQkkgzkgjibA1KwPAAjD9v 4UsAhpZd61gxSg+fSgmmEQCSb90BKjLrRuIxoYGoAXc87LzMpXgvWHYUx0cKrSinDk0I IvwOmf3Oa8h+QPnYmNqYZfdAS07B7WVwBqAJVR6dMQ5IOdmluu98G4qvU7gNmcWTFFm9 Ixj+h95A57bllFkP5D7pviDDdIFjjQ79ywY2iVcB8ubxDrJtWv1FcIYd7BvxiUhm8hUP +xtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X0IG+/1X; 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; 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 n10si7220536pfi.256.2017.10.19.10.12.20; Thu, 19 Oct 2017 10:12:20 -0700 (PDT) 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=@linaro.org header.s=google header.b=X0IG+/1X; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753641AbdJSRMS (ORCPT + 27 others); Thu, 19 Oct 2017 13:12:18 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:44591 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753500AbdJSRIi (ORCPT ); Thu, 19 Oct 2017 13:08:38 -0400 Received: by mail-wr0-f194.google.com with SMTP id z55so2981740wrz.1 for ; Thu, 19 Oct 2017 10:08:38 -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=RXq2HM2wsx+XsSvP5yIIgV1sF/W7OK4M6nuLfQ5ydXg=; b=X0IG+/1XJw8fWVRi6aOTaU/TLGZ6yqydkxuLEr4sCZfMYyp9F9NDsdRmvi2MGkB2iv /0qcTQg7ytoOSMOSZO9U5ELIGEvYunT1JPV+gPpbIKlTslGUFHebCN8BlQzsH9YIf3Y4 h2Hvc1Q780LeuI42PFQYlyHuEZRiG+TyQzxXc= 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=RXq2HM2wsx+XsSvP5yIIgV1sF/W7OK4M6nuLfQ5ydXg=; b=IPtHG4py1EOI8LWDaKoOdVsCt10LD8chz2W3tNMVBLzDLfG4EHMUiqQNy2zsisVKXj bIIhVGzqkHN6tCj4Q9EbhBVaWRkLZyL8Ej4RTbZxTx4yXO/uislFna7+dCJdaIvl9LQ4 mNkJPg4oPKHtbkyIZDOvUSP/v6G3XmsrrLAma3o7sPs31VVb8OqBx+K5Dx1w7Bll9aVk d3HGDKHtSB0TOSIiu5BudUJKWED5VDuL0+O4zSKLXf+Xcctot5RDQGxJsW+nGI/ud8cy heXTrDUw9LTDSbaKf1n1ZcvtiaK20LxeyFsTIvy+ZnaUNyHp9dALiVtD6PIGXAQceLuB aBtg== X-Gm-Message-State: AMCzsaX4bg3BWF7h/wwKXp/60B51NInj1DFKMw1QkYbx37KjR/cP+aq2 To0tLrpYJ5y5dYG+xsNAocnZTQ== X-Google-Smtp-Source: ABhQp+RtFwTjl9wzK8zHbgfHY2/NWkWgr1D/2IQFud8Tbs8OqIs6ISyH8hUSXRtVcLuISc34o+9Olw== X-Received: by 10.223.162.152 with SMTP id s24mr2389956wra.173.1508432917681; Thu, 19 Oct 2017 10:08:37 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:51c7:d9b7:e14b:6840]) by smtp.gmail.com with ESMTPSA id g16sm14277394wrd.72.2017.10.19.10.08.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Oct 2017 10:08:37 -0700 (PDT) From: Daniel Lezcano To: edubezval@gmail.com, rui.zhang@intel.com Cc: linux-pm@vger.kernel.org, leo.yan@linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/18] thermal/drivers/hisi: Remove pointless lock Date: Thu, 19 Oct 2017 19:05:48 +0200 Message-Id: <1508432760-17847-6-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508432760-17847-1-git-send-email-daniel.lezcano@linaro.org> References: <6ac48f08-7fe6-92e9-0801-6ed3bcd05ff1@linaro.org> <1508432760-17847-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 1b44bfe..b657ae4 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);