Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2145057rwb; Fri, 11 Nov 2022 05:46:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf6HY/JfrNfmrxENTkfrpa5E/U6sGT3GeW08zS6DwZhKewv7sH+qgJoky8MMeZHB99Y6qQrT X-Received: by 2002:a17:902:a612:b0:186:b3d0:f75 with SMTP id u18-20020a170902a61200b00186b3d00f75mr2679299plq.48.1668174381745; Fri, 11 Nov 2022 05:46:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668174381; cv=pass; d=google.com; s=arc-20160816; b=02/6KVUr67WeHP5LGvPpxqNWBEDtWTAZhfdM4lckUZyC4No2WBj3pFNbptqeVqSd5d eNCa7mAjA4B7gBakrJBjpM9QOaphUvpipEq5bt6ScKE5NyTMUBkwvann4sgl691KD/bd Zcl/8LkYyhs2sf+pKEf71ygfxXIK5F+1alF9PwcpyTZUCHNnJyEnanXrjdNgKl4Y6I4i PMgS+0dWpNEH5HR8eE4ZDvoizv5/5b3GVEcGAGAK4e+Z3GjzZ2Hp/ApzDRIpV1NeH8hc 4K+Vx3sAeTamZvuu2eVZHst4MuL5ZwoLYRCS5HImx6TGTHKNSjjNSJrkx0hEpC1fCYaF PmSg== 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=HJLNPcFWzS5LAsaAXKd+bnp5iG4de7O6aWUVA6YX2Xw=; b=YFOOCF6gIjunZuCsWTEAcbMoCV8U3YtiuFe+CncG2sQDIymrT3a4I1b0n17gMma/l9 WECwTyFL27qXT5qzkZ01JqYqxlr3cG07xs35Nw8hZ0FyRir19lnC/8dMkyb7LQkR50kf fIR7AZegmuDlW/ySej8ZMFz8uqqU4qwUurbrvuYj7K5A/KmNbJgEUs6oJTHQl9t0arYi l8DaOXl4CHqMvFvhvLqMba5IVX0egrrfcR3y8DoV6eE5fqAjR/hheyn8mRLGSvgjJd4Y VIkHHSzkag4EOLTmfekUPUunwfStOW5mjwPs3uclbxbX/nA6KjM4GXT3OByK/xq7R/CL 82Ow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=2yY6LRc3; 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 k6-20020a170902c40600b0017a0fe2e1fdsi2892402plk.450.2022.11.11.05.46.09; Fri, 11 Nov 2022 05:46:21 -0800 (PST) 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=2yY6LRc3; 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 S233608AbiKKMrp (ORCPT + 92 others); Fri, 11 Nov 2022 07:47:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232416AbiKKMro (ORCPT ); Fri, 11 Nov 2022 07:47:44 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2057.outbound.protection.outlook.com [40.107.223.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3709A663F6; Fri, 11 Nov 2022 04:47:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WXcZVlyzyER8RMbnJF8v/+bqxUdzws261OwdDQF9iN6eROefh7LcbpMr1SB6+oopWGqjmOfzxRoZM4jZHAUf0ZbSGzAOsiPLGcxbGWUAVRJPtCN5WFemA37iE2LfAT+2LNFbU7+ogzryvqAntKrRx3LbI2ZbNwmq3PbFy1fq1QwT6dgCJgZaFkk9Gv2HkI9EdpcL+FcpyUcQ37rAAK4ZEG/9/4+YeT9sEnbWS9rLt5sk00N8FK/QCckSjNzVjr8i6JZcWyJcILJ8OqAgziP0Im5Z7IEQNvvtKox/wqdQ2enmFRe9kkUBRer7NmfrKzKq+6UwOwmVh3DhOJwM49Jyow== 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=HJLNPcFWzS5LAsaAXKd+bnp5iG4de7O6aWUVA6YX2Xw=; b=mhEPt3f6r52Xge5dEn/iIJFYIFG8XnIgw3xGj5xFTgA1rXn6F7PHV/31/QzvYyvO/XldhiLpAnxwaeOr8lSaTTpPa0lIaRqXT/D/SNOYNPx/sjlmPrqUN3fAxBwiJFHZcH6u7hbWAJ3m0eIbUys1HAH5pFRiQZv+PYXTn9h/9KUlC4zfcb4CIgxlV/hmR5LmKtOP4kHpp678QZZw7GFjukxMCEvWpgS9Nzl9YVfIJmd4MEqiOsJCygwiQonE15YA38N4rUxIMsUNmLxOj1fvJLsCfC/yfiyvjbwoEIf+HitMeM7Qg1dMhvQAqEx4ZDJ1P4nSrD4oG64eZE4ToQM+mA== 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=HJLNPcFWzS5LAsaAXKd+bnp5iG4de7O6aWUVA6YX2Xw=; b=2yY6LRc3CYF+JZbSIR8m9lssrVBW8kIMFdUQ5X8qfmLJwlxWibpEHPZ1xu8EgyZH1N6wgizoSKpwu81s2h9VR7PrLRL31wn/SUUOd2+Yr1APd8Y8/TrMewDmSb0j5cFGmne/Dm19TN6XPjEZpilzw2Yd5RX5izno5UPD9v5yljA= 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 CH2PR12MB4199.namprd12.prod.outlook.com (2603:10b6:610:a7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13; Fri, 11 Nov 2022 12:47:40 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::7d43:3f30:4caf:7421]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::7d43:3f30:4caf:7421%7]) with mapi id 15.20.5813.013; Fri, 11 Nov 2022 12:47:40 +0000 Message-ID: Date: Fri, 11 Nov 2022 13:47:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v1 1/6] dma-buf: Move dma_buf_mmap_internal() to dynamic locking specification Content-Language: en-US To: Dmitry Osipenko , Sumit Semwal , Benjamin Gaignard , Liam Mark , Brian Starkey , John Stultz , Gerd Hoffmann , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Thomas Zimmermann , Tomi Valkeinen , Thierry Reding , Tomasz Figa , Marek Szyprowski , Mauro Carvalho Chehab , Srinivas Kandagatla , Amol Maheshwari Cc: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@collabora.com References: <20221110201349.351294-1-dmitry.osipenko@collabora.com> <20221110201349.351294-2-dmitry.osipenko@collabora.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <20221110201349.351294-2-dmitry.osipenko@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR3P281CA0175.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a0::12) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8PR12MB3587:EE_|CH2PR12MB4199:EE_ X-MS-Office365-Filtering-Correlation-Id: f89c8762-41b6-4bc3-f266-08dac3e2eaec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nwCY2YXDKaT4SOcSZ2Hlh9R1/2lM21XVJ4WgHHqI9s8fILGmlu5cedKcumDnyn0euxgBZEg+bjLiP8cVGNn0+7vXQZtcNBx8Q8rPTgJGmHT9qGdXJ/wYdOV7KLaIw3Xpe/z6T8obSCUxVFj+DSVKNcIrsBkLOLeFYJuPRubBvnmaNR5FybzwpdtOacYizNjNfYVW7KtPKbmMKrW5S7wKeAX5szs4+6UTNC3+Kw1isz0uV9jfe7rcKmd6vdkbileIHQWGSfTzD3JdoD32R/PWuxP31C0n4xBtICIDUj9yCpq7FYV6vfNZJ7V48+S+YhUb1oDCnYutnlZm3cqtXIERSyU43GHqsGXYBhMLLQZKxuvPryhIWW/Znb7vxkjXuxCo1egzP/ey50XNdlA9T5X0JjEe3opgLPq6xfRnVZFwRHcpXbFq4oeZy1H4o/fE5IeZu6ehqAesELoU4ttXDE2/G48Ekw7f1i6rlVJZdzY/FALGwRET4R8rFVnwhNquTyzTM1uKO6sTnpk/BafEZ6o9Hn2MFbc+dLrvB22jgrjAAYHbnCa3TAHUd7+1YB+tzYpLuaDQQ/fhYX1mRfM67YAYv/QctVYv/GwJ2rij/twEFg3luRyCkSuGc0GULh7Ir8YuQhS/IMasboIZU1kl+l8URw6ZcUaLn9QOtPNAEG5/9hJvZpBL8AzjubPT0i333IckQdSkmG1HtK2Z+RbyVwo915E3EAwCJVBaQ97NXTnd/PzJY3iwlV+qyJg7SLaRVOV2FlPig1hEpWTZPhkuMDEL/ISt7TWgRjqNxh9/pcdBOYGTWCO0ybf1UPs/60iaRyVh 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:(13230022)(4636009)(346002)(376002)(366004)(39860400002)(136003)(396003)(451199015)(2616005)(83380400001)(66574015)(38100700002)(186003)(6512007)(6506007)(66556008)(5660300002)(7416002)(2906002)(6486002)(8936002)(41300700001)(110136005)(6666004)(478600001)(4326008)(66946007)(66476007)(316002)(8676002)(31686004)(921005)(86362001)(31696002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TnhCeTdMc2FMZ1JCcWlSSkJjTlRKR3NKRkswMmFSUzB5OHVrTzI0ZzVPNXhM?= =?utf-8?B?ak96N1R6YStnY1FaS1RkektpSzVhbFg5bUtVbXZEbGM1ZHNrNHBWQ0ZoK2Zp?= =?utf-8?B?cXlzKytjSXFkUTF0Q04wSDU2V0orUG9LTjVNdzl4T3I4Q3hvQ0o0a0dCSnY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lldE1CUEJXV1MwZXFXMERFenNkb0FvMWVxOEJmaUYzUjEw?= =?utf-8?B?QURJRXFReUNSK0Y3cURaMDZnVFFCOWJIcThXcUR3N1RuVjZseXpVdnVrYWhs?= =?utf-8?B?cTFCcGhhNk1ScHI0UFNMQ1hGMjVwSjV5QjdJd2xaMHkxWDArd3o1ellVRURE?= =?utf-8?B?VHFjSDNVM1JmdFMxSlFrbm9rcmpKaERPdENzdUczQXpndytVTG1ZMUJuRWJP?= =?utf-8?Q?MPcLhqYbqPcewTTcAh5Hkm7qPbL9eMIyXZ/YdVEPqCON?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: f89c8762-41b6-4bc3-f266-08dac3e2eaec X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2022 12:47:40.4643 (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: 4Lcrb/9myqqM+nDq2DY5EPNWQbX1d3ePsRW/zGwcyIpIw7VZvzKozkyUn02f43xl X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4199 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 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 10.11.22 um 21:13 schrieb Dmitry Osipenko: > All dma-buf functions has been moved to dynamic locking specification > The dma_buf_mmap_internal() was missed out by accident. Take reservation > lock around file mapping operation to adhere the common locking convention. > > Reported-by: Daniel Vetter > Signed-off-by: Dmitry Osipenko Reviewed-by: Christian König for this patch here. Acked-by: Christian König for the rest of the series. Regards, Christian. > --- > drivers/dma-buf/dma-buf.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c > index 13bfd2d09c56..b809513b03fe 100644 > --- a/drivers/dma-buf/dma-buf.c > +++ b/drivers/dma-buf/dma-buf.c > @@ -129,6 +129,7 @@ static struct file_system_type dma_buf_fs_type = { > static int dma_buf_mmap_internal(struct file *file, struct vm_area_struct *vma) > { > struct dma_buf *dmabuf; > + int ret; > > if (!is_dma_buf_file(file)) > return -EINVAL; > @@ -144,7 +145,11 @@ static int dma_buf_mmap_internal(struct file *file, struct vm_area_struct *vma) > dmabuf->size >> PAGE_SHIFT) > return -EINVAL; > > - return dmabuf->ops->mmap(dmabuf, vma); > + dma_resv_lock(dmabuf->resv, NULL); > + ret = dmabuf->ops->mmap(dmabuf, vma); > + dma_resv_unlock(dmabuf->resv); > + > + return ret; > } > > static loff_t dma_buf_llseek(struct file *file, loff_t offset, int whence)