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: 10017877 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 D26E3602C8 for ; Thu, 19 Oct 2017 17:12:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB96F28CF0 for ; Thu, 19 Oct 2017 17:12:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B09E128D55; Thu, 19 Oct 2017 17:12:51 +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=unavailable 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 63BB428CF0 for ; Thu, 19 Oct 2017 17:12:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753285AbdJSRMR (ORCPT ); Thu, 19 Oct 2017 13:12:17 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:49609 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755012AbdJSRIi (ORCPT ); Thu, 19 Oct 2017 13:08:38 -0400 Received: by mail-wr0-f193.google.com with SMTP id g90so9036005wrd.6 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=CMAOHDNAseZgphNpqKNdUJsRkfmQTJ+yO2PdLoGZxd3xw3TJs+UQZyyf3O8PpWOdse EA2/5QZz4pQryq2gBTnS97PziupXMELsgHReDms9e6Tp1Re0XZNCOy+HOvE7G6Nd0EWS uBXAgEzRhhir6y1ZVjtQ+hdTM/cvfcGIe4KxQdvmu9rWm56wF/wKFpfjlj1q22rza6i5 aBJ1IybZBmv98erxbXqQ5OqVnaQJsVterIpwacl7GdSuJKvFFZg6f1Lrp0yKBe74Mo9T 3PGBp6m8wS1MmBIxKd7EKAFCM20nLmr7J8LAegD5sdJ8TxQmsbRQzHVb2pfD20yJ6F+N 6iUw== X-Gm-Message-State: AMCzsaU14liWDFngUNoSIFQ7qbMUxfuCDH2mwdcRoJogMY6jX0oUkHk4 Q3yvIVUF/mK758zGEadh+QunyQ== 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-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);