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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 1F30AC433C1 for ; Mon, 22 Mar 2021 16:35:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB0446157F for ; Mon, 22 Mar 2021 16:35:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231311AbhCVQeP (ORCPT ); Mon, 22 Mar 2021 12:34:15 -0400 Received: from muru.com ([72.249.23.125]:45702 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230330AbhCVQdr (ORCPT ); Mon, 22 Mar 2021 12:33:47 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 47C59804C; Mon, 22 Mar 2021 16:34:39 +0000 (UTC) Date: Mon, 22 Mar 2021 18:33:40 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <556d55af-0b30-8751-6aef-2e1bb9db1a76@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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. Or do you have some better suggestion for the flags to use here? :) Regards, Tony 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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 8F3FDC433C1 for ; Mon, 22 Mar 2021 16:36:09 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 379EB61974 for ; Mon, 22 Mar 2021 16:36:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 379EB61974 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=atomide.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RdxQyhdOnvTKZkIrNaLDjNiQo6YB1hnQRy5svdcg8Do=; b=hZmRRh3DR+P9cywOiaYU5cDar 8TIcRkSD3NeIpz8WrPxrLaaN4W3Cdajg8P5w1BZluvyTmjhmVv3ZTveTBkjEo7ePZKSmqp7u3Ofuu NRMeLglgwzQBS6kQwLaXl99IzGHSiNXhf4vIAaHDtf94tnguAo/Sg2QQwPk5UyzYnhvl2r0jV9D1d kzMeURWisTvQpn9f20Fhcz99pPOnrnKAByneADZYkvfdiSZ06CWbuQIpvL8vNka3OVsMfmsDsqAXV eFVDTr9bQtrNC5ZtYw1GcQ1ztFEcvpiiKffTPe8mC3GTJm+iUdoOT+PCKenNRz7uCMH5qchchd+ev PGz+saCKw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lONV8-00C2xG-74; Mon, 22 Mar 2021 16:33:58 +0000 Received: from muru.com ([72.249.23.125]) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lONUy-00C2tS-1n for linux-arm-kernel@lists.infradead.org; Mon, 22 Mar 2021 16:33:51 +0000 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 47C59804C; Mon, 22 Mar 2021 16:34:39 +0000 (UTC) Date: Mon, 22 Mar 2021 18:33:40 +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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <556d55af-0b30-8751-6aef-2e1bb9db1a76@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_163349_031080_35C4BEFA X-CRM114-Status: GOOD ( 19.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Or do you have some better suggestion for the flags to use here? :) Regards, Tony _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel