From patchwork Tue May 21 16:10:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 10956017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C8931924 for ; Wed, 22 May 2019 14:40:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DC1228D80 for ; Wed, 22 May 2019 14:39:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DB8128D85; Wed, 22 May 2019 14:39:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 22EBD28D81 for ; Wed, 22 May 2019 14:39:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 05FC289B95; Wed, 22 May 2019 14:36:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id E90E4893CB for ; Tue, 21 May 2019 16:11:11 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id 15so3478036wmg.5 for ; Tue, 21 May 2019 09:11:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r8viNroRA5goE0iPj/ap53EgAXBGfEQtlqx5YkjMMp0=; b=nQCMtCRANtH1wSNrxYD/PUJYgWk1i0vVYa4Hib2bHsNP22rNy/BS2qcWieq3RyWW6S DxWPLRd6dpf8Un9RJUkBvKReNw8gaDO0IBZjSx8CQvOhlHsGT7vke2f1EHSxLYOUziop G4jpmDGmuRcOpE9P3PNoJoU9cnvR8Mfvg+u9EoM68QN6Nzwqs6JrqGPV/OCXPx4JB7C5 lhxVi38Ecf16J+vhqbRdQBaTi7m/1btOahlRBC6+HmWPeAAhORLwVA7MZmYQccc8LV29 FAD+o7In0oGLT0sZoSSwYJZn0Kb7KSaO+RNcwKNpWm0f8FbCWhwDktN3pA1gXMAXUuTY BdqQ== X-Gm-Message-State: APjAAAVnjyxYeiyEVibQMXSF1R+Nd7bis3pnhMpPnyvfEG7rwZ8J66QP QL83SqJeru8085oQTK98NeU= X-Google-Smtp-Source: APXvYqxfxJ6RsSMMKEQ8Whf7wf2BBbNOZyqWjeSvLocsSoko9vuDWmS1j0CXAq8lGvRTLD6FP4Blfw== X-Received: by 2002:a7b:c4d2:: with SMTP id g18mr4212516wmk.78.1558455070526; Tue, 21 May 2019 09:11:10 -0700 (PDT) Received: from localhost.localdomain (18.189-60-37.rdns.acropolistelecom.net. [37.60.189.18]) by smtp.gmail.com with ESMTPSA id n63sm3891094wmn.38.2019.05.21.09.11.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 09:11:09 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Maxime Ripard , Chen-Yu Tsai , Tomeu Vizoso , Will Deacon , Robin Murphy , Joerg Roedel , Neil Armstrong , Steven Price Subject: [PATCH v6 2/6] iommu: io-pgtable: fix sanity check for non 48-bit mali iommu Date: Tue, 21 May 2019 18:10:58 +0200 Message-Id: <20190521161102.29620-3-peron.clem@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190521161102.29620-1-peron.clem@gmail.com> References: <20190521161102.29620-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 22 May 2019 14:35:24 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r8viNroRA5goE0iPj/ap53EgAXBGfEQtlqx5YkjMMp0=; b=ARZFb59f/TEGR4dKn2zPIsVrlQpgAN3MkGdMyYoenwZrYx//1w/GS1vxb/zR0DiMu4 kFpEmoMA86LR7oMglGgowJVUCRWcB4uFwzjEjBzB/TClFDnUCsAYsZGfse3m9d3Elf0X LZXgLoTvu2klwbc97GLhdfLn9ItpsQuHfWTsjUtfW9vQRNNk+uobllA6qAZTnTm99Ugm n1r7iW/h9mU0lcFEX1q+b4LjCRuTE9urqhkK56b9ItVJIMrgMcJ4E0gF0t7oqfqCy6WU IMfY/wZLsXkxMjbx6rkgIiucVgB9E+aq2VD6BVtbZIJW4Dj9fkmrj2Upj/QMFHowPrYh TkYw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, iommu@lists.linux-foundation.org, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Allwinner H6 SoC has a Mali T720MP2 with a 33-bit iommu which trig the sanity check during the alloc of the pgtable. Change the sanity check to allow non 48-bit configuration. Suggested-by: Robin Murphy Signed-off-by: Clément Péron --- drivers/iommu/io-pgtable-arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index 4e21efbc4459..74f2ce802e6f 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -1016,7 +1016,7 @@ arm_mali_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie) { struct io_pgtable *iop; - if (cfg->ias != 48 || cfg->oas > 40) + if (cfg->ias > 48 || cfg->oas > 40) return NULL; cfg->pgsize_bitmap &= (SZ_4K | SZ_2M | SZ_1G);