From patchwork Thu Mar 9 22:21:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacob Pan X-Patchwork-Id: 13168416 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F29BC61DA4 for ; Thu, 9 Mar 2023 22:18:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230088AbjCIWSU (ORCPT ); Thu, 9 Mar 2023 17:18:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229835AbjCIWSO (ORCPT ); Thu, 9 Mar 2023 17:18:14 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59BE2298C9; Thu, 9 Mar 2023 14:18:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678400292; x=1709936292; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jgqfl9dl4fu6uMtJqZ6F6+dnX8IYDV3LSFTgul9NRy4=; b=Gp+EBBCrpX0sU4lYRDp9ss/EvNnT77V00hss7U7uM+l1b3nl5fZ0x05m GoDT/xG0nQIDwG7Kmby8i5pshm06U4DQxBIkfi3XrpohOuYM5egFHEvc1 4gh/3XuH1OP/nATNrRH7/lyzan32r7W4p+cY1j8MpCC1T9WCQuwxAxTiY c0Kid6k2PZp+CJp8J43XY3Q6KjGSB7rQm3zQDRdg7TLNLy1A9VDgWex9I iFZSnyHhMv+YDpr/BWgw2P1pzpy+mfCXa7BOMz2okBhl1zwLaYi4XSr1U iJpfguJIq+5eV9FINxPjWyeLkvMNwD5YW49pbQZkpQajaGw+NUF/5lfJA A==; X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="364235249" X-IronPort-AV: E=Sophos;i="5.98,247,1673942400"; d="scan'208";a="364235249" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2023 14:18:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="707788852" X-IronPort-AV: E=Sophos;i="5.98,247,1673942400"; d="scan'208";a="707788852" Received: from srinivas-otcpl-7600.jf.intel.com (HELO jacob-builder.jf.intel.com) ([10.54.39.106]) by orsmga008.jf.intel.com with ESMTP; 09 Mar 2023 14:18:09 -0800 From: Jacob Pan To: LKML , iommu@lists.linux.dev, Jason Gunthorpe , "Lu Baolu" , Joerg Roedel , Jean-Philippe Brucker , Dave Hansen , Thomas Gleixner , X86 Kernel , bp@alien8.de, "H. Peter Anvin" , Peter Zijlstra , corbet@lwn.net, vkoul@kernel.org, dmaengine@vger.kernel.org, linux-doc@vger.kernel.org Cc: "Robin Murphy" , "Will Deacon" , David Woodhouse , Raj Ashok , "Tian, Kevin" , Yi Liu , "Yu, Fenghua" , Dave Jiang , Kirill Shutemov , Tony Luck , Jacob Pan Subject: [PATCH v5 5/7] iommu/sva: Use GFP_KERNEL for pasid allocation Date: Thu, 9 Mar 2023 14:21:57 -0800 Message-Id: <20230309222159.487826-7-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309222159.487826-1-jacob.jun.pan@linux.intel.com> References: <20230309222159.487826-1-jacob.jun.pan@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org We’re not using spinlock-protected IOASID allocation anymore, there’s no need for GFP_ATOMIC. Reviewed-by: Kevin Tian Reviewed-by: Lu Baolu Signed-off-by: Jacob Pan --- drivers/iommu/iommu-sva.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c index b75711bdbe97..bd6fb2a6df23 100644 --- a/drivers/iommu/iommu-sva.c +++ b/drivers/iommu/iommu-sva.c @@ -27,8 +27,8 @@ static int iommu_sva_alloc_pasid(struct mm_struct *mm, ioasid_t min, ioasid_t ma goto out; } - ret = ida_alloc_range(&iommu_global_pasid_ida, min, max, GFP_ATOMIC); - if (ret < 0) + ret = ida_alloc_range(&iommu_global_pasid_ida, min, max, GFP_KERNEL); + if (ret < min) goto out; mm->pasid = ret; ret = 0;