Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3631291imu; Mon, 28 Jan 2019 08:08:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN4yjCLnUmltmSoqZVQPeCATM2E881M6CjjS+oLZ9F5ycMS27iVRvR+YVeUcZpO+OnB+WBfA X-Received: by 2002:a17:902:7b91:: with SMTP id w17mr22348861pll.111.1548691703643; Mon, 28 Jan 2019 08:08:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691703; cv=none; d=google.com; s=arc-20160816; b=SLcRXg+xs7vpakAXcOApigfYEsZ5FLNxLxPb+jVlF3vc41Enq5DoHqxgCnRk/09UXS uJz+fRTLxHRFrwflfFCQONnPY5tE0wHt047r96FJvYKRfZ1VUpg5Yvzk86VL31mPJo1H nYZobjIahy+WVVu7DqhAmX2oqBt1oud+jGCOBZDlixIFEUk8TVqFpEz9KDTNvylFScKo OqkeCmLzi1ltwOmA83/mxcQina9tYatSXd3RL/YWqIYgHPpz0XsssrLErVFGPfGi5rDk QLWv7GFA6Gg8eNbnami/BiGXtnv6Fks6goH/tyREdV+xG0Ye2ULRW31Z3gZNd4+wqs2n ek/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BcZpzs6Qvr+AgmsgaZz9rHFMGjTjEH1kpOjuEkNyPyw=; b=1LORlFsFj4HVlg1yCPL8Ci886voYFg51oXo5Wlh9mhRR2WU97huonNbTO80Nqv7xMK XY9UzoAEpspnhPQUOkCiA0CBEcR3uIBL9NHdBy80FcQEHVsh0heOpLyV+TF57Rvu+6Zt pFyqgyYgdEBhHxl7WjHyeBXxpedH/w/7D8KhzoLpOACHIXJijM11ZuTzUJ16mK55kwtp Nrc9/CXBIlhX77Rs3ZhAY6URfseDxsvY0JeCzER+NMW7VNoj55+Bl0R3njYJ+de3H1To txyTGS5jKBWXM1UOYeCXb0D+pie4Ssfc47VuVGCX4/ZSVagBHS7QNCgvli6o/1KFIKtN IgVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iuWvQafK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id v5si6079931pgh.510.2019.01.28.08.08.08; Mon, 28 Jan 2019 08:08:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iuWvQafK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1731922AbfA1QFz (ORCPT + 99 others); Mon, 28 Jan 2019 11:05:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:53470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731102AbfA1QFx (ORCPT ); Mon, 28 Jan 2019 11:05:53 -0500 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 6FC2C20989; Mon, 28 Jan 2019 16:05:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691552; bh=nqgrXLaJEHrhcbL9D8uQmAp7BxY5tKdpYBY8bZh4r2E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iuWvQafKIVFAXlWCvpLvJ/8AsXwBAZ99sTYZ1e0Dsd5xVnoJ2igZw85XVnCvAKHdl uxAemXnDj1WqOVozaIbbe7g57QEjEznefxmWHpH56de0yoGhBZmO9VvgfDBmXgAgSY T2D8w1OkANVgBroEL64J43ScoD3NKtVOEZ6g2Roc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sean Paul , Rob Clark , Sasha Levin , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH AUTOSEL 4.19 138/258] drm/msm: dpu: Only check flush register against pending flushes Date: Mon, 28 Jan 2019 10:57:24 -0500 Message-Id: <20190128155924.51521-138-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Paul [ Upstream commit 5f79e03b1f7c1b2cf0019ce6365fe5d52629813d ] There exists a case where a flush of a plane/dma may have been triggered & started from an async commit. If that plane/dma is subsequently disabled by the next commit, the flush register will continue to hold the flush bit for the disabled plane. Since the bit remains active, pending_kickoff_cnt will never decrement and we'll miss frame_done events. This patch limits the check of flush_register to include only those bits which have been updated with the latest commit. Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c index 14fc7c2a6bb7..c9962a36b86b 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c @@ -331,7 +331,7 @@ static void dpu_encoder_phys_vid_vblank_irq(void *arg, int irq_idx) if (hw_ctl && hw_ctl->ops.get_flush_register) flush_register = hw_ctl->ops.get_flush_register(hw_ctl); - if (flush_register == 0) + if (!(flush_register & hw_ctl->ops.get_pending_flush(hw_ctl))) new_cnt = atomic_add_unless(&phys_enc->pending_kickoff_cnt, -1, 0); spin_unlock_irqrestore(phys_enc->enc_spinlock, lock_flags); -- 2.19.1