Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3133990ybi; Thu, 18 Jul 2019 21:41:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQC2uyCUgYCvyIAxrmEgV4AsrvtiqdzZGppugoGFG6fyG4sFiTUqfBPhO0/quXUkuVchq7 X-Received: by 2002:a17:902:925:: with SMTP id 34mr53987481plm.334.1563511303131; Thu, 18 Jul 2019 21:41:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563511303; cv=none; d=google.com; s=arc-20160816; b=DlISeuHQF1pPsoj94URPVfjw1NLFEGev5fVKNkmJMrEU/S864BOtGL8cmjfd92/ly0 SJBW8My/3mLFzTpVU2bDBwwZCG8KWG+bZQQ3IjfskbIW70Q+Z4yQd3drGD2jku4pUE67 q0PE04U9AA4qLYnJoCoYdjm/woYMGPjX+lMbAdaymb+uVGNJqQGwvext6pNEg/srBofS QQ1oKQZ+zHM6LVEEDkH43JlYvHRZwnVtqlRNyGqQDZZwWpH6eUPRAJI8945K/n1T1gQv wdwshcA0A7fxQbjL/jB+8Anwxjr+XhIioDhrq+c3ou0AbSIE1Apl0e7XH+8/yZxMlsIa REqQ== 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=cDwmJFjBxXR/5jYJ62YRo8JZT+kvAMwKa41QTcgHba8=; b=UjgKAM7iuTZe+Z8/H/FdbNCY83O7TvOZit2+AqIQJwpDlp9+I8uL77NSYbJo2ltY4+ D2ov0kdfKjvyNZ2M2uhEIA2eAw+uZScS/LBLfbMf//Ta3Rxf4HYKQJEJni2Su5vLRVbi DuLDBdM7ORyhnSuoDsRFqdG69A5oW2cSMwVNatqZKjE4UeuKh0EewKLJqkSqdbwX3TFK yeSz5sP/WQVCHIPr6FESD5/rmrsiAA2AEulYN+aXfidNKleI1UGOsHLLu7IqPf1rEd9C Z0PANmYpuTROWdN/2c/ZOI9E+XFF7RWz2mvFa9ZbeNsZ6aKJVYl4iKyfHu9FXlMQcy+9 oKRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bZptdSly; 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 h63si4255966pje.79.2019.07.18.21.41.27; Thu, 18 Jul 2019 21:41:43 -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=bZptdSly; 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 S1729896AbfGSEjR (ORCPT + 99 others); Fri, 19 Jul 2019 00:39:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:58348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728361AbfGSD65 (ORCPT ); Thu, 18 Jul 2019 23:58:57 -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 D01A921855; Fri, 19 Jul 2019 03:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508736; bh=ArwmgiV1wSYko0c2MaUE0C7Iz4E5SJPnVJ/ZR/Lcg0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bZptdSlyu+xpXNYOyLbzZ5/NU+ntd37BxinqRRk6RLSHfCC3Ij5F+pvYtos5v/Tb8 aQBZ7h7qycjKr4GXlAHmV8ENAU9vNcXM2ScPkj7snGZm/YEXQ7q6PfYeF4L7QK8wE9 v0mwxcHlVF6FyxpVcx4fqWUIT/yf8vFITMWBMg94= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tomi Valkeinen , Andrzej Hajda , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.2 059/171] drm/bridge: tfp410: fix use of cancel_delayed_work_sync Date: Thu, 18 Jul 2019 23:54:50 -0400 Message-Id: <20190719035643.14300-59-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tomi Valkeinen [ Upstream commit b1622cb3be4557fd086831ca7426eafe5f1acc2e ] We use delayed_work in HPD handling, and cancel any scheduled work in tfp410_fini using cancel_delayed_work_sync(). However, we have only initialized the delayed work if we actually have a HPD interrupt configured in the DT, but in the tfp410_fini, we always cancel the work, possibly causing a WARN(). Fix this by doing the cancel only if we actually had the delayed work set up. Signed-off-by: Tomi Valkeinen Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20190610135739.6077-2-tomi.valkeinen@ti.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/ti-tfp410.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index a879aac21246..3a8af9978ebd 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -372,7 +372,8 @@ static int tfp410_fini(struct device *dev) { struct tfp410 *dvi = dev_get_drvdata(dev); - cancel_delayed_work_sync(&dvi->hpd_work); + if (dvi->hpd_irq >= 0) + cancel_delayed_work_sync(&dvi->hpd_work); drm_bridge_remove(&dvi->bridge); -- 2.20.1