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=-5.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 A8B34C433E7 for ; Fri, 16 Oct 2020 08:54:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 2F06B20663 for ; Fri, 16 Oct 2020 08:54:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qOpKHelH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F06B20663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C81F6EAAE; Fri, 16 Oct 2020 08:54:16 +0000 (UTC) Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by gabe.freedesktop.org (Postfix) with ESMTPS id DC9556EAAE for ; Fri, 16 Oct 2020 08:54:14 +0000 (UTC) Received: by mail-pj1-x1041.google.com with SMTP id p21so1020775pju.0 for ; Fri, 16 Oct 2020 01:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qlKQpjh6RTs3RwzvTa5iXMFegGmcIdpv9KbiNEX8k94=; b=qOpKHelHEA4ybcHdlNVcBL/4CaVjMw6euMsCT/HXdAy9L8iMqKddkGodZSgp35aQzS sfElka10ZN5Bh9UFAJu9KegGSEjds70FdeA9+K4PO66M5Y0Yqt0SW3tV7F+mICE0rrRA +6sjPIIcYpv+Y3SvUMXTNe30pN5FSur5/tnj7cdwzSMTmAgsiLZHFqHZVa4+jHTRdb50 HPqCRgh9l3T/eBmi9sVkoXnhuWqnZRSD1AnJZdkalSpmRb3O7shHBcDMrQVEpzQyMrAy bmIYPhi4oupWAfr78gTCf4f3VcugwrBfFTT3y0yRaJu11dfj90aPviQxJjGqpdKUsluL ypsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qlKQpjh6RTs3RwzvTa5iXMFegGmcIdpv9KbiNEX8k94=; b=QzbG8nlWvVO7mPpIfWCt3IuxLuF+VHS3Q9yuBW5CH224zPRfxkkMlQm67Qd+gSMBNn uAF2zbtYSbmpkdiGrcf0r5/QztrLeNBPQDCXIzOU1Xep3jS1HlSd5qp3YPY6MJyQTEe0 /a7nnJfTxwwMzNLtRa8/w1HZ6jiE9QJAjt/4PHMJPb4TQ49U+PVMANB1U5AJXT0H75UV nJu3lnKsZnZuENa6f0xQSDN02kYAFzPwn8pR9Sk6bFglelREvXrAgdo3twIAWfb5wUPn pBSUPkM6snZTVTiL1n1ImE4sDy53gE/acV3SfWnFxKBRV9ZElt51DxwGUWCS/1BN+aKj uk8w== X-Gm-Message-State: AOAM532eBExh9MFEBA8Ptorw1Blwb2KnLjgwqZ6qezeM+lK3CTMTZhhJ 2tCCOb440HSggx+X/DBnB4sPMA== X-Google-Smtp-Source: ABdhPJyIr+iTQFDXJ805fNvtIed3QCl8jfCPFo8IbPdZKHoVu9+yDXSNk+k/k1arSRf/0/L3nqSB5A== X-Received: by 2002:a17:90b:3658:: with SMTP id nh24mr2965528pjb.177.1602838454436; Fri, 16 Oct 2020 01:54:14 -0700 (PDT) Received: from dragon (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id 190sm2024300pfc.151.2020.10.16.01.54.12 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Oct 2020 01:54:13 -0700 (PDT) Date: Fri, 16 Oct 2020 16:54:08 +0800 From: Shawn Guo To: Daniel Vetter Subject: Re: [PATCH] drm/drm_vblank: use drm_warn_once() to warn undefined mode timing Message-ID: <20201016085407.GA5182@dragon> References: <20201016071254.2681-1-shawn.guo@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Paul , dri-devel , Thomas Zimmermann Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, Oct 16, 2020 at 09:58:46AM +0200, Daniel Vetter wrote: > On Fri, Oct 16, 2020 at 9:13 AM Shawn Guo wrote: > > > > Commit 5caa0feafcc6 ("drm/vblank: Lock down vblank->hwmode more") added > > WARN_ON_ONCE() for atomic drivers to warn the case that vsync is enabled > > before a mode has been set on CRTC. This happens sometimes during the > > initial mode setting of a CRTC. It also happens on Android running HWC2 > > backed with drm_hwcomposer, where HWC2::SetVsyncEnabled could be called > > before the atomic mode setting on CRTC happens. > > > > In this case, there is nothing really bad to happen as kernel function > > returns as no-op. So using WARN() version might be overkilled, > > considering some user space crash reporting services may treat kernel > > WARNINGS as crashes. Let's drop WARN_ON_ONCE() and change drm_dbg_core() > > to drm_warn_once() for warning undefined mode timing. > > This indicates a bug in your driver. Please fix it there, not by > shutting up the core code complaining about that. Either you're > getting vblank timestamps when the vblank isn't set up yet > (drm_crtc_vblank_on/off) or there's some other race going on in your > driver code resulting in this. Thanks for the comment, Daniel. I'm hitting this warning on an Android running drm_hwcomposer. I'm indeed getting vblank timestamps request before drm_crtc_vblank_on() is called. I'm not sure this is a bug or race condition in the driver code, as both vblank timestamps and on/off requests are coming from user space ioctl for my case. @Sean, that means the problem is in Android drm_hwcomposer code? Shawn _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel