Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3541708pxj; Mon, 24 May 2021 09:01:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3SHCmFA2Wqvo6q7IBSUm2kbN3aEaXnu+RmB/uagDcvoKCluAaejMcLgfdQ+P1SrC5x7xO X-Received: by 2002:a05:6e02:527:: with SMTP id h7mr16939820ils.93.1621872068463; Mon, 24 May 2021 09:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872068; cv=none; d=google.com; s=arc-20160816; b=rxTnR9w+ltxSpbWGIq2bBn3s0xlDOnpAXEQiSHbQ3yaZJf+4vXD+LdubP61dKtH0gD n5wMTtU8qPEYSkpNM4GwKSLqMnHbvEvfwDkckBgIt/fdy1cESZZPI8DKQiduifpGET2Z x0o257V7rpu6DsM9Bq5hOabPXnrNGZp8pYD7eeFaU1D24aDIaxnXUTxTENR4AUe+AGWz jCXSAiXNhoZoof7zq9wW2WXIpXtVgKG89qqzEL3qiVbo72y2eq5Oh279aIn+4PRyTzyS H8grnN65Caulzx/VzC44AUpk+bt47V9RurSvH1789ppK5SsyYECmz5XlLF7UikkkoPQ/ 8F3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Kd3nhzmRBtyjSw//X01bNSEj+KMrzqg2xol2CIVHLcc=; b=Eb6Wp9/Wuhu5O5HwvH4AwdoFJYRTjp7KkLhKxnVky/Rpz/wOn46+3aPrnvWmwNy4GV pjlF1mzQG2oTWOy5GH4LXD0lfDM7d5anGh/X92miZB+1JLUQxaZ980YAT9ntrRxr0ysD lkwnd88j7eXWdxt//ObaYCrRvUcSWyO7uLMmqyRAdXTlezsX/i8qabWyeAwbS8Me0fXl CX0YoLZHjTsnnOioELqUqzCi5jSb5qRR6AIRURhRBSJ3ksMAtNLeujw2LuWtTGeHYISa FDBjpTRiLMzIp2TmCb+TEN/aGWW4VMm6g6J31jwJk1LlVoW7AYtfr5IG2I5HkU/cuq9o 5Ejg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ldYX8n9S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si14298377ioo.31.2021.05.24.09.00.54; Mon, 24 May 2021 09:01:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ldYX8n9S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234194AbhEXQAn (ORCPT + 99 others); Mon, 24 May 2021 12:00:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:38648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234652AbhEXPyI (ORCPT ); Mon, 24 May 2021 11:54:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2CA8D613F5; Mon, 24 May 2021 15:39:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870777; bh=B2YmaOLZ8sUvAHqkfhLKExSdVVQsHbEQlSclP+9YIOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ldYX8n9SOk97UPEIOBjeUTST3H2Oe/Iqr1pJt4DwPDiHzxGqFeLWKF+BFjBErblPF 0kg5fBhZgfFSIZpkrDOLllgbRfrwd9r+fM068QJlynosbor1703A+Z0EX//biPM3/u Ak+ga+T9Hpz12o06yhRB/lE6NKTXWf9jqxEE9SB4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Kardashevskiy , Christophe Leroy , Michael Ellerman , Sasha Levin Subject: [PATCH 5.10 030/104] powerpc: Fix early setup to make early_ioremap() work Date: Mon, 24 May 2021 17:25:25 +0200 Message-Id: <20210524152333.811212934@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152332.844251980@linuxfoundation.org> References: <20210524152332.844251980@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexey Kardashevskiy [ Upstream commit e2f5efd0f0e229bd110eab513e7c0331d61a4649 ] The immediate problem is that after commit 0bd3f9e953bd ("powerpc/legacy_serial: Use early_ioremap()") the kernel silently reboots on some systems. The reason is that early_ioremap() returns broken addresses as it uses slot_virt[] array which initialized with offsets from FIXADDR_TOP == IOREMAP_END+FIXADDR_SIZE == KERN_IO_END - FIXADDR_SIZ + FIXADDR_SIZE == __kernel_io_end which is 0 when early_ioremap_setup() is called. __kernel_io_end is initialized little bit later in early_init_mmu(). This fixes the initialization by swapping early_ioremap_setup() and early_init_mmu(). Fixes: 265c3491c4bc ("powerpc: Add support for GENERIC_EARLY_IOREMAP") Signed-off-by: Alexey Kardashevskiy Reviewed-by: Christophe Leroy [mpe: Drop unrelated cleanup & cleanup change log] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210520032919.358935-1-aik@ozlabs.ru Signed-off-by: Sasha Levin --- arch/powerpc/kernel/setup_64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 3b871ecb3a92..3f8426bccd16 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -368,11 +368,11 @@ void __init early_setup(unsigned long dt_ptr) apply_feature_fixups(); setup_feature_keys(); - early_ioremap_setup(); - /* Initialize the hash table or TLB handling */ early_init_mmu(); + early_ioremap_setup(); + /* * After firmware and early platform setup code has set things up, * we note the SPR values for configurable control/performance -- 2.30.2