Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp684303pxj; Thu, 13 May 2021 14:31:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbPRwfDV6Amj0QwfhTFPZV23iimfWndQb3lkyRmoRVxEOQWUGRYuBPUP0nzRxC0HG7zIBx X-Received: by 2002:a17:906:1305:: with SMTP id w5mr6281405ejb.404.1620941509035; Thu, 13 May 2021 14:31:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620941509; cv=none; d=google.com; s=arc-20160816; b=o3xKAfpGSLOEk5UNnRP9DQt5qOXi12flQcKeVP9yICZdRc/bDRTAdluw3D+8GBF6fR paa8PEbR96wo6vf+ht98T92PljLPvoN1hDHH32cM9xepSJqNWWyyDBm6FA0TFX3Jx4UZ 6UTchlmJJlp9IbSlEuLP44Ux6RpTYOwf0FN2bOU7SEg8KniImfNVg3ZeAK+wTXYj67qW PtEu2R9JmKD2JbYXE4Ut4HaDSkyCv0kVzCvD8F+v+6Vqw7OqTgm7DZK/CN8Cc0fBkWnP ZG8XSYzi5R1nduNuDI27pAYqX3X/DIt8AyCvhamqNMuY+ZYMR2g2YnIND9Aib3J5kRTj LfBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=B+baY95FPQkUPXLrLohTvFtYOpo3rW+vabm9FMks7dk=; b=hf8H68dNbFQI2zrhtsw/NcJdRBbDDYOEhsycD/ppJOfJJhywwGYJROBgIcFbQRAUDL XXl007DQcs/SZFuRG+Dal3+PRtsZGcafEFKfsuMXJNSDzzwSvNJ+DvYtGZRCZD4uz0lf 84eAutOqhUoARK45YXO3C86kPFvW1Xu/KrszH+nPdmI01GZW5Y1hiTLvLmdxhmWhKG3i hNOVv3tLCbcUamF7ayBLsslXAMjF/NDwAGLae+7iaviXQ6j/6jCSC2k3ywR2WK2T+7AK AET59J6/c+RWmFL76pmOrYRuAQWYtWm1rE0lnp/PFYX0CNrIqjyMRyW8lghG/pvv7K6V e78w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=LDasP70e; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si4577853edw.369.2021.05.13.14.31.20; Thu, 13 May 2021 14:31:49 -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=@infradead.org header.s=casper.20170209 header.b=LDasP70e; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234402AbhEMOUB (ORCPT + 99 others); Thu, 13 May 2021 10:20:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234401AbhEMOTe (ORCPT ); Thu, 13 May 2021 10:19:34 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B48DCC06174A; Thu, 13 May 2021 07:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=B+baY95FPQkUPXLrLohTvFtYOpo3rW+vabm9FMks7dk=; b=LDasP70eq35ARTWIIMb6R3kT/r sue+s3m1wbJ+CikD25M95FFEObL2ZaWyTtzLbSXLSCsORASp3dWwlR3VGd1qt7k9aT3MaP8pVY7QT NMGlZBbDGfCy4UmJYVn6m98qgIbwBsCcKXTv9/xp35uhod5VQlZvOoUXzknv6XDBa4JTA2TjRafJp VDMXqDcrFVMrNPoAYw1qxpdOZ6hswDa4Rden633hap26Gk6mVmCJokSnXYPqeh4VadjPzI4F0OwbQ 5aTAZjcR+kZhgr+HJzcAtebcnyjwrhVhD/LPH9w5w5ArI+qUB4hGgisACOUZ9+n6Xwdvqe9F2/cwT NMDEnv+A==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lhC8O-009V3t-SO; Thu, 13 May 2021 14:16:33 +0000 Date: Thu, 13 May 2021 15:16:16 +0100 From: Matthew Wilcox To: Maciej Kwapulinski Cc: Greg Kroah-Hartman , Arnd Bergmann , Jonathan Corbet , Derek Kiernan , Dragan Cvetic , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Tomasz Jankowski , Savo Novakovic , Jianxun Zhang Subject: Re: [PATCH v3 11/14] intel_gna: add ioctl handler Message-ID: References: <20210513110040.2268-1-maciej.kwapulinski@linux.intel.com> <20210513110040.2268-12-maciej.kwapulinski@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210513110040.2268-12-maciej.kwapulinski@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 13, 2021 at 01:00:37PM +0200, Maciej Kwapulinski wrote: > +#include Please don't use the IDR in new code. Use the XArray instead. > + mutex_lock(&gna_priv->memidr_lock); > + mo = idr_find(&gna_priv->memory_idr, memory_id); > + mutex_unlock(&gna_priv->memidr_lock); You don't need your own lock with the XArray.