Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp776696pxb; Wed, 8 Sep 2021 12:05:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3OuSmcTrWXTx7A+/nD6ZWOhsji9/kt/g5DBK8it5QZhoBAQUJ67XGpQnqFlk2A27Gd/wh X-Received: by 2002:a17:906:4413:: with SMTP id x19mr1468494ejo.234.1631127900289; Wed, 08 Sep 2021 12:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631127900; cv=none; d=google.com; s=arc-20160816; b=rubUpGmX9FhYioCSlD76s26F6CCVXxElf11VVgxes86vLIr82FsXZHfin8qFDGG7Us 87zINT07vDsp2a4f7G6WOZxJz6O3gHxqhNl2UVY7lvH1WlZmjSAEoztgSwMyoyhzrTJV hvjy9lEhI3TMhR7OIME0gP2VMNNhKaIKbDW5XY1Z9dsEOGCzQipfidwxKMlRJgjNW43f o30d6SqD3XSVefPf5OZ2I0vwgyZftzJ6XORNgbsgXLFd67iJZCtp4zM28VY0mp0JA37H CdA+OF5BYgMHR+cnixZifGI6jDKjEWEZCWhquF1zsIqQAHB/G6hasMAtl6IJWYEKx4VV H9kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YRUmRUUCYmjE8wlXNGRCZTbNeHfZjNb6hJUKTvoLMJE=; b=mzm6Eudv+MjbJVzVfmbKQfuH4X9rqzLfkEdFHT4+FCyvdi9skmMjME3fbpXrBj3Fly BD+lPzlB9QAJlHxYPdEN32PAsJzKFIC0+ed++FKsFRzPWrC+3xHqFx82eoP/KlX2vw2i xZ+DXey1nHzKNhmieMvsXiCWnnpFN4fgHq9NPq5k81i8+tLOucsYMGk41rNP3Q1dFcei DdMOE/i89o+nZu/AE1x2Hj0CB8sQu0fCP27H3jdHwxenLGewthuMCIlz9GIfE2lW4Cvb 3cYzHIuHsWwHVSC7KAbUpt6ancaJ0PALJmvxkVuPMvWzp5tCHOw3BZWElzw5wzyAe8p3 5WXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NRxAAd7y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ne33si3204828ejc.598.2021.09.08.12.04.33; Wed, 08 Sep 2021 12:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NRxAAd7y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349626AbhIHSQH (ORCPT + 99 others); Wed, 8 Sep 2021 14:16:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235747AbhIHSQG (ORCPT ); Wed, 8 Sep 2021 14:16:06 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EE5FC061575; Wed, 8 Sep 2021 11:14:58 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id d6so4561363wrc.11; Wed, 08 Sep 2021 11:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YRUmRUUCYmjE8wlXNGRCZTbNeHfZjNb6hJUKTvoLMJE=; b=NRxAAd7y72m0T3aSIbndy+HJVgXcePIEbPw7RzYDKSkGDr7OylwuEsyXxLXxC8Wp3Q a2GeUbAOblhD4Kd/GXztAUU3QND2ihaT0zBBFqWoVemp5eU4KoEC6ZLs3i5TPFQRrhP+ zyvLA5xf++zEAKTIqnJ+KxtRDJx8aRRN51jsLJG0x0daYyKFFiCxRoVYBj8euPIGg3jf TR4H1ANvax/D2ToiabFBoYc4vkcD0otvfSmW/Ak3Aw3amFvoAR3T1RpnwmYpHIab1GOg cNHMS/aScEaYwuP8E9p6G1sX74a54i59OEjALlYeL7d7LCTTaaip5SpKqk6EHdfIc27q sN8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YRUmRUUCYmjE8wlXNGRCZTbNeHfZjNb6hJUKTvoLMJE=; b=zFRIzNpRlGJx3uWQFQ1gcaWwnh0mtsXBBobdejooyFlGzx3jDBna6eA1v0OFQ0/qT3 uGQ/EuF/70Pj2R3EAvOTjLSZ/gUqXTp+dkyCZBtbKKqpmxgDRXU5KcKtE6VI2zfZDYkG xLh1NE+UEJOOIR6nggsrJKO1eRFDP3y4ZD6WAhLZXUWmGS4meYtlJXQHvbna9NwBlpTd UWClqN4BcsePrxPOppDJ4kjba8mUytuXLW27Qn6tffVcBevs3cZjRXCdXuz55xK7hhA3 OBcU0G9LR0dKuVtOCxJkLlN11bt3UrPQPUcBWcbdYxo4bank/gvSkjoUIhiK1eAAOwRY Yfjw== X-Gm-Message-State: AOAM533Kmb6QWT+jK8TEG2tHP9oo2V7Ij3EpAKPj1AFHGl5Zm74z9ttv tSY2xHMZK3M4TiAX9pKdYdvSjKWnLLTB/sFZsXo= X-Received: by 2002:a5d:4488:: with SMTP id j8mr5580376wrq.260.1631124896977; Wed, 08 Sep 2021 11:14:56 -0700 (PDT) MIME-Version: 1.0 References: <20210903184806.1680887-1-robdclark@gmail.com> <20210903184806.1680887-8-robdclark@gmail.com> In-Reply-To: From: Rob Clark Date: Wed, 8 Sep 2021 11:19:15 -0700 Message-ID: Subject: Re: [PATCH v3 7/9] dma-buf/fence-chain: Add fence deadline support To: Rob Clark , dri-devel , "moderated list:DMA BUFFER SHARING FRAMEWORK" , =?UTF-8?Q?Christian_K=C3=B6nig?= , =?UTF-8?Q?Michel_D=C3=A4nzer?= , Pekka Paalanen , Rob Clark , Sumit Semwal , Gustavo Padovan , =?UTF-8?Q?Christian_K=C3=B6nig?= , "open list:SYNC FILE FRAMEWORK" , open list Cc: Daniel Vetter Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 8, 2021 at 10:54 AM Daniel Vetter wrote: > > On Fri, Sep 03, 2021 at 11:47:58AM -0700, Rob Clark wrote: > > From: Rob Clark > > > > Signed-off-by: Rob Clark > > --- > > drivers/dma-buf/dma-fence-chain.c | 13 +++++++++++++ > > 1 file changed, 13 insertions(+) > > > > diff --git a/drivers/dma-buf/dma-fence-chain.c b/drivers/dma-buf/dma-fence-chain.c > > index 1b4cb3e5cec9..736a9ad3ea6d 100644 > > --- a/drivers/dma-buf/dma-fence-chain.c > > +++ b/drivers/dma-buf/dma-fence-chain.c > > @@ -208,6 +208,18 @@ static void dma_fence_chain_release(struct dma_fence *fence) > > dma_fence_free(fence); > > } > > > > + > > +static void dma_fence_chain_set_deadline(struct dma_fence *fence, > > + ktime_t deadline) > > +{ > > + dma_fence_chain_for_each(fence, fence) { > > + struct dma_fence_chain *chain = to_dma_fence_chain(fence); > > + struct dma_fence *f = chain ? chain->fence : fence; > > Doesn't this just end up calling set_deadline on a chain, potenetially > resulting in recursion? Also I don't think this should ever happen, why > did you add that? Tbh the fence-chain was the part I was a bit fuzzy about, and the main reason I added igt tests. The iteration is similar to how, for ex, dma_fence_chain_signaled() work, and according to the igt test it does what was intended BR, -R > -Daniel > > > + > > + dma_fence_set_deadline(f, deadline); > > + } > > +} > > + > > const struct dma_fence_ops dma_fence_chain_ops = { > > .use_64bit_seqno = true, > > .get_driver_name = dma_fence_chain_get_driver_name, > > @@ -215,6 +227,7 @@ const struct dma_fence_ops dma_fence_chain_ops = { > > .enable_signaling = dma_fence_chain_enable_signaling, > > .signaled = dma_fence_chain_signaled, > > .release = dma_fence_chain_release, > > + .set_deadline = dma_fence_chain_set_deadline, > > }; > > EXPORT_SYMBOL(dma_fence_chain_ops); > > > > -- > > 2.31.1 > > > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch