From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 01142C4332F for ; Wed, 8 Nov 2023 08:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:To:Subject:Cc: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SjzV/QN61eYb52XRJfdi0AxeNZrNH1K8NhM1p3cuwFU=; b=Xwb/JQ54+t5W0j 5QtbHqo7yAr/2bu/yRl9AxqUAKsgGfaSwiatvzCr9V7QL95inEVZTCzMC7w/VOo7WOpX3QJPSTPnd 4iAv6p673c/5fayze66cEhNeWCR7mcCBCVYbgtrxzOl6rgk7AcEWB/DWqhlCDRrJsvr/1g+tjokxB O36RGNyT0LAagI854hIrNpKkTyAPrvY85x941E0vn5M0hG3Kz4mvUtCkoznW37o5h22vmyPm8WmWJ Jjp5ptH5usdpSY5dyiYZksVLPs1z9GDLUZ8GpHWSKI2mHrVDxarr29x5N5yvNv3zrB5nJ6V5gFuKH hf42TERoGaQsrPOn6eow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0dm5-003GZT-0B; Wed, 08 Nov 2023 08:18:57 +0000 Received: from mgamail.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0dm0-003GXA-2M; Wed, 08 Nov 2023 08:18:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699431532; x=1730967532; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=o4b+vqtKY9OOVsB1rEVpRTkAptYNaJoA44xLfvE+DI0=; b=Quu8QugOE4Cv9TYmdnDyRrA8nVedqC3uIIXwW6uwAZIj/wmTXV6KP8lu z0j//AUxn8eIVW5qlfxODVzTtXrXqYwBdPcTpuXaipAT2Wov07Cjjt/b4 AEuRQyEmiyPey8PZSObJ+OGQRSZGXeAUgExRWivGeWxTSrMikKc8J5D17 ohziUPO0G6Zf561DE6Dbc2JC9Rd3Quie+7SMqXLgDedfJox8yE6MH17pb vmPQ0UCIgqvD5uZ9B1FaALg/Yipu09YKZAh6KHtzlSopsx+irKfjIVMTB sAWlRBr+v5YQt9N+bidNxLtZ5ehFrRCAeb9dnyNlFwHwggx7g+RifTHco Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10887"; a="420823093" X-IronPort-AV: E=Sophos;i="6.03,285,1694761200"; d="scan'208";a="420823093" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2023 00:18:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10887"; a="828883803" X-IronPort-AV: E=Sophos;i="6.03,285,1694761200"; d="scan'208";a="828883803" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.254.215.63]) ([10.254.215.63]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2023 00:18:32 -0800 Message-ID: Date: Wed, 8 Nov 2023 16:18:30 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: baolu.lu@linux.intel.com, Zhenhua Huang Subject: Re: [PATCH RFC 17/17] iommu: Mark dev_iommu_priv_set() with a lockdep Content-Language: en-US To: Jason Gunthorpe , acpica-devel@lists.linuxfoundation.org, Alyssa Rosenzweig , Albert Ou , asahi@lists.linux.dev, Catalin Marinas , Dexuan Cui , devicetree@vger.kernel.org, David Woodhouse , Frank Rowand , Hanjun Guo , Haiyang Zhang , Christoph Hellwig , iommu@lists.linux.dev, Jean-Philippe Brucker , Jonathan Hunter , Joerg Roedel , "K. Y. Srinivasan" , Len Brown , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, linux-snps-arc@lists.infradead.org, linux-tegra@vger.kernel.org, Russell King , Lorenzo Pieralisi , Marek Szyprowski , Hector Martin , Palmer Dabbelt , Paul Walmsley , "Rafael J. Wysocki" , Robert Moore , Rob Herring , Robin Murphy , Sudeep Holla , Suravee Suthikulpanit , Sven Peter , Thierry Reding , Thomas Bogendoerfer , Krishna Reddy , Vineet Gupta , virtualization@lists.linux-foundation.org, Wei Liu , Will Deacon References: <17-v1-5f734af130a3+34f-iommu_fwspec_jgg@nvidia.com> From: Baolu Lu In-Reply-To: <17-v1-5f734af130a3+34f-iommu_fwspec_jgg@nvidia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231108_001852_786760_485263C0 X-CRM114-Status: GOOD ( 13.36 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On 2023/11/4 0:45, Jason Gunthorpe wrote: > A perfect driver would only call dev_iommu_priv_set() from its probe > callback. We've made it functionally correct to call it from the of_xlate > by adding a lock around that call. > > lockdep assert that iommu_probe_device_lock is held to discourage misuse. > > Exclude PPC kernels with CONFIG_FSL_PAMU turned on because FSL_PAMU uses a > global static for its priv and abuses priv for its domain. > > Remove the pointless stores of NULL, all these are on paths where the core > code will free dev->iommu after the op returns. > > Signed-off-by: Jason Gunthorpe > --- > drivers/iommu/amd/iommu.c | 2 -- > drivers/iommu/apple-dart.c | 1 - > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 - > drivers/iommu/arm/arm-smmu/arm-smmu.c | 1 - > drivers/iommu/intel/iommu.c | 2 -- > drivers/iommu/iommu.c | 9 +++++++++ > drivers/iommu/omap-iommu.c | 1 - > include/linux/iommu.h | 5 +---- > 8 files changed, 10 insertions(+), 12 deletions(-) Reviewed-by: Lu Baolu Best regards, baolu _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv