Received: by 10.192.165.148 with SMTP id m20csp3334115imm; Mon, 23 Apr 2018 04:58:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/9Zhw3jA97FUeRfGh5c/z0C3J9aDJp7DhRy7goE31WOYLt7bC1+puUOVH4/9RBH2Dtgqwh X-Received: by 10.99.95.13 with SMTP id t13mr17141930pgb.145.1524484698756; Mon, 23 Apr 2018 04:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524484698; cv=none; d=google.com; s=arc-20160816; b=Lm67SNmxeYxKAp3iNttiuWur9xe/ARSzEDzIvSa2QIbt23elEz7m8smS8YDVRqCEVm 5a+XEnXOSPYU7DmTZiYr+YZ6f14vfXLX3uhVvO4P+tdY7+YP1XmCkt+oeLcTIInFrfNp 5s5sn2PpsLvv5MGSB3Wz1mX5gvEgTpaIdSdTcNc1YpRMmHZsfnSfmNrdIW9SJ7ZwsfJP DlXNMKWOtH/L0I1jln39pZCcPN8aNdO1GJ82hvev9N+Sk2d56x5ZbG6isAwceMZ4EUqf LH8CrYw7wyflgdFPkU74JEki2PWLe245HR6Uw4YbjVTg+QvK6VQOjXRAd7sDL7k0UJl9 85Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=U1mD3xqRIpev+sgpsF3E2TPvXlltwYwj4n7W4EgSdaE=; b=sATrqY6F1Ehd9+xnPYs3zsRAR5w99bmTWG5bEHykfntfvu4ymtlhMO2qeKBgot6+ef Yhb2DRsWDsxR4SCSObx7y+Idyjdzgh/S7Cypw6HeWSPTcwEy/8SMDP0QvSn0Hqh/q7aU sY8O+UgpdVG+d33bBdDYIoixW7JSCx0ga2S7YwU5FBC7HXeDHq5NVQK8yzeDKvuEpFnR YGITfdpPDHHDOed2zJFVOv8IooSDZjimy8LVk5rrSg5Iz147kUN3tCPhTe9l8SWLCAuT i9YjHZxeY7TdeeTAt95vX8blT9bj/0C6tIh/4I+/vPU9KYYt3sZzjON+0mceF8c6v9um jOBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6si10535275pfk.342.2018.04.23.04.58.04; Mon, 23 Apr 2018 04:58:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755056AbeDWL4k (ORCPT + 99 others); Mon, 23 Apr 2018 07:56:40 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7198 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755019AbeDWL4h (ORCPT ); Mon, 23 Apr 2018 07:56:37 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 41E44E1B3F2C7; Mon, 23 Apr 2018 19:56:24 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.361.1; Mon, 23 Apr 2018 19:56:16 +0800 From: Yisheng Xie To: , , CC: , , , , , Yisheng Xie Subject: [RFC 1/2] iommu/arm-smmu-v3: Remove bypass in arm_smmu_reset_device Date: Mon, 23 Apr 2018 19:45:58 +0800 Message-ID: <1524483959-54940-2-git-send-email-xieyisheng1@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1524483959-54940-1-git-send-email-xieyisheng1@huawei.com> References: <1524483959-54940-1-git-send-email-xieyisheng1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a bypass parameter in arm_smmu_device to keep whether smmu device should pypass or not, so parameter bypass in arm_smmu_reset_device can be removed. This should not have any functional change, but prepare for later patch. Signed-off-by: Yisheng Xie --- drivers/iommu/arm-smmu-v3.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 1d64710..044df6e 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -587,6 +587,8 @@ struct arm_smmu_device { u32 sync_count; + bool bypass; + /* IOMMU core code handle */ struct iommu_device iommu; }; @@ -2384,7 +2386,7 @@ static int arm_smmu_device_disable(struct arm_smmu_device *smmu) return ret; } -static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass) +static int arm_smmu_device_reset(struct arm_smmu_device *smmu) { int ret; u32 reg, enables; @@ -2487,7 +2489,7 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass) /* Enable the SMMU interface, or ensure bypass */ - if (!bypass || disable_bypass) { + if (!smmu->bypass || disable_bypass) { enables |= CR0_SMMUEN; } else { ret = arm_smmu_update_gbpa(smmu, 0, GBPA_ABORT); @@ -2778,7 +2780,6 @@ static int arm_smmu_device_probe(struct platform_device *pdev) resource_size_t ioaddr; struct arm_smmu_device *smmu; struct device *dev = &pdev->dev; - bool bypass; smmu = devm_kzalloc(dev, sizeof(*smmu), GFP_KERNEL); if (!smmu) { @@ -2796,7 +2797,7 @@ static int arm_smmu_device_probe(struct platform_device *pdev) } /* Set bypass mode according to firmware probing result */ - bypass = !!ret; + smmu->bypass = !!ret; /* Base address */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -2842,7 +2843,7 @@ static int arm_smmu_device_probe(struct platform_device *pdev) platform_set_drvdata(pdev, smmu); /* Reset the device */ - ret = arm_smmu_device_reset(smmu, bypass); + ret = arm_smmu_device_reset(smmu); if (ret) return ret; -- 1.7.12.4