Received: by 10.213.65.68 with SMTP id h4csp509641imn; Fri, 16 Mar 2018 09:56:29 -0700 (PDT) X-Google-Smtp-Source: AG47ELtUHCGXFKjynwbaV2H9SD7F+wSfcdNJ1bT0uNI3TzTLFZgHq4eHXZWZFpLGNWxfuhuX8voN X-Received: by 2002:a17:902:5410:: with SMTP id d16-v6mr2922067pli.176.1521219389132; Fri, 16 Mar 2018 09:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521219389; cv=none; d=google.com; s=arc-20160816; b=QebmRyIxuYZ31U7p4vTLjZ1t8XiTVRwDCEHIcCKe83QjpQmGtrf947tBUZolH8Dgkh P+HV7x9I6scLRazsLNMg+wO9u195dswVFM027gZTiRA+rKXXn0yRNTvQhkpZ6mh0SopY ARW+Fy7YQE9a1FxOuD78ET6aZnNIBZSEgOT5yAVRE7WWt8F+NP3rI617Fx6s3jB5h7D3 hgBegUNGjVGUEKF1T7Fj9rTptVJFfTT398fL6JmYp/uSYUEjc0UxkVfIxs4Ji+u3hpC8 rtrdVB3Vhbrh8CrBMjPo+JSqXdtFC7Qqd7TUMIL8dNtmVtehgkzya2L9vVkjd6szwo8B 8Log== 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=CwdaxBQYhbbp6xOEImINjx84LLgEcLjglJrQuNZ2A0I=; b=AgH7N6r1/3rL19VjQ9Jd7lUArUA0XUjPE/bsGJKZkeuNcnxc4QeWUVK5VUdKyCfP1E mRHUChHTnyVMABqXU8jCRf1BYHfaNi0Nzh2Hb7TrmsyFek0t9Bg6ShL5zbS08KIGWR13 egWcB4qNNDHW1bVykJqSFFDwxAo92i2krnZE+4yUxO1KJvbRO7ccCYPjeSl6mi2rzMnJ 92t2sZDrGXzxgzbz0l2g1gRXxsc5whqdYI8ooL8yepTH9oNZ1TaOnDhRXMthqWyN3O72 auiaiTBvJhMzdogt0dahtSH/9YB9ac0yOJAccWTq0Ut2f10GW2bKerswXF/+PT6Dmtey Vpbg== 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 t66si5281645pgc.606.2018.03.16.09.56.12; Fri, 16 Mar 2018 09:56:29 -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 S933859AbeCPPd6 (ORCPT + 99 others); Fri, 16 Mar 2018 11:33:58 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39202 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933844AbeCPPdy (ORCPT ); Fri, 16 Mar 2018 11:33:54 -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 DB7E2F2F; Fri, 16 Mar 2018 15:33:53 +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.9 85/86] earlycon: add reg-offset to physical address before mapping Date: Fri, 16 Mar 2018 16:23:48 +0100 Message-Id: <20180316152323.074686007@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152317.167709497@linuxfoundation.org> References: <20180316152317.167709497@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.9-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 @@ -253,11 +253,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);