Received: by 10.213.65.68 with SMTP id h4csp488769imn; Wed, 4 Apr 2018 01:55:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+AVzhTCc6E7e3jjodgJAAEcN0KGmq5+bUhTXFCcpprU+XXkIxqAeRrpodLXtaG7Jl5T8rp X-Received: by 2002:a17:902:5242:: with SMTP id z60-v6mr9428276plh.223.1522832141814; Wed, 04 Apr 2018 01:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522832141; cv=none; d=google.com; s=arc-20160816; b=YFSzHG+S8odxsQv1ffpun61EWoOdougLMY2OfjNUePFw9DAgGhYxUlpnycEibiOm3b rNMq0v/N8hz0hSHaXhkHZSUqitOGHWjg295BVfPbeSvCKZ7wUdEp0ohXFYiYlF3NvgC0 C6jekKAXQ9HrskhbVl6/uBC00+MJn7GoAOhqKJr257GKJVS+0GVqeUfORllNKxiQ7HH2 cy9G7D6u1+HSz61+7UY4ty7UqNPYNS73W5g2VINkvOCBM8xBX/1aAdXjWRnmaCBrQj8+ fxVRjFVVMTS6qq2kgfq4qUv7WUHZHby6dgWWaMtetB2V4JSGFEL/hV5a5N/o/RornV+k 0dWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=5AkiqJXwjz65ePjvQ1hUq0OO3OtojXFisC5eeKOEkc8=; b=ACemeBm+6ULKX8fTjDFHpnJw5+aOFo6GiNcxATVwCQPF20kAyn5NipGO2trwPkYymj 77BEBcpBE+rjfpsYHmcDPXxQWguoivBRDz/6JMHZhCbhkcru40sFg3eSoKDN3wFZt/uE XnBb6iC1vlwx9vUud1FOg049WUF2jg+nm2qWOG8wZbx3i5HnLtM9V+5+W/mIxB9WQlxi Lma8ynHUliJJS01UzfsC2K52cO7/fbcAzBmKicV6waRgxoIW0wSIfFIkENpmEAnsGs3P BUBLFqgmAnQ1ncbNJj1qZylKfWGTqLkkCMFF57FBGMZSgzSfiaYdVgVYhv9LGB2aUh1n ihMA== 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 g14-v6si2732336plj.54.2018.04.04.01.55.28; Wed, 04 Apr 2018 01:55:41 -0700 (PDT) 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 S1751679AbeDDIxz (ORCPT + 99 others); Wed, 4 Apr 2018 04:53:55 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:41983 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751465AbeDDIxG (ORCPT ); Wed, 4 Apr 2018 04:53:06 -0400 Received: from 79.184.255.92.ipv4.supernova.orange.pl (79.184.255.92) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id 2759a011ef80964f; Wed, 4 Apr 2018 10:53:04 +0200 From: "Rafael J. Wysocki" To: Linux PM Cc: Peter Zijlstra , Frederic Weisbecker , Thomas Gleixner , Paul McKenney , Thomas Ilsche , Doug Smythies , Rik van Riel , Aubrey Li , Mike Galbraith , LKML , Len Brown Subject: [PATCH v9 04/10] jiffies: Introduce USER_TICK_USEC and redefine TICK_USEC Date: Wed, 04 Apr 2018 10:38:34 +0200 Message-ID: <7620417.mBP1cQHt5D@aspire.rjw.lan> In-Reply-To: <1736751.LdhZHb50jq@aspire.rjw.lan> References: <1736751.LdhZHb50jq@aspire.rjw.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Since the subsequent changes will need a TICK_USEC definition analogous to TICK_NSEC, rename the existing TICK_USEC as USER_TICK_USEC, update its users and redefine TICK_USEC accordingly. Suggested-by: Peter Zijlstra Signed-off-by: Rafael J. Wysocki --- v8 -> v9: No changes. --- drivers/net/ethernet/sfc/mcdi.c | 2 +- include/linux/jiffies.h | 7 +++++-- kernel/time/ntp.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) Index: linux-pm/include/linux/jiffies.h =================================================================== --- linux-pm.orig/include/linux/jiffies.h +++ linux-pm/include/linux/jiffies.h @@ -62,8 +62,11 @@ extern int register_refined_jiffies(long /* TICK_NSEC is the time between ticks in nsec assuming SHIFTED_HZ */ #define TICK_NSEC ((NSEC_PER_SEC+HZ/2)/HZ) -/* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */ -#define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) +/* TICK_USEC is the time between ticks in usec assuming SHIFTED_HZ */ +#define TICK_USEC ((USEC_PER_SEC + HZ/2) / HZ) + +/* USER_TICK_USEC is the time between ticks in usec assuming fake USER_HZ */ +#define USER_TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) #ifndef __jiffy_arch_data #define __jiffy_arch_data Index: linux-pm/drivers/net/ethernet/sfc/mcdi.c =================================================================== --- linux-pm.orig/drivers/net/ethernet/sfc/mcdi.c +++ linux-pm/drivers/net/ethernet/sfc/mcdi.c @@ -375,7 +375,7 @@ static int efx_mcdi_poll(struct efx_nic * because generally mcdi responses are fast. After that, back off * and poll once a jiffy (approximately) */ - spins = TICK_USEC; + spins = USER_TICK_USEC; finish = jiffies + MCDI_RPC_TIMEOUT; while (1) { Index: linux-pm/kernel/time/ntp.c =================================================================== --- linux-pm.orig/kernel/time/ntp.c +++ linux-pm/kernel/time/ntp.c @@ -31,7 +31,7 @@ /* USER_HZ period (usecs): */ -unsigned long tick_usec = TICK_USEC; +unsigned long tick_usec = USER_TICK_USEC; /* SHIFTED_HZ period (nsecs): */ unsigned long tick_nsec;