Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3288643pxk; Mon, 21 Sep 2020 09:46:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFtbm49Z7Gmj6XCcGm2p9jrnAnatryJ4I5CPbcCT5LLukkiKFRXq1P8DWmZyPQ/JK774wC X-Received: by 2002:a17:906:8246:: with SMTP id f6mr336894ejx.296.1600706809451; Mon, 21 Sep 2020 09:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600706809; cv=none; d=google.com; s=arc-20160816; b=Yc224S7wwKa1oc/jASKkmusOB8easkmUmzALFQVzasXt9WIO1C3ndHzSewM6raDRqi bpOZnKjR03tX50OkXzilKEaada5Ti6i4w6sGh5WV5p/2Vgz7jhQeSywldCCPNhumvNdc 3F8OkIxgwNMPXBXJWOODeI4cA64WaQDBCRZNec3Wdz8vQLBYUkWQRmq89oZxEfFPrXM/ k8tIBVGfYGQpqlvtsMabg8SOYbdfv8DJrm/yuye+JliSVmaNwrsN/6jltlo2V4irH71J IRTHr9LuLjOLCGEMivC3QdO/jyoyJSCEwfCv3gvc8qa5MNPndk0KcKDe1VASBcFr7K07 JMbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=18atnYcgGoM28L0a9qM4ljAq9eCjaz23Ba8V5c3ofI4=; b=fsVufnGeYObf/t5p1KK38XAZ3eoZRhjCIXaejz/V6awNe2ybrgGQ+uyWcNQ31m3+Pm ZR28cwpE+OINDlhjoGyE4vF8yzSV9gB09gbYSXx3qSpz91g9Os3I6sDpSKBdGLW5kOBP 54WFFiQZ+KpfZGjrHsePCsRR5AqPFmKcv6OdIODX9TCUvbt6S757oH8i5++epmdYW6wO U/ynm6WlzuBnbbh+uq9o5FAR52yOY8mEZbZpiUUFS8VzL9RiQDOBkyg2Ay5nW9cIj7wP oUigNA8+p8d4hbKGNi0CLXZSjopFyIW9pzRJGscjThbOOAa1cZzTkoTbv2M1vVUkSa03 MYKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DXWoi9ev; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s19si8758429ejv.149.2020.09.21.09.46.25; Mon, 21 Sep 2020 09:46:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DXWoi9ev; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728029AbgIUQpf (ORCPT + 99 others); Mon, 21 Sep 2020 12:45:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:51170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729032AbgIUQpT (ORCPT ); Mon, 21 Sep 2020 12:45:19 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 1728723998; Mon, 21 Sep 2020 16:45:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706718; bh=z/ffxFJFSkBTieCOO7Z4rdWZaAoFjf95X+Dji5IxViM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DXWoi9evuMFQaqS6ahHThJA17i6HDNJgdEzUmkihLW/vXoJGblDDgk8q8bu7QlEBg METxMeUDmZSsVllyVaehzeecSrPAX84lJhGF2dYrD+8/9YH4WTuUiYUawWkwWOtgwk XtrWOWjqPZEhG4ve2oa6w5OEreQOTGKABNLwn/W8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chun-Kuang Hu , Sasha Levin Subject: [PATCH 5.8 067/118] drm/mediatek: Use CPU when fail to get cmdq event Date: Mon, 21 Sep 2020 18:27:59 +0200 Message-Id: <20200921162039.465490829@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162036.324813383@linuxfoundation.org> References: <20200921162036.324813383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chun-Kuang Hu [ Upstream commit f85acdad07fe36b91f2244263a890bf372528326 ] Even though cmdq client is created successfully, without the cmdq event, cmdq could not work correctly, so use CPU when fail to get cmdq event. Fixes: 60fa8c13ab1a ("drm/mediatek: Move gce event property to mutex device node") Signed-off-by: Chun-Kuang Hu Signed-off-by: Sasha Levin --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index 7cd8f415fd029..d8b43500f12d1 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -834,13 +834,19 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev, drm_crtc_index(&mtk_crtc->base)); mtk_crtc->cmdq_client = NULL; } - ret = of_property_read_u32_index(priv->mutex_node, - "mediatek,gce-events", - drm_crtc_index(&mtk_crtc->base), - &mtk_crtc->cmdq_event); - if (ret) - dev_dbg(dev, "mtk_crtc %d failed to get mediatek,gce-events property\n", - drm_crtc_index(&mtk_crtc->base)); + + if (mtk_crtc->cmdq_client) { + ret = of_property_read_u32_index(priv->mutex_node, + "mediatek,gce-events", + drm_crtc_index(&mtk_crtc->base), + &mtk_crtc->cmdq_event); + if (ret) { + dev_dbg(dev, "mtk_crtc %d failed to get mediatek,gce-events property\n", + drm_crtc_index(&mtk_crtc->base)); + cmdq_mbox_destroy(mtk_crtc->cmdq_client); + mtk_crtc->cmdq_client = NULL; + } + } #endif return 0; } -- 2.25.1