Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2073522ybk; Mon, 11 May 2020 11:16:13 -0700 (PDT) X-Google-Smtp-Source: APiQypJ8/mNEaWkjigOGrGeoAqaUatowh4erZ6QCPyeE22DTuaR5CY3HhIqew2rWqF9kTHc5WuEO X-Received: by 2002:a05:6402:684:: with SMTP id f4mr15107277edy.240.1589220973651; Mon, 11 May 2020 11:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589220973; cv=none; d=google.com; s=arc-20160816; b=F+0r0km/VwUL5mPvjUhI2/vQQNv4SjUAwVyjv5kYKPLfkQlWHWUlkpB3oRVJkpaGq/ W00Lc0rYkvd+05Hf8w/IkqjLWxtYywQ0pZN73PWCNt7El2ImVLPhERAi4C+DZ0xN6EGY O7AY8OMUy+pTSDp7QgTFbE4QbtFWRCxzVRMxOfj9BYfg50LjjY8jZUt/6edocfcNmxMl 2EaEbPEeGvv/JtNMBN0lM/6K0Mz2whkFkxIvqozQFd2LZW0P5qY9bbfi8zg0esrge3FV TwRdcFUO+NotIhkz9dtc/4pJFRXd6/66lOcPJtNMC7gY290Hi21cuLapA0oLK5rVTkS6 EgSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=pgOU2lq8hSbwhzS+rs4FyZ0k7y4Ag4yWgMLr/Up+Yzk=; b=oF1WBYiDPjdGjShuTmpmxjFwEy9hqkDn8Ohai3AMYNs0JBkIks54cUVrdzw922YTTY STmo1iBLPG/AUY518jnEx3GGeA1CdRQA9juXY9Te+/F5thJWu4mUxWAqBsV8ndx13okT jmKBITrUuc6upPyvMbAf2A73V9fmCTxjmwLI6DS6VaUDfhHUS+kuhraVTmUV0Qbr8YVK Xdh9xvM3/UpGmBkczt1f1jHu+X/S3KZ8MpFmyEHpzp3qcQJZzrWEXBqcuVFX8sfNKfr2 /GdcjIWN+tHZpErDQQ6WH6/A7bjqBHbO63vC+AOs4l8GktLLpTNZTi88OKREzv6Ga26c pSXw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d6si6292657ejr.400.2020.05.11.11.15.49; Mon, 11 May 2020 11:16:13 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731072AbgEKSNY convert rfc822-to-8bit (ORCPT + 99 others); Mon, 11 May 2020 14:13:24 -0400 Received: from mga07.intel.com ([134.134.136.100]:46999 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726891AbgEKSNY (ORCPT ); Mon, 11 May 2020 14:13:24 -0400 IronPort-SDR: zaMNC/w3azGH/oNgjNzF1nny4uSFEu+e+0Chp0q5enZ6VOKDSDmtVVeNFrmroAkNleCGaf6phN w9y+HNtx9ppA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2020 11:13:23 -0700 IronPort-SDR: 4yn5bQ6SzOqq6GhdNt4t87npsuluYQWvNQB8Ku44Q6axiNqEfWtTVx9UXsJapXpIHTxZyo2p5R cEOwBqNcJsRA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,380,1583222400"; d="scan'208";a="265240180" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga006.jf.intel.com with ESMTP; 11 May 2020 11:13:23 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 11 May 2020 11:13:22 -0700 Received: from fmsmsx108.amr.corp.intel.com ([169.254.9.60]) by FMSMSX110.amr.corp.intel.com ([169.254.14.169]) with mapi id 14.03.0439.000; Mon, 11 May 2020 11:13:22 -0700 From: "Ruhl, Michael J" To: Daniel Vetter , LKML CC: Intel Graphics Development , "DRI Development" , "linaro-mm-sig@lists.linaro.org" , "Vetter, Daniel" , Sumit Semwal , "linux-media@vger.kernel.org" Subject: RE: [Intel-gfx] [PATCH 2/3] dma-fence: use default wait function for mock fences Thread-Topic: [Intel-gfx] [PATCH 2/3] dma-fence: use default wait function for mock fences Thread-Index: AQHWJ3Q9b7FvqdjeFkWZgt98eLHlv6ijMJew Date: Mon, 11 May 2020 18:13:21 +0000 Message-ID: <14063C7AD467DE4B82DEDB5C278E8663010E20F842@FMSMSX108.amr.corp.intel.com> References: <20200511091142.208787-1-daniel.vetter@ffwll.ch> <20200511091142.208787-2-daniel.vetter@ffwll.ch> In-Reply-To: <20200511091142.208787-2-daniel.vetter@ffwll.ch> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.1.200.107] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >-----Original Message----- >From: Intel-gfx On Behalf Of >Daniel Vetter >Sent: Monday, May 11, 2020 5:12 AM >To: LKML >Cc: Daniel Vetter ; Intel Graphics Development >; DRI Development devel@lists.freedesktop.org>; linaro-mm-sig@lists.linaro.org; Vetter, Daniel >; Sumit Semwal ; linux- >media@vger.kernel.org >Subject: [Intel-gfx] [PATCH 2/3] dma-fence: use default wait function for >mock fences > >No need to micro-optmize when we're waiting in a mocked object ... Makes sense to me. Acked-by: Michael J. Ruhl M >Signed-off-by: Daniel Vetter >Cc: Sumit Semwal >Cc: linux-media@vger.kernel.org >Cc: linaro-mm-sig@lists.linaro.org >--- > drivers/dma-buf/st-dma-fence.c | 41 ---------------------------------- > 1 file changed, 41 deletions(-) > >diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma- >fence.c >index e593064341c8..8166d2984702 100644 >--- a/drivers/dma-buf/st-dma-fence.c >+++ b/drivers/dma-buf/st-dma-fence.c >@@ -33,50 +33,9 @@ static void mock_fence_release(struct dma_fence *f) > kmem_cache_free(slab_fences, to_mock_fence(f)); > } > >-struct wait_cb { >- struct dma_fence_cb cb; >- struct task_struct *task; >-}; >- >-static void mock_wakeup(struct dma_fence *f, struct dma_fence_cb *cb) >-{ >- wake_up_process(container_of(cb, struct wait_cb, cb)->task); >-} >- >-static long mock_wait(struct dma_fence *f, bool intr, long timeout) >-{ >- const int state = intr ? TASK_INTERRUPTIBLE : >TASK_UNINTERRUPTIBLE; >- struct wait_cb cb = { .task = current }; >- >- if (dma_fence_add_callback(f, &cb.cb, mock_wakeup)) >- return timeout; >- >- while (timeout) { >- set_current_state(state); >- >- if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &f->flags)) >- break; >- >- if (signal_pending_state(state, current)) >- break; >- >- timeout = schedule_timeout(timeout); >- } >- __set_current_state(TASK_RUNNING); >- >- if (!dma_fence_remove_callback(f, &cb.cb)) >- return timeout; >- >- if (signal_pending_state(state, current)) >- return -ERESTARTSYS; >- >- return -ETIME; >-} >- > static const struct dma_fence_ops mock_ops = { > .get_driver_name = mock_name, > .get_timeline_name = mock_name, >- .wait = mock_wait, > .release = mock_fence_release, > }; > >-- >2.26.2 > >_______________________________________________ >Intel-gfx mailing list >Intel-gfx@lists.freedesktop.org >https://lists.freedesktop.org/mailman/listinfo/intel-gfx