From patchwork Mon Dec 3 13:31:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael David Tinoco X-Patchwork-Id: 10709551 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-2.web.codeaurora.org (Postfix) with ESMTP id 339D313BF for ; Mon, 3 Dec 2018 13:31:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23D652B125 for ; Mon, 3 Dec 2018 13:31:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 180762ADC5; Mon, 3 Dec 2018 13:31:24 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 EB24D2B47B for ; Mon, 3 Dec 2018 13:31:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725947AbeLCNcX (ORCPT ); Mon, 3 Dec 2018 08:32:23 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:42145 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726174AbeLCNcW (ORCPT ); Mon, 3 Dec 2018 08:32:22 -0500 Received: by mail-qt1-f194.google.com with SMTP id d19so13632268qtq.9 for ; Mon, 03 Dec 2018 05:31:19 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=OZD4wbyF9EkTu7UJQPBSAQZkCQxHDTNWUeyHRP/NGb0=; b=RqdCl40+FY0B7VOb00rNWAsUW79xJnjUbWFl9432NeXaHrFrMLS22igSW/VN5fO+dZ d5kyIhP1b9LYcCssPBO56MppAcop1HMxmy3zxlmNs8NDcB5V0FDFVJpP4pLv3R1EMUuG TDvef2QUf6mcJcNybq7ZsfEWGwKA+DZUWk2WU= 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:mime-version:content-transfer-encoding; bh=OZD4wbyF9EkTu7UJQPBSAQZkCQxHDTNWUeyHRP/NGb0=; b=NBADKqEh//Tvay3iU/hC7DSnZSMnTyZqPV3Z4c/hCZuVVhlv1EcUrwTp//mBH1hjWf tOjCGkZLONRyZ6XXmDSHeQfqQV1HcbwJvBwoxt8lJNUji4D9UBbz7kq7RAAFHK0P45Pc vjHED8xfWgKLXHeWb37I7qK0yV+wAYponNOAvyXvtZJqykm96TZKA0UTGiaArKdw2uam krKu1D3rjt0/7VT+C8I4829XZtffcQHY4oTYmkZ/oodFkIEuMLfON56suzM4wv+ns8hn gL707P0I4EEmwJtE0OYoMi3Nu5FdZZRqvKJhY6BEs0VPRPcSOzqD0PExugZo8thupsGx Q4bQ== X-Gm-Message-State: AA+aEWa/sko9FZ0CXZpEsDpzLolj/BJzmc2Kq7lkumSVqBKlG3Rx0ezm e27ufEEYRp7pk2IO6RHazKDu1w== X-Google-Smtp-Source: AFSGD/WA+2wO+V8/5inhe+vN47ZjrjQqoGPXOblhwtSdvGP8vbeID6j9S08KauKaDO8R7E77SMcPSA== X-Received: by 2002:a0c:878d:: with SMTP id 13mr15631294qvj.8.1543843878814; Mon, 03 Dec 2018 05:31:18 -0800 (PST) Received: from workstation.celeiro.br ([138.204.25.29]) by smtp.gmail.com with ESMTPSA id r56sm8619112qtj.30.2018.12.03.05.31.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Dec 2018 05:31:18 -0800 (PST) From: Rafael David Tinoco To: sashal@kernel.org Cc: rafael.tinoco@linaro.org, gregkh@linuxfoundation.org, rui.zhang@intel.com, edubezval@gmail.com, daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 2/5] thermal/drivers/hisi: Remove pointless lock Date: Mon, 3 Dec 2018 11:31:04 -0200 Message-Id: <20181203133107.4002-3-rafael.tinoco@linaro.org> X-Mailer: git-send-email 2.20.0.rc1 In-Reply-To: <20181203133107.4002-1-rafael.tinoco@linaro.org> References: <20181203133107.4002-1-rafael.tinoco@linaro.org> MIME-Version: 1.0 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 From: Daniel Lezcano commit 2d4fa7b4c6f8080ced2e8237c9f46fb1fc110d64 upstream. 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. Link: https://bugs.linaro.org/show_bug.cgi?id=4053 (PATCH 2/5) Signed-off-by: Daniel Lezcano Reviewed-by: Leo Yan Signed-off-by: Eduardo Valentin (cherry picked from commit 2d4fa7b4c6f8080ced2e8237c9f46fb1fc110d64) Signed-off-by: Rafael David Tinoco --- 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 aecbfe9fc8f2..0c2966c285b1 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);