Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752732AbdFLLIJ (ORCPT ); Mon, 12 Jun 2017 07:08:09 -0400 Received: from mga07.intel.com ([134.134.136.100]:29521 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752122AbdFLLII (ORCPT ); Mon, 12 Jun 2017 07:08:08 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,333,1493708400"; d="scan'208";a="273117843" Subject: Re: [PATCH] drm/core: Fail atomic IOCTL with no CRTC state but with signaling. To: Andrey Grodzovsky , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org, harry.wentland@amd.com References: <1497043819-28591-1-git-send-email-Andrey.Grodzovsky@amd.com> From: Maarten Lankhorst Message-ID: <7c001485-0485-5ba6-0be1-8738523d3fe5@linux.intel.com> Date: Mon, 12 Jun 2017 13:08:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <1497043819-28591-1-git-send-email-Andrey.Grodzovsky@amd.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1320 Lines: 25 Op 09-06-17 om 23:30 schreef Andrey Grodzovsky: > Problem: > While running IGT kms_atomic_transition test suite i encountered > a hang in drmHandleEvent immidietly follwoing an atomic_commit. > After dumping the atomic state I relized that in this case there was > not even one CRTC attached to the state and only disabled > planes. This probably due to a commit which hadn't changed any property > which would require attaching crtc state. This means drmHandleEvent > will never wake up from read since without CRTC in atomic state > the event fd will not be singnaled. > This point to a bug in IGT but also DRM should gracefully > fail such scenario so no hang on user side will happen. > > Fix: > Explicitly fail by failing atomic_commit early in > drm_mode_atomic_commit where such problem can be identified. > > Signed-off-by: Andrey Grodzovsky > --- > drivers/gpu/drm/drm_atomic.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) Patch itself looks sane, but I'm worried about failing with -EINVAL when the same configuration with TEST_ONLY would otherwise succeed on it. Not sure whether we should fail or not, since sending 0 events could still be considered success. I don't mind either way, but definitely something that should be discussed before applying.