Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp174167imd; Wed, 31 Oct 2018 16:48:56 -0700 (PDT) X-Google-Smtp-Source: AJdET5ffoj7vR60LWTo6A2EeH+I8CloiNo9Kagq1DyJj2aq1RF/MHoD93WfkU0tqetIL3CpNy8HK X-Received: by 2002:a63:e505:: with SMTP id r5-v6mr4974483pgh.170.1541029736829; Wed, 31 Oct 2018 16:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029736; cv=none; d=google.com; s=arc-20160816; b=W+QqzTXInQ0goJFrfYVPI1n6CGHjkj14dGRm0+m+xLq4mumMJvcGGHA2uSl+BhKj2T LXF6lVsVZyvYEmtNkiuf17H0/0yKdURDOCsrvE4TGjGDn1BeHLA5xcGiH8/P0ZcbcW78 2xwNRrAeF9IlYpcu4lYc+ZS91ASv8LdK5UTyVpPUTvIIhie3zM9Bs0N1/pwU824sFKsm V+YO+/nIz5VGEahDmR65gzKPACqYbh7E5pNaARr/XPTW6fYhb9oSuXeJZVnY00Zs7Ux+ iv01/2EnF7fj14uLTgMDTxtyOlbZw3G9W3rtlG1HLW3oPKpooNEg/4rC1XNaIh4S5jhb /9cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=9AAsoUf5mdd6o85cEvO7QONxrhUjRD8QSADzqv7AjMg=; b=KrXQgp7KaHWJ/7PDOSWRRdwV7Q4v+KUMf/RsbeT3h3z9es3spKd143G6vkI9C8ZXH5 xukYeZ+qlsDh0hEj4HNezNL7MrMLFwKqVJWJYX31lYWylMLE8cQsbdTsq1dX4CM1VrRG qaKdhQQ31VGZ10zNT4nayvAGTIEPHmWywWQkcSYISzn7xR3k1CuAjZWzgQwE7qDmmL8z qj3Lgrb/S2Qq4tvtA8CF/UmMNAUnOtHkZIvAX+MMWRt/2tEHNrzxCeT+ZpnJpQd9xW6Z 2dn6YYqkfPMWUqJREgcO25uGnAvjuxeuMagBpcCh7M8Wa7RtxZut7WYGI+S9IpUY3Vzs hGaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tC4ix4sq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f12-v6si27377403pgo.136.2018.10.31.16.48.39; Wed, 31 Oct 2018 16:48:56 -0700 (PDT) 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=tC4ix4sq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728862AbeKAIr2 (ORCPT + 99 others); Thu, 1 Nov 2018 04:47:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:54676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728528AbeKAIHJ (ORCPT ); Thu, 1 Nov 2018 04:07:09 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6C84C20830; Wed, 31 Oct 2018 23:06:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027219; bh=FYBFqrhVinhdRvVhAnfmN693wT2oKuIZIHlbaLGu2qE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tC4ix4sqvOfMDC5dYjoXVJYhOtD520wIpGlChVvY10X6giA3GNZktCJy4gPieqJ96 Q75X2Jovofw/oDHa1FIyJ4vGr9psogBkHvqytW7Usvck1GPVUhHE7wU2HNueKiifYC uUk6VG1QRcw8mYjlGtxD443k8uSjx6v5IX6dCl7M= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Geert Uytterhoeven , Eduardo Valentin , Sasha Levin Subject: [PATCH AUTOSEL 4.19 084/146] thermal: da9062/61: Prevent hardware access during system suspend Date: Wed, 31 Oct 2018 19:04:39 -0400 Message-Id: <20181031230541.28822-84-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven [ Upstream commit 760eea43f8c6d48684f1f34b8a02fddc1456e849 ] The workqueue used for monitoring the hardware may run while the device is already suspended. Fix this by using the freezable system workqueue instead, cfr. commit 51e20d0e3a60cf46 ("thermal: Prevent polling from happening during system suspend"). Fixes: 608567aac3206ae8 ("thermal: da9062/61: Thermal junction temperature monitoring driver") Signed-off-by: Geert Uytterhoeven Acked-by: Steve Twiss Signed-off-by: Eduardo Valentin Signed-off-by: Sasha Levin --- drivers/thermal/da9062-thermal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/da9062-thermal.c b/drivers/thermal/da9062-thermal.c index dd8dd947b7f0..01b0cb994457 100644 --- a/drivers/thermal/da9062-thermal.c +++ b/drivers/thermal/da9062-thermal.c @@ -106,7 +106,7 @@ static void da9062_thermal_poll_on(struct work_struct *work) THERMAL_EVENT_UNSPECIFIED); delay = msecs_to_jiffies(thermal->zone->passive_delay); - schedule_delayed_work(&thermal->work, delay); + queue_delayed_work(system_freezable_wq, &thermal->work, delay); return; } @@ -125,7 +125,7 @@ static irqreturn_t da9062_thermal_irq_handler(int irq, void *data) struct da9062_thermal *thermal = data; disable_irq_nosync(thermal->irq); - schedule_delayed_work(&thermal->work, 0); + queue_delayed_work(system_freezable_wq, &thermal->work, 0); return IRQ_HANDLED; } -- 2.17.1