Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3545976pxj; Mon, 24 May 2021 09:05:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzMMnEbEwHdnbeZfJ49BtpDUx0w0gK9rUWtGtX3Sy+jlucF4pJbSVPBycgfi+3cU6slrma X-Received: by 2002:a5d:9e44:: with SMTP id i4mr16648122ioi.143.1621872321378; Mon, 24 May 2021 09:05:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872321; cv=none; d=google.com; s=arc-20160816; b=wrQPruHImrgU460FCo1EguM94f7unTXkq8QTeus8EKNNb9j4d5uGdW/tDu97LxtwDA KHlyE0+xelo0SwlH7L8zF5W9ZGa3fXNCqM1Je8JMv36BM7dsUL215ybmaHUtLGO/FEte SJ5q364W+n9/iA9ZAaIhqUwyLS3gcOWhYS3Ff7p08JzBwHkI5EI4zh/wcUzurYGrYH1/ fGQzGNHi/HiCdJtF240K32UD5Qhy/ypaOBCeJYAfiv8bKZsCrZ7gGN7PNGhbRhtbRv3a ikjWVqCZ60QzuIgueWJWukL8Z+mMzxBHXfhlfkGtidssQ8A9MtfyEHSnmr91GjFMxPEI StiQ== 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=AFruBiM4gNM4QyQz/Suh3jm4eawWIeuW+9Uamces/F4=; b=MuIgkMokcXuh8XbBUtbQ+q9rxCBYRulJ3XCncvE5Y+hjL+PxkbAk54LbiULuK56qe7 GJze8upaq7iYO4gH3fIXpxtb7FPoPqbB60szP6S2knrXD1lF6VmsWey333x0XTvCdbLU oztjuxhPqixYtsVkUmtmv7pXCCPAzlKiY3/BLx5YU6Fj2nVd9sa0RIm57Jd0uVqHfVzj TP8kKus1xSeV9mQMFZ6qjOlE0izElQ8vkdWW/EAHFm3QXfoQNoOs8TATWZ/UELDp94i5 TcGGB1KAzwCY0Q1Y4CBLMHbz4SCm8wahaPzqXfJGJcACiHIK4zvkn4RlLq7c4tScS9Hx hOFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ovqgJHEK; 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 a13si15212994ilf.41.2021.05.24.09.05.02; Mon, 24 May 2021 09:05:21 -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=ovqgJHEK; 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 S236384AbhEXQES (ORCPT + 99 others); Mon, 24 May 2021 12:04:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:40464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235136AbhEXP51 (ORCPT ); Mon, 24 May 2021 11:57:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E169061953; Mon, 24 May 2021 15:43:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621871018; bh=kNTEj5zBvkI/7YAJ9QJOgb1fSb78jcpXW6MHyOJMBDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ovqgJHEK/Yz+0tIbI5C+yv2Hr9Men5idrNjl4nMP5LtHmwau01i9KSzyU83nnW4u+ 39sXqQbFb9REL4WeIxiY26oXUR5grUEVcRj7G12T69GOLmHacVXpr4PLhrAyRcUnj7 si6qY++vZl9eVfpMVJSuzSeEPefuMx7WJ1isMpyg= 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.12 034/127] powerpc: Fix early setup to make early_ioremap() work Date: Mon, 24 May 2021 17:25:51 +0200 Message-Id: <20210524152336.006587324@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152334.857620285@linuxfoundation.org> References: <20210524152334.857620285@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 830fee91b2d9..c914fe8a2c67 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -369,11 +369,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