Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp880933pxk; Thu, 17 Sep 2020 20:12:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHI/ZcnFeuZwDr6xV+56PRtqKki/jVMKUrK7s9w6VmIZn4Js8VbV1yWRNGCnj2eYR78wHq X-Received: by 2002:a50:d802:: with SMTP id o2mr37069035edj.152.1600398750777; Thu, 17 Sep 2020 20:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398750; cv=none; d=google.com; s=arc-20160816; b=ujK0bpHphXo9UdoYi/q43FX/0j2cRQo6hWrlZAbez3sjh9uoci8Jvb32pTjmZPueM3 hi7zUeXrvv6wLKeCn4QZIjaLnIb7Z72CbP7BAYQZk1U0vX76L2jdfD6RgAS75vlxviyI UYYmqI6hg/nBRrBfkJU9lL2mTHy0R76bcmYZa8lQ52Hy39Mm3DyQYMyMvZSwRUQTCIAe bBfyUtsVAjFLu8iOnnF0seUqzaBN60bLRNa1Ibom3J7GM9EihJlVTW+UNLBrFcq+pIvp OLefO9Yu8LU/urVX0BRlnbwZVDWkt9R44gVmUGCg/LRCr199IWwi//yLgP9i+eYtVdZV 0UCw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=y4gyV6yO1MltYANxSMPn0YHEtHsDyrizB8fmPYOaIv4=; b=VuTN08uO6YMKa3ui0P62T8frxcJpuCzdLO2dGHcjPov3dAdmSg2FcbhT1Gu0Il5ZIo hppIkiQsFD4jQJLNHH2sKJW8kDZaCgFcHe9C3QXZ9RxxssrNLPcST0YdIWmnEYSmP4oS lUdxI8Lwa5cEm1oond1zgejnOE75l+h0W3v6ekp0RQ5k2mYH88IiU5u0G3HrOYoMfbxx WmNxUnhxkNJ/IUXh+XIYq+fhFQT6tu62V63ByanQnytn8Pm3XQrOi+pnDblgWrIhvL0T /GN7lnA7ne7Q4B+7NhFpw0W47gW6qhf8knqeCQfkvcUjCvo8rpGX/9Wb7k4i1y3USbME fqBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kNeCsZVI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg23si1182187edb.229.2020.09.17.20.12.07; Thu, 17 Sep 2020 20:12:30 -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=kNeCsZVI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729751AbgIRDKK (ORCPT + 99 others); Thu, 17 Sep 2020 23:10:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:48494 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726786AbgIRCCw (ORCPT ); Thu, 17 Sep 2020 22:02:52 -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 B640A2376E; Fri, 18 Sep 2020 02:02:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394571; bh=OMVk3fI/tZs7pnCPVX8Wp4T55m38T8i17r0bLUz066E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kNeCsZVID6Qz4M7nKNRXkTYwsBM3ysA0TD9JZpqTZd1fJ2GLpJ8SZh/IO27gcMngC N0ocJ1kQbu3SABZa9qoiGYD54F0lU1MaDHM0SQd/DKxyLxIDebf0mr+SV+OBhiGgnN Lle6t47fBF3CwnW5FtMxqS0fCFCnuCph++wtiMEw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Stephan Gerhold , Linus Walleij , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.4 083/330] drm/mcde: Handle pending vblank while disabling display Date: Thu, 17 Sep 2020 21:57:03 -0400 Message-Id: <20200918020110.2063155-83-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stephan Gerhold [ Upstream commit 97de863673f07f424dd0666aefb4b6ecaba10171 ] Disabling the display using MCDE currently results in a warning together with a delay caused by some timeouts: mcde a0350000.mcde: MCDE display is disabled ------------[ cut here ]------------ WARNING: CPU: 0 PID: 20 at drivers/gpu/drm/drm_atomic_helper.c:2258 drm_atomic_helper_commit_hw_done+0xe0/0xe4 Hardware name: ST-Ericsson Ux5x0 platform (Device Tree Support) Workqueue: events drm_mode_rmfb_work_fn [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x84/0x98) [] (dump_stack) from [] (__warn+0xb8/0xd4) [] (__warn) from [] (warn_slowpath_fmt+0x64/0xc4) [] (warn_slowpath_fmt) from [] (drm_atomic_helper_commit_hw_done+0xe0/0xe4) [] (drm_atomic_helper_commit_hw_done) from [] (drm_atomic_helper_commit_tail_rpm+0x44/0x6c) [] (drm_atomic_helper_commit_tail_rpm) from [] (commit_tail+0x50/0x10c) [] (commit_tail) from [] (drm_atomic_helper_commit+0xbc/0x128) [] (drm_atomic_helper_commit) from [] (drm_framebuffer_remove+0x390/0x428) [] (drm_framebuffer_remove) from [] (drm_mode_rmfb_work_fn+0x38/0x48) [] (drm_mode_rmfb_work_fn) from [] (process_one_work+0x1f0/0x43c) [] (process_one_work) from [] (worker_thread+0x254/0x55c) [] (worker_thread) from [] (kthread+0x124/0x150) [] (kthread) from [] (ret_from_fork+0x14/0x2c) Exception stack(0xeb14dfb0 to 0xeb14dff8) dfa0: 00000000 00000000 00000000 00000000 dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace 314909bcd4c7d50c ]--- [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:32:crtc-0] flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:34:DSI-1] flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:31:plane-0] flip_done timed out The reason for this is that there is a vblank event pending, but we never handle it after disabling the vblank interrupts. Check if there is an vblank event pending when disabling the display, and clear it by sending a fake vblank event in that case. Signed-off-by: Stephan Gerhold Tested-by: Linus Walleij Reviewed-by: Linus Walleij Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20191106165835.2863-8-stephan@gerhold.net Signed-off-by: Sasha Levin --- drivers/gpu/drm/mcde/mcde_display.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/mcde/mcde_display.c b/drivers/gpu/drm/mcde/mcde_display.c index 751454ae3cd10..28ed506285018 100644 --- a/drivers/gpu/drm/mcde/mcde_display.c +++ b/drivers/gpu/drm/mcde/mcde_display.c @@ -946,6 +946,7 @@ static void mcde_display_disable(struct drm_simple_display_pipe *pipe) struct drm_crtc *crtc = &pipe->crtc; struct drm_device *drm = crtc->dev; struct mcde *mcde = drm->dev_private; + struct drm_pending_vblank_event *event; if (mcde->te_sync) drm_crtc_vblank_off(crtc); @@ -953,6 +954,15 @@ static void mcde_display_disable(struct drm_simple_display_pipe *pipe) /* Disable FIFO A flow */ mcde_disable_fifo(mcde, MCDE_FIFO_A, true); + event = crtc->state->event; + if (event) { + crtc->state->event = NULL; + + spin_lock_irq(&crtc->dev->event_lock); + drm_crtc_send_vblank_event(crtc, event); + spin_unlock_irq(&crtc->dev->event_lock); + } + dev_info(drm->dev, "MCDE display is disabled\n"); } -- 2.25.1