From patchwork Mon Mar 2 16:57:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baptiste Reynal X-Patchwork-Id: 5914981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 293EC9F36A for ; Mon, 2 Mar 2015 17:00:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C13F2015E for ; Mon, 2 Mar 2015 17:00:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9EA83201EF for ; Mon, 2 Mar 2015 17:00:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YSTfp-0005Q1-Tw; Mon, 02 Mar 2015 16:58:29 +0000 Received: from mail-we0-f177.google.com ([74.125.82.177]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YSTfg-0005BP-2M for linux-arm-kernel@lists.infradead.org; Mon, 02 Mar 2015 16:58:21 +0000 Received: by wesp10 with SMTP id p10so32410046wes.12 for ; Mon, 02 Mar 2015 08:57:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BGjYBPkVJ6QwbznYWKo5QiIRr2zyQAGLX3NA48AB+20=; b=CzAhNTAZRDQN4Dn6Ls1n/98ICsvGnLzIgV8sATpmdGHkHfl/g5VYd+fm1Oqh8v3ip1 iHoHh+vjKLDHrvFuCNCfdlSsadJ5jJRz/MNiaX2UpMrztaOYHEzqFKrvB89tNAsjVyEQ nq8RFSlisuf63aYPtkFfBZnszCdCGklo6mlsvE0PO3Qyh6bl+3ydg4hUqmKzlOcV2+tR iYOzEs4EO6t1PjVGfXVyKWX4XOFaBB51KD2WMa4DEivqY2YrfLN6jwF2ZexY0EcONYRo IsNMzmU8vJNtkKD5jNZncsYmArddTotQsoXuFplve3Ht+dYqrrFJUm1lqMKwp+rfoW7Q +oqA== X-Gm-Message-State: ALoCoQmmZzq4IaISRjE1a6CdbLPwvUkZMypo3/ieqF7NTvhKt/ztDjojuGq5XG7KjFmBjJ4fpSBy X-Received: by 10.194.48.74 with SMTP id j10mr61664334wjn.38.1425315476292; Mon, 02 Mar 2015 08:57:56 -0800 (PST) Received: from localhost (LPuteaux-656-1-278-113.w80-15.abo.wanadoo.fr. [80.15.154.113]) by mx.google.com with ESMTPSA id lj13sm16861018wic.9.2015.03.02.08.57.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2015 08:57:55 -0800 (PST) From: Baptiste Reynal To: iommu@lists.linux-foundation.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH 1/1] iommu/arm-smmu: fix ARM_SMMU_FEAT_TRANS_OPS condition Date: Mon, 2 Mar 2015 17:57:22 +0100 Message-Id: <1425315442-29584-1-git-send-email-b.reynal@virtualopensystems.com> X-Mailer: git-send-email 2.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150302_085820_299270_0EE2B26C X-CRM114-Status: GOOD ( 10.22 ) X-Spam-Score: -0.7 (/) Cc: Baptiste Reynal , Joerg Roedel , Will Deacon , open list , tech@virtualopensystems.com, "moderated list:ARM SMMU DRIVER" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch is a fix to "iommu/arm-smmu: add support for iova_to_phys through ATS1PR". According to ARM documentation, translation registers are optional even in SMMUv1, so ID0_S1TS needs to be checked to verify their presence. Signed-off-by: Baptiste Reynal --- drivers/iommu/arm-smmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index fc13dd5..d4beca4 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -1556,7 +1556,7 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu) return -ENODEV; } - if (smmu->version == 1 || (!(id & ID0_ATOSNS) && (id & ID0_S1TS))) { + if ((id & ID0_S1TS) && ((smmu->version == 1) || (id & ID0_ATOSNS))) { smmu->features |= ARM_SMMU_FEAT_TRANS_OPS; dev_notice(smmu->dev, "\taddress translation ops\n"); }