From patchwork Tue Aug 22 16:15:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 13361126 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 8713DEE49A3 for ; Tue, 22 Aug 2023 16:16:27 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=QogaZgKZpsCnyEqQfqYI6aFJL0PSvdyFnrTCg/mCvk0=; b=ql41bFenOEpOVu PwJWx+1xG5UMBnAFtOVdmOxYiMsLYfQXMqwmKHV1HI5Sm/1tlBp6wT2/2bgk2FYrqZ4/3Ar61faXd kmAs+NyWRgExc9lnf6W4P1zntIi8hAlLoZ46bbnUs50n4len6OUbm1FyPo+XlMx+lz8GNYq2iIjhp 8kqrJWam8ofEdTUATtGZyFHWzOYMJeVtUAIZl2q9RTI7m8nPrss7oEwmnTKO7nwi7ASB+j8oigqVv 3ZJ0kci0x9Sc+bW7a5DXfVwP8sxSd3uYaM26p69DKdzGnU0s0XKnT4JCIugAkRrNno2HHR4crNhqu eAmNSQN621pbeHVjpYQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYU3G-00GS3V-1S; Tue, 22 Aug 2023 16:16:18 +0000 Received: from mail-bn8nam12on2061b.outbound.protection.outlook.com ([2a01:111:f400:fe5b::61b] helo=NAM12-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYU3B-00GRyc-14; Tue, 22 Aug 2023 16:16:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NW24m1VRJBDZ5jFGZS2tT7SRRLbzeC+1QOJatGPZILioWB/xknXwimP7ws7+Ua9mirjEyCyZi+rx2sHTrIEqQAnabFdiuhPfNch3IwU3iMVLZXEv4eH8njCPcbdiKWbgy+9wImH/MjdwSLTHkYEuPpYIgFZ+++82v8Bf24jUMiGq+iBIi+3dOR0c/to3lo8yM5aWWkyUXvyxBSRBqNmxyxIJz5bvb/QvjGJf4J0PJB3R1cjBcZMOW5mADRXXq1T+0og5jaZRkgZ8fOJiadyVepVl23mLkJ1lQY2wnV3MxG3jF9qP2Ma5DhMBD7q/zJcD2Cs9dnqwHcEbB9KLYUeGcg== 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=Qunw758No1uqIWTm52lIxe3fGHIxNkfgVaaLpgAqlZ8=; b=UXDvJCt3+pZy6SOIFhoQhUq3cuqyFSXnP7CBgNozww2uF8MHbNU5efTkqxVZWyiIzuW/iYe1Y7yyJel2qmJ2y6TNi1ZSc4WI/NcLjeMbECeAyyaqAAaQNDziCPdF0XYjAz9gAfAkQedekn4/ZaibEko+xlpkYW/3qpZ2jYePz5CjeE2aOiL3ZFx07LF5AdPFDFIlxh+bzBV6RCIbhxLbNHAlh7ldAGOSBytYtTuFRlP3zF4/qTdtmHoqkqlYh/uEegU7qN+WmlllfM0DZMIxasqi0jl9PrvOrVwoeIrZX1lMVGsegV633Xm3+lSn0ob9rW9FG1UVE6EO31G5Pn32rw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Qunw758No1uqIWTm52lIxe3fGHIxNkfgVaaLpgAqlZ8=; b=tWUotb71MOVNnLbMzZCKsCabLXYw+Pdj2C4uv+F5xe7UId653xK2VdbGBpRbMogTwUc+qO0m899xgCALKHsxnrQNsrPRY88G6efLgX827YkeOioqp+/A6MBQJFRl/cMDOax+54lOx1dEtIHfqNXHQJExQGO0p+KagCF5sdYSOxyAuAgfKgJvcobiIIheqfl4JcvDsPF/5kzXSgQIlFKi4Cf5UE8PyYa6j4w+LCxanulDITdhwqFCgZvxKxDvrrGch8vaigAHMCLoDnBxDSA0cYJ1MITjQPFG6eW3L370AMx/PqMJL6wuP1iG0cwIgI4bfj9Hn4wco8azCP39XPwqyA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by LV3PR12MB9329.namprd12.prod.outlook.com (2603:10b6:408:21c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.25; Tue, 22 Aug 2023 16:16:06 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::5111:16e8:5afe:1da1]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::5111:16e8:5afe:1da1%6]) with mapi id 15.20.6699.020; Tue, 22 Aug 2023 16:16:06 +0000 From: Jason Gunthorpe To: Baolin Wang , Heiko Stuebner , iommu@lists.linux.dev, Jernej Skrabec , Joerg Roedel , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev, Orson Zhai , Robin Murphy , Samuel Holland , Chen-Yu Tsai , Will Deacon , Chunyan Zhang Cc: Lu Baolu , Kevin Tian , Marek Szyprowski Subject: [PATCH 0/7] Introduce generic_single_device_group() Date: Tue, 22 Aug 2023 13:15:55 -0300 Message-ID: <0-v1-c869a95191f2+5e8-iommu_single_grp_jgg@nvidia.com> X-ClientProxiedBy: CH2PR19CA0023.namprd19.prod.outlook.com (2603:10b6:610:4d::33) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|LV3PR12MB9329:EE_ X-MS-Office365-Filtering-Correlation-Id: 4fa18407-e016-4d20-fd2e-08dba32b161a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cXebvd5D38gQBcquABPSLm6Gvet11e//SUyFO9/g2sPTa1gWZsOZJnxsPxMzYsOD7040G53UsP3FMC16dMAdisKUSsOWkRO3mDB03GfZT0Mv9v7hNxd39f2zgo/3NBbJT3VJND9BaEbmHndqnmtmRflUjBeFZqLQwkAIoSbqVNBreJpramotQsqRvbIQuc/qsF5ur1Th/TpkxTTm9GptsuDeG5OAGuT7JZGPVDoUC0ihDeVASyeZOJeorFx0UK83BYPFaJ3DzLJRETowZv4uwgFBj8N7imKVKOaZjMdnz/fNWSS8bMK3dVvPrzfXIyPACaQhcYLkHAFUkbqvGXMYxAhip+VytbEtOmXQbmM9s85MBkIGHNlgdjysNvXZDw4fJ1ejDpXYvIw8RtkWR19/Lnx4orquM//WEyhfK9/J4gedHo1PWBwcR0tu2+kgGrFUyBj2/U3dObnFdmr65hsUqObNPXZNcMC+zL122mV2iVfwtz1HnkqYtZdicE/fazSMeVhMZoLu9TXCLjEYIKQLpQ3PJTwo2fkjtUtPkZYVEb4JyVdOkArFqjb9vaVysWCnE18d4pdtx2ufD2G88E0iAn4/9a3SOdSYTuNYR9PV109AzJTnWrfUFH4GXApLaLDPPJIavBt9i8zB9E4KyBbOCmdRqPFKXQ39CifG7KXzs7wY+dRCLTuGRPmccdoCWHKl X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(136003)(39860400002)(376002)(366004)(451199024)(1800799009)(186009)(83380400001)(478600001)(966005)(921005)(26005)(6506007)(6486002)(2616005)(6512007)(6666004)(86362001)(5660300002)(4326008)(2906002)(7416002)(66556008)(38100700002)(110136005)(316002)(54906003)(66476007)(41300700001)(8676002)(8936002)(36756003)(66946007)(4216001)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ExcFP1i+acHURXob7YzQSSJY5tZNpkMfhYjmlEhCjyhHyzYGNpb3s9zxbafztKWsUrLnegjmBax93BkeAZiTSeJXPPin/vo0zJ02gMnActUmJYXKVTbE8GXxmKepW33oYTnzYWrnu2aK4JakQwcwV/bmN/tViBvMEJxP1Rw7h+1wqE/KCnLaVZoUg7VjYqnHzButtzMts7x0PL+iJVsFIujxCyX7lzF9RwMnxOjU3qJmtVPn6MKvMyX0ajeHNp6Xj28SE1fVDeBoFnN4zBKybTmuT7PoWFPTyVbymHCu+xCWJlq5XA0MapO64MLaSydJM4tGsk/dMnugYsrAapfBB41ubcdMLASlqI5d+etp6Ibzo7jPsWuODvw/7aup6zO3+bb0vlpCzeuPfBNAw1MEh9NiRgq/q8+WUd1uqkaXLexNFhq8J7yi0+oFmxBvejLhkZhfgezXuRz6WU1oLCJYm88Q7xmNqYA7zUMSpJ26r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M0h1CyXVzroAmRWjMRJIey12HMF7iI X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4fa18407-e016-4d20-fd2e-08dba32b161a X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 16:16:05.4621 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jdxm1bnIqc9AVLN/ecSlZpTZEllYj7FNJMzarEts2D3/ub5wbAsqw1Nru3vLSDti X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9329 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_091613_386369_5ECF23A6 X-CRM114-Status: UNSURE ( 6.24 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org This was previously part of the reverted locking rework, but it stands alone just fine. It has already been in linux-next for a few weeks, this folds the bug fix from: https://lore.kernel.org/all/e5e75222-13a9-ee01-0c25-8311b622fe0d@samsung.com/ The patch "iommu: Add a lockdep assertion for remaining dev->iommu_group reads" is pushed out of this series, even though the logic and explanation behind that is still correct. Jason Gunthorpe (7): iommu: Remove useless group refcounting iommu: Add generic_single_device_group() iommu/sun50i: Convert to generic_single_device_group() iommu/sprd: Convert to generic_single_device_group() iommu/rockchip: Convert to generic_single_device_group() iommu/ipmmu-vmsa: Convert to generic_single_device_group() iommu/omap: Convert to generic_single_device_group() drivers/iommu/iommu.c | 85 +++++++++++++++++++--------------- drivers/iommu/ipmmu-vmsa.c | 22 ++------- drivers/iommu/omap-iommu.c | 30 ++---------- drivers/iommu/omap-iommu.h | 2 +- drivers/iommu/rockchip-iommu.c | 22 +-------- drivers/iommu/sprd-iommu.c | 24 +--------- drivers/iommu/sun50i-iommu.c | 29 +++--------- include/linux/iommu.h | 3 ++ 8 files changed, 71 insertions(+), 146 deletions(-) base-commit: d8fe59f11096d6470b5f53739e49cdce67f3e127