Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp373875rwe; Thu, 1 Sep 2022 00:27:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR48g9DesjIlbB55WM+rbjtm4851ETvGZpyoOxo9p8SNBC3ASwmI3pwBECs7VsL4nKyAPQPT X-Received: by 2002:a17:907:a0c6:b0:741:d9a1:e2b6 with SMTP id hw6-20020a170907a0c600b00741d9a1e2b6mr8808855ejc.99.1662017230052; Thu, 01 Sep 2022 00:27:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1662017230; cv=pass; d=google.com; s=arc-20160816; b=G0Rl0N9GlIEPIww4av/kTYH9NT1Yw3dafkxZbCg7pibBTeAmjPg1yNL/M6qVvxFXLF PgYuFiSQrsqBTbJFFXqoYMejiuNQHGdAxCaEto1nL2d1aCJvokJebg+64m12Ss5ApApz RAsbx4/6wRqFWuQm2NQIS3rgHe+XQQr5SOwmFKU00iMYyDXO+SCkKJkgbfL6gnWLz0xB cL90dZ6jebPi4LsOkHTLTVhUJ1dF4R55/W1aqUmO1blUIEPsbggbXKDniThH1hSYDm/q 2w89/QwfkQ4B/fB4pYuvANPbR1LBHwqhVGcw3M/SMemvKPZzr72O1WaixNtgrSVdHBrf gPgw== 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=NHLVt8A/betNG8SaQLcMk/gr0EGqztrxEPR0r60twJk=; b=hp99IrzOc9fhqFifkSQx0HFpXZxs7/w/0FXKZ+6vALSQ6+foUEkPYuo9Bl75v+zaOB wbREcfCnN3NJA5Jor3ZBjsWI+BUVUFSXeTFxlKYBONJESDUbx06cU6/TYFhLa5P0Pg8Y x3vU2b3aaKMaP58SNp+SmXFIS32gZv0NzhDoDXyqKWeBkY0i7mmudYFzY2areOF9dr1a KpTfiwgqUM57qBR15mylCnG0cN+T0FKArToQQHfkqSInBpearlHd7/aJq5udyVmBAPof awTze7/4w/Q/fe9zCKavu0Pyy8GFkYvz/x8Ii0SDxlgBoz2UdPJm1HWVGAUVzKDvaMvT 1iaQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=WoSPa4NK; 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 di8-20020a170906730800b0072f0a9a8e61si6045792ejc.368.2022.09.01.00.26.41; Thu, 01 Sep 2022 00:27:10 -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=WoSPa4NK; 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 S233017AbiIAHQt (ORCPT + 99 others); Thu, 1 Sep 2022 03:16:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229706AbiIAHQr (ORCPT ); Thu, 1 Sep 2022 03:16:47 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2046.outbound.protection.outlook.com [40.107.243.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E4AD1243D2; Thu, 1 Sep 2022 00:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C7FWfhsNIwuOy3OT430mYaGey6sF8Vu5uEaDtfN1ZjawwylmzfN73TkMV4zrqYXYmL0q96pwqkHSUuYqU+IMKhBSOn3IQ3E4eluFz3k+kJP3mvQvjPGthlcHwjfvF4SvuPsw7QV/Mxn3BuoRVx9j5L3A4y3F4lOhAHKHKRIoapJi4cDhule0jB8nMGTtrKzYgH7onq0pYi1DeoQz75UeP+cHAheeZjtFdxXLMfpYylAgWnlAgLKaVzwY9MRAXgbdGSFUPFSvioX5PD/A5a4dbrdJ8b/EThSK+kktS19t4QkgoDP2nKnmsx7AFyVCMbLgcA2e9Eb6bp1AQbR72xYamA== 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=NHLVt8A/betNG8SaQLcMk/gr0EGqztrxEPR0r60twJk=; b=K98IkF/UVErQl1bxJO17OG1G3BL2n4TR46E8bahAnqMJ2XhqYVCQNsWU7j+kEV3BVw7Be+NK9U0JCBG8azwKxQnpaIkaOyNh1WAwK21t6yWcDmStM2/Ub9yh7at4js2hatO+k58NGRPwQHefQzX9RGC0al4gPq7SSA0DeI1Kzyk/tDgsoa/6FDp2vS0/bmhMfzRzZM+3cuGwtfZaEUGAnhvE+lJliiGCmxQUc5WEdar5VCLJSnl8mez9KjxQ+2Hi0V2H00UcJGGyYZ0Na3r1eqRfEKGWEhg4AdXqxgn9Tj001YOjZTF3nRDK2rGYtmXFP3clr0uMSgM+POEeP0TnDQ== 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=NHLVt8A/betNG8SaQLcMk/gr0EGqztrxEPR0r60twJk=; b=WoSPa4NKSM+sNNoVSdwEiaNK3CYxWcJM8VyLXLT/1fUeGc8nLV6z6hqveZ/Z6jzaTIFgXD1G85X61HeMqMolDmQjS2jBFPljYyTbStfB1dKRAxY3nex415jYHMIdge6xGHzxdaLd1f5jcFsr7voeme/zkSCkzsz2CUmEqxZLOoY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BYAPR12MB3589.namprd12.prod.outlook.com (2603:10b6:a03:df::29) by BL3PR12MB6547.namprd12.prod.outlook.com (2603:10b6:208:38e::6) 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 07:16:44 +0000 Received: from BYAPR12MB3589.namprd12.prod.outlook.com ([fe80::a997:c7f:aea0:764a]) by BYAPR12MB3589.namprd12.prod.outlook.com ([fe80::a997:c7f:aea0:764a%4]) with mapi id 15.20.5566.021; Thu, 1 Sep 2022 07:16:43 +0000 Message-ID: <192b9a30-6f15-3702-c679-c3f26b76c9ef@amd.com> Date: Thu, 1 Sep 2022 09:16:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v4 19/21] dma-buf: Document dynamic locking convention 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-20-dmitry.osipenko@collabora.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <20220831153757.97381-20-dmitry.osipenko@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AM6PR05CA0009.eurprd05.prod.outlook.com (2603:10a6:20b:2e::22) To BYAPR12MB3589.namprd12.prod.outlook.com (2603:10b6:a03:df::29) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5e18351-2cd4-41b9-f3c2-08da8be9ec5b X-MS-TrafficTypeDiagnostic: BL3PR12MB6547:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4AArAxg4nVDu1rhkdi0sNgfrkQsWv+kLvK2ItSwhgIFNzvFeRMASaBVoRGVxBONS745plw8B7i0cnajmxceI/9/O+b3BSSb6ERlL02JLrCNEl++PdQyqxWBFXfREO1y5N5qqtoWKs4s1NlJdOjE/breaBH2RfCQjZnJhUoEka7PcJ+xcMkdoT3D6l/jRRmMcrJd5Sz1Zzme0poH7NokTYcuvgaDitYpkM8rGBLykUW3iBzwrdmYvEvEbMbqw+hBDupzxPuzkjNwcdhwbXPQj0SFslYtIAxcQZQNjDw7Qv7BeSovaOAx6E2eu3LAY4BkA9/NxU9MGtduw45bRVfUmXMHl5ZXPfNfmQxQ0uODW+N6CGT63KjhZnw0Au3nvBTKZnFZwBagO3wuJXt6QIgrm/sgVk543QU/gVjE2pBzFJ3G7Dlf/RaekCRWq6OQMUSJm24Z/CQMTxNqgme5ohCe3CfgeeJbkfkoWibkS6R2GioAn8P3XcqMTxy4gGm8249WNTp7V+2JliOZ2TlVBiByK+uyD+tq0JexBmta9HGbaWutqDBTIyTGcapvwwroLY9gklWM7i7Q+2kX0t2xgEYzHgt9mOn8Bsxf/8zQHew8wkh3TK18AoAix1okNy1wFik0V1WNpkVW7bYPUm3vyPJMwcLWxchRwNp7gG2LS99ycTp2CHZ1kiaGd35lRO7jUd37o0B9MWmXi5UJXdbNpUrNYHH5qhZv2yraTgWK7yGHw6MuCxwXLzahX8vKE4aHxh1rHb4qWLKoOJCW/BVCQqjEnRNSNiGPuDl6uPzuPvk8sT3QpA4kFoXWlp+mQhXRgXbrY X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB3589.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(136003)(346002)(376002)(366004)(39860400002)(396003)(7416002)(66556008)(66946007)(8676002)(4326008)(31686004)(921005)(66574015)(66476007)(36756003)(186003)(5660300002)(2906002)(8936002)(7406005)(316002)(110136005)(6486002)(478600001)(6666004)(41300700001)(6512007)(2616005)(6506007)(31696002)(26005)(38100700002)(83380400001)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-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IvallrV3BUVDB4MFJFOFk0WmptbUJLUU1zcnNETldGc05jWDJ3RE03M1RS?= =?utf-8?B?ZWNOc2ZRd3Zwaks2YmorbUROeTdSYVNxcUhrekw2MXhIQ09SdTVMZXREVUto?= =?utf-8?B?VTlIR1pHc0xMeW91NkpYMTY3cmJVTE9EWXV0MHZIVGsrMFVuVndGVGlaWE9R?= =?utf-8?B?TUJyTW5aelNNNlFlNFlvV0xvY3FRbncyRW1YRnlUZHZDRVhxK2E5NGtKak04?= =?utf-8?B?MHNOQnlSbVMreWhJdmxwQWlRZlVmbjdEWUxjZC81eHJic1doVEpZNzFFWXhk?= =?utf-8?B?WnlWTmFUTGlRRU0xeXJTcHpPVkVwUkJwVkRsUzkxcHlKZnRvKzAxTjBCMGN0?= =?utf-8?Q?BMMjt9L5JlYolxgAYc2AgQyJI?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5e18351-2cd4-41b9-f3c2-08da8be9ec5b X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB3589.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2022 07:16:43.8561 (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: m2uzCUa36if5xNJgp6hjWo3+LnOorUhKbWbiHjxBFPC6dUgghPP+e4hbLY4ArK3k X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6547 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: > Add documentation for the dynamic locking convention. The documentation > tells dma-buf API users when they should take the reservation lock and > when not. > > Signed-off-by: Dmitry Osipenko Reviewed-by: Christian König > --- > Documentation/driver-api/dma-buf.rst | 6 +++ > drivers/dma-buf/dma-buf.c | 64 ++++++++++++++++++++++++++++ > 2 files changed, 70 insertions(+) > > diff --git a/Documentation/driver-api/dma-buf.rst b/Documentation/driver-api/dma-buf.rst > index 36a76cbe9095..622b8156d212 100644 > --- a/Documentation/driver-api/dma-buf.rst > +++ b/Documentation/driver-api/dma-buf.rst > @@ -119,6 +119,12 @@ DMA Buffer ioctls > > .. kernel-doc:: include/uapi/linux/dma-buf.h > > +DMA-BUF locking convention > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +.. kernel-doc:: drivers/dma-buf/dma-buf.c > + :doc: locking convention > + > Kernel Functions and Structures Reference > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c > index d9130486cb8f..97ce884fad76 100644 > --- a/drivers/dma-buf/dma-buf.c > +++ b/drivers/dma-buf/dma-buf.c > @@ -794,6 +794,70 @@ static struct sg_table * __map_dma_buf(struct dma_buf_attachment *attach, > return sg_table; > } > > +/** > + * DOC: locking convention > + * > + * In order to avoid deadlock situations between dma-buf exports and importers, > + * all dma-buf API users must follow the common dma-buf locking convention. > + * > + * Convention for importers > + * > + * 1. Importers must hold the dma-buf reservation lock when calling these > + * functions: > + * > + * - dma_buf_pin() > + * - dma_buf_unpin() > + * - dma_buf_map_attachment() > + * - dma_buf_unmap_attachment() > + * - dma_buf_vmap() > + * - dma_buf_vunmap() > + * > + * 2. Importers must not hold the dma-buf reservation lock when calling these > + * functions: > + * > + * - dma_buf_attach() > + * - dma_buf_dynamic_attach() > + * - dma_buf_detach() > + * - dma_buf_export( > + * - dma_buf_fd() > + * - dma_buf_get() > + * - dma_buf_put() > + * - dma_buf_mmap() > + * - dma_buf_begin_cpu_access() > + * - dma_buf_end_cpu_access() > + * - dma_buf_map_attachment_unlocked() > + * - dma_buf_unmap_attachment_unlocked() > + * - dma_buf_vmap_unlocked() > + * - dma_buf_vunmap_unlocked() > + * > + * Convention for exporters > + * > + * 1. These &dma_buf_ops callbacks are invoked with unlocked dma-buf > + * reservation and exporter can take the lock: > + * > + * - &dma_buf_ops.attach() > + * - &dma_buf_ops.detach() > + * - &dma_buf_ops.release() > + * - &dma_buf_ops.begin_cpu_access() > + * - &dma_buf_ops.end_cpu_access() > + * > + * 2. These &dma_buf_ops callbacks are invoked with locked dma-buf > + * reservation and exporter can't take the lock: > + * > + * - &dma_buf_ops.pin() > + * - &dma_buf_ops.unpin() > + * - &dma_buf_ops.map_dma_buf() > + * - &dma_buf_ops.unmap_dma_buf() > + * - &dma_buf_ops.mmap() > + * - &dma_buf_ops.vmap() > + * - &dma_buf_ops.vunmap() > + * > + * 3. Exporters must hold the dma-buf reservation lock when calling these > + * functions: > + * > + * - dma_buf_move_notify() > + */ > + > /** > * dma_buf_dynamic_attach - Add the device to dma_buf's attachments list > * @dmabuf: [in] buffer to attach device to.