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: 9996977 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2A03F60216 for ; Tue, 10 Oct 2017 18:13:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20C5028701 for ; Tue, 10 Oct 2017 18:13:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15D7128708; Tue, 10 Oct 2017 18:13:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC3B628701 for ; Tue, 10 Oct 2017 18:13:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932406AbdJJSNk (ORCPT ); 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 X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);