Commit f40d6817 authored by Eric Anholt's avatar Eric Anholt
Browse files

Merge remote branch 'airlied/drm-next' into drm-intel-next

parents 103a196f 46557bef
...@@ -8,7 +8,7 @@ Supported adapters: ...@@ -8,7 +8,7 @@ Supported adapters:
Datasheet: Only available via NDA from ServerWorks Datasheet: Only available via NDA from ServerWorks
* ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges
Datasheet: Not publicly available Datasheet: Not publicly available
* AMD SB900 * AMD Hudson-2
Datasheet: Not publicly available Datasheet: Not publicly available
* Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge
Datasheet: Publicly available at the SMSC website http://www.smsc.com Datasheet: Publicly available at the SMSC website http://www.smsc.com
......
Generic Thermal Sysfs driver How To Generic Thermal Sysfs driver How To
========================= ===================================
Written by Sujith Thomas <sujith.thomas@intel.com>, Zhang Rui <rui.zhang@intel.com> Written by Sujith Thomas <sujith.thomas@intel.com>, Zhang Rui <rui.zhang@intel.com>
...@@ -10,20 +10,20 @@ Copyright (c) 2008 Intel Corporation ...@@ -10,20 +10,20 @@ Copyright (c) 2008 Intel Corporation
0. Introduction 0. Introduction
The generic thermal sysfs provides a set of interfaces for thermal zone devices (sensors) The generic thermal sysfs provides a set of interfaces for thermal zone
and thermal cooling devices (fan, processor...) to register with the thermal management devices (sensors) and thermal cooling devices (fan, processor...) to register
solution and to be a part of it. with the thermal management solution and to be a part of it.
This how-to focuses on enabling new thermal zone and cooling devices to participate This how-to focuses on enabling new thermal zone and cooling devices to
in thermal management. participate in thermal management.
This solution is platform independent and any type of thermal zone devices and This solution is platform independent and any type of thermal zone devices
cooling devices should be able to make use of the infrastructure. and cooling devices should be able to make use of the infrastructure.
The main task of the thermal sysfs driver is to expose thermal zone attributes as well The main task of the thermal sysfs driver is to expose thermal zone attributes
as cooling device attributes to the user space. as well as cooling device attributes to the user space.
An intelligent thermal management application can make decisions based on inputs An intelligent thermal management application can make decisions based on
from thermal zone attributes (the current temperature and trip point temperature) inputs from thermal zone attributes (the current temperature and trip point
and throttle appropriate devices. temperature) and throttle appropriate devices.
[0-*] denotes any positive number starting from 0 [0-*] denotes any positive number starting from 0
[1-*] denotes any positive number starting from 1 [1-*] denotes any positive number starting from 1
...@@ -31,77 +31,77 @@ and throttle appropriate devices. ...@@ -31,77 +31,77 @@ and throttle appropriate devices.
1. thermal sysfs driver interface functions 1. thermal sysfs driver interface functions
1.1 thermal zone device interface 1.1 thermal zone device interface
1.1.1 struct thermal_zone_device *thermal_zone_device_register(char *name, int trips, 1.1.1 struct thermal_zone_device *thermal_zone_device_register(char *name,
void *devdata, struct thermal_zone_device_ops *ops) int trips, void *devdata, struct thermal_zone_device_ops *ops)
This interface function adds a new thermal zone device (sensor) to This interface function adds a new thermal zone device (sensor) to
/sys/class/thermal folder as thermal_zone[0-*]. /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the
It tries to bind all the thermal cooling devices registered at the same time. thermal cooling devices registered at the same time.
name: the thermal zone name. name: the thermal zone name.
trips: the total number of trip points this thermal zone supports. trips: the total number of trip points this thermal zone supports.
devdata: device private data devdata: device private data
ops: thermal zone device call-backs. ops: thermal zone device call-backs.
.bind: bind the thermal zone device with a thermal cooling device. .bind: bind the thermal zone device with a thermal cooling device.
.unbind: unbind the thermal zone device with a thermal cooling device. .unbind: unbind the thermal zone device with a thermal cooling device.
.get_temp: get the current temperature of the thermal zone. .get_temp: get the current temperature of the thermal zone.
.get_mode: get the current mode (user/kernel) of the thermal zone. .get_mode: get the current mode (user/kernel) of the thermal zone.
"kernel" means thermal management is done in kernel. - "kernel" means thermal management is done in kernel.
"user" will prevent kernel thermal driver actions upon trip points - "user" will prevent kernel thermal driver actions upon trip points
so that user applications can take charge of thermal management. so that user applications can take charge of thermal management.
.set_mode: set the mode (user/kernel) of the thermal zone. .set_mode: set the mode (user/kernel) of the thermal zone.
.get_trip_type: get the type of certain trip point. .get_trip_type: get the type of certain trip point.
.get_trip_temp: get the temperature above which the certain trip point .get_trip_temp: get the temperature above which the certain trip point
will be fired. will be fired.
1.1.2 void thermal_zone_device_unregister(struct thermal_zone_device *tz) 1.1.2 void thermal_zone_device_unregister(struct thermal_zone_device *tz)
This interface function removes the thermal zone device. This interface function removes the thermal zone device.
It deletes the corresponding entry form /sys/class/thermal folder and unbind all It deletes the corresponding entry form /sys/class/thermal folder and
the thermal cooling devices it uses. unbind all the thermal cooling devices it uses.
1.2 thermal cooling device interface 1.2 thermal cooling device interface
1.2.1 struct thermal_cooling_device *thermal_cooling_device_register(char *name, 1.2.1 struct thermal_cooling_device *thermal_cooling_device_register(char *name,
void *devdata, struct thermal_cooling_device_ops *) void *devdata, struct thermal_cooling_device_ops *)
This interface function adds a new thermal cooling device (fan/processor/...) to This interface function adds a new thermal cooling device (fan/processor/...)
/sys/class/thermal/ folder as cooling_device[0-*]. to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind itself
It tries to bind itself to all the thermal zone devices register at the same time. to all the thermal zone devices register at the same time.
name: the cooling device name. name: the cooling device name.
devdata: device private data. devdata: device private data.
ops: thermal cooling devices call-backs. ops: thermal cooling devices call-backs.
.get_max_state: get the Maximum throttle state of the cooling device. .get_max_state: get the Maximum throttle state of the cooling device.
.get_cur_state: get the Current throttle state of the cooling device. .get_cur_state: get the Current throttle state of the cooling device.
.set_cur_state: set the Current throttle state of the cooling device. .set_cur_state: set the Current throttle state of the cooling device.
1.2.2 void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev) 1.2.2 void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev)
This interface function remove the thermal cooling device. This interface function remove the thermal cooling device.
It deletes the corresponding entry form /sys/class/thermal folder and unbind It deletes the corresponding entry form /sys/class/thermal folder and
itself from all the thermal zone devices using it. unbind itself from all the thermal zone devices using it.
1.3 interface for binding a thermal zone device with a thermal cooling device 1.3 interface for binding a thermal zone device with a thermal cooling device
1.3.1 int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, 1.3.1 int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
int trip, struct thermal_cooling_device *cdev); int trip, struct thermal_cooling_device *cdev);
This interface function bind a thermal cooling device to the certain trip point This interface function bind a thermal cooling device to the certain trip
of a thermal zone device. point of a thermal zone device.
This function is usually called in the thermal zone device .bind callback. This function is usually called in the thermal zone device .bind callback.
tz: the thermal zone device tz: the thermal zone device
cdev: thermal cooling device cdev: thermal cooling device
trip: indicates which trip point the cooling devices is associated with trip: indicates which trip point the cooling devices is associated with
in this thermal zone. in this thermal zone.
1.3.2 int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz, 1.3.2 int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz,
int trip, struct thermal_cooling_device *cdev); int trip, struct thermal_cooling_device *cdev);
This interface function unbind a thermal cooling device from the certain trip point This interface function unbind a thermal cooling device from the certain
of a thermal zone device. trip point of a thermal zone device. This function is usually called in
This function is usually called in the thermal zone device .unbind callback. the thermal zone device .unbind callback.
tz: the thermal zone device tz: the thermal zone device
cdev: thermal cooling device cdev: thermal cooling device
trip: indicates which trip point the cooling devices is associated with trip: indicates which trip point the cooling devices is associated with
in this thermal zone. in this thermal zone.
2. sysfs attributes structure 2. sysfs attributes structure
...@@ -114,153 +114,166 @@ if hwmon is compiled in or built as a module. ...@@ -114,153 +114,166 @@ if hwmon is compiled in or built as a module.
Thermal zone device sys I/F, created once it's registered: Thermal zone device sys I/F, created once it's registered:
/sys/class/thermal/thermal_zone[0-*]: /sys/class/thermal/thermal_zone[0-*]:
|-----type: Type of the thermal zone |---type: Type of the thermal zone
|-----temp: Current temperature |---temp: Current temperature
|-----mode: Working mode of the thermal zone |---mode: Working mode of the thermal zone
|-----trip_point_[0-*]_temp: Trip point temperature |---trip_point_[0-*]_temp: Trip point temperature
|-----trip_point_[0-*]_type: Trip point type |---trip_point_[0-*]_type: Trip point type
Thermal cooling device sys I/F, created once it's registered: Thermal cooling device sys I/F, created once it's registered:
/sys/class/thermal/cooling_device[0-*]: /sys/class/thermal/cooling_device[0-*]:
|-----type : Type of the cooling device(processor/fan/...) |---type: Type of the cooling device(processor/fan/...)
|-----max_state: Maximum cooling state of the cooling device |---max_state: Maximum cooling state of the cooling device
|-----cur_state: Current cooling state of the cooling device |---cur_state: Current cooling state of the cooling device
These two dynamic attributes are created/removed in pairs. Then next two dynamic attributes are created/removed in pairs. They represent
They represent the relationship between a thermal zone and its associated cooling device. the relationship between a thermal zone and its associated cooling device.
They are created/removed for each They are created/removed for each successful execution of
thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful execution. thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device.
/sys/class/thermal/thermal_zone[0-*] /sys/class/thermal/thermal_zone[0-*]:
|-----cdev[0-*]: The [0-*]th cooling device in the current thermal zone |---cdev[0-*]: [0-*]th cooling device in current thermal zone
|-----cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with |---cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with
Besides the thermal zone device sysfs I/F and cooling device sysfs I/F, Besides the thermal zone device sysfs I/F and cooling device sysfs I/F,
the generic thermal driver also creates a hwmon sysfs I/F for each _type_ of the generic thermal driver also creates a hwmon sysfs I/F for each _type_
thermal zone device. E.g. the generic thermal driver registers one hwmon class device of thermal zone device. E.g. the generic thermal driver registers one hwmon
and build the associated hwmon sysfs I/F for all the registered ACPI thermal zones. class device and build the associated hwmon sysfs I/F for all the registered
ACPI thermal zones.
/sys/class/hwmon/hwmon[0-*]: /sys/class/hwmon/hwmon[0-*]:
|-----name: The type of the thermal zone devices. |---name: The type of the thermal zone devices
|-----temp[1-*]_input: The current temperature of thermal zone [1-*]. |---temp[1-*]_input: The current temperature of thermal zone [1-*]
|-----temp[1-*]_critical: The critical trip point of thermal zone [1-*]. |---temp[1-*]_critical: The critical trip point of thermal zone [1-*]
Please read Documentation/hwmon/sysfs-interface for additional information. Please read Documentation/hwmon/sysfs-interface for additional information.
*************************** ***************************
* Thermal zone attributes * * Thermal zone attributes *
*************************** ***************************
type Strings which represent the thermal zone type. type
This is given by thermal zone driver as part of registration. Strings which represent the thermal zone type.
Eg: "acpitz" indicates it's an ACPI thermal device. This is given by thermal zone driver as part of registration.
In order to keep it consistent with hwmon sys attribute, E.g: "acpitz" indicates it's an ACPI thermal device.
this should be a short, lowercase string, In order to keep it consistent with hwmon sys attribute; this should
not containing spaces nor dashes. be a short, lowercase string, not containing spaces nor dashes.
RO RO, Required
Required
temp
temp Current temperature as reported by thermal zone (sensor) Current temperature as reported by thermal zone (sensor).
Unit: millidegree Celsius Unit: millidegree Celsius
RO RO, Required
Required
mode
mode One of the predefined values in [kernel, user] One of the predefined values in [kernel, user].
This file gives information about the algorithm This file gives information about the algorithm that is currently
that is currently managing the thermal zone. managing the thermal zone. It can be either default kernel based
It can be either default kernel based algorithm algorithm or user space application.
or user space application. kernel = Thermal management in kernel thermal zone driver.
RW user = Preventing kernel thermal zone driver actions upon
Optional trip points so that user application can take full
kernel = Thermal management in kernel thermal zone driver. charge of the thermal management.
user = Preventing kernel thermal zone driver actions upon RW, Optional
trip points so that user application can take full
charge of the thermal management. trip_point_[0-*]_temp
The temperature above which trip point will be fired.
trip_point_[0-*]_temp The temperature above which trip point will be fired Unit: millidegree Celsius
Unit: millidegree Celsius RO, Optional
RO
Optional trip_point_[0-*]_type
Strings which indicate the type of the trip point.
trip_point_[0-*]_type Strings which indicate the type of the trip point E.g. it can be one of critical, hot, passive, active[0-*] for ACPI
E.g. it can be one of critical, hot, passive, thermal zone.
active[0-*] for ACPI thermal zone. RO, Optional
RO
Optional cdev[0-*]
Sysfs link to the thermal cooling device node where the sys I/F
cdev[0-*] Sysfs link to the thermal cooling device node where the sys I/F for cooling device throttling control represents.
for cooling device throttling control represents. RO, Optional
RO
Optional cdev[0-*]_trip_point
The trip point with which cdev[0-*] is associated in this thermal
cdev[0-*]_trip_point The trip point with which cdev[0-*] is associated in this thermal zone zone; -1 means the cooling device is not associated with any trip
-1 means the cooling device is not associated with any trip point. point.
RO RO, Optional
Optional
passive
****************************** Attribute is only present for zones in which the passive cooling
* Cooling device attributes * policy is not supported by native thermal driver. Default is zero
****************************** and can be set to a temperature (in millidegrees) to enable a
passive trip point for the zone. Activation is done by polling with
type String which represents the type of device an interval of 1 second.
eg: For generic ACPI: this should be "Fan", Unit: millidegrees Celsius
"Processor" or "LCD" RW, Optional
eg. For memory controller device on intel_menlow platform:
this should be "Memory controller" *****************************
RO * Cooling device attributes *
Required *****************************
max_state The maximum permissible cooling state of this cooling device. type
RO String which represents the type of device, e.g:
Required - for generic ACPI: should be "Fan", "Processor" or "LCD"
- for memory controller device on intel_menlow platform:
cur_state The current cooling state of this cooling device. should be "Memory controller".
the value can any integer numbers between 0 and max_state, RO, Required
cur_state == 0 means no cooling
cur_state == max_state means the maximum cooling. max_state
RW The maximum permissible cooling state of this cooling device.
Required RO, Required
cur_state
The current cooling state of this cooling device.
The value can any integer numbers between 0 and max_state:
- cur_state == 0 means no cooling
- cur_state == max_state means the maximum cooling.
RW, Required
3. A simple implementation 3. A simple implementation
ACPI thermal zone may support multiple trip points like critical/hot/passive/active. ACPI thermal zone may support multiple trip points like critical, hot,
If an ACPI thermal zone supports critical, passive, active[0] and active[1] at the same time, passive, active. If an ACPI thermal zone supports critical, passive,
it may register itself as a thermal_zone_device (thermal_zone1) with 4 trip points in all. active[0] and active[1] at the same time, it may register itself as a
It has one processor and one fan, which are both registered as thermal_cooling_device. thermal_zone_device (thermal_zone1) with 4 trip points in all.
If the processor is listed in _PSL method, and the fan is listed in _AL0 method, It has one processor and one fan, which are both registered as
the sys I/F structure will be built like this: thermal_cooling_device.
If the processor is listed in _PSL method, and the fan is listed in _AL0
method, the sys I/F structure will be built like this:
/sys/class/thermal: /sys/class/thermal:
|thermal_zone1: |thermal_zone1:
|-----type: acpitz |---type: acpitz
|-----temp: 37000 |---temp: 37000
|-----mode: kernel |---mode: kernel
|-----trip_point_0_temp: 100000 |---trip_point_0_temp: 100000
|-----trip_point_0_type: critical |---trip_point_0_type: critical
|-----trip_point_1_temp: 80000 |---trip_point_1_temp: 80000
|-----trip_point_1_type: passive |---trip_point_1_type: passive
|-----trip_point_2_temp: 70000 |---trip_point_2_temp: 70000
|-----trip_point_2_type: active0 |---trip_point_2_type: active0
|-----trip_point_3_temp: 60000 |---trip_point_3_temp: 60000
|-----trip_point_3_type: active1 |---trip_point_3_type: active1
|-----cdev0: --->/sys/class/thermal/cooling_device0 |---cdev0: --->/sys/class/thermal/cooling_device0
|-----cdev0_trip_point: 1 /* cdev0 can be used for passive */ |---cdev0_trip_point: 1 /* cdev0 can be used for passive */
|-----cdev1: --->/sys/class/thermal/cooling_device3 |---cdev1: --->/sys/class/thermal/cooling_device3
|-----cdev1_trip_point: 2 /* cdev1 can be used for active[0]*/ |---cdev1_trip_point: 2 /* cdev1 can be used for active[0]*/
|cooling_device0: |cooling_device0:
|-----type: Processor |---type: Processor
|-----max_state: 8 |---max_state: 8
|-----cur_state: 0 |---cur_state: 0
|cooling_device3: |cooling_device3:
|-----type: Fan |---type: Fan
|-----max_state: 2 |---max_state: 2
|-----cur_state: 0 |---cur_state: 0
/sys/class/hwmon: /sys/class/hwmon:
|hwmon0: |hwmon0:
|-----name: acpitz |---name: acpitz
|-----temp1_input: 37000 |---temp1_input: 37000
|-----temp1_crit: 100000 |---temp1_crit: 100000
...@@ -3665,6 +3665,7 @@ L: netdev@vger.kernel.org ...@@ -3665,6 +3665,7 @@ L: netdev@vger.kernel.org
W: http://www.linuxfoundation.org/en/Net W: http://www.linuxfoundation.org/en/Net
W: http://patchwork.ozlabs.org/project/netdev/list/ W: http://patchwork.ozlabs.org/project/netdev/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6.git
S: Maintained S: Maintained
F: net/ F: net/
F: include/net/ F: include/net/
......
# #
# linux/arch/sh/boot/compressed/Makefile # linux/arch/m32r/boot/compressed/Makefile
# #
# create a compressed vmlinux image from the original vmlinux # create a compressed vmlinux image from the original vmlinux
# #
...@@ -47,5 +47,5 @@ suffix_$(CONFIG_KERNEL_GZIP) = gz ...@@ -47,5 +47,5 @@ suffix_$(CONFIG_KERNEL_GZIP) = gz
suffix_$(CONFIG_KERNEL_BZIP2) = bz2 suffix_$(CONFIG_KERNEL_BZIP2) = bz2
suffix_$(CONFIG_KERNEL_LZMA) = lzma suffix_$(CONFIG_KERNEL_LZMA) = lzma
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
$(call if_changed,ld) $(call if_changed,ld)
...@@ -414,6 +414,10 @@ config ARCH_SPARSEMEM_DEFAULT ...@@ -414,6 +414,10 @@ config ARCH_SPARSEMEM_DEFAULT
config ARCH_POPULATES_NODE_MAP config ARCH_POPULATES_NODE_MAP
def_bool y def_bool y
config SYS_SUPPORTS_HUGETLBFS
def_bool y
depends on PPC_BOOK3S_64
source "mm/Kconfig" source "mm/Kconfig"
config ARCH_MEMORY_PROBE config ARCH_MEMORY_PROBE
......
...@@ -777,7 +777,7 @@ int update_persistent_clock(struct timespec now) ...@@ -777,7 +777,7 @@ int update_persistent_clock(struct timespec now)
return ppc_md.set_rtc_time(&tm); return ppc_md.set_rtc_time(&tm);
} }
void read_persistent_clock(struct timespec *ts) static void __read_persistent_clock(struct timespec *ts)
{ {
struct rtc_time tm; struct rtc_time tm;
static int first = 1; static int first = 1;
...@@ -800,10 +800,23 @@ void read_persistent_clock(struct timespec *ts) ...@@ -800,10 +800,23 @@ void read_persistent_clock(struct timespec *ts)
return; return;
} }
ppc_md.get_rtc_time(&tm); ppc_md.get_rtc_time(&tm);
ts->tv_sec = mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, ts->tv_sec = mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec); tm.tm_hour, tm.tm_min, tm.tm_sec);
} }
void read_persistent_clock(struct timespec *ts)
{
__read_persistent_clock(ts);
/* Sanitize it in case real time clock is set below EPOCH */
if (ts->tv_sec < 0) {
ts->tv_sec = 0;
ts->tv_nsec = 0;
}
}
/* clocksource code */ /* clocksource code */
static cycle_t rtc_read(struct clocksource *cs) static cycle_t rtc_read(struct clocksource *cs)
{ {
......
...@@ -48,7 +48,11 @@ static inline void kvmppc_set_exit_type(struct kvm_vcpu *vcpu, int type) {} ...@@ -48,7 +48,11 @@ static inline void kvmppc_set_exit_type(struct kvm_vcpu *vcpu, int type) {}
static inline void kvmppc_account_exit_stat(struct kvm_vcpu *vcpu, int type) static inline void kvmppc_account_exit_stat(struct kvm_vcpu *vcpu, int type)
{ {
/* type has to be known at build time for optimization */ /* type has to be known at build time for optimization */
/* The BUILD_BUG_ON below breaks in funny ways, commented out
* for now ... -BenH
BUILD_BUG_ON(__builtin_constant_p(type)); BUILD_BUG_ON(__builtin_constant_p(type));
*/
switch (type) { switch (type) {
case EXT_INTR_EXITS: case EXT_INTR_EXITS:
vcpu->stat.ext_intr_exits++; vcpu->stat.ext_intr_exits++;
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
* also clear mm->cpu_vm_mask bits when processes are migrated * also clear mm->cpu_vm_mask bits when processes are migrated
*/ */
#define DEBUG_MAP_CONSISTENCY //#define DEBUG_MAP_CONSISTENCY
#define DEBUG_CLAMP_LAST_CONTEXT 31 //#define DEBUG_CLAMP_LAST_CONTEXT 31
//#define DEBUG_HARDER //#define DEBUG_HARDER
/* We don't use DEBUG because it tends to be compiled in always nowadays /* We don't use DEBUG because it tends to be compiled in always nowadays
......
...@@ -432,8 +432,6 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) ...@@ -432,8 +432,6 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
/* Read config space back so we can restore after reset */ /* Read config space back so we can restore after reset */
read_msi_msg(virq, &msg); read_msi_msg(virq, &msg);
entry->msg = msg; entry->msg = msg;
unmask_msi_irq(virq);
} }
return 0; return 0;
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/radix-tree.h> #include <linux/radix-tree.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <linux/msi.h>
#include <linux/of.h> #include <linux/of.h>
#include <asm/firmware.h> #include <asm/firmware.h>
...@@ -219,6 +220,14 @@ static void xics_unmask_irq(unsigned int virq) ...@@ -219,6 +220,14 @@ static void xics_unmask_irq(unsigned int virq)
static unsigned int xics_startup(unsigned int virq) static unsigned int xics_startup(unsigned int virq)
{ {
/*
* The generic MSI code returns with the interrupt disabled on the
* card, using the MSI mask bits. Firmware doesn't appear to unmask
* at that level, so we do it here by hand.
*/
if (irq_to_desc(virq)->msi_desc)
unmask_msi_irq(virq);
/* unmask it */ /* unmask it */
xics_unmask_irq(virq); xics_unmask_irq(virq);
return 0; return 0;
......
...@@ -41,7 +41,7 @@ struct rw_semaphore { ...@@ -41,7 +41,7 @@ struct rw_semaphore {
#endif #endif
#define __RWSEM_INITIALIZER(name) \ #define __RWSEM_INITIALIZER(name) \
{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \
LIST_HEAD_INIT((name).wait_list) \ LIST_HEAD_INIT((name).wait_list) \
__RWSEM_DEP_MAP_INIT(name) } __RWSEM_DEP_MAP_INIT(name) }
......
...@@ -555,7 +555,7 @@ struct dwarf_frame * dwarf_unwind_stack(unsigned long pc, ...@@ -555,7 +555,7 @@ struct dwarf_frame * dwarf_unwind_stack(unsigned long pc,
* NOTE: the return address is guaranteed to be setup by the * NOTE: the return address is guaranteed to be setup by the
* time this function makes its first function call. * time this function makes its first function call.
*/ */
if (!pc && !prev) if (!pc || !prev)
pc = (unsigned long)current_text_addr(); pc = (unsigned long)current_text_addr();
#ifdef CONFIG_FUNCTION_GRAPH_TRACER #ifdef CONFIG_FUNCTION_GRAPH_TRACER
......
...@@ -72,6 +72,7 @@ static void __uses_jump_to_uncached sh4_flush_icache_range(void *args) ...@@ -72,6 +72,7 @@ static void __uses_jump_to_uncached sh4_flush_icache_range(void *args)
for (v = start; v < end; v += L1_CACHE_BYTES) { for (v = start; v < end; v += L1_CACHE_BYTES) {
unsigned long icacheaddr; unsigned long icacheaddr;
int j, n;
__ocbwb(v); __ocbwb(v);
...@@ -79,8 +80,10 @@ static void __uses_jump_to_uncached sh4_flush_icache_range(void *args) ...@@ -79,8 +80,10 @@ static void __uses_jump_to_uncached sh4_flush_icache_range(void *args)
cpu_data->icache.entry_mask); cpu_data->icache.entry_mask);
/* Clear i-cache line valid-bit */ /* Clear i-cache line valid-bit */
n = boot_cpu_data.icache.n_aliases;
for (i = 0; i < cpu_data->icache.ways; i++) { for (i = 0; i < cpu_data->icache.ways; i++) {
__raw_writel(0, icacheaddr); for (j = 0; j < n; j++)
__raw_writel(0, icacheaddr + (j * PAGE_SIZE));
icacheaddr += cpu_data->icache.way_incr; icacheaddr += cpu_data->icache.way_incr;
} }
} }
......
...@@ -63,6 +63,10 @@ do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \ ...@@ -63,6 +63,10 @@ do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
: : : "memory"); \ : : : "memory"); \
} while (0) } while (0)
/* The kernel always executes in TSO memory model these days,
* and furthermore most sparc64 chips implement more stringent
* memory ordering than required by the specifications.
*/
#define mb() membar_safe("#StoreLoad") #define mb() membar_safe("#StoreLoad")
#define rmb() __asm__ __volatile__("":::"memory") #define rmb() __asm__ __volatile__("":::"memory")
#define wmb() __asm__ __volatile__("":::"memory") #define wmb() __asm__ __volatile__("":::"memory")
......
...@@ -79,6 +79,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len ...@@ -79,6 +79,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
err = -ENODEV; err = -ENODEV;
mutex_lock(&of_set_property_mutex);
write_lock(&devtree_lock); write_lock(&devtree_lock);
prevp = &dp->properties; prevp = &dp->properties;
while (*prevp) { while (*prevp) {
...@@ -88,9 +89,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len ...@@ -88,9 +89,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
void *old_val = prop->value; void *old_val = prop->value;
int ret; int ret;
mutex_lock(&of_set_property_mutex);
ret = prom_setprop(dp->node, name, val, len); ret = prom_setprop(dp->node, name, val, len);
mutex_unlock(&of_set_property_mutex);
err = -EINVAL; err = -EINVAL;
if (ret >= 0) { if (ret >= 0) {
...@@ -109,6 +108,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len ...@@ -109,6 +108,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
prevp = &(*prevp)->next; prevp = &(*prevp)->next;
} }
write_unlock(&devtree_lock); write_unlock(&devtree_lock);
mutex_unlock(&of_set_property_mutex);
/* XXX Upate procfs if necessary... */ /* XXX Upate procfs if necessary... */
......
...@@ -617,7 +617,7 @@ static void pmul(struct pt_regs *regs, unsigned int insn, unsigned int opf) ...@@ -617,7 +617,7 @@ static void pmul(struct pt_regs *regs, unsigned int insn, unsigned int opf)
rs2 = fps_regval(f, RS2(insn)); rs2 = fps_regval(f, RS2(insn));
rd_val = 0; rd_val = 0;
src2 = (rs2 >> (opf == FMUL8x16AU_OPF) ? 16 : 0); src2 = rs2 >> (opf == FMUL8x16AU_OPF ? 16 : 0);
for (byte = 0; byte < 4; byte++) { for (byte = 0; byte < 4; byte++) {
u16 src1 = (rs1 >> (byte * 8)) & 0x00ff; u16 src1 = (rs1 >> (byte * 8)) & 0x00ff;
u32 prod = src1 * src2; u32 prod = src1 * src2;
......
...@@ -288,7 +288,7 @@ static inline void load_LDT(mm_context_t *pc) ...@@ -288,7 +288,7 @@ static inline void load_LDT(mm_context_t *pc)
static inline unsigned long get_desc_base(const struct desc_struct *desc) static inline unsigned long get_desc_base(const struct desc_struct *desc)
{ {
return desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24); return (unsigned)(desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24));
} }
static inline void set_desc_base(struct desc_struct *desc, unsigned long base) static inline void set_desc_base(struct desc_struct *desc, unsigned long base)
......
...@@ -1692,7 +1692,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu, ...@@ -1692,7 +1692,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
unsigned bank_num = mcg_cap & 0xff, bank; unsigned bank_num = mcg_cap & 0xff, bank;
r = -EINVAL; r = -EINVAL;
if (!bank_num) if (!bank_num || bank_num >= KVM_MAX_MCE_BANKS)
goto out; goto out;
if (mcg_cap & ~(KVM_MCE_CAP_SUPPORTED | 0xff | 0xff0000)) if (mcg_cap & ~(KVM_MCE_CAP_SUPPORTED | 0xff | 0xff0000))
goto out; goto out;
...@@ -4051,7 +4051,7 @@ static int save_guest_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector, ...@@ -4051,7 +4051,7 @@ static int save_guest_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector,
return kvm_write_guest_virt(dtable.base + index*8, seg_desc, sizeof(*seg_desc), vcpu); return kvm_write_guest_virt(dtable.base + index*8, seg_desc, sizeof(*seg_desc), vcpu);
} }
static u32 get_tss_base_addr(struct kvm_vcpu *vcpu, static gpa_t get_tss_base_addr(struct kvm_vcpu *vcpu,
struct desc_struct *seg_desc) struct desc_struct *seg_desc)
{ {
u32 base_addr = get_desc_base(seg_desc); u32 base_addr = get_desc_base(seg_desc);
......
...@@ -103,9 +103,9 @@ ...@@ -103,9 +103,9 @@
#define ACPI_MAX_REFERENCE_COUNT 0x1000 #define ACPI_MAX_REFERENCE_COUNT 0x1000
/* Size of cached memory mapping for system memory operation region */ /* Default page size for use in mapping memory for operation regions */
#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096 #define ACPI_DEFAULT_PAGE_SIZE 4096 /* Must be power of 2 */
/* owner_id tracking. 8 entries allows for 255 owner_ids */ /* owner_id tracking. 8 entries allows for 255 owner_ids */
......
...@@ -77,7 +77,8 @@ acpi_ex_system_memory_space_handler(u32 function, ...@@ -77,7 +77,8 @@ acpi_ex_system_memory_space_handler(u32 function,
void *logical_addr_ptr = NULL; void *logical_addr_ptr = NULL;
struct acpi_mem_space_context *mem_info = region_context; struct acpi_mem_space_context *mem_info = region_context;
u32 length; u32 length;
acpi_size window_size; acpi_size map_length;
acpi_size page_boundary_map_length;
#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED #ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
u32 remainder; u32 remainder;
#endif #endif
...@@ -144,25 +145,39 @@ acpi_ex_system_memory_space_handler(u32 function, ...@@ -144,25 +145,39 @@ acpi_ex_system_memory_space_handler(u32 function,
} }
/* /*
* Don't attempt to map memory beyond the end of the region, and * Attempt to map from the requested address to the end of the region.
* constrain the maximum mapping size to something reasonable. * However, we will never map more than one page, nor will we cross
* a page boundary.
*/ */
window_size = (acpi_size) map_length = (acpi_size)
((mem_info->address + mem_info->length) - address); ((mem_info->address + mem_info->length) - address);
if (window_size > ACPI_SYSMEM_REGION_WINDOW_SIZE) { /*
window_size = ACPI_SYSMEM_REGION_WINDOW_SIZE; * If mapping the entire remaining portion of the region will cross
* a page boundary, just map up to the page boundary, do not cross.
* On some systems, crossing a page boundary while mapping regions
* can cause warnings if the pages have different attributes
* due to resource management
*/
page_boundary_map_length =
ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address;
if (!page_boundary_map_length) {
page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE;
}
if (map_length > page_boundary_map_length) {
map_length = page_boundary_map_length;
} }
/* Create a new mapping starting at the address given */ /* Create a new mapping starting at the address given */
mem_info->mapped_logical_address = mem_info->mapped_logical_address = acpi_os_map_memory((acpi_physical_address) address, map_length);
acpi_os_map_memory((acpi_physical_address) address, window_size);
if (!mem_info->mapped_logical_address) { if (!mem_info->mapped_logical_address) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Could not map memory at %8.8X%8.8X, size %X", "Could not map memory at %8.8X%8.8X, size %X",
ACPI_FORMAT_NATIVE_UINT(address), ACPI_FORMAT_NATIVE_UINT(address),
(u32) window_size)); (u32) map_length));
mem_info->mapped_length = 0; mem_info->mapped_length = 0;
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
...@@ -170,7 +185,7 @@ acpi_ex_system_memory_space_handler(u32 function, ...@@ -170,7 +185,7 @@ acpi_ex_system_memory_space_handler(u32 function,
/* Save the physical address and mapping size */ /* Save the physical address and mapping size */
mem_info->mapped_physical_address = address; mem_info->mapped_physical_address = address;
mem_info->mapped_length = window_size; mem_info->mapped_length = map_length;
} }
/* /*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment