From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1A32C433E0 for ; Wed, 24 Jun 2020 09:44:29 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8CB1720885 for ; Wed, 24 Jun 2020 09:44:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ClNqR+L1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="OjdEHyGP"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="E2zHziMM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CB1720885 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tebcgsHKHEqBZKvqf+42ad3pnc03VwlBXdkRBdxeKlg=; b=ClNqR+L1dsISYiAybvLCOCoqf eD1/xidyVzzrSZGBiv6uvekoRyXN223B1CvXo2L19UDnynYBpGAaaMHMndFnZ6eN0wjjNyOyP5rl8 m5RqOf/7P0kHQstD5XCiQhR1yf1EzXjq24CEmDXKnV3rS0nLvMrZUl/uLRPQG5du7fMcIYRcVNCg5 COK/tcjyx9lWLSQtwHKKGugkyohcq2s4iHLuppEATXG+fo67p+ua8FAi4jjdqHqigNDNXk5f+MS7N Ny41zjUaA9TLdnmWVnIwmwIHS+EzdlaKW6FLnu3zBQTTEMB4sTnTU2sZ+/Zn7f5Cw/9tkwsFwyAtI EvxyBBhrQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo1vB-0002Xb-6v; Wed, 24 Jun 2020 09:42:21 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo1v8-0002W6-5V for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 09:42:19 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 0DFCC58011A; Wed, 24 Jun 2020 05:42:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 24 Jun 2020 05:42:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm3; bh=a mJwSW8hZ/p5gW9pWhHia2npnDp0E1YNvRlmKyJTzpU=; b=OjdEHyGPok0GtFpVH TaXHefbzGqqm769WcR8yufTXGbUrVJpxmeHDFVH/z540Ug3LJYuUPGF2aomx1tYI aTZm/vPwS9vD712vuki25WCCa0PuHWz39FRnAxh1tXHZ0fi9LxE7h78Qxqr2aa+F OG1vog1Flu8iY3NEDs1CdkJSmDrrZj71rb60k1zNTSfVoK/EbvH9/6S9DtujH/d1 5i1oiq0YwChvY2VuMdMut0KAt2nJ9G66VIYt+h3q5yZt/MA/bvhmbivQ7kk8rg5Y bXwsOU052QhpknROhZuusOY90X/Prd7bgIvAPT7RxTBUPlKCvG79Er6t1BeH2hQn m74Hw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=amJwSW8hZ/p5gW9pWhHia2npnDp0E1YNvRlmKyJTz pU=; b=E2zHziMMzyfPrx6/sMzTtz+syKX+3Jcqa/JJZpQnvq5Xirhw12P/pbMEH Gqj/NvgGpxegh5KpiBZ2kNONiW/znyxStPmW2qx9uWmVRZe27nYBTZl2Fe5QK4H/ aLORCv5yiivOsxDphzYrtQduw6MkUvhpaPBBpc4p1R5QnQfii6PFUmTovXyotdJ6 eeTCSvvJNNwwllnFstglr1ObD9w3cOcIvKPvdLoSrE2lx215dZuLMj1oWoIK1K4z QxD0NuyuXTvn7xZPCjUgLGeBkLyyZWGXcw2dXvrGAu9ayWpr3D0T/1HgA0IgqgDv nzke67GjrCS2ki3o72nVMJK0+WEfw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudekjedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne goufhushhpvggtthffohhmrghinhculdegledmnecujfgurhepfffhvffukfhfgggtugfg jgesthhqredttddtvdenucfhrhhomhepofgrgihimhgvucftihhprghrugcuoehmrgigih hmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtthgvrhhnpeegteevtdehtdduleff ffeuveffvdevveejueegueduffeiudekteffteefieeufeenucffohhmrghinheprghpph hsphhothdrtghomhenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrth gvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 15AD43280066; Wed, 24 Jun 2020 05:42:05 -0400 (EDT) Date: Wed, 24 Jun 2020 11:42:03 +0200 From: Maxime Ripard To: Daniel Vetter Subject: Re: [PATCH 1/8] drm/atomic-helper: reset vblank on crtc reset Message-ID: <20200624094203.5dw267lb4c7ongvy@gilmour.lan> References: <20200612160056.2082681-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200612160056.2082681-1-daniel.vetter@ffwll.ch> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Tetsuo Handa , Liviu Dudau , DRI Development , Thierry Reding , Laurent Pinchart , Daniel Vetter , Mihail Atanassov , Sam Ravnborg , Emil Velikov , linux-renesas-soc@vger.kernel.org, Jonathan Hunter , David Airlie , Ludovic Desroches , Tomi Valkeinen , "James \(Qian\) Wang" , Thierry Reding , syzbot+0871b14ca2e2fb64f6e3@syzkaller.appspotmail.com, Thomas Zimmermann , Intel Graphics Development , Maarten Lankhorst , Jyri Sarha , Sean Paul , linux-tegra@vger.kernel.org, Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Boris Brezillon , Kieran Bingham , zhengbin , Rob Clark , Boris Brezillon , Daniel Vetter , Brian Masney , Brian Starkey Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jun 12, 2020 at 06:00:49PM +0200, Daniel Vetter wrote: > Only when vblanks are supported ofc. > > Some drivers do this already, but most unfortunately missed it. This > opens up bugs after driver load, before the crtc is enabled for the > first time. syzbot spotted this when loading vkms as a secondary > output. Given how many drivers are buggy it's best to solve this once > and for all in shared helper code. > > Aside from moving the few existing calls to drm_crtc_vblank_reset into > helpers (i915 doesn't use helpers, so keeps its own) I think the > regression risk is minimal: atomic helpers already rely on drivers > calling drm_crtc_vblank_on/off correctly in their hooks when they > support vblanks. And driver that's failing to handle vblanks after > this is missing those calls already, and vblanks could only work by > accident when enabling a CRTC for the first time right after boot. > > Big thanks to Tetsuo for helping track down what's going wrong here. > > There's only a few drivers which already had the necessary call and > needed some updating: > - komeda, atmel and tidss also needed to be changed to call > __drm_atomic_helper_crtc_reset() intead of open coding it > - tegra and msm even had it in the same place already, just code > motion, and malidp already uses __drm_atomic_helper_crtc_reset(). > > Only call left is in i915, which doesn't use drm_mode_config_reset, > but has its own fastboot infrastructure. So that's the only case where > we actually want this in the driver still. > > I've also reviewed all other drivers which set up vblank support with > drm_vblank_init. After the previous patch fixing mxsfb all atomic > drivers do call drm_crtc_vblank_on/off as they should, the remaining > drivers are either legacy kms or legacy dri1 drivers, so not affected > by this change to atomic helpers. > > v2: Use the drm_dev_has_vblank() helper. > > v3: Laurent pointed out that omap and rcar-du used drm_crtc_vblank_off > instead of drm_crtc_vblank_reset. Adjust them too. > > v4: Laurent noticed that rcar-du and omap open-code their crtc reset > and hence would actually be broken by this patch now. So fix them up > by reusing the helpers, which brings the drm_crtc_vblank_reset() back. > > Cc: Laurent Pinchart > Reviewed-by: Boris Brezillon > Acked-by: Liviu Dudau > Acked-by: Thierry Reding > Link: https://syzkaller.appspot.com/bug?id=0ba17d70d062b2595e1f061231474800f076c7cb > Reported-by: Tetsuo Handa > Reported-by: syzbot+0871b14ca2e2fb64f6e3@syzkaller.appspotmail.com > Cc: Tetsuo Handa > Cc: "James (Qian) Wang" > Cc: Liviu Dudau > Cc: Mihail Atanassov > Cc: Brian Starkey > Cc: Sam Ravnborg > Cc: Boris Brezillon > Cc: Nicolas Ferre > Cc: Alexandre Belloni > Cc: Ludovic Desroches > Cc: Maarten Lankhorst > Cc: Maxime Ripard > Cc: Thomas Zimmermann > Cc: David Airlie > Cc: Daniel Vetter > Cc: Thierry Reding > Cc: Jonathan Hunter > Cc: Jyri Sarha > Cc: Tomi Valkeinen > Cc: Rob Clark > Cc: Sean Paul > Cc: Brian Masney > Cc: Emil Velikov > Cc: zhengbin > Cc: Thomas Gleixner > Cc: linux-tegra@vger.kernel.org > Cc: Kieran Bingham > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-renesas-soc@vger.kernel.org > Signed-off-by: Daniel Vetter Acked-by: Maxime Ripard Maxime _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel