Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10796049imu; Thu, 6 Dec 2018 06:58:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/WuFiE19YXly9paM0deo4XAIrMvpgMblpTYuNHWFNhocTrdMOjna5PRXWXWty9X6pr95CJh X-Received: by 2002:a63:e950:: with SMTP id q16mr24255889pgj.138.1544108310522; Thu, 06 Dec 2018 06:58:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544108310; cv=none; d=google.com; s=arc-20160816; b=HLmBUknIJJ7Zx1difOvKzmWGsCD2ZrVIVWCH11bgz6TML8xMsr2J4Gs13PJSZuGvpe NMTCsLIQLS1vz5V7p7eouHsElEOhVB3ZSh/DGxhU8wATjH1KEG557ghBYiibp8N8ikQ0 z+vH9ApZymX30Qi5DHb+g8A2TgIbR1o3+hgsoc2BntpCXuxnpvFgeRtYiHybrOdwNnGE YxHbuw1p2u8WJD04pP7w+bwfxCEMtYPcxTx0P8mXLRqTy4bN+q95PUY/xBPxUwGlnx49 M3ggzA93MKTGHQXu9gN7p3irLCtG6bL18LQuXmsripm3bfyqwVnLZ+Me7PzkylpwjP2s JGZg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XUe646hVhTVs3psiZShvI1AAaxY0d50h793OaHBVAfU=; b=TmjKEm5LglZT2FRCaZubYzQjZ3zg2XCY05qFsUSyway/NqWFIYo8WHvs3kxUt1Qti1 jmMUrIZ/JPd1Re8lMmgmfc8EtQfUaXoNR6fSs5HkwnX5hy81FYh5r2dSgLiZdImJl500 8Lh76lrNsKqyoqUimN3mI2hUy8sdMtrRd7ETtJ1/GZxU1RSHOKy6hF3CcfBWDZiThUE5 dO4UgMOQdTTvpkvjensIAO4c7S9Mfi+lXBiRCTY++uElJ7mONThb08Xvc857KK7C8oRd 9ZbHQktctTl8V287nB+pi4raSJ0TkRDAIC/YfpV97xirEkXW5h/MqH/xiRxgPfNB0iOV Gzpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s4Y4JV2l; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q66si418082pfb.231.2018.12.06.06.58.15; Thu, 06 Dec 2018 06:58:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=s4Y4JV2l; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730679AbeLFOnd (ORCPT + 99 others); Thu, 6 Dec 2018 09:43:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:47938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730668AbeLFOn3 (ORCPT ); Thu, 6 Dec 2018 09:43:29 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1E36F214DB; Thu, 6 Dec 2018 14:43:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544107408; bh=zmoFpXKMgI5GcE4lkathkNMClp1CJ0VEpJOd2+/L7OY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s4Y4JV2lHteIwUPtxaqWlRDScT7G/bSQuHJyW0ZZtxybeXB0VTkhlZf6+HhZq5Zqj /xVJFIQzRAK1Sn9AACONCCqsyAshhUVn3HKRCBZSISalshNGUHI14FxTfl9gcSHQEC THIpLVoWJg9WllGvFa/S5DnNsdGJWBvnhWDfmqtk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Lezcano , Leo Yan , Eduardo Valentin , Rafael David Tinoco Subject: [PATCH 4.14 49/55] thermal/drivers/hisi: Remove pointless lock Date: Thu, 6 Dec 2018 15:39:23 +0100 Message-Id: <20181206143004.382565505@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181206143001.749982936@linuxfoundation.org> References: <20181206143001.749982936@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ 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. Signed-off-by: Daniel Lezcano Reviewed-by: Leo Yan Signed-off-by: Eduardo Valentin Signed-off-by: Rafael David Tinoco Signed-off-by: Greg Kroah-Hartman --- drivers/thermal/hisi_thermal.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -221,14 +221,10 @@ static irqreturn_t hisi_thermal_alarm_ir 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);