Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1819659pxb; Thu, 4 Mar 2021 23:54:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzJo+CHpV1dDkoWedmjyb+bm+RJgCw12BP5Tj6JXbq0CiOXejBYR/EcQ2YkMag6s0okgWX X-Received: by 2002:a05:6e02:1544:: with SMTP id j4mr7427789ilu.67.1614930881707; Thu, 04 Mar 2021 23:54:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614930881; cv=none; d=google.com; s=arc-20160816; b=DBD5zkYjsPIsrzq3mPQk9Co8YW5YBhIh1Bv6WgWT6pi1oQcaGuCRIhs9QCVrDcgGSf ff5FER+Q8ZimszqnHAIC9wmj8JFvDdvP4ZgngiM4bCqyx1hJJjPtefsBsSq2eqETozdh 7LJyamu3uyRqVaVO0O2AgueHzaQNiDx4xVtWFol24FrVTg+RtY+K/yRZXoBtweiQUbuf rzrsr1zjbq0EyNvJAd7Qz/nCIDM4ZpuMSMCArczDNcL3u6L7/P1XEj630q8QYgzT3LKa sHKUqkPliMo9Mwto7gC94pPCgjWUM7fE3LyRWyPQzScjDOpQPJM2kzdiOFMUwSgSy9aH uBMg== 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=hlsK1bTbsxXpOp1g7Bw6JQOztXbqeXh/XgB/38j9bn4=; b=KfMnXJe1CnEB0FPUaWFgmonYvkE0R6MnO8uS9MForw3JTYsu6o6naAi5JXIzycfOWb QnrzYb6XExhZIx/NHcVy+XbO7Ks9AbaXZw/mp1aYfZzAGLFqa/tGfob8r017LdBqCryf jkXtqF48/7r3ZRleocNooPLWrbVK9Tmv4R3DpIQMOtUqsbO3jbp0Nn1J9CNy/OBKfCF5 GidSIvxOY58zcjucl8tULyPFFeHf3FyI5659OLxwZLCOwZbsQ5gjtGK2PUozhvwtWf2K fSDtYpUO5Ug37Fz2/aBhiRNIo7YzdHeO2jAtEjIHnJcpfh27rB+c3r0E4B8ex5aztBXC Vujg== 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 b13si1606423ilv.50.2021.03.04.23.54.28; Thu, 04 Mar 2021 23:54:41 -0800 (PST) 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 S229475AbhCEHxj (ORCPT + 99 others); Fri, 5 Mar 2021 02:53:39 -0500 Received: from muru.com ([72.249.23.125]:39712 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbhCEHxj (ORCPT ); Fri, 5 Mar 2021 02:53:39 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 701C380BA; Fri, 5 Mar 2021 07:54:17 +0000 (UTC) Date: Fri, 5 Mar 2021 09:53:35 +0200 From: Tony Lindgren To: Grygorii Strashko Cc: Daniel Lezcano , Thomas Gleixner , Keerthy , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/3] clocksource/drivers/timer-ti-dm: Fix posted mode status check order Message-ID: References: <20210304072135.52712-1-tony@atomide.com> <20210304072135.52712-2-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Grygorii Strashko [210304 20:58]: > On 04/03/2021 09:21, Tony Lindgren wrote: > > When the timer is configured in posted mode, we need to check the write- > > posted status register (TWPS) before writing to the register. ... > > --- a/drivers/clocksource/timer-ti-dm-systimer.c > > +++ b/drivers/clocksource/timer-ti-dm-systimer.c > > @@ -449,13 +449,13 @@ static int dmtimer_set_next_event(unsigned long cycles, > > struct dmtimer_systimer *t = &clkevt->t; > > void __iomem *pend = t->base + t->pend; > > - writel_relaxed(0xffffffff - cycles, t->base + t->counter); > > while (readl_relaxed(pend) & WP_TCRR) > > cpu_relax(); > > + writel_relaxed(0xffffffff - cycles, t->base + t->counter); > > - writel_relaxed(OMAP_TIMER_CTRL_ST, t->base + t->ctrl); > > while (readl_relaxed(pend) & WP_TCLR) > > cpu_relax(); > > + writel_relaxed(OMAP_TIMER_CTRL_ST, t->base + t->ctrl); > > It seems static [and inline] helper here could be better solution. no? Well we wanted to get rid of the confusing macros. And in this case I suspect we can eventually do just one read of the pending register for the registers used mask rather than check the status separately multiple times. But that needs to be carefully tested and is not a fix :) Regards, Tony