From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5147ECE596 for ; Wed, 9 Oct 2019 22:42:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7526F218DE for ; Wed, 9 Oct 2019 22:42:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AnnIm6CQ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="3KhKthe2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7526F218DE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Cc: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:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pDYAMyfdER+bN714mOgmRnB0jE9DlIhz3dphk1ay0+o=; b=AnnIm6CQs4w0cx pPM/rrKRxYB9X1+q+S+QgAL2YIphz8MI5WivQmFVdHjUgksnoq+2bjCIzXx+SmQrZra3vXIsoOdk9 hHWrrmwKurUX5uWVr2cX8J1zSDzXbyhU/a6idHYj4DZYvkYrZ3n76ief/gD1IjClByLz6Fj8U10f3 3hJ9OzOBkpR1sdavO4dXJ4Ukv78TWSfpiMWhzZXLMW4erqYcENqvPBQc2Q46KkG7dO6clwG0NXkf6 VPaGJutvaqaprnZw3sZjdUgaeiNH5NIFwgPcNUK98uRjZsdOK4qAh3cDfWrlcHFt9xdLExZLCWPNC Si51A3CIhP5j3YLGCc7Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iIKez-0002l9-1T; Wed, 09 Oct 2019 22:42:21 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iIKdY-0001FA-Gs for linux-arm-kernel@bombadil.infradead.org; Wed, 09 Oct 2019 22:40:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=P7jnIgRzdOlbpzapvfQ9Wjn9wGorKJ6gROjLEY8NhyE=; b=3KhKthe2dCXqWVhYCppr46UOhq w015E0YIqAnOySJQST1JWrc+p94xB9jV0EQcZcfnLv4XN87lz8h/2BS74ATP9+mq1JcGpnXLD0fSL ekkSDB89FgFKNPX0mCl+qQ3C5VjoA2eKd5Hbxf9mbfuGxRHve7pSAyqhtQyqIRYx9UmG2ZvwLDg8x hCEMgMLOcbkNI6c+TR5ZS6aJkqpmuSN0BOuvG0ao0a+wuUHxjbmIPKqO7ZVjIZPJJKq8j8C/dNQKq sT3u3NmUD66YSelJUQ8XkajXUbC0mwPD58s2qX+uWu/O2Wng6tARJ070cPmlg6NRbwShmSRqlw/kK 1bBJznpQ==; Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by merlin.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iIKdV-0001VW-D1 for linux-arm-kernel@lists.infradead.org; Wed, 09 Oct 2019 22:40:50 +0000 X-Originating-IP: 86.202.229.42 Received: from localhost (lfbn-lyo-1-146-42.w86-202.abo.wanadoo.fr [86.202.229.42]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 044511C0006; Wed, 9 Oct 2019 22:40:15 +0000 (UTC) From: Alexandre Belloni To: Daniel Lezcano Subject: [PATCH 7/8] clocksource/drivers/timer-atmel-tcb: allow selecting first divider Date: Thu, 10 Oct 2019 00:40:05 +0200 Message-Id: <20191009224006.5021-8-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191009224006.5021-1-alexandre.belloni@bootlin.com> References: <20191009224006.5021-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, Thomas Gleixner , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org The divider selection algorithm never allowed to get index 0. It was also continuing to look for dividers, trying to find the slow clock selection. This is not necessary anymore. Signed-off-by: Alexandre Belloni --- drivers/clocksource/timer-atmel-tcb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/clocksource/timer-atmel-tcb.c b/drivers/clocksource/timer-atmel-tcb.c index 8fcd4d74c54b..ccb77b9cb489 100644 --- a/drivers/clocksource/timer-atmel-tcb.c +++ b/drivers/clocksource/timer-atmel-tcb.c @@ -432,10 +432,8 @@ static int __init tcb_clksrc_init(struct device_node *node) tmp = rate / divisor; pr_debug("TC: %u / %-3u [%d] --> %u\n", rate, divisor, i, tmp); - if (best_divisor_idx > 0) { - if (tmp < 5 * 1000 * 1000) - continue; - } + if ((best_divisor_idx >= 0) && (tmp < 5 * 1000 * 1000)) + break; divided_rate = tmp; best_divisor_idx = i; } -- 2.21.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel