Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4010122pxf; Mon, 22 Mar 2021 23:34:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCy2KobXELlKcbJVkDn7fKygHEs1G2SIdTISjfLvQh0Jp/InZRX/MZAU9wB+3uOSPwu8kx X-Received: by 2002:a17:906:f88a:: with SMTP id lg10mr3464588ejb.39.1616481289971; Mon, 22 Mar 2021 23:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616481289; cv=none; d=google.com; s=arc-20160816; b=ExbDsRlmhnxnChJ+expFfCkcUtrpMi24mnJew09qVDFTIDFft6zCB0MoxTs26pvH3h DVWIAcpzw/HZ6AdZmdE4NCgXVFLJnJwrLMwTyZL4ioZGdZESIc1yIk8MYx5AB/aPPgni sSAPKJF5MXX7mBtdXlDaAzrnfN5zUqtiKmTmIpxBJA0QrWkju/js/1brIra34ZKW2Meu Ur3wuUy0r5fkhmq1HI+WqXO6LPumnP3IUjyAVl+c4fpxD5O443Q9J2EXtnIOY570C+hG WWI26StGNwr9MdYAhYnSCKuZ3XuE3nxGJjBKgRSzgxkaGdR1wNfPqrSL3LwAQc24LZbe SuUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=fXE45U0JCGtwRdM0F/aHqYvgxGs82gffSPOkOoN/KSA=; b=IqogdeUlyRfMi00g5jF7D9JfjLmXTVGK9fhNxMeBT23BwVobmKVC6q/8Mwr3bu0mSL RtiPQIdajAwZznmHVKjZSu7JHsUAZqmtlVUQwdNim6QaRpoH4y6QY+u6R946+5716vJW y33EsAB20GS+CIzXvkLCValwNz0eWZgCo6UqsNZ5fqxECEtIcIjC1rbMcKb0Mo8Q1jcE CHxxzElFkI15xF8qdp/aCroMY+qHTJeWcIBaUEgpiAjkeF5f7b3nSazNFxjhGHMK8e8p TyDGTXvDaWoKrBzMxuuHY09P0+Uwga86Y6hCb6dcWX0cVFTxLunzb4bkW3hRYNbQJXop hWtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c25si12876981edw.293.2021.03.22.23.34.27; Mon, 22 Mar 2021 23:34:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229961AbhCWGcY (ORCPT + 99 others); Tue, 23 Mar 2021 02:32:24 -0400 Received: from muru.com ([72.249.23.125]:45888 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbhCWGbz (ORCPT ); Tue, 23 Mar 2021 02:31:55 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 09CE1804C; Tue, 23 Mar 2021 06:32:49 +0000 (UTC) Date: Tue, 23 Mar 2021 08:31:51 +0200 From: Tony Lindgren To: Daniel Lezcano Cc: Thomas Gleixner , Keerthy , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tero Kristo Subject: Re: [PATCH 1/2] clocksource/drivers/timer-ti-dm: Prepare to handle dra7 timer wrap issue Message-ID: References: <20210304073737.15810-1-tony@atomide.com> <20210304073737.15810-2-tony@atomide.com> <556d55af-0b30-8751-6aef-2e1bb9db1a76@linaro.org> <5c3c2447-3f8c-160c-8761-e43c1b4ebbf9@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5c3c2447-3f8c-160c-8761-e43c1b4ebbf9@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Daniel Lezcano [210322 18:24]: > On 22/03/2021 17:33, Tony Lindgren wrote: > > Hi, > > > > * Daniel Lezcano [210322 15:56]: > >> On 04/03/2021 08:37, Tony Lindgren wrote: > >>> There is a timer wrap issue on dra7 for the ARM architected timer. > >>> In a typical clock configuration the timer fails to wrap after 388 days. > >>> > >>> To work around the issue, we need to use timer-ti-dm timers instead. > >>> > >>> Let's prepare for adding support for percpu timers by adding a common > >>> dmtimer_clkevt_init_common() and call it from dmtimer_clockevent_init(). > >>> This patch makes no intentional functional changes. > >>> > >>> Signed-off-by: Tony Lindgren > >>> --- > >> > >> [ ... ] > >> > >>> @@ -575,33 +574,60 @@ static int __init dmtimer_clockevent_init(struct device_node *np) > >>> */ > >>> writel_relaxed(OMAP_TIMER_CTRL_POSTED, t->base + t->ifctrl); > >>> > >>> + if (dev->cpumask == cpu_possible_mask) > >>> + irqflags = IRQF_TIMER; > >>> + else > >>> + irqflags = IRQF_TIMER | IRQF_NOBALANCING; > >> > >> Can you explain the reasoning behind the test above ? > > > > In the per cpu case we assign one dmtimer per cpu, and we want the > > interrupt handling on the assigned CPU. In the per cpu case we have > > the cpu specified with dev->cpumask unlike for the normal clockevent > > case. > > > > In the per cpu dmtimer case the interrupt line is not wired per cpu > > though, so I don't think we want to add IRQF_PERCPU here. > > If it is per cpu, then the parameter will be cpumask_of(cpu). If there > is one cpu, no balancing can happen and then the IRQF_NOBALANCING is not > needed, neither this test and the irqflags, right? Oh yeah you're right, none of that is needed. For the percpu case we already have irq_force_affinity() in omap_dmtimer_starting_cpu(). I'll update and send out v2 of these two patches. Thanks, Tony