Received: by 10.213.65.68 with SMTP id h4csp489028imn; Fri, 16 Mar 2018 09:16:39 -0700 (PDT) X-Google-Smtp-Source: AG47ELvqkRT3bI5K5g91VuE8ZnPQVzQTPqnbYcIS+7aKfLeHdpzUy0C4lAuCNSQm/K/vzQdC5/SE X-Received: by 10.99.126.24 with SMTP id z24mr1927709pgc.110.1521216999549; Fri, 16 Mar 2018 09:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521216999; cv=none; d=google.com; s=arc-20160816; b=B3dmi9wYmnaHQNxITujFb37UuGu38+ZWJAeBkVJYyuKKfaVwwXn3NtrbDOpG6XyVJe fS/FslhJvLfW652RMG9wuZa8naNtnC9YkA1T1a4A8783sVzcALWdgLoV7ppZPwo6VINB 9MT3PteNVcxQLQvF5kg8gLn1qlbC0Yv9ILVYeb8PCKZu8/qcQXdqxcFYfYJaycAkc+gD z0U5TCgrq4kNKIYp9CjqavYj6NrGO5DQiChDBtlIvTAg5elo19pkbYAApl4Hlw4+Ujy4 lewSly3Nrd8ldXDigAoPUabmQG1oc64zYeJ6dDUoXtWHhmEu44TjxKBOq3JBP5BFuKac 2SHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ev+0e7O6FFJs8jiKT02pGYFWV7+wkDBsLEJJBgiKwI0=; b=AoEUbAv4DMDFzq+feqo2vqXTGZmyFl0yaRaQBjK0lSk7/lH+V+mOE9sjchxfqg6nVK EK3Bu3xVy7q5WbYn61VFQ4K43ZDKRpIO+KnMzhIWTCRVZIq/6ztZ1F/IkRfm+fc8Fbbz W3hJUQJSkVcQckB0/hw6nwEvSBQtN1q8crXDAzgrm+gJJFAz9QTQWEO86w6DsofdgfEc Z9G1D6TMfJc+z4+jO/1se/3Ax+Xst2xo5wjj2lX4NJRKzJu+XJ7ujtsb3Ir7l+0AT8oy 78nYifpmWInN/tEjrEK88fmpdn2hG8YcNM32rPHIN3KLkx18f5xqCWX4Pp64WZXfyK2N SAOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d88si5761945pfe.215.2018.03.16.09.16.25; Fri, 16 Mar 2018 09:16:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965070AbeCPQN4 (ORCPT + 99 others); Fri, 16 Mar 2018 12:13:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43430 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964971AbeCPPkA (ORCPT ); Fri, 16 Mar 2018 11:40:00 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9C37DD73; Fri, 16 Mar 2018 15:39:59 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Greentime Hu , Arnd Bergmann , Peter Hurley , Rob Herring Subject: [PATCH 4.15 023/128] earlycon: add reg-offset to physical address before mapping Date: Fri, 16 Mar 2018 16:22:44 +0100 Message-Id: <20180316152337.642785148@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Greentime Hu commit 1f66dd36bb18437397ea0d7882c52f7e3c476e15 upstream. It will get the wrong virtual address because port->mapbase is not added the correct reg-offset yet. We have to update it before earlycon_map() is called Signed-off-by: Greentime Hu Acked-by: Arnd Bergmann Cc: Peter Hurley Cc: stable@vger.kernel.org Fixes: 088da2a17619 ("of: earlycon: Initialize port fields from DT properties") Acked-by: Rob Herring Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/earlycon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -250,11 +250,12 @@ int __init of_setup_earlycon(const struc } port->mapbase = addr; port->uartclk = BASE_BAUD * 16; - port->membase = earlycon_map(port->mapbase, SZ_4K); val = of_get_flat_dt_prop(node, "reg-offset", NULL); if (val) port->mapbase += be32_to_cpu(*val); + port->membase = earlycon_map(port->mapbase, SZ_4K); + val = of_get_flat_dt_prop(node, "reg-shift", NULL); if (val) port->regshift = be32_to_cpu(*val);