Received: by 10.223.164.202 with SMTP id h10csp5214147wrb; Tue, 21 Nov 2017 06:28:21 -0800 (PST) X-Google-Smtp-Source: AGs4zMZa66DmnRn8I4T35Ik2Lk5lgOHzhzTQ3tIGcbjLE3gc1hTmI/fmNryGmn9lgmweuBV4rggV X-Received: by 10.84.192.37 with SMTP id b34mr3977045pld.157.1511274501206; Tue, 21 Nov 2017 06:28:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511274501; cv=none; d=google.com; s=arc-20160816; b=U7ibfvPndNaKHo9YPzV6xlFxE+gzV1Og7dsi0RWPpviKdExoLA/nmEDg5VwHf92KkC CeYa6Ag0j4J1BrZQDD5BIiJFg4tO+JaTwX9Vi6NwKLJwbl62nOuKK1LgwY2kM0xI8Z6r ZWapI/ZeKhHGUBHckmFVw2As4q3Fu/9j4KOm5Yd9ZLzJlbmF3gJiwXaV9aX54BHfy6VE ZZTaNT6Pws1rv4YjwJn7lPyyB+xvAEf6D0UX4XCOfGrg5kJZF7OX4a0caK6e3q4j4KqI rh2wi17yR7af5avRu6xsgkJGCORZv4Nh3xvLZipYPdC3r6ii38a1holYqNsoOmaxTOqe /XGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to:dkim-signature :arc-authentication-results; bh=NN5P2pqnLpXI2RJgucPYBehzMRQjU3sdTQds+pk91o8=; b=kirN7vLtHMnZjWL4QaYP+GXMSymFdDpTh5M6ss/FS0v0Q/yX5CjSsjf9OzbjkMnzl9 lTpk0+UcKxPlTUE5cwz5cr2wuY2TsX+UrmJdUoYQ/7ASR57UQUcK1SzH/+orrLbfBgIb +17RGvnGf6jyrzu+gp6Vsl7dmEtr5szzvstw7+1VA0ocytMAwxpwuc6pAwsBjtoEfN0+ NFPSkyJkAwczrY120NMJAw+tNFuY4sIJ3FFGwGSt1NacQqQ6j6YxGlkzZYSQN2wKNUw6 0hwrE4VpiJu76P5YnbqTjnQO3aaROzrus+pm38MfWG+EC40Czip/gqUKgt+SzZpx473r ESKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FmpAcFP3; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b67si12037344pfc.272.2017.11.21.06.28.09; Tue, 21 Nov 2017 06:28:21 -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=@gmail.com header.s=20161025 header.b=FmpAcFP3; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751468AbdKUO1g (ORCPT + 76 others); Tue, 21 Nov 2017 09:27:36 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:41519 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751226AbdKUO1e (ORCPT ); Tue, 21 Nov 2017 09:27:34 -0500 Received: by mail-wm0-f65.google.com with SMTP id b189so3804325wmd.0; Tue, 21 Nov 2017 06:27:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=NN5P2pqnLpXI2RJgucPYBehzMRQjU3sdTQds+pk91o8=; b=FmpAcFP3ESgcJcucN0djPgqattWdQgSaQ0zihZQurm8GkSH2S8VO3E5s2Ei639JZqt 2XSeeCySmTm1ldGO+xQP0WDKNB7Gth3keiRlaXi83+F+tTvbM9xzGi4W0csssq5JFC6b OYVq7s6exAQoqXdh3q6FK3InnEXTlvBh5IzuRKL6npfV8+A17MnBZ5cPlbzTP2g71q1T D3mTR2eeo6QGPkjGFoRzKiSLyllrDzBJX+Hm8lU7x5LD5GLEa54fN74XaYuxsmFLnocC 61iKKQfR6NUa2BorZYV8s4BreQHrV6nXmyo6BzfeS5dFa41w3Tn+8wtQbgrtAhWLXATu iChg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=NN5P2pqnLpXI2RJgucPYBehzMRQjU3sdTQds+pk91o8=; b=ByqDWLXn+/eUlAQvlszFYqyXYWjwsTV3GXhqDaxjOs8B270XP89Fv5KKt5VIeZJQ5r DdoPinq+HmFA26l9uCNvGxOs5CYrvBgwXrt8E9OwtrMhHkNwF7z9oQVH2Y6lmW+C8KjU 81XlIrVR8UpiuAH+/jZjfbckXmrR6y9MCrRBPVKY584hZAMDMtxtNzwJnzXDBt9OWzk4 fzillbybrY+sGSohLmdCclS2DQCgIe3yuwIvT1dF603znLz25Kp8XRLt1QwROICmElGq Qyg2RX6lw8NLejjv594sTnbEikskjW2D1enwVI+YfdN80V0R5TllvB8XmE0rQCYnS46I xi1Q== X-Gm-Message-State: AJaThX5N+afKyuGT73oU1tX0PVk8+sl5KbUBvQ7uRgmVU7g10/pQRXNr 9eXTIX6eDOMKz90kI/4/vfmKMfe4 X-Received: by 10.80.135.182 with SMTP id a51mr24066556eda.98.1511274452878; Tue, 21 Nov 2017 06:27:32 -0800 (PST) Received: from ?IPv6:2a02:908:1251:7981:fcc0:d6fe:33e7:da04? ([2a02:908:1251:7981:fcc0:d6fe:33e7:da04]) by smtp.gmail.com with ESMTPSA id a99sm10431927edf.54.2017.11.21.06.27.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Nov 2017 06:27:27 -0800 (PST) Reply-To: christian.koenig@amd.com Subject: Re: [PATCH] reservation: don't wait when timeout=0 To: Rob Clark , dri-devel@lists.freedesktop.org Cc: linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org References: <20171121140850.23401-1-robdclark@gmail.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <52253a44-112a-9bcb-bceb-2ea53a444265@gmail.com> Date: Tue, 21 Nov 2017 15:27:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171121140850.23401-1-robdclark@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 21.11.2017 um 15:08 schrieb Rob Clark: > If we are testing if a reservation object's fences have been > signaled with timeout=0 (non-blocking), we need to pass 0 for > timeout to dma_fence_wait_timeout(). > > Plus bonus spelling correction. > > Signed-off-by: Rob Clark Reviewed-by: Christian König > --- > drivers/dma-buf/reservation.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c > index dec3a815455d..71f51140a9ad 100644 > --- a/drivers/dma-buf/reservation.c > +++ b/drivers/dma-buf/reservation.c > @@ -420,7 +420,7 @@ EXPORT_SYMBOL_GPL(reservation_object_get_fences_rcu); > * > * RETURNS > * Returns -ERESTARTSYS if interrupted, 0 if the wait timed out, or > - * greater than zer on success. > + * greater than zero on success. > */ > long reservation_object_wait_timeout_rcu(struct reservation_object *obj, > bool wait_all, bool intr, > @@ -483,7 +483,14 @@ long reservation_object_wait_timeout_rcu(struct reservation_object *obj, > goto retry; > } > > - ret = dma_fence_wait_timeout(fence, intr, ret); > + /* > + * Note that dma_fence_wait_timeout() will return 1 if > + * the fence is already signaled, so in the wait_all > + * case when we go through the retry loop again, ret > + * will be greater than 0 and we don't want this to > + * cause _wait_timeout() to block > + */ > + ret = dma_fence_wait_timeout(fence, intr, timeout ? ret : 0); > dma_fence_put(fence); > if (ret > 0 && wait_all && (i + 1 < shared_count)) > goto retry; From 1584685078993396088@xxx Tue Nov 21 14:10:59 +0000 2017 X-GM-THRID: 1584685078993396088 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread