From patchwork Tue Jan 12 21:23:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWFyZWsgT2zFocOhaw==?= X-Patchwork-Id: 8021061 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6EE6ABEEE5 for ; Tue, 12 Jan 2016 21:24:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9FDFF20416 for ; Tue, 12 Jan 2016 21:24:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C306920412 for ; Tue, 12 Jan 2016 21:24:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D9BDD7213C; Tue, 12 Jan 2016 13:24:13 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by gabe.freedesktop.org (Postfix) with ESMTPS id AF2C272136 for ; Tue, 12 Jan 2016 13:24:11 -0800 (PST) Received: by mail-wm0-f68.google.com with SMTP id f206so33461252wmf.2 for ; Tue, 12 Jan 2016 13:24:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=qD5a5FC7qMDKU4XynyBUue1+NVoiD0m6blLYR7EXcEU=; b=MAZ5QypmNh3rmCh6n0NZGSsSwTzFvBlJgkUjjiWruvUS7qvKJvg5dnE7tCK0tISayW G0D++fYp6NMmlukJ1gqGKXTDV0n60I2dqr69hBaD2Jrx9Lip6vgEve2CvEbO1fRCVoDV hY1xaR+LTYb6ThPFUZUBQPx5iEyrXrGohuaiF8k6cKzrxfUxRO98NgtoOLDeAyrG8Dxq fHws5kLgZF4tjirri7WZ2/1YkqEW3i7sPAdKHJDYr/CmxmuL56ZxU6BJW6K06GbjIFSm 0J6A5Qd6JV6fCQXcBxbZatxaQ41iU4zJhjq9ybOXtkYqIdtBL8zg4mwA/MNJ+4hACN3T Aq3w== X-Received: by 10.28.220.68 with SMTP id t65mr20467796wmg.92.1452633850329; Tue, 12 Jan 2016 13:24:10 -0800 (PST) Received: from heaven.amd.com (ip-89-103-110-3.net.upcbroadband.cz. [89.103.110.3]) by smtp.gmail.com with ESMTPSA id n5sm19291001wmf.3.2016.01.12.13.24.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jan 2016 13:24:09 -0800 (PST) From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 10/10] amdgpu: list each entry safely for sw semaphore when submit ib Date: Tue, 12 Jan 2016 22:23:56 +0100 Message-Id: <1452633836-26855-11-git-send-email-maraeo@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452633836-26855-1-git-send-email-maraeo@gmail.com> References: <1452633836-26855-1-git-send-email-maraeo@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Junwei Zhang Signed-off-by: Junwei Zhang Reviewed-by: Michel Dänzer Reviewed-by: David Zhou Reviewed-by: Christian König --- amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index 5c7a3a3..82fa805 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -179,7 +179,7 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context, struct drm_amdgpu_cs_chunk_dep *dependencies = NULL; struct drm_amdgpu_cs_chunk_dep *sem_dependencies = NULL; struct list_head *sem_list; - amdgpu_semaphore_handle sem; + amdgpu_semaphore_handle sem, tmp; uint32_t i, size, sem_count = 0; bool user_fence; int r = 0; @@ -282,7 +282,7 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context, goto error_unlock; } sem_count = 0; - LIST_FOR_EACH_ENTRY(sem, sem_list, list) { + LIST_FOR_EACH_ENTRY_SAFE(sem, tmp, sem_list, list) { struct amdgpu_cs_fence *info = &sem->signal_fence; struct drm_amdgpu_cs_chunk_dep *dep = &sem_dependencies[sem_count++]; dep->ip_type = info->ip_type;