From patchwork Thu Jul 23 15:26:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 11681235 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6655413A4 for ; Thu, 23 Jul 2020 15:30:49 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 3EFEE20714 for ; Thu, 23 Jul 2020 15:30:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JpDaiUID"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MqR5dmPJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3EFEE20714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.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=Og7RZ8wNKu4Li/m+pqVTR/MV1GL+noTrGnPhT7SFiPQ=; b=JpDaiUIDQ2miQI4gZiqmMsv2R cSCejhPF/YAk334dQ556zmUW89yz+j6ofBfNi2OOp50CeFn8nt24l9NdlIm5wt8N36gnAjlzgThvY rrWYz9oMjDv6dMH6EgZrflnG/LGnpDoKjJx/Km/TKtq7jm8z+AOxpYz+8gBqqBNcMvegSBTe0QB4r 1CFj1p94z/OiFPD9zOPuAnvVN4asavBjvExc2n3xFiJ83q8ZgrEoBwgO74cfvyHWHddbNN35TZS0G bXJBc1dUdKKmW7tJOQlwVPAbzaTFw5KnrT9svMHC2WGp/31J56TwR89V5atKp59jfqYelrAyWEanZ FsGoG7UzA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyd9M-0008DT-R7; Thu, 23 Jul 2020 15:28:48 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyd7g-0007XJ-8S for linux-arm-kernel@lists.infradead.org; Thu, 23 Jul 2020 15:27:06 +0000 Received: by mail-wr1-x442.google.com with SMTP id f7so5589917wrw.1 for ; Thu, 23 Jul 2020 08:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e0JbtEzkpaP5eGicuhoxIx9QkzOY7wkk6qcai0tP1vY=; b=MqR5dmPJKZt5Lk2FpnBD7WSKUc64KVMlhC8TpRuuc1fCQVK+ljTQjWIpP4o/fpD4xf g2QN937wYa9dtz2D23TXK5UXLLgxEcUIhiiF9D8+R2QonAWwNa1YErbAM9LbX4uoVBd5 bknzhLQfmWzQ+zM3iTrrBEQzlbZQjVa9f2Hhh3zN1r2PoGLM2qnRPlzGhkEJbZDnJukr CT4b6VRCt5Xjp1KwcFnxxLRDZqnGOaw2Bew9S9KMK8vrpe5gpDfpFq4EFIRal4MK6VDs cM2lmE5zK9LVDyWZJQRqQg/M+MoXpLnkdqy110RE/WpQXgfxIv2z8hV4l/D+OG8625Wm BbMQ== 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=e0JbtEzkpaP5eGicuhoxIx9QkzOY7wkk6qcai0tP1vY=; b=k0HL2LA+lo0/zTM2QvKXK3MhWbxQuLgpDOm+QpcuKMVJQwZM3sGymyT/JCTi8cF9QB dh+mZkViEY1u6h+yUzx0czdWYfTPf4e/maSS5ZCPmxPtlsjK4+zGApOJSDamuQLbx8Fh jdXhC4l3VyM/Q6QxSLJEvmFWgjVlK3chnL+r7k5gSVI18DYaZCa9bW+Yl0XYTOcMvrBo rnE7WjvP6XwehXoEu8vgj5CytfsmsHF9enHRfrJNfGW2PF5oMUGzHCrxDOSff3A6qm7u 9Vye6yER5+DaQdiJ9se4eVKw1+TKmReMpxl8h+4f95OtXNRii/Iz+1vU6cfGfBRMAha1 0MCA== X-Gm-Message-State: AOAM530kqGGOhebzc3itT/mDeMt1gXFFt9EDNlqMxKA35GC/ZFhKntBc BjVAY/Q7AGX1o3A1+6/Nr1T8LA== X-Google-Smtp-Source: ABdhPJyqC+WdoaOrO38I8UGAoEbMymegflGpb1WsDygxY9WWLT9NW89KSD0qTRB+yk+7qRMD5LCbZw== X-Received: by 2002:a5d:5609:: with SMTP id l9mr4373612wrv.86.1595518023106; Thu, 23 Jul 2020 08:27:03 -0700 (PDT) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:dca7:8d30:33fa:daac]) by smtp.gmail.com with ESMTPSA id g145sm5963491wmg.23.2020.07.23.08.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 08:27:02 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Subject: [PATCH 08/16] clocksource/drivers/timer-atmel-tcb: Allow selecting first divider Date: Thu, 23 Jul 2020 17:26:28 +0200 Message-Id: <20200723152639.639771-8-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200723152639.639771-1-daniel.lezcano@linaro.org> References: <1b1122f4-bce9-f349-e602-ed8e14cbb501@linaro.org> <20200723152639.639771-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200723_112704_369084_002078D5 X-CRM114-Status: GOOD ( 11.35 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: Alexandre Belloni , Ludovic Desroches , "moderated list:ARM/Microchip AT91 SoC support" , "open list:CLOCKSOURCE, CLOCKEVENT DRIVERS" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Alexandre Belloni 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 Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200710230813.1005150-9-alexandre.belloni@bootlin.com --- 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 7a6474acc774..7fea134650fc 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; }