Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752192AbdFLOMc (ORCPT ); Mon, 12 Jun 2017 10:12:32 -0400 Received: from mail-by2nam01on0041.outbound.protection.outlook.com ([104.47.34.41]:12956 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751976AbdFLOMa (ORCPT ); Mon, 12 Jun 2017 10:12:30 -0400 Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Subject: Re: [PATCH] drm/core: Fail atomic IOCTL with no CRTC state but with signaling. To: Maarten Lankhorst , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org References: <1497043819-28591-1-git-send-email-Andrey.Grodzovsky@amd.com> <7c001485-0485-5ba6-0be1-8738523d3fe5@linux.intel.com> Cc: amd-gfx@lists.freedesktop.org, harry.wentland@amd.com From: Andrey Grodzovsky Message-ID: <92a4ac19-ce78-47bd-f678-8ea84cc29d85@amd.com> Date: Mon, 12 Jun 2017 10:12:23 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <7c001485-0485-5ba6-0be1-8738523d3fe5@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: CY4PR1701CA0017.namprd17.prod.outlook.com (10.171.208.27) To BN6PR1201MB0100.namprd12.prod.outlook.com (10.174.114.137) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR1201MB0100: X-MS-Office365-Filtering-Correlation-Id: df817af8-df77-4624-3766-08d4b19d0e8e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081)(201703131423075)(201703031133081);SRVR:BN6PR1201MB0100; X-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p3DkmlfpmYNvvzInChHE+6LCLjJzQ3H6OP6SQ71hsBkxvGJ38FOMnsdLI5oYKcdImRHFC3DTysD4uOELfMIy/AWt9JomiGJHW75dg=;20:DHC51JOEfdngSFWRL1h+HJlLTRuvESz7f0W2OUzjj5GgCUnFBKWFgTEEVBfQah0fF+PNUGQebe8WU48UfveO7haReynsZY+uglFQgKcQi7sOQQa9r+kQBC1yRP/bEFqaZrhQIyB0fZ4MZVf3CaIpt6cmFogZrLkga+5gzWLNYg8MlUOibYVH6aHHbJkzLB0gVmdTKkxaLx47/EFsiMNgL2WknuILhEJHUNvdVKNqp2Mt7Ed84Q3V2+AAlUBlHbLhSm4VIwNiPesaZl+LFXeV6t5IwlH7iHNLLIDwzhp29dUc9/D1C5tUYu2CaSR7cTfr4ynfTjP2ZjlRu2nzqCb7AIomjnOottf2Ds2Lrj1FAnfCn7qx/cvhS3TBBbybjAEVCUp6xsUyZxWWENCozp58FPRp9PB4P7KuIjDfrz21CGSZsQ8+CQ25Q67Z1RF6l7f6Kzae0IrClGH+0A+nwpgiQ2tl3PJIghTuBz7A5bzcQfWbNuje5gBIig1NvqIGWeFE X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123560025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN6PR1201MB0100;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN6PR1201MB0100; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?M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RUdPbHBUUlVT?= =?utf-8?B?d2Y5dmUvNEIvbXhZcHZqdmFFeVJNTjltR0F3YndMSC93RnBMUi9hdUwzRENu?= =?utf-8?B?MzRpaGRCSzJyTnBmSTdJNlh0UW54WEVBNG8zSmtQdzF4aFpzZmFGZlhyM2pO?= =?utf-8?B?Q1VIMk9yQk84VnZoY1hHSlBndTJZTFA2RXlZekhMTXhIRzZvRWFXTkl3Z2Js?= =?utf-8?B?S1dDUm5QVzVsSzJXanJzUEx2ZTN0elNucEZ2Y3hmQnhCOHU5MUN6Rk5aNW9y?= =?utf-8?B?L2ZmSnpoTGVTSk5JV0VZNlh4RmZGT29LQzFJaW5EcHN1elp4UlBZSHAzRVQ5?= =?utf-8?B?b3JVc2NkNkhFbzU2NHVLbjdCNGFGOXRja3BTajVzL0c4UVpOTFhUZFFnUnJU?= =?utf-8?B?R2pvcGg5c0Q1ZXR5dE15ZUtVcHpVbExjNlZuT2hlL1NBVGg5bm0wMXUyMmNJ?= =?utf-8?B?WmVobys5cmJQaHRmWTU3Ui9QanBMWVR2MFFzYkxuSVhvUGQ4NjNxK3VJaW45?= =?utf-8?B?b293REgrTm55QVpNTHUyVkNzTGxtZlJEUVFEeU12T0xaVS9LWlBXd0V2N1ov?= =?utf-8?B?M0Z2clM4QnlaaGx2QlZWcHh6NXp1T0xkYmZUMzdKQ0Z1UWh6WTdiSUZSYVNs?= =?utf-8?B?d296aGNVZEJXb2ZSR0ptUE9sMDNBM3BaeEhlNXZJOGNocG5TcTQ0cG16bG5T?= =?utf-8?B?L0ttWElrTktGUHBtd2pvaXJkbXRXUWd2bHoxOXlpTDRXWTFEejE4YW1qQjJy?= =?utf-8?Q?py9nybSMMBGJVzINr4I7x?= X-Forefront-PRVS: 03361FCC43 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(39400400002)(39840400002)(39860400002)(39850400002)(39410400002)(39450400003)(377454003)(377424004)(24454002)(65826007)(3846002)(8676002)(54356999)(76176999)(50986999)(5890100001)(189998001)(36756003)(65956001)(47776003)(66066001)(65806001)(230700001)(86362001)(90366009)(25786009)(2906002)(64126003)(31696002)(53546009)(5660300001)(6486002)(77096006)(305945005)(42186005)(31686004)(23676002)(53936002)(2950100002)(6666003)(72206003)(478600001)(6246003)(110136004)(38730400002)(33646002)(229853002)(4326008)(81166006)(7736002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR1201MB0100;H:[172.29.156.107];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyMDFNQjAxMDA7MjM6bFBGYUhkVGpXc1BJaXF3WWZGeFpWZWRj?= =?utf-8?B?ZjRvaXVSUVZZVHRhZjRjQWhnbTg3YitJNUFWK0FvL1RjSWlsbCtnSWNRTkth?= =?utf-8?B?b3ZRZEMyT09YV25SQW5NV2tBU0s2OTJVY0kxVDgvVStjSW9QUG52S2txMXFu?= =?utf-8?B?S2Rqd3hoMUEyR2RjQWxFbHhKSUY4Q0Vld2p1QXQwNC9aNFova0d0U3pBUFcv?= =?utf-8?B?bXcycjA5QzBSa0x2d1ZTY2hEME5jejBGNXhyQ3ViNVFBdnZPMHpKMlFrclpF?= =?utf-8?B?V25YWWVOWUJpcG5BVm5RUHQ1V2srcTlqcU5LZU9rdFoyT051elNoSHBWQmJQ?= =?utf-8?B?UWdsUk16WUp1SjZvcEpJaG9oTDQ0OWZNN2tKS2IyelRxandKVGgvL2VVOElR?= =?utf-8?B?LzliWTBJYk94azZSa1oyOStLZTJKL1lFK0UxVThzeHZFNTBqNEZla25qZ0Fz?= =?utf-8?B?dXZEWFhRWFFPcFF3RU1URUJvVXRRbnZKNzVwaDVnSVhtdkMwSFhqRUxLRjJm?= =?utf-8?B?VnVqV2hwd1RzdFR3ekR3U3M1emlsUEpacnZZdGliRTMxVTB0bkFNV0dQc0NX?= =?utf-8?B?L2Jxb01aM25yL2ZsdWQyQWQ5cUh0a2FIVGJxMHFiTnhVaE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08yR3Nj?= =?utf-8?B?dTVNWGdmUmJCNTRETURneHNXY1dhb1JUMk5GQ1RNUjFsV3hFR1pZSmpVdkRz?= =?utf-8?B?eGxudVBaOHl5bGlQT1FQSWpleDFPUEVLekdWdVQwa2dnS2EreVJ4R0x3YWJt?= =?utf-8?B?cEZHL1JIdGFabzFQQXlMU1ozeXFuWGE0U05QUXJZZXJSa3kzYmR6SUZOTStO?= =?utf-8?Q?zULXl6KCs/tABTrevAU2e0fa5NO4lnMbxkCKq4Y=3D?= X-Microsoft-Exchange-Diagnostics: 1;BN6PR1201MB0100;6:Mi0nvDjWiWADck9RrcNAx1KoquwQagVBMaygxpdyvEJkXGJYKxo7krQ7TzTHo2prsGTHvTttK2wugM8wnO5fZPNhhzpNVyv9xI7JWWntqNyzEIruasIGs5IXHSjT9mDG4cqjc/DgPjc9rvM03vQ6YYJFVjPggCnKYh4b5M6CMa8FV68CmYnDrTC9KLwYS0miiDRLqzF2HsnPC8xCrvCysGrrhjux5lCni2QALQ+euHBP4pAjYIncel93PMHRjTAbeHooPZuICidH4wFCH63rZEpgyFH/nEsGETs+wrYq4A1kG2/WhhXbCcnJmR6EgPep5HbdDGYBOoLOYONG795Z0qoLybo01oOYBIz70mAzNEhfbUU7mDLevlnz5ynmQSwgzdVuo1r9z28WTCUhKclDHo2fLQDC22ia0wc3mp35h+oTx0YSuYZO/UWwTl6dCvKYtPSZBc7JkPjNMVtc3He75qVZm473KriR/pUG87HPe64DCe21OSgp9DesTLVY9DzmvGF1oFqS9uxtfXyryOfhCgHjZA4OZ9cXJG1jG7Xpzh0= X-Microsoft-Exchange-Diagnostics: 1;BN6PR1201MB0100;5:/VopJQIRTspnQEekcQf5eXFjITS/OmfJAwmEmXLDTqEO4pchYZjUKrqOcu19tgWMqPUKQIwbyqUJLqR0rSYqO1hBthaSmqmNDqZigo8/+MPbWYQk/YdHsoMM6lzmYKYNqRKECA2DmI6aEchNfXQef0O9/+BYRPM9PcNsnArA4b1PBbHi6Er6rCZp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0gverJXUev6Wd8sJ4bikHoYdXPYzmM9YWS1 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2017 14:12:26.9046 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB0100 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1725 Lines: 36 On 06/12/2017 07:08 AM, Maarten Lankhorst wrote: > 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. DRM_MODE_ATOMIC_TEST_ONLY flag is checked later, after this, so if this fails , test only will return EINVAL also. > 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. Sending 0 events is no problem at all on it's own but if user provides DRM_MODE_PAGE_FLIP_EVENT in args then when it becomes a problem , doesn't it mean he expects to receive at least one event ? Thanks.