Received: by 10.213.65.68 with SMTP id h4csp506986imn; Fri, 16 Mar 2018 09:51:11 -0700 (PDT) X-Google-Smtp-Source: AG47ELt0kw+RKlC1YheYKkYgRxqB8/XzuxSUJLnkBnvuFo/iAJzQtSd4K+gyCxnOW8Oyn6K++GK5 X-Received: by 2002:a17:902:128c:: with SMTP id g12-v6mr2809137pla.98.1521219071830; Fri, 16 Mar 2018 09:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521219071; cv=none; d=google.com; s=arc-20160816; b=JBH+a2wUyL0pwN6xcY+43d4Tpquw0Fp1jEa7h2nrwG7E+ogAWgh1o+PPDedAtSUHM4 2su/MVXvOnRfbh24gRgLVF5q3RQAdiGYwFJ7swXZ0LvBSVHQpR9p7kmUyZDVr/zGCM8N 3Ug+uvZFUqkR+km9lG40eSRroPiOWBix46Ke+ZftYa76JcwC79l26S1/rldfVSHRQ+7j ZHpBccfY1+bg7Y8C4Jk/ujMhjrWXfNHTJO2TiNmXdTdQiU1ExndcClYaR/8SkgVbKdfU I4Ug/bB21TsON0W5eYcW9IqxDos21gY7QNgP7sxo+nlARh/QMGP9Tw1/GAjA8NYe5sr/ ogbg== 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=hP2GVBwHaf22IeTCpUjkCFZFizEanZYvZDrql9Y5T4c=; b=LJ9EiqvxoCgr0TrB6nuMUw9RjH960OQMcB/Ubiv8Eiil9lE/d5ar4lqv3xWFlnFvRl WbyJQlZrjq7XVjCmr9WH98Y1kYnG5A+u3MwIwqf+TfnVqKd9nsnSP/NpzhnD0bUg3UeG ws1Ku/WAef4C2dkfMALjMpD9o1HFCwnQWj1i7CIxaUisI5LKQ2CubRYzo+tSrALI62oN VS063r+hgHeiNWbfh4k3tiidRurBd+/TbNZ5p8dC/tQDjdwgjYMWtFNlDzIlf/A5EkZH VIvQkVtbEGdE8mkufZd8pbb+FxCuhQyh6rhtcXBrg3wvtkmMaXP212N4bB1s8n8r1Eqx FEeQ== 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 f12si5078565pgo.625.2018.03.16.09.50.57; Fri, 16 Mar 2018 09:51:11 -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 S934057AbeCPPe6 (ORCPT + 99 others); Fri, 16 Mar 2018 11:34:58 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39582 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934026AbeCPPes (ORCPT ); Fri, 16 Mar 2018 11:34:48 -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 E2A711012; Fri, 16 Mar 2018 15:34:47 +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.14 024/109] earlycon: add reg-offset to physical address before mapping Date: Fri, 16 Mar 2018 16:22:53 +0100 Message-Id: <20180316152331.266725718@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@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.14-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);