From patchwork Thu Nov 4 00:37:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 12602291 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF5EFC433F5 for ; Thu, 4 Nov 2021 01:04:03 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9AE8561106 for ; Thu, 4 Nov 2021 01:04:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9AE8561106 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=rere.qmqm.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:Cc:To:MIME-Version:Subject:From: Message-Id:Date: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=E6KOQ9+XmQCJpC8ddNGyNGQeZ/UF7gkgvo8c/X+sVkI=; b=Tnn XWkClRrWpJ0OREuYhACNJ8XgpInvqjY6icGNMFX79SiVXyIQz113OSsTWO61nWjHOmm3njpDf+IAf /KgwAQDv0hxoFJo1SfcNemqaCJRd5w3K6Y5bG9fjRdwYQoIxfLyl5/Ax/FdZ4Gx77JCfkOyxKHUQs VFCcLQpDwjSKuEOJMfnyARCYMgSmZb1Nt+A5JjmA2rB5IEHBw0a3AZ0G2eB06tCkB7VnxwxO+A4HF dWGx2okFfaY/h8Mq2LoV4qqYKMQWfOSWzuc9RM5ahIVqzN+mK1hjKoh3AxeD+V/np+GNdxi5g9T0Q Q2EukeMlirxvmp5g9gDFC7/vFqrKnqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1miR8i-007R1R-7I; Thu, 04 Nov 2021 01:02:01 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1miQkw-007I2I-3F for linux-arm-kernel@lists.infradead.org; Thu, 04 Nov 2021 00:37:27 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 4Hl4Tm5pg0z8K; Thu, 4 Nov 2021 01:37:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1635986237; bh=f5cqlw1tZGKFEiZUYL8xXBI9O4s1xQd9SM6Z/48bIuU=; h=Date:From:Subject:To:Cc:From; b=ZWWGgfoHpKwhWLJP7KsZ9iMZtK7ex8VxloRuus0sA9g/N3VyAztx7dS7ls5+SaazH 1cTVgmLkq2v7sWmhnu8qTu21vVEgwqK8uYuX1DogJA4MDqhHVMoU4p28iCaKTBPnK1 zd7fBKGRubcy1VJDgy3nhczM2B0UPwDETPymsoPn3gzlNuzbMxL7GUqBHAT0QAcfuV xASrCjdrE5ZFkL9z01ZWRwepXYlWUVQpug5kvUSgMQSeb2lZbvNT7NLwKRCLuKOvCL 7uP+2lgHTIow0PxlCdIj3RLLmJCEPVRgr68dGDfJTH/7O19cBtqKZsFtTgFdRcEnQ6 AfUlctQxIgdgg== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.3 at mail Date: Thu, 04 Nov 2021 01:37:15 +0100 Message-Id: <990f4427968071d59bcbb7411da73acc379d3ac4.1635986046.git.mirq-linux@rere.qmqm.pl> From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH] ARM: fix early early_iounmap() MIME-Version: 1.0 To: Jon Medhurst , Ard Biesheuvel , Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211103_173726_396192_32FF8A24 X-CRM114-Status: GOOD ( 11.38 ) 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 Currently __set_fixmap() bails out with a warning when called in early boot from early_iounmap(). Fix it, and while at it, make the comment a bit easier to understand. Cc: Fixes: b089c31c519c ("ARM: 8667/3: Fix memory attribute inconsistencies when using fixmap") Signed-off-by: Michał Mirosław Acked-by: Ard Biesheuvel --- arch/arm/mm/mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index a4e006005107..274e4f73fd33 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -390,9 +390,9 @@ void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot) BUILD_BUG_ON(__fix_to_virt(__end_of_fixed_addresses) < FIXADDR_START); BUG_ON(idx >= __end_of_fixed_addresses); - /* we only support device mappings until pgprot_kernel has been set */ + /* We support only device mappings before pgprot_kernel is set. */ if (WARN_ON(pgprot_val(prot) != pgprot_val(FIXMAP_PAGE_IO) && - pgprot_val(pgprot_kernel) == 0)) + pgprot_val(prot) && pgprot_val(pgprot_kernel) == 0)) return; if (pgprot_val(prot))