From patchwork Sat Mar 20 13:28:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Vyukov X-Patchwork-Id: 12152455 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=-16.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 80392C433C1 for ; Sat, 20 Mar 2021 13:28:49 +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 2919B61966 for ; Sat, 20 Mar 2021 13:28:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2919B61966 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com 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 80A6B6EB14; Sat, 20 Mar 2021 13:28:48 +0000 (UTC) Received: from mail-ed1-x549.google.com (mail-ed1-x549.google.com [IPv6:2a00:1450:4864:20::549]) by gabe.freedesktop.org (Postfix) with ESMTPS id DACB46EB14 for ; Sat, 20 Mar 2021 13:28:46 +0000 (UTC) Received: by mail-ed1-x549.google.com with SMTP id q12so9064390edv.9 for ; Sat, 20 Mar 2021 06:28:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=BBm8e3ljXuTB2RwWH86mMYMB3mSh/3i2elGx86nbt2k=; b=MvAnzc4LPFs0OPxKBAzRip81IjdvkOQq5oCx+Db7pRo/laL2njO2DR8M29LndXu/Ge QigKDtEnw2zlFQQJP9ZXbYZ8AeBvKm0WZB4spAk6kkJaVxuHCDavXwgSjgi36GHTeWSf Y2Nb4Krx7dXb3pWTVR4po3SRdHLNanY3GxrxDG9J7nInBnVMrUoPOui8nP3JSRDqMwud P2xvicA4GwseQB2c9W4L+nTW4Xo0cG+0WxnbntuDUSvgsY/6aA6IjAUXNUVZq08B9OLw YCXiZ+Tuaz8h2XBUklamg7YL2yOszHtvHe+ArcV2vcuUuWcbz3+v6Hv1mJt22A32H9Xn f+1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=BBm8e3ljXuTB2RwWH86mMYMB3mSh/3i2elGx86nbt2k=; b=Jjr0XBf1zdi7LzoYoBKw9Ta0o0Vxa/b4dtw2vHhO4ZHkSMiaNhNUyjCnlZudsVy4Fk VOk5Oz+R6ayDW/HYyrWrmLgbe1KdTkC4QnyalKIgCmB5TaCi8KTLQx1TESdQecUkZhaw FsWT68WYgM0HmVHY8OiMRGHG3oE8R61d+wupOKOJDDhpoXbrakHVk2ogUauxZjJ/UWv4 jMbS8AKg6hCubmpBZ7KVd557Gtyx4PEb799iDjm4WzNB2lIm++W7Ne9k+Ez4anqotVtn hRguylf6HZizpMw4QWBU0/hwcJDly4OAUNKc6jPv/UtmA5p7ZhR4l6YTWw90+ZR8DTRV KdXQ== X-Gm-Message-State: AOAM5313TR1NaNG0Ans2T9uVzj7Fe09+7cEFUE7n7ZjxuWOLXBbYyFzu 7e9J10zp3GC4/AVVOgfafy4BGb0ia6TF X-Google-Smtp-Source: ABdhPJwPlInIesVyLJR/yWRN+uRqKL/K5/VS1q+KO2JbycUaR96xSyYa3dYnZk6gJduKpoluxtwJqqPtpmo3 X-Received: from dvyukov-desk.muc.corp.google.com ([2a00:79e0:15:13:84f2:bf18:7ada:738e]) (user=dvyukov job=sendgmr) by 2002:a50:bb47:: with SMTP id y65mr15819702ede.305.1616246925213; Sat, 20 Mar 2021 06:28:45 -0700 (PDT) Date: Sat, 20 Mar 2021 14:28:40 +0100 Message-Id: <20210320132840.1315853-1-dvyukov@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog Subject: [PATCH] drm/vkms: fix misuse of WARN_ON From: Dmitry Vyukov To: daniel@ffwll.ch, airlied@linux.ie, hamohammed.sa@gmail.com, melissa.srw@gmail.com, rodrigosiqueiramelo@gmail.com 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: syzbot+4fc21a003c8332eb0bdd@syzkaller.appspotmail.com, dri-devel@lists.freedesktop.org, Dmitry Vyukov , linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" vkms_vblank_simulate() uses WARN_ON for timing-dependent condition (timer overrun). This is a mis-use of WARN_ON, WARN_ON must be used to denote kernel bugs. Use pr_warn() instead. Signed-off-by: Dmitry Vyukov Reported-by: syzbot+4fc21a003c8332eb0bdd@syzkaller.appspotmail.com Cc: Rodrigo Siqueira Cc: Melissa Wen Cc: Haneen Mohammed Cc: Daniel Vetter Cc: David Airlie Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org Change-Id: I7f01c288092bc7e472ec63af198f93ce3d8c49f7 Acked-by: Melissa Wen --- drivers/gpu/drm/vkms/vkms_crtc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) base-commit: e94c55b8e0a0bbe9a026250cf31e2fa45957d776 diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index 0443b7deeaef6..758d8a98d96b3 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -18,7 +18,8 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer) ret_overrun = hrtimer_forward_now(&output->vblank_hrtimer, output->period_ns); - WARN_ON(ret_overrun != 1); + if (ret_overrun != 1) + pr_warn("%s: vblank timer overrun\n", __func__); spin_lock(&output->lock); ret = drm_crtc_handle_vblank(crtc);