Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp80049ybf; Wed, 26 Feb 2020 09:10:23 -0800 (PST) X-Google-Smtp-Source: APXvYqyBeCUw1fiOQbABydCrz25wAO7GuI65gsewG+PngbcuM/2HmiFsIb4+BBTJPgvUTYlRgD+R X-Received: by 2002:aca:f517:: with SMTP id t23mr3801374oih.160.1582737015558; Wed, 26 Feb 2020 09:10:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582737015; cv=none; d=google.com; s=arc-20160816; b=g/q+L1jfpgfDPeF1KG6dW9UqeGS1M4U1Jy+Rpyp/8SpLr1NwwY0MddACXvjGEtrAQg OOX/JrZk9NQ13+62xrcXZkXP7hqg24Mkou74k0Mfe0HG50cUJEPbsmQhgObr2zhJw6pC C08cXplNQxOcSzMaQT47eL1YhB2i48QwDNdXqO3tB1JLck229nzilTPOM2siS1k/9UmS 7m9AXMwBuJhnUe7qaICMZUkQenKOsw51h8Wj5SFRHjLQUcPhLtbtj8Tf+NI+0+FIROdk Sy40jK01OHLV4uqbhUseNt0xfzdrjk/abdxXL5VDiMzaUAqTm8g64x04ovXBH1KDs9Xo dfKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=dmrXzejAAlw8opacTN1fKOK2zfgOfWf7geCir9NF8o0=; b=HsWqvMgtrfxO9pawI9J4l+CCIuXewQdOeNQ4mEVJMvHY24h1n2hjM6guL5pmddjP83 XvjL/zm/xZy3whpKn6N1MazNi2U9qswqG/QoYwkqLmVF3SxgsyTr8Sry7sXQZvSVRhLt vKjYYo468B/xOrvUkqm2uKGPVdfjs0cKy1FT04skjZ6ruaZshu643eZf0wI5hX0jzng/ Md0K7YwwXwoQGUxVtf5V/nt7FKDyC/c0SoQwm6Il3IQfBl0BmTJHOqjXIxV+slT0bdxp 9OhJ2ldsUlW2JwxnqMwg2rIgood+GaKcFLHn39esh6LN1ffnx5/LDKFGvYaf4maGTdYK RnwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 185si1517383oie.52.2020.02.26.09.10.03; Wed, 26 Feb 2020 09:10:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728208AbgBZRJn (ORCPT + 99 others); Wed, 26 Feb 2020 12:09:43 -0500 Received: from muru.com ([72.249.23.125]:57782 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727240AbgBZRJn (ORCPT ); Wed, 26 Feb 2020 12:09:43 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 62B8F8022; Wed, 26 Feb 2020 17:10:27 +0000 (UTC) Date: Wed, 26 Feb 2020 09:09:39 -0800 From: Tony Lindgren To: Lokesh Vutla Cc: Daniel Lezcano , Thomas Gleixner , Linux OMAP Mailing List , linux-kernel@vger.kernel.org, narmstrong@baylibre.com, Sekhar Nori , Tero Kristo Subject: Re: [PATCH 1/2] clocksource: timer-ti-dm: Do not restore context on every timer enable Message-ID: <20200226170939.GQ37466@atomide.com> References: <20200224050753.17784-1-lokeshvutla@ti.com> <20200224050753.17784-2-lokeshvutla@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200224050753.17784-2-lokeshvutla@ti.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Lokesh Vutla [200224 05:09]: > omap_dm_timer_enable() restores the entire context(including counter) > based on 2 conditions: > - If get_context_loss_count is populated and context is lost. > - If get_context_loss_count is not populated update unconditionally. > > Case2 has a side effect of updating the counter register even though > context is not lost. When timer is configured in pwm mode, this is > causing undesired behaviour in the pwm period. So restore context only > if get_context_loss_count is populated and context is actually lost. Sounds like this will break things. We have get_context_loss_count() only on omap4 and later, and even that was only partially implemented from what I recall. To mee it seems the right thing to do here is to save and restore context on CPU_CLUSTER_PM_ENTER and CPU_CLUSTER_PM_EXIT. And I'd just get rid of the partially implemented custom calls to get_context_loss_count(). See for example a recent patch on removing the legacy SDMA code for CPU_CLUSTER_PM_ENTER in commit d2f924879e19 ("thermal: ti-soc-thermal: Enable addition power management"). Then if we really need to add checks for context lost at some point, that can be implemented via reset_control_status() returning -ENOLINK or something similar. Regards, Tony