From patchwork Mon Nov 19 21:44:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 10689511 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5C5A814BD for ; Mon, 19 Nov 2018 21:45:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BB552A6E3 for ; Mon, 19 Nov 2018 21:45:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3DDB02A70C; Mon, 19 Nov 2018 21:45:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E7B782A6CE for ; Mon, 19 Nov 2018 21:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/WH7rQNbffv8Xptmty1UJ7Q0nmWWbrlH5lAOV33Sv/E=; b=H1fthbfGpn9fH4 sUAzJGNM6eaBG520wFW9vjJLEE/nc2MsYFrejSOL4cy9XrbI02OOrIqjVJd3g++h7gh5dkws2S3WS f1rrGGdirW6BrBgs28M3OJ5VvjpYNEHT5slDtrk928VfH1R31cJN5ah13Wf1sfwfTC7dFJkfS16t7 JxI+TlvYxoBPreucioULS34wYqpxdPhihjYoD1biqJD3yMudL+XvYnsrZk3+AGIl2l1Sb9qThg6Ao 6NzgDvwOmGp0NSrwMYZj+P63cNtqYCNzKDrKKnKk9DhVQ3pCgdW/pyBTvWBZqXymNXiP2L4NQaJdV cchNDXJOEcGYL+3wjHQw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOrM1-00042P-Dg; Mon, 19 Nov 2018 21:45:13 +0000 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOrLm-00038S-3x for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2018 21:44:59 +0000 Received: by mail-qk1-x742.google.com with SMTP id d19so51253597qkg.5 for ; Mon, 19 Nov 2018 13:44:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=+oQAX8fwUnGMvYCxHbkSvUAGYzEO5k42+h8wSeOChms=; b=Oukja+Js1aUq3NeEs4N79u8gxf2bCTQ2K/Z5der+Rrzww1avzZ2PrSS7S4mhMtxpzb XLu6KzfuVo7WnqoNO35C4RXKsJMhKDY9xNA4VkIrQWLriPARO3w3RauD6FBo7pn7lmNU j8LuJvPcX7OFaGvujNsu6BR3tYL3UVGTAF2drHttnM1rsnDfq27sx1w8KSR5+gSe4WlM yz8Ku/AMauxpvMfgKTuY1B7BzYi/nC57xpvWDIyGstX4wJw0RF2EWWOl2RHYULFBK2mz 6FyRP1Nk4oT3knhZUJSwUK2JJnHmDtDjZ71WefwsUQl29MDCs8hdkAOvigNqUDShBY8a tkrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+oQAX8fwUnGMvYCxHbkSvUAGYzEO5k42+h8wSeOChms=; b=Wae7qvFcNcqPyekdqK2nFh9RQUwyQ679rzMpaP1lXkiivPJJgBKaV0n41usqAQWvY5 jKjJUcpEU2CTpR1P2wKF/Hlf+lzs1360gnySOSO5hCkSpmeg3RcgKY5ICKMKcEYkUx31 axp4cUXpizpaZ0jIQxxxqWOsKbVch0XyhJnYmuL58xYRwwSWSYTjMgcuU4anYLaEGXUk TtfxwtDXf8fVoZuT0nbc7u/sI75BUuDTmyirV/oUIFSFPsc5nBeEFVftvLDZJkPvX4Ts AUhlHBgVJtEqjXMNQ79UGRKFaJ3GUJX87VYgr54ZTL+YLSO3NC+p1XGWCSB7GoZiQVlf S9UQ== X-Gm-Message-State: AGRZ1gKZnq1k0ij5LVQAUHFoOztd3tGPArNipJbiKuZoG3sa4DolaJf/ oY8GxoTiCTEFLyeJltLPd6fmf/KacUo= X-Google-Smtp-Source: AJdET5eCz8eaYpJLthFftXGDx+7xM8nZvQyJsMUXnrynMCHshVEfCIAcsKk/W8Vp9iHsJqS17FVO2w== X-Received: by 2002:ac8:7116:: with SMTP id z22mr14773455qto.377.1542663886774; Mon, 19 Nov 2018 13:44:46 -0800 (PST) Received: from localhost.localdomain (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id x5sm27493714qtc.43.2018.11.19.13.44.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Nov 2018 13:44:46 -0800 (PST) From: Pavel Tatashin To: catalin.marinas@arm.com, will.deacon@arm.com, akpm@linux-foundation.org, rppt@linux.vnet.ibm.com, mhocko@suse.com, ard.biesheuvel@linaro.org, andrew.murray@arm.com, james.morse@arm.com, marc.zyngier@arm.com, sboyd@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, pasha.tatashin@soleen.com Subject: [PATCH v1 1/1] arm64: Early boot time stamps Date: Mon, 19 Nov 2018 16:44:43 -0500 Message-Id: <20181119214443.25175-2-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119214443.25175-1-pasha.tatashin@soleen.com> References: <20181119214443.25175-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181119_134458_398633_0E06C32C X-CRM114-Status: GOOD ( 12.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Allow printk time stamps/sched_clock() to be available from the early boot. Signed-off-by: Pavel Tatashin --- arch/arm64/kernel/setup.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index f4fc1e0544b7..4df41a66b403 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -279,8 +280,26 @@ arch_initcall(reserve_memblock_reserved_regions); u64 __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID }; +/* + * Get time stamps available early in boot, useful to identify boot time issues + * from the early boot. + */ +static __init void sched_clock_early_init(void) +{ + u64 freq = arch_timer_get_cntfrq(); + u64 (*read_time)(void) = arch_counter_get_cntvct; + + /* Early clock is available only on platforms with known freqs */ + if (!freq) + return; + + sched_clock_register(read_time, BITS_PER_LONG, freq); +} + void __init setup_arch(char **cmdline_p) { + sched_clock_early_init(); + init_mm.start_code = (unsigned long) _text; init_mm.end_code = (unsigned long) _etext; init_mm.end_data = (unsigned long) _edata;