All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] pci/uio: enable prefetchable resources mapping
From: Ferruh Yigit @ 2017-10-05  0:06 UTC (permalink / raw)
  To: Changpeng Liu, dev
In-Reply-To: <1496530644-8393-1-git-send-email-changpeng.liu@intel.com>

On 6/3/2017 11:57 PM, Changpeng Liu wrote:
> For PCI prefetchable resources, Linux will create a
> write combined file as well, the library will try
> to map resourceX_wc file first, if the file does
> not exist, then it will map resourceX as usual.

Hi Changpeng,

Code part looks OK, but can you please describe more why we should try
write combined resource file first, what is the benefit of using it _wc
file?

Thanks,
ferruh


> 
> Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
> ---
>  lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 19 ++++++++++++++-----
>  1 file changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
> index fa10329..d9fc20a 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
> @@ -321,7 +321,7 @@
>  
>  	/* update devname for mmap  */
>  	snprintf(devname, sizeof(devname),
> -			"%s/" PCI_PRI_FMT "/resource%d",
> +			"%s/" PCI_PRI_FMT "/resource%d_wc",
>  			pci_get_sysfs_path(),
>  			loc->domain, loc->bus, loc->devid,
>  			loc->function, res_idx);
> @@ -335,13 +335,22 @@
>  	}
>  
>  	/*
> -	 * open resource file, to mmap it
> +	 * open prefetchable resource file first, try to mmap it
>  	 */
>  	fd = open(devname, O_RDWR);
>  	if (fd < 0) {
> -		RTE_LOG(ERR, EAL, "Cannot open %s: %s\n",
> -				devname, strerror(errno));
> -		goto error;
> +		snprintf(devname, sizeof(devname),
> +				"%s/" PCI_PRI_FMT "/resource%d",
> +				pci_get_sysfs_path(),
> +				loc->domain, loc->bus, loc->devid,
> +				loc->function, res_idx);
> +		/* then try to map resource file */
> +		fd = open(devname, O_RDWR);
> +		if (fd < 0) {
> +			RTE_LOG(ERR, EAL, "Cannot open %s: %s\n",
> +					devname, strerror(errno));
> +			goto error;
> +		}
>  	}
>  
>  	/* try mapping somewhere close to the end of hugepages */
> 

^ permalink raw reply

* Re: mailing list archive
From: Ruben Roy @ 2017-10-05  0:08 UTC (permalink / raw)
  To: Jerry Snitselaar, linux-integrity
In-Reply-To: <20171004235645.hp3ndqmdla6szumo@rhwork>

https://www.spinics.net/lists/linux-integrity/

On 5 October 2017 05:26:45 GMT+05:30, Jerry Snitselaar <jsnitsel@redhat.com> wrote:
>Is there an archive set up for the list? I've
>been catching up on email and just found out
>about the move.

^ permalink raw reply

* Re: [kernel-hardening] [RFC V2 0/6] add more kernel pointer filter options
From: Linus Torvalds @ 2017-10-05  0:09 UTC (permalink / raw)
  To: Roberts, William C, Tejun Heo, Bjorn Helgaas
  Cc: Jordan Glover, Tobin C. Harding, Greg KH, Petr Mladek,
	Joe Perches, Ian Campbell, Sergey Senozhatsky,
	kernel-hardening@lists.openwall.com, Catalin Marinas, Will Deacon,
	Steven Rostedt, Chris Fries, Dave Weinstein
In-Reply-To: <CA+55aFwEZCT6=BCdmaNn5LGeU8g-2qi4OnM9MTOep3NOZVXjMg@mail.gmail.com>

On Wed, Oct 4, 2017 at 4:52 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> It also shows
>
>     software IO TLB [mem PA-PB] (64MB) mapped at [VA-VB]
>
> for example.  And THIS IS IMPORTANT! The physical address is shown
> with "%#010llx".

Oh, and I added Tejun for the percpu printout, but didn't add Bjorn
for this one.

Like the percpu one, I suspect that this pr_info() isn't really
important enough to stay, and while it doesn't sound nearly as
interesting as the percpu virtual address to an attacker, it probably
isn't important enough to leak kernel (and hardware) data for.

Bjorn?

I suspect we could try to make people aware of these kinds of things.
The nice zero-day robots etc probably aren't wondeful for this (since
they'll have fairly limited hardware), but maybe we could have a
script that makes it easy to just say

 "does dmesg seem to contain interesting numbers that really shouldn't
be leaked?"

That "egrep 'ffff[0-9a-f]{12}" is certainly not very good - not only
is it 64-bit specific, but it triggers, for example, on a "mask:
0xffffffffffffffff" from the clocksource code. But Something
*slightly* smarter could be something we could probably encourage
people to run occasionally.

... and if nothing else, maybe it makes developers more aware of the
"I shouldn't be leaking kernel data in dmesg" issue in general.

More so than just special-casing %p handling in odd ways and ignoring
all the other ways we can leak.

For example: x86 removed the raw stack dump last year (commit
0ee1dd9f5e7e: "x86/dumpstack: Remove raw stack dump"), because we
decided that triggering a BUG_ON() obviously does need to expose some
kernel data, but the stack wasn't worth it (and definitely tends to
contain nasty information). ARM has not (see "dump_mem()". Again,
that's not using %p. It uses to use %lx.

So is %p really the problem?

               Linus

^ permalink raw reply

* Re: [PATCH v4 00/14] Introduce support for Dell SMBIOS over WMI
From: Darren Hart @ 2017-10-05  0:09 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Andy Shevchenko, LKML, platform-driver-x86, Andy Lutomirski,
	quasisec, pali.rohar, rjw, mjg59, hch, Greg KH
In-Reply-To: <cover.1507156392.git.mario.limonciello@dell.com>

On Wed, Oct 04, 2017 at 05:48:26PM -0500, Mario Limonciello wrote:
> 
> NOTE: This patch is intended to go on top of the 6 patches already in
> Darren's review tree.

I pushed these to for-next today, they should be available in linux-next
shortly.

-- 
Darren Hart
VMware Open Source Technology Center

^ permalink raw reply

* Re: [PATCH] ACPI / LPIT: Add Low Power Idle Table (LPIT) support
From: Rafael J. Wysocki @ 2017-10-05  0:10 UTC (permalink / raw)
  To: Srinivas Pandruvada
  Cc: Rafael J. Wysocki, Lv, Len Brown, ACPI Devel Maling List,
	Linux Kernel Mailing List
In-Reply-To: <1507160613-56852-1-git-send-email-srinivas.pandruvada@linux.intel.com>

On Thu, Oct 5, 2017 at 1:43 AM, Srinivas Pandruvada
<srinivas.pandruvada@linux.intel.com> wrote:
> Added functionality to read LPIT table, which provides:
>
> - Sysfs interface to read residency counters via
> /sys/devices/system/cpu/cpuidle/low_power_idle_cpu_residency_us
> /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us
>
> Here the count "low_power_idle_cpu_residency_us" shows the time spent
> by CPU package in low power state. This is read via MSR interface, which
> points to MSR for PKG C10.
>
> Here the count "low_power_idle_system_residency_us" show the count the
> system was in low power state. This is read via MMIO interface. This
> is mapped to SLP_S0 residency on modern Intel systems. This residency
> is achieved only when CPU is in PKG C10 and all functional blocks are
> in low power state.
>
> It is possible that none of the above counters present or anyone of the
> counter present or all counters present.
>
> For example: On my Kabylake system both of the above counters present.
> After suspend to idle these counts updated and prints:
> 6916179
> 6998564
>
> This counter can be read by tools like turbostat to display. Or it can
> be used to debug, if modern systems are reaching desired low power state.
>
> - Provides an interface to read residency counter memory address
> This address can be used to get the base address of PMC memory mapped IO.
> This is utilized by intel_pmc_core driver to print more debug information.
>
> Link: http://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
>  Documentation/acpi/lpit.txt |  26 ++++++++
>  drivers/acpi/Kconfig        |   5 ++
>  drivers/acpi/Makefile       |   1 +
>  drivers/acpi/acpi_lpit.c    | 157 ++++++++++++++++++++++++++++++++++++++++++++
>  drivers/acpi/scan.c         |   3 +
>  include/acpi/acpi_lpit.h    |  34 ++++++++++
>  6 files changed, 226 insertions(+)
>  create mode 100644 Documentation/acpi/lpit.txt
>  create mode 100644 drivers/acpi/acpi_lpit.c
>  create mode 100644 include/acpi/acpi_lpit.h
>
> diff --git a/Documentation/acpi/lpit.txt b/Documentation/acpi/lpit.txt
> new file mode 100644
> index 0000000..6be68c0
> --- /dev/null
> +++ b/Documentation/acpi/lpit.txt
> @@ -0,0 +1,26 @@
> +To enumerate platform Low Power Idle states, Intel platforms are using
> +“Low Power Idle Table” (LPIT). More details about this table can be
> +downloaded from:
> +http://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf
> +
> +Residencies for each low power state can be read via FFH
> +(Function fixed hardware) or a memory mapped interface.
> +
> +On platforms supporting S0ix sleep states, there can be two types of
> +residencies:
> +- CPU PKG C10 (Read via FFH interface)
> +- Platform Controller Hub (PCH) SLP_S0 (Read via memory mapped interface)
> +
> +The following attributes are added dynamically to the cpuidle
> +sysfs attribute group:
> +       /sys/devices/system/cpu/cpuidle/low_power_idle_cpu_residency_us
> +       /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us
> +
> +The "low_power_idle_cpu_residency_us" attribute shows time spent
> +by the CPU package in PKG C10
> +
> +The "low_power_idle_system_residency_us" attribute shows SLP_S0
> +residency, or system time spent with the SLP_S0# signal asserted.
> +This is the lowest possible system power state, achieved only when CPU is in
> +PKG C10 and all functional blocks in PCH are in a low power state.
> +
> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> index 1ce52f8..4bfef0f 100644
> --- a/drivers/acpi/Kconfig
> +++ b/drivers/acpi/Kconfig
> @@ -80,6 +80,11 @@ endif
>  config ACPI_SPCR_TABLE
>         bool
>
> +config ACPI_LPIT
> +       bool
> +       depends on X86_64
> +       default y
> +
>  config ACPI_SLEEP
>         bool
>         depends on SUSPEND || HIBERNATION
> diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
> index 90265ab..6a19bd7 100644
> --- a/drivers/acpi/Makefile
> +++ b/drivers/acpi/Makefile
> @@ -56,6 +56,7 @@ acpi-$(CONFIG_DEBUG_FS)               += debugfs.o
>  acpi-$(CONFIG_ACPI_NUMA)       += numa.o
>  acpi-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o
>  acpi-y                         += acpi_lpat.o
> +acpi-$(CONFIG_ACPI_LPIT)       += acpi_lpit.o
>  acpi-$(CONFIG_ACPI_GENERIC_GSI) += irq.o
>  acpi-$(CONFIG_ACPI_WATCHDOG)   += acpi_watchdog.o
>
> diff --git a/drivers/acpi/acpi_lpit.c b/drivers/acpi/acpi_lpit.c
> new file mode 100644
> index 0000000..38d760d
> --- /dev/null
> +++ b/drivers/acpi/acpi_lpit.c
> @@ -0,0 +1,157 @@
> +
> +/*
> + * acpi_lpit.c - LPIT table processing functions
> + *
> + * Copyright (C) 2017 Intel Corporation. All rights reserved.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License version
> + * 2 as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <linux/cpu.h>
> +#include <linux/acpi.h>
> +#include <asm/msr.h>
> +#include <asm/tsc.h>
> +
> +struct lpit_residency_info {
> +       struct acpi_generic_address gaddr;
> +       u64 frequency;
> +       void __iomem *iomem_addr;
> +};
> +
> +/* Storage for an memory mapped and FFH based entries */
> +static struct lpit_residency_info residency_info_mem;
> +static struct lpit_residency_info residency_info_ffh;
> +
> +static int lpit_read_residency_counter_us(u64 *counter, bool io_mem)
> +{
> +       int err;
> +
> +       if (io_mem) {
> +               u32 count;
> +
> +               count = readl(residency_info_mem.iomem_addr);
> +               *counter = div64_u64(count * 1000000ULL, residency_info_mem.frequency);
> +               return 0;
> +       }
> +
> +       err = rdmsrl_safe(residency_info_ffh.gaddr.address, counter);
> +       if (!err) {
> +               u64 mask = GENMASK_ULL(residency_info_ffh.gaddr.bit_offset +
> +                                      residency_info_ffh.gaddr. bit_width - 1,
> +                                      residency_info_ffh.gaddr.bit_offset);
> +
> +               *counter &= mask;
> +               *counter >>= residency_info_ffh.gaddr.bit_offset;
> +               *counter = div64_u64(*counter * 1000000ULL, residency_info_ffh.frequency);
> +               return 0;
> +       }
> +
> +       return -ENODATA;
> +}
> +
> +static ssize_t low_power_idle_system_residency_us_show(struct device *dev,
> +                                                      struct device_attribute *attr,
> +                                                      char *buf)
> +{
> +       u64 counter;
> +       int ret;
> +
> +       ret = lpit_read_residency_counter_us(&counter, true);
> +       if (ret)
> +               return ret;
> +
> +       return sprintf(buf, "%llu\n", counter);
> +}
> +static DEVICE_ATTR_RO(low_power_idle_system_residency_us);
> +
> +static ssize_t low_power_idle_cpu_residency_us_show(struct device *dev,
> +                                                   struct device_attribute *attr,
> +                                                   char *buf)
> +{
> +       u64 counter;
> +       int ret;
> +
> +       ret = lpit_read_residency_counter_us(&counter, false);
> +       if (ret)
> +               return ret;
> +
> +       return sprintf(buf, "%llu\n", counter);
> +}
> +static DEVICE_ATTR_RO(low_power_idle_cpu_residency_us);
> +
> +int lpit_read_residency_count_address(u64 *address)
> +{
> +       if (!residency_info_mem.gaddr.address)
> +               return -EINVAL;
> +
> +       *address = residency_info_mem.gaddr.address;
> +
> +       return 0;
> +}

I don't see users of this.  Are there any?

> +
> +static void lpit_update_residency(struct lpit_residency_info *info,
> +                                struct acpi_lpit_native *lpit_native)
> +{
> +       info->frequency = lpit_native->counter_frequency ?
> +                               lpit_native->counter_frequency : tsc_khz * 1000;
> +       if (!info->frequency)
> +               info->frequency = 1;
> +
> +       info->gaddr = lpit_native->residency_counter;
> +       if (info->gaddr.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
> +               info->iomem_addr = ioremap_nocache(info->gaddr.address,
> +                                                  info->gaddr.bit_width / 8);
> +               if (!info->iomem_addr)
> +                       return;
> +
> +               /* Silently fail, if cpuidle attribute group is not present */
> +               sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj,
> +                                       &dev_attr_low_power_idle_system_residency_us.attr,
> +                                       "cpuidle");
> +       } else if (info->gaddr.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) {
> +               /* Silently fail, if cpuidle attribute group is not present */
> +               sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj,
> +                                       &dev_attr_low_power_idle_cpu_residency_us.attr,
> +                                       "cpuidle");
> +       }
> +}
> +
> +static void lpit_process(u64 begin, u64 end)
> +{
> +       while (begin + sizeof(struct acpi_lpit_native) < end) {
> +               struct acpi_lpit_native *lpit_native = (struct acpi_lpit_native *)begin;
> +
> +               if (!lpit_native->header.type && !lpit_native->header.flags) {
> +                       if (lpit_native->residency_counter.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY &&
> +                           !residency_info_mem.gaddr.address) {
> +                               lpit_update_residency(&residency_info_mem, lpit_native);
> +                       } else if (lpit_native->residency_counter.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE &&
> +                                  !residency_info_ffh.gaddr.address) {
> +                               lpit_update_residency(&residency_info_ffh, lpit_native);
> +                       }
> +               }
> +               begin += lpit_native->header.length;
> +       }
> +}
> +
> +void acpi_init_lpit(void)
> +{
> +       acpi_status status;
> +       u64 lpit_begin;
> +       struct acpi_table_lpit *lpit;
> +
> +       status = acpi_get_table(ACPI_SIG_LPIT, 0, (struct acpi_table_header **)&lpit);
> +
> +       if (ACPI_FAILURE(status))
> +               return;
> +
> +       lpit_begin = (u64)lpit + sizeof(*lpit);
> +       lpit_process(lpit_begin, lpit_begin + lpit->header.length);
> +}
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index 602f8ff..3f05d43 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -15,6 +15,8 @@
>  #include <linux/dma-mapping.h>
>  #include <linux/platform_data/x86/apple.h>
>
> +#include <acpi/acpi_lpit.h>
> +
>  #include <asm/pgtable.h>
>
>  #include "internal.h"
> @@ -2122,6 +2124,7 @@ int __init acpi_scan_init(void)
>         acpi_int340x_thermal_init();
>         acpi_amba_init();
>         acpi_watchdog_init();
> +       acpi_init_lpit();
>
>         acpi_scan_add_handler(&generic_device_handler);
>
> diff --git a/include/acpi/acpi_lpit.h b/include/acpi/acpi_lpit.h
> new file mode 100644
> index 0000000..5d5285a
> --- /dev/null
> +++ b/include/acpi/acpi_lpit.h
> @@ -0,0 +1,34 @@
> +/*
> + * acpi_lpit.h - LPIT table processing functions interface
> + *
> + * Copyright (C) 2017 Intel Corporation. All rights reserved.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License version
> + * 2 as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#ifndef ACPI_LPIT_H
> +#define ACPI_LPIT_H
> +
> +#ifdef CONFIG_ACPI_LPIT
> +
> +void acpi_init_lpit(void);
> +int lpit_read_residency_count_address(u64 *address);
> +
> +#else
> +
> +static inline void acpi_init_lpit(void) { }
> +
> +static inline int lpit_read_residency_count_address(u64 *address)
> +{
> +       return -EINVAL;
> +}
> +
> +#endif
> +#endif

The above can go into internal.h or sleep.h in drivers/acpi/ IMO.
There's not need to export it.

Thanks,
Rafael

^ permalink raw reply

* Re: [PATCH] Update James Hogan's email address
From: Linus Torvalds @ 2017-10-05  0:12 UTC (permalink / raw)
  To: James Hogan; +Cc: Linux Kernel Mailing List, James Hogan
In-Reply-To: <20171004221059.17279-1-james.hogan@imgtec.com>

On Wed, Oct 4, 2017 at 3:10 PM, James Hogan <james.hogan@imgtec.com> wrote:
>
> Linus: Are you happy to apply this patch directly?

Done.

                Linus

^ permalink raw reply

* Re: [PATCH 09/13] timer: Remove users of expire and data arguments to DEFINE_TIMER
From: Guenter Roeck @ 2017-10-05  0:12 UTC (permalink / raw)
  To: Kees Cook, Thomas Gleixner
  Cc: Ralf Baechle, Wim Van Sebroeck, Geert Uytterhoeven, linux-mips,
	linux-watchdog, Andrew Morton, Arnd Bergmann,
	Benjamin Herrenschmidt, Chris Metcalf, Greg Kroah-Hartman,
	Harish Patil, Heiko Carstens, James E.J. Bottomley, John Stultz,
	Julian Wiedmann, Kalle Valo, Lai Jiangshan, Len Brown,
	Manish Chopra
In-Reply-To: <1507159627-127660-10-git-send-email-keescook@chromium.org>

On 10/04/2017 04:27 PM, Kees Cook wrote:
> The expire and data arguments of DEFINE_TIMER are only used in two places
> and are ignored by the code (malta-display.c only uses mod_timer(),
> never add_timer(), so the preset expires value is ignored). Set both
> sets of arguments to zero.
> 
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Wim Van Sebroeck <wim@iguana.be>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: linux-mips@linux-mips.org
> Cc: linux-watchdog@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>

For watchdog:

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   arch/mips/mti-malta/malta-display.c | 6 +++---
>   drivers/watchdog/alim7101_wdt.c     | 4 ++--
>   2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/mips/mti-malta/malta-display.c b/arch/mips/mti-malta/malta-display.c
> index d4f807191ecd..ac813158b9b8 100644
> --- a/arch/mips/mti-malta/malta-display.c
> +++ b/arch/mips/mti-malta/malta-display.c
> @@ -36,10 +36,10 @@ void mips_display_message(const char *str)
>   	}
>   }
>   
> -static void scroll_display_message(unsigned long data);
> -static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, HZ, 0);
> +static void scroll_display_message(unsigned long unused);
> +static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, 0, 0);
>   
> -static void scroll_display_message(unsigned long data)
> +static void scroll_display_message(unsigned long unused)
>   {
>   	mips_display_message(&display_string[display_count++]);
>   	if (display_count == max_display_count)
> diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c
> index 665e0e7dfe1e..3c1f6ac68ea9 100644
> --- a/drivers/watchdog/alim7101_wdt.c
> +++ b/drivers/watchdog/alim7101_wdt.c
> @@ -71,7 +71,7 @@ MODULE_PARM_DESC(use_gpio,
>   		"Use the gpio watchdog (required by old cobalt boards).");
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 1);
> +static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> @@ -87,7 +87,7 @@ MODULE_PARM_DESC(nowayout,
>    *	Whack the dog
>    */
>   
> -static void wdt_timer_ping(unsigned long data)
> +static void wdt_timer_ping(unsigned long unused)
>   {
>   	/* If we got a heartbeat pulse within the WDT_US_INTERVAL
>   	 * we agree to ping the WDT
> 

^ permalink raw reply

* Re: [PATCH 09/13] timer: Remove users of expire and data arguments to DEFINE_TIMER
From: Guenter Roeck @ 2017-10-05  0:12 UTC (permalink / raw)
  To: Kees Cook, Thomas Gleixner
  Cc: Ralf Baechle, Wim Van Sebroeck, Geert Uytterhoeven, linux-mips,
	linux-watchdog, Andrew Morton, Arnd Bergmann,
	Benjamin Herrenschmidt, Chris Metcalf, Greg Kroah-Hartman,
	Harish Patil, Heiko Carstens, James E.J. Bottomley, John Stultz,
	Julian Wiedmann, Kalle Valo, Lai Jiangshan, Len Brown,
	Manish Chopra, M
In-Reply-To: <1507159627-127660-10-git-send-email-keescook@chromium.org>

On 10/04/2017 04:27 PM, Kees Cook wrote:
> The expire and data arguments of DEFINE_TIMER are only used in two places
> and are ignored by the code (malta-display.c only uses mod_timer(),
> never add_timer(), so the preset expires value is ignored). Set both
> sets of arguments to zero.
> 
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Wim Van Sebroeck <wim@iguana.be>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: linux-mips@linux-mips.org
> Cc: linux-watchdog@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>

For watchdog:

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   arch/mips/mti-malta/malta-display.c | 6 +++---
>   drivers/watchdog/alim7101_wdt.c     | 4 ++--
>   2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/mips/mti-malta/malta-display.c b/arch/mips/mti-malta/malta-display.c
> index d4f807191ecd..ac813158b9b8 100644
> --- a/arch/mips/mti-malta/malta-display.c
> +++ b/arch/mips/mti-malta/malta-display.c
> @@ -36,10 +36,10 @@ void mips_display_message(const char *str)
>   	}
>   }
>   
> -static void scroll_display_message(unsigned long data);
> -static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, HZ, 0);
> +static void scroll_display_message(unsigned long unused);
> +static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, 0, 0);
>   
> -static void scroll_display_message(unsigned long data)
> +static void scroll_display_message(unsigned long unused)
>   {
>   	mips_display_message(&display_string[display_count++]);
>   	if (display_count == max_display_count)
> diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c
> index 665e0e7dfe1e..3c1f6ac68ea9 100644
> --- a/drivers/watchdog/alim7101_wdt.c
> +++ b/drivers/watchdog/alim7101_wdt.c
> @@ -71,7 +71,7 @@ MODULE_PARM_DESC(use_gpio,
>   		"Use the gpio watchdog (required by old cobalt boards).");
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 1);
> +static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> @@ -87,7 +87,7 @@ MODULE_PARM_DESC(nowayout,
>    *	Whack the dog
>    */
>   
> -static void wdt_timer_ping(unsigned long data)
> +static void wdt_timer_ping(unsigned long unused)
>   {
>   	/* If we got a heartbeat pulse within the WDT_US_INTERVAL
>   	 * we agree to ping the WDT
> 

^ permalink raw reply

* Re: [PATCH 09/13] timer: Remove users of expire and data arguments to DEFINE_TIMER
From: Guenter Roeck @ 2017-10-05  0:12 UTC (permalink / raw)
  To: Kees Cook, Thomas Gleixner
  Cc: Ralf Baechle, Wim Van Sebroeck, Geert Uytterhoeven, linux-mips,
	linux-watchdog, Andrew Morton, Arnd Bergmann,
	Benjamin Herrenschmidt, Chris Metcalf, Greg Kroah-Hartman,
	Harish Patil, Heiko Carstens, James E.J. Bottomley, John Stultz,
	Julian Wiedmann, Kalle Valo, Lai Jiangshan, Len Brown,
	Manish Chopra, Mark Gross, Martin K. Petersen, Martin Schwidefsky,
	Michael Ellerman, Michael Reed, netdev, Oleg Nesterov,
	Paul Mackerras, Pavel Machek, Petr Mladek, Rafael J. Wysocki,
	Sebastian Reichel, Stefan Richter, Stephen Boyd, Sudip Mukherjee,
	Tejun Heo, Ursula Braun, Viresh Kumar, linux1394-devel, linux-pm,
	linuxppc-dev, linux-s390, linux-scsi, linux-wireless,
	linux-kernel
In-Reply-To: <1507159627-127660-10-git-send-email-keescook@chromium.org>

On 10/04/2017 04:27 PM, Kees Cook wrote:
> The expire and data arguments of DEFINE_TIMER are only used in two places
> and are ignored by the code (malta-display.c only uses mod_timer(),
> never add_timer(), so the preset expires value is ignored). Set both
> sets of arguments to zero.
> 
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Wim Van Sebroeck <wim@iguana.be>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: linux-mips@linux-mips.org
> Cc: linux-watchdog@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>

For watchdog:

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   arch/mips/mti-malta/malta-display.c | 6 +++---
>   drivers/watchdog/alim7101_wdt.c     | 4 ++--
>   2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/mips/mti-malta/malta-display.c b/arch/mips/mti-malta/malta-display.c
> index d4f807191ecd..ac813158b9b8 100644
> --- a/arch/mips/mti-malta/malta-display.c
> +++ b/arch/mips/mti-malta/malta-display.c
> @@ -36,10 +36,10 @@ void mips_display_message(const char *str)
>   	}
>   }
>   
> -static void scroll_display_message(unsigned long data);
> -static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, HZ, 0);
> +static void scroll_display_message(unsigned long unused);
> +static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, 0, 0);
>   
> -static void scroll_display_message(unsigned long data)
> +static void scroll_display_message(unsigned long unused)
>   {
>   	mips_display_message(&display_string[display_count++]);
>   	if (display_count == max_display_count)
> diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c
> index 665e0e7dfe1e..3c1f6ac68ea9 100644
> --- a/drivers/watchdog/alim7101_wdt.c
> +++ b/drivers/watchdog/alim7101_wdt.c
> @@ -71,7 +71,7 @@ MODULE_PARM_DESC(use_gpio,
>   		"Use the gpio watchdog (required by old cobalt boards).");
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 1);
> +static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> @@ -87,7 +87,7 @@ MODULE_PARM_DESC(nowayout,
>    *	Whack the dog
>    */
>   
> -static void wdt_timer_ping(unsigned long data)
> +static void wdt_timer_ping(unsigned long unused)
>   {
>   	/* If we got a heartbeat pulse within the WDT_US_INTERVAL
>   	 * we agree to ping the WDT
> 

^ permalink raw reply

* [U-Boot] [PATCH v1 08/12] efi_loader: console support for color attributes
From: Rob Clark @ 2017-10-05  0:12 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <CAF6AEGszcdU8+5S=uxtt7JUOrBeaU6hTznHoMkz66fJE+HORrA@mail.gmail.com>

On Wed, Oct 4, 2017 at 8:00 PM, Rob Clark <robdclark@gmail.com> wrote:
> On Wed, Oct 4, 2017 at 7:53 PM, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>> On 10/05/2017 01:19 AM, Rob Clark wrote:
>>> On Wed, Oct 4, 2017 at 6:01 PM, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>>>> On 10/04/2017 10:54 PM, Rob Clark wrote:
>>>>> On Wed, Oct 4, 2017 at 2:53 PM, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>>>>>> On 09/10/2017 03:22 PM, Rob Clark wrote:
>>>>>>> Shell.efi uses this, and supporting color attributes makes things look
>>>>>>> nicer.  Map the EFI fg/bg color attributes to ANSI escape sequences.
>>>>>>> Not all colors have a perfect match, but spec just says "Devices
>>>>>>> supporting a different number of text colors are required to emulate the
>>>>>>> above colors to the best of the device’s capabilities".
>>>>>>>
>>>>>>> Signed-off-by: Rob Clark <robdclark@gmail.com>
>>>>>>> ---
>>>>>>>  include/efi_api.h            | 29 +++++++++++++++++++++++++++++
>>>>>>>  lib/efi_loader/efi_console.c | 30 ++++++++++++++++++++++++++++++
>>>>>>>  2 files changed, 59 insertions(+)
>>>>>>>
>>>>>>> diff --git a/include/efi_api.h b/include/efi_api.h
>>>>>>> index 87c8ffe68e..3cc1dbac2e 100644
>>>>>>> --- a/include/efi_api.h
>>>>>>> +++ b/include/efi_api.h
>>>>>>> @@ -426,6 +426,35 @@ struct simple_text_output_mode {
>>>>>>>       EFI_GUID(0x387477c2, 0x69c7, 0x11d2, \
>>>>>>>                0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
>>>>>>>
>>>>>>> +#define EFI_BLACK                0x00
>>>>>>> +#define EFI_BLUE                 0x01
>>>>>>> +#define EFI_GREEN                0x02
>>>>>>> +#define EFI_CYAN                 0x03
>>>>>>> +#define EFI_RED                  0x04
>>>>>>> +#define EFI_MAGENTA              0x05
>>>>>>> +#define EFI_BROWN                0x06
>>>>>>> +#define EFI_LIGHTGRAY            0x07
>>>>>>> +#define EFI_BRIGHT               0x08
>>>>>>> +#define EFI_DARKGRAY             0x08
>>>>>>> +#define EFI_LIGHTBLUE            0x09
>>>>>>> +#define EFI_LIGHTGREEN           0x0a
>>>>>>> +#define EFI_LIGHTCYAN            0x0b
>>>>>>> +#define EFI_LIGHTRED             0x0c
>>>>>>> +#define EFI_LIGHTMAGENTA         0x0d
>>>>>>> +#define EFI_YELLOW               0x0e
>>>>>>> +#define EFI_WHITE                0x0f
>>>>>>> +#define EFI_BACKGROUND_BLACK     0x00
>>>>>>> +#define EFI_BACKGROUND_BLUE      0x10
>>>>>>> +#define EFI_BACKGROUND_GREEN     0x20
>>>>>>> +#define EFI_BACKGROUND_CYAN      0x30
>>>>>>> +#define EFI_BACKGROUND_RED       0x40
>>>>>>> +#define EFI_BACKGROUND_MAGENTA   0x50
>>>>>>> +#define EFI_BACKGROUND_BROWN     0x60
>>>>>>> +#define EFI_BACKGROUND_LIGHTGRAY 0x70
>>>>>>
>>>>>> Will we ever use these constants?
>>>>>>
>>>>>
>>>>> possibly not, but it is useful to understand what is going on with
>>>>> efi->ansi mapping, so I would prefer to keep them.
>>>>>
>>>>>>
>>>>>> Where are the comments explaining the defines below?
>>>>>>
>>>>>>> +
>>>>>>> +#define EFI_ATTR_FG(attr)        ((attr) & 0x0f)
>>>>>>
>>>>>> This saves 8 entries in the table below.
>>>>>> +#define EFI_ATTR_FG(attr)        ((attr) & 0x07)
>>>>>>
>>>>>>> +#define EFI_ATTR_BG(attr)        (((attr) >> 4) & 0x7)
>>>>>>
>>>>>> Add
>>>>>> #define EFI_ATTR_BOLD(attr) (((attr) >> 3) & 0x01)
>>>>>>
>>>>>>> +
>>>>>>>  struct efi_simple_text_output_protocol {
>>>>>>>       void *reset;
>>>>>>>       efi_status_t (EFIAPI *output_string)(
>>>>>>> diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
>>>>>>> index 2e13fdc096..fcd65ca488 100644
>>>>>>> --- a/lib/efi_loader/efi_console.c
>>>>>>> +++ b/lib/efi_loader/efi_console.c
>>>>>>> @@ -316,12 +316,42 @@ static efi_status_t EFIAPI efi_cout_set_mode(
>>>>>>>       return EFI_EXIT(EFI_SUCCESS);
>>>>>>>  }
>>>>>>>
>>>>>>> +static const struct {
>>>>>>> +     unsigned fg;
>>>>>>> +     unsigned bg;
>>>>>>> +} color[] = {
>>>>>>> +     { 30, 40 },     /* 0: black */
>>>>>>> +     { 34, 44 },     /* 1: blue */
>>>>>>> +     { 32, 42 },     /* 2: green */
>>>>>>> +     { 36, 46 },     /* 3: cyan */
>>>>>>> +     { 31, 41 },     /* 4: red */
>>>>>>> +     { 35, 45 },     /* 5: magenta */
>>>>>>> +     { 30, 40 },     /* 6: brown, map to black */
>>>>>>
>>>>>> This should be { 33, 43 }
>>>>>>
>>>>>>> +     { 37, 47 },     /* 7: light grey, map to white */
>>>>>>
>>>>>> The entries below are redundant.
>>>>>>
>>>>>>> +     { 37, 47 },     /* 8: bright, map to white */
>>>>>>> +     { 34, 44 },     /* 9: light blue, map to blue */
>>>>>>> +     { 32, 42 },     /* A: light green, map to green */
>>>>>>> +     { 36, 46 },     /* B: light cyan, map to cyan */
>>>>>>> +     { 31, 41 },     /* C: light red, map to red */
>>>>>>> +     { 35, 45 },     /* D: light magenta, map to magenta */
>>>>>>> +     { 33, 43 },     /* E: yellow */
>>>>>>> +     { 37, 47 },     /* F: white */
>>>>>>> +};
>>>>>>> +
>>>>>
>>>>> I'm not totally convinced about mapping extra colors that UEFI defines
>>>>> to bold.. unless you have some example of prior-art for this on other
>>>>> platforms.
>>>>
>>>> See
>>>> Standard ECMA-48 - Control Functions for Coded Character Sets
>>>> chapter 8.3.117 SGR - SELECT GRAPHIC RENDITION
>>>>
>>>> 1 - bold or increased intensity
>>>> 22 - normal colour or normal intensity (neither bold nor faint)
>>>>
>>>> You can easily experiment in your bash shell like this:
>>>>
>>>> printf "\x1b[1;32;40m bold \x1b[22;32;40m normal\x1b[22;39;49m\n";
>>>>
>>>> You will find that "bold" prints bold and bright in the KDE konsole and
>>>> xterm.
>>>
>>> but I think we don't want (potential) font changes, just color changes..
>>>
>>> if you can find the code in edk2 that does this, I guess it would be a
>>> reasonable precedent to follow.. but if not I wanted to avoid things
>>> that might be specific to particular terminal emulators, since I
>>> wasn't really looking forward to testing them all.  Otherwise I'd just
>>> rely on the extension that allowed 256 colors..
>>>
>>> BR,
>>> -R
>>
>> The same problem seems has led the EDK folks to a similar solution.
>>
>> See
>> MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
>
> ok, I'll have a closer look at that.. I don't feel badly about doing
> the same thing that edk2 does when there is doubt ;-)

hmm, the semi-annoying thing will be to have to implement the
vidconsole-uclass side of this.. I suppose I could ignore anything
other than 0 (normal) and 1 (bold).  Reverse wouldn't be too hard, but
blink would be hard I think without timer interrupts (same reason that
I didn't implement cursor yet)

> BR,
> -R
>
>
>> Everything starts with this array:
>>
>> { ESC, '[', '0', 'm', ESC, '[', '4', '0', 'm', ESC, '[', '4', '0', 'm', 0 };
>>
>> The first '0' is replaced by either 0 or 1 depending on brightness.
>>
>> mSetAttributeString[BRIGHT_CONTROL_OFFSET] =
>>   (CHAR16) ('0' + BrightControl);
>>
>> The first '4', '0' is replaced by the foreground color.
>> The second '4', '0' is replaced by the background color.
>>
>> ECMA 48 says:
>>
>> 0 - default rendition, cancels the effect of any preceding SGR
>>
>> So you can use this instead of 22.
>>
>> Best regards
>>
>> Heinrich
>>
>>
>>>
>>>> Using colors 90-97 as foreground colors produces only bright but not
>>>> bold in the KDE konsole and xterm:
>>>>
>>>> printf "\x1b[92;40m bold \x1b[32;40m normal\x1b[22;39;49m\n";
>>>>
>>>> But these codes are not defined in ECMA-48.
>>>>
>>>> Best regards
>>>>
>>>> Heinrich
>>>>
>>>
>>

^ permalink raw reply

* Re: [PATCH 10/13] timer: Remove expires and data arguments from DEFINE_TIMER
From: Guenter Roeck @ 2017-10-05  0:13 UTC (permalink / raw)
  To: Kees Cook, Thomas Gleixner
  Cc: Andrew Morton, Arnd Bergmann, Benjamin Herrenschmidt,
	Chris Metcalf, Geert Uytterhoeven, Greg Kroah-Hartman,
	Harish Patil, Heiko Carstens, James E.J. Bottomley, John Stultz,
	Julian Wiedmann, Kalle Valo, Lai Jiangshan, Len Brown,
	Manish Chopra, Mark Gross, Martin K. Petersen, Martin Schwidefsky
In-Reply-To: <1507159627-127660-11-git-send-email-keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

On 10/04/2017 04:27 PM, Kees Cook wrote:
> Drop the arguments from the macro and adjust all callers with the
> following script:
> 
>    perl -pi -e 's/DEFINE_TIMER\((.*), 0, 0\);/DEFINE_TIMER($1);/g;' \
>      $(git grep DEFINE_TIMER | cut -d: -f1 | sort -u | grep -v timer.h)
> 
> Signed-off-by: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> Acked-by: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> # for m68k parts

For watchdog:

Acked-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>

> ---
>   arch/arm/mach-ixp4xx/dsmg600-setup.c      | 2 +-
>   arch/arm/mach-ixp4xx/nas100d-setup.c      | 2 +-
>   arch/m68k/amiga/amisound.c                | 2 +-
>   arch/m68k/mac/macboing.c                  | 2 +-
>   arch/mips/mti-malta/malta-display.c       | 2 +-
>   arch/parisc/kernel/pdc_cons.c             | 2 +-
>   arch/s390/mm/cmm.c                        | 2 +-
>   drivers/atm/idt77105.c                    | 4 ++--
>   drivers/atm/iphase.c                      | 2 +-
>   drivers/block/ataflop.c                   | 8 ++++----
>   drivers/char/dtlk.c                       | 2 +-
>   drivers/char/hangcheck-timer.c            | 2 +-
>   drivers/char/nwbutton.c                   | 2 +-
>   drivers/char/rtc.c                        | 2 +-
>   drivers/input/touchscreen/s3c2410_ts.c    | 2 +-
>   drivers/net/cris/eth_v10.c                | 6 +++---
>   drivers/net/hamradio/yam.c                | 2 +-
>   drivers/net/wireless/atmel/at76c50x-usb.c | 2 +-
>   drivers/staging/speakup/main.c            | 2 +-
>   drivers/staging/speakup/synth.c           | 2 +-
>   drivers/tty/cyclades.c                    | 2 +-
>   drivers/tty/isicom.c                      | 2 +-
>   drivers/tty/moxa.c                        | 2 +-
>   drivers/tty/rocket.c                      | 2 +-
>   drivers/tty/vt/keyboard.c                 | 2 +-
>   drivers/tty/vt/vt.c                       | 2 +-
>   drivers/watchdog/alim7101_wdt.c           | 2 +-
>   drivers/watchdog/machzwd.c                | 2 +-
>   drivers/watchdog/mixcomwd.c               | 2 +-
>   drivers/watchdog/sbc60xxwdt.c             | 2 +-
>   drivers/watchdog/sc520_wdt.c              | 2 +-
>   drivers/watchdog/via_wdt.c                | 2 +-
>   drivers/watchdog/w83877f_wdt.c            | 2 +-
>   drivers/xen/grant-table.c                 | 2 +-
>   fs/pstore/platform.c                      | 2 +-
>   include/linux/timer.h                     | 4 ++--
>   kernel/irq/spurious.c                     | 2 +-
>   lib/random32.c                            | 2 +-
>   net/atm/mpc.c                             | 2 +-
>   net/decnet/dn_route.c                     | 2 +-
>   net/ipv6/ip6_flowlabel.c                  | 2 +-
>   net/netrom/nr_loopback.c                  | 2 +-
>   security/keys/gc.c                        | 2 +-
>   sound/oss/midibuf.c                       | 2 +-
>   sound/oss/soundcard.c                     | 2 +-
>   sound/oss/sys_timer.c                     | 2 +-
>   sound/oss/uart6850.c                      | 2 +-
>   47 files changed, 54 insertions(+), 54 deletions(-)
> 
> diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c
> index b3bd0e137f6d..b3689a141ec6 100644
> --- a/arch/arm/mach-ixp4xx/dsmg600-setup.c
> +++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c
> @@ -174,7 +174,7 @@ static int power_button_countdown;
>   #define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
>   
>   static void dsmg600_power_handler(unsigned long data);
> -static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler, 0, 0);
> +static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler);
>   
>   static void dsmg600_power_handler(unsigned long data)
>   {
> diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
> index 4e0f762bc651..562d05f9888e 100644
> --- a/arch/arm/mach-ixp4xx/nas100d-setup.c
> +++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
> @@ -197,7 +197,7 @@ static int power_button_countdown;
>   #define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
>   
>   static void nas100d_power_handler(unsigned long data);
> -static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler, 0, 0);
> +static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler);
>   
>   static void nas100d_power_handler(unsigned long data)
>   {
> diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c
> index 90a60d758f8b..a23f48181fd6 100644
> --- a/arch/m68k/amiga/amisound.c
> +++ b/arch/m68k/amiga/amisound.c
> @@ -66,7 +66,7 @@ void __init amiga_init_sound(void)
>   }
>   
>   static void nosound( unsigned long ignored );
> -static DEFINE_TIMER(sound_timer, nosound, 0, 0);
> +static DEFINE_TIMER(sound_timer, nosound);
>   
>   void amiga_mksound( unsigned int hz, unsigned int ticks )
>   {
> diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c
> index ffaa1f6439ae..9a52aff183d0 100644
> --- a/arch/m68k/mac/macboing.c
> +++ b/arch/m68k/mac/macboing.c
> @@ -56,7 +56,7 @@ static void ( *mac_special_bell )( unsigned int, unsigned int, unsigned int );
>   /*
>    * our timer to start/continue/stop the bell
>    */
> -static DEFINE_TIMER(mac_sound_timer, mac_nosound, 0, 0);
> +static DEFINE_TIMER(mac_sound_timer, mac_nosound);
>   
>   /*
>    * Sort of initialize the sound chip (called from mac_mksound on the first
> diff --git a/arch/mips/mti-malta/malta-display.c b/arch/mips/mti-malta/malta-display.c
> index ac813158b9b8..063de44675ce 100644
> --- a/arch/mips/mti-malta/malta-display.c
> +++ b/arch/mips/mti-malta/malta-display.c
> @@ -37,7 +37,7 @@ void mips_display_message(const char *str)
>   }
>   
>   static void scroll_display_message(unsigned long unused);
> -static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, 0, 0);
> +static DEFINE_TIMER(mips_scroll_timer, scroll_display_message);
>   
>   static void scroll_display_message(unsigned long unused)
>   {
> diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
> index 10a5ae9553fd..27a2dd616a7d 100644
> --- a/arch/parisc/kernel/pdc_cons.c
> +++ b/arch/parisc/kernel/pdc_cons.c
> @@ -92,7 +92,7 @@ static int pdc_console_setup(struct console *co, char *options)
>   #define PDC_CONS_POLL_DELAY (30 * HZ / 1000)
>   
>   static void pdc_console_poll(unsigned long unused);
> -static DEFINE_TIMER(pdc_console_timer, pdc_console_poll, 0, 0);
> +static DEFINE_TIMER(pdc_console_timer, pdc_console_poll);
>   static struct tty_port tty_port;
>   
>   static int pdc_console_tty_open(struct tty_struct *tty, struct file *filp)
> diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
> index 829c63dbc81a..2dbdcd85b68f 100644
> --- a/arch/s390/mm/cmm.c
> +++ b/arch/s390/mm/cmm.c
> @@ -56,7 +56,7 @@ static DEFINE_SPINLOCK(cmm_lock);
>   
>   static struct task_struct *cmm_thread_ptr;
>   static DECLARE_WAIT_QUEUE_HEAD(cmm_thread_wait);
> -static DEFINE_TIMER(cmm_timer, NULL, 0, 0);
> +static DEFINE_TIMER(cmm_timer, NULL);
>   
>   static void cmm_timer_fn(unsigned long);
>   static void cmm_set_timer(void);
> diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
> index 082aa02abc57..57af9fd198e4 100644
> --- a/drivers/atm/idt77105.c
> +++ b/drivers/atm/idt77105.c
> @@ -49,8 +49,8 @@ static void idt77105_stats_timer_func(unsigned long);
>   static void idt77105_restart_timer_func(unsigned long);
>   
>   
> -static DEFINE_TIMER(stats_timer, idt77105_stats_timer_func, 0, 0);
> -static DEFINE_TIMER(restart_timer, idt77105_restart_timer_func, 0, 0);
> +static DEFINE_TIMER(stats_timer, idt77105_stats_timer_func);
> +static DEFINE_TIMER(restart_timer, idt77105_restart_timer_func);
>   static int start_timer = 1;
>   static struct idt77105_priv *idt77105_all = NULL;
>   
> diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
> index fc72b763fdd7..ad6b582c268e 100644
> --- a/drivers/atm/iphase.c
> +++ b/drivers/atm/iphase.c
> @@ -76,7 +76,7 @@ static IADEV *ia_dev[8];
>   static struct atm_dev *_ia_dev[8];
>   static int iadev_count;
>   static void ia_led_timer(unsigned long arg);
> -static DEFINE_TIMER(ia_timer, ia_led_timer, 0, 0);
> +static DEFINE_TIMER(ia_timer, ia_led_timer);
>   static int IA_TX_BUF = DFL_TX_BUFFERS, IA_TX_BUF_SZ = DFL_TX_BUF_SZ;
>   static int IA_RX_BUF = DFL_RX_BUFFERS, IA_RX_BUF_SZ = DFL_RX_BUF_SZ;
>   static uint IADebugFlag = /* IF_IADBG_ERR | IF_IADBG_CBR| IF_IADBG_INIT_ADAPTER
> diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
> index 92da886180aa..ae596e55bcb6 100644
> --- a/drivers/block/ataflop.c
> +++ b/drivers/block/ataflop.c
> @@ -373,10 +373,10 @@ static void floppy_release(struct gendisk *disk, fmode_t mode);
>   
>   /************************* End of Prototypes **************************/
>   
> -static DEFINE_TIMER(motor_off_timer, fd_motor_off_timer, 0, 0);
> -static DEFINE_TIMER(readtrack_timer, fd_readtrack_check, 0, 0);
> -static DEFINE_TIMER(timeout_timer, fd_times_out, 0, 0);
> -static DEFINE_TIMER(fd_timer, check_change, 0, 0);
> +static DEFINE_TIMER(motor_off_timer, fd_motor_off_timer);
> +static DEFINE_TIMER(readtrack_timer, fd_readtrack_check);
> +static DEFINE_TIMER(timeout_timer, fd_times_out);
> +static DEFINE_TIMER(fd_timer, check_change);
>   	
>   static void fd_end_request_cur(blk_status_t err)
>   {
> diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
> index 58471394beb9..1a0385ed6417 100644
> --- a/drivers/char/dtlk.c
> +++ b/drivers/char/dtlk.c
> @@ -84,7 +84,7 @@ static int dtlk_has_indexing;
>   static unsigned int dtlk_portlist[] =
>   {0x25e, 0x29e, 0x2de, 0x31e, 0x35e, 0x39e, 0};
>   static wait_queue_head_t dtlk_process_list;
> -static DEFINE_TIMER(dtlk_timer, dtlk_timer_tick, 0, 0);
> +static DEFINE_TIMER(dtlk_timer, dtlk_timer_tick);
>   
>   /* prototypes for file_operations struct */
>   static ssize_t dtlk_read(struct file *, char __user *,
> diff --git a/drivers/char/hangcheck-timer.c b/drivers/char/hangcheck-timer.c
> index 5406b90bf626..5b8db2ed844d 100644
> --- a/drivers/char/hangcheck-timer.c
> +++ b/drivers/char/hangcheck-timer.c
> @@ -124,7 +124,7 @@ static unsigned long long hangcheck_tsc, hangcheck_tsc_margin;
>   
>   static void hangcheck_fire(unsigned long);
>   
> -static DEFINE_TIMER(hangcheck_ticktock, hangcheck_fire, 0, 0);
> +static DEFINE_TIMER(hangcheck_ticktock, hangcheck_fire);
>   
>   static void hangcheck_fire(unsigned long data)
>   {
> diff --git a/drivers/char/nwbutton.c b/drivers/char/nwbutton.c
> index e6d0d271c58c..44006ed9558f 100644
> --- a/drivers/char/nwbutton.c
> +++ b/drivers/char/nwbutton.c
> @@ -27,7 +27,7 @@ static void button_sequence_finished (unsigned long parameters);
>   
>   static int button_press_count;		/* The count of button presses */
>   /* Times for the end of a sequence */
> -static DEFINE_TIMER(button_timer, button_sequence_finished, 0, 0);
> +static DEFINE_TIMER(button_timer, button_sequence_finished);
>   static DECLARE_WAIT_QUEUE_HEAD(button_wait_queue); /* Used for blocking read */
>   static char button_output_buffer[32];	/* Stores data to write out of device */
>   static int bcount;			/* The number of bytes in the buffer */
> diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
> index 974d48927b07..616871e68e09 100644
> --- a/drivers/char/rtc.c
> +++ b/drivers/char/rtc.c
> @@ -137,7 +137,7 @@ static DECLARE_WAIT_QUEUE_HEAD(rtc_wait);
>   #ifdef RTC_IRQ
>   static void rtc_dropped_irq(unsigned long data);
>   
> -static DEFINE_TIMER(rtc_irq_timer, rtc_dropped_irq, 0, 0);
> +static DEFINE_TIMER(rtc_irq_timer, rtc_dropped_irq);
>   #endif
>   
>   static ssize_t rtc_read(struct file *file, char __user *buf,
> diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
> index 3b3db8c868e0..d3265b6b58b8 100644
> --- a/drivers/input/touchscreen/s3c2410_ts.c
> +++ b/drivers/input/touchscreen/s3c2410_ts.c
> @@ -145,7 +145,7 @@ static void touch_timer_fire(unsigned long data)
>   	}
>   }
>   
> -static DEFINE_TIMER(touch_timer, touch_timer_fire, 0, 0);
> +static DEFINE_TIMER(touch_timer, touch_timer_fire);
>   
>   /**
>    * stylus_irq - touchscreen stylus event interrupt
> diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
> index 017f48cdcab9..1fcc86fa4e05 100644
> --- a/drivers/net/cris/eth_v10.c
> +++ b/drivers/net/cris/eth_v10.c
> @@ -165,8 +165,8 @@ static unsigned int network_rec_config_shadow = 0;
>   static unsigned int network_tr_ctrl_shadow = 0;
>   
>   /* Network speed indication. */
> -static DEFINE_TIMER(speed_timer, NULL, 0, 0);
> -static DEFINE_TIMER(clear_led_timer, NULL, 0, 0);
> +static DEFINE_TIMER(speed_timer, NULL);
> +static DEFINE_TIMER(clear_led_timer, NULL);
>   static int current_speed; /* Speed read from transceiver */
>   static int current_speed_selection; /* Speed selected by user */
>   static unsigned long led_next_time;
> @@ -174,7 +174,7 @@ static int led_active;
>   static int rx_queue_len;
>   
>   /* Duplex */
> -static DEFINE_TIMER(duplex_timer, NULL, 0, 0);
> +static DEFINE_TIMER(duplex_timer, NULL);
>   static int full_duplex;
>   static enum duplex current_duplex;
>   
> diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
> index 7a7c5224a336..104f71fa9c5e 100644
> --- a/drivers/net/hamradio/yam.c
> +++ b/drivers/net/hamradio/yam.c
> @@ -157,7 +157,7 @@ static struct net_device *yam_devs[NR_PORTS];
>   
>   static struct yam_mcs *yam_data;
>   
> -static DEFINE_TIMER(yam_timer, NULL, 0, 0);
> +static DEFINE_TIMER(yam_timer, NULL);
>   
>   /* --------------------------------------------------------------------- */
>   
> diff --git a/drivers/net/wireless/atmel/at76c50x-usb.c b/drivers/net/wireless/atmel/at76c50x-usb.c
> index 94bf01f8b2a8..ede89d4ffc88 100644
> --- a/drivers/net/wireless/atmel/at76c50x-usb.c
> +++ b/drivers/net/wireless/atmel/at76c50x-usb.c
> @@ -519,7 +519,7 @@ static int at76_usbdfu_download(struct usb_device *udev, u8 *buf, u32 size,
>   /* LED trigger */
>   static int tx_activity;
>   static void at76_ledtrig_tx_timerfunc(unsigned long data);
> -static DEFINE_TIMER(ledtrig_tx_timer, at76_ledtrig_tx_timerfunc, 0, 0);
> +static DEFINE_TIMER(ledtrig_tx_timer, at76_ledtrig_tx_timerfunc);
>   DEFINE_LED_TRIGGER(ledtrig_tx);
>   
>   static void at76_ledtrig_tx_timerfunc(unsigned long data)
> diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
> index 67956e24779c..b61e9becb612 100644
> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -1165,7 +1165,7 @@ static const int NUM_CTL_LABELS = (MSG_CTL_END - MSG_CTL_START + 1);
>   
>   static void read_all_doc(struct vc_data *vc);
>   static void cursor_done(u_long data);
> -static DEFINE_TIMER(cursor_timer, cursor_done, 0, 0);
> +static DEFINE_TIMER(cursor_timer, cursor_done);
>   
>   static void do_handle_shift(struct vc_data *vc, u_char value, char up_flag)
>   {
> diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
> index a1ca68c76579..6ddd3fc3f08d 100644
> --- a/drivers/staging/speakup/synth.c
> +++ b/drivers/staging/speakup/synth.c
> @@ -158,7 +158,7 @@ static void thread_wake_up(u_long data)
>   	wake_up_interruptible_all(&speakup_event);
>   }
>   
> -static DEFINE_TIMER(thread_timer, thread_wake_up, 0, 0);
> +static DEFINE_TIMER(thread_timer, thread_wake_up);
>   
>   void synth_start(void)
>   {
> diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
> index d272bc4e7fb5..dac8a1a8e4ac 100644
> --- a/drivers/tty/cyclades.c
> +++ b/drivers/tty/cyclades.c
> @@ -283,7 +283,7 @@ static void cyz_poll(unsigned long);
>   /* The Cyclades-Z polling cycle is defined by this variable */
>   static long cyz_polling_cycle = CZ_DEF_POLL;
>   
> -static DEFINE_TIMER(cyz_timerlist, cyz_poll, 0, 0);
> +static DEFINE_TIMER(cyz_timerlist, cyz_poll);
>   
>   #else				/* CONFIG_CYZ_INTR */
>   static void cyz_rx_restart(unsigned long);
> diff --git a/drivers/tty/isicom.c b/drivers/tty/isicom.c
> index 61ecdd6b2fc2..40af32108ff5 100644
> --- a/drivers/tty/isicom.c
> +++ b/drivers/tty/isicom.c
> @@ -177,7 +177,7 @@ static struct tty_driver *isicom_normal;
>   static void isicom_tx(unsigned long _data);
>   static void isicom_start(struct tty_struct *tty);
>   
> -static DEFINE_TIMER(tx, isicom_tx, 0, 0);
> +static DEFINE_TIMER(tx, isicom_tx);
>   
>   /*   baud index mappings from linux defns to isi */
>   
> diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
> index 7f3d4cb0341b..93d37655d928 100644
> --- a/drivers/tty/moxa.c
> +++ b/drivers/tty/moxa.c
> @@ -428,7 +428,7 @@ static const struct tty_port_operations moxa_port_ops = {
>   };
>   
>   static struct tty_driver *moxaDriver;
> -static DEFINE_TIMER(moxaTimer, moxa_poll, 0, 0);
> +static DEFINE_TIMER(moxaTimer, moxa_poll);
>   
>   /*
>    * HW init
> diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c
> index 20d79a6007d5..aa695fda1084 100644
> --- a/drivers/tty/rocket.c
> +++ b/drivers/tty/rocket.c
> @@ -111,7 +111,7 @@ static struct r_port *rp_table[MAX_RP_PORTS];	       /*  The main repository of
>   static unsigned int xmit_flags[NUM_BOARDS];	       /*  Bit significant, indicates port had data to transmit. */
>   						       /*  eg.  Bit 0 indicates port 0 has xmit data, ...        */
>   static atomic_t rp_num_ports_open;	               /*  Number of serial ports open                           */
> -static DEFINE_TIMER(rocket_timer, rp_do_poll, 0, 0);
> +static DEFINE_TIMER(rocket_timer, rp_do_poll);
>   
>   static unsigned long board1;	                       /* ISA addresses, retrieved from rocketport.conf          */
>   static unsigned long board2;
> diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
> index f4166263bb3a..f974d6340d04 100644
> --- a/drivers/tty/vt/keyboard.c
> +++ b/drivers/tty/vt/keyboard.c
> @@ -250,7 +250,7 @@ static void kd_nosound(unsigned long ignored)
>   	input_handler_for_each_handle(&kbd_handler, &zero, kd_sound_helper);
>   }
>   
> -static DEFINE_TIMER(kd_mksound_timer, kd_nosound, 0, 0);
> +static DEFINE_TIMER(kd_mksound_timer, kd_nosound);
>   
>   void kd_mksound(unsigned int hz, unsigned int ticks)
>   {
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index 2ebaba16f785..602d71630952 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -228,7 +228,7 @@ static int scrollback_delta;
>    */
>   int (*console_blank_hook)(int);
>   
> -static DEFINE_TIMER(console_timer, blank_screen_t, 0, 0);
> +static DEFINE_TIMER(console_timer, blank_screen_t);
>   static int blank_state;
>   static int blank_timer_expired;
>   enum {
> diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c
> index 3c1f6ac68ea9..18e896eeca62 100644
> --- a/drivers/watchdog/alim7101_wdt.c
> +++ b/drivers/watchdog/alim7101_wdt.c
> @@ -71,7 +71,7 @@ MODULE_PARM_DESC(use_gpio,
>   		"Use the gpio watchdog (required by old cobalt boards).");
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_ping);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
> index 9826b59ef734..8a616a57bb90 100644
> --- a/drivers/watchdog/machzwd.c
> +++ b/drivers/watchdog/machzwd.c
> @@ -127,7 +127,7 @@ static int zf_action = GEN_RESET;
>   static unsigned long zf_is_open;
>   static char zf_expect_close;
>   static DEFINE_SPINLOCK(zf_port_lock);
> -static DEFINE_TIMER(zf_timer, zf_ping, 0, 0);
> +static DEFINE_TIMER(zf_timer, zf_ping);
>   static unsigned long next_heartbeat;
>   
>   
> diff --git a/drivers/watchdog/mixcomwd.c b/drivers/watchdog/mixcomwd.c
> index be86ea359eee..c9e38096ea91 100644
> --- a/drivers/watchdog/mixcomwd.c
> +++ b/drivers/watchdog/mixcomwd.c
> @@ -105,7 +105,7 @@ static unsigned long mixcomwd_opened; /* long req'd for setbit --RR */
>   
>   static int watchdog_port;
>   static int mixcomwd_timer_alive;
> -static DEFINE_TIMER(mixcomwd_timer, mixcomwd_timerfun, 0, 0);
> +static DEFINE_TIMER(mixcomwd_timer, mixcomwd_timerfun);
>   static char expect_close;
>   
>   static bool nowayout = WATCHDOG_NOWAYOUT;
> diff --git a/drivers/watchdog/sbc60xxwdt.c b/drivers/watchdog/sbc60xxwdt.c
> index 2eef58a0cf05..8d589939bc84 100644
> --- a/drivers/watchdog/sbc60xxwdt.c
> +++ b/drivers/watchdog/sbc60xxwdt.c
> @@ -113,7 +113,7 @@ MODULE_PARM_DESC(nowayout,
>   				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_ping);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> diff --git a/drivers/watchdog/sc520_wdt.c b/drivers/watchdog/sc520_wdt.c
> index 1cfd3f6a13d5..3e9bbaa37bf4 100644
> --- a/drivers/watchdog/sc520_wdt.c
> +++ b/drivers/watchdog/sc520_wdt.c
> @@ -124,7 +124,7 @@ MODULE_PARM_DESC(nowayout,
>   static __u16 __iomem *wdtmrctl;
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_ping);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> diff --git a/drivers/watchdog/via_wdt.c b/drivers/watchdog/via_wdt.c
> index 5f9cbc37520d..ad3c3be13b40 100644
> --- a/drivers/watchdog/via_wdt.c
> +++ b/drivers/watchdog/via_wdt.c
> @@ -68,7 +68,7 @@ static struct resource wdt_res;
>   static void __iomem *wdt_mem;
>   static unsigned int mmio;
>   static void wdt_timer_tick(unsigned long data);
> -static DEFINE_TIMER(timer, wdt_timer_tick, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_tick);
>   					/* The timer that pings the watchdog */
>   static unsigned long next_heartbeat;	/* the next_heartbeat for the timer */
>   
> diff --git a/drivers/watchdog/w83877f_wdt.c b/drivers/watchdog/w83877f_wdt.c
> index f0483c75ed32..ba6b680af100 100644
> --- a/drivers/watchdog/w83877f_wdt.c
> +++ b/drivers/watchdog/w83877f_wdt.c
> @@ -98,7 +98,7 @@ MODULE_PARM_DESC(nowayout,
>   				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_ping);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
> index 2c6a9114d332..a8721d718186 100644
> --- a/drivers/xen/grant-table.c
> +++ b/drivers/xen/grant-table.c
> @@ -305,7 +305,7 @@ struct deferred_entry {
>   };
>   static LIST_HEAD(deferred_list);
>   static void gnttab_handle_deferred(unsigned long);
> -static DEFINE_TIMER(deferred_timer, gnttab_handle_deferred, 0, 0);
> +static DEFINE_TIMER(deferred_timer, gnttab_handle_deferred);
>   
>   static void gnttab_handle_deferred(unsigned long unused)
>   {
> diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
> index 2b21d180157c..ec7199e859d2 100644
> --- a/fs/pstore/platform.c
> +++ b/fs/pstore/platform.c
> @@ -62,7 +62,7 @@ MODULE_PARM_DESC(update_ms, "milliseconds before pstore updates its content "
>   static int pstore_new_entry;
>   
>   static void pstore_timefunc(unsigned long);
> -static DEFINE_TIMER(pstore_timer, pstore_timefunc, 0, 0);
> +static DEFINE_TIMER(pstore_timer, pstore_timefunc);
>   
>   static void pstore_dowork(struct work_struct *);
>   static DECLARE_WORK(pstore_work, pstore_dowork);
> diff --git a/include/linux/timer.h b/include/linux/timer.h
> index a33220311361..91e5a2cc81b5 100644
> --- a/include/linux/timer.h
> +++ b/include/linux/timer.h
> @@ -73,9 +73,9 @@ struct timer_list {
>   			__FILE__ ":" __stringify(__LINE__))	\
>   	}
>   
> -#define DEFINE_TIMER(_name, _function, _expires, _data)		\
> +#define DEFINE_TIMER(_name, _function)				\
>   	struct timer_list _name =				\
> -		__TIMER_INITIALIZER(_function, _expires, _data, 0)
> +		__TIMER_INITIALIZER(_function, 0, 0, 0)
>   
>   void init_timer_key(struct timer_list *timer, unsigned int flags,
>   		    const char *name, struct lock_class_key *key);
> diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
> index 061ba7eed4ed..c805e8691c22 100644
> --- a/kernel/irq/spurious.c
> +++ b/kernel/irq/spurious.c
> @@ -20,7 +20,7 @@ static int irqfixup __read_mostly;
>   
>   #define POLL_SPURIOUS_IRQ_INTERVAL (HZ/10)
>   static void poll_spurious_irqs(unsigned long dummy);
> -static DEFINE_TIMER(poll_spurious_irq_timer, poll_spurious_irqs, 0, 0);
> +static DEFINE_TIMER(poll_spurious_irq_timer, poll_spurious_irqs);
>   static int irq_poll_cpu;
>   static atomic_t irq_poll_active;
>   
> diff --git a/lib/random32.c b/lib/random32.c
> index fa594b1140e6..6e91b75c113f 100644
> --- a/lib/random32.c
> +++ b/lib/random32.c
> @@ -214,7 +214,7 @@ core_initcall(prandom_init);
>   
>   static void __prandom_timer(unsigned long dontcare);
>   
> -static DEFINE_TIMER(seed_timer, __prandom_timer, 0, 0);
> +static DEFINE_TIMER(seed_timer, __prandom_timer);
>   
>   static void __prandom_timer(unsigned long dontcare)
>   {
> diff --git a/net/atm/mpc.c b/net/atm/mpc.c
> index 5677147209e8..63138c8c2269 100644
> --- a/net/atm/mpc.c
> +++ b/net/atm/mpc.c
> @@ -121,7 +121,7 @@ static struct notifier_block mpoa_notifier = {
>   
>   struct mpoa_client *mpcs = NULL; /* FIXME */
>   static struct atm_mpoa_qos *qos_head = NULL;
> -static DEFINE_TIMER(mpc_timer, NULL, 0, 0);
> +static DEFINE_TIMER(mpc_timer, NULL);
>   
>   
>   static struct mpoa_client *find_mpc_by_itfnum(int itf)
> diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
> index 0bd3afd01dd2..6538632fbd03 100644
> --- a/net/decnet/dn_route.c
> +++ b/net/decnet/dn_route.c
> @@ -131,7 +131,7 @@ static struct dn_rt_hash_bucket *dn_rt_hash_table;
>   static unsigned int dn_rt_hash_mask;
>   
>   static struct timer_list dn_route_timer;
> -static DEFINE_TIMER(dn_rt_flush_timer, dn_run_flush, 0, 0);
> +static DEFINE_TIMER(dn_rt_flush_timer, dn_run_flush);
>   int decnet_dst_gc_interval = 2;
>   
>   static struct dst_ops dn_dst_ops = {
> diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
> index 8081bafe441b..b39d0908be2e 100644
> --- a/net/ipv6/ip6_flowlabel.c
> +++ b/net/ipv6/ip6_flowlabel.c
> @@ -47,7 +47,7 @@ static atomic_t fl_size = ATOMIC_INIT(0);
>   static struct ip6_flowlabel __rcu *fl_ht[FL_HASH_MASK+1];
>   
>   static void ip6_fl_gc(unsigned long dummy);
> -static DEFINE_TIMER(ip6_fl_gc_timer, ip6_fl_gc, 0, 0);
> +static DEFINE_TIMER(ip6_fl_gc_timer, ip6_fl_gc);
>   
>   /* FL hash table lock: it protects only of GC */
>   
> diff --git a/net/netrom/nr_loopback.c b/net/netrom/nr_loopback.c
> index 94d4e922af53..989ae647825e 100644
> --- a/net/netrom/nr_loopback.c
> +++ b/net/netrom/nr_loopback.c
> @@ -18,7 +18,7 @@
>   static void nr_loopback_timer(unsigned long);
>   
>   static struct sk_buff_head loopback_queue;
> -static DEFINE_TIMER(loopback_timer, nr_loopback_timer, 0, 0);
> +static DEFINE_TIMER(loopback_timer, nr_loopback_timer);
>   
>   void __init nr_loopback_init(void)
>   {
> diff --git a/security/keys/gc.c b/security/keys/gc.c
> index 87cb260e4890..8673f7f58ead 100644
> --- a/security/keys/gc.c
> +++ b/security/keys/gc.c
> @@ -30,7 +30,7 @@ DECLARE_WORK(key_gc_work, key_garbage_collector);
>    * Reaper for links from keyrings to dead keys.
>    */
>   static void key_gc_timer_func(unsigned long);
> -static DEFINE_TIMER(key_gc_timer, key_gc_timer_func, 0, 0);
> +static DEFINE_TIMER(key_gc_timer, key_gc_timer_func);
>   
>   static time_t key_gc_next_run = LONG_MAX;
>   static struct key_type *key_gc_dead_keytype;
> diff --git a/sound/oss/midibuf.c b/sound/oss/midibuf.c
> index 701c7625c971..1277df815d5b 100644
> --- a/sound/oss/midibuf.c
> +++ b/sound/oss/midibuf.c
> @@ -52,7 +52,7 @@ static struct midi_parms parms[MAX_MIDI_DEV];
>   static void midi_poll(unsigned long dummy);
>   
>   
> -static DEFINE_TIMER(poll_timer, midi_poll, 0, 0);
> +static DEFINE_TIMER(poll_timer, midi_poll);
>   
>   static volatile int open_devs;
>   static DEFINE_SPINLOCK(lock);
> diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
> index b70c7c8f9c5d..4391062e5cfd 100644
> --- a/sound/oss/soundcard.c
> +++ b/sound/oss/soundcard.c
> @@ -662,7 +662,7 @@ static void do_sequencer_timer(unsigned long dummy)
>   }
>   
>   
> -static DEFINE_TIMER(seq_timer, do_sequencer_timer, 0, 0);
> +static DEFINE_TIMER(seq_timer, do_sequencer_timer);
>   
>   void request_sound_timer(int count)
>   {
> diff --git a/sound/oss/sys_timer.c b/sound/oss/sys_timer.c
> index d17019d25b99..8a4b5625dba6 100644
> --- a/sound/oss/sys_timer.c
> +++ b/sound/oss/sys_timer.c
> @@ -28,7 +28,7 @@ static unsigned long prev_event_time;
>   
>   static void     poll_def_tmr(unsigned long dummy);
>   static DEFINE_SPINLOCK(lock);
> -static DEFINE_TIMER(def_tmr, poll_def_tmr, 0, 0);
> +static DEFINE_TIMER(def_tmr, poll_def_tmr);
>   
>   static unsigned long
>   tmr2ticks(int tmr_value)
> diff --git a/sound/oss/uart6850.c b/sound/oss/uart6850.c
> index eda32d7eddbd..a9d3f7568525 100644
> --- a/sound/oss/uart6850.c
> +++ b/sound/oss/uart6850.c
> @@ -78,7 +78,7 @@ static void (*midi_input_intr) (int dev, unsigned char data);
>   static void poll_uart6850(unsigned long dummy);
>   
>   
> -static DEFINE_TIMER(uart6850_timer, poll_uart6850, 0, 0);
> +static DEFINE_TIMER(uart6850_timer, poll_uart6850);
>   
>   static void uart6850_input_loop(void)
>   {
> 

^ permalink raw reply

* Re: [PATCH 10/13] timer: Remove expires and data arguments from DEFINE_TIMER
From: Guenter Roeck @ 2017-10-05  0:13 UTC (permalink / raw)
  To: Kees Cook, Thomas Gleixner
  Cc: Andrew Morton, Arnd Bergmann, Benjamin Herrenschmidt,
	Chris Metcalf, Geert Uytterhoeven, Greg Kroah-Hartman,
	Harish Patil, Heiko Carstens, James E.J. Bottomley, John Stultz,
	Julian Wiedmann, Kalle Valo, Lai Jiangshan, Len Brown,
	Manish Chopra, Mark Gross, Martin K. Petersen, Martin Schwidefsky
In-Reply-To: <1507159627-127660-11-git-send-email-keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

On 10/04/2017 04:27 PM, Kees Cook wrote:
> Drop the arguments from the macro and adjust all callers with the
> following script:
> 
>    perl -pi -e 's/DEFINE_TIMER\((.*), 0, 0\);/DEFINE_TIMER($1);/g;' \
>      $(git grep DEFINE_TIMER | cut -d: -f1 | sort -u | grep -v timer.h)
> 
> Signed-off-by: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> Acked-by: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> # for m68k parts

For watchdog:

Acked-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>

> ---
>   arch/arm/mach-ixp4xx/dsmg600-setup.c      | 2 +-
>   arch/arm/mach-ixp4xx/nas100d-setup.c      | 2 +-
>   arch/m68k/amiga/amisound.c                | 2 +-
>   arch/m68k/mac/macboing.c                  | 2 +-
>   arch/mips/mti-malta/malta-display.c       | 2 +-
>   arch/parisc/kernel/pdc_cons.c             | 2 +-
>   arch/s390/mm/cmm.c                        | 2 +-
>   drivers/atm/idt77105.c                    | 4 ++--
>   drivers/atm/iphase.c                      | 2 +-
>   drivers/block/ataflop.c                   | 8 ++++----
>   drivers/char/dtlk.c                       | 2 +-
>   drivers/char/hangcheck-timer.c            | 2 +-
>   drivers/char/nwbutton.c                   | 2 +-
>   drivers/char/rtc.c                        | 2 +-
>   drivers/input/touchscreen/s3c2410_ts.c    | 2 +-
>   drivers/net/cris/eth_v10.c                | 6 +++---
>   drivers/net/hamradio/yam.c                | 2 +-
>   drivers/net/wireless/atmel/at76c50x-usb.c | 2 +-
>   drivers/staging/speakup/main.c            | 2 +-
>   drivers/staging/speakup/synth.c           | 2 +-
>   drivers/tty/cyclades.c                    | 2 +-
>   drivers/tty/isicom.c                      | 2 +-
>   drivers/tty/moxa.c                        | 2 +-
>   drivers/tty/rocket.c                      | 2 +-
>   drivers/tty/vt/keyboard.c                 | 2 +-
>   drivers/tty/vt/vt.c                       | 2 +-
>   drivers/watchdog/alim7101_wdt.c           | 2 +-
>   drivers/watchdog/machzwd.c                | 2 +-
>   drivers/watchdog/mixcomwd.c               | 2 +-
>   drivers/watchdog/sbc60xxwdt.c             | 2 +-
>   drivers/watchdog/sc520_wdt.c              | 2 +-
>   drivers/watchdog/via_wdt.c                | 2 +-
>   drivers/watchdog/w83877f_wdt.c            | 2 +-
>   drivers/xen/grant-table.c                 | 2 +-
>   fs/pstore/platform.c                      | 2 +-
>   include/linux/timer.h                     | 4 ++--
>   kernel/irq/spurious.c                     | 2 +-
>   lib/random32.c                            | 2 +-
>   net/atm/mpc.c                             | 2 +-
>   net/decnet/dn_route.c                     | 2 +-
>   net/ipv6/ip6_flowlabel.c                  | 2 +-
>   net/netrom/nr_loopback.c                  | 2 +-
>   security/keys/gc.c                        | 2 +-
>   sound/oss/midibuf.c                       | 2 +-
>   sound/oss/soundcard.c                     | 2 +-
>   sound/oss/sys_timer.c                     | 2 +-
>   sound/oss/uart6850.c                      | 2 +-
>   47 files changed, 54 insertions(+), 54 deletions(-)
> 
> diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c
> index b3bd0e137f6d..b3689a141ec6 100644
> --- a/arch/arm/mach-ixp4xx/dsmg600-setup.c
> +++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c
> @@ -174,7 +174,7 @@ static int power_button_countdown;
>   #define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
>   
>   static void dsmg600_power_handler(unsigned long data);
> -static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler, 0, 0);
> +static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler);
>   
>   static void dsmg600_power_handler(unsigned long data)
>   {
> diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
> index 4e0f762bc651..562d05f9888e 100644
> --- a/arch/arm/mach-ixp4xx/nas100d-setup.c
> +++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
> @@ -197,7 +197,7 @@ static int power_button_countdown;
>   #define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
>   
>   static void nas100d_power_handler(unsigned long data);
> -static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler, 0, 0);
> +static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler);
>   
>   static void nas100d_power_handler(unsigned long data)
>   {
> diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c
> index 90a60d758f8b..a23f48181fd6 100644
> --- a/arch/m68k/amiga/amisound.c
> +++ b/arch/m68k/amiga/amisound.c
> @@ -66,7 +66,7 @@ void __init amiga_init_sound(void)
>   }
>   
>   static void nosound( unsigned long ignored );
> -static DEFINE_TIMER(sound_timer, nosound, 0, 0);
> +static DEFINE_TIMER(sound_timer, nosound);
>   
>   void amiga_mksound( unsigned int hz, unsigned int ticks )
>   {
> diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c
> index ffaa1f6439ae..9a52aff183d0 100644
> --- a/arch/m68k/mac/macboing.c
> +++ b/arch/m68k/mac/macboing.c
> @@ -56,7 +56,7 @@ static void ( *mac_special_bell )( unsigned int, unsigned int, unsigned int );
>   /*
>    * our timer to start/continue/stop the bell
>    */
> -static DEFINE_TIMER(mac_sound_timer, mac_nosound, 0, 0);
> +static DEFINE_TIMER(mac_sound_timer, mac_nosound);
>   
>   /*
>    * Sort of initialize the sound chip (called from mac_mksound on the first
> diff --git a/arch/mips/mti-malta/malta-display.c b/arch/mips/mti-malta/malta-display.c
> index ac813158b9b8..063de44675ce 100644
> --- a/arch/mips/mti-malta/malta-display.c
> +++ b/arch/mips/mti-malta/malta-display.c
> @@ -37,7 +37,7 @@ void mips_display_message(const char *str)
>   }
>   
>   static void scroll_display_message(unsigned long unused);
> -static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, 0, 0);
> +static DEFINE_TIMER(mips_scroll_timer, scroll_display_message);
>   
>   static void scroll_display_message(unsigned long unused)
>   {
> diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
> index 10a5ae9553fd..27a2dd616a7d 100644
> --- a/arch/parisc/kernel/pdc_cons.c
> +++ b/arch/parisc/kernel/pdc_cons.c
> @@ -92,7 +92,7 @@ static int pdc_console_setup(struct console *co, char *options)
>   #define PDC_CONS_POLL_DELAY (30 * HZ / 1000)
>   
>   static void pdc_console_poll(unsigned long unused);
> -static DEFINE_TIMER(pdc_console_timer, pdc_console_poll, 0, 0);
> +static DEFINE_TIMER(pdc_console_timer, pdc_console_poll);
>   static struct tty_port tty_port;
>   
>   static int pdc_console_tty_open(struct tty_struct *tty, struct file *filp)
> diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
> index 829c63dbc81a..2dbdcd85b68f 100644
> --- a/arch/s390/mm/cmm.c
> +++ b/arch/s390/mm/cmm.c
> @@ -56,7 +56,7 @@ static DEFINE_SPINLOCK(cmm_lock);
>   
>   static struct task_struct *cmm_thread_ptr;
>   static DECLARE_WAIT_QUEUE_HEAD(cmm_thread_wait);
> -static DEFINE_TIMER(cmm_timer, NULL, 0, 0);
> +static DEFINE_TIMER(cmm_timer, NULL);
>   
>   static void cmm_timer_fn(unsigned long);
>   static void cmm_set_timer(void);
> diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
> index 082aa02abc57..57af9fd198e4 100644
> --- a/drivers/atm/idt77105.c
> +++ b/drivers/atm/idt77105.c
> @@ -49,8 +49,8 @@ static void idt77105_stats_timer_func(unsigned long);
>   static void idt77105_restart_timer_func(unsigned long);
>   
>   
> -static DEFINE_TIMER(stats_timer, idt77105_stats_timer_func, 0, 0);
> -static DEFINE_TIMER(restart_timer, idt77105_restart_timer_func, 0, 0);
> +static DEFINE_TIMER(stats_timer, idt77105_stats_timer_func);
> +static DEFINE_TIMER(restart_timer, idt77105_restart_timer_func);
>   static int start_timer = 1;
>   static struct idt77105_priv *idt77105_all = NULL;
>   
> diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
> index fc72b763fdd7..ad6b582c268e 100644
> --- a/drivers/atm/iphase.c
> +++ b/drivers/atm/iphase.c
> @@ -76,7 +76,7 @@ static IADEV *ia_dev[8];
>   static struct atm_dev *_ia_dev[8];
>   static int iadev_count;
>   static void ia_led_timer(unsigned long arg);
> -static DEFINE_TIMER(ia_timer, ia_led_timer, 0, 0);
> +static DEFINE_TIMER(ia_timer, ia_led_timer);
>   static int IA_TX_BUF = DFL_TX_BUFFERS, IA_TX_BUF_SZ = DFL_TX_BUF_SZ;
>   static int IA_RX_BUF = DFL_RX_BUFFERS, IA_RX_BUF_SZ = DFL_RX_BUF_SZ;
>   static uint IADebugFlag = /* IF_IADBG_ERR | IF_IADBG_CBR| IF_IADBG_INIT_ADAPTER
> diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
> index 92da886180aa..ae596e55bcb6 100644
> --- a/drivers/block/ataflop.c
> +++ b/drivers/block/ataflop.c
> @@ -373,10 +373,10 @@ static void floppy_release(struct gendisk *disk, fmode_t mode);
>   
>   /************************* End of Prototypes **************************/
>   
> -static DEFINE_TIMER(motor_off_timer, fd_motor_off_timer, 0, 0);
> -static DEFINE_TIMER(readtrack_timer, fd_readtrack_check, 0, 0);
> -static DEFINE_TIMER(timeout_timer, fd_times_out, 0, 0);
> -static DEFINE_TIMER(fd_timer, check_change, 0, 0);
> +static DEFINE_TIMER(motor_off_timer, fd_motor_off_timer);
> +static DEFINE_TIMER(readtrack_timer, fd_readtrack_check);
> +static DEFINE_TIMER(timeout_timer, fd_times_out);
> +static DEFINE_TIMER(fd_timer, check_change);
>   	
>   static void fd_end_request_cur(blk_status_t err)
>   {
> diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
> index 58471394beb9..1a0385ed6417 100644
> --- a/drivers/char/dtlk.c
> +++ b/drivers/char/dtlk.c
> @@ -84,7 +84,7 @@ static int dtlk_has_indexing;
>   static unsigned int dtlk_portlist[] =
>   {0x25e, 0x29e, 0x2de, 0x31e, 0x35e, 0x39e, 0};
>   static wait_queue_head_t dtlk_process_list;
> -static DEFINE_TIMER(dtlk_timer, dtlk_timer_tick, 0, 0);
> +static DEFINE_TIMER(dtlk_timer, dtlk_timer_tick);
>   
>   /* prototypes for file_operations struct */
>   static ssize_t dtlk_read(struct file *, char __user *,
> diff --git a/drivers/char/hangcheck-timer.c b/drivers/char/hangcheck-timer.c
> index 5406b90bf626..5b8db2ed844d 100644
> --- a/drivers/char/hangcheck-timer.c
> +++ b/drivers/char/hangcheck-timer.c
> @@ -124,7 +124,7 @@ static unsigned long long hangcheck_tsc, hangcheck_tsc_margin;
>   
>   static void hangcheck_fire(unsigned long);
>   
> -static DEFINE_TIMER(hangcheck_ticktock, hangcheck_fire, 0, 0);
> +static DEFINE_TIMER(hangcheck_ticktock, hangcheck_fire);
>   
>   static void hangcheck_fire(unsigned long data)
>   {
> diff --git a/drivers/char/nwbutton.c b/drivers/char/nwbutton.c
> index e6d0d271c58c..44006ed9558f 100644
> --- a/drivers/char/nwbutton.c
> +++ b/drivers/char/nwbutton.c
> @@ -27,7 +27,7 @@ static void button_sequence_finished (unsigned long parameters);
>   
>   static int button_press_count;		/* The count of button presses */
>   /* Times for the end of a sequence */
> -static DEFINE_TIMER(button_timer, button_sequence_finished, 0, 0);
> +static DEFINE_TIMER(button_timer, button_sequence_finished);
>   static DECLARE_WAIT_QUEUE_HEAD(button_wait_queue); /* Used for blocking read */
>   static char button_output_buffer[32];	/* Stores data to write out of device */
>   static int bcount;			/* The number of bytes in the buffer */
> diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
> index 974d48927b07..616871e68e09 100644
> --- a/drivers/char/rtc.c
> +++ b/drivers/char/rtc.c
> @@ -137,7 +137,7 @@ static DECLARE_WAIT_QUEUE_HEAD(rtc_wait);
>   #ifdef RTC_IRQ
>   static void rtc_dropped_irq(unsigned long data);
>   
> -static DEFINE_TIMER(rtc_irq_timer, rtc_dropped_irq, 0, 0);
> +static DEFINE_TIMER(rtc_irq_timer, rtc_dropped_irq);
>   #endif
>   
>   static ssize_t rtc_read(struct file *file, char __user *buf,
> diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
> index 3b3db8c868e0..d3265b6b58b8 100644
> --- a/drivers/input/touchscreen/s3c2410_ts.c
> +++ b/drivers/input/touchscreen/s3c2410_ts.c
> @@ -145,7 +145,7 @@ static void touch_timer_fire(unsigned long data)
>   	}
>   }
>   
> -static DEFINE_TIMER(touch_timer, touch_timer_fire, 0, 0);
> +static DEFINE_TIMER(touch_timer, touch_timer_fire);
>   
>   /**
>    * stylus_irq - touchscreen stylus event interrupt
> diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
> index 017f48cdcab9..1fcc86fa4e05 100644
> --- a/drivers/net/cris/eth_v10.c
> +++ b/drivers/net/cris/eth_v10.c
> @@ -165,8 +165,8 @@ static unsigned int network_rec_config_shadow = 0;
>   static unsigned int network_tr_ctrl_shadow = 0;
>   
>   /* Network speed indication. */
> -static DEFINE_TIMER(speed_timer, NULL, 0, 0);
> -static DEFINE_TIMER(clear_led_timer, NULL, 0, 0);
> +static DEFINE_TIMER(speed_timer, NULL);
> +static DEFINE_TIMER(clear_led_timer, NULL);
>   static int current_speed; /* Speed read from transceiver */
>   static int current_speed_selection; /* Speed selected by user */
>   static unsigned long led_next_time;
> @@ -174,7 +174,7 @@ static int led_active;
>   static int rx_queue_len;
>   
>   /* Duplex */
> -static DEFINE_TIMER(duplex_timer, NULL, 0, 0);
> +static DEFINE_TIMER(duplex_timer, NULL);
>   static int full_duplex;
>   static enum duplex current_duplex;
>   
> diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
> index 7a7c5224a336..104f71fa9c5e 100644
> --- a/drivers/net/hamradio/yam.c
> +++ b/drivers/net/hamradio/yam.c
> @@ -157,7 +157,7 @@ static struct net_device *yam_devs[NR_PORTS];
>   
>   static struct yam_mcs *yam_data;
>   
> -static DEFINE_TIMER(yam_timer, NULL, 0, 0);
> +static DEFINE_TIMER(yam_timer, NULL);
>   
>   /* --------------------------------------------------------------------- */
>   
> diff --git a/drivers/net/wireless/atmel/at76c50x-usb.c b/drivers/net/wireless/atmel/at76c50x-usb.c
> index 94bf01f8b2a8..ede89d4ffc88 100644
> --- a/drivers/net/wireless/atmel/at76c50x-usb.c
> +++ b/drivers/net/wireless/atmel/at76c50x-usb.c
> @@ -519,7 +519,7 @@ static int at76_usbdfu_download(struct usb_device *udev, u8 *buf, u32 size,
>   /* LED trigger */
>   static int tx_activity;
>   static void at76_ledtrig_tx_timerfunc(unsigned long data);
> -static DEFINE_TIMER(ledtrig_tx_timer, at76_ledtrig_tx_timerfunc, 0, 0);
> +static DEFINE_TIMER(ledtrig_tx_timer, at76_ledtrig_tx_timerfunc);
>   DEFINE_LED_TRIGGER(ledtrig_tx);
>   
>   static void at76_ledtrig_tx_timerfunc(unsigned long data)
> diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
> index 67956e24779c..b61e9becb612 100644
> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -1165,7 +1165,7 @@ static const int NUM_CTL_LABELS = (MSG_CTL_END - MSG_CTL_START + 1);
>   
>   static void read_all_doc(struct vc_data *vc);
>   static void cursor_done(u_long data);
> -static DEFINE_TIMER(cursor_timer, cursor_done, 0, 0);
> +static DEFINE_TIMER(cursor_timer, cursor_done);
>   
>   static void do_handle_shift(struct vc_data *vc, u_char value, char up_flag)
>   {
> diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
> index a1ca68c76579..6ddd3fc3f08d 100644
> --- a/drivers/staging/speakup/synth.c
> +++ b/drivers/staging/speakup/synth.c
> @@ -158,7 +158,7 @@ static void thread_wake_up(u_long data)
>   	wake_up_interruptible_all(&speakup_event);
>   }
>   
> -static DEFINE_TIMER(thread_timer, thread_wake_up, 0, 0);
> +static DEFINE_TIMER(thread_timer, thread_wake_up);
>   
>   void synth_start(void)
>   {
> diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
> index d272bc4e7fb5..dac8a1a8e4ac 100644
> --- a/drivers/tty/cyclades.c
> +++ b/drivers/tty/cyclades.c
> @@ -283,7 +283,7 @@ static void cyz_poll(unsigned long);
>   /* The Cyclades-Z polling cycle is defined by this variable */
>   static long cyz_polling_cycle = CZ_DEF_POLL;
>   
> -static DEFINE_TIMER(cyz_timerlist, cyz_poll, 0, 0);
> +static DEFINE_TIMER(cyz_timerlist, cyz_poll);
>   
>   #else				/* CONFIG_CYZ_INTR */
>   static void cyz_rx_restart(unsigned long);
> diff --git a/drivers/tty/isicom.c b/drivers/tty/isicom.c
> index 61ecdd6b2fc2..40af32108ff5 100644
> --- a/drivers/tty/isicom.c
> +++ b/drivers/tty/isicom.c
> @@ -177,7 +177,7 @@ static struct tty_driver *isicom_normal;
>   static void isicom_tx(unsigned long _data);
>   static void isicom_start(struct tty_struct *tty);
>   
> -static DEFINE_TIMER(tx, isicom_tx, 0, 0);
> +static DEFINE_TIMER(tx, isicom_tx);
>   
>   /*   baud index mappings from linux defns to isi */
>   
> diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
> index 7f3d4cb0341b..93d37655d928 100644
> --- a/drivers/tty/moxa.c
> +++ b/drivers/tty/moxa.c
> @@ -428,7 +428,7 @@ static const struct tty_port_operations moxa_port_ops = {
>   };
>   
>   static struct tty_driver *moxaDriver;
> -static DEFINE_TIMER(moxaTimer, moxa_poll, 0, 0);
> +static DEFINE_TIMER(moxaTimer, moxa_poll);
>   
>   /*
>    * HW init
> diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c
> index 20d79a6007d5..aa695fda1084 100644
> --- a/drivers/tty/rocket.c
> +++ b/drivers/tty/rocket.c
> @@ -111,7 +111,7 @@ static struct r_port *rp_table[MAX_RP_PORTS];	       /*  The main repository of
>   static unsigned int xmit_flags[NUM_BOARDS];	       /*  Bit significant, indicates port had data to transmit. */
>   						       /*  eg.  Bit 0 indicates port 0 has xmit data, ...        */
>   static atomic_t rp_num_ports_open;	               /*  Number of serial ports open                           */
> -static DEFINE_TIMER(rocket_timer, rp_do_poll, 0, 0);
> +static DEFINE_TIMER(rocket_timer, rp_do_poll);
>   
>   static unsigned long board1;	                       /* ISA addresses, retrieved from rocketport.conf          */
>   static unsigned long board2;
> diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
> index f4166263bb3a..f974d6340d04 100644
> --- a/drivers/tty/vt/keyboard.c
> +++ b/drivers/tty/vt/keyboard.c
> @@ -250,7 +250,7 @@ static void kd_nosound(unsigned long ignored)
>   	input_handler_for_each_handle(&kbd_handler, &zero, kd_sound_helper);
>   }
>   
> -static DEFINE_TIMER(kd_mksound_timer, kd_nosound, 0, 0);
> +static DEFINE_TIMER(kd_mksound_timer, kd_nosound);
>   
>   void kd_mksound(unsigned int hz, unsigned int ticks)
>   {
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index 2ebaba16f785..602d71630952 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -228,7 +228,7 @@ static int scrollback_delta;
>    */
>   int (*console_blank_hook)(int);
>   
> -static DEFINE_TIMER(console_timer, blank_screen_t, 0, 0);
> +static DEFINE_TIMER(console_timer, blank_screen_t);
>   static int blank_state;
>   static int blank_timer_expired;
>   enum {
> diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c
> index 3c1f6ac68ea9..18e896eeca62 100644
> --- a/drivers/watchdog/alim7101_wdt.c
> +++ b/drivers/watchdog/alim7101_wdt.c
> @@ -71,7 +71,7 @@ MODULE_PARM_DESC(use_gpio,
>   		"Use the gpio watchdog (required by old cobalt boards).");
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_ping);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
> index 9826b59ef734..8a616a57bb90 100644
> --- a/drivers/watchdog/machzwd.c
> +++ b/drivers/watchdog/machzwd.c
> @@ -127,7 +127,7 @@ static int zf_action = GEN_RESET;
>   static unsigned long zf_is_open;
>   static char zf_expect_close;
>   static DEFINE_SPINLOCK(zf_port_lock);
> -static DEFINE_TIMER(zf_timer, zf_ping, 0, 0);
> +static DEFINE_TIMER(zf_timer, zf_ping);
>   static unsigned long next_heartbeat;
>   
>   
> diff --git a/drivers/watchdog/mixcomwd.c b/drivers/watchdog/mixcomwd.c
> index be86ea359eee..c9e38096ea91 100644
> --- a/drivers/watchdog/mixcomwd.c
> +++ b/drivers/watchdog/mixcomwd.c
> @@ -105,7 +105,7 @@ static unsigned long mixcomwd_opened; /* long req'd for setbit --RR */
>   
>   static int watchdog_port;
>   static int mixcomwd_timer_alive;
> -static DEFINE_TIMER(mixcomwd_timer, mixcomwd_timerfun, 0, 0);
> +static DEFINE_TIMER(mixcomwd_timer, mixcomwd_timerfun);
>   static char expect_close;
>   
>   static bool nowayout = WATCHDOG_NOWAYOUT;
> diff --git a/drivers/watchdog/sbc60xxwdt.c b/drivers/watchdog/sbc60xxwdt.c
> index 2eef58a0cf05..8d589939bc84 100644
> --- a/drivers/watchdog/sbc60xxwdt.c
> +++ b/drivers/watchdog/sbc60xxwdt.c
> @@ -113,7 +113,7 @@ MODULE_PARM_DESC(nowayout,
>   				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_ping);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> diff --git a/drivers/watchdog/sc520_wdt.c b/drivers/watchdog/sc520_wdt.c
> index 1cfd3f6a13d5..3e9bbaa37bf4 100644
> --- a/drivers/watchdog/sc520_wdt.c
> +++ b/drivers/watchdog/sc520_wdt.c
> @@ -124,7 +124,7 @@ MODULE_PARM_DESC(nowayout,
>   static __u16 __iomem *wdtmrctl;
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_ping);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> diff --git a/drivers/watchdog/via_wdt.c b/drivers/watchdog/via_wdt.c
> index 5f9cbc37520d..ad3c3be13b40 100644
> --- a/drivers/watchdog/via_wdt.c
> +++ b/drivers/watchdog/via_wdt.c
> @@ -68,7 +68,7 @@ static struct resource wdt_res;
>   static void __iomem *wdt_mem;
>   static unsigned int mmio;
>   static void wdt_timer_tick(unsigned long data);
> -static DEFINE_TIMER(timer, wdt_timer_tick, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_tick);
>   					/* The timer that pings the watchdog */
>   static unsigned long next_heartbeat;	/* the next_heartbeat for the timer */
>   
> diff --git a/drivers/watchdog/w83877f_wdt.c b/drivers/watchdog/w83877f_wdt.c
> index f0483c75ed32..ba6b680af100 100644
> --- a/drivers/watchdog/w83877f_wdt.c
> +++ b/drivers/watchdog/w83877f_wdt.c
> @@ -98,7 +98,7 @@ MODULE_PARM_DESC(nowayout,
>   				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_ping);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
> index 2c6a9114d332..a8721d718186 100644
> --- a/drivers/xen/grant-table.c
> +++ b/drivers/xen/grant-table.c
> @@ -305,7 +305,7 @@ struct deferred_entry {
>   };
>   static LIST_HEAD(deferred_list);
>   static void gnttab_handle_deferred(unsigned long);
> -static DEFINE_TIMER(deferred_timer, gnttab_handle_deferred, 0, 0);
> +static DEFINE_TIMER(deferred_timer, gnttab_handle_deferred);
>   
>   static void gnttab_handle_deferred(unsigned long unused)
>   {
> diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
> index 2b21d180157c..ec7199e859d2 100644
> --- a/fs/pstore/platform.c
> +++ b/fs/pstore/platform.c
> @@ -62,7 +62,7 @@ MODULE_PARM_DESC(update_ms, "milliseconds before pstore updates its content "
>   static int pstore_new_entry;
>   
>   static void pstore_timefunc(unsigned long);
> -static DEFINE_TIMER(pstore_timer, pstore_timefunc, 0, 0);
> +static DEFINE_TIMER(pstore_timer, pstore_timefunc);
>   
>   static void pstore_dowork(struct work_struct *);
>   static DECLARE_WORK(pstore_work, pstore_dowork);
> diff --git a/include/linux/timer.h b/include/linux/timer.h
> index a33220311361..91e5a2cc81b5 100644
> --- a/include/linux/timer.h
> +++ b/include/linux/timer.h
> @@ -73,9 +73,9 @@ struct timer_list {
>   			__FILE__ ":" __stringify(__LINE__))	\
>   	}
>   
> -#define DEFINE_TIMER(_name, _function, _expires, _data)		\
> +#define DEFINE_TIMER(_name, _function)				\
>   	struct timer_list _name =				\
> -		__TIMER_INITIALIZER(_function, _expires, _data, 0)
> +		__TIMER_INITIALIZER(_function, 0, 0, 0)
>   
>   void init_timer_key(struct timer_list *timer, unsigned int flags,
>   		    const char *name, struct lock_class_key *key);
> diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
> index 061ba7eed4ed..c805e8691c22 100644
> --- a/kernel/irq/spurious.c
> +++ b/kernel/irq/spurious.c
> @@ -20,7 +20,7 @@ static int irqfixup __read_mostly;
>   
>   #define POLL_SPURIOUS_IRQ_INTERVAL (HZ/10)
>   static void poll_spurious_irqs(unsigned long dummy);
> -static DEFINE_TIMER(poll_spurious_irq_timer, poll_spurious_irqs, 0, 0);
> +static DEFINE_TIMER(poll_spurious_irq_timer, poll_spurious_irqs);
>   static int irq_poll_cpu;
>   static atomic_t irq_poll_active;
>   
> diff --git a/lib/random32.c b/lib/random32.c
> index fa594b1140e6..6e91b75c113f 100644
> --- a/lib/random32.c
> +++ b/lib/random32.c
> @@ -214,7 +214,7 @@ core_initcall(prandom_init);
>   
>   static void __prandom_timer(unsigned long dontcare);
>   
> -static DEFINE_TIMER(seed_timer, __prandom_timer, 0, 0);
> +static DEFINE_TIMER(seed_timer, __prandom_timer);
>   
>   static void __prandom_timer(unsigned long dontcare)
>   {
> diff --git a/net/atm/mpc.c b/net/atm/mpc.c
> index 5677147209e8..63138c8c2269 100644
> --- a/net/atm/mpc.c
> +++ b/net/atm/mpc.c
> @@ -121,7 +121,7 @@ static struct notifier_block mpoa_notifier = {
>   
>   struct mpoa_client *mpcs = NULL; /* FIXME */
>   static struct atm_mpoa_qos *qos_head = NULL;
> -static DEFINE_TIMER(mpc_timer, NULL, 0, 0);
> +static DEFINE_TIMER(mpc_timer, NULL);
>   
>   
>   static struct mpoa_client *find_mpc_by_itfnum(int itf)
> diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
> index 0bd3afd01dd2..6538632fbd03 100644
> --- a/net/decnet/dn_route.c
> +++ b/net/decnet/dn_route.c
> @@ -131,7 +131,7 @@ static struct dn_rt_hash_bucket *dn_rt_hash_table;
>   static unsigned int dn_rt_hash_mask;
>   
>   static struct timer_list dn_route_timer;
> -static DEFINE_TIMER(dn_rt_flush_timer, dn_run_flush, 0, 0);
> +static DEFINE_TIMER(dn_rt_flush_timer, dn_run_flush);
>   int decnet_dst_gc_interval = 2;
>   
>   static struct dst_ops dn_dst_ops = {
> diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
> index 8081bafe441b..b39d0908be2e 100644
> --- a/net/ipv6/ip6_flowlabel.c
> +++ b/net/ipv6/ip6_flowlabel.c
> @@ -47,7 +47,7 @@ static atomic_t fl_size = ATOMIC_INIT(0);
>   static struct ip6_flowlabel __rcu *fl_ht[FL_HASH_MASK+1];
>   
>   static void ip6_fl_gc(unsigned long dummy);
> -static DEFINE_TIMER(ip6_fl_gc_timer, ip6_fl_gc, 0, 0);
> +static DEFINE_TIMER(ip6_fl_gc_timer, ip6_fl_gc);
>   
>   /* FL hash table lock: it protects only of GC */
>   
> diff --git a/net/netrom/nr_loopback.c b/net/netrom/nr_loopback.c
> index 94d4e922af53..989ae647825e 100644
> --- a/net/netrom/nr_loopback.c
> +++ b/net/netrom/nr_loopback.c
> @@ -18,7 +18,7 @@
>   static void nr_loopback_timer(unsigned long);
>   
>   static struct sk_buff_head loopback_queue;
> -static DEFINE_TIMER(loopback_timer, nr_loopback_timer, 0, 0);
> +static DEFINE_TIMER(loopback_timer, nr_loopback_timer);
>   
>   void __init nr_loopback_init(void)
>   {
> diff --git a/security/keys/gc.c b/security/keys/gc.c
> index 87cb260e4890..8673f7f58ead 100644
> --- a/security/keys/gc.c
> +++ b/security/keys/gc.c
> @@ -30,7 +30,7 @@ DECLARE_WORK(key_gc_work, key_garbage_collector);
>    * Reaper for links from keyrings to dead keys.
>    */
>   static void key_gc_timer_func(unsigned long);
> -static DEFINE_TIMER(key_gc_timer, key_gc_timer_func, 0, 0);
> +static DEFINE_TIMER(key_gc_timer, key_gc_timer_func);
>   
>   static time_t key_gc_next_run = LONG_MAX;
>   static struct key_type *key_gc_dead_keytype;
> diff --git a/sound/oss/midibuf.c b/sound/oss/midibuf.c
> index 701c7625c971..1277df815d5b 100644
> --- a/sound/oss/midibuf.c
> +++ b/sound/oss/midibuf.c
> @@ -52,7 +52,7 @@ static struct midi_parms parms[MAX_MIDI_DEV];
>   static void midi_poll(unsigned long dummy);
>   
>   
> -static DEFINE_TIMER(poll_timer, midi_poll, 0, 0);
> +static DEFINE_TIMER(poll_timer, midi_poll);
>   
>   static volatile int open_devs;
>   static DEFINE_SPINLOCK(lock);
> diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
> index b70c7c8f9c5d..4391062e5cfd 100644
> --- a/sound/oss/soundcard.c
> +++ b/sound/oss/soundcard.c
> @@ -662,7 +662,7 @@ static void do_sequencer_timer(unsigned long dummy)
>   }
>   
>   
> -static DEFINE_TIMER(seq_timer, do_sequencer_timer, 0, 0);
> +static DEFINE_TIMER(seq_timer, do_sequencer_timer);
>   
>   void request_sound_timer(int count)
>   {
> diff --git a/sound/oss/sys_timer.c b/sound/oss/sys_timer.c
> index d17019d25b99..8a4b5625dba6 100644
> --- a/sound/oss/sys_timer.c
> +++ b/sound/oss/sys_timer.c
> @@ -28,7 +28,7 @@ static unsigned long prev_event_time;
>   
>   static void     poll_def_tmr(unsigned long dummy);
>   static DEFINE_SPINLOCK(lock);
> -static DEFINE_TIMER(def_tmr, poll_def_tmr, 0, 0);
> +static DEFINE_TIMER(def_tmr, poll_def_tmr);
>   
>   static unsigned long
>   tmr2ticks(int tmr_value)
> diff --git a/sound/oss/uart6850.c b/sound/oss/uart6850.c
> index eda32d7eddbd..a9d3f7568525 100644
> --- a/sound/oss/uart6850.c
> +++ b/sound/oss/uart6850.c
> @@ -78,7 +78,7 @@ static void (*midi_input_intr) (int dev, unsigned char data);
>   static void poll_uart6850(unsigned long dummy);
>   
>   
> -static DEFINE_TIMER(uart6850_timer, poll_uart6850, 0, 0);
> +static DEFINE_TIMER(uart6850_timer, poll_uart6850);
>   
>   static void uart6850_input_loop(void)
>   {
> 

^ permalink raw reply

* Re: [PATCH 10/13] timer: Remove expires and data arguments from DEFINE_TIMER
From: Guenter Roeck @ 2017-10-05  0:13 UTC (permalink / raw)
  To: Kees Cook, Thomas Gleixner
  Cc: Andrew Morton, Arnd Bergmann, Benjamin Herrenschmidt,
	Chris Metcalf, Geert Uytterhoeven, Greg Kroah-Hartman,
	Harish Patil, Heiko Carstens, James E.J. Bottomley, John Stultz,
	Julian Wiedmann, Kalle Valo, Lai Jiangshan, Len Brown,
	Manish Chopra, Mark Gross, Martin K. Petersen, Martin Schwidefsky,
	Michael Ellerman, Michael Reed, netdev, Oleg Nesterov,
	Paul Mackerras, Pavel Machek, Petr Mladek, Rafael J. Wysocki,
	Ralf Baechle, Sebastian Reichel, Stefan Richter, Stephen Boyd,
	Sudip Mukherjee, Tejun Heo, Ursula Braun, Viresh Kumar,
	Wim Van Sebroeck, linux1394-devel, linux-mips, linux-pm,
	linuxppc-dev, linux-s390, linux-scsi, linux-watchdog,
	linux-wireless, linux-kernel
In-Reply-To: <1507159627-127660-11-git-send-email-keescook@chromium.org>

On 10/04/2017 04:27 PM, Kees Cook wrote:
> Drop the arguments from the macro and adjust all callers with the
> following script:
> 
>    perl -pi -e 's/DEFINE_TIMER\((.*), 0, 0\);/DEFINE_TIMER($1);/g;' \
>      $(git grep DEFINE_TIMER | cut -d: -f1 | sort -u | grep -v timer.h)
> 
> Signed-off-by: Kees Cook <keescook@chromium.org>
> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> # for m68k parts

For watchdog:

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   arch/arm/mach-ixp4xx/dsmg600-setup.c      | 2 +-
>   arch/arm/mach-ixp4xx/nas100d-setup.c      | 2 +-
>   arch/m68k/amiga/amisound.c                | 2 +-
>   arch/m68k/mac/macboing.c                  | 2 +-
>   arch/mips/mti-malta/malta-display.c       | 2 +-
>   arch/parisc/kernel/pdc_cons.c             | 2 +-
>   arch/s390/mm/cmm.c                        | 2 +-
>   drivers/atm/idt77105.c                    | 4 ++--
>   drivers/atm/iphase.c                      | 2 +-
>   drivers/block/ataflop.c                   | 8 ++++----
>   drivers/char/dtlk.c                       | 2 +-
>   drivers/char/hangcheck-timer.c            | 2 +-
>   drivers/char/nwbutton.c                   | 2 +-
>   drivers/char/rtc.c                        | 2 +-
>   drivers/input/touchscreen/s3c2410_ts.c    | 2 +-
>   drivers/net/cris/eth_v10.c                | 6 +++---
>   drivers/net/hamradio/yam.c                | 2 +-
>   drivers/net/wireless/atmel/at76c50x-usb.c | 2 +-
>   drivers/staging/speakup/main.c            | 2 +-
>   drivers/staging/speakup/synth.c           | 2 +-
>   drivers/tty/cyclades.c                    | 2 +-
>   drivers/tty/isicom.c                      | 2 +-
>   drivers/tty/moxa.c                        | 2 +-
>   drivers/tty/rocket.c                      | 2 +-
>   drivers/tty/vt/keyboard.c                 | 2 +-
>   drivers/tty/vt/vt.c                       | 2 +-
>   drivers/watchdog/alim7101_wdt.c           | 2 +-
>   drivers/watchdog/machzwd.c                | 2 +-
>   drivers/watchdog/mixcomwd.c               | 2 +-
>   drivers/watchdog/sbc60xxwdt.c             | 2 +-
>   drivers/watchdog/sc520_wdt.c              | 2 +-
>   drivers/watchdog/via_wdt.c                | 2 +-
>   drivers/watchdog/w83877f_wdt.c            | 2 +-
>   drivers/xen/grant-table.c                 | 2 +-
>   fs/pstore/platform.c                      | 2 +-
>   include/linux/timer.h                     | 4 ++--
>   kernel/irq/spurious.c                     | 2 +-
>   lib/random32.c                            | 2 +-
>   net/atm/mpc.c                             | 2 +-
>   net/decnet/dn_route.c                     | 2 +-
>   net/ipv6/ip6_flowlabel.c                  | 2 +-
>   net/netrom/nr_loopback.c                  | 2 +-
>   security/keys/gc.c                        | 2 +-
>   sound/oss/midibuf.c                       | 2 +-
>   sound/oss/soundcard.c                     | 2 +-
>   sound/oss/sys_timer.c                     | 2 +-
>   sound/oss/uart6850.c                      | 2 +-
>   47 files changed, 54 insertions(+), 54 deletions(-)
> 
> diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c
> index b3bd0e137f6d..b3689a141ec6 100644
> --- a/arch/arm/mach-ixp4xx/dsmg600-setup.c
> +++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c
> @@ -174,7 +174,7 @@ static int power_button_countdown;
>   #define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
>   
>   static void dsmg600_power_handler(unsigned long data);
> -static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler, 0, 0);
> +static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler);
>   
>   static void dsmg600_power_handler(unsigned long data)
>   {
> diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
> index 4e0f762bc651..562d05f9888e 100644
> --- a/arch/arm/mach-ixp4xx/nas100d-setup.c
> +++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
> @@ -197,7 +197,7 @@ static int power_button_countdown;
>   #define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
>   
>   static void nas100d_power_handler(unsigned long data);
> -static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler, 0, 0);
> +static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler);
>   
>   static void nas100d_power_handler(unsigned long data)
>   {
> diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c
> index 90a60d758f8b..a23f48181fd6 100644
> --- a/arch/m68k/amiga/amisound.c
> +++ b/arch/m68k/amiga/amisound.c
> @@ -66,7 +66,7 @@ void __init amiga_init_sound(void)
>   }
>   
>   static void nosound( unsigned long ignored );
> -static DEFINE_TIMER(sound_timer, nosound, 0, 0);
> +static DEFINE_TIMER(sound_timer, nosound);
>   
>   void amiga_mksound( unsigned int hz, unsigned int ticks )
>   {
> diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c
> index ffaa1f6439ae..9a52aff183d0 100644
> --- a/arch/m68k/mac/macboing.c
> +++ b/arch/m68k/mac/macboing.c
> @@ -56,7 +56,7 @@ static void ( *mac_special_bell )( unsigned int, unsigned int, unsigned int );
>   /*
>    * our timer to start/continue/stop the bell
>    */
> -static DEFINE_TIMER(mac_sound_timer, mac_nosound, 0, 0);
> +static DEFINE_TIMER(mac_sound_timer, mac_nosound);
>   
>   /*
>    * Sort of initialize the sound chip (called from mac_mksound on the first
> diff --git a/arch/mips/mti-malta/malta-display.c b/arch/mips/mti-malta/malta-display.c
> index ac813158b9b8..063de44675ce 100644
> --- a/arch/mips/mti-malta/malta-display.c
> +++ b/arch/mips/mti-malta/malta-display.c
> @@ -37,7 +37,7 @@ void mips_display_message(const char *str)
>   }
>   
>   static void scroll_display_message(unsigned long unused);
> -static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, 0, 0);
> +static DEFINE_TIMER(mips_scroll_timer, scroll_display_message);
>   
>   static void scroll_display_message(unsigned long unused)
>   {
> diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
> index 10a5ae9553fd..27a2dd616a7d 100644
> --- a/arch/parisc/kernel/pdc_cons.c
> +++ b/arch/parisc/kernel/pdc_cons.c
> @@ -92,7 +92,7 @@ static int pdc_console_setup(struct console *co, char *options)
>   #define PDC_CONS_POLL_DELAY (30 * HZ / 1000)
>   
>   static void pdc_console_poll(unsigned long unused);
> -static DEFINE_TIMER(pdc_console_timer, pdc_console_poll, 0, 0);
> +static DEFINE_TIMER(pdc_console_timer, pdc_console_poll);
>   static struct tty_port tty_port;
>   
>   static int pdc_console_tty_open(struct tty_struct *tty, struct file *filp)
> diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
> index 829c63dbc81a..2dbdcd85b68f 100644
> --- a/arch/s390/mm/cmm.c
> +++ b/arch/s390/mm/cmm.c
> @@ -56,7 +56,7 @@ static DEFINE_SPINLOCK(cmm_lock);
>   
>   static struct task_struct *cmm_thread_ptr;
>   static DECLARE_WAIT_QUEUE_HEAD(cmm_thread_wait);
> -static DEFINE_TIMER(cmm_timer, NULL, 0, 0);
> +static DEFINE_TIMER(cmm_timer, NULL);
>   
>   static void cmm_timer_fn(unsigned long);
>   static void cmm_set_timer(void);
> diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
> index 082aa02abc57..57af9fd198e4 100644
> --- a/drivers/atm/idt77105.c
> +++ b/drivers/atm/idt77105.c
> @@ -49,8 +49,8 @@ static void idt77105_stats_timer_func(unsigned long);
>   static void idt77105_restart_timer_func(unsigned long);
>   
>   
> -static DEFINE_TIMER(stats_timer, idt77105_stats_timer_func, 0, 0);
> -static DEFINE_TIMER(restart_timer, idt77105_restart_timer_func, 0, 0);
> +static DEFINE_TIMER(stats_timer, idt77105_stats_timer_func);
> +static DEFINE_TIMER(restart_timer, idt77105_restart_timer_func);
>   static int start_timer = 1;
>   static struct idt77105_priv *idt77105_all = NULL;
>   
> diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
> index fc72b763fdd7..ad6b582c268e 100644
> --- a/drivers/atm/iphase.c
> +++ b/drivers/atm/iphase.c
> @@ -76,7 +76,7 @@ static IADEV *ia_dev[8];
>   static struct atm_dev *_ia_dev[8];
>   static int iadev_count;
>   static void ia_led_timer(unsigned long arg);
> -static DEFINE_TIMER(ia_timer, ia_led_timer, 0, 0);
> +static DEFINE_TIMER(ia_timer, ia_led_timer);
>   static int IA_TX_BUF = DFL_TX_BUFFERS, IA_TX_BUF_SZ = DFL_TX_BUF_SZ;
>   static int IA_RX_BUF = DFL_RX_BUFFERS, IA_RX_BUF_SZ = DFL_RX_BUF_SZ;
>   static uint IADebugFlag = /* IF_IADBG_ERR | IF_IADBG_CBR| IF_IADBG_INIT_ADAPTER
> diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
> index 92da886180aa..ae596e55bcb6 100644
> --- a/drivers/block/ataflop.c
> +++ b/drivers/block/ataflop.c
> @@ -373,10 +373,10 @@ static void floppy_release(struct gendisk *disk, fmode_t mode);
>   
>   /************************* End of Prototypes **************************/
>   
> -static DEFINE_TIMER(motor_off_timer, fd_motor_off_timer, 0, 0);
> -static DEFINE_TIMER(readtrack_timer, fd_readtrack_check, 0, 0);
> -static DEFINE_TIMER(timeout_timer, fd_times_out, 0, 0);
> -static DEFINE_TIMER(fd_timer, check_change, 0, 0);
> +static DEFINE_TIMER(motor_off_timer, fd_motor_off_timer);
> +static DEFINE_TIMER(readtrack_timer, fd_readtrack_check);
> +static DEFINE_TIMER(timeout_timer, fd_times_out);
> +static DEFINE_TIMER(fd_timer, check_change);
>   	
>   static void fd_end_request_cur(blk_status_t err)
>   {
> diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
> index 58471394beb9..1a0385ed6417 100644
> --- a/drivers/char/dtlk.c
> +++ b/drivers/char/dtlk.c
> @@ -84,7 +84,7 @@ static int dtlk_has_indexing;
>   static unsigned int dtlk_portlist[] =
>   {0x25e, 0x29e, 0x2de, 0x31e, 0x35e, 0x39e, 0};
>   static wait_queue_head_t dtlk_process_list;
> -static DEFINE_TIMER(dtlk_timer, dtlk_timer_tick, 0, 0);
> +static DEFINE_TIMER(dtlk_timer, dtlk_timer_tick);
>   
>   /* prototypes for file_operations struct */
>   static ssize_t dtlk_read(struct file *, char __user *,
> diff --git a/drivers/char/hangcheck-timer.c b/drivers/char/hangcheck-timer.c
> index 5406b90bf626..5b8db2ed844d 100644
> --- a/drivers/char/hangcheck-timer.c
> +++ b/drivers/char/hangcheck-timer.c
> @@ -124,7 +124,7 @@ static unsigned long long hangcheck_tsc, hangcheck_tsc_margin;
>   
>   static void hangcheck_fire(unsigned long);
>   
> -static DEFINE_TIMER(hangcheck_ticktock, hangcheck_fire, 0, 0);
> +static DEFINE_TIMER(hangcheck_ticktock, hangcheck_fire);
>   
>   static void hangcheck_fire(unsigned long data)
>   {
> diff --git a/drivers/char/nwbutton.c b/drivers/char/nwbutton.c
> index e6d0d271c58c..44006ed9558f 100644
> --- a/drivers/char/nwbutton.c
> +++ b/drivers/char/nwbutton.c
> @@ -27,7 +27,7 @@ static void button_sequence_finished (unsigned long parameters);
>   
>   static int button_press_count;		/* The count of button presses */
>   /* Times for the end of a sequence */
> -static DEFINE_TIMER(button_timer, button_sequence_finished, 0, 0);
> +static DEFINE_TIMER(button_timer, button_sequence_finished);
>   static DECLARE_WAIT_QUEUE_HEAD(button_wait_queue); /* Used for blocking read */
>   static char button_output_buffer[32];	/* Stores data to write out of device */
>   static int bcount;			/* The number of bytes in the buffer */
> diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
> index 974d48927b07..616871e68e09 100644
> --- a/drivers/char/rtc.c
> +++ b/drivers/char/rtc.c
> @@ -137,7 +137,7 @@ static DECLARE_WAIT_QUEUE_HEAD(rtc_wait);
>   #ifdef RTC_IRQ
>   static void rtc_dropped_irq(unsigned long data);
>   
> -static DEFINE_TIMER(rtc_irq_timer, rtc_dropped_irq, 0, 0);
> +static DEFINE_TIMER(rtc_irq_timer, rtc_dropped_irq);
>   #endif
>   
>   static ssize_t rtc_read(struct file *file, char __user *buf,
> diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
> index 3b3db8c868e0..d3265b6b58b8 100644
> --- a/drivers/input/touchscreen/s3c2410_ts.c
> +++ b/drivers/input/touchscreen/s3c2410_ts.c
> @@ -145,7 +145,7 @@ static void touch_timer_fire(unsigned long data)
>   	}
>   }
>   
> -static DEFINE_TIMER(touch_timer, touch_timer_fire, 0, 0);
> +static DEFINE_TIMER(touch_timer, touch_timer_fire);
>   
>   /**
>    * stylus_irq - touchscreen stylus event interrupt
> diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
> index 017f48cdcab9..1fcc86fa4e05 100644
> --- a/drivers/net/cris/eth_v10.c
> +++ b/drivers/net/cris/eth_v10.c
> @@ -165,8 +165,8 @@ static unsigned int network_rec_config_shadow = 0;
>   static unsigned int network_tr_ctrl_shadow = 0;
>   
>   /* Network speed indication. */
> -static DEFINE_TIMER(speed_timer, NULL, 0, 0);
> -static DEFINE_TIMER(clear_led_timer, NULL, 0, 0);
> +static DEFINE_TIMER(speed_timer, NULL);
> +static DEFINE_TIMER(clear_led_timer, NULL);
>   static int current_speed; /* Speed read from transceiver */
>   static int current_speed_selection; /* Speed selected by user */
>   static unsigned long led_next_time;
> @@ -174,7 +174,7 @@ static int led_active;
>   static int rx_queue_len;
>   
>   /* Duplex */
> -static DEFINE_TIMER(duplex_timer, NULL, 0, 0);
> +static DEFINE_TIMER(duplex_timer, NULL);
>   static int full_duplex;
>   static enum duplex current_duplex;
>   
> diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
> index 7a7c5224a336..104f71fa9c5e 100644
> --- a/drivers/net/hamradio/yam.c
> +++ b/drivers/net/hamradio/yam.c
> @@ -157,7 +157,7 @@ static struct net_device *yam_devs[NR_PORTS];
>   
>   static struct yam_mcs *yam_data;
>   
> -static DEFINE_TIMER(yam_timer, NULL, 0, 0);
> +static DEFINE_TIMER(yam_timer, NULL);
>   
>   /* --------------------------------------------------------------------- */
>   
> diff --git a/drivers/net/wireless/atmel/at76c50x-usb.c b/drivers/net/wireless/atmel/at76c50x-usb.c
> index 94bf01f8b2a8..ede89d4ffc88 100644
> --- a/drivers/net/wireless/atmel/at76c50x-usb.c
> +++ b/drivers/net/wireless/atmel/at76c50x-usb.c
> @@ -519,7 +519,7 @@ static int at76_usbdfu_download(struct usb_device *udev, u8 *buf, u32 size,
>   /* LED trigger */
>   static int tx_activity;
>   static void at76_ledtrig_tx_timerfunc(unsigned long data);
> -static DEFINE_TIMER(ledtrig_tx_timer, at76_ledtrig_tx_timerfunc, 0, 0);
> +static DEFINE_TIMER(ledtrig_tx_timer, at76_ledtrig_tx_timerfunc);
>   DEFINE_LED_TRIGGER(ledtrig_tx);
>   
>   static void at76_ledtrig_tx_timerfunc(unsigned long data)
> diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
> index 67956e24779c..b61e9becb612 100644
> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -1165,7 +1165,7 @@ static const int NUM_CTL_LABELS = (MSG_CTL_END - MSG_CTL_START + 1);
>   
>   static void read_all_doc(struct vc_data *vc);
>   static void cursor_done(u_long data);
> -static DEFINE_TIMER(cursor_timer, cursor_done, 0, 0);
> +static DEFINE_TIMER(cursor_timer, cursor_done);
>   
>   static void do_handle_shift(struct vc_data *vc, u_char value, char up_flag)
>   {
> diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
> index a1ca68c76579..6ddd3fc3f08d 100644
> --- a/drivers/staging/speakup/synth.c
> +++ b/drivers/staging/speakup/synth.c
> @@ -158,7 +158,7 @@ static void thread_wake_up(u_long data)
>   	wake_up_interruptible_all(&speakup_event);
>   }
>   
> -static DEFINE_TIMER(thread_timer, thread_wake_up, 0, 0);
> +static DEFINE_TIMER(thread_timer, thread_wake_up);
>   
>   void synth_start(void)
>   {
> diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
> index d272bc4e7fb5..dac8a1a8e4ac 100644
> --- a/drivers/tty/cyclades.c
> +++ b/drivers/tty/cyclades.c
> @@ -283,7 +283,7 @@ static void cyz_poll(unsigned long);
>   /* The Cyclades-Z polling cycle is defined by this variable */
>   static long cyz_polling_cycle = CZ_DEF_POLL;
>   
> -static DEFINE_TIMER(cyz_timerlist, cyz_poll, 0, 0);
> +static DEFINE_TIMER(cyz_timerlist, cyz_poll);
>   
>   #else				/* CONFIG_CYZ_INTR */
>   static void cyz_rx_restart(unsigned long);
> diff --git a/drivers/tty/isicom.c b/drivers/tty/isicom.c
> index 61ecdd6b2fc2..40af32108ff5 100644
> --- a/drivers/tty/isicom.c
> +++ b/drivers/tty/isicom.c
> @@ -177,7 +177,7 @@ static struct tty_driver *isicom_normal;
>   static void isicom_tx(unsigned long _data);
>   static void isicom_start(struct tty_struct *tty);
>   
> -static DEFINE_TIMER(tx, isicom_tx, 0, 0);
> +static DEFINE_TIMER(tx, isicom_tx);
>   
>   /*   baud index mappings from linux defns to isi */
>   
> diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
> index 7f3d4cb0341b..93d37655d928 100644
> --- a/drivers/tty/moxa.c
> +++ b/drivers/tty/moxa.c
> @@ -428,7 +428,7 @@ static const struct tty_port_operations moxa_port_ops = {
>   };
>   
>   static struct tty_driver *moxaDriver;
> -static DEFINE_TIMER(moxaTimer, moxa_poll, 0, 0);
> +static DEFINE_TIMER(moxaTimer, moxa_poll);
>   
>   /*
>    * HW init
> diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c
> index 20d79a6007d5..aa695fda1084 100644
> --- a/drivers/tty/rocket.c
> +++ b/drivers/tty/rocket.c
> @@ -111,7 +111,7 @@ static struct r_port *rp_table[MAX_RP_PORTS];	       /*  The main repository of
>   static unsigned int xmit_flags[NUM_BOARDS];	       /*  Bit significant, indicates port had data to transmit. */
>   						       /*  eg.  Bit 0 indicates port 0 has xmit data, ...        */
>   static atomic_t rp_num_ports_open;	               /*  Number of serial ports open                           */
> -static DEFINE_TIMER(rocket_timer, rp_do_poll, 0, 0);
> +static DEFINE_TIMER(rocket_timer, rp_do_poll);
>   
>   static unsigned long board1;	                       /* ISA addresses, retrieved from rocketport.conf          */
>   static unsigned long board2;
> diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
> index f4166263bb3a..f974d6340d04 100644
> --- a/drivers/tty/vt/keyboard.c
> +++ b/drivers/tty/vt/keyboard.c
> @@ -250,7 +250,7 @@ static void kd_nosound(unsigned long ignored)
>   	input_handler_for_each_handle(&kbd_handler, &zero, kd_sound_helper);
>   }
>   
> -static DEFINE_TIMER(kd_mksound_timer, kd_nosound, 0, 0);
> +static DEFINE_TIMER(kd_mksound_timer, kd_nosound);
>   
>   void kd_mksound(unsigned int hz, unsigned int ticks)
>   {
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index 2ebaba16f785..602d71630952 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -228,7 +228,7 @@ static int scrollback_delta;
>    */
>   int (*console_blank_hook)(int);
>   
> -static DEFINE_TIMER(console_timer, blank_screen_t, 0, 0);
> +static DEFINE_TIMER(console_timer, blank_screen_t);
>   static int blank_state;
>   static int blank_timer_expired;
>   enum {
> diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c
> index 3c1f6ac68ea9..18e896eeca62 100644
> --- a/drivers/watchdog/alim7101_wdt.c
> +++ b/drivers/watchdog/alim7101_wdt.c
> @@ -71,7 +71,7 @@ MODULE_PARM_DESC(use_gpio,
>   		"Use the gpio watchdog (required by old cobalt boards).");
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_ping);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
> index 9826b59ef734..8a616a57bb90 100644
> --- a/drivers/watchdog/machzwd.c
> +++ b/drivers/watchdog/machzwd.c
> @@ -127,7 +127,7 @@ static int zf_action = GEN_RESET;
>   static unsigned long zf_is_open;
>   static char zf_expect_close;
>   static DEFINE_SPINLOCK(zf_port_lock);
> -static DEFINE_TIMER(zf_timer, zf_ping, 0, 0);
> +static DEFINE_TIMER(zf_timer, zf_ping);
>   static unsigned long next_heartbeat;
>   
>   
> diff --git a/drivers/watchdog/mixcomwd.c b/drivers/watchdog/mixcomwd.c
> index be86ea359eee..c9e38096ea91 100644
> --- a/drivers/watchdog/mixcomwd.c
> +++ b/drivers/watchdog/mixcomwd.c
> @@ -105,7 +105,7 @@ static unsigned long mixcomwd_opened; /* long req'd for setbit --RR */
>   
>   static int watchdog_port;
>   static int mixcomwd_timer_alive;
> -static DEFINE_TIMER(mixcomwd_timer, mixcomwd_timerfun, 0, 0);
> +static DEFINE_TIMER(mixcomwd_timer, mixcomwd_timerfun);
>   static char expect_close;
>   
>   static bool nowayout = WATCHDOG_NOWAYOUT;
> diff --git a/drivers/watchdog/sbc60xxwdt.c b/drivers/watchdog/sbc60xxwdt.c
> index 2eef58a0cf05..8d589939bc84 100644
> --- a/drivers/watchdog/sbc60xxwdt.c
> +++ b/drivers/watchdog/sbc60xxwdt.c
> @@ -113,7 +113,7 @@ MODULE_PARM_DESC(nowayout,
>   				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_ping);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> diff --git a/drivers/watchdog/sc520_wdt.c b/drivers/watchdog/sc520_wdt.c
> index 1cfd3f6a13d5..3e9bbaa37bf4 100644
> --- a/drivers/watchdog/sc520_wdt.c
> +++ b/drivers/watchdog/sc520_wdt.c
> @@ -124,7 +124,7 @@ MODULE_PARM_DESC(nowayout,
>   static __u16 __iomem *wdtmrctl;
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_ping);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> diff --git a/drivers/watchdog/via_wdt.c b/drivers/watchdog/via_wdt.c
> index 5f9cbc37520d..ad3c3be13b40 100644
> --- a/drivers/watchdog/via_wdt.c
> +++ b/drivers/watchdog/via_wdt.c
> @@ -68,7 +68,7 @@ static struct resource wdt_res;
>   static void __iomem *wdt_mem;
>   static unsigned int mmio;
>   static void wdt_timer_tick(unsigned long data);
> -static DEFINE_TIMER(timer, wdt_timer_tick, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_tick);
>   					/* The timer that pings the watchdog */
>   static unsigned long next_heartbeat;	/* the next_heartbeat for the timer */
>   
> diff --git a/drivers/watchdog/w83877f_wdt.c b/drivers/watchdog/w83877f_wdt.c
> index f0483c75ed32..ba6b680af100 100644
> --- a/drivers/watchdog/w83877f_wdt.c
> +++ b/drivers/watchdog/w83877f_wdt.c
> @@ -98,7 +98,7 @@ MODULE_PARM_DESC(nowayout,
>   				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
>   
>   static void wdt_timer_ping(unsigned long);
> -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
> +static DEFINE_TIMER(timer, wdt_timer_ping);
>   static unsigned long next_heartbeat;
>   static unsigned long wdt_is_open;
>   static char wdt_expect_close;
> diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
> index 2c6a9114d332..a8721d718186 100644
> --- a/drivers/xen/grant-table.c
> +++ b/drivers/xen/grant-table.c
> @@ -305,7 +305,7 @@ struct deferred_entry {
>   };
>   static LIST_HEAD(deferred_list);
>   static void gnttab_handle_deferred(unsigned long);
> -static DEFINE_TIMER(deferred_timer, gnttab_handle_deferred, 0, 0);
> +static DEFINE_TIMER(deferred_timer, gnttab_handle_deferred);
>   
>   static void gnttab_handle_deferred(unsigned long unused)
>   {
> diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
> index 2b21d180157c..ec7199e859d2 100644
> --- a/fs/pstore/platform.c
> +++ b/fs/pstore/platform.c
> @@ -62,7 +62,7 @@ MODULE_PARM_DESC(update_ms, "milliseconds before pstore updates its content "
>   static int pstore_new_entry;
>   
>   static void pstore_timefunc(unsigned long);
> -static DEFINE_TIMER(pstore_timer, pstore_timefunc, 0, 0);
> +static DEFINE_TIMER(pstore_timer, pstore_timefunc);
>   
>   static void pstore_dowork(struct work_struct *);
>   static DECLARE_WORK(pstore_work, pstore_dowork);
> diff --git a/include/linux/timer.h b/include/linux/timer.h
> index a33220311361..91e5a2cc81b5 100644
> --- a/include/linux/timer.h
> +++ b/include/linux/timer.h
> @@ -73,9 +73,9 @@ struct timer_list {
>   			__FILE__ ":" __stringify(__LINE__))	\
>   	}
>   
> -#define DEFINE_TIMER(_name, _function, _expires, _data)		\
> +#define DEFINE_TIMER(_name, _function)				\
>   	struct timer_list _name =				\
> -		__TIMER_INITIALIZER(_function, _expires, _data, 0)
> +		__TIMER_INITIALIZER(_function, 0, 0, 0)
>   
>   void init_timer_key(struct timer_list *timer, unsigned int flags,
>   		    const char *name, struct lock_class_key *key);
> diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
> index 061ba7eed4ed..c805e8691c22 100644
> --- a/kernel/irq/spurious.c
> +++ b/kernel/irq/spurious.c
> @@ -20,7 +20,7 @@ static int irqfixup __read_mostly;
>   
>   #define POLL_SPURIOUS_IRQ_INTERVAL (HZ/10)
>   static void poll_spurious_irqs(unsigned long dummy);
> -static DEFINE_TIMER(poll_spurious_irq_timer, poll_spurious_irqs, 0, 0);
> +static DEFINE_TIMER(poll_spurious_irq_timer, poll_spurious_irqs);
>   static int irq_poll_cpu;
>   static atomic_t irq_poll_active;
>   
> diff --git a/lib/random32.c b/lib/random32.c
> index fa594b1140e6..6e91b75c113f 100644
> --- a/lib/random32.c
> +++ b/lib/random32.c
> @@ -214,7 +214,7 @@ core_initcall(prandom_init);
>   
>   static void __prandom_timer(unsigned long dontcare);
>   
> -static DEFINE_TIMER(seed_timer, __prandom_timer, 0, 0);
> +static DEFINE_TIMER(seed_timer, __prandom_timer);
>   
>   static void __prandom_timer(unsigned long dontcare)
>   {
> diff --git a/net/atm/mpc.c b/net/atm/mpc.c
> index 5677147209e8..63138c8c2269 100644
> --- a/net/atm/mpc.c
> +++ b/net/atm/mpc.c
> @@ -121,7 +121,7 @@ static struct notifier_block mpoa_notifier = {
>   
>   struct mpoa_client *mpcs = NULL; /* FIXME */
>   static struct atm_mpoa_qos *qos_head = NULL;
> -static DEFINE_TIMER(mpc_timer, NULL, 0, 0);
> +static DEFINE_TIMER(mpc_timer, NULL);
>   
>   
>   static struct mpoa_client *find_mpc_by_itfnum(int itf)
> diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
> index 0bd3afd01dd2..6538632fbd03 100644
> --- a/net/decnet/dn_route.c
> +++ b/net/decnet/dn_route.c
> @@ -131,7 +131,7 @@ static struct dn_rt_hash_bucket *dn_rt_hash_table;
>   static unsigned int dn_rt_hash_mask;
>   
>   static struct timer_list dn_route_timer;
> -static DEFINE_TIMER(dn_rt_flush_timer, dn_run_flush, 0, 0);
> +static DEFINE_TIMER(dn_rt_flush_timer, dn_run_flush);
>   int decnet_dst_gc_interval = 2;
>   
>   static struct dst_ops dn_dst_ops = {
> diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
> index 8081bafe441b..b39d0908be2e 100644
> --- a/net/ipv6/ip6_flowlabel.c
> +++ b/net/ipv6/ip6_flowlabel.c
> @@ -47,7 +47,7 @@ static atomic_t fl_size = ATOMIC_INIT(0);
>   static struct ip6_flowlabel __rcu *fl_ht[FL_HASH_MASK+1];
>   
>   static void ip6_fl_gc(unsigned long dummy);
> -static DEFINE_TIMER(ip6_fl_gc_timer, ip6_fl_gc, 0, 0);
> +static DEFINE_TIMER(ip6_fl_gc_timer, ip6_fl_gc);
>   
>   /* FL hash table lock: it protects only of GC */
>   
> diff --git a/net/netrom/nr_loopback.c b/net/netrom/nr_loopback.c
> index 94d4e922af53..989ae647825e 100644
> --- a/net/netrom/nr_loopback.c
> +++ b/net/netrom/nr_loopback.c
> @@ -18,7 +18,7 @@
>   static void nr_loopback_timer(unsigned long);
>   
>   static struct sk_buff_head loopback_queue;
> -static DEFINE_TIMER(loopback_timer, nr_loopback_timer, 0, 0);
> +static DEFINE_TIMER(loopback_timer, nr_loopback_timer);
>   
>   void __init nr_loopback_init(void)
>   {
> diff --git a/security/keys/gc.c b/security/keys/gc.c
> index 87cb260e4890..8673f7f58ead 100644
> --- a/security/keys/gc.c
> +++ b/security/keys/gc.c
> @@ -30,7 +30,7 @@ DECLARE_WORK(key_gc_work, key_garbage_collector);
>    * Reaper for links from keyrings to dead keys.
>    */
>   static void key_gc_timer_func(unsigned long);
> -static DEFINE_TIMER(key_gc_timer, key_gc_timer_func, 0, 0);
> +static DEFINE_TIMER(key_gc_timer, key_gc_timer_func);
>   
>   static time_t key_gc_next_run = LONG_MAX;
>   static struct key_type *key_gc_dead_keytype;
> diff --git a/sound/oss/midibuf.c b/sound/oss/midibuf.c
> index 701c7625c971..1277df815d5b 100644
> --- a/sound/oss/midibuf.c
> +++ b/sound/oss/midibuf.c
> @@ -52,7 +52,7 @@ static struct midi_parms parms[MAX_MIDI_DEV];
>   static void midi_poll(unsigned long dummy);
>   
>   
> -static DEFINE_TIMER(poll_timer, midi_poll, 0, 0);
> +static DEFINE_TIMER(poll_timer, midi_poll);
>   
>   static volatile int open_devs;
>   static DEFINE_SPINLOCK(lock);
> diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
> index b70c7c8f9c5d..4391062e5cfd 100644
> --- a/sound/oss/soundcard.c
> +++ b/sound/oss/soundcard.c
> @@ -662,7 +662,7 @@ static void do_sequencer_timer(unsigned long dummy)
>   }
>   
>   
> -static DEFINE_TIMER(seq_timer, do_sequencer_timer, 0, 0);
> +static DEFINE_TIMER(seq_timer, do_sequencer_timer);
>   
>   void request_sound_timer(int count)
>   {
> diff --git a/sound/oss/sys_timer.c b/sound/oss/sys_timer.c
> index d17019d25b99..8a4b5625dba6 100644
> --- a/sound/oss/sys_timer.c
> +++ b/sound/oss/sys_timer.c
> @@ -28,7 +28,7 @@ static unsigned long prev_event_time;
>   
>   static void     poll_def_tmr(unsigned long dummy);
>   static DEFINE_SPINLOCK(lock);
> -static DEFINE_TIMER(def_tmr, poll_def_tmr, 0, 0);
> +static DEFINE_TIMER(def_tmr, poll_def_tmr);
>   
>   static unsigned long
>   tmr2ticks(int tmr_value)
> diff --git a/sound/oss/uart6850.c b/sound/oss/uart6850.c
> index eda32d7eddbd..a9d3f7568525 100644
> --- a/sound/oss/uart6850.c
> +++ b/sound/oss/uart6850.c
> @@ -78,7 +78,7 @@ static void (*midi_input_intr) (int dev, unsigned char data);
>   static void poll_uart6850(unsigned long dummy);
>   
>   
> -static DEFINE_TIMER(uart6850_timer, poll_uart6850, 0, 0);
> +static DEFINE_TIMER(uart6850_timer, poll_uart6850);
>   
>   static void uart6850_input_loop(void)
>   {
> 

^ permalink raw reply

* [PATCH net-next] ip_gre: check packet length and mtu correctly in erspan_fb_xmit
From: William Tu @ 2017-10-05  0:14 UTC (permalink / raw)
  To: netdev; +Cc: Xin Long

Similarly to early patch for erspan_xmit(), the ARPHDR_ETHER device
is the length of the whole ether packet.  So skb->len should subtract
the dev->hard_header_len.

Fixes: 1a66a836da63 ("gre: add collect_md mode to ERSPAN tunnel")
Signed-off-by: William Tu <u9012063@gmail.com>
Cc: Xin Long <lucien.xin@gmail.com>
---
 net/ipv4/ip_gre.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index b279c325c7f6..10b21fe5b3a6 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -579,7 +579,7 @@ static void erspan_fb_xmit(struct sk_buff *skb, struct net_device *dev,
 	if (gre_handle_offloads(skb, false))
 		goto err_free_rt;
 
-	if (skb->len > dev->mtu) {
+	if (skb->len - dev->hard_header_len > dev->mtu) {
 		pskb_trim(skb, dev->mtu);
 		truncate = true;
 	}
-- 
2.7.4

^ permalink raw reply related

* Having trouble getting recipe to run in proper directory
From: Greg Wilson-Lindberg @ 2017-10-05  0:16 UTC (permalink / raw)
  To: yocto@yoctoproject.org

[-- Attachment #1: Type: text/plain, Size: 1935 bytes --]

I'm trying to create a new recipe for a package that has a version and non-numeric rev in its name (canfestival-3-asc). I've gotten bitbake to unpack the package into a tree that looks ok, but it keeps trying to run the compile at least in the wrong directory. Here is the recipe:


SUMMARY = "Independent CANOpen® stack"
DESCRIPTION = "CanFestival focuses on providing an ANSI-C platform independent \
               CANOpen® stack that can be built as master or slave nodes on PCs, \
               Real-time IPCs, and Microcontrollers."

HOMEPAGE = "http://www.canfestival.org/"

SRCREV = "895:8973dd8be7e8"

SRC_URI = "hg://bitbucket.org/Mongo;protocol=https;module=canfestival-3-asc"
SRC_URI[md5sum] = ""
SRC_URI[sha256sum] = ""

PN = "canfestival"
PV = '3'
PR = 'asc'

LICENSE = "LGPL-2"
LIC_FILES_CHKSUM = "file://COPYING;md5= \
                    file://LICENCE;md5="

inherit autotools

# Specify any options you want to pass to the configure script using EXTRA_OECONF:
EXTRA_OECONF = "-can=socket -timers=unix -SDO_MAX_SIMULTANEOUS_TRANSFERS=25 \
                -SDO_MAX_LENGTH_TRANSFER=4096 -MAX_NB_TIMER=128 -SDO_TIMEOUT_MS=1000"

PROVIDES = "canfestival"

The directory structure that bitbake builds is:


canfestival

           3-asc

                   build

                   canfestival-3           # directory that bitbake is trying to compile in

                   canfestival-3-asc       # directory that code was extracted to

                   temp


I'm not getting any errors from the configure task, but the log file looks like it is trying to run from the canfestival-3 directory, not the canfestival-3-asc. What can I do to the recipe to get the build to run in the canfestival-3-asc directory? Or, i guess, get bitbake to unpack the source into the canfestival-3, or a different directory that it will actually run the tasks in.


Regards,

Greg

[-- Attachment #2: Type: text/html, Size: 6134 bytes --]

^ permalink raw reply

* Re: Extreme time jitter with suspend/resume cycles
From: John Stultz @ 2017-10-05  0:16 UTC (permalink / raw)
  To: Gabriel Beddingfield
  Cc: LKML, Stephen Boyd, Thomas Gleixner, Alessandro Zummo,
	Alexandre Belloni, linux-rtc, Guy Erb, hharte, Miroslav Lichvar
In-Reply-To: <CAOdF7nvHfh_M3UQDYjbofNOm0-S_-LXHdmsMY7DeEwgOQCmfFA@mail.gmail.com>

On Wed, Oct 4, 2017 at 9:11 AM, Gabriel Beddingfield <gabe@nestlabs.com> wrote:
> TL;DR: the "delta_delta" hack[1 and 2] in kernel/time/timekeeping.c
> and drivers/rtc/class.c undermines the NTP system. It's not
> appropriate to use if sub-second precision is available. I've attached
> a patch to resolve this... please let me know the ways you hate it.
> :-)
>
> Hello Kernel Timekeeping Maintainers,
>
> We have been developing a device that has very a very aggressive power
> policy, doing suspend/resume cycles a few times a minute ("echo mem >
> /sys/power/state"). In doing so, we found that the system time
> experiences a lot of jitter (compared to, say, an NTP server). It was
> not uncommon for us to see time corrections of 1s to 4s on a regular
> basis. This didn't happen when the device stayed awake, only when it
> was allowed to do suspend/resume.
>
> We found that the problem is an interaction between the NTP code and
> what I call the "delta_delta hack." (see [1] and [2]) This code
> allocates a static variable in a function that contains an offset from
> the system time to the persistent/rtc clock. It uses that time to
> fudge the suspend timestamp so that on resume the sleep time will be
> compensated. It's kind of a statistical hack that assumes things will
> average out. It seems to have two main assumptions:
>
>   1. The persistent/rtc clock has only single-second precision
>   2. The system does not frequently suspend/resume.
>   3. If delta_delta is less than 2 seconds, these assumptions are "true"
>
> Because the delta_delta hack is trying to maintain an offset from the
> system time to the persistent/rtc clock, any minor NTP corrections
> that have occurred since the last suspend will be discarded. However,
> the NTP subsystem isn't notified that this is happening -- and so it
> causes some level of instability in its PLL logic.

So, on resume when we call __timekeeping_inject_sleeptime(), that uses
the TK_CLEAR_NTP which clears the NTP state (sets STA_UNSYNC, etc) .
I'm not sure how else we can notify userspace.  It may be that ntpd
doesn't expect the kernel to set things as unsynced and doesn't
recover well, but the proper fix for that probably is in userspace.

>
> This problem affects any device that does "frequent" suspend/resume
> cycles. I.e. any battery-powered "linux" device (like Android phones).

Ironically, if I recall correctly, the delta_delta "hack" originally
came from Android developers who were trying to find a solution to the
~1sec per suspend  time error that we had before.


> Many ARM systems provide a "persistent clock." Most of them are backed
> by a 32kHz clock that gives good precision and makes the delta_delta
> hack unnecessary. However, devices that only have single-second
> precision for the persistent clock and/or are forced to use the RTC
> (whose API only allows for single-second precision) -- they still need
> this hack.
>
> I've attached a patch that we developed in-house. I have a feeling you
> won't like it... since it pushes the responsibility on whoever
> configures the kernel. It also ignores the RTC problem (which will
> still affect a lot of battery-powered devices).
>
> Please let me know what you think -- and what the right approach for
> solving this would be.

So I suspect the best solution for you here is: provide some
infrastructure so clocksources that set CLOCK_SOURCE_SUSPEND_NONSTOP
which are not the current clocksource can be used for suspend timing.

We should also figure out how to best handle ntpd in userspace dealing
with frequent suspend/resume cycles. This is problematic, as the
closest analogy is trying driving on the road while frequently falling
asleep.  This is not something I think ntpd handles well.  I suspect
our options are that any ntp adjustments being made might be made for
far too long (causing potentially massive over-correction) or not at
all, and not at all seems slightly better in my mind.

Miroslav may have other thoughts?

thanks
-john

^ permalink raw reply

* Re: [PATCH v4 0/5] net/mlx5 multi-process support
From: Ferruh Yigit @ 2017-10-05  0:17 UTC (permalink / raw)
  To: Xueming Li, Nelio Laranjeiro, Adrien Mazarguil; +Cc: dev
In-Reply-To: <1505831512-127244-1-git-send-email-xuemingl@mellanox.com>

On 9/19/2017 3:31 PM, Xueming Li wrote:
> This patchset enhances Mellanox multi-process by supporting all multi-process
> examples, also support reading ethdev (x)stats in secondary process.
> 
> Start from V2, this patchset depends on upstream rdma-core enhancement
> and l2fork example bug fix:
> http://www.dpdk.org/ml/archives/dev/2017-August/073405.html
> http://www.dpdk.org/ml/archives/dev/2017-September/075568.html
> 
> V4:
> * remove forked secondary mode
> 
> V3:
> * add cover letter
> * add dependency notes
> 
> V2:
> * split into multiple patches
> * support forked secondary process
> * add secondary process ethdev operations
> * rebase on latest rdma-core upstream api
> 
> 
> Xueming Li (5):
>   net/mlx5: change eth device reference for secondary process
>   net/mlx5: install a socket to exchange a file descriptor
>   net/mlx5: allocate verbs object into shared memory
>   net/mlx5: add operations for secondary process
>   net/mlx5: multi-process document update

Hi Xueming,

I guess all dependent patches merged into next-net for this patchset, so
can get this one.

But this is causing merge conflicts on latest next-net, can you please
re-base patchset and sent a new version?

Thanks,
ferruh

^ permalink raw reply

* Re: Extreme time jitter with suspend/resume cycles
From: John Stultz @ 2017-10-05  0:20 UTC (permalink / raw)
  To: Gabriel Beddingfield
  Cc: Thomas Gleixner, LKML, Stephen Boyd, Alessandro Zummo,
	Alexandre Belloni, linux-rtc, Guy Erb, hharte
In-Reply-To: <CAOdF7ntda5TuCDBUTsuPZ0TCofo-GVfBmrGVyPk-hqGgHEkBQw@mail.gmail.com>

On Wed, Oct 4, 2017 at 4:10 PM, Gabriel Beddingfield <gabe@nestlabs.com> wrote:
> Hi Thomas,
>
> Thanks for your reply!
>
> On Wed, Oct 4, 2017 at 11:22 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>> Calling things a hack which might have been thought out carefully does not
>> make people more receptive.
>
> My bad... sorry! You're right. The code in question is better than a "hack."
>
>>> Many ARM systems provide a "persistent clock." Most of them are backed
>>> by a 32kHz clock that gives good precision and makes the delta_delta
>>> hack unnecessary. However, devices that only have single-second
>>> precision for the persistent clock and/or are forced to use the RTC
>>> (whose API only allows for single-second precision) -- they still need
>>> this hack.
>>
>> I have no idea what you are trying to tell me. We know that there are
>> systems which have a clocksource which continues to tick across
>> suspend/resume.
>
> I'm referring to read_persistent_clock64() API... which is distinct from the
> CLOCK_SOURCE_SUSPEND_NONSTOP flag.
>
>> Such clocksources can be flagged with CLOCK_SOURCE_SUSPEND_NONSTOP and the
>> timekeeping resume code uses them when available instead of using the
>> RTC. There are a few of them flagged as such in the kernel, but it might
> ...
>> It's neither a problem of the timekeeping core code to select the
>> appropriate clocksource for a system. That's up to the developer who
>> implemented the SoC/CPU support and made a decision about rating the
>> clocksource(s), which might end up selecting one which stops in suspend.
>
> This was our first approach. However, because of some hardware
> limitations we couldn't
> move the system's monotonic clock to the persistent clock. They had to
> be two different
> clocks. (Details below.)
>
>> Without looking at what it does, I can tell you that making it a config
>> option is not going to fly. It has to be runtime discoverable as we have to
>> support multi platform kernels.
>
> OK. Here's a couple ideas...
>
> APPROACH ONE: Use a heuristic
>
> If read_persistent_clock64() ever returns fractional seconds (as
> apposed to whole seconds), then
> permanently disable the compensation.


This seems reasonable to me as well.

>> Though I still want to know exactly why you think that you need some extra
>> magic in the timekeeping core code. If your system has a clocksource which
>> is not stopping on suspend and it lacks the flag, then this is a one liner
>> patch. If there is something else, then please elaborate.
>
> Long story short: you can't always have your low-power clock be your
> monotonic/sched
> clock.
>
> The SoC we use backs the monotonic clock (sched_clock_register()) with
> a counter that is
> high frequency (>10 MHz) in their reference implementation. But it
> does not count when the
> system is in low-power mode. However, it can be configured to use a
> 32kHz clock that *does*
> count when the system is in low-power mode. So, we started by using
> this clock and setting the
> CLOCK_SOURCE_SUSPEND_NONSTOP flag. It worked great... at first.
>
> Then we found that devices would randomly experience a 36-hour time jump.
> While we don't have a definitive root cause, the current theory is
> that we are getting
> non-atomic reads because the clock source isn't synchronized with the
> the high frequency
> clock (which is used for most of the digital logic on the SoC).
>
> Therefore, we moved the monotonic/sched clock back to the high-frequency source.
>
> Meanwhile, we can directly read the RTC clock on this system, and it
> will give us 32kHz
> resolution and also runs non-stop. Since reads are non-atomic, we have
> to read the
> registers in a loop. We used this register to implement
> read_persistent_clock64().
> Because we have to read the registers in a loop, it seemed unfit for use as the
> monotonic/sched clock.

Yea. I thought arm devices often had read_persistent_clock64() backed
by the 32k timer (which is poor for time initialization but works well
for suspend timing).

Maybe I misunderstood on the first read. Is it then that the
relatively fine-grained read_persistent_clock64() is colliding with
the delta_delta logic that assumes we get coarse 1sec resolution? In
that case the huristic above seems sane.

thanks
-john

^ permalink raw reply

* Re: RISC-V Linux Port v9
From: Palmer Dabbelt @ 2017-10-05  0:21 UTC (permalink / raw)
  To: Arnd Bergmann, sfr-3FnU+UHB4dNDw9hX6IcOSA, Olof Johansson
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	patches-q3qR2WxjNRFS9aJRtSZj7A, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	mark.rutland-5wv7dgnIgG8, albert-SpMDHPYPyPbQT0dZR+AlfA,
	yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A, mmarek-IBi9RG/b67k,
	will.deacon-5wv7dgnIgG8, peterz-wEGCiKHe2LqWVfeAwA7xHQ,
	boqun.feng-Re5JQEeQqe8AvxtiuMwx3w, oleg-H+wXaHxf7aLQT0dZR+AlfA,
	mingo-H+wXaHxf7aLQT0dZR+AlfA, devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <CAK8P3a1ROLHHY9HE0LtPywhTMqBaHjp8kd4ZVBr3iWTyveBh9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, 26 Sep 2017 23:08:02 PDT (-0700), Arnd Bergmann wrote:
> On Tue, Sep 26, 2017 at 6:56 PM, Palmer Dabbelt <palmer-96lFi9zoCfxBDgjK7y7TUQ@public.gmane.org> wrote:
>> As per suggestions on our v8 patch set, I've split the core architecture code
>> out from our drivers and would like to submit this patch set to be included
>> into linux-next, with the goal being to be merged in during the next merge
>> window.  This patch set is based on 4.14-rc2, but if it's better to have it
>> based on something else then I can change it around.
>
> -rc2 is good, just don't rebase it any more. I'd suggest that at the point this
> becomes part of linux-next, you stop modifying the patches further and
> move to adding any additional changes as patches on top.

Sounds good.  I've gotten a kernel.org account now, so I've gone ahead and
signed a "for-linux-next" tag that contains this patch set.  I'm going to treat
what's here as an official pull request into linux-next and therefor I won't be
rewriting history any more.  If I understand everything correctly, once I'm in
linux-next I'm meant to update that tag with commits that are ready to go?

Is there anything further I should do in order to get that tag merged into
linux-next?

>>  * I cleaned up the defconfigs -- there's actually now just one, and it's
>>    empty.  For now I think we're OK with what the kernel sets as defaults, but
>>    I anticipate we'll begin to expand this as people start to use the port
>>    more.
>
> The kernel defaults are not really as sensible as one would hope. Maybe
> go through your previous defconfig once more and pick up the items that
> made sense.

I was a bit surprised at the defaults: for example, I'd expect things like
CONFIG_PCI and CONFIG_NET to be enabled by default.  I guess I just assumed
that since technically we have a working kernel without those that it was fine
to just stick with the defaults.  Looking at our old defconfig, I'd pick

  CONFIG_PCI=y
  CONFIG_NAMESPACES=y
  CONFIG_NET=y
  CONFIG_UNIX=y
  CONFIG_INET=y
  CONFIG_DEVTMPFS=y
  CONFIG_EXT2_FS=y
  CONFIG_TMPFS=y

does that seem reasonable?
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: RISC-V Linux Port v9
From: Palmer Dabbelt @ 2017-10-05  0:21 UTC (permalink / raw)
  To: Arnd Bergmann, sfr, Olof Johansson
  Cc: linux-kernel, patches, robh+dt, mark.rutland, albert,
	yamada.masahiro, mmarek, will.deacon, peterz, boqun.feng, oleg,
	mingo, devicetree
In-Reply-To: <CAK8P3a1ROLHHY9HE0LtPywhTMqBaHjp8kd4ZVBr3iWTyveBh9A@mail.gmail.com>

On Tue, 26 Sep 2017 23:08:02 PDT (-0700), Arnd Bergmann wrote:
> On Tue, Sep 26, 2017 at 6:56 PM, Palmer Dabbelt <palmer@dabbelt.com> wrote:
>> As per suggestions on our v8 patch set, I've split the core architecture code
>> out from our drivers and would like to submit this patch set to be included
>> into linux-next, with the goal being to be merged in during the next merge
>> window.  This patch set is based on 4.14-rc2, but if it's better to have it
>> based on something else then I can change it around.
>
> -rc2 is good, just don't rebase it any more. I'd suggest that at the point this
> becomes part of linux-next, you stop modifying the patches further and
> move to adding any additional changes as patches on top.

Sounds good.  I've gotten a kernel.org account now, so I've gone ahead and
signed a "for-linux-next" tag that contains this patch set.  I'm going to treat
what's here as an official pull request into linux-next and therefor I won't be
rewriting history any more.  If I understand everything correctly, once I'm in
linux-next I'm meant to update that tag with commits that are ready to go?

Is there anything further I should do in order to get that tag merged into
linux-next?

>>  * I cleaned up the defconfigs -- there's actually now just one, and it's
>>    empty.  For now I think we're OK with what the kernel sets as defaults, but
>>    I anticipate we'll begin to expand this as people start to use the port
>>    more.
>
> The kernel defaults are not really as sensible as one would hope. Maybe
> go through your previous defconfig once more and pick up the items that
> made sense.

I was a bit surprised at the defaults: for example, I'd expect things like
CONFIG_PCI and CONFIG_NET to be enabled by default.  I guess I just assumed
that since technically we have a working kernel without those that it was fine
to just stick with the defaults.  Looking at our old defconfig, I'd pick

  CONFIG_PCI=y
  CONFIG_NAMESPACES=y
  CONFIG_NET=y
  CONFIG_UNIX=y
  CONFIG_INET=y
  CONFIG_DEVTMPFS=y
  CONFIG_EXT2_FS=y
  CONFIG_TMPFS=y

does that seem reasonable?

^ permalink raw reply

* Re: [PATCH v2] net/sfc: add device state check to reta update operation
From: Ferruh Yigit @ 2017-10-05  0:23 UTC (permalink / raw)
  To: Andrew Rybchenko, dev; +Cc: Ivan Malov, stable
In-Reply-To: <1507102466-16386-1-git-send-email-arybchenko@solarflare.com>

On 10/4/2017 8:34 AM, Andrew Rybchenko wrote:
> From: Ivan Malov <ivan.malov@oktetlabs.ru>
> 
> The callback must not attempt to program RSS table to the HW
> in non-started state; the new table must be remembered and
> applied on the next start
> 
> Fixes: 32bcfb0a50b1 ("net/sfc: update RSS redirection table")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Reviewed-by: Andy Moreton <amoreton@solarflare.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply

* Re: [PATCH v5 2/5] drm/i915/guc : Removing i915_modparams.enable_guc_loading module
From: Sujaritha @ 2017-10-05  0:26 UTC (permalink / raw)
  To: Sagar Arun Kamble, intel-gfx
In-Reply-To: <16be1dd0-7030-bb8f-bd71-529c9d72788c@intel.com>



On 10/03/2017 11:45 PM, Sagar Arun Kamble wrote:
>
> Subject is missing "parameter" in the end. Either keep module 
> parameter or i915_modparams.
Will fix the subject line.
>
>
> On 10/4/2017 4:26 AM, Sujaritha Sundaresan wrote:
>> We currently have two module parameters that control GuC: 
>> "enable_guc_loading" and "enable_guc_submission".
>> Whenever we need i915_modparams.enable_guc_submission=1, we also need 
>> enable_guc_loading=1.
>> We also need enable_guc_loading=1 when we want to verify the HuC,
>> which is every time we have a HuC (but all platforms with HuC have a 
>> GuC and viceversa).
>>
>> v2: Clarifying the commit message (Anusha)
>>
>> v3: Unify seq_puts messages, Re-factoring code as per review (Michal)
>>
>> v4: Rebase
>>
>> v5: Separating message unification into a separate patch
>>
>> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
>> Cc: Oscar Mateo <oscar.mateo@intel.com>
>> Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
>> Signed-off-by: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>
> Need to change the order of the tag to comply with new convention. 
> Applies to all patches.
> should be as below as per chronology
> S-o-b:
> Cc:
> R-b:
>> ---
>>   drivers/gpu/drm/i915/i915_debugfs.c     | 11 +++++--
>>   drivers/gpu/drm/i915/i915_drv.h         |  9 ++++--
>>   drivers/gpu/drm/i915/i915_gem_context.c |  2 +-
>>   drivers/gpu/drm/i915/i915_gem_gtt.c     |  2 +-
>>   drivers/gpu/drm/i915/i915_irq.c         |  2 +-
>>   drivers/gpu/drm/i915/i915_params.c      |  5 ----
>>   drivers/gpu/drm/i915/i915_params.h      |  1 -
>>   drivers/gpu/drm/i915/intel_guc_loader.c |  7 +++--
>>   drivers/gpu/drm/i915/intel_huc.c        |  4 ++-
>>   drivers/gpu/drm/i915/intel_uc.c         | 51 
>> +++++++++++++++++----------------
>>   drivers/gpu/drm/i915/intel_uc.h         |  2 +-
>>   drivers/gpu/drm/i915/intel_uncore.c     |  4 +--
>>   12 files changed, 52 insertions(+), 48 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
>> b/drivers/gpu/drm/i915/i915_debugfs.c
>> index 53e40dd..4fde4b2 100644
>> --- a/drivers/gpu/drm/i915/i915_debugfs.c
>> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
>> @@ -2336,8 +2336,10 @@ static int i915_huc_load_status_info(struct 
>> seq_file *m, void *data)
>>       struct drm_i915_private *dev_priv = node_to_i915(m->private);
>>       struct intel_uc_fw *huc_fw = &dev_priv->huc.fw;
>>   -    if (!HAS_HUC_UCODE(dev_priv))
>> +    if (!HAS_GUC(dev_priv)){
>> +        seq_puts(m, "not supported\n");
>>           return 0;
>> +    }
>>         seq_puts(m, "HuC firmware status:\n");
>>       seq_printf(m, "\tpath: %s\n", huc_fw->path);
>> @@ -2369,8 +2371,11 @@ static int i915_guc_load_status_info(struct 
>> seq_file *m, void *data)
>>       struct intel_uc_fw *guc_fw = &dev_priv->guc.fw;
>>       u32 tmp, i;
>>   -    if (!HAS_GUC_UCODE(dev_priv))
>> +    if (!HAS_GUC(dev_priv)){
>> +        seq_puts(m, "not supported\n");
>>           return 0;
>> +
>> +    }
>>         seq_printf(m, "GuC firmware status:\n");
>>       seq_printf(m, "\tpath: %s\n",
>> @@ -2465,7 +2470,7 @@ static bool check_guc_submission(struct 
>> seq_file *m)
>>         if (!guc->execbuf_client) {
>>           seq_printf(m, "GuC submission %s\n",
>> -               HAS_GUC_SCHED(dev_priv) ?
>> +               HAS_GUC(dev_priv) ?
>>                  "disabled" :
>>                  "not supported");
>>           return false;
>> diff --git a/drivers/gpu/drm/i915/i915_drv.h 
>> b/drivers/gpu/drm/i915/i915_drv.h
>> index 61a4be9..6479b72 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.h
>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>> @@ -3141,9 +3141,12 @@ static inline unsigned int 
>> i915_sg_segment_size(void)
>>    */
>>   #define HAS_GUC(dev_priv)    ((dev_priv)->info.has_guc)
>>   #define HAS_GUC_CT(dev_priv) ((dev_priv)->info.has_guc_ct)
>> -#define HAS_GUC_UCODE(dev_priv)    (HAS_GUC(dev_priv))
>> -#define HAS_GUC_SCHED(dev_priv)    (HAS_GUC(dev_priv))
>> -#define HAS_HUC_UCODE(dev_priv)    (HAS_GUC(dev_priv))
>> +#define HAS_GUC_UCODE(dev_priv)    ((dev_priv)->guc.fw.path != NULL)
>> +#define HAS_HUC_UCODE(dev_priv)    ((dev_priv)->guc.fw.path != NULL)
> Is this typo? Should be (dev_priv)->huc.fw.path

Yes this is a typo, I will fix this in the revision.
>> +
>> +#define NEEDS_GUC_LOADING(dev_priv) \
>> +    (HAS_GUC(dev_priv) && \
>> +    (i915_modparams.enable_guc_submission || HAS_HUC_UCODE(dev_priv)))
>>     #define HAS_RESOURCE_STREAMER(dev_priv) 
>> ((dev_priv)->info.has_resource_streamer)
>>   diff --git a/drivers/gpu/drm/i915/i915_gem_context.c 
>> b/drivers/gpu/drm/i915/i915_gem_context.c
>> index 921ee36..0890341 100644
>> --- a/drivers/gpu/drm/i915/i915_gem_context.c
>> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
>> @@ -314,7 +314,7 @@ static u32 default_desc_template(const struct 
>> drm_i915_private *i915,
>>        * present or not in use we still need a small bias as ring 
>> wraparound
>>        * at offset 0 sometimes hangs. No idea why.
>>        */
>> -    if (HAS_GUC(dev_priv) && i915_modparams.enable_guc_loading)
>> +    if (NEEDS_GUC_LOADING(dev_priv))
>>           ctx->ggtt_offset_bias = GUC_WOPCM_TOP;
>>       else
>>           ctx->ggtt_offset_bias = I915_GTT_PAGE_SIZE;
>> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c 
>> b/drivers/gpu/drm/i915/i915_gem_gtt.c
>> index 64d7852..a32935a 100644
>> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
>> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
>> @@ -3292,7 +3292,7 @@ int i915_ggtt_probe_hw(struct drm_i915_private 
>> *dev_priv)
>>        * currently don't have any bits spare to pass in this upper
>>        * restriction!
>>        */
>> -    if (HAS_GUC(dev_priv) && i915_modparams.enable_guc_loading) {
>> +    if (NEEDS_GUC_LOADING(dev_priv)) {
>>           ggtt->base.total = min_t(u64, ggtt->base.total, GUC_GGTT_TOP);
>>           ggtt->mappable_end = min(ggtt->mappable_end, 
>> ggtt->base.total);
>>       }
>> diff --git a/drivers/gpu/drm/i915/i915_irq.c 
>> b/drivers/gpu/drm/i915/i915_irq.c
>> index 6a07ef3..60cdf0d 100644
>> --- a/drivers/gpu/drm/i915/i915_irq.c
>> +++ b/drivers/gpu/drm/i915/i915_irq.c
>> @@ -3956,7 +3956,7 @@ void intel_irq_init(struct drm_i915_private 
>> *dev_priv)
>>       for (i = 0; i < MAX_L3_SLICES; ++i)
>>           dev_priv->l3_parity.remap_info[i] = NULL;
>>   -    if (HAS_GUC_SCHED(dev_priv))
>> +    if (NEEDS_GUC_LOADING(dev_priv))
>>           dev_priv->pm_guc_events = GEN9_GUC_TO_HOST_INT_EVENT;
>>         /* Let's track the enabled rps events */
>> diff --git a/drivers/gpu/drm/i915/i915_params.c 
>> b/drivers/gpu/drm/i915/i915_params.c
>> index ec65341..30344e1 100644
>> --- a/drivers/gpu/drm/i915/i915_params.c
>> +++ b/drivers/gpu/drm/i915/i915_params.c
>> @@ -63,7 +63,6 @@ struct i915_params i915_modparams __read_mostly = {
>>       .verbose_state_checks = 1,
>>       .nuclear_pageflip = 0,
>>       .edp_vswing = 0,
>> -    .enable_guc_loading = 0,
>>       .enable_guc_submission = 0,
>>       .guc_log_level = -1,
>>       .guc_firmware_path = NULL,
>> @@ -201,10 +200,6 @@ struct i915_params i915_modparams __read_mostly = {
>>       "(0=use value from vbt [default], 1=low power swing(200mV),"
>>       "2=default swing(400mV))");
>>   -i915_param_named_unsafe(enable_guc_loading, int, 0400,
>> -    "Enable GuC firmware loading "
>> -    "(-1=auto, 0=never [default], 1=if available, 2=required)");
>> -
>>   i915_param_named_unsafe(enable_guc_submission, int, 0400,
>>       "Enable GuC submission "
>>       "(-1=auto, 0=never [default], 1=if available, 2=required)");
>> diff --git a/drivers/gpu/drm/i915/i915_params.h 
>> b/drivers/gpu/drm/i915/i915_params.h
>> index a2cbb47..b26df06 100644
>> --- a/drivers/gpu/drm/i915/i915_params.h
>> +++ b/drivers/gpu/drm/i915/i915_params.h
>> @@ -44,7 +44,6 @@
>>       func(int, disable_power_well); \
>>       func(int, enable_ips); \
>>       func(int, invert_brightness); \
>> -    func(int, enable_guc_loading); \
>>       func(int, enable_guc_submission); \
>>       func(int, guc_log_level); \
>>       func(char *, guc_firmware_path); \
>> diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c 
>> b/drivers/gpu/drm/i915/intel_guc_loader.c
>> index c9e25be..4210680 100644
>> --- a/drivers/gpu/drm/i915/intel_guc_loader.c
>> +++ b/drivers/gpu/drm/i915/intel_guc_loader.c
>> @@ -382,7 +382,7 @@ int intel_guc_init_hw(struct intel_guc *guc)
>>    *
>>    * Return: zero when we know firmware, non-zero in other case
> Need to update the comment.
Will do.
>>    */
>> -int intel_guc_select_fw(struct intel_guc *guc)
>> +void intel_guc_select_fw(struct intel_guc *guc)
>>   {
>>       struct drm_i915_private *dev_priv = guc_to_i915(guc);
>>   @@ -412,8 +412,9 @@ int intel_guc_select_fw(struct intel_guc *guc)
>>           guc->fw.major_ver_wanted = GLK_FW_MAJOR;
>>           guc->fw.minor_ver_wanted = GLK_FW_MINOR;
>>       } else {
>> -        DRM_ERROR("No GuC firmware known for platform with GuC!\n");
>> -        return -ENOENT;
>> +        if(HAS_GUC(dev_priv))
>> +            DRM_ERROR("NO GUC FW konown for a platform with GuC!\n");
>> +        return;
>>       }
>>         return 0;
> returning value is not correct

Will fix the return value in the revised patch.
>> diff --git a/drivers/gpu/drm/i915/intel_huc.c 
>> b/drivers/gpu/drm/i915/intel_huc.c
>> index 6e1779b..ee9e786 100644
>> --- a/drivers/gpu/drm/i915/intel_huc.c
>> +++ b/drivers/gpu/drm/i915/intel_huc.c
>> @@ -176,7 +176,9 @@ void intel_huc_select_fw(struct intel_huc *huc)
>>           huc->fw.major_ver_wanted = GLK_HUC_FW_MAJOR;
>>           huc->fw.minor_ver_wanted = GLK_HUC_FW_MINOR;
>>       } else {
>> -        DRM_ERROR("No HuC firmware known for platform with HuC!\n");
>> +        /* For now, everything with a GuC also has a HuC */
>> +        if (HAS_GUC(dev_priv))
>> +            DRM_ERROR("No HuC FW known for a platform with HuC!\n");
>>           return;
>>       }
>>   }
>> diff --git a/drivers/gpu/drm/i915/intel_uc.c 
>> b/drivers/gpu/drm/i915/intel_uc.c
>> index 9018540..4290b35 100644
>> --- a/drivers/gpu/drm/i915/intel_uc.c
>> +++ b/drivers/gpu/drm/i915/intel_uc.c
>> @@ -63,35 +63,31 @@ static int __intel_uc_reset_hw(struct 
>> drm_i915_private *dev_priv)
>>   void intel_uc_sanitize_options(struct drm_i915_private *dev_priv)
>>   {
>>       if (!HAS_GUC(dev_priv)) {
>> -        if (i915_modparams.enable_guc_loading > 0 ||
>> -            i915_modparams.enable_guc_submission > 0)
>> +        if (i915_modparams.enable_guc_submission > 0)
>>               DRM_INFO("Ignoring GuC options, no hardware\n");
>>   -        i915_modparams.enable_guc_loading = 0;
>>           i915_modparams.enable_guc_submission = 0;
>>           return;
>>       }
>>   -    /* A negative value means "use platform default" */
>> -    if (i915_modparams.enable_guc_loading < 0)
>> -        i915_modparams.enable_guc_loading = HAS_GUC_UCODE(dev_priv);
>>         /* Verify firmware version */
>> -    if (i915_modparams.enable_guc_loading) {
>> -        if (HAS_HUC_UCODE(dev_priv))
>> -            intel_huc_select_fw(&dev_priv->huc);
>> -
>> -        if (intel_guc_select_fw(&dev_priv->guc))
>> -            i915_modparams.enable_guc_loading = 0;
>> +    if (!HAS_GUC(dev_priv)){
>> +        if (i915_modparams.enable_guc_submission > 0){
>> +            DRM_INFO("Ignoring GuC submission enable enable, no FW\n");
>> +            i915_modparams.enable_guc_submission = 0;
>> +            return;
>> +        }
>>       }
> This is same !HAS_GUC check as the one at the beginning of the function.
Will fix this error.
>>         /* Can't enable guc submission without guc loaded */
> Remove this comment.

Will do
>> -    if (!i915_modparams.enable_guc_loading)
>> +    if (!i915_modparams.enable_guc_submission < 0)
> This is incorrect. Add ( braces to specify correct condition. Also 
> missing { } till return.
>> i915_modparams.enable_guc_submission = 0;
>> +    return;
>>         /* A negative value means "use platform default" */
>>       if (i915_modparams.enable_guc_submission < 0)
>> -        i915_modparams.enable_guc_submission = HAS_GUC_SCHED(dev_priv);
>> +        i915_modparams.enable_guc_submission = 1;
> This is wrong. This should be HAS_GUC.

Will fix this.
>>   }
>>     static void gen8_guc_raise_irq(struct intel_guc *guc)
>> @@ -106,6 +102,8 @@ void intel_uc_init_early(struct drm_i915_private 
>> *dev_priv)
>>       struct intel_guc *guc = &dev_priv->guc;
>>         intel_guc_ct_init_early(&guc->ct);
>> +    intel_guc_select_fw(&dev_priv->guc);
>> +    intel_huc_select_fw(&dev_priv->huc);
> Need to rebase these w.r.t Michal's latest GuC code reorg series - 
> https://patchwork.freedesktop.org/series/31340/

Will rebase the revised patches.
>> mutex_init(&guc->send_mutex);
>>       guc->send = intel_guc_send_nop;
>> @@ -258,6 +256,8 @@ void intel_uc_init_fw(struct drm_i915_private 
>> *dev_priv)
>>     void intel_uc_fini_fw(struct drm_i915_private *dev_priv)
>>   {
>> +    if (!HAS_GUC(dev_priv))
>> +        return;
>>       __intel_uc_fw_fini(&dev_priv->guc.fw);
>>       __intel_uc_fw_fini(&dev_priv->huc.fw);
>>   }
>> @@ -333,7 +333,7 @@ int intel_uc_init_hw(struct drm_i915_private 
>> *dev_priv)
>>       struct intel_guc *guc = &dev_priv->guc;
>>       int ret, attempts;
>>   -    if (!i915_modparams.enable_guc_loading)
>> +    if (!NEEDS_GUC_LOADING(dev_priv))
>>           return 0;
>>         guc_disable_communication(guc);
>> @@ -423,19 +423,20 @@ int intel_uc_init_hw(struct drm_i915_private 
>> *dev_priv)
>>       i915_ggtt_disable_guc(dev_priv);
>>         DRM_ERROR("GuC init failed\n");
>> -    if (i915_modparams.enable_guc_loading > 1 ||
>> -        i915_modparams.enable_guc_submission > 1)
>> +    if (i915_modparams.enable_guc_submission > 1){
>> +        DRM_NOTE("GuC is required, so marking the GPU as wedged\n");
>>           ret = -EIO;
>> -    else
>> -        ret = 0;
>> +
>> +    }
>>   -    if (i915_modparams.enable_guc_submission) {
>> -        i915_modparams.enable_guc_submission = 0;
>> -        DRM_NOTE("Falling back from GuC submission to execlist 
>> mode\n");
>> +    else if (i915_modparams.enable_guc_submission == 1){
>> +            DRM_NOTE("Falling back from GuC submission to execlist 
>> mode\n");
>> +            i915_modparams.enable_guc_submission = 0;
>> +            ret = 0;
>>       }
>>   -    i915_modparams.enable_guc_loading = 0;
>> -    DRM_NOTE("GuC firmware loading disabled\n");
>> +    else
>> +        ret = 0;
>>         return ret;
>>   }
>> @@ -444,7 +445,7 @@ void intel_uc_fini_hw(struct drm_i915_private 
>> *dev_priv)
>>   {
>>       guc_free_load_err_log(&dev_priv->guc);
>>   -    if (!i915_modparams.enable_guc_loading)
>> +    if (!NEEDS_GUC_LOADING(dev_priv))
>>           return;
>>         if (i915_modparams.enable_guc_submission)
>> diff --git a/drivers/gpu/drm/i915/intel_uc.h 
>> b/drivers/gpu/drm/i915/intel_uc.h
>> index 7703c9a..58d787e 100644
>> --- a/drivers/gpu/drm/i915/intel_uc.h
>> +++ b/drivers/gpu/drm/i915/intel_uc.h
>> @@ -223,7 +223,7 @@ static inline void intel_guc_notify(struct 
>> intel_guc *guc)
>>   }
>>     /* intel_guc_loader.c */
>> -int intel_guc_select_fw(struct intel_guc *guc);
>> +void intel_guc_select_fw(struct intel_guc *guc);
>>   int intel_guc_init_hw(struct intel_guc *guc);
>>   int intel_guc_suspend(struct drm_i915_private *dev_priv);
>>   int intel_guc_resume(struct drm_i915_private *dev_priv);
>> diff --git a/drivers/gpu/drm/i915/intel_uncore.c 
>> b/drivers/gpu/drm/i915/intel_uncore.c
>> index b3c3f94..0164f41 100644
>> --- a/drivers/gpu/drm/i915/intel_uncore.c
>> +++ b/drivers/gpu/drm/i915/intel_uncore.c
>> @@ -1786,12 +1786,10 @@ int intel_guc_reset(struct drm_i915_private 
>> *dev_priv)
>>   {
>>       int ret;
>>   -    if (!HAS_GUC(dev_priv))
>> -        return -EINVAL;
>> +    GEM_BUG_ON(!HAS_GUC(dev_priv));
>>         intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
>>       ret = gen6_hw_domain_reset(dev_priv, GEN9_GRDOM_GUC);
>> -    intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
>>         return ret;
>>   }
>
Thanks for the review.

Regards,
Sujaritha
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply

* Re: [kernel-hardening] [RFC V2 0/6] add more kernel pointer filter options
From: Daniel Micay @ 2017-10-05  0:29 UTC (permalink / raw)
  To: Linus Torvalds, Roberts, William C, Tejun Heo
  Cc: Jordan Glover, Tobin C. Harding, Greg KH, Petr Mladek,
	Joe Perches, Ian Campbell, Sergey Senozhatsky,
	kernel-hardening@lists.openwall.com, Catalin Marinas, Will Deacon,
	Steven Rostedt, Chris Fries, Dave Weinstein
In-Reply-To: <CA+55aFwEZCT6=BCdmaNn5LGeU8g-2qi4OnM9MTOep3NOZVXjMg@mail.gmail.com>

On Wed, 2017-10-04 at 16:52 -0700, Linus Torvalds wrote:
> On Wed, Oct 4, 2017 at 2:58 PM, Roberts, William C
> <william.c.roberts@intel.com> wrote:
> > 
> > I agree with you 100% kptr restrict is odd, and I don't think anyone
> > should have had to opt in to be
> > cleansed via kptr_restrict value via %pK. Opt-in never works. One
> > nice thing now, is that checkpatch
> > has checking of %p usages and warns.
> 
> Yeah, the checkpatch thing may help for future patches.
> 
> > As far as broken things, I can't comment on desktop systems where I
> > think it's harder to make that claim.
> > I see value in embedded systems where I am shipping the whole image,
> > So I know when/what will
> > break.
> > 
> > If this was in-tree, Android would be setting this to 4 immediately
> > FWIW.
> 
> Does android set it to 2 right now?

Yes, as the universal baseline.

On Google Pixels it's set to this 4 level since August (Android 8.0)
which indicates they plan on moving to that universally.

They only allow dmesg access for core system services so I think their
concern is with formatted strings leaking it elsewhere, not to dmesg.

These are the only services they allow to read dmesg:

private/system_server.te:  allow system_server kernel:system syslog_read;
public/dumpstate.te:allow dumpstate kernel:system syslog_read;
public/init.te:allow init kernel:system syslog_read;
public/logd.te:allow logd kernel:system syslog_read;
public/recovery.te:  allow recovery kernel:system syslog_read;

logd doesn't read it in production builds, but even when it does in
engineering builds it only gives out access to privileged apps with
READ_LOGS which isn't something a third party app can obtain.

^ permalink raw reply

* Another question about yocto
From: Mark Hieber @ 2017-10-05  0:31 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]

I am trying to build
http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-devtools/desktop-file-utils/
into my image.

My local.conf has IMAGE_INSTALL_append = " desktop-file-utils-native"

and bblayers.conf has
BBLAYERS ?= " \
  /yocto/poky/meta \
  /yocto/poky/meta-poky \
  /yocto/poky/meta-yocto-bsp \
  /yocto/poky/meta-openembedded/meta-oe \
  /yocto/poky/meta-openembedded/meta-python \
  /yocto/poky/meta-openembedded/meta-networking \
  /yocto/poky/meta-selinux \
  "

When I run bitbake core-image-full-cmdline, I get

ERROR: Task do_populate_sdk in /yocto/poky/meta/recipes-extended/images/
core-image-full-cmdline.bb rdepends upon non-existent task
do_package_write_rpm in
/yocto/poky/meta/recipes-devtools/desktop-file-utils/
desktop-file-utils-native_0.23.bb

ERROR: Command execution failed: 1


I have struggled to add packages to my image, is this the correct way to do
this? Is there something missing in desktop-files-utils-native_0.23.bb that
should be there? According to the error message, it is looking for a
non-existent do_package_write_rpm method.

Thanks,

Mark

[-- Attachment #2: Type: text/html, Size: 1544 bytes --]

^ permalink raw reply

* Re: [PATCH linux dev-4.10 v2 2/9] drivers: fsi: SBEFIFO: Fix probe() and remove()
From: Andrew Jeffery @ 2017-10-05  0:32 UTC (permalink / raw)
  To: Eddie James, openbmc; +Cc: joel, Edward A. James
In-Reply-To: <1506724868-13010-3-git-send-email-eajames@linux.vnet.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 7390 bytes --]

On Fri, 2017-09-29 at 17:41 -0500, Eddie James wrote:
> From: "Edward A. James" <eajames@us.ibm.com>
> 
> Probe didn't handle a failed misc device registration properly. Remove
> had the potential for hangs. Also, remove the list of SBEFIFOs and
> instead just use the device "driver data" pointer.

What was the purpose of the list of SBEFIFOs? Are we losing something from the
intended design here? The list could be stored in the driver data pointer
right?

> 
> Signed-off-by: Edward A. James <eajames@us.ibm.com>
> ---
>  drivers/fsi/fsi-sbefifo.c | 109 ++++++++++++++++++++++------------------------
>  1 file changed, 52 insertions(+), 57 deletions(-)
> 
> diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c
> index a4cd353..fa34bd8 100644
> --- a/drivers/fsi/fsi-sbefifo.c
> +++ b/drivers/fsi/fsi-sbefifo.c
> @@ -58,7 +58,6 @@ struct sbefifo {
>  	struct fsi_device *fsi_dev;
>  	struct miscdevice mdev;
>  	wait_queue_head_t wait;
> -	struct list_head link;
>  	struct list_head xfrs;
>  	struct kref kref;
>  	spinlock_t lock;
> @@ -96,8 +95,6 @@ struct sbefifo_client {
>  	unsigned long f_flags;
>  };
>  
> -static struct list_head sbefifo_fifos;
> -
>  static DEFINE_IDA(sbefifo_ida);
>  
>  static int sbefifo_inw(struct sbefifo *sbefifo, int reg, u32 *word)
> @@ -267,9 +264,12 @@ static struct sbefifo_xfr *sbefifo_enq_xfr(struct sbefifo_client *client)
>  	struct sbefifo *sbefifo = client->dev;
>  	struct sbefifo_xfr *xfr;
>  
> +	if (READ_ONCE(sbefifo->rc))
> +		return ERR_PTR(sbefifo->rc);
> +
>  	xfr = kzalloc(sizeof(*xfr), GFP_KERNEL);
>  	if (!xfr)
> -		return NULL;
> +		return ERR_PTR(-ENOMEM);
>  
>  	xfr->rbuf = &client->rbuf;
>  	xfr->wbuf = &client->wbuf;
> @@ -490,7 +490,7 @@ static void sbefifo_poll_timer(unsigned long data)
>  	}
>  
>  	sbefifo_put(sbefifo);
> -	wake_up(&sbefifo->wait);
> +	wake_up_interruptible(&sbefifo->wait);
>  
>  out_unlock:
>  	spin_unlock(&sbefifo->lock);
> @@ -604,7 +604,7 @@ static ssize_t sbefifo_read_common(struct sbefifo_client *client,
>  		} else {
>  			kfree(xfr);
>  			list_del(&xfr->client);
> -			wake_up(&sbefifo->wait);
> +			wake_up_interruptible(&sbefifo->wait);
>  		}
>  	}
>  
> @@ -664,7 +664,7 @@ static ssize_t sbefifo_write_common(struct sbefifo_client *client,
>  	}
>  
>  	xfr = sbefifo_enq_xfr(client);		/* this xfr queued up */
> -	if (!xfr) {
> +	if (IS_ERR(xfr)) {

Should this be in what is currently patch 0/9?

>  		spin_unlock_irq(&sbefifo->lock);
>  		ret = PTR_ERR(xfr);
>  		goto out;
> @@ -766,18 +766,15 @@ static int sbefifo_release(struct inode *inode, struct file *file)
>  struct sbefifo_client *sbefifo_drv_open(struct device *dev,
>  					unsigned long flags)
>  {
> -	struct sbefifo_client *client = NULL;
> -	struct sbefifo *sbefifo;
> -	struct fsi_device *fsi_dev = to_fsi_dev(dev);
> +	struct sbefifo_client *client;
> +	struct sbefifo *sbefifo = dev_get_drvdata(dev);
>  
> -	list_for_each_entry(sbefifo, &sbefifo_fifos, link) {
> -		if (sbefifo->fsi_dev != fsi_dev)
> -			continue;
> +	if (!sbefifo)
> +		return NULL;
>  
> -		client = sbefifo_new_client(sbefifo);
> -		if (client)
> -			client->f_flags = flags;
> -	}
> +	client = sbefifo_new_client(sbefifo);
> +	if (client)
> +		client->f_flags = flags;
>  
>  	return client;
>  }
> @@ -850,69 +847,68 @@ static int sbefifo_probe(struct device *dev)
>  		return -EIO;
>  	}
>  
> -	sbefifo->mdev.minor = MISC_DYNAMIC_MINOR;
> -	sbefifo->mdev.fops = &sbefifo_fops;
> -	sbefifo->mdev.name = sbefifo->name;
> -	sbefifo->mdev.parent = dev;
>  	spin_lock_init(&sbefifo->lock);
>  	kref_init(&sbefifo->kref);
> +	init_waitqueue_head(&sbefifo->wait);
> +	INIT_LIST_HEAD(&sbefifo->xfrs);
>  
>  	sbefifo->idx = ida_simple_get(&sbefifo_ida, 1, INT_MAX, GFP_KERNEL);
>  	snprintf(sbefifo->name, sizeof(sbefifo->name), "sbefifo%d",
>  		 sbefifo->idx);
> -	init_waitqueue_head(&sbefifo->wait);
> -	INIT_LIST_HEAD(&sbefifo->xfrs);
>  
>  	/* This bit of silicon doesn't offer any interrupts... */
>  	setup_timer(&sbefifo->poll_timer, sbefifo_poll_timer,
>  		    (unsigned long)sbefifo);
>  
> -	if (dev->of_node) {
> -		/* create platform devs for dts child nodes (occ, etc) */
> -		for_each_child_of_node(dev->of_node, np) {
> -			snprintf(child_name, sizeof(child_name), "%s-dev%d",
> -				 sbefifo->name, child_idx++);
> -			child = of_platform_device_create(np, child_name, dev);
> -			if (!child)
> -				dev_warn(dev,
> -					 "failed to create child node dev\n");
> -		}
> +	sbefifo->mdev.minor = MISC_DYNAMIC_MINOR;
> +	sbefifo->mdev.fops = &sbefifo_fops;
> +	sbefifo->mdev.name = sbefifo->name;
> +	sbefifo->mdev.parent = dev;
> +	ret = misc_register(&sbefifo->mdev);
> +	if (ret) {
> +		dev_err(dev, "failed to register miscdevice: %d\n", ret);
> +		ida_simple_remove(&sbefifo_ida, sbefifo->idx);
> +		sbefifo_put(sbefifo);
> +		return ret;
>  	}
>  
> -	list_add(&sbefifo->link, &sbefifo_fifos);
> -	
> -	return misc_register(&sbefifo->mdev);
> +	/* create platform devs for dts child nodes (occ, etc) */
> +	for_each_available_child_of_node(dev->of_node, np) {
> +		snprintf(child_name, sizeof(child_name), "%s-dev%d",
> +			 sbefifo->name, child_idx++);
> +		child = of_platform_device_create(np, child_name, dev);
> +		if (!child)
> +			dev_warn(dev, "failed to create child %s dev\n",
> +				 child_name);
> +	}
> +
> +	dev_set_drvdata(dev, sbefifo);
> +
> +	return 0;
>  }
>  
>  static int sbefifo_remove(struct device *dev)
>  {
> -	struct fsi_device *fsi_dev = to_fsi_dev(dev);
> -	struct sbefifo *sbefifo, *sbefifo_tmp;
> +	struct sbefifo *sbefifo = dev_get_drvdata(dev);
>  	struct sbefifo_xfr *xfr;
>  
> -	list_for_each_entry_safe(sbefifo, sbefifo_tmp, &sbefifo_fifos, link) {
> -		if (sbefifo->fsi_dev != fsi_dev)
> -			continue;
> +	WRITE_ONCE(sbefifo->rc, -ENODEV);
> +	wake_up_interruptible_all(&sbefifo->wait);

If we're removing, we want to wake up non-interruptible tasks as well, so I
think wake_up_all() is more appropriate.

>  
> -		device_for_each_child(dev, NULL, sbefifo_unregister_child);
> +	misc_deregister(&sbefifo->mdev);
> +	device_for_each_child(dev, NULL, sbefifo_unregister_child);
>  
> -		misc_deregister(&sbefifo->mdev);
> -		list_del(&sbefifo->link);
> -		ida_simple_remove(&sbefifo_ida, sbefifo->idx);
> -
> -		if (del_timer_sync(&sbefifo->poll_timer))
> -			sbefifo_put(sbefifo);
> +	ida_simple_remove(&sbefifo_ida, sbefifo->idx);
>  
> -		spin_lock(&sbefifo->lock);
> -		list_for_each_entry(xfr, &sbefifo->xfrs, xfrs)
> -			kfree(xfr);
> -		spin_unlock(&sbefifo->lock);
> +	if (del_timer_sync(&sbefifo->poll_timer))
> +		sbefifo_put(sbefifo);
>  
> -		WRITE_ONCE(sbefifo->rc, -ENODEV);
> +	spin_lock(&sbefifo->lock);
> +	list_for_each_entry(xfr, &sbefifo->xfrs, xfrs)
> +		kfree(xfr);
> +	spin_unlock(&sbefifo->lock);
>  
> -		wake_up(&sbefifo->wait);
> -		sbefifo_put(sbefifo);
> -	}
> +	sbefifo_put(sbefifo);
>  
>  	return 0;
>  }
> @@ -937,7 +933,6 @@ static int sbefifo_remove(struct device *dev)
>  
>  static int sbefifo_init(void)
>  {
> -	INIT_LIST_HEAD(&sbefifo_fifos);
>  	return fsi_driver_register(&sbefifo_drv);
>  }
>  

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.