Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp139946imd; Wed, 31 Oct 2018 16:07:49 -0700 (PDT) X-Google-Smtp-Source: AJdET5doCE7gY4BqV/kC38R6vViAADdGGEU0ciYdzZVN7PIA7VzC+Bdlx6EBblkzZrDiJdtmfji/ X-Received: by 2002:a17:902:7146:: with SMTP id u6-v6mr5128441plm.322.1541027269335; Wed, 31 Oct 2018 16:07:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541027269; cv=none; d=google.com; s=arc-20160816; b=U39bO233kbtPllSrq08kYO9y8bitNxP2ysVAtjzPlRp6ma88gcLJ1UqS0JqNa/Tde4 NQYsr3E5dyB30LaTVI9O6kX6T2XuGyZ603IgN8zCEoVSV7sS/eFA3VTnw4adFcgrjVTD dy7guGCnYMCf0OqXzrwwXykBlAk0phjLzcsXP3HjxrGBzZnWnUMHLsxK0XsKudoFWlr8 tOiya7vwq8oPx64Z+4nVOQn4Br9SLTaZXykwa0cDPNoVriafQA3roJCQKWcFq998scBH 0lmj0MHlyu27kr+CA+qu9tMOK3gYkogTfiuxmLO0IhJLkksbJcj4MKcStyKjcAA4HSzt WlCg== 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=Ri16ux2WiD8j45vxEm++mylhmaisR2RoNIKilU2lhRs=; b=Sr5JJj0W3+352bEAsz/sriaD3EPNzc0bm5nDNHDVrG0tWA038IDc+7Wy7dtbLS91Dj C9+EaslAJaITPBKGJVjBX8/jUqLjUn2VT5JocG8qViOSRxndA5jGFZeOTxGinAlpN67Z 8G6Kw53o1EX9LYJtsaoxFhtg3lvZf6aK1+yW1+VY0k/0EYCEXB03ijZyNOg0G2O5Yqan Ey7OjWsdbzks/rk40BgPRLbnW5F6r0HLuwP6UBzGTQlbRhVLWgH/w/frDpFl1GJmN07e GZxwzafVu2GyPQJenDZ48p4wY7cF4r43MhFUuqSXkJ/Dn9N9BzuoblEkzeClMy6N8MDw WUHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lxIEsT6T; 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 f10-v6si27657218pgl.148.2018.10.31.16.07.33; Wed, 31 Oct 2018 16:07:49 -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=lxIEsT6T; 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 S1728644AbeKAIHJ (ORCPT + 99 others); Thu, 1 Nov 2018 04:07:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:54640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728581AbeKAIHI (ORCPT ); Thu, 1 Nov 2018 04:07:08 -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 94FAB20823; Wed, 31 Oct 2018 23:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027218; bh=1BSXyL1cvEyBLimhoK03AeeMjVU/VqwtiuxC50g00MA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lxIEsT6T25zCnIeRlGYrQk8TYsFZt7ebVr+IR/2ZCXuxV5z427/qL+BiSlYyttFSG I7ZGFGVz5MzNxPAKEHsAb9RAo7nCBkkZUH+x/Mf+Wkr2R5EYnsvl66z2lRRrpq6iPJ 3JeTF2sKn9jME5Wg8xAnPfyxQaUMKWS4TUFqXDB4= 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 083/146] thermal: rcar_thermal: Prevent doing work after unbind Date: Wed, 31 Oct 2018 19:04:38 -0400 Message-Id: <20181031230541.28822-83-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> 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 From: Geert Uytterhoeven [ Upstream commit 697ee786f15d7b65c7f3045d45fe3a05d28e0911 ] When testing bind/unbind on r8a7791/koelsch: WARNING: CPU: 1 PID: 697 at lib/debugobjects.c:329 debug_print_object+0x8c/0xb4 ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x10 This happens if the workqueue runs after the device has been unbound. Fix this by cancelling any queued work during remove. Fixes: e0a5172e9eec7f0d ("thermal: rcar: add interrupt support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Signed-off-by: Eduardo Valentin Signed-off-by: Sasha Levin --- drivers/thermal/rcar_thermal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 78f932822d38..8df2ce94c28d 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -453,6 +453,7 @@ static int rcar_thermal_remove(struct platform_device *pdev) rcar_thermal_for_each_priv(priv, common) { rcar_thermal_irq_disable(priv); + cancel_delayed_work_sync(&priv->work); if (priv->chip->use_of_thermal) thermal_remove_hwmon_sysfs(priv->zone); else -- 2.17.1