From patchwork Wed Oct 11 00:33:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 13416480 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 E4DDECD98E0 for ; Wed, 11 Oct 2023 00:34:44 +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:References:In-Reply-To: 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: List-Owner; bh=QeeyylnDrlEj9CYD5PET7RkdiPtgHeJmm0Ohw31TBnM=; b=kcKbB+tUnneofr q+YrYPjc+J+mZLvMfgNiMQISkPSivN+QxbzgH1qeu7y6D1+B0TdX77D2ekOLds5q+7Hs0dDKKeEAU /tKINYnVQ7ZJqzZPzEPZknK4ejb4oc0OXLKoBQS1vhddkoxEluWJLKc8Cf9IKuooPtNA/4DaFBjYb pLhri4wcUwJy8wEmt6y2nySyBmtxlXpO9zN21E3YFMlCEqCGNjWrow1Ksrz1mjJ458SS/nWFoXwWC tov/mxaFYlWsLK8tEOiM5Y1UWIMGnmvT5X3azflZMVVV/aFdN9eWqlGUVi1obPVXYgjW+tf/iLfPi LNfgRvMyE5DZD2aEbXyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqNAw-00ERQT-0l; Wed, 11 Oct 2023 00:34:10 +0000 Received: from mail-dm6nam04on20624.outbound.protection.outlook.com ([2a01:111:f400:7e8b::624] helo=NAM04-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qqNAi-00ER5U-2Y for linux-arm-kernel@lists.infradead.org; Wed, 11 Oct 2023 00:33:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OCK8fNQUiR0wCTQZUpqsEY/bYwhzKSHv3B9rGfcgncmkDFCJYQblBH380jHWkx/gKSNjTuB+o0PItQSrMOcNMymxzguMgje5aOtIl2i8VjKu8Ys2mFg4z1UVLCB4V7eTJxT8itzZEw5gRUonipZXfQY9Sx40+bkyEtt6Co8yJ62GnjPE8Mlqxf/ynvJzKzp/ex3gSTlGQxxxdUPz0Plp4xGPE2Baz+pMiJNLmqaxjmv23phnqhRoxBzbTIOTphLan/yOhydmMobSEol49MbAbpYm7Ika21NlPbwEWN5MPjSju5O2/ydxvSs+knmbQMgdPrxSh/Wk14XdqZq0hwwXGw== 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=LU1VnFcORe3Garadx4FemnCc/4o+ni1i3OYVQDm5PI4=; b=JIKJVe6oVraLWi4QhdHGIksx+tMsRP1ZG1V3VF79oxz94BTRDlO0Tqq4jbLmg2EUqDaZ4d8vLm4C6X8TOmkrMdng2s1JaF7BMvXvhaoKk9dJBDpEFd+CdH040pNCu0VHy8CbTdPlDEDc1trEbjc5T478I8JeYNH6Nm5eMID8wZr4dXLTddX+xG2q9PIhsxPL1w/z00getsh0ER80YfIZRngvE8B8jXfsBKowXYTlO0PhCvjg+Tp5eMMu1pOk3qI7Uy5SPnv5GzacDGGxlNgKEN8gzUwXHRhVuGJjTMOsxvObCom2coUW+jcNjZHqMHJAikpxyxbC2d29aE24VQ0NxA== 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=LU1VnFcORe3Garadx4FemnCc/4o+ni1i3OYVQDm5PI4=; b=ivviCDxssAYAe33rFP6o/pdJvtsriCCMdrzCsFaDIOr80uFoAkKY4bBsftcxcOQJq9vTEIsuGcQ/UIBWIEEZheh+++qenUMu1tL9Orno4qY8Ul5zjpKKJY7vig2iSGX2XUg4x80K/wZpEhhiZObxmrORONIeD2QDxJFcbO+4BU7hVcSpASgA3bfB74OTz/LTjgq39+eWoHmArUj9wdGWAakmtwKHyeH7CzH5l0eqHbk6yKO+LA+onrddMrsgr5eJHHp1/qVHqaGBEYSgTuiqVkZ4SlCPkVM9N5SDBDdzhcc/SlzblackC6fzfn9F5SHYc9qX2+553yFE0IbWeSK+6w== 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 IA1PR12MB6625.namprd12.prod.outlook.com (2603:10b6:208:3a3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.42; Wed, 11 Oct 2023 00:33:30 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3f66:c2b6:59eb:78c2]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3f66:c2b6:59eb:78c2%6]) with mapi id 15.20.6863.032; Wed, 11 Oct 2023 00:33:30 +0000 From: Jason Gunthorpe To: iommu@lists.linux.dev, Joerg Roedel , linux-arm-kernel@lists.infradead.org, Robin Murphy , Will Deacon Cc: Michael Shavit , Nicolin Chen Subject: [PATCH 02/19] iommu/arm-smmu-v3: Master cannot be NULL in arm_smmu_write_strtab_ent() Date: Tue, 10 Oct 2023 21:33:08 -0300 Message-ID: <2-v1-e289ca9121be+2be-smmuv3_newapi_p1_jgg@nvidia.com> In-Reply-To: <0-v1-e289ca9121be+2be-smmuv3_newapi_p1_jgg@nvidia.com> References: X-ClientProxiedBy: MN2PR18CA0020.namprd18.prod.outlook.com (2603:10b6:208:23c::25) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|IA1PR12MB6625:EE_ X-MS-Office365-Filtering-Correlation-Id: 58051e5a-ada5-4f2d-25b9-08dbc9f1af41 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UkUUg8ft1g744IrmRa8aBFrE2LKVgFutGAQIXsztjc4Gub707FvY6vOH8/pqoM0iOXvTvYe6NpNo/6ylgY11xMhCjQSJjCSoSGwjFeZMSpZTaXhzQeFdfuyVElw7bqtKQLcuG41b2Y6LdeQ0v68wQ9kudYfGsCY51+vj+UXHbWBNXqW1ERPxjtw+XcB19oNZULpKWJSDT7WgkurI0rnPq1bSyd+GC9t9ZhDUVthZ4YVxSZ9ROUS5tSBmArR+ipLuksGtXsWPcKtpSKEm9RrAMLWXcVJikTXQldWcfFwF+Xp7wWDIz7en7W34G3PGvvD7WDAHk6T5KoC478/DvmFxUglZFxojORaqZ3iTbLMUqOTQKmz2L5pyeiS4Dip4d9R9OEnjPqNUruCpcvDeN73QrT5LhGq1+DSAX2VY4hQtpoZb1HytW4yqZGySdI7B5ww0GwRTRyeVcWPQqA24MOfx9OohBcE5+QY3bVvgqbfYQMRrH+SO6YHBbykbw0sPWbPxcCtiL79h7ZNJ1GxvUhfiHdc32mfXA2KXkBFlxdovt/e7wdRTN+q0gdWXfKh8BVOwlaD44vDVumUheOc3xOZnqz+7nW6UTTcjr//Laz/2dVo= 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)(396003)(366004)(376002)(346002)(39860400002)(136003)(230922051799003)(1800799009)(186009)(451199024)(64100799003)(107886003)(6512007)(36756003)(38100700002)(86362001)(26005)(83380400001)(2906002)(6666004)(2616005)(6506007)(478600001)(6486002)(8936002)(8676002)(4326008)(316002)(41300700001)(110136005)(66946007)(66556008)(66476007)(54906003)(5660300002)(4216001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PKMU/cBYUEX0iOAbGngjTDC2phEj00y4yiWjXeGrzbqWztW62xv6k+kd5un3rY2LfgGsElLWHujpaWcopdzDllLLMlB9Snl1LglcF8Jjm7bbrm/6k1LKKKxyZqdWRBosF/U4K/AqMiHExtK9E9E6KZjPx3UNC18eyeanIwkN/ZKvzFMIBagSaDT9qEJHrRkVBDYgDAfnqTgf3WlJwNQ1sNNWDq3gPGkeMT1+hj1x1Y4bGwLAjj5n4tAobj4UEq7COxjTzppJltOxwT+ZfKAte7JKzd726rFcOWG0Rd5ISQaQeugobV/WPhCOH49gLLPb6iIpeYTJhXzHFo0gKR1W+FOLFtQhuWotvbR5L7ole7qX2w6z/pfeap6OvlDWB81DXq49a/ZDk+hY2EcsoiYd4e5A9HUx+UjfAe3A9eIHep53hAEp5OCVvWWoMd/fVIlT1NjcV6LbhzxdWqfmL91wgIX5ND2+6yzRZuxe0F/f7MBvC+cFlpd6MLf58gQCuaDFwONfGNXGHuktAliFS9epNtJW4LKc++OvzGlP2kdIYJaji+NWr3XQPyuOUT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 58051e5a-ada5-4f2d-25b9-08dbc9f1af41 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 00:33:26.8573 (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: 4bj4yFVsDFBMe82iDA9eHbsHK/Ob9XcZYbttpQLU081FWcib+h/x4mGid4bfmsPG X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6625 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231010_173356_849646_35761AA0 X-CRM114-Status: UNSURE ( 9.24 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The only caller is arm_smmu_install_ste_for_dev() which never has a NULL master. Remove the confusing if. Signed-off-by: Jason Gunthorpe --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index 519749d15fbda0..9117e769a965e1 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -1269,10 +1269,10 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_master *master, u32 sid, */ u64 val = le64_to_cpu(dst->data[0]); bool ste_live = false; - struct arm_smmu_device *smmu = NULL; + struct arm_smmu_device *smmu = master->smmu; struct arm_smmu_ctx_desc_cfg *cd_table = NULL; struct arm_smmu_s2_cfg *s2_cfg = NULL; - struct arm_smmu_domain *smmu_domain = NULL; + struct arm_smmu_domain *smmu_domain = master->domain; struct arm_smmu_cmdq_ent prefetch_cmd = { .opcode = CMDQ_OP_PREFETCH_CFG, .prefetch = { @@ -1280,11 +1280,6 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_master *master, u32 sid, }, }; - if (master) { - smmu_domain = master->domain; - smmu = master->smmu; - } - if (smmu_domain) { switch (smmu_domain->stage) { case ARM_SMMU_DOMAIN_S1: