Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp945892ybl; Fri, 10 Jan 2020 09:19:48 -0800 (PST) X-Google-Smtp-Source: APXvYqzTdZ8aj7wQdxRabkHxvKag2pzXxOcW4FkVkH5fEc4zH6BaCIaIXRXr6FvI2mWmgDyV72ol X-Received: by 2002:aca:c646:: with SMTP id w67mr2952693oif.171.1578676788880; Fri, 10 Jan 2020 09:19:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578676788; cv=none; d=google.com; s=arc-20160816; b=QNXpd8z8fwzlOfR5fyLb7Ij2UT0D7VfQIettfy1+b7P6sorRSlcoRqdjhecuL45Fi7 4o42hrrKD+0MQcr2Ew9/9US188B50GhAETc9gka4WKPNX//uhCKsYUR8LqxQIAbI+mbM /pdC0BuqmHzF7Qor4veFlrhMaTFyas1J0RE8aMTAYv7jDfJwbzrgJvE6PKRftDiyPfNP GwPMDKDT0gCk1ktDCBTKdrBXbh2wP6i60ZpvN0AQ4FBtz9MyqVLyqnLZA/rFsErK1p1F OeP/Hr0wgwc0WVBcm609MoVcl+UTEMQ3+YJhbuA+wcxUDEBTuunYxkKV6MLXtB6U5zP9 QS6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LJ+029g6d1kMuKZjHmcK4CynzHKfYgyeKH9nRPh7CKA=; b=U3Nzk18ozISEj+xS9n20c77b2y6wL08s9f4TidXBvfmkx2TXVPFpsicKUVN4KINxS3 y7H9RZB2FRjk2BcAE52ZMibHPW9k/+ye6H05CmpMqhOP1++IpyLs7tbHaZvEyj95eu/g D246oo4Apz+v5HNNZs/lNLV9vnssckBiLYidahHVM6kSxCJen5Ui5C03ZBpQNJlwFfk5 u67y+ryGoxdESMs3W4P7VP359yet9cQN8LqOor6aAJRzM2C3XAYs3Svr+l3NJrU+pKzZ N0dR8+NUFw3CbP7cMJek4md7WmjFrOI5FlcslxCY8LwNcnmeyxk6DiUF6FD+zRGV+4C2 iwxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=lzhbjfPf; 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 c186si1333497oib.103.2020.01.10.09.19.36; Fri, 10 Jan 2020 09:19:48 -0800 (PST) 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; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=lzhbjfPf; 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 S1727446AbgAJRRI (ORCPT + 99 others); Fri, 10 Jan 2020 12:17:08 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35315 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726346AbgAJRRF (ORCPT ); Fri, 10 Jan 2020 12:17:05 -0500 Received: by mail-wm1-f67.google.com with SMTP id p17so2784964wmb.0 for ; Fri, 10 Jan 2020 09:17:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LJ+029g6d1kMuKZjHmcK4CynzHKfYgyeKH9nRPh7CKA=; b=lzhbjfPfk19t6AL0qyxVZQ9GlqoWYbfiLPz2M+qi8UINPCtmAmxW5zxIU7dmQVXedT iIT6Ngof6Bbf5giZ7v/4QhbEFb0e1HVADVFHFkAdpZ/1PB4Q/aEIKEGgXJoWBuGJxKup /Gids0NlPdKQ/AxfQfR85lZCQEMjSKFFcNrQTd+oto2NeRAQUWsrgtf6P5EcOXkMIR2M fLKdNRWvDHopsobyZZErkuruMItzSyAAy8i1bgwLEpnm4M3vtISonhgyqJBrIvoUAcHX ONuLvlZ/tgTAdjj+3Glr/kP947L+ebAcynuHbhrRIjXsZWIvB7ERU24AVhQYlicZAC92 GHzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LJ+029g6d1kMuKZjHmcK4CynzHKfYgyeKH9nRPh7CKA=; b=ovxurcZw3LcRyDemlDs+SJ9agsq6BLmm1qkYrDGo31pXLpLstMfyVjt6aEW8sa06Pz 1IKKbEeTM548jDAR78ddziUpsnon+cUIYP67K7iRoVyh2m4R0YG9BUd6TNwRdRHKcg5E yPoU8X+0/7FapmI7pU54c4lwVZqUVkkjxPhSB8H/9g0ZRpxLtXhMdlPvHGn+9z0091km q+XaTS7fHyCrY2IlcUMG2q8AoaR0sAuqgdxM0KBxgC19iCVaXA48g+psRsRo0TDzBKMx fKXz7vslmSQ3xqvW9z1mb19mxYtnx3AzFzKbMSuBMWxmiAWverxUcoicSGi9wZ8xBX/y YGzw== X-Gm-Message-State: APjAAAUnBdiL/fqUcdSls6ftMMVow9JBsNe7HnG2gK4+Rgv7snoyLdze 07D6a11KJAP45mElMSGfjZUonOUyM8s= X-Received: by 2002:a1c:7406:: with SMTP id p6mr5432051wmc.82.1578676623525; Fri, 10 Jan 2020 09:17:03 -0800 (PST) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:b0ec:c83d:aa26:b93]) by smtp.gmail.com with ESMTPSA id z123sm3072725wme.18.2020.01.10.09.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2020 09:17:02 -0800 (PST) From: Bartosz Golaszewski To: Sekhar Nori , Daniel Lezcano , Thomas Gleixner , David Lechner , Kevin Hilman Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v3 1/3] clocksource: davinci: only enable clockevents once tim34 is initialized Date: Fri, 10 Jan 2020 18:16:41 +0100 Message-Id: <20200110171643.18578-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200110171643.18578-1-brgl@bgdev.pl> References: <20200110171643.18578-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski The DM365 platform has a strange quirk (only present when using ancient u-boot - mainline u-boot v2013.01 and later works fine) where if we enable the second half of the timer in periodic mode before we do its initialization - the time won't start flowing and we can't boot. When using more recent u-boot, we can enable the timer, then reinitialize it and all works fine. To work around this issue only enable clockevents once tim34 is initialized i.e. move clockevents_config_and_register() below tim34 initialization. Signed-off-by: Bartosz Golaszewski --- drivers/clocksource/timer-davinci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clocksource/timer-davinci.c b/drivers/clocksource/timer-davinci.c index 62745c962049..e421946a91c5 100644 --- a/drivers/clocksource/timer-davinci.c +++ b/drivers/clocksource/timer-davinci.c @@ -302,10 +302,6 @@ int __init davinci_timer_register(struct clk *clk, return rv; } - clockevents_config_and_register(&clockevent->dev, tick_rate, - DAVINCI_TIMER_MIN_DELTA, - DAVINCI_TIMER_MAX_DELTA); - davinci_clocksource.dev.rating = 300; davinci_clocksource.dev.read = davinci_clocksource_read; davinci_clocksource.dev.mask = @@ -323,6 +319,10 @@ int __init davinci_timer_register(struct clk *clk, davinci_clocksource_init_tim34(base); } + clockevents_config_and_register(&clockevent->dev, tick_rate, + DAVINCI_TIMER_MIN_DELTA, + DAVINCI_TIMER_MAX_DELTA); + rv = clocksource_register_hz(&davinci_clocksource.dev, tick_rate); if (rv) { pr_err("Unable to register clocksource"); -- 2.23.0