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: 152703 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6814535ljp; Mon, 3 Dec 2018 05:31:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/XYrOvHEuhqF/2HPK8c65XtoknmkT9Pwei4j0McmFY4WmFNgFvbOSGhl2sQ6e+8W4uPT97x X-Received: by 2002:a17:902:f01:: with SMTP id 1mr15457004ply.143.1543843883871; Mon, 03 Dec 2018 05:31:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543843883; cv=none; d=google.com; s=arc-20160816; b=p6OrAcGuQt76wckYttagUQ9Ro3a6uoy6A0CzrArsufAZzzFTqMW7aawbe38b2LUL9x lUXA9WxuzpN66OkK543gOysq0QmhF+1jRfEoX3adnONaCTjaaHbbEkLAGdX2ODpKZaRH yIRZyKn+etp8WTDPVsBiU1vhgW+m7CR6vt7qjOue1VZuy5iqLFVT6w04QCrw6S/7vE6g 7N0XA5zjlVUnqdJF2EYOL0iWQ7/e61GguY1KKg9n/FRrIWq8xmmonuANMjucafgGMjiH 2rRDLZiEn9zJltt/08SbEbsnDtt3ect/s5PyxK/GdmgV8NGwmtc0Y7A4vXzCd/hBnwgr 9LAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OZD4wbyF9EkTu7UJQPBSAQZkCQxHDTNWUeyHRP/NGb0=; b=zQNRSDhCtEBeNRM/XzbXE6D2Vp0EuuBK2MmPkHAOgv/85AD09zbiMkhPxrxAu8Q2w/ D7H3JXGMIv28BZJLyEDtv2P8WqNYH4Wmr67Q7bUxfcVBLcSBxirBDBaQzfthjVn50oTA c4CPQfUjCvAudznn0oY12QyR5+XL/xd40U5gIFbXqFRx1CHV+3gIkkHdb8qiScL40gmd A9Zn1EFZEFX1xyk0LsqCqDWBuIw/X53iLS3xzm3K3h7cKhqyUKAWTarS/4GMr4y8glUR fyvDyo44QbSVCXTFuWRvtnNOLbRWL5UbjDelUofiCjD7YMuHVYTK8s1MUSk7hnylgif5 EKoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RqdCl40+; 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 e67si3756713pfa.15.2018.12.03.05.31.23; Mon, 03 Dec 2018 05:31:23 -0800 (PST) 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=RqdCl40+; 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 S1725947AbeLCNcX (ORCPT + 11 others); 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-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 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(-) -- 2.20.0.rc1 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);