Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp368244rwe; Thu, 1 Sep 2022 00:18:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR5E6+rMHfRX1XgqEg2SY4vtyX8ae0fQ2DsuuTr5kYIN3WsPe/AaX0oqAvYSYG/1Kita4+nI X-Received: by 2002:a17:902:db12:b0:16e:eaf9:e98d with SMTP id m18-20020a170902db1200b0016eeaf9e98dmr29179903plx.172.1662016718188; Thu, 01 Sep 2022 00:18:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1662016718; cv=pass; d=google.com; s=arc-20160816; b=GaFDMmzhThk61RfHHoBv4CXMtXyP9/mcZpU2JFxdR0UP9nmDOMCRb5anq5HFWtLc+M UFx+987MnZ1hTmiqWCRyWBWEiBrfQKVPqKrT3I25t5kcd+pqYE/1zccNhLkr+DXytAEU dI4WDawceMr0Wn+FwmuVl7PCgD5kGHKpwaDcqbD9GI/Xy60ucbcunYEJix+34evMn/nD 8b1/dZddxg6FXG3kGsu6lMETat17Bnn7hqIKIRYaU9uRSrkYPcg2sG6gRQcw1FSj0hIG EhZ502wvq1VtKha7GCxhgXcWNkogiVTx45cR1DwZUlV3KRGGKQnfO+OqIlyq9Xg/GiVa W79A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=CO9nrEklpYX7tnEq4edqxYFL4EsrLF2kpEA6u4/TGdM=; b=1Buz0SerOYqrErjx1noWszUbOx0aKkdvfBY1we6oZetRa7jD6IY8XGuE8W0VGy5U57 HUXfg2mz4mJlKAHh00GdjK0XAGoXRTvvX9pXWy2npXBlQMhU/WpoEnxmTg+eElSodyL/ neWLJNRWWcX4LgBh0lJgvwWtTUaNvD4x0Pj0TkEWfaq8pZh41BB7f7ZoV8Z/DV8nbYoT Idw63kQUzd9nGq44ZR/pocujC8GmDatl+kVFONMLhrahHusAoE10s9LA/xW6946ZtRrL 6kMpeFF8+gy5HOrCw0QM0lWEZHD56u/ow1OSz2HQ2El/r37WoTehm7Rg1Pa1mqQH0p6T qBpA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=4nypQjFJ; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e16-20020a17090301d000b0016c44b7c8c5si18556501plh.11.2022.09.01.00.18.26; Thu, 01 Sep 2022 00:18:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=4nypQjFJ; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233136AbiIAGpX (ORCPT + 99 others); Thu, 1 Sep 2022 02:45:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229781AbiIAGpT (ORCPT ); Thu, 1 Sep 2022 02:45:19 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 134B0792DB; Wed, 31 Aug 2022 23:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ahTYEC9QIsWQA3pCRmrDzL7V1OOzCuaXptvg2vcr1uBoWIAFAAgtX+QbbkVI2NFPfZUYBJWK+KJO9zV3UVZaaD4Ro/Eqc7g9+OdsaYBYlgpyAgwkyxhWUSxmo8YskqSNV64ZnPSAeGNWPq1KYlYBEEJocnN6w9l8djP+rWX8kscNuLbeBplro3YlWUYGlumtbpxPD1swatRLkJDKaJ3+VzVxFg/k8U611W4xpKzGTfdGbPI6taigcai9fIFnAFfj5hxUJV23p4Ub+cPqzcfjEfJrpIlDsrqBD+c+iVPfsD2T9o8H1tFoZSaDidRDhfzVwagYiuHaGiVs95DEuZaACA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CO9nrEklpYX7tnEq4edqxYFL4EsrLF2kpEA6u4/TGdM=; b=ZZIonSv9iByR9iS9HB5OlHzmBf6GTTCivAvlxcjDXBq4pgJ+4NWapX9gySWRjBR2MNQtiWxBRpzVEihEz9/cWmqGyR6n11OOuNhVqyo2+jdi2W4cfqBGNaJwiAvCOdMcj6c2YYws2Y1GvhDfw/ets5zvwdzbEdvR7+prG594Sg3eQRql1RI8+YtQxqb1o1x56+dqRlt+47I4qmAC64iREOxmCWxq7ldb1mSKCd1ay1/Yb6N/7T5Ckf0XGe+JRJab7hxK/YHYM0OkMiGzccXQ+d+HBuqNAEDizw2LhqKxML8JogQgU4y61SkU33Bct1HtN8QcB4mEoXQ65VfmbmN4gg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CO9nrEklpYX7tnEq4edqxYFL4EsrLF2kpEA6u4/TGdM=; b=4nypQjFJBVh+sM+sOEWfC427n+XX8zUjZTaoB5cGzpcUUP1dRjktgLRW+4aowALo+SWkiNDqxwWw6Cc3ctr0Lhf0evKSvGKfTV2SB/ZOi/ydYMJ9u4aFrFopI4iQ+zsxFQ02s3DhCn8CzVo26sYpNKkY4hi1EO9fnaNxvMLompw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) by BN9PR12MB5228.namprd12.prod.outlook.com (2603:10b6:408:101::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10; Thu, 1 Sep 2022 06:45:15 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::4524:eda6:873a:8f94]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::4524:eda6:873a:8f94%7]) with mapi id 15.20.5588.011; Thu, 1 Sep 2022 06:45:15 +0000 Message-ID: <2463ccb0-6620-8760-fc06-532847835207@amd.com> Date: Thu, 1 Sep 2022 08:45:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v4 06/21] drm/i915: Prepare to dynamic dma-buf locking specification Content-Language: en-US To: Dmitry Osipenko , David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny , Gustavo Padovan , Daniel Stone , Tomeu Vizoso , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Clark , Sumit Semwal , "Pan, Xinhui" , Thierry Reding , Tomasz Figa , Marek Szyprowski , Mauro Carvalho Chehab , Alex Deucher , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= , Qiang Yu , Srinivas Kandagatla , Amol Maheshwari , Jason Gunthorpe , Leon Romanovsky , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Tomi Valkeinen , Russell King , Lucas Stach , Christian Gmeiner Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dmitry Osipenko , linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernel@collabora.com, virtualization@lists.linux-foundation.org, linux-rdma@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20220831153757.97381-1-dmitry.osipenko@collabora.com> <20220831153757.97381-7-dmitry.osipenko@collabora.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <20220831153757.97381-7-dmitry.osipenko@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AM6P194CA0008.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:90::21) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3a74a4ab-696e-4f28-3427-08da8be58665 X-MS-TrafficTypeDiagnostic: BN9PR12MB5228:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2T40/60DPhA+Jlw3HehoxUCX9U9KfdkJaTxhATgiaohs/vuipqQ4DlcD4ySaEFw7ZvmwOiOXxs1g76NONWvWt88M8trdKGRuRW1dzMTOE70HLSH3CutJ4N+UMdOMr1SWxRyLcVKzohJt9TP8TQdJFowdBLXtkRxe4IHx/EuCtQ6sX8C1D0dkvxS5yTf68hnBp1uC6FUIIZ9+SRsXeQDO1tKFF5gWlIms12mKNdGgRsZ/szyH3D6aWfZEEQtEEdxwJFfMKnuFfowHImYKwIDV9wdmT5uP2n9xwusvM7ucDpwoK83C5c1vcd8E7+vcRhlUCAJIZCsly5JBUybFFvLIbBjmu3qCMX6E2/vSpKRKSLnMmQIF3mQP2IA/TsBA5fZ//5v0ZHCNvZLiRSMhdhrdb3zL3W4AWBaSPOofEYv8vbcBh91seC14bLszZKadyWJSlh9x3Gw601jZwZ5fnJfrz8kCWke/Pst6dj3n677iOQOpkvM4IHFB+HkpxlTloWSxAQsXavg6eq28MUARpjB72idYgvmtijtJVrGbPtJlSqkid4zGJh45w23+hkZfIdoSo8G3qyUARh+Rw1OM19dGnClo718I2iOpmFEev8Skxk8UTFok6pAaZ70uTL7Fj7Bff6mZLnOpWLxOBKAhZdZRm3Y6GTIn2ij0JfJy6AFVOQ1roD+VnP/foaGWCHHdtME6C3Vsi0rxjDSDTSPcE1m7a17NWXQCgePLkwCv3hUe9Sw4uOza5DtqFKsP/0b0VZynOf+0j2kCMQAsWKG3KxOe7JD/IE5ZiioM6XFB0OGqC44v2um5rj77JktTbwxQYUZk X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR12MB3587.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(39860400002)(136003)(376002)(366004)(396003)(8936002)(7406005)(6486002)(38100700002)(478600001)(7416002)(110136005)(31686004)(6506007)(316002)(41300700001)(6666004)(5660300002)(6512007)(26005)(86362001)(2616005)(83380400001)(2906002)(66946007)(66476007)(36756003)(31696002)(186003)(8676002)(66556008)(4326008)(66574015)(921005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-Ch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TNpeDZsZGJC?= =?utf-8?B?eEM0bkNDRUtjalZVdTROSklOZkUxRVFQTDdpeWZ1a1pNbHBhTmtBaGF1OG1Q?= =?utf-8?B?K09RaGdUL1hTSTB4SU5MMnRIeGw5VWM1WHRUSzR3NFdMVkdpNVhwNTVqSXMz?= =?utf-8?B?TUpybUY1aTZKWFRHU0p6UWZZak9MRzBXSDRZZm5KM1FaRlVkZmFYVUhlL3RB?= =?utf-8?B?RUExUnFDcUdib2JaQ1ZmYjV1NncycEFDWVlKRVRhL0Q0dDdDdW1XdktuL0Fa?= =?utf-8?B?SnZFSmlqWjZTZGkya2IrWDVGM0gzcWJjck9RMy8ybUdTbjNQV3FIRWNvZC9n?= =?utf-8?B?YnZkUGRKdkVFaktmR2hLZEZzVDg0dTdPanlKbGk4YURLaHllMjNJZ3lESlFz?= =?utf-8?Q?uR5oex08w5wYUxOtfuFIiXDAF?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a74a4ab-696e-4f28-3427-08da8be58665 X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2022 06:45:14.9272 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: i/9qNzgInkJX/XdKXehavtVkTevzayvvOgGwZJJ8NCfq3V7yS6nfj34Jq2ZmNdLj X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5228 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 31.08.22 um 17:37 schrieb Dmitry Osipenko: > Prepare i915 driver to the common dynamic dma-buf locking convention > by starting to use the unlocked versions of dma-buf API functions > and handling cases where importer now holds the reservation lock. > > Signed-off-by: Dmitry Osipenko Acked-by: Christian König , but it's probably best if somebody from the Intel guys take a look as well. > --- > drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- > drivers/gpu/drm/i915/gem/i915_gem_object.c | 12 ++++++++++++ > .../gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c | 16 ++++++++-------- > 3 files changed, 21 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c > index f5062d0c6333..07eee1c09aaf 100644 > --- a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c > +++ b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c > @@ -72,7 +72,7 @@ static int i915_gem_dmabuf_vmap(struct dma_buf *dma_buf, > struct drm_i915_gem_object *obj = dma_buf_to_obj(dma_buf); > void *vaddr; > > - vaddr = i915_gem_object_pin_map_unlocked(obj, I915_MAP_WB); > + vaddr = i915_gem_object_pin_map(obj, I915_MAP_WB); > if (IS_ERR(vaddr)) > return PTR_ERR(vaddr); > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c > index 389e9f157ca5..7e2a9b02526c 100644 > --- a/drivers/gpu/drm/i915/gem/i915_gem_object.c > +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c > @@ -331,7 +331,19 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915, > continue; > } > > + /* > + * dma_buf_unmap_attachment() requires reservation to be > + * locked. The imported GEM shouldn't share reservation lock, > + * so it's safe to take the lock. > + */ > + if (obj->base.import_attach) > + i915_gem_object_lock(obj, NULL); > + > __i915_gem_object_pages_fini(obj); > + > + if (obj->base.import_attach) > + i915_gem_object_unlock(obj); > + > __i915_gem_free_object(obj); > > /* But keep the pointer alive for RCU-protected lookups */ > diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c > index 62c61af77a42..9e3ed634aa0e 100644 > --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c > +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c > @@ -213,7 +213,7 @@ static int igt_dmabuf_import_same_driver(struct drm_i915_private *i915, > goto out_import; > } > > - st = dma_buf_map_attachment(import_attach, DMA_BIDIRECTIONAL); > + st = dma_buf_map_attachment_unlocked(import_attach, DMA_BIDIRECTIONAL); > if (IS_ERR(st)) { > err = PTR_ERR(st); > goto out_detach; > @@ -226,7 +226,7 @@ static int igt_dmabuf_import_same_driver(struct drm_i915_private *i915, > timeout = -ETIME; > } > err = timeout > 0 ? 0 : timeout; > - dma_buf_unmap_attachment(import_attach, st, DMA_BIDIRECTIONAL); > + dma_buf_unmap_attachment_unlocked(import_attach, st, DMA_BIDIRECTIONAL); > out_detach: > dma_buf_detach(dmabuf, import_attach); > out_import: > @@ -296,7 +296,7 @@ static int igt_dmabuf_import(void *arg) > goto out_obj; > } > > - err = dma_buf_vmap(dmabuf, &map); > + err = dma_buf_vmap_unlocked(dmabuf, &map); > dma_map = err ? NULL : map.vaddr; > if (!dma_map) { > pr_err("dma_buf_vmap failed\n"); > @@ -337,7 +337,7 @@ static int igt_dmabuf_import(void *arg) > > err = 0; > out_dma_map: > - dma_buf_vunmap(dmabuf, &map); > + dma_buf_vunmap_unlocked(dmabuf, &map); > out_obj: > i915_gem_object_put(obj); > out_dmabuf: > @@ -358,7 +358,7 @@ static int igt_dmabuf_import_ownership(void *arg) > if (IS_ERR(dmabuf)) > return PTR_ERR(dmabuf); > > - err = dma_buf_vmap(dmabuf, &map); > + err = dma_buf_vmap_unlocked(dmabuf, &map); > ptr = err ? NULL : map.vaddr; > if (!ptr) { > pr_err("dma_buf_vmap failed\n"); > @@ -367,7 +367,7 @@ static int igt_dmabuf_import_ownership(void *arg) > } > > memset(ptr, 0xc5, PAGE_SIZE); > - dma_buf_vunmap(dmabuf, &map); > + dma_buf_vunmap_unlocked(dmabuf, &map); > > obj = to_intel_bo(i915_gem_prime_import(&i915->drm, dmabuf)); > if (IS_ERR(obj)) { > @@ -418,7 +418,7 @@ static int igt_dmabuf_export_vmap(void *arg) > } > i915_gem_object_put(obj); > > - err = dma_buf_vmap(dmabuf, &map); > + err = dma_buf_vmap_unlocked(dmabuf, &map); > ptr = err ? NULL : map.vaddr; > if (!ptr) { > pr_err("dma_buf_vmap failed\n"); > @@ -435,7 +435,7 @@ static int igt_dmabuf_export_vmap(void *arg) > memset(ptr, 0xc5, dmabuf->size); > > err = 0; > - dma_buf_vunmap(dmabuf, &map); > + dma_buf_vunmap_unlocked(dmabuf, &map); > out: > dma_buf_put(dmabuf); > return err;