20 Oct, 2014

1 commit


20 Mar, 2014

1 commit

  • Subsystems that want to register CPU hotplug callbacks, as well as perform
    initialization for the CPUs that are already online, often do it as shown
    below:

    get_online_cpus();

    for_each_online_cpu(cpu)
    init_cpu(cpu);

    register_cpu_notifier(&foobar_cpu_notifier);

    put_online_cpus();

    This is wrong, since it is prone to ABBA deadlocks involving the
    cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently
    with CPU hotplug operations).

    Instead, the correct and race-free way of performing the callback
    registration is:

    cpu_notifier_register_begin();

    for_each_online_cpu(cpu)
    init_cpu(cpu);

    /* Note the use of the double underscored version of the API */
    __register_cpu_notifier(&foobar_cpu_notifier);

    cpu_notifier_register_done();

    Fix the hwmon via-cputemp code by using this latter form of callback
    registration.

    Cc: Jean Delvare
    Cc: Ingo Molnar
    Acked-by: Guenter Roeck
    Signed-off-by: Srivatsa S. Bhat
    Signed-off-by: Rafael J. Wysocki

    Srivatsa S. Bhat
     

15 Jul, 2013

1 commit

  • The __cpuinit type of throwaway sections might have made sense
    some time ago when RAM was more constrained, but now the savings
    do not offset the cost and complications. For example, the fix in
    commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
    is a good example of the nasty type of bugs that can be created
    with improper use of the various __init prefixes.

    After a discussion on LKML[1] it was decided that cpuinit should go
    the way of devinit and be phased out. Once all the users are gone,
    we can then finally remove the macros themselves from linux/init.h.

    This removes all the drivers/hwmon uses of the __cpuinit macros
    from all C files.

    [1] https://lkml.org/lkml/2013/5/20/589

    Cc: Fenghua Yu
    Cc: lm-sensors@lm-sensors.org
    Acked-by: Guenter Roeck
    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

29 Nov, 2012

3 commits

  • CONFIG_HOTPLUG is going away as an option so __devexit is no
    longer needed.

    Signed-off-by: Bill Pemberton
    Cc: Hans de Goede
    Cc: Jean Delvare
    Cc: Alistair John Strachan
    Cc: Fenghua Yu
    Cc: Juerg Haefliger
    Cc: Andreas Herrmann
    Cc: Clemens Ladisch
    Cc: Rudolf Marek
    Cc: Jim Cromie
    Cc: "Mark M. Hoffman"
    Cc: Roger Lucas
    Acked-by: Guenter Roeck
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devinit is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Hans de Goede
    Cc: Jean Delvare
    Cc: Alistair John Strachan
    Cc: Fenghua Yu
    Cc: Juerg Haefliger
    Cc: Andreas Herrmann
    Cc: Clemens Ladisch
    Cc: Rudolf Marek
    Cc: Jim Cromie
    Cc: "Mark M. Hoffman"
    Cc: Roger Lucas
    Acked-by: Guenter Roeck
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Hans de Goede
    Cc: Jean Delvare
    Cc: Alistair John Strachan
    Cc: Fenghua Yu
    Cc: Juerg Haefliger
    Cc: Andreas Herrmann
    Cc: Clemens Ladisch
    Cc: Rudolf Marek
    Cc: Jim Cromie
    Cc: "Mark M. Hoffman"
    Cc: Roger Lucas
    Acked-by: Guenter Roeck
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     

24 Sep, 2012

2 commits

  • Convert to use devm_ functions to reduce code size and simplify the code.

    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • via_cputemp_init loops with for_each_online_cpu, adding
    platform_devices, then calls register_hotcpu_notifier. If a CPU is
    offlined between the loop and register_hotcpu_notifier, then later
    onlined, via_cputemp_device_add will attempt to add platform devices
    with the same ID. A similar race occurs during via_cputemp_exit,
    after the module calls unregister_hotcpu_notifier, a CPU might offline
    and a device will exist for a CPU that is offline.

    This fix surrounds for_each_online_cpu and register_hotcpu_notifier
    with get_online_cpus+put_online_cpus; and surrounds
    unregister_hotcpu_notifier and device unregistering with
    get_online_cpus+put_online_cpus.

    Build tested.

    Signed-off-by: Silas Boyd-Wickizer
    Acked-by: Harald Welte
    Signed-off-by: Jean Delvare

    Silas Boyd-Wickizer
     

30 Jul, 2012

1 commit


27 Jan, 2012

1 commit


26 Jul, 2011

1 commit


09 Jan, 2011

2 commits


26 Oct, 2010

3 commits


15 Aug, 2010

1 commit

  • The via-cputemp hwmon driver was probably intending "typedef enum {
    ... } SHOW;", but the "typedef" was missing creating a global variable
    named "SHOW". There is absolutely no reason to have this in the
    global namespace.

    Signed-off-by: H. Peter Anvin
    Acked-by: Harald Welte
    Cc: Juerg Haefliger
    Signed-off-by: Jean Delvare

    H. Peter Anvin
     

17 Dec, 2009

1 commit