Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp250821ybg; Sun, 26 Jul 2020 03:27:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMcoR68MONmtMyewyml8PHMEV1LcHeZvJBoU8IlGgBPwxOfYtFNb6Ppr6UTNL6yEZRlQMm X-Received: by 2002:a05:6402:1427:: with SMTP id c7mr620366edx.245.1595759232427; Sun, 26 Jul 2020 03:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595759232; cv=none; d=google.com; s=arc-20160816; b=hsWAi2viK2Ws0q7I4Z+F2cdPZ/TlG2stG2sZ0nXofvrPiHRDkvNLL8CxEN52KRNy65 KhnZGrIApz8nIOXB1Ht50coE8qzdD+Z9cDs/grtiQi5QW1DhQEIKbFhHxfSZZWG66LDS 5N9B0Lw+6UAfOk041zraK4gCTFCpyyd4QsUoRloYbEuCoKHDnpo2kDt1w5CtMudEWQNp KtGp6lm9PDQvZqdPqpuJBbbUpzEXcV79p1RY8LJjX0zGUoa/1igMTz+Rg8+oaQIuxDrq iBEPeKJNU6MpD4fUCAQeue+A483yZ15uFhHayj4F7RMC2wcxHfzRoJH9WFSzv6MwaW5y FEYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=k2Fq4D+MVaPvOwyYejkASFNE/Fbxf9pO3/22f+1eVLs=; b=QW1jCiTLP4PGFmnuI1VZp8ozMpZwX451Yp+ICS46zQC2FNmdGaDhWsXc1jOpYuSC0m yf4xskFRJb2l8foV8v2zvUerutsUxwykU63+yS3DdFIX45qmXqi1N0IdPaOWHCC+ym1p j2LhUypqsO3bYMhYMqZu72vL6RtIQA+jG1Vl2WD7oNXGwHevTE3r2bDRRbEWd7g4qLWs qBZXJifKctTCADP9+AJz/7/2929CMtm1WcLk5VqyGxCC31Dnfay3CJm/iHDRl6odRzaE l6ymdfhpWlPzBd5jzbX4f5RY4acaSixUBow50S4H4F8T3SoRcXS3zNMzQxR4lerHNsnb YK6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=PHf0VFLD; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e10si3857361eji.183.2020.07.26.03.26.49; Sun, 26 Jul 2020 03:27:12 -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=@ffwll.ch header.s=google header.b=PHf0VFLD; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726145AbgGZK0U (ORCPT + 99 others); Sun, 26 Jul 2020 06:26:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725960AbgGZK0U (ORCPT ); Sun, 26 Jul 2020 06:26:20 -0400 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47974C0619D2 for ; Sun, 26 Jul 2020 03:26:20 -0700 (PDT) Received: by mail-ot1-x341.google.com with SMTP id n24so10208979otr.13 for ; Sun, 26 Jul 2020 03:26:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k2Fq4D+MVaPvOwyYejkASFNE/Fbxf9pO3/22f+1eVLs=; b=PHf0VFLDhl6XKmXhQHgwoYrMD2qxUGTx/e7U1VrDSzvUSNGyFfFVxoNihxoInyIPuw Su6+h1XQunxpBb9kezEWJX+oB5gKajxzh71pifMnMo7PgJ13V276+jHKCiZvJ4nbe3DC WhxaaPD2cSTrMa0YukAZhZl3//fYQPKxx9X+0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k2Fq4D+MVaPvOwyYejkASFNE/Fbxf9pO3/22f+1eVLs=; b=oLOon7cuL4WcmdXH8Nb92xAstOAHeqdgNW59Z9egu6ay4cfd52Y6I2GLiNqnbs2hKZ Lhaw1hKHgNsIonessxtYeKS29F5IhZjWvqHtnkODU3SUjammQNIQOpOIDXDa5m7JI5LV 3ar5oZR/Mvn8GJETlHrja4Qb95qVenmskPBlawmWDCJ02ebje13NyQWAqnqqRH/3LmUA lfYjTXVuwDRV5X2kwgod+frkx9Of2pnKz3C6I9qOUq06gw+aIh2goCSJPT6QjWN0RiCB zBLikR8qtU9jHCe59vu/VxT5NeM7WN9brhO7wYEUamMThYkq2vGEhrWOmGJ08Qe6S0Py mAkA== X-Gm-Message-State: AOAM533L+4brzEcpDRpzp2xd2O4JhaGRZC4S0GqxOlLLkKTCFjzr4xk1 y8CAx/lsXMm8cTSVUUQShC9oR8DOLmYPwdTd1DDQ9Q== X-Received: by 2002:a05:6830:1613:: with SMTP id g19mr15498856otr.303.1595759179525; Sun, 26 Jul 2020 03:26:19 -0700 (PDT) MIME-Version: 1.0 References: <20200722110411.ebkv6knvc6mzw5uf@smtp.gmail.com> <20200722120502.GK6419@phenom.ffwll.local> <20200722140604.27dfzfnzug5vb75r@smtp.gmail.com> <20200725011737.GA2851@realwakka> <20200725174514.esh4gqek6oddizvh@smtp.gmail.com> <20200725184918.togb54bxuifrq77c@smtp.gmail.com> In-Reply-To: From: Daniel Vetter Date: Sun, 26 Jul 2020 12:26:08 +0200 Message-ID: Subject: Re: [PATCH] drm/vkms: add missing drm_crtc_vblank_put to the get/put pair on flush To: Melissa Wen Cc: Sidong Yang , Haneen Mohammed , Rodrigo Siqueira , David Airlie , Rodrigo Siqueira , Linux Kernel Mailing List , dri-devel , kernel-usp@googlegroups.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 25, 2020 at 9:29 PM Melissa Wen wrote: > > On Sat, Jul 25, 2020 at 4:19 PM Melissa Wen wrote: > > > > > No, this very first warning continues (only once) :( > > > From here (drm_crtc_vblank_on): > > > if (atomic_read(&vblank->refcount) != 0 || drm_vblank_offdelay == 0) > > > drm_WARN_ON(dev, drm_vblank_enable(dev, pipe)); > > > > Sorry, not sure when this warning is triggered. > > Again, I just had to look at the trace: > [ 52.299388] drm_get_last_vbltimestamp+0xaa/0xc0 [drm] > [ 52.299389] drm_reset_vblank_timestamp+0x5b/0xd0 [drm] > [ 52.299389] drm_crtc_vblank_on.cold+0x37/0x103 [drm] > [ 52.299390] drm_atomic_helper_commit_modeset_enable Yeah I think vkms can't generate a reasonable timestamp when the hrtimer is off. I thought the warning comes from a different callchain, but seems to be a general problem. I guess in the vkms timestamp function we should check whether the timer is running, and if it's not running, then we just grab the current time and done. -Daniel > > > > > > > > > But I'm still wondering why after step 3 we don't get -EINVAL from > > > > vblank_get() - after vblank_off() vblank->enabled should be false > > > > again, getting us back to the same state as after 1. Is that not > > > > happening? > > > > > > Yes (sorry if it got confused), we got -EINVAL after setp 3: > > > > > > In step 3, at the end of the 2nd running, we have: > > > atomic_disable > > > --> vblank_off [!vblank->inmodeset + refcount going 0->1 + inmodeset=1] > > > and then in next vblank_get: -EINVAL (!vblank->enabled + refcount ends 1) > > > as in the first step. > > > > > > Melissa > > > > > > > -Daniel > > > > > > > > > > > > > > > > > > > > > > > Thanks > > > > > > > -Sidong > > > > > > > > > > > > > > > > > > > > > > > > > > > > crtc->state->event = NULL; > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > > 2.27.0 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > Daniel Vetter > > > > > > > > > > Software Engineer, Intel Corporation > > > > > > > > > > http://blog.ffwll.ch > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > Daniel Vetter > > > > > > > > Software Engineer, Intel Corporation > > > > > > > > http://blog.ffwll.ch > > > > > > > > _______________________________________________ > > > > > > > > dri-devel mailing list > > > > > > > > dri-devel@lists.freedesktop.org > > > > > > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Daniel Vetter > > > > > > Software Engineer, Intel Corporation > > > > > > http://blog.ffwll.ch > > > > > > > > > > > > > > > > -- > > > > Daniel Vetter > > > > Software Engineer, Intel Corporation > > > > http://blog.ffwll.ch -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch