From patchwork Mon Jun 10 13:57:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 166324 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1063324ilk; Mon, 10 Jun 2019 06:58:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbAhUyRPWSuRPkREEc0/GKxlG0oP0FRKiCx1GxuKB+ykV9a0uH69U3f7Jz3TRT2y7gAlP0 X-Received: by 2002:a17:90a:9b8a:: with SMTP id g10mr13389307pjp.66.1560175096541; Mon, 10 Jun 2019 06:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560175096; cv=none; d=google.com; s=arc-20160816; b=YA6aB4YJEPPnExArCyihniIyNHGfUep6vJqCg3S55QGE5FGrnFSm2iGm6M8JNAzbJG ArOyDuq9r84K5iLc8NO7vQ3AdcRWuFgKnacYIZcWGIjyz6WOwIyBJVsuhkpwUt8MNfU2 YMubfjTxq982vaIhliRkctVBquqJrDEWvBEniNYPoF76c520h3zyog7iPXYvE9mJQ8O5 n1Mr5UGHG96PDQh2Q+xP558hZ+Bl9pZhP9FBa+Av49Y3QxkGefGLGBA5rEimgt+wAIRM X9TB+FXyQbX/48i/xBSRj2qYouUxZeX7/gYfQX4vs4bHPOMhoKalX7VJvoEXGKzKAsPh EgFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=c0QkEZpR717HiYrzDaxlsX6CcxmsnGH1uoudRkqso2E=; b=ed1r+wMYAFXT6g+ilMcQYwMbycZxwcC/Za9UnxUJUTDePTyrrlPFYTOg/lgR+rGS3K AHEYv9h4Fne/0JZJWyCQSDj9jiguabqjxExRZiYwv+auiChJ6aa8Y1qozFkfxS8GTtaN YSV006yTWMXfsvgTXxabLi8KTDtHt0GR2vMqODi3ikNXKE7PvJq6XOluQg0OoSeN6kpI ZiDDMMwaJEJl/NsKnOoWVaYcPD8vCNG5sTK/L5MbtGlFWxAXGljlc4IM0+oNyeThvwBs 0rRVFyMhA3f0fAIJRQFirkGDmEBtCzJ/69wTJ9uQp2dahfqoHXvld4T9cxL4BPULxXaN f3mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id k8si10045006pgi.123.2019.06.10.06.58.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jun 2019 06:58:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A1D54890BC; Mon, 10 Jun 2019 13:58:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id B8B39890BA for ; Mon, 10 Jun 2019 13:58:12 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x5ADw97q074708; Mon, 10 Jun 2019 08:58:09 -0500 Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x5ADw9Ws038798 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Jun 2019 08:58:09 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 10 Jun 2019 08:58:08 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Mon, 10 Jun 2019 08:58:08 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x5ADw5A5031652; Mon, 10 Jun 2019 08:58:07 -0500 From: Tomi Valkeinen To: , Laurent Pinchart , Andrzej Hajda Subject: [PATCH 2/2] drm/bridge: tfp410: fix use of cancel_delayed_work_sync Date: Mon, 10 Jun 2019 16:57:39 +0300 Message-ID: <20190610135739.6077-2-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190610135739.6077-1-tomi.valkeinen@ti.com> References: <20190610135739.6077-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1560175089; bh=6Qnx1ZS6yDoLhsy9Pw/hbJgJ21lXELEXI5PTGbIoMVY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=sdNgQPOn2nSeN1Yx+CpjHCSDOUGWVcJCPoVBH/cX2RqosM1+E59UtE7D8lSKW5JYl ObD5DQmxfFjhO0EBPTDai3g/5DDpRaOx2826vKOIBD63DXp4avJpgpMioP+k9RiYqC c3GcPFnCbuqU0ucdQ17I/FEwEK5BI+Ws06foo/l8= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Ujfalusi , Tomi Valkeinen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- 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 9f0836cc712b..07b695172db2 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -381,7 +381,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);