History log of /drivers/platform/x86/intel_ips.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
797a796a13df6b84a4791e57306737059b5b2384 07-Feb-2012 Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> asm-generic: architecture independent readq/writeq for 32bit environment

This provides unified readq()/writeq() helper functions for 32-bit
drivers.

For some cases, readq/writeq without atomicity is harmful, and order of
io access has to be specified explicitly. So in this patch, new two
header files which contain non-atomic readq/writeq are added.

- <asm-generic/io-64-nonatomic-lo-hi.h> provides non-atomic readq/
writeq with the order of lower address -> higher address

- <asm-generic/io-64-nonatomic-hi-lo.h> provides non-atomic readq/
writeq with reversed order

This allows us to remove some readq()s that were added drivers when the
default non-atomic ones were removed in commit dbee8a0affd5 ("x86:
remove 32-bit versions of readq()/writeq()")

The drivers which need readq/writeq but can do with the non-atomic ones
must add the line:

#include <asm-generic/io-64-nonatomic-lo-hi.h> /* or hi-lo.h */

But this will be nop in 64-bit environments, and no other #ifdefs are
required. So I believe that this patch can solve the problem of
1. driver-specific readq/writeq
2. atomicity and order of io access

This patch is tested with building allyesconfig and allmodconfig as
ARCH=x86 and ARCH=i386 on top of tip/master.

Cc: Kashyap Desai <Kashyap.Desai@lsi.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Ravi Anand <ravi.anand@qlogic.com>
Cc: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Jason Uhlenkott <juhlenko@akamai.com>
Cc: James Bottomley <James.Bottomley@parallels.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Roland Dreier <roland@purestorage.com>
Cc: James Bottomley <jbottomley@parallels.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Hitoshi Mitake <h.mitake@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/platform/x86/intel_ips.c
70fda70a724c737b0df4195763f9124d181fe64d 22-Jul-2011 Jesse Barnes <jbarnes@virtuousgeek.org> x86 driver: fix typo in TDP override enabling

When enabling turbo, we need to set both the TDC and TDP bits. IIRC
only the TDC one actually matters, but fix it up anyway since the
current code is confusing.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
dbee8a0affd5e6eaa5d7c816c4bc233f6f110f50 25-May-2011 Roland Dreier <roland@purestorage.com> x86: remove 32-bit versions of readq()/writeq()

The presense of a writeq() implementation on 32-bit x86 that splits the
64-bit write into two 32-bit writes turns out to break the mpt2sas driver
(and in general is risky for drivers as was discussed in
<http://lkml.kernel.org/r/adaab6c1h7c.fsf@cisco.com>). To fix this,
revert 2c5643b1c5c7 ("x86: provide readq()/writeq() on 32-bit too") and
follow-on cleanups.

This unfortunately leads to pushing non-atomic definitions of readq() and
write() to various x86-only drivers that in the meantime started using the
definitions in the x86 version of <asm/io.h>. However as discussed
exhaustively, this is actually the right thing to do, because the right
way to split a 64-bit transaction is hardware dependent and therefore
belongs in the hardware driver (eg mpt2sas needs a spinlock to make sure
no other accesses occur in between the two halves of the access).

Build tested on 32- and 64-bit x86 allmodconfig.

Link: http://lkml.kernel.org/r/x86-32-writeq-is-broken@mdm.bga.com
Acked-by: Hitoshi Mitake <h.mitake@gmail.com>
Cc: Kashyap Desai <Kashyap.Desai@lsi.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Ravi Anand <ravi.anand@qlogic.com>
Cc: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Jason Uhlenkott <juhlenko@akamai.com>
Acked-by: James Bottomley <James.Bottomley@parallels.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/platform/x86/intel_ips.c
a3424216e4935221fdaa5ca3c26e024f11297164 28-Mar-2011 Jesse Barnes <jbarnes@virtuousgeek.org> ips: use interruptible waits in ips-monitor

This is what I intended to do since:
1) the driver handles variable waits just fine, and
2) interruptible waits aren't reported as load in the load avg.

Reported-and-tested-by: Andreas Hartmann <andihartmann@freenet.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
7027d8b570244f0fa3aaebccf0bcd8e95e172631 09-Jan-2011 Randy Dunlap <randy.dunlap@oracle.com> intel_ips: fix sparse non-ANSI function warning

Fix sparse warning for non-ANSI function declaration:

drivers/platform/x86/intel_ips.c:1477:25: warning: non-ANSI function declaration of function 'ips_link_to_i915_driver'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
63ee41d794d9c555f84205517a68509848988760 21-Dec-2010 Eric Anholt <eric@anholt.net> drm/i915, intel_ips: When i915 loads after IPS, make IPS relink to i915.

The IPS driver is designed to be able to run detached from i915 and
just not enable GPU turbo in that case, in order to avoid module
dependencies between the two drivers. This means that we don't know
what the load order between the two is going to be, and we had
previously only supported IPS after (optionally) i915, but not i915
after IPS. If the wrong order was chosen, you'd get no GPU turbo, and
something like half the possible graphics performance.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
/drivers/platform/x86/intel_ips.c
d24a9da573444ab4aff38af2f4a0da07408ff491 05-Oct-2010 Matthew Garrett <mjg@redhat.com> IPS driver: Fix limit clamping when reducing CPU power

Values here are in internal units rather than Watts, so we shouldn't
perform any conversion.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
96f3823f537088c13735cfdfbf284436c802352a 05-Oct-2010 Jesse Barnes <jbarnes@virtuousgeek.org> [PATCH 2/2] IPS driver: disable CPU turbo

The undocumented interface we're using for reading CPU power seems to be
overreporting power. Until we figure out how to correct it, disable CPU
turbo and power reporting to be safe. This will keep the CPU within default
limits and still allow us to increase GPU frequency as needed.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
4fd07ac00d87b942cc8d8f30a27192fea2fc4ab2 05-Oct-2010 Jesse Barnes <jbarnes@virtuousgeek.org> IPS driver: apply BIOS provided CPU limit if different from default

The BIOS may hand us a lower CPU power limit than the default for a
given SKU. We should use it in case the platform isn't designed to
dissapate the full TDP of a given part.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
070c0ee1ef9f5550cac9247190f0289349f28c01 05-Oct-2010 Andy Whitcroft <apw@canonical.com> intel_ips -- ensure we do not enable gpu turbo mode without driver linkage

Both when polling the current turbo status (in poll_turbo_status mode)
and when handling thermal events (in ips_irq_handler) the current status
of GPU turbo is updated to match the hardware status. However if during
driver initialisation we were unable aquire linkage to the i915 driver
enabling GPU turbo will lead to an oops on the first attempt to determine
GPU busy status.

Ensure that we do not enable GPU turbo unless we have driver linkage.

BugLink: http://bugs.launchpad.net/bugs/632430
Cc: stable@kernel.org
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
a8c096adbd2b55942ff13c8bbc573a7551768003 28-Sep-2010 Tim Gardner <tim.gardner@canonical.com> intel_ips: Print MCP limit exceeded values.

Print some interesting values when MCP limits
are exceeded.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
eceab272fb895148f6293b5c0644fc2dd36d3aff 23-Sep-2010 Jesse Barnes <jbarnes@virtuousgeek.org> IPS driver: verify BIOS provided limits

They're optional. If not present or sane, we should use the CPU
defaults.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
354aeeb1ca8f82ea133ede21987034addc75057a 23-Sep-2010 Jesse Barnes <jbarnes@virtuousgeek.org> IPS driver: don't toggle CPU turbo on unsupported CPUs

If the CPU doesn't support turbo, don't try to enable/disable it.

http://bugzilla.kernel.org/show_bug.cgi?id=18742

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
a7abda8d721359363d679c5f2de964f29419568c 17-Sep-2010 minskey guo <chaohong.guo@linux.intel.com> NULL pointer might be used in ips_monitor()

The patch is to create ips_adjust thread before ips_monitor begins
to run because the latter will kthread_stop() or wake up the former
via ips->adjust pointer. Without this change, it is possible that
ips->adjust is NULL when kthread_stop() or wake_up_process() is
called in ips_monitor().

Signed-off-by: minskey guo <chaohong.guo@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
fed522f7ea780d195d5d3e55df95fee520136e17 17-Sep-2010 minskey guo <chaohong.guo@linux.intel.com> Release symbol on error-handling path of ips_get_i915_syms()

In ips_get_i915_syms(), the symbol i915_gpu_busy() is not released
when error occurs.

Signed-off-by: minskey guo <chaohong.guo@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
c21eae4f7c38db0e4693fb4cb24fb42fb83d8c15 17-Sep-2010 minskey guo <chaohong.guo@linux.intel.com> old_cpu_power is wrongly divided by 65535 in ips_monitor()

The variable old_cpu_power is used to save the value of THM_CEC
register. In get_cpu_power(), it will be divided by 65535.

Signed-off-by: minskey guo <chaohong.guo@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
6230d18cc7c4c68b7a38ea73bf5910e7652e5b21 17-Sep-2010 minskey guo <chaohong.guo@linux.intel.com> seqno mask of THM_ITV register is 16bit

The mask of sequence number in THM_ITV register is 16bit width instead
of 8bit.

Signed-off-by: minskey guo <chaohong.guo@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
52d7ee558d3babb4918eed6769f593adc1b6616e 08-Aug-2010 Dan Carpenter <error27@gmail.com> intel_ips: potential null dereference

There is a potential NULL dereference of "limits." We can just return
NULL earlier to avoid it. The caller already handles NULL returns.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
5629236b31239dbaa182cb7eb39aad4d62278f7c 03-Aug-2010 Kulikov Vasiliy <segooon@gmail.com> x86: intel_ips: do not use PCI resources before pci_enable_device()

IRQ and resource[] may not have correct values until
after PCI hotplug setup occurs at pci_enable_device() time.

The semantic match that finds this problem is as follows:

// <smpl>
@@
identifier x;
identifier request ~= "pci_request.*|pci_resource.*";
@@

(
* x->irq
|
* x->resource
|
* request(x, ...)
)
...
*pci_enable_device(x)
// </smpl>

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
1a14703d6b20010401ca273ac1f07bff7992aa2c 28-Jul-2010 Jesse Barnes <jbarnes@virtuousgeek.org> ips driver: make it less chatty

We don't need a dev_warn when we exceed a thermal or power limit as
we'll handle it appropriately by clamping down on the CPU, GPU or both
as needed.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
e9ec7f3539cbeae8ffc5d7b30543e5612df5cba3 21-Jun-2010 Jiri Slaby <jslaby@suse.cz> X86: intel_ips, check for kzalloc properly

Stanse found that there are two NULL checks missing in ips_monitor. So
check their value too and bail out appropriately if the allocation
failed.

While at it, add one more kfree to the fail path. It is not necessary
now, but may be needed in the future when a new allocation is added.
And for completeness.

Also remove unneeded initialization of the variables. They are all set
right after their declaration.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
/drivers/platform/x86/intel_ips.c
0385e5210c83b13fe685c54b6063655f80bce3ee 20-May-2010 Jesse Barnes <jbarnes@virtuousgeek.org> IPS driver: add GPU busy and turbo checking

Be sure to enable GPU turbo by default at load time and check GPU busy
and MCP exceeded status correctly. Also fix up CPU power comparison and
work around buggy MCH temp reporting.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c
aa7ffc01d254c91a36bf854d57a14049c6134c72 15-May-2010 Jesse Barnes <jbarnes@virtuousgeek.org> x86 platform driver: intelligent power sharing driver

Intel Core i3/5 platforms with integrated graphics support both CPU and
GPU turbo mode. CPU turbo mode is opportunistic: the CPU will use any
available power to increase core frequencies if thermal headroom is
available. The GPU side is more manual however; the graphics driver
must monitor GPU power and temperature and coordinate with a core
thermal driver to take advantage of available thermal and power headroom
in the package.

The intelligent power sharing (IPS) driver is intended to coordinate
this activity by monitoring MCP (multi-chip package) temperature and
power, allowing the CPU and/or GPU to increase their power consumption,
and thus performance, when possible. The goal is to maximize
performance within a given platform's TDP (thermal design point).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
/drivers/platform/x86/intel_ips.c