Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1167546AbdDXJJE (ORCPT ); Mon, 24 Apr 2017 05:09:04 -0400 Received: from mail-dm3nam03on0047.outbound.protection.outlook.com ([104.47.41.47]:28576 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1167559AbdDXJI4 (ORCPT ); Mon, 24 Apr 2017 05:08:56 -0400 Authentication-Results: 163.com; dkim=none (message not signed) header.d=none;163.com; dmarc=none action=none header.from=amd.com; Subject: Re: [PATCH 1/1] drm/radeon: check return value of radeon_fence_emit To: Pan Bian , Alex Deucher , David Airlie References: <1493023551-12003-1-git-send-email-bianpan201603@163.com> CC: , , , Pan Bian From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: Date: Mon, 24 Apr 2017 11:08:39 +0200 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: <1493023551-12003-1-git-send-email-bianpan201603@163.com> Content-Type: text/plain; charset="iso-8859-15"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [2a02:908:1251:7981:14ef:ff99:ae89:1a37] X-ClientProxiedBy: DB6PR0802CA0028.eurprd08.prod.outlook.com (10.172.252.142) To CY4PR12MB1302.namprd12.prod.outlook.com (10.168.168.139) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 863f5551-7c2e-4580-80a0-08d48af18727 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081)(201703131423075)(201703031133081);SRVR:CY4PR12MB1302; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1302;3:THnARs/sWmg/CUEDULXx3h6ETMyJCc4PBIpq11jheMfjHdQWWlNXk6rG/dbMnMVRqvLh6g30k36HHkTHJLM+IpHDEzuNdOj83LiQzLbFyzvgb1hefHDO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zGWsqmI2vYmPiz8SLtmJ4pPK5YT95HaVXaxDap2yEPz60seprEZBpISNaZChAUGi687aOCfk3eUyBJj3ft5PZFpA7q69HKYxmq9zzl+f+ypL0NXSnYs6j4gi5HRUSLrlO0tXd0GWIMLgBe+4LTgx1qcHd9qBPVkxGb/R1sVLMz/6GJsR1NDwHDhksWLoEONzOLEw9Ws3RsccXR9WM/vLyz3wyAsforOBNPB9Y/iJT1BB/tryIk3Ko73GOsEhNlAd0+kwf19NBPWV8iTAip3cAjW8LiTC9lmQm4I41vssF7iO+KdQW0UQnkRcU2/bROAmvEXS8Z1e3M+tT6Czr7e1sq5zAt/QTkyXXBK7GFwPzuRwIoSayk2yum/dEzmXPRN9E0FFSAzf7e/ej8gPa/bHnFSBcJ1gS X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(130843839470238); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123562025)(20161123560025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(6072148);SRVR:CY4PR12MB1302;BCL:0;PCL:0;RULEID:;SRVR:CY4PR12MB1302; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1302;4:oqMw/0Aq8Vjx3ZuXOUvIHZKP0m4Z3sMm15ExJH8MHGSHuzX8a1xjZkP+EbaSWZeJVjWehv+9cAspLmyrGrAQOvPBhGtkO5YHk7dgL5ZjgY8KoAT2+L7sYQQhjLiDtbuBLPRX4z4Z0CVi6wj+xohHErPTt2smricEP1G1I4lsbkehWbOljjQBgt9Dy0lJ5k5HpHFfsgYgZmMpBF0pWgXlsj3mQ8wAoV3Z7/h9w2IcVf3dO91RARbn+gtKlmDX8ZWUstm9pOPNB9FtYzzvmv1myG3X6gzXV6+XXRcGmCDolmIbVkQyG9rkNKZItaA8tpYtZ4tWPjM7TwlTuxkVj5VAIz/f0O6kriCtABl8EJCfrRlRTWTvrMhmMk4Yq03FFYGBdl2SZsW+fcwybSszqYBEPOQyYStJwYvCZMIDCtFzR585d4MnwuzDUkzOAK26lPyKeua+oRoPHcC5Fu834y5prqxfSb3Jddo7bNjT7kW6rPjc8Kh/43vtz5BsVLs6oq4ot/C8U9IaBj2i+MDLMLS+sR3aOw1MDu4y64IN6r8FNWxbdKeHKVujWRNYG+M4u/38m6QZuRJpujVGUgcb2IPg/WMAQLR7Mfvo+nfOl3g5COUKhRjebTeOo2bKhV65HTnmXhGs2nful1dTWXl4nAaC8a8gT+hYhjrZRzwZ/CesvumhL5GXZRouibVzKiXioqvnev8a0ada4JpbPcjZWWBQOiN1yOh1cZQHw6L7CrMR3lcJaxW4qEKQZhb8/E0yQIoWR9VlVc2wOLrBX35pQGbU+9WMfIyuB+cnKmTXmYAo5eAyJbg88I1ce2C6LHhvIutq X-Forefront-PRVS: 0287BBA78D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39860400002)(39840400002)(39400400002)(39850400002)(39410400002)(39450400003)(7736002)(305945005)(189998001)(23756003)(42186005)(53936002)(6486002)(54906002)(6246003)(33646002)(65826007)(25786009)(8676002)(5660300001)(54356999)(76176999)(50986999)(81166006)(86362001)(31696002)(65806001)(65956001)(229853002)(2950100002)(47776003)(38730400002)(83506001)(36756003)(6666003)(6116002)(4326008)(50466002)(4001350100001)(31686004)(2906002)(2870700001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1302;H:[IPv6:2a02:908:1251:7981:14ef:ff99:ae89:1a37];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?iso-8859-15?Q?1;CY4PR12MB1302;23:qvouD1F+dJRPS2ljSIjsUxTJqdTVK4fwS1yL8R?= =?iso-8859-15?Q?8JzEBWhGx76gsT+k36n9OztvzuX7yPWwN0BrVQj2VJO5/tCvFTMrT6K/6?= =?iso-8859-15?Q?q1FYl0Ike3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/e7ufCwZa4n5SwxKVEslGeRcitVmcWuBobj6tC4D5uIGIFU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1302;7:wZcvk1h0EiE+Vt7hk9As/AKDXuijcqStC8gF7JKn+NJBQW+iq6RwPSS08Ahf9pEWHY3tBzbl25A+kRkxRZ9X95JXy51H2hYot7uw58U5QErOpp+U8RX86+KidMTCBD5XlRppO9wTxoxLMIsD6uprsSvNXY7aKHkKV5zF7yWDvCk/Wc8pUOiB/kRLjA+enQRZNVuONxm4CXGCnNjc9TuPxs0u1RMct/nM1cv9czk03sfJf4FlMsKPeUGaFxaedU/tL3yhzxmWk3ULVyMLdipfktMIcrgpoTUHkKpaKYTRwHzag7whT1QOCHKx/JvVaH/u/35dALIy1dt5tcB7+GAKug==;20:HfD8X2ufJUQy4tfopHuqmf95IA2vhLAMsN2D1E/EsXRdBxYRSLme8PhwyeLD3Bety2VvJhIdUZrFCgFtET9OGTwJdP+VzgVALcDpvUOKQ83/j63fxf8PIlGb2QSGYdaoa1uxbYgBOWnZU/b+EwKVfFRabW349vMMejKorZtjCngATTLUzpGwTr0d4BkorOOVEWBfMo7v3BLo2A04eQ7Jf5aeu8WVQb1Phv+u7SvOhcczvNs7x32Cm5SYQPkqsKoX X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2017 09:08:51.0214 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1302 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1336 Lines: 36 Am 24.04.2017 um 10:45 schrieb Pan Bian: > From: Pan Bian > > Function radeon_fence_emit() returns -ENOMEM if there is no enough > memory. And in this case, function radeon_ring_unlock_undo() rather than > function radeon_ring_unlock_commit() should be called. However, in > function radeon_test_create_and_emit_fence(), the return value of > radeon_fence_emit() is ignored. This patch adds the check. > > Signed-off-by: Pan Bian Reviewed-by: Christian K?nig > --- > drivers/gpu/drm/radeon/radeon_test.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c > index 79181816..623768e 100644 > --- a/drivers/gpu/drm/radeon/radeon_test.c > +++ b/drivers/gpu/drm/radeon/radeon_test.c > @@ -298,7 +298,12 @@ static int radeon_test_create_and_emit_fence(struct radeon_device *rdev, > DRM_ERROR("Failed to lock ring A %d\n", ring->idx); > return r; > } > - radeon_fence_emit(rdev, fence, ring->idx); > + r = radeon_fence_emit(rdev, fence, ring->idx); > + if (r) { > + DRM_ERROR("Failed to emit fence\n"); > + radeon_ring_unlock_undo(rdev, ring); > + return r; > + } > radeon_ring_unlock_commit(rdev, ring, false); > } > return 0;