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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96008C433FE for ; Tue, 17 May 2022 22:51:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231491AbiEQWvP (ORCPT ); Tue, 17 May 2022 18:51:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231489AbiEQWvE (ORCPT ); Tue, 17 May 2022 18:51:04 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7F7A4F455 for ; Tue, 17 May 2022 15:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652827862; x=1684363862; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Zzsg2WuJh6uzhJovq8XCrnmcAqakpF47E+0Mjk8izlQ=; b=Mh/zA90wHaa8IFQn2f2jnLCbmi/O2VIOSYlevYAzw6yV0zzCMYjK62Yi fZbpItEcukbDLIbv4aKGJ95B7vfdxZUt49cEfO/Iqq2+rmXpX75Z0W16j nQk+ODyMeYdjfNKT1tpKuEi3J3NJ+Gfyicag2u4BtVJkFk0+s5lZzABLW 7aWrjpJXuCal+QHM8lfFxnKlcQZ4p2JG8mXNIDcJyornvWLTQdWflz2f5 DsFnZ8wf5SdAGvVp0dQvKoJvWOG5tx5VdriJ/qnhGo+DZzCyUjuVdY4vM dfSQU5yMIT/lrhwxQnYyLtFmRe9dtZgFcvtRce3DAT7nxEzWTMtoORy+B g==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="251879809" X-IronPort-AV: E=Sophos;i="5.91,233,1647327600"; d="scan'208";a="251879809" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 15:51:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,233,1647327600"; d="scan'208";a="660835593" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by FMSMGA003.fm.intel.com with ESMTP; 17 May 2022 15:51:00 -0700 Date: Tue, 17 May 2022 15:54:43 -0700 From: Ricardo Neri To: Thomas Gleixner Cc: x86@kernel.org, Tony Luck , Andi Kleen , Stephane Eranian , Andrew Morton , Joerg Roedel , Suravee Suthikulpanit , David Woodhouse , Lu Baolu , Nicholas Piggin , "Ravi V. Shankar" , Ricardo Neri , iommu@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 15/29] x86/hpet: Add helper function hpet_set_comparator_periodic() Message-ID: <20220517225443.GA8069@ranerica-svr.sc.intel.com> References: <20220506000008.30892-1-ricardo.neri-calderon@linux.intel.com> <20220506000008.30892-16-ricardo.neri-calderon@linux.intel.com> <87mtfufifa.ffs@tglx> <20220513211944.GE22683@ranerica-svr.sc.intel.com> <87pmkgsf31.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pmkgsf31.ffs@tglx> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 14, 2022 at 10:17:38AM +0200, Thomas Gleixner wrote: > On Fri, May 13 2022 at 14:19, Ricardo Neri wrote: > > On Fri, May 06, 2022 at 11:41:13PM +0200, Thomas Gleixner wrote: > >> The argument about not bloating the code > >> with an "obvious???" function which is quite small is slightly beyond my > >> comprehension level. > > > > That obvious function would look like this: > > > > void hpet_set_comparator_one_shot(int channel, u32 delta) > > { > > u32 count; > > > > count = hpet_readl(HPET_COUNTER); > > count += delta; > > hpet_writel(count, HPET_Tn_CMP(channel)); > > } > > This function only works reliably when the delta is large. See > hpet_clkevt_set_next_event(). That is a good point. One more reason to not have a hpet_set_comparator_one_shot(), IMO. Thanks and BR, Ricardo 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 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3257AC433EF for ; Tue, 17 May 2022 22:51:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id C2788830FB; Tue, 17 May 2022 22:51:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5OdRtatmcg7H; Tue, 17 May 2022 22:51:06 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id AFF1A83004; Tue, 17 May 2022 22:51:05 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 90B14C0039; Tue, 17 May 2022 22:51:05 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4DD50C002D for ; Tue, 17 May 2022 22:51:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 2E26B6111F for ; Tue, 17 May 2022 22:51:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=intel.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mX1UX2TisfI3 for ; Tue, 17 May 2022 22:51:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by smtp3.osuosl.org (Postfix) with ESMTPS id 6F68D6110E for ; Tue, 17 May 2022 22:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652827863; x=1684363863; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Zzsg2WuJh6uzhJovq8XCrnmcAqakpF47E+0Mjk8izlQ=; b=MUd+a8j2oJK49tECsVGys2NxjSAiyzZJHP59Et0v3pNSiOLQjCUUuUo5 +w0MtIwVTOR7E53pNxXqRvBT/XRixEdCTL08W0SB3U4Tw3RqC3H8VzxnX 44pU5iwvUIsjbsoXs/c0jGJ4rBESc3l9wlPH3vW5Ebk7gWuBVwHJdMVPe z+bLt62TyVKuaIoSvp07dMP6jC2xAsXRAVPtABgQGWUVZjlOJQpqvekms SXTNsyK9c9FQJmFnIPYQLwMYTcQq2K9rtls9qoVa84ZmsALT90KUUYVuh XOXRzOA3A10lAGSQM6gMArk55ODNOvuLq0d2qPGiFtKbfShGddvxvkaum w==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="251879808" X-IronPort-AV: E=Sophos;i="5.91,233,1647327600"; d="scan'208";a="251879808" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 15:51:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,233,1647327600"; d="scan'208";a="660835593" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by FMSMGA003.fm.intel.com with ESMTP; 17 May 2022 15:51:00 -0700 Date: Tue, 17 May 2022 15:54:43 -0700 From: Ricardo Neri To: Thomas Gleixner Subject: Re: [PATCH v6 15/29] x86/hpet: Add helper function hpet_set_comparator_periodic() Message-ID: <20220517225443.GA8069@ranerica-svr.sc.intel.com> References: <20220506000008.30892-1-ricardo.neri-calderon@linux.intel.com> <20220506000008.30892-16-ricardo.neri-calderon@linux.intel.com> <87mtfufifa.ffs@tglx> <20220513211944.GE22683@ranerica-svr.sc.intel.com> <87pmkgsf31.ffs@tglx> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87pmkgsf31.ffs@tglx> User-Agent: Mutt/1.9.4 (2018-02-28) Cc: "Ravi V. Shankar" , Andi Kleen , linuxppc-dev@lists.ozlabs.org, x86@kernel.org, Ricardo Neri , Stephane Eranian , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Tony Luck , Nicholas Piggin , Andrew Morton , David Woodhouse X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Sat, May 14, 2022 at 10:17:38AM +0200, Thomas Gleixner wrote: > On Fri, May 13 2022 at 14:19, Ricardo Neri wrote: > > On Fri, May 06, 2022 at 11:41:13PM +0200, Thomas Gleixner wrote: > >> The argument about not bloating the code > >> with an "obvious???" function which is quite small is slightly beyond my > >> comprehension level. > > > > That obvious function would look like this: > > > > void hpet_set_comparator_one_shot(int channel, u32 delta) > > { > > u32 count; > > > > count = hpet_readl(HPET_COUNTER); > > count += delta; > > hpet_writel(count, HPET_Tn_CMP(channel)); > > } > > This function only works reliably when the delta is large. See > hpet_clkevt_set_next_event(). That is a good point. One more reason to not have a hpet_set_comparator_one_shot(), IMO. Thanks and BR, Ricardo _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C901C433EF for ; Tue, 17 May 2022 22:51:54 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4L2rw90jqfz3bwG for ; Wed, 18 May 2022 08:51:53 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Dj9z/2un; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.intel.com (client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=ricardo.neri-calderon@linux.intel.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Dj9z/2un; dkim-atps=neutral Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4L2rvS3cPNz2yJ5 for ; Wed, 18 May 2022 08:51:16 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652827876; x=1684363876; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Zzsg2WuJh6uzhJovq8XCrnmcAqakpF47E+0Mjk8izlQ=; b=Dj9z/2unrtknLEsDif77AirlCENhyt+/8E2i0/fX+DUw+pRuzS4SIZCh ySvfm56KKnKouQWk4WFUNuduETstOYTsefG5ihOUdHwwk98YRJjRND5OU +XiO+MUeUeYUph0kI6PPvKyBQoczjYwyTAXJ1fQ/Px+zrnRCTq81NZ/wq B3rfBpZ+aEigcfDM8J65/bTPYwOBjcmYyMvjnEf4T9iSFWmxbq9cskNbD XmvjTFTnpBKQkxyHa5JtfPrQFvTMADQ8ZzDqsSiA3R0/10FfOgW2eK/gC awlIBg2rgeDynJSuQIwTsvKq1L90qVCAruvj3kuyz34jJSyQ4ReSZ392e g==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="253412507" X-IronPort-AV: E=Sophos;i="5.91,233,1647327600"; d="scan'208";a="253412507" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 15:51:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,233,1647327600"; d="scan'208";a="660835593" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by FMSMGA003.fm.intel.com with ESMTP; 17 May 2022 15:51:00 -0700 Date: Tue, 17 May 2022 15:54:43 -0700 From: Ricardo Neri To: Thomas Gleixner Subject: Re: [PATCH v6 15/29] x86/hpet: Add helper function hpet_set_comparator_periodic() Message-ID: <20220517225443.GA8069@ranerica-svr.sc.intel.com> References: <20220506000008.30892-1-ricardo.neri-calderon@linux.intel.com> <20220506000008.30892-16-ricardo.neri-calderon@linux.intel.com> <87mtfufifa.ffs@tglx> <20220513211944.GE22683@ranerica-svr.sc.intel.com> <87pmkgsf31.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pmkgsf31.ffs@tglx> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Ravi V. Shankar" , Andi Kleen , linuxppc-dev@lists.ozlabs.org, Joerg Roedel , x86@kernel.org, Ricardo Neri , Stephane Eranian , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Tony Luck , Nicholas Piggin , Suravee Suthikulpanit , Andrew Morton , David Woodhouse , Lu Baolu Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Sat, May 14, 2022 at 10:17:38AM +0200, Thomas Gleixner wrote: > On Fri, May 13 2022 at 14:19, Ricardo Neri wrote: > > On Fri, May 06, 2022 at 11:41:13PM +0200, Thomas Gleixner wrote: > >> The argument about not bloating the code > >> with an "obvious???" function which is quite small is slightly beyond my > >> comprehension level. > > > > That obvious function would look like this: > > > > void hpet_set_comparator_one_shot(int channel, u32 delta) > > { > > u32 count; > > > > count = hpet_readl(HPET_COUNTER); > > count += delta; > > hpet_writel(count, HPET_Tn_CMP(channel)); > > } > > This function only works reliably when the delta is large. See > hpet_clkevt_set_next_event(). That is a good point. One more reason to not have a hpet_set_comparator_one_shot(), IMO. Thanks and BR, Ricardo