From patchwork Tue Oct 10 18:02:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 115446 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4047512qgn; Tue, 10 Oct 2017 11:13:43 -0700 (PDT) X-Received: by 10.159.244.4 with SMTP id x4mr3413622plr.182.1507659223681; Tue, 10 Oct 2017 11:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507659223; cv=none; d=google.com; s=arc-20160816; b=FHyCZ05PSfw56SONp8625Vw4OztLGg6LVV51mbQlhLFnrrkd84PCqBQFkdiUpKwjTu 7l+GzO/R2WOO4R1L5zNaPlajAlJvtDlZwFKodvoMpc/2RIFbGaMBdGb4wCc2/DMeIyRa CSLjFu3mpNc+VGF3jV8cn8iY3jwFT76kkpDfxMm85GNa5p1S+CeoMU7lzbebxKF1sh45 7r9k75qbXyROqdgbkazvh9i0QbczFz/p4eqlVTi2kIl+JEnAM/6TyV3EVsEpxmhSDHtI KNGutb2EbvhJ7d3N7KPDhaeSYGF0jaS+aJ8QmtLvy2ugMyl/fVrf5hW4fgsxDf+OHuI0 ATww== 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=uOqybWJSVImQhaa4RI1vn17BrLFmsXhE6HFZx14XnHdMDs2uBomICq1ISd8tultDSh koVcWq2arIgWQ4bBwl+lsjU3+PNISqpbmRQgMn+G2IMu4gtM28oUssiGCQv4/Hx8d+LQ fN6ZRAtwh0WEC9nPE0VCRI7q59/uPB2qkJEMwx/iVorw2b9d1eYm8vVqm4bF25mNvhHS mpGySupFjj66O4bfSuYd4cs6Xqv8xcjs23dXSt8Q0pCqQzRnCmd/80uVLPTT0qNKX5x2 +nsRXjMEj8tvtAZvhYt+VScWYImjtnOqRxEDo+yysZ68OBhNV3vMSVB/iRSB8M4EHUh9 Hkow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VW3bnQcY; 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 b3si5164584plr.706.2017.10.10.11.13.43; Tue, 10 Oct 2017 11:13:43 -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=VW3bnQcY; 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 S932406AbdJJSNk (ORCPT + 12 others); Tue, 10 Oct 2017 14:13:40 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:45641 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932257AbdJJSE5 (ORCPT ); Tue, 10 Oct 2017 14:04:57 -0400 Received: by mail-wm0-f41.google.com with SMTP id q124so7514849wmb.0 for ; Tue, 10 Oct 2017 11:04:57 -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=VW3bnQcYOBcSQ1COk3TADLu3xmnMCcx5z+nXvg8DFFIJ/Svs6k/xJv0qRHsedaPU3q 4b0k5Y3ws4SWFz3tIF0xj2d4UhAKOHohyUhKJf18NhKhbioYb3lBN9RV4ocEG8vxbgfc tfURKu8xFsPkEAb1S1tUQEJWmb8Hj/qUjVzro= 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=uZQcJF4qUrjlBqsTieC2YNgLVs+euGaLLMMGO7RAyjNYUv3vl3o5iPigLlRT7t6gzW Rc/yKoHICJb+eSTB5mS/fICyAV/LQL9KijOO5WSAgcIhNyntHbcVWcANRXnM/DxnVIA9 qH7BWcrmQJ0icb4+Ts76GduKBRNQbYI24lu5IO8rieNKbUHRcDG4jMY06xKBNN1rtgXZ qOO7XRlOCk/UG7YexC/Qi7wvDOKEa+2AtEl5V1T7cKedMWdoshx9s6/h/WcAShRqk250 v9+HEbU4y8rq7fRm8M+Wopg7IBJVxJRy//9l0JogEfxHp0dEP9ytFy3mBn/XxsyN9irV gV/A== X-Gm-Message-State: AMCzsaWsnsY59CbR3BS7Q7BMotU+ZByhUGtH9YDtX/Qu4IlaWsOEziDG pCSz/tHLXqpZmR+XxgIyYILWcw== X-Google-Smtp-Source: AOwi7QAU90zDyicY6hGRCcB6j/zuXK4H+uSJsBXXtUT8ZEHFrQ2Z6EvJvGda3y1GbcUSmXXckW/9BQ== X-Received: by 10.28.127.206 with SMTP id a197mr10981979wmd.12.1507658696360; Tue, 10 Oct 2017 11:04:56 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:4f9:3ae1:43d2:31ae]) by smtp.gmail.com with ESMTPSA id l73sm12513428wmd.47.2017.10.10.11.04.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Oct 2017 11:04:55 -0700 (PDT) From: Daniel Lezcano To: edubezval@gmail.com, rui.zhang@intel.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, kevin.wangtao@linaro.org Subject: [PATCH 06/25] thermal/drivers/hisi: Remove pointless lock Date: Tue, 10 Oct 2017 20:02:31 +0200 Message-Id: <1507658570-32675-6-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507658570-32675-1-git-send-email-daniel.lezcano@linaro.org> References: <79a5f10c-0fb7-3e4f-caac-c1625904b137@linaro.org> <1507658570-32675-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 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);