1. 06 Jan, 2014 18 commits
    • Mikulas Patocka's avatar
      powernow-k6: correctly initialize default parameters · d82b922a
      Mikulas Patocka authored
      The powernow-k6 driver used to read the initial multiplier from the
      powernow register. However, there is a problem with this:
      
      * If there was a frequency transition before, the multiplier read from the
        register corresponds to the current multiplier.
      * If there was no frequency transition since reset, the field in the
        register always reads as zero, regardless of the current multiplier that
        is set using switches on the mainboard and that the CPU is running at.
      
      The zero value corresponds to multiplier 4.5, so as a consequence, the
      powernow-k6 driver always assumes multiplier 4.5.
      
      For example, if we have 550MHz CPU with bus frequency 100MHz and
      multiplier 5.5, the powernow-k6 driver thinks that the multiplier is 4.5
      and bus frequency is 122MHz. The powernow-k6 driver then sets the
      multiplier to 4.5, underclocking the CPU to 450MHz, but reports the
      current frequency as 550MHz.
      
      There is no reliable way how to read the initial multiplier. I modified
      the driver so that it contains a table of known frequencies (based on
      parameters of existing CPUs and some common overclocking schemes) and sets
      the multiplier according to the frequency. If the frequency is unknown
      (because of unusual overclocking or underclocking), the user must supply
      the bus speed and maximum multiplier as module parameters.
      
      This patch should be backported to all stable kernels. If it doesn't
      apply cleanly, change it, or ask me to change it.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d82b922a
    • Mikulas Patocka's avatar
      powernow-k6: disable cache when changing frequency · e20e1d0a
      Mikulas Patocka authored
      I found out that a system with k6-3+ processor is unstable during network
      server load. The system locks up or the network card stops receiving. The
      reason for the instability is the CPU frequency scaling.
      
      During frequency transition the processor is in "EPM Stop Grant" state.
      The documentation says that the processor doesn't respond to inquiry
      requests in this state. Consequently, coherency of processor caches and
      bus master devices is not maintained, causing the system instability.
      
      This patch flushes the cache during frequency transition. It fixes the
      instability.
      
      Other minor changes:
      * u64 invalue changed to unsigned long because the variable is 32-bit
      * move the logic to set the multiplier to a separate function
        powernow_k6_set_cpu_multiplier
      * preserve lower 5 bits of the powernow port instead of 4 (the voltage
        field has 5 bits)
      * mask interrupts when reading the multiplier, so that the port is not
        open during other activity (running other kernel code with the port open
        shouldn't cause any misbehavior, but we should better be safe and keep
        the port closed)
      
      This patch should be backported to all stable kernels. If it doesn't
      apply cleanly, change it, or ask me to change it.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e20e1d0a
    • Ramkumar Ramachandra's avatar
      Documentation: add ABI entry for intel_pstate · fbe299e0
      Ramkumar Ramachandra authored
      Add a Documentation/ABI entry for
      /sys/devices/system/cpu/intel_pstate/max_perf_pct,
      /sys/devices/system/cpu/intel_pstate/min_perf_pct, and
      /sys/devices/system/cpu/intel_pstate/no_turbo.
      
      Cc: Dirk Brandewie <dirk.brandewie@gmail.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarRamkumar Ramachandra <artagnon@gmail.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      fbe299e0
    • Lukasz Majewski's avatar
      cpufreq: exynos: Convert exynos-cpufreq to platform driver · d568b6f7
      Lukasz Majewski authored
      To make the driver multiplatform-friendly, unconditional initialization
      in an initcall is replaced with a platform driver probed only if
      respective platform device is registered.
      
      Tested at: Exynos4210 (TRATS) and Exynos4412 (TRATS2)
      Signed-off-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      Signed-off-by: default avatarTomasz Figa <t.figa@samsung.com>
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      Reviewed-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
      Tested-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d568b6f7
    • Viresh Kumar's avatar
      cpufreq: Make sure CPU is running on a freq from freq-table · d3916691
      Viresh Kumar authored
      Sometimes boot loaders set CPU frequency to a value outside of frequency table
      present with cpufreq core. In such cases CPU might be unstable if it has to run
      on that frequency for long duration of time and so its better to set it to a
      frequency which is specified in freq-table. This also makes cpufreq stats
      inconsistent as cpufreq-stats would fail to register because current frequency
      of CPU isn't found in freq-table.
      
      Because we don't want this change to affect boot process badly, we go for the
      next freq which is >= policy->cur ('cur' must be set by now, otherwise we will
      end up setting freq to lowest of the table as 'cur' is initialized to zero).
      
      In case current frequency doesn't match any frequency from freq-table, we throw
      warnings to user, so that user can get this fixed in their bootloaders or
      freq-tables.
      Reported-by: default avatarCarlos Hernandez <ceh@ti.com>
      Reported-and-tested-by: default avatarNishanth Menon <nm@ti.com>
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d3916691
    • Viresh Kumar's avatar
      cpufreq: Mark ARM drivers with CPUFREQ_NEED_INITIAL_FREQ_CHECK flag · ae6b4271
      Viresh Kumar authored
      Sometimes boot loaders set CPU frequency to a value outside of frequency table
      present with cpufreq core. In such cases CPU might be unstable if it has to run
      on that frequency for long duration of time and so its better to set it to a
      frequency which is specified in frequency table.
      
      On some systems we can't really say what frequency we're running at the moment
      and so for these we shouldn't check if we are running at a frequency present in
      frequency table. And so we really can't force this for all the cpufreq drivers.
      
      Hence we are created another flag here: CPUFREQ_NEED_INITIAL_FREQ_CHECK that
      will be marked by platforms which want to go for this check at boot time.
      
      Initially this is done for all ARM platforms but others may follow if required.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ae6b4271
    • John Tobias's avatar
      cpufreq: imx6q: add of_init_opp_table · 20b7cbe2
      John Tobias authored
      Add a routine check to see if the platform supplied the OPP table.
      Incase there's no OPP table exist, it will try to initialise it.
      
      It's been tested on iMX6SL board where the platform doesn't have
      an OPP table.
      Signed-off-by: default avatarJohn Tobias <john.tobias.ph@gmail.com>
      Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      20b7cbe2
    • Shawn Guo's avatar
      cpufreq: imx6q-cpufreq driver is reused on i.MX6 series SoCs · 1d0eaae9
      Shawn Guo authored
      The imx6q-cpufreq driver nowadays is not only running on imx6q but also
      other i.MX6 series SoCs like imx6dl and imx6sl.  Update Kconfig prompt
      and help text to make it clear to users.
      Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1d0eaae9
    • Anson Huang's avatar
      cpufreq: imx6q: correct VDDSOC/PU voltage scaling when cpufreq is changed · b4573d1d
      Anson Huang authored
      on i.MX6Q, cpu freq change need to follow below flows:
      
      1. each setpoint has different VDDARM, VDDSOC/PU voltage, get the setpoint
         table from dts;
      2. when cpu freq is scaling up, need to increase VDDSOC/PU voltage before
         VDDARM, if VDDPU is off, no need to change it;
      3. when cpu freq is scaling down, need to decrease VDDARM voltage before
         VDDSOC/PU, if VDDPU is off, no need to change it;
      
      normally dts will pass vddsoc/pu freq/volt info to kernel, if not, will
      use fixed value for vddsoc/pu voltage setting.
      Signed-off-by: default avatarAnson Huang <b20788@freescale.com>
      Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b4573d1d
    • Viresh Kumar's avatar
      cpufreq: send new set of notification for transition failures · ab1b1c4e
      Viresh Kumar authored
      In the current code, if we fail during a frequency transition, we
      simply send the POSTCHANGE notification with the old frequency. This
      isn't enough.
      
      One of the core users of these notifications is the code responsible
      for keeping loops_per_jiffy aligned with frequency changes. And mostly
      it is written as:
      
      	if ((val == CPUFREQ_PRECHANGE  && freq->old < freq->new) ||
      	    (val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
      		update-loops-per-jiffy...
      	}
      
      So, suppose we are changing to a higher frequency and failed during
      transition, then following will happen:
      - CPUFREQ_PRECHANGE notification with freq-new > freq-old
      - CPUFREQ_POSTCHANGE notification with freq-new == freq-old
      
      The first one will update loops_per_jiffy and second one will do
      nothing. Even if we send the 2nd notification by exchanging values of
      freq-new and old, some users of these notifications might get
      unstable.
      
      This can be fixed by simply calling cpufreq_notify_post_transition()
      with error code and this routine will take care of sending
      notifications in the correct order.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      [rjw: Folded 3 patches into one, rebased unicore2 changes]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ab1b1c4e
    • Viresh Kumar's avatar
      cpufreq: Introduce cpufreq_notify_post_transition() · f7ba3b41
      Viresh Kumar authored
      This introduces a new routine cpufreq_notify_post_transition() which
      can be used to send POSTCHANGE notification for new freq with or
      without both {PRE|POST}CHANGE notifications for last freq. This is
      useful at multiple places, especially for sending transition failure
      notifications.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f7ba3b41
    • Sachin Kamat's avatar
      cpufreq: exynos5250: Set APLL rate using CCF API · 26ab1c62
      Sachin Kamat authored
      Use common clock framework (CCF) APIs to set the clock rates
      instead of direct register manipulation. This now updates the
      sysfs entry (cpuinfo_cur_freq) correctly which did not reflect
      the correct value until now. While at it clean up the PLL s-div
      parameter setting as it is handled by the PLL driver.
      Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Reviewed-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      26ab1c62
    • Jane Li's avatar
      cpufreq: Fix timer/workqueue corruption by protecting reading governor_enabled · 6f1e4efd
      Jane Li authored
      When a CPU is hot removed we'll cancel all the delayed work items via
      gov_cancel_work(). Sometimes the delayed work function determines that
      it should adjust the delay for all other CPUs that the policy is
      managing. If this scenario occurs, the canceling CPU will cancel its own
      work but queue up the other CPUs works to run.
      
      Commit 3617f2 (cpufreq: Fix timer/workqueue corruption due to double
      queueing) has tried to fix this, but reading governor_enabled is not
      protected by cpufreq_governor_lock. Even though od_dbs_timer() checks
      governor_enabled before gov_queue_work(), this scenario may occur. For
      example:
      
       CPU0                                        CPU1
       ----                                        ----
       cpu_down()
        ...                                        <work runs>
        __cpufreq_remove_dev()                     od_dbs_timer()
         __cpufreq_governor()                       policy->governor_enabled
          policy->governor_enabled = false;
          cpufreq_governor_dbs()
           case CPUFREQ_GOV_STOP:
            gov_cancel_work(dbs_data, policy);
             cpu0 work is canceled
              timer is canceled
              cpu1 work is canceled
              <waits for cpu1>
                                                    gov_queue_work(*, *, true);
                                                     cpu0 work queued
                                                     cpu1 work queued
                                                     cpu2 work queued
                                                     ...
              cpu1 work is canceled
              cpu2 work is canceled
              ...
      
      At the end of the GOV_STOP case cpu0 still has a work queued to
      run although the code is expecting all of the works to be
      canceled. __cpufreq_remove_dev() will then proceed to
      re-initialize all the other CPUs works except for the CPU that is
      going down. The CPUFREQ_GOV_START case in cpufreq_governor_dbs()
      will trample over the queued work and debugobjects will spit out
      a warning:
      
      WARNING: at lib/debugobjects.c:260 debug_print_object+0x94/0xbc()
      ODEBUG: init active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x14
      Modules linked in:
      CPU: 1 PID: 1205 Comm: sh Tainted: G        W    3.10.0 #200
      [<c01144f0>] (unwind_backtrace+0x0/0xf8) from [<c0111d98>] (show_stack+0x10/0x14)
      [<c0111d98>] (show_stack+0x10/0x14) from [<c01272cc>] (warn_slowpath_common+0x4c/0x68)
      [<c01272cc>] (warn_slowpath_common+0x4c/0x68) from [<c012737c>] (warn_slowpath_fmt+0x30/0x40)
      [<c012737c>] (warn_slowpath_fmt+0x30/0x40) from [<c034c640>] (debug_print_object+0x94/0xbc)
      [<c034c640>] (debug_print_object+0x94/0xbc) from [<c034c7f8>] (__debug_object_init+0xc8/0x3c0)
      [<c034c7f8>] (__debug_object_init+0xc8/0x3c0) from [<c01360e0>] (init_timer_key+0x20/0x104)
      [<c01360e0>] (init_timer_key+0x20/0x104) from [<c04872ac>] (cpufreq_governor_dbs+0x1dc/0x68c)
      [<c04872ac>] (cpufreq_governor_dbs+0x1dc/0x68c) from [<c04833a8>] (__cpufreq_governor+0x80/0x1b0)
      [<c04833a8>] (__cpufreq_governor+0x80/0x1b0) from [<c0483704>] (__cpufreq_remove_dev.isra.12+0x22c/0x380)
      [<c0483704>] (__cpufreq_remove_dev.isra.12+0x22c/0x380) from [<c0692f38>] (cpufreq_cpu_callback+0x48/0x5c)
      [<c0692f38>] (cpufreq_cpu_callback+0x48/0x5c) from [<c014fb40>] (notifier_call_chain+0x44/0x84)
      [<c014fb40>] (notifier_call_chain+0x44/0x84) from [<c012ae44>] (__cpu_notify+0x2c/0x48)
      [<c012ae44>] (__cpu_notify+0x2c/0x48) from [<c068dd40>] (_cpu_down+0x80/0x258)
      [<c068dd40>] (_cpu_down+0x80/0x258) from [<c068df40>] (cpu_down+0x28/0x3c)
      [<c068df40>] (cpu_down+0x28/0x3c) from [<c068e4c0>] (store_online+0x30/0x74)
      [<c068e4c0>] (store_online+0x30/0x74) from [<c03a7308>] (dev_attr_store+0x18/0x24)
      [<c03a7308>] (dev_attr_store+0x18/0x24) from [<c0256fe0>] (sysfs_write_file+0x100/0x180)
      [<c0256fe0>] (sysfs_write_file+0x100/0x180) from [<c01fec9c>] (vfs_write+0xbc/0x184)
      [<c01fec9c>] (vfs_write+0xbc/0x184) from [<c01ff034>] (SyS_write+0x40/0x68)
      [<c01ff034>] (SyS_write+0x40/0x68) from [<c010e200>] (ret_fast_syscall+0x0/0x48)
      
      In gov_queue_work(), lock cpufreq_governor_lock before gov_queue_work,
      and unlock it after __gov_queue_work(). In this way, governor_enabled
      is guaranteed not changed in gov_queue_work().
      Signed-off-by: default avatarJane Li <jiel@marvell.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Reviewed-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      6f1e4efd
    • Sachin Kamat's avatar
      cpufreq: s3c24xx: Staticize local variable · 87ae97f1
      Sachin Kamat authored
      Local variable used only in this file is made static.
      Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      87ae97f1
    • Sachin Kamat's avatar
      cpufreq: s3c2440: Staticize local variables · 8f82b196
      Sachin Kamat authored
      Local variables used only in this file are made static.
      Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8f82b196
    • Sachin Kamat's avatar
      cpufreq: s3c2440: Remove hardware.h inclusion · 2b2ec67f
      Sachin Kamat authored
      The contents of this header file are not referenced in the driver.
      Remove its inclusion.
      Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2b2ec67f
    • Viresh Kumar's avatar
      cpufreq: arm-big-little: Make driver dependent on CONFIG_BIG_LITTLE · 998be8ee
      Viresh Kumar authored
      The arm_big_little cpufreq driver is only used by ARM bigLITTLE
      platforms and hence must depend on CONFIG_BIG_LITTLE.
      
      This was highlighted by Russell earlier when he reported this issue:
      
      drivers/built-in.o: In function `bL_cpufreq_set_rate':
      powercap_sys.c:(.text+0x5ed9a0): undefined reference to `bL_switch_request_cb'
      Reported-by: default avatarRussell King <linux@arm.linux.org.uk>
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      998be8ee
    • Ramkumar Ramachandra's avatar
      Documentation / cpufreq: add intel-pstate.txt · a3ea0153
      Ramkumar Ramachandra authored
      The Intel P-state driver is currently undocumented. Add some
      documentation based on the cover-letter sent with the original series.
      
      Cc: Dirk Brandewie <dirk.brandewie@gmail.com>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarRamkumar Ramachandra <artagnon@gmail.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a3ea0153
  2. 05 Jan, 2014 1 commit
  3. 31 Dec, 2013 1 commit
    • Rafael J. Wysocki's avatar
      intel_pstate: Fail initialization if P-state information is missing · 98a947ab
      Rafael J. Wysocki authored
      If pstate.current_pstate is 0 after the initial
      intel_pstate_get_cpu_pstates(), this means that we were unable to
      obtain any useful P-state information and there is no reason to
      continue, so free memory and return an error in that case.
      
      This fixes the following divide error occuring in a nested KVM
      guest:
      
      Intel P-state driver initializing.
      Intel pstate controlling: cpu 0
      cpufreq: __cpufreq_add_dev: ->get() failed
      divide error: 0000 [#1] SMP
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.13.0-0.rc4.git5.1.fc21.x86_64 #1
      Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
      task: ffff88001ea20000 ti: ffff88001e9bc000 task.ti: ffff88001e9bc000
      RIP: 0010:[<ffffffff815c551d>]  [<ffffffff815c551d>] intel_pstate_timer_func+0x11d/0x2b0
      RSP: 0000:ffff88001ee03e18  EFLAGS: 00010246
      RAX: 0000000000000000 RBX: ffff88001a454348 RCX: 0000000000006100
      RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
      RBP: ffff88001ee03e38 R08: 0000000000000000 R09: 0000000000000000
      R10: ffff88001ea20000 R11: 0000000000000000 R12: 00000c0a1ea20000
      R13: 1ea200001ea20000 R14: ffffffff815c5400 R15: ffff88001a454348
      FS:  0000000000000000(0000) GS:ffff88001ee00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 0000000000000000 CR3: 0000000001c0c000 CR4: 00000000000006f0
      Stack:
       fffffffb1a454390 ffffffff821a4500 ffff88001a454390 0000000000000100
       ffff88001ee03ea8 ffffffff81083e9a ffffffff81083e15 ffffffff82d5ed40
       ffffffff8258cc60 0000000000000000 ffffffff81ac39de 0000000000000000
      Call Trace:
       <IRQ>
       [<ffffffff81083e9a>] call_timer_fn+0x8a/0x310
       [<ffffffff81083e15>] ? call_timer_fn+0x5/0x310
       [<ffffffff815c5400>] ? pid_param_set+0x130/0x130
       [<ffffffff81084354>] run_timer_softirq+0x234/0x380
       [<ffffffff8107aee4>] __do_softirq+0x104/0x430
       [<ffffffff8107b5fd>] irq_exit+0xcd/0xe0
       [<ffffffff81770645>] smp_apic_timer_interrupt+0x45/0x60
       [<ffffffff8176efb2>] apic_timer_interrupt+0x72/0x80
       <EOI>
       [<ffffffff810e15cd>] ? vprintk_emit+0x1dd/0x5e0
       [<ffffffff81757719>] printk+0x67/0x69
       [<ffffffff815c1493>] __cpufreq_add_dev.isra.13+0x883/0x8d0
       [<ffffffff815c14f0>] cpufreq_add_dev+0x10/0x20
       [<ffffffff814a14d1>] subsys_interface_register+0xb1/0xf0
       [<ffffffff815bf5cf>] cpufreq_register_driver+0x9f/0x210
       [<ffffffff81fb19af>] intel_pstate_init+0x27d/0x3be
       [<ffffffff81761e3e>] ? mutex_unlock+0xe/0x10
       [<ffffffff81fb1732>] ? cpufreq_gov_dbs_init+0x12/0x12
       [<ffffffff8100214a>] do_one_initcall+0xfa/0x1b0
       [<ffffffff8109dbf5>] ? parse_args+0x225/0x3f0
       [<ffffffff81f64193>] kernel_init_freeable+0x1fc/0x287
       [<ffffffff81f638d0>] ? do_early_param+0x88/0x88
       [<ffffffff8174b530>] ? rest_init+0x150/0x150
       [<ffffffff8174b53e>] kernel_init+0xe/0x130
       [<ffffffff8176e27c>] ret_from_fork+0x7c/0xb0
       [<ffffffff8174b530>] ? rest_init+0x150/0x150
      Code: c1 e0 05 48 63 bc 03 10 01 00 00 48 63 83 d0 00 00 00 48 63 d6 48 c1 e2 08 c1 e1 08 4c 63 c2 48 c1 e0 08 48 98 48 c1 e0 08 48 99 <49> f7 f8 48 98 48 0f af f8 48 c1 ff 08 29 f9 89 ca c1 fa 1f 89
      RIP  [<ffffffff815c551d>] intel_pstate_timer_func+0x11d/0x2b0
       RSP <ffff88001ee03e18>
      ---[ end trace f166110ed22cc37a ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      Reported-and-tested-by: default avatarKashyap Chamarthy <kchamart@redhat.com>
      Cc: Josh Boyer <jwboyer@fedoraproject.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: All applicable <stable@vger.kernel.org>
      98a947ab
  4. 29 Dec, 2013 2 commits
  5. 22 Dec, 2013 4 commits
  6. 21 Dec, 2013 2 commits
    • Jason Baron's avatar
      cpufreq: Use CONFIG_CPU_FREQ_DEFAULT_* to set initial policy for setpolicy drivers · a27a9ab7
      Jason Baron authored
      When configuring a default governor (via CONFIG_CPU_FREQ_DEFAULT_*) with the
      intel_pstate driver, the desired default policy is not properly set. For
      example, setting 'CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE' ends up with the
      'powersave' policy being set.
      
      Fix by configuring the correct default policy, if either 'powersave' or
      'performance' are requested. Otherwise, fallback to what the driver originally
      set via its 'init' routine.
      Signed-off-by: default avatarJason Baron <jbaron@akamai.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a27a9ab7
    • Viresh Kumar's avatar
      cpufreq: remove sysfs files for CPUs which failed to come back after resume · 42f921a6
      Viresh Kumar authored
      There are cases where cpufreq_add_dev() may fail for some CPUs
      during system resume. With the current code we will still have
      sysfs cpufreq files for those CPUs and struct cpufreq_policy
      would be already freed for them. Hence any operation on those
      sysfs files would result in kernel warnings.
      
      Example of problems resulting from resume errors (from Bjørn Mork):
      
      WARNING: CPU: 0 PID: 6055 at fs/sysfs/file.c:343 sysfs_open_file+0x77/0x212()
      missing sysfs attribute operations for kobject: (null)
      Modules linked in: [stripped as irrelevant]
      CPU: 0 PID: 6055 Comm: grep Tainted: G      D      3.13.0-rc2 #153
      Hardware name: LENOVO 2776LEG/2776LEG, BIOS 6EET55WW (3.15 ) 12/19/2011
       0000000000000009 ffff8802327ebb78 ffffffff81380b0e 0000000000000006
       ffff8802327ebbc8 ffff8802327ebbb8 ffffffff81038635 0000000000000000
       ffffffff811823c7 ffff88021a19e688 ffff88021a19e688 ffff8802302f9310
      Call Trace:
       [<ffffffff81380b0e>] dump_stack+0x55/0x76
       [<ffffffff81038635>] warn_slowpath_common+0x7c/0x96
       [<ffffffff811823c7>] ? sysfs_open_file+0x77/0x212
       [<ffffffff810386e3>] warn_slowpath_fmt+0x41/0x43
       [<ffffffff81182dec>] ? sysfs_get_active+0x6b/0x82
       [<ffffffff81182382>] ? sysfs_open_file+0x32/0x212
       [<ffffffff811823c7>] sysfs_open_file+0x77/0x212
       [<ffffffff81182350>] ? sysfs_schedule_callback+0x1ac/0x1ac
       [<ffffffff81122562>] do_dentry_open+0x17c/0x257
       [<ffffffff8112267e>] finish_open+0x41/0x4f
       [<ffffffff81130225>] do_last+0x80c/0x9ba
       [<ffffffff8112dbbd>] ? inode_permission+0x40/0x42
       [<ffffffff81130606>] path_openat+0x233/0x4a1
       [<ffffffff81130b7e>] do_filp_open+0x35/0x85
       [<ffffffff8113b787>] ? __alloc_fd+0x172/0x184
       [<ffffffff811232ea>] do_sys_open+0x6b/0xfa
       [<ffffffff811233a7>] SyS_openat+0xf/0x11
       [<ffffffff8138c812>] system_call_fastpath+0x16/0x1b
      
      To fix this, remove those sysfs files or put the associated kobject
      in case of such errors. Also, to make it simple, remove the cpufreq
      sysfs links from all the CPUs (except for the policy->cpu) during
      suspend, as that operation won't result in a loss of sysfs file
      permissions and we can create those links during resume just fine.
      
      Fixes: 5302c3fb ("cpufreq: Perform light-weight init/teardown during suspend/resume")
      Reported-and-tested-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Cc: 3.12+ <stable@vger.kernel.org> # 3.12+
      [rjw: Changelog]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      42f921a6
  7. 15 Dec, 2013 10 commits
    • Linus Torvalds's avatar
      Linux 3.13-rc4 · 319e2e3f
      Linus Torvalds authored
      319e2e3f
    • Matias Bjorling's avatar
      null_blk: mem garbage on NUMA systems during init · 57053d8c
      Matias Bjorling authored
      For NUMA systems, initializing the blk-mq layer and using per node hctx.
      We initialize submit queues to 1, while blk-mq nr_hw_queues is
      initialized to the number of NUMA nodes.
      
      This makes the null_init_hctx function overwrite memory outside of what
      it allocated.  In my case it lead to writing garbage into struct
      request_queue's mq_map.
      Signed-off-by: default avatarMatias Bjorling <m@bjorling.me>
      Cc: Jens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      57053d8c
    • Sergey Senozhatsky's avatar
      radeon_pm: fix oops in hwmon_attributes_visible() and radeon_hwmon_show_temp_thresh() · e4158f1b
      Sergey Senozhatsky authored
      Since commit ec39f64b ("drm/radeon/dpm: Convert to use
      devm_hwmon_register_with_groups") radeon_hwmon_init() is using
      hwmon_device_register_with_groups(), which sets `rdev' as a device
      private driver_data, while hwmon_attributes_visible() and
      radeon_hwmon_show_temp_thresh() are still waiting for `drm_device'.
      
      Fix them by using dev_get_drvdata(), in order to avoid this oops:
      
        BUG: unable to handle kernel paging request at 0000000000001e28
        IP: [<ffffffffa02ae8b4>] hwmon_attributes_visible+0x18/0x3d [radeon]
        PGD 15057e067 PUD 151a8e067 PMD 0
        Oops: 0000 [#1] PREEMPT SMP
        Call Trace:
          internal_create_group+0x114/0x1d9
          sysfs_create_group+0xe/0x10
          sysfs_create_groups+0x22/0x5f
          device_add+0x34f/0x501
          device_register+0x15/0x18
          hwmon_device_register_with_groups+0xb5/0xed
          radeon_hwmon_init+0x56/0x7c [radeon]
          radeon_pm_init+0x134/0x7e5 [radeon]
          radeon_modeset_init+0x75f/0x8ed [radeon]
          radeon_driver_load_kms+0xc6/0x187 [radeon]
          drm_dev_register+0xf9/0x1b4 [drm]
          drm_get_pci_dev+0x98/0x129 [drm]
          radeon_pci_probe+0xa3/0xac [radeon]
          pci_device_probe+0x6e/0xcf
          driver_probe_device+0x98/0x1c4
          __driver_attach+0x5c/0x7e
          bus_for_each_dev+0x7b/0x85
          driver_attach+0x19/0x1b
          bus_add_driver+0x104/0x1ce
          driver_register+0x89/0xc5
          __pci_register_driver+0x58/0x5b
          drm_pci_init+0x86/0xea [drm]
          radeon_init+0x97/0x1000 [radeon]
          do_one_initcall+0x7f/0x117
          load_module+0x1583/0x1bb4
          SyS_init_module+0xa0/0xaf
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Alexander Deucher <Alexander.Deucher@amd.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e4158f1b
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 4a251dd2
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Revert CHECKSUM_COMPLETE optimization in pskb_trim_rcsum(), I can't
          figure out why it breaks things.
      
       2) Fix comparison in netfilter ipset's hash_netnet4_data_equal(), it
          was basically doing "x == x", from Dave Jones.
      
       3) Freescale FEC driver was DMA mapping the wrong number of bytes, from
          Sebastian Siewior.
      
       4) Blackhole and prohibit routes in ipv6 were not doing the right thing
          because their ->input and ->output methods were not being assigned
          correctly.  Now they behave properly like their ipv4 counterparts.
          From Kamala R.
      
       5) Several drivers advertise the NETIF_F_FRAGLIST capability, but
          really do not support this feature and will send garbage packets if
          fed fraglist SKBs.  From Eric Dumazet.
      
       6) Fix long standing user triggerable BUG_ON over loopback in RDS
          protocol stack, from Venkat Venkatsubra.
      
       7) Several not so common code paths can potentially try to invoke
          packet scheduler actions that might be NULL without checking.  Shore
          things up by either 1) defining a method as mandatory and erroring
          on registration if that method is NULL 2) defininig a method as
          optional and the registration function hooks up a default
          implementation when NULL is seen.  From Jamal Hadi Salim.
      
       8) Fix fragment detection in xen-natback driver, from Paul Durrant.
      
       9) Kill dangling enter_memory_pressure method in cg_proto ops, from
          Eric W Biederman.
      
      10) SKBs that traverse namespaces should have their local_df cleared,
          from Hannes Frederic Sowa.
      
      11) IOCB file position is not being updated by macvtap_aio_read() and
          tun_chr_aio_read().  From Zhi Yong Wu.
      
      12) Don't free virtio_net netdev before releasing all of the NAPI
          instances.  From Andrey Vagin.
      
      13) Procfs entry leak in xt_hashlimit, from Sergey Popovich.
      
      14) IPv6 routes that are no cached routes should not count against the
          garbage collection limits.  We had this almost right, but were
          missing handling addrconf generated routes properly.  From Hannes
          Frederic Sowa.
      
      15) fib{4,6}_rule_suppress() have to consider potentially seeing NULL
          route info when they are called, from Stefan Tomanek.
      
      16) TUN and MACVTAP have had truncated packet signalling for some time,
          fix from Jason Wang.
      
      17) Fix use after frrr in __udp4_lib_rcv(), from Eric Dumazet.
      
      18) xen-netback does not interpret the NAPI budget properly for TX work,
          fix from Paul Durrant.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (132 commits)
        igb: Fix for issue where values could be too high for udelay function.
        i40e: fix null dereference
        xen-netback: fix gso_prefix check
        net: make neigh_priv_len in struct net_device 16bit instead of 8bit
        drivers: net: cpsw: fix for cpsw crash when build as modules
        xen-netback: napi: don't prematurely request a tx event
        xen-netback: napi: fix abuse of budget
        sch_tbf: use do_div() for 64-bit divide
        udp: ipv4: must add synchronization in udp_sk_rx_dst_set()
        net:fec: remove duplicate lines in comment about errata ERR006358
        Revert "8390 : Replace ei_debug with msg_enable/NETIF_MSG_* feature"
        8390 : Replace ei_debug with msg_enable/NETIF_MSG_* feature
        xen-netback: make sure skb linear area covers checksum field
        net: smc91x: Fix device tree based configuration so it's usable
        udp: ipv4: fix potential use after free in udp_v4_early_demux()
        macvtap: signal truncated packets
        tun: unbreak truncated packet signalling
        net: sched: htb: fix the calculation of quantum
        net: sched: tbf: fix the calculation of max_size
        micrel: add support for KSZ8041RNLI
        ...
      4a251dd2
    • Linus Torvalds's avatar
      Merge branch 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 908bfda7
      Linus Torvalds authored
      Pull x86 fixes from Peter Anvin:
       "This is a pretty small batch:
      
        The biggest single change is to stop using EFI time services on 32-bit
        platforms.  This matches our current behavior on 64-bit platforms as
        we already had ruled them out there as being too unreliable.  Turns
        out that affects 32-bit platforms, too.
      
        One NULL pointer fix for SGI UV.
      
        Two minor build fixes, one of which only affects icc and the other
        which affects icc and future versions or nonstandard default settings
        of gcc"
      
      * 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86, efi: Don't use (U)EFI time services on 32 bit
        x86, build, icc: Remove uninitialized_var() from compiler-intel.h
        x86/UV: Fix NULL pointer dereference in uv_flush_tlb_others() if the 'nobau' boot option is used
        x86, build: Pass in additional -mno-mmx, -mno-sse options
      908bfda7
    • Linus Torvalds's avatar
      Merge tag 'pci-v3.13-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 9199c4ca
      Linus Torvalds authored
      Pull PCI updates from Bjorn Helgaas:
       "PCI device hotplug
          - Move device_del() from pci_stop_dev() to pci_destroy_dev() (Rafael
            Wysocki)
      
        Host bridge drivers
          - Update maintainers for DesignWare, i.MX6, Armada, R-Car (Bjorn
            Helgaas)
          - mvebu: Return 'unsupported' for Interrupt Line and Interrupt Pin
            (Jason Gunthorpe)
      
        Miscellaneous
          - Avoid unnecessary CPU switch when calling .probe() (Alexander
            Duyck)
          - Revert "workqueue: allow work_on_cpu() to be called recursively"
            (Bjorn Helgaas)
          - Disable Bus Master only on kexec reboot (Khalid Aziz)
          - Omit PCI ID macro strings to shorten quirk names for LTO (Michal
            Marek)"
      
      * tag 'pci-v3.13-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        MAINTAINERS: Add DesignWare, i.MX6, Armada, R-Car PCI host maintainers
        PCI: Disable Bus Master only on kexec reboot
        PCI: mvebu: Return 'unsupported' for Interrupt Line and Interrupt Pin
        PCI: Omit PCI ID macro strings to shorten quirk names
        PCI: Move device_del() from pci_stop_dev() to pci_destroy_dev()
        Revert "workqueue: allow work_on_cpu() to be called recursively"
        PCI: Avoid unnecessary CPU switch when calling driver .probe() method
      9199c4ca
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · b5745c59
      Linus Torvalds authored
      Pull SELinux fixes from James Morris.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        selinux: process labeled IPsec TCP SYN-ACK packets properly in selinux_ip_postroute()
        selinux: look for IPsec labels on both inbound and outbound packets
        selinux: handle TCP SYN-ACK packets correctly in selinux_ip_postroute()
        selinux: handle TCP SYN-ACK packets correctly in selinux_ip_output()
        selinux: fix possible memory leak
      b5745c59
    • Linus Torvalds's avatar
      Revert "selinux: consider filesystem subtype in policies" · 29b1deb2
      Linus Torvalds authored
      This reverts commit 102aefdd.
      
      Tom London reports that it causes sync() to hang on Fedora rawhide:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=1033965
      
      and Josh Boyer bisected it down to this commit.  Reverting the commit in
      the rawhide kernel fixes the problem.
      
      Eric Paris root-caused it to incorrect subtype matching in that commit
      breaking fuse, and has a tentative patch, but by now we're better off
      retrying this in 3.14 rather than playing with it any more.
      Reported-by: default avatarTom London <selinux@gmail.com>
      Bisected-by: default avatarJosh Boyer <jwboyer@fedoraproject.org>
      Acked-by: default avatarEric Paris <eparis@redhat.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: Anand Avati <avati@redhat.com>
      Cc: Paul Moore <paul@paul-moore.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      29b1deb2
    • Carolyn Wyborny's avatar
      igb: Fix for issue where values could be too high for udelay function. · df29df92
      Carolyn Wyborny authored
      This patch changes the igb_phy_has_link function to check the value of the
      parameter before deciding to use udelay or mdelay in order to be sure that
      the value is not too high for udelay function.
      
      CC: stable kernel <stable@vger.kernel.org> # 3.9+
      Signed-off-by: default avatarSunil K Pandey <sunil.k.pandey@intel.com>
      Signed-off-by: default avatarKevin B Smith <kevin.b.smith@intel.com>
      Signed-off-by: default avatarCarolyn Wyborny <carolyn.wyborny@intel.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      df29df92
    • Jesse Brandeburg's avatar
      i40e: fix null dereference · 3c325ced
      Jesse Brandeburg authored
      If the vsi->tx_rings structure is NULL we don't want to panic.
      
      Change-Id: Ic694f043701738c434e8ebe0caf0673f4410dc10
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: default avatarKavindya Deegala <kavindya.s.deegala@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3c325ced
  8. 14 Dec, 2013 2 commits