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

This commit is contained in:
Eric Anholt 2009-12-01 09:01:54 -08:00
Родитель 103a196f42 46557bef3f
Коммит f40d6817a5
131 изменённых файлов: 1469 добавлений и 653 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -1,5 +1,5 @@
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
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,12 +31,12 @@ 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.
@ -46,8 +46,8 @@ and throttle appropriate devices.
.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.
@ -57,16 +57,16 @@ and throttle appropriate devices.
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.
@ -77,15 +77,15 @@ and throttle appropriate devices.
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
@ -95,9 +95,9 @@ and throttle appropriate devices.
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
@ -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
Strings which represent the thermal zone type.
This is given by thermal zone driver as part of registration. This is given by thermal zone driver as part of registration.
Eg: "acpitz" indicates it's an ACPI thermal device. E.g: "acpitz" indicates it's an ACPI thermal device.
In order to keep it consistent with hwmon sys attribute, In order to keep it consistent with hwmon sys attribute; this should
this should be a short, lowercase string, be a short, lowercase string, not containing spaces nor dashes.
not containing spaces nor dashes. RO, Required
RO
Required
temp Current temperature as reported by thermal zone (sensor) temp
Current temperature as reported by thermal zone (sensor).
Unit: millidegree Celsius Unit: millidegree Celsius
RO RO, Required
Required
mode One of the predefined values in [kernel, user] mode
This file gives information about the algorithm One of the predefined values in [kernel, user].
that is currently managing the thermal zone. This file gives information about the algorithm that is currently
It can be either default kernel based algorithm managing the thermal zone. It can be either default kernel based
or user space application. algorithm or user space application.
RW
Optional
kernel = Thermal management in kernel thermal zone driver. kernel = Thermal management in kernel thermal zone driver.
user = Preventing kernel thermal zone driver actions upon user = Preventing kernel thermal zone driver actions upon
trip points so that user application can take full trip points so that user application can take full
charge of the thermal management. charge of the thermal management.
RW, Optional
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 RO, Optional
Optional
trip_point_[0-*]_type Strings which indicate the type of the trip point trip_point_[0-*]_type
E.g. it can be one of critical, hot, passive, Strings which indicate the type of the trip point.
active[0-*] for ACPI thermal zone. E.g. it can be one of critical, hot, passive, active[0-*] for ACPI
RO thermal zone.
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 RO, Optional
Optional
cdev[0-*]_trip_point The trip point with which cdev[0-*] is associated in this thermal zone cdev[0-*]_trip_point
-1 means the cooling device is not associated with any trip point. The trip point with which cdev[0-*] is associated in this thermal
RO zone; -1 means the cooling device is not associated with any trip
Optional point.
RO, Optional
****************************** passive
Attribute is only present for zones in which the passive cooling
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
an interval of 1 second.
Unit: millidegrees Celsius
RW, Optional
*****************************
* Cooling device attributes * * Cooling device attributes *
****************************** *****************************
type String which represents the type of device type
eg: For generic ACPI: this should be "Fan", String which represents the type of device, e.g:
"Processor" or "LCD" - for generic ACPI: should be "Fan", "Processor" or "LCD"
eg. For memory controller device on intel_menlow platform: - for memory controller device on intel_menlow platform:
this should be "Memory controller" should be "Memory controller".
RO RO, Required
Required
max_state The maximum permissible cooling state of this cooling device. max_state
RO The maximum permissible cooling state of this cooling device.
Required RO, Required
cur_state The current cooling state of this cooling device. cur_state
the value can any integer numbers between 0 and max_state, The current cooling state of this cooling device.
cur_state == 0 means no cooling The value can any integer numbers between 0 and max_state:
cur_state == max_state means the maximum cooling. - cur_state == 0 means no cooling
RW - cur_state == max_state means the maximum cooling.
Required 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
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/

Просмотреть файл

@ -1,5 +1,5 @@
# #
# 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
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
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)
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)
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) {}
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 @@
* 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)
/* 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 @@
#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)
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 {
#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,
* 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)
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)
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" \
: : : "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
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
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
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)
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)
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,
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,
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 @@
#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,
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,
} }
/* /*
* 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,
/* 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;
} }
/* /*

Просмотреть файл

@ -294,7 +294,11 @@ static int set_acpi_trip(struct acpi_power_meter_resource *resource)
return -EINVAL; return -EINVAL;
} }
return data; /* _PTP returns 0 on success, nonzero otherwise */
if (data)
return -EINVAL;
return 0;
} }
static ssize_t set_trip(struct device *dev, struct device_attribute *devattr, static ssize_t set_trip(struct device *dev, struct device_attribute *devattr,

Просмотреть файл

@ -393,7 +393,7 @@ acpi_system_write_wakeup_device(struct file *file,
struct list_head *node, *next; struct list_head *node, *next;
char strbuf[5]; char strbuf[5];
char str[5] = ""; char str[5] = "";
int len = count; unsigned int len = count;
struct acpi_device *found_dev = NULL; struct acpi_device *found_dev = NULL;
if (len > 4) if (len > 4)

Просмотреть файл

@ -770,7 +770,7 @@ static struct notifier_block acpi_cpu_notifier =
.notifier_call = acpi_cpu_soft_notify, .notifier_call = acpi_cpu_soft_notify,
}; };
static int acpi_processor_add(struct acpi_device *device) static int __cpuinit acpi_processor_add(struct acpi_device *device)
{ {
struct acpi_processor *pr = NULL; struct acpi_processor *pr = NULL;
int result = 0; int result = 0;

Просмотреть файл

@ -1133,15 +1133,15 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
int result = 0; int result = 0;
struct acpi_processor_throttling *pthrottling; struct acpi_processor_throttling *pthrottling;
if (!pr)
return -EINVAL;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n", "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n",
pr->throttling.address, pr->throttling.address,
pr->throttling.duty_offset, pr->throttling.duty_offset,
pr->throttling.duty_width)); pr->throttling.duty_width));
if (!pr)
return -EINVAL;
/* /*
* Evaluate _PTC, _TSS and _TPC * Evaluate _PTC, _TSS and _TPC
* They must all be present or none of them can be used. * They must all be present or none of them can be used.

Просмотреть файл

@ -413,6 +413,30 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
}, },
}, },
{ {
.callback = init_set_sci_en_on_resume,
.ident = "Hewlett-Packard Pavilion dv4",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4"),
},
},
{
.callback = init_set_sci_en_on_resume,
.ident = "Hewlett-Packard Pavilion dv7",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv7"),
},
},
{
.callback = init_set_sci_en_on_resume,
.ident = "Hewlett-Packard Compaq Presario CQ40 Notebook PC",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
DMI_MATCH(DMI_PRODUCT_NAME, "Compaq Presario CQ40 Notebook PC"),
},
},
{
.callback = init_old_suspend_ordering, .callback = init_old_suspend_ordering,
.ident = "Panasonic CF51-2L", .ident = "Panasonic CF51-2L",
.matches = { .matches = {

Просмотреть файл

@ -1223,7 +1223,7 @@ acpi_video_device_write_state(struct file *file,
u32 state = 0; u32 state = 0;
if (!dev || count + 1 > sizeof str) if (!dev || count >= sizeof(str))
return -EINVAL; return -EINVAL;
if (copy_from_user(str, buffer, count)) if (copy_from_user(str, buffer, count))
@ -1280,7 +1280,7 @@ acpi_video_device_write_brightness(struct file *file,
int i; int i;
if (!dev || !dev->brightness || count + 1 > sizeof str) if (!dev || !dev->brightness || count >= sizeof(str))
return -EINVAL; return -EINVAL;
if (copy_from_user(str, buffer, count)) if (copy_from_user(str, buffer, count))
@ -1562,7 +1562,7 @@ acpi_video_bus_write_POST(struct file *file,
unsigned long long opt, options; unsigned long long opt, options;
if (!video || count + 1 > sizeof str) if (!video || count >= sizeof(str))
return -EINVAL; return -EINVAL;
status = acpi_video_bus_POST_options(video, &options); status = acpi_video_bus_POST_options(video, &options);
@ -1602,7 +1602,7 @@ acpi_video_bus_write_DOS(struct file *file,
unsigned long opt; unsigned long opt;
if (!video || count + 1 > sizeof str) if (!video || count >= sizeof(str))
return -EINVAL; return -EINVAL;
if (copy_from_user(str, buffer, count)) if (copy_from_user(str, buffer, count))

Просмотреть файл

@ -2479,3 +2479,72 @@ out:
mutex_unlock(&dev->mode_config.mutex); mutex_unlock(&dev->mode_config.mutex);
return ret; return ret;
} }
int drm_mode_page_flip_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_crtc_page_flip *page_flip = data;
struct drm_mode_object *obj;
struct drm_crtc *crtc;
struct drm_framebuffer *fb;
struct drm_pending_vblank_event *e = NULL;
unsigned long flags;
int ret = -EINVAL;
if (page_flip->flags & ~DRM_MODE_PAGE_FLIP_FLAGS ||
page_flip->reserved != 0)
return -EINVAL;
mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, page_flip->crtc_id, DRM_MODE_OBJECT_CRTC);
if (!obj)
goto out;
crtc = obj_to_crtc(obj);
if (crtc->funcs->page_flip == NULL)
goto out;
obj = drm_mode_object_find(dev, page_flip->fb_id, DRM_MODE_OBJECT_FB);
if (!obj)
goto out;
fb = obj_to_fb(obj);
if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) {
ret = -ENOMEM;
spin_lock_irqsave(&dev->event_lock, flags);
if (file_priv->event_space < sizeof e->event) {
spin_unlock_irqrestore(&dev->event_lock, flags);
goto out;
}
file_priv->event_space -= sizeof e->event;
spin_unlock_irqrestore(&dev->event_lock, flags);
e = kzalloc(sizeof *e, GFP_KERNEL);
if (e == NULL) {
spin_lock_irqsave(&dev->event_lock, flags);
file_priv->event_space += sizeof e->event;
spin_unlock_irqrestore(&dev->event_lock, flags);
goto out;
}
e->event.base.type = DRM_EVENT_VBLANK;
e->event.base.length = sizeof e->event;
e->event.user_data = page_flip->user_data;
e->base.event = &e->event.base;
e->base.file_priv = file_priv;
e->base.destroy =
(void (*) (struct drm_pending_event *)) kfree;
}
ret = crtc->funcs->page_flip(crtc, fb, e);
if (ret) {
spin_lock_irqsave(&dev->event_lock, flags);
file_priv->event_space += sizeof e->event;
spin_unlock_irqrestore(&dev->event_lock, flags);
kfree(e);
}
out:
mutex_unlock(&dev->mode_config.mutex);
return ret;
}

Просмотреть файл

@ -145,6 +145,7 @@ static struct drm_ioctl_desc drm_ioctls[] = {
DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETFB, drm_mode_getfb, DRM_MASTER|DRM_CONTROL_ALLOW), DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETFB, drm_mode_getfb, DRM_MASTER|DRM_CONTROL_ALLOW),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB, drm_mode_addfb, DRM_MASTER|DRM_CONTROL_ALLOW), DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB, drm_mode_addfb, DRM_MASTER|DRM_CONTROL_ALLOW),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_RMFB, drm_mode_rmfb, DRM_MASTER|DRM_CONTROL_ALLOW), DRM_IOCTL_DEF(DRM_IOCTL_MODE_RMFB, drm_mode_rmfb, DRM_MASTER|DRM_CONTROL_ALLOW),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_PAGE_FLIP, drm_mode_page_flip_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW),
}; };
#define DRM_CORE_IOCTL_COUNT ARRAY_SIZE( drm_ioctls ) #define DRM_CORE_IOCTL_COUNT ARRAY_SIZE( drm_ioctls )
@ -365,6 +366,29 @@ static void __exit drm_core_exit(void)
module_init(drm_core_init); module_init(drm_core_init);
module_exit(drm_core_exit); module_exit(drm_core_exit);
/**
* Copy and IOCTL return string to user space
*/
static int drm_copy_field(char *buf, size_t *buf_len, const char *value)
{
int len;
/* don't overflow userbuf */
len = strlen(value);
if (len > *buf_len)
len = *buf_len;
/* let userspace know exact length of driver value (which could be
* larger than the userspace-supplied buffer) */
*buf_len = strlen(value);
/* finally, try filling in the userbuf */
if (len && buf)
if (copy_to_user(buf, value, len))
return -EFAULT;
return 0;
}
/** /**
* Get version information * Get version information
* *
@ -380,16 +404,21 @@ static int drm_version(struct drm_device *dev, void *data,
struct drm_file *file_priv) struct drm_file *file_priv)
{ {
struct drm_version *version = data; struct drm_version *version = data;
int len; int err;
version->version_major = dev->driver->major; version->version_major = dev->driver->major;
version->version_minor = dev->driver->minor; version->version_minor = dev->driver->minor;
version->version_patchlevel = dev->driver->patchlevel; version->version_patchlevel = dev->driver->patchlevel;
DRM_COPY(version->name, dev->driver->name); err = drm_copy_field(version->name, &version->name_len,
DRM_COPY(version->date, dev->driver->date); dev->driver->name);
DRM_COPY(version->desc, dev->driver->desc); if (!err)
err = drm_copy_field(version->date, &version->date_len,
dev->driver->date);
if (!err)
err = drm_copy_field(version->desc, &version->desc_len,
dev->driver->desc);
return 0; return err;
} }
/** /**

Просмотреть файл

@ -585,6 +585,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe,
if ((vblwait->request.type & _DRM_VBLANK_NEXTONMISS) && if ((vblwait->request.type & _DRM_VBLANK_NEXTONMISS) &&
(seq - vblwait->request.sequence) <= (1 << 23)) { (seq - vblwait->request.sequence) <= (1 << 23)) {
vblwait->request.sequence = seq + 1; vblwait->request.sequence = seq + 1;
vblwait->reply.sequence = vblwait->request.sequence;
} }
DRM_DEBUG("event on vblank count %d, current %d, crtc %d\n", DRM_DEBUG("event on vblank count %d, current %d, crtc %d\n",

Просмотреть файл

@ -49,7 +49,7 @@ radeon-y += radeon_device.o radeon_kms.o \
radeon_cs.o radeon_bios.o radeon_benchmark.o r100.o r300.o r420.o \ radeon_cs.o radeon_bios.o radeon_benchmark.o r100.o r300.o r420.o \
rs400.o rs600.o rs690.o rv515.o r520.o r600.o rv770.o radeon_test.o \ rs400.o rs600.o rs690.o rv515.o r520.o r600.o rv770.o radeon_test.o \
r200.o radeon_legacy_tv.o r600_cs.o r600_blit.o r600_blit_shaders.o \ r200.o radeon_legacy_tv.o r600_cs.o r600_blit.o r600_blit_shaders.o \
r600_blit_kms.o r600_blit_kms.o radeon_pm.o
radeon-$(CONFIG_COMPAT) += radeon_ioc32.o radeon-$(CONFIG_COMPAT) += radeon_ioc32.o

Просмотреть файл

@ -311,6 +311,8 @@ int r420_init(struct radeon_device *rdev)
} }
/* Initialize clocks */ /* Initialize clocks */
radeon_get_clock_info(rdev->ddev); radeon_get_clock_info(rdev->ddev);
/* Initialize power management */
radeon_pm_init(rdev);
/* Get vram informations */ /* Get vram informations */
r300_vram_info(rdev); r300_vram_info(rdev);
/* Initialize memory controller (also test AGP) */ /* Initialize memory controller (also test AGP) */

Просмотреть файл

@ -260,6 +260,8 @@ int r520_init(struct radeon_device *rdev)
} }
/* Initialize clocks */ /* Initialize clocks */
radeon_get_clock_info(rdev->ddev); radeon_get_clock_info(rdev->ddev);
/* Initialize power management */
radeon_pm_init(rdev);
/* Get vram informations */ /* Get vram informations */
r520_vram_info(rdev); r520_vram_info(rdev);
/* Initialize memory controller (also test AGP) */ /* Initialize memory controller (also test AGP) */

Просмотреть файл

@ -858,7 +858,8 @@ void r600_gpu_init(struct radeon_device *rdev)
((rdev->family) == CHIP_RV630) || ((rdev->family) == CHIP_RV630) ||
((rdev->family) == CHIP_RV610) || ((rdev->family) == CHIP_RV610) ||
((rdev->family) == CHIP_RV620) || ((rdev->family) == CHIP_RV620) ||
((rdev->family) == CHIP_RS780)) { ((rdev->family) == CHIP_RS780) ||
((rdev->family) == CHIP_RS880)) {
WREG32(DB_DEBUG, PREZ_MUST_WAIT_FOR_POSTZ_DONE); WREG32(DB_DEBUG, PREZ_MUST_WAIT_FOR_POSTZ_DONE);
} else { } else {
WREG32(DB_DEBUG, 0); WREG32(DB_DEBUG, 0);
@ -875,7 +876,8 @@ void r600_gpu_init(struct radeon_device *rdev)
tmp = RREG32(SQ_MS_FIFO_SIZES); tmp = RREG32(SQ_MS_FIFO_SIZES);
if (((rdev->family) == CHIP_RV610) || if (((rdev->family) == CHIP_RV610) ||
((rdev->family) == CHIP_RV620) || ((rdev->family) == CHIP_RV620) ||
((rdev->family) == CHIP_RS780)) { ((rdev->family) == CHIP_RS780) ||
((rdev->family) == CHIP_RS880)) {
tmp = (CACHE_FIFO_SIZE(0xa) | tmp = (CACHE_FIFO_SIZE(0xa) |
FETCH_FIFO_HIWATER(0xa) | FETCH_FIFO_HIWATER(0xa) |
DONE_FIFO_HIWATER(0xe0) | DONE_FIFO_HIWATER(0xe0) |
@ -918,7 +920,8 @@ void r600_gpu_init(struct radeon_device *rdev)
NUM_ES_STACK_ENTRIES(0)); NUM_ES_STACK_ENTRIES(0));
} else if (((rdev->family) == CHIP_RV610) || } else if (((rdev->family) == CHIP_RV610) ||
((rdev->family) == CHIP_RV620) || ((rdev->family) == CHIP_RV620) ||
((rdev->family) == CHIP_RS780)) { ((rdev->family) == CHIP_RS780) ||
((rdev->family) == CHIP_RS880)) {
/* no vertex cache */ /* no vertex cache */
sq_config &= ~VC_ENABLE; sq_config &= ~VC_ENABLE;
@ -975,7 +978,8 @@ void r600_gpu_init(struct radeon_device *rdev)
if (((rdev->family) == CHIP_RV610) || if (((rdev->family) == CHIP_RV610) ||
((rdev->family) == CHIP_RV620) || ((rdev->family) == CHIP_RV620) ||
((rdev->family) == CHIP_RS780)) { ((rdev->family) == CHIP_RS780) ||
((rdev->family) == CHIP_RS880)) {
WREG32(VGT_CACHE_INVALIDATION, CACHE_INVALIDATION(TC_ONLY)); WREG32(VGT_CACHE_INVALIDATION, CACHE_INVALIDATION(TC_ONLY));
} else { } else {
WREG32(VGT_CACHE_INVALIDATION, CACHE_INVALIDATION(VC_AND_TC)); WREG32(VGT_CACHE_INVALIDATION, CACHE_INVALIDATION(VC_AND_TC));
@ -1001,8 +1005,9 @@ void r600_gpu_init(struct radeon_device *rdev)
tmp = rdev->config.r600.max_pipes * 16; tmp = rdev->config.r600.max_pipes * 16;
switch (rdev->family) { switch (rdev->family) {
case CHIP_RV610: case CHIP_RV610:
case CHIP_RS780:
case CHIP_RV620: case CHIP_RV620:
case CHIP_RS780:
case CHIP_RS880:
tmp += 32; tmp += 32;
break; break;
case CHIP_RV670: case CHIP_RV670:
@ -1043,8 +1048,9 @@ void r600_gpu_init(struct radeon_device *rdev)
switch (rdev->family) { switch (rdev->family) {
case CHIP_RV610: case CHIP_RV610:
case CHIP_RS780:
case CHIP_RV620: case CHIP_RV620:
case CHIP_RS780:
case CHIP_RS880:
tmp = TC_L2_SIZE(8); tmp = TC_L2_SIZE(8);
break; break;
case CHIP_RV630: case CHIP_RV630:
@ -1629,10 +1635,13 @@ int r600_init(struct radeon_device *rdev)
r600_scratch_init(rdev); r600_scratch_init(rdev);
/* Initialize surface registers */ /* Initialize surface registers */
radeon_surface_init(rdev); radeon_surface_init(rdev);
/* Initialize clocks */
radeon_get_clock_info(rdev->ddev); radeon_get_clock_info(rdev->ddev);
r = radeon_clocks_init(rdev); r = radeon_clocks_init(rdev);
if (r) if (r)
return r; return r;
/* Initialize power management */
radeon_pm_init(rdev);
/* Fence driver */ /* Fence driver */
r = radeon_fence_driver_init(rdev); r = radeon_fence_driver_init(rdev);
if (r) if (r)

Просмотреть файл

@ -368,7 +368,7 @@ set_default_state(struct radeon_device *rdev)
if ((rdev->family == CHIP_RV610) || if ((rdev->family == CHIP_RV610) ||
(rdev->family == CHIP_RV620) || (rdev->family == CHIP_RV620) ||
(rdev->family == CHIP_RS780) || (rdev->family == CHIP_RS780) ||
(rdev->family == CHIP_RS780) || (rdev->family == CHIP_RS880) ||
(rdev->family == CHIP_RV710)) (rdev->family == CHIP_RV710))
sq_config = 0; sq_config = 0;
else else

Просмотреть файл

@ -139,6 +139,10 @@ struct radeon_clock {
uint32_t default_sclk; uint32_t default_sclk;
}; };
/*
* Power management
*/
int radeon_pm_init(struct radeon_device *rdev);
/* /*
* Fences. * Fences.
@ -623,7 +627,9 @@ struct radeon_asic {
uint64_t dst_offset, uint64_t dst_offset,
unsigned num_pages, unsigned num_pages,
struct radeon_fence *fence); struct radeon_fence *fence);
uint32_t (*get_engine_clock)(struct radeon_device *rdev);
void (*set_engine_clock)(struct radeon_device *rdev, uint32_t eng_clock); void (*set_engine_clock)(struct radeon_device *rdev, uint32_t eng_clock);
uint32_t (*get_memory_clock)(struct radeon_device *rdev);
void (*set_memory_clock)(struct radeon_device *rdev, uint32_t mem_clock); void (*set_memory_clock)(struct radeon_device *rdev, uint32_t mem_clock);
void (*set_pcie_lanes)(struct radeon_device *rdev, int lanes); void (*set_pcie_lanes)(struct radeon_device *rdev, int lanes);
void (*set_clock_gating)(struct radeon_device *rdev, int enable); void (*set_clock_gating)(struct radeon_device *rdev, int enable);
@ -955,7 +961,9 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)
#define radeon_copy_blit(rdev, s, d, np, f) (rdev)->asic->copy_blit((rdev), (s), (d), (np), (f)) #define radeon_copy_blit(rdev, s, d, np, f) (rdev)->asic->copy_blit((rdev), (s), (d), (np), (f))
#define radeon_copy_dma(rdev, s, d, np, f) (rdev)->asic->copy_dma((rdev), (s), (d), (np), (f)) #define radeon_copy_dma(rdev, s, d, np, f) (rdev)->asic->copy_dma((rdev), (s), (d), (np), (f))
#define radeon_copy(rdev, s, d, np, f) (rdev)->asic->copy((rdev), (s), (d), (np), (f)) #define radeon_copy(rdev, s, d, np, f) (rdev)->asic->copy((rdev), (s), (d), (np), (f))
#define radeon_get_engine_clock(rdev) (rdev)->asic->get_engine_clock((rdev))
#define radeon_set_engine_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e)) #define radeon_set_engine_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e))
#define radeon_get_memory_clock(rdev) (rdev)->asic->get_memory_clock((rdev))
#define radeon_set_memory_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e)) #define radeon_set_memory_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e))
#define radeon_set_pcie_lanes(rdev, l) (rdev)->asic->set_pcie_lanes((rdev), (l)) #define radeon_set_pcie_lanes(rdev, l) (rdev)->asic->set_pcie_lanes((rdev), (l))
#define radeon_set_clock_gating(rdev, e) (rdev)->asic->set_clock_gating((rdev), (e)) #define radeon_set_clock_gating(rdev, e) (rdev)->asic->set_clock_gating((rdev), (e))

Просмотреть файл

@ -31,10 +31,13 @@
/* /*
* common functions * common functions
*/ */
uint32_t radeon_legacy_get_engine_clock(struct radeon_device *rdev);
void radeon_legacy_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock); void radeon_legacy_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock);
void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable); void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable);
uint32_t radeon_atom_get_engine_clock(struct radeon_device *rdev);
void radeon_atom_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock); void radeon_atom_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock);
uint32_t radeon_atom_get_memory_clock(struct radeon_device *rdev);
void radeon_atom_set_memory_clock(struct radeon_device *rdev, uint32_t mem_clock); void radeon_atom_set_memory_clock(struct radeon_device *rdev, uint32_t mem_clock);
void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable); void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable);
@ -95,7 +98,9 @@ static struct radeon_asic r100_asic = {
.copy_blit = &r100_copy_blit, .copy_blit = &r100_copy_blit,
.copy_dma = NULL, .copy_dma = NULL,
.copy = &r100_copy_blit, .copy = &r100_copy_blit,
.get_engine_clock = &radeon_legacy_get_engine_clock,
.set_engine_clock = &radeon_legacy_set_engine_clock, .set_engine_clock = &radeon_legacy_set_engine_clock,
.get_memory_clock = NULL,
.set_memory_clock = NULL, .set_memory_clock = NULL,
.set_pcie_lanes = NULL, .set_pcie_lanes = NULL,
.set_clock_gating = &radeon_legacy_set_clock_gating, .set_clock_gating = &radeon_legacy_set_clock_gating,
@ -148,7 +153,9 @@ static struct radeon_asic r300_asic = {
.copy_blit = &r100_copy_blit, .copy_blit = &r100_copy_blit,
.copy_dma = &r300_copy_dma, .copy_dma = &r300_copy_dma,
.copy = &r100_copy_blit, .copy = &r100_copy_blit,
.get_engine_clock = &radeon_legacy_get_engine_clock,
.set_engine_clock = &radeon_legacy_set_engine_clock, .set_engine_clock = &radeon_legacy_set_engine_clock,
.get_memory_clock = NULL,
.set_memory_clock = NULL, .set_memory_clock = NULL,
.set_pcie_lanes = &rv370_set_pcie_lanes, .set_pcie_lanes = &rv370_set_pcie_lanes,
.set_clock_gating = &radeon_legacy_set_clock_gating, .set_clock_gating = &radeon_legacy_set_clock_gating,
@ -185,7 +192,9 @@ static struct radeon_asic r420_asic = {
.copy_blit = &r100_copy_blit, .copy_blit = &r100_copy_blit,
.copy_dma = &r300_copy_dma, .copy_dma = &r300_copy_dma,
.copy = &r100_copy_blit, .copy = &r100_copy_blit,
.get_engine_clock = &radeon_atom_get_engine_clock,
.set_engine_clock = &radeon_atom_set_engine_clock, .set_engine_clock = &radeon_atom_set_engine_clock,
.get_memory_clock = &radeon_atom_get_memory_clock,
.set_memory_clock = &radeon_atom_set_memory_clock, .set_memory_clock = &radeon_atom_set_memory_clock,
.set_pcie_lanes = &rv370_set_pcie_lanes, .set_pcie_lanes = &rv370_set_pcie_lanes,
.set_clock_gating = &radeon_atom_set_clock_gating, .set_clock_gating = &radeon_atom_set_clock_gating,
@ -227,7 +236,9 @@ static struct radeon_asic rs400_asic = {
.copy_blit = &r100_copy_blit, .copy_blit = &r100_copy_blit,
.copy_dma = &r300_copy_dma, .copy_dma = &r300_copy_dma,
.copy = &r100_copy_blit, .copy = &r100_copy_blit,
.get_engine_clock = &radeon_legacy_get_engine_clock,
.set_engine_clock = &radeon_legacy_set_engine_clock, .set_engine_clock = &radeon_legacy_set_engine_clock,
.get_memory_clock = NULL,
.set_memory_clock = NULL, .set_memory_clock = NULL,
.set_pcie_lanes = NULL, .set_pcie_lanes = NULL,
.set_clock_gating = &radeon_legacy_set_clock_gating, .set_clock_gating = &radeon_legacy_set_clock_gating,
@ -273,7 +284,9 @@ static struct radeon_asic rs600_asic = {
.copy_blit = &r100_copy_blit, .copy_blit = &r100_copy_blit,
.copy_dma = &r300_copy_dma, .copy_dma = &r300_copy_dma,
.copy = &r100_copy_blit, .copy = &r100_copy_blit,
.get_engine_clock = &radeon_atom_get_engine_clock,
.set_engine_clock = &radeon_atom_set_engine_clock, .set_engine_clock = &radeon_atom_set_engine_clock,
.get_memory_clock = &radeon_atom_get_memory_clock,
.set_memory_clock = &radeon_atom_set_memory_clock, .set_memory_clock = &radeon_atom_set_memory_clock,
.set_pcie_lanes = NULL, .set_pcie_lanes = NULL,
.set_clock_gating = &radeon_atom_set_clock_gating, .set_clock_gating = &radeon_atom_set_clock_gating,
@ -312,7 +325,9 @@ static struct radeon_asic rs690_asic = {
.copy_blit = &r100_copy_blit, .copy_blit = &r100_copy_blit,
.copy_dma = &r300_copy_dma, .copy_dma = &r300_copy_dma,
.copy = &r300_copy_dma, .copy = &r300_copy_dma,
.get_engine_clock = &radeon_atom_get_engine_clock,
.set_engine_clock = &radeon_atom_set_engine_clock, .set_engine_clock = &radeon_atom_set_engine_clock,
.get_memory_clock = &radeon_atom_get_memory_clock,
.set_memory_clock = &radeon_atom_set_memory_clock, .set_memory_clock = &radeon_atom_set_memory_clock,
.set_pcie_lanes = NULL, .set_pcie_lanes = NULL,
.set_clock_gating = &radeon_atom_set_clock_gating, .set_clock_gating = &radeon_atom_set_clock_gating,
@ -357,7 +372,9 @@ static struct radeon_asic rv515_asic = {
.copy_blit = &r100_copy_blit, .copy_blit = &r100_copy_blit,
.copy_dma = &r300_copy_dma, .copy_dma = &r300_copy_dma,
.copy = &r100_copy_blit, .copy = &r100_copy_blit,
.get_engine_clock = &radeon_atom_get_engine_clock,
.set_engine_clock = &radeon_atom_set_engine_clock, .set_engine_clock = &radeon_atom_set_engine_clock,
.get_memory_clock = &radeon_atom_get_memory_clock,
.set_memory_clock = &radeon_atom_set_memory_clock, .set_memory_clock = &radeon_atom_set_memory_clock,
.set_pcie_lanes = &rv370_set_pcie_lanes, .set_pcie_lanes = &rv370_set_pcie_lanes,
.set_clock_gating = &radeon_atom_set_clock_gating, .set_clock_gating = &radeon_atom_set_clock_gating,
@ -393,7 +410,9 @@ static struct radeon_asic r520_asic = {
.copy_blit = &r100_copy_blit, .copy_blit = &r100_copy_blit,
.copy_dma = &r300_copy_dma, .copy_dma = &r300_copy_dma,
.copy = &r100_copy_blit, .copy = &r100_copy_blit,
.get_engine_clock = &radeon_atom_get_engine_clock,
.set_engine_clock = &radeon_atom_set_engine_clock, .set_engine_clock = &radeon_atom_set_engine_clock,
.get_memory_clock = &radeon_atom_get_memory_clock,
.set_memory_clock = &radeon_atom_set_memory_clock, .set_memory_clock = &radeon_atom_set_memory_clock,
.set_pcie_lanes = &rv370_set_pcie_lanes, .set_pcie_lanes = &rv370_set_pcie_lanes,
.set_clock_gating = &radeon_atom_set_clock_gating, .set_clock_gating = &radeon_atom_set_clock_gating,
@ -456,7 +475,9 @@ static struct radeon_asic r600_asic = {
.copy_blit = &r600_copy_blit, .copy_blit = &r600_copy_blit,
.copy_dma = &r600_copy_blit, .copy_dma = &r600_copy_blit,
.copy = &r600_copy_blit, .copy = &r600_copy_blit,
.get_engine_clock = &radeon_atom_get_engine_clock,
.set_engine_clock = &radeon_atom_set_engine_clock, .set_engine_clock = &radeon_atom_set_engine_clock,
.get_memory_clock = &radeon_atom_get_memory_clock,
.set_memory_clock = &radeon_atom_set_memory_clock, .set_memory_clock = &radeon_atom_set_memory_clock,
.set_pcie_lanes = NULL, .set_pcie_lanes = NULL,
.set_clock_gating = &radeon_atom_set_clock_gating, .set_clock_gating = &radeon_atom_set_clock_gating,
@ -493,7 +514,9 @@ static struct radeon_asic rv770_asic = {
.copy_blit = &r600_copy_blit, .copy_blit = &r600_copy_blit,
.copy_dma = &r600_copy_blit, .copy_dma = &r600_copy_blit,
.copy = &r600_copy_blit, .copy = &r600_copy_blit,
.get_engine_clock = &radeon_atom_get_engine_clock,
.set_engine_clock = &radeon_atom_set_engine_clock, .set_engine_clock = &radeon_atom_set_engine_clock,
.get_memory_clock = &radeon_atom_get_memory_clock,
.set_memory_clock = &radeon_atom_set_memory_clock, .set_memory_clock = &radeon_atom_set_memory_clock,
.set_pcie_lanes = NULL, .set_pcie_lanes = NULL,
.set_clock_gating = &radeon_atom_set_clock_gating, .set_clock_gating = &radeon_atom_set_clock_gating,

Просмотреть файл

@ -46,7 +46,8 @@ radeon_add_atom_connector(struct drm_device *dev,
uint32_t supported_device, uint32_t supported_device,
int connector_type, int connector_type,
struct radeon_i2c_bus_rec *i2c_bus, struct radeon_i2c_bus_rec *i2c_bus,
bool linkb, uint32_t igp_lane_info); bool linkb, uint32_t igp_lane_info,
uint16_t connector_object_id);
/* from radeon_legacy_encoder.c */ /* from radeon_legacy_encoder.c */
extern void extern void
@ -193,6 +194,23 @@ const int supported_devices_connector_convert[] = {
DRM_MODE_CONNECTOR_DisplayPort DRM_MODE_CONNECTOR_DisplayPort
}; };
const uint16_t supported_devices_connector_object_id_convert[] = {
CONNECTOR_OBJECT_ID_NONE,
CONNECTOR_OBJECT_ID_VGA,
CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I, /* not all boards support DL */
CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D, /* not all boards support DL */
CONNECTOR_OBJECT_ID_VGA, /* technically DVI-A */
CONNECTOR_OBJECT_ID_COMPOSITE,
CONNECTOR_OBJECT_ID_SVIDEO,
CONNECTOR_OBJECT_ID_LVDS,
CONNECTOR_OBJECT_ID_9PIN_DIN,
CONNECTOR_OBJECT_ID_9PIN_DIN,
CONNECTOR_OBJECT_ID_DISPLAYPORT,
CONNECTOR_OBJECT_ID_HDMI_TYPE_A,
CONNECTOR_OBJECT_ID_HDMI_TYPE_B,
CONNECTOR_OBJECT_ID_SVIDEO
};
const int object_connector_convert[] = { const int object_connector_convert[] = {
DRM_MODE_CONNECTOR_Unknown, DRM_MODE_CONNECTOR_Unknown,
DRM_MODE_CONNECTOR_DVII, DRM_MODE_CONNECTOR_DVII,
@ -229,7 +247,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
ATOM_OBJECT_HEADER *obj_header; ATOM_OBJECT_HEADER *obj_header;
int i, j, path_size, device_support; int i, j, path_size, device_support;
int connector_type; int connector_type;
uint16_t igp_lane_info, conn_id; uint16_t igp_lane_info, conn_id, connector_object_id;
bool linkb; bool linkb;
struct radeon_i2c_bus_rec ddc_bus; struct radeon_i2c_bus_rec ddc_bus;
@ -277,7 +295,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
ATOM_DEVICE_CV_SUPPORT) ATOM_DEVICE_CV_SUPPORT)
continue; continue;
if ((rdev->family == CHIP_RS780) && /* IGP chips */
if ((rdev->flags & RADEON_IS_IGP) &&
(con_obj_id == (con_obj_id ==
CONNECTOR_OBJECT_ID_PCIE_CONNECTOR)) { CONNECTOR_OBJECT_ID_PCIE_CONNECTOR)) {
uint16_t igp_offset = 0; uint16_t igp_offset = 0;
@ -311,6 +330,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
connector_type = connector_type =
object_connector_convert object_connector_convert
[ct]; [ct];
connector_object_id = ct;
igp_lane_info = igp_lane_info =
slot_config & 0xffff; slot_config & 0xffff;
} else } else
@ -321,6 +341,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
igp_lane_info = 0; igp_lane_info = 0;
connector_type = connector_type =
object_connector_convert[con_obj_id]; object_connector_convert[con_obj_id];
connector_object_id = con_obj_id;
} }
if (connector_type == DRM_MODE_CONNECTOR_Unknown) if (connector_type == DRM_MODE_CONNECTOR_Unknown)
@ -425,7 +446,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
le16_to_cpu(path-> le16_to_cpu(path->
usDeviceTag), usDeviceTag),
connector_type, &ddc_bus, connector_type, &ddc_bus,
linkb, igp_lane_info); linkb, igp_lane_info,
connector_object_id);
} }
} }
@ -435,6 +457,45 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
return true; return true;
} }
static uint16_t atombios_get_connector_object_id(struct drm_device *dev,
int connector_type,
uint16_t devices)
{
struct radeon_device *rdev = dev->dev_private;
if (rdev->flags & RADEON_IS_IGP) {
return supported_devices_connector_object_id_convert
[connector_type];
} else if (((connector_type == DRM_MODE_CONNECTOR_DVII) ||
(connector_type == DRM_MODE_CONNECTOR_DVID)) &&
(devices & ATOM_DEVICE_DFP2_SUPPORT)) {
struct radeon_mode_info *mode_info = &rdev->mode_info;
struct atom_context *ctx = mode_info->atom_context;
int index = GetIndexIntoMasterTable(DATA, XTMDS_Info);
uint16_t size, data_offset;
uint8_t frev, crev;
ATOM_XTMDS_INFO *xtmds;
atom_parse_data_header(ctx, index, &size, &frev, &crev, &data_offset);
xtmds = (ATOM_XTMDS_INFO *)(ctx->bios + data_offset);
if (xtmds->ucSupportedLink & ATOM_XTMDS_SUPPORTED_DUALLINK) {
if (connector_type == DRM_MODE_CONNECTOR_DVII)
return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I;
else
return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D;
} else {
if (connector_type == DRM_MODE_CONNECTOR_DVII)
return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I;
else
return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D;
}
} else {
return supported_devices_connector_object_id_convert
[connector_type];
}
}
struct bios_connector { struct bios_connector {
bool valid; bool valid;
uint16_t line_mux; uint16_t line_mux;
@ -593,14 +654,20 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct
/* add the connectors */ /* add the connectors */
for (i = 0; i < ATOM_MAX_SUPPORTED_DEVICE; i++) { for (i = 0; i < ATOM_MAX_SUPPORTED_DEVICE; i++) {
if (bios_connectors[i].valid) if (bios_connectors[i].valid) {
uint16_t connector_object_id =
atombios_get_connector_object_id(dev,
bios_connectors[i].connector_type,
bios_connectors[i].devices);
radeon_add_atom_connector(dev, radeon_add_atom_connector(dev,
bios_connectors[i].line_mux, bios_connectors[i].line_mux,
bios_connectors[i].devices, bios_connectors[i].devices,
bios_connectors[i]. bios_connectors[i].
connector_type, connector_type,
&bios_connectors[i].ddc_bus, &bios_connectors[i].ddc_bus,
false, 0); false, 0,
connector_object_id);
}
} }
radeon_link_encoder_connector(dev); radeon_link_encoder_connector(dev);
@ -1066,6 +1133,24 @@ void radeon_atom_static_pwrmgt_setup(struct radeon_device *rdev, int enable)
atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
} }
uint32_t radeon_atom_get_engine_clock(struct radeon_device *rdev)
{
GET_ENGINE_CLOCK_PS_ALLOCATION args;
int index = GetIndexIntoMasterTable(COMMAND, GetEngineClock);
atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
return args.ulReturnEngineClock;
}
uint32_t radeon_atom_get_memory_clock(struct radeon_device *rdev)
{
GET_MEMORY_CLOCK_PS_ALLOCATION args;
int index = GetIndexIntoMasterTable(COMMAND, GetMemoryClock);
atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
return args.ulReturnMemoryClock;
}
void radeon_atom_set_engine_clock(struct radeon_device *rdev, void radeon_atom_set_engine_clock(struct radeon_device *rdev,
uint32_t eng_clock) uint32_t eng_clock)
{ {

Просмотреть файл

@ -32,7 +32,7 @@
#include "atom.h" #include "atom.h"
/* 10 khz */ /* 10 khz */
static uint32_t radeon_legacy_get_engine_clock(struct radeon_device *rdev) uint32_t radeon_legacy_get_engine_clock(struct radeon_device *rdev)
{ {
struct radeon_pll *spll = &rdev->clock.spll; struct radeon_pll *spll = &rdev->clock.spll;
uint32_t fb_div, ref_div, post_div, sclk; uint32_t fb_div, ref_div, post_div, sclk;

Просмотреть файл

@ -49,7 +49,8 @@ radeon_add_legacy_connector(struct drm_device *dev,
uint32_t connector_id, uint32_t connector_id,
uint32_t supported_device, uint32_t supported_device,
int connector_type, int connector_type,
struct radeon_i2c_bus_rec *i2c_bus); struct radeon_i2c_bus_rec *i2c_bus,
uint16_t connector_object_id);
/* from radeon_legacy_encoder.c */ /* from radeon_legacy_encoder.c */
extern void extern void
@ -1176,7 +1177,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
radeon_add_legacy_connector(dev, 0, radeon_add_legacy_connector(dev, 0,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
DRM_MODE_CONNECTOR_VGA, DRM_MODE_CONNECTOR_VGA,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_VGA);
} else if (rdev->flags & RADEON_IS_MOBILITY) { } else if (rdev->flags & RADEON_IS_MOBILITY) {
/* LVDS */ /* LVDS */
ddc_i2c = combios_setup_i2c_bus(RADEON_LCD_GPIO_MASK); ddc_i2c = combios_setup_i2c_bus(RADEON_LCD_GPIO_MASK);
@ -1188,7 +1190,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
radeon_add_legacy_connector(dev, 0, radeon_add_legacy_connector(dev, 0,
ATOM_DEVICE_LCD1_SUPPORT, ATOM_DEVICE_LCD1_SUPPORT,
DRM_MODE_CONNECTOR_LVDS, DRM_MODE_CONNECTOR_LVDS,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_LVDS);
/* VGA - primary dac */ /* VGA - primary dac */
ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC);
@ -1200,7 +1203,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
radeon_add_legacy_connector(dev, 1, radeon_add_legacy_connector(dev, 1,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
DRM_MODE_CONNECTOR_VGA, DRM_MODE_CONNECTOR_VGA,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_VGA);
} else { } else {
/* DVI-I - tv dac, int tmds */ /* DVI-I - tv dac, int tmds */
ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC); ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC);
@ -1218,7 +1222,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ATOM_DEVICE_DFP1_SUPPORT | ATOM_DEVICE_DFP1_SUPPORT |
ATOM_DEVICE_CRT2_SUPPORT, ATOM_DEVICE_CRT2_SUPPORT,
DRM_MODE_CONNECTOR_DVII, DRM_MODE_CONNECTOR_DVII,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I);
/* VGA - primary dac */ /* VGA - primary dac */
ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC);
@ -1230,7 +1235,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
radeon_add_legacy_connector(dev, 1, radeon_add_legacy_connector(dev, 1,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
DRM_MODE_CONNECTOR_VGA, DRM_MODE_CONNECTOR_VGA,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_VGA);
} }
if (rdev->family != CHIP_R100 && rdev->family != CHIP_R200) { if (rdev->family != CHIP_R100 && rdev->family != CHIP_R200) {
@ -1243,7 +1249,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
radeon_add_legacy_connector(dev, 2, radeon_add_legacy_connector(dev, 2,
ATOM_DEVICE_TV1_SUPPORT, ATOM_DEVICE_TV1_SUPPORT,
DRM_MODE_CONNECTOR_SVIDEO, DRM_MODE_CONNECTOR_SVIDEO,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_SVIDEO);
} }
break; break;
case CT_IBOOK: case CT_IBOOK:
@ -1257,7 +1264,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
0), 0),
ATOM_DEVICE_LCD1_SUPPORT); ATOM_DEVICE_LCD1_SUPPORT);
radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT,
DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); DRM_MODE_CONNECTOR_LVDS, &ddc_i2c,
CONNECTOR_OBJECT_ID_LVDS);
/* VGA - TV DAC */ /* VGA - TV DAC */
ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC);
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
@ -1266,7 +1274,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
2), 2),
ATOM_DEVICE_CRT2_SUPPORT); ATOM_DEVICE_CRT2_SUPPORT);
radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT,
DRM_MODE_CONNECTOR_VGA, &ddc_i2c); DRM_MODE_CONNECTOR_VGA, &ddc_i2c,
CONNECTOR_OBJECT_ID_VGA);
/* TV - TV DAC */ /* TV - TV DAC */
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_id(dev,
@ -1275,7 +1284,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
DRM_MODE_CONNECTOR_SVIDEO, DRM_MODE_CONNECTOR_SVIDEO,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_SVIDEO);
break; break;
case CT_POWERBOOK_EXTERNAL: case CT_POWERBOOK_EXTERNAL:
DRM_INFO("Connector Table: %d (powerbook external tmds)\n", DRM_INFO("Connector Table: %d (powerbook external tmds)\n",
@ -1288,7 +1298,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
0), 0),
ATOM_DEVICE_LCD1_SUPPORT); ATOM_DEVICE_LCD1_SUPPORT);
radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT,
DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); DRM_MODE_CONNECTOR_LVDS, &ddc_i2c,
CONNECTOR_OBJECT_ID_LVDS);
/* DVI-I - primary dac, ext tmds */ /* DVI-I - primary dac, ext tmds */
ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC);
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
@ -1301,10 +1312,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
1), 1),
ATOM_DEVICE_CRT1_SUPPORT); ATOM_DEVICE_CRT1_SUPPORT);
/* XXX some are SL */
radeon_add_legacy_connector(dev, 1, radeon_add_legacy_connector(dev, 1,
ATOM_DEVICE_DFP2_SUPPORT | ATOM_DEVICE_DFP2_SUPPORT |
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
DRM_MODE_CONNECTOR_DVII, &ddc_i2c); DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I);
/* TV - TV DAC */ /* TV - TV DAC */
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_id(dev,
@ -1313,7 +1326,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
DRM_MODE_CONNECTOR_SVIDEO, DRM_MODE_CONNECTOR_SVIDEO,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_SVIDEO);
break; break;
case CT_POWERBOOK_INTERNAL: case CT_POWERBOOK_INTERNAL:
DRM_INFO("Connector Table: %d (powerbook internal tmds)\n", DRM_INFO("Connector Table: %d (powerbook internal tmds)\n",
@ -1326,7 +1340,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
0), 0),
ATOM_DEVICE_LCD1_SUPPORT); ATOM_DEVICE_LCD1_SUPPORT);
radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT,
DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); DRM_MODE_CONNECTOR_LVDS, &ddc_i2c,
CONNECTOR_OBJECT_ID_LVDS);
/* DVI-I - primary dac, int tmds */ /* DVI-I - primary dac, int tmds */
ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC);
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
@ -1342,7 +1357,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
radeon_add_legacy_connector(dev, 1, radeon_add_legacy_connector(dev, 1,
ATOM_DEVICE_DFP1_SUPPORT | ATOM_DEVICE_DFP1_SUPPORT |
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
DRM_MODE_CONNECTOR_DVII, &ddc_i2c); DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I);
/* TV - TV DAC */ /* TV - TV DAC */
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_id(dev,
@ -1351,7 +1367,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
DRM_MODE_CONNECTOR_SVIDEO, DRM_MODE_CONNECTOR_SVIDEO,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_SVIDEO);
break; break;
case CT_POWERBOOK_VGA: case CT_POWERBOOK_VGA:
DRM_INFO("Connector Table: %d (powerbook vga)\n", DRM_INFO("Connector Table: %d (powerbook vga)\n",
@ -1364,7 +1381,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
0), 0),
ATOM_DEVICE_LCD1_SUPPORT); ATOM_DEVICE_LCD1_SUPPORT);
radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT,
DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); DRM_MODE_CONNECTOR_LVDS, &ddc_i2c,
CONNECTOR_OBJECT_ID_LVDS);
/* VGA - primary dac */ /* VGA - primary dac */
ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC);
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
@ -1373,7 +1391,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1), 1),
ATOM_DEVICE_CRT1_SUPPORT); ATOM_DEVICE_CRT1_SUPPORT);
radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT1_SUPPORT, radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT1_SUPPORT,
DRM_MODE_CONNECTOR_VGA, &ddc_i2c); DRM_MODE_CONNECTOR_VGA, &ddc_i2c,
CONNECTOR_OBJECT_ID_VGA);
/* TV - TV DAC */ /* TV - TV DAC */
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_id(dev,
@ -1382,7 +1401,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
DRM_MODE_CONNECTOR_SVIDEO, DRM_MODE_CONNECTOR_SVIDEO,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_SVIDEO);
break; break;
case CT_MINI_EXTERNAL: case CT_MINI_EXTERNAL:
DRM_INFO("Connector Table: %d (mini external tmds)\n", DRM_INFO("Connector Table: %d (mini external tmds)\n",
@ -1399,10 +1419,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ATOM_DEVICE_CRT2_SUPPORT, ATOM_DEVICE_CRT2_SUPPORT,
2), 2),
ATOM_DEVICE_CRT2_SUPPORT); ATOM_DEVICE_CRT2_SUPPORT);
/* XXX are any DL? */
radeon_add_legacy_connector(dev, 0, radeon_add_legacy_connector(dev, 0,
ATOM_DEVICE_DFP2_SUPPORT | ATOM_DEVICE_DFP2_SUPPORT |
ATOM_DEVICE_CRT2_SUPPORT, ATOM_DEVICE_CRT2_SUPPORT,
DRM_MODE_CONNECTOR_DVII, &ddc_i2c); DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I);
/* TV - TV DAC */ /* TV - TV DAC */
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_id(dev,
@ -1411,7 +1433,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT,
DRM_MODE_CONNECTOR_SVIDEO, DRM_MODE_CONNECTOR_SVIDEO,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_SVIDEO);
break; break;
case CT_MINI_INTERNAL: case CT_MINI_INTERNAL:
DRM_INFO("Connector Table: %d (mini internal tmds)\n", DRM_INFO("Connector Table: %d (mini internal tmds)\n",
@ -1431,7 +1454,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
radeon_add_legacy_connector(dev, 0, radeon_add_legacy_connector(dev, 0,
ATOM_DEVICE_DFP1_SUPPORT | ATOM_DEVICE_DFP1_SUPPORT |
ATOM_DEVICE_CRT2_SUPPORT, ATOM_DEVICE_CRT2_SUPPORT,
DRM_MODE_CONNECTOR_DVII, &ddc_i2c); DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I);
/* TV - TV DAC */ /* TV - TV DAC */
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_id(dev,
@ -1440,7 +1464,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT,
DRM_MODE_CONNECTOR_SVIDEO, DRM_MODE_CONNECTOR_SVIDEO,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_SVIDEO);
break; break;
case CT_IMAC_G5_ISIGHT: case CT_IMAC_G5_ISIGHT:
DRM_INFO("Connector Table: %d (imac g5 isight)\n", DRM_INFO("Connector Table: %d (imac g5 isight)\n",
@ -1453,7 +1478,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
0), 0),
ATOM_DEVICE_DFP1_SUPPORT); ATOM_DEVICE_DFP1_SUPPORT);
radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_DFP1_SUPPORT, radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_DFP1_SUPPORT,
DRM_MODE_CONNECTOR_DVID, &ddc_i2c); DRM_MODE_CONNECTOR_DVID, &ddc_i2c,
CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D);
/* VGA - tv dac */ /* VGA - tv dac */
ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC); ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC);
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
@ -1462,7 +1488,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
2), 2),
ATOM_DEVICE_CRT2_SUPPORT); ATOM_DEVICE_CRT2_SUPPORT);
radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT,
DRM_MODE_CONNECTOR_VGA, &ddc_i2c); DRM_MODE_CONNECTOR_VGA, &ddc_i2c,
CONNECTOR_OBJECT_ID_VGA);
/* TV - TV DAC */ /* TV - TV DAC */
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_id(dev,
@ -1471,7 +1498,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
DRM_MODE_CONNECTOR_SVIDEO, DRM_MODE_CONNECTOR_SVIDEO,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_SVIDEO);
break; break;
case CT_EMAC: case CT_EMAC:
DRM_INFO("Connector Table: %d (emac)\n", DRM_INFO("Connector Table: %d (emac)\n",
@ -1484,7 +1512,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1), 1),
ATOM_DEVICE_CRT1_SUPPORT); ATOM_DEVICE_CRT1_SUPPORT);
radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_CRT1_SUPPORT, radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_CRT1_SUPPORT,
DRM_MODE_CONNECTOR_VGA, &ddc_i2c); DRM_MODE_CONNECTOR_VGA, &ddc_i2c,
CONNECTOR_OBJECT_ID_VGA);
/* VGA - tv dac */ /* VGA - tv dac */
ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_CRT2_DDC); ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_CRT2_DDC);
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
@ -1493,7 +1522,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
2), 2),
ATOM_DEVICE_CRT2_SUPPORT); ATOM_DEVICE_CRT2_SUPPORT);
radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT,
DRM_MODE_CONNECTOR_VGA, &ddc_i2c); DRM_MODE_CONNECTOR_VGA, &ddc_i2c,
CONNECTOR_OBJECT_ID_VGA);
/* TV - TV DAC */ /* TV - TV DAC */
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_id(dev,
@ -1502,7 +1532,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
DRM_MODE_CONNECTOR_SVIDEO, DRM_MODE_CONNECTOR_SVIDEO,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_SVIDEO);
break; break;
default: default:
DRM_INFO("Connector table: %d (invalid)\n", DRM_INFO("Connector table: %d (invalid)\n",
@ -1596,11 +1627,46 @@ static bool radeon_apply_legacy_tv_quirks(struct drm_device *dev)
return true; return true;
} }
static uint16_t combios_check_dl_dvi(struct drm_device *dev, int is_dvi_d)
{
struct radeon_device *rdev = dev->dev_private;
uint32_t ext_tmds_info;
if (rdev->flags & RADEON_IS_IGP) {
if (is_dvi_d)
return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D;
else
return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I;
}
ext_tmds_info = combios_get_table_offset(dev, COMBIOS_EXT_TMDS_INFO_TABLE);
if (ext_tmds_info) {
uint8_t rev = RBIOS8(ext_tmds_info);
uint8_t flags = RBIOS8(ext_tmds_info + 4 + 5);
if (rev >= 3) {
if (is_dvi_d)
return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D;
else
return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I;
} else {
if (flags & 1) {
if (is_dvi_d)
return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D;
else
return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I;
}
}
}
if (is_dvi_d)
return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D;
else
return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I;
}
bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
{ {
struct radeon_device *rdev = dev->dev_private; struct radeon_device *rdev = dev->dev_private;
uint32_t conn_info, entry, devices; uint32_t conn_info, entry, devices;
uint16_t tmp; uint16_t tmp, connector_object_id;
enum radeon_combios_ddc ddc_type; enum radeon_combios_ddc ddc_type;
enum radeon_combios_connector connector; enum radeon_combios_connector connector;
int i = 0; int i = 0;
@ -1660,7 +1726,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
radeon_add_legacy_connector(dev, i, devices, radeon_add_legacy_connector(dev, i, devices,
legacy_connector_convert legacy_connector_convert
[connector], [connector],
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D);
break; break;
case CONNECTOR_CRT_LEGACY: case CONNECTOR_CRT_LEGACY:
if (tmp & 0x1) { if (tmp & 0x1) {
@ -1685,7 +1752,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
devices, devices,
legacy_connector_convert legacy_connector_convert
[connector], [connector],
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_VGA);
break; break;
case CONNECTOR_DVI_I_LEGACY: case CONNECTOR_DVI_I_LEGACY:
devices = 0; devices = 0;
@ -1714,6 +1782,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
ATOM_DEVICE_DFP2_SUPPORT, ATOM_DEVICE_DFP2_SUPPORT,
0), 0),
ATOM_DEVICE_DFP2_SUPPORT); ATOM_DEVICE_DFP2_SUPPORT);
connector_object_id = combios_check_dl_dvi(dev, 0);
} else { } else {
devices |= ATOM_DEVICE_DFP1_SUPPORT; devices |= ATOM_DEVICE_DFP1_SUPPORT;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
@ -1722,19 +1791,24 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
ATOM_DEVICE_DFP1_SUPPORT, ATOM_DEVICE_DFP1_SUPPORT,
0), 0),
ATOM_DEVICE_DFP1_SUPPORT); ATOM_DEVICE_DFP1_SUPPORT);
connector_object_id = CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I;
} }
radeon_add_legacy_connector(dev, radeon_add_legacy_connector(dev,
i, i,
devices, devices,
legacy_connector_convert legacy_connector_convert
[connector], [connector],
&ddc_i2c); &ddc_i2c,
connector_object_id);
break; break;
case CONNECTOR_DVI_D_LEGACY: case CONNECTOR_DVI_D_LEGACY:
if ((tmp >> 4) & 0x1) if ((tmp >> 4) & 0x1) {
devices = ATOM_DEVICE_DFP2_SUPPORT; devices = ATOM_DEVICE_DFP2_SUPPORT;
else connector_object_id = combios_check_dl_dvi(dev, 1);
} else {
devices = ATOM_DEVICE_DFP1_SUPPORT; devices = ATOM_DEVICE_DFP1_SUPPORT;
connector_object_id = CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I;
}
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id radeon_get_encoder_id
(dev, devices, 0), (dev, devices, 0),
@ -1742,7 +1816,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
radeon_add_legacy_connector(dev, i, devices, radeon_add_legacy_connector(dev, i, devices,
legacy_connector_convert legacy_connector_convert
[connector], [connector],
&ddc_i2c); &ddc_i2c,
connector_object_id);
break; break;
case CONNECTOR_CTV_LEGACY: case CONNECTOR_CTV_LEGACY:
case CONNECTOR_STV_LEGACY: case CONNECTOR_STV_LEGACY:
@ -1756,7 +1831,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
ATOM_DEVICE_TV1_SUPPORT, ATOM_DEVICE_TV1_SUPPORT,
legacy_connector_convert legacy_connector_convert
[connector], [connector],
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_SVIDEO);
break; break;
default: default:
DRM_ERROR("Unknown connector type: %d\n", DRM_ERROR("Unknown connector type: %d\n",
@ -1788,7 +1864,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
ATOM_DEVICE_CRT1_SUPPORT | ATOM_DEVICE_CRT1_SUPPORT |
ATOM_DEVICE_DFP1_SUPPORT, ATOM_DEVICE_DFP1_SUPPORT,
DRM_MODE_CONNECTOR_DVII, DRM_MODE_CONNECTOR_DVII,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I);
} else { } else {
uint16_t crt_info = uint16_t crt_info =
combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE); combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE);
@ -1804,7 +1881,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
0, 0,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
DRM_MODE_CONNECTOR_VGA, DRM_MODE_CONNECTOR_VGA,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_VGA);
} else { } else {
DRM_DEBUG("No connector info found\n"); DRM_DEBUG("No connector info found\n");
return false; return false;
@ -1903,7 +1981,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
5, 5,
ATOM_DEVICE_LCD1_SUPPORT, ATOM_DEVICE_LCD1_SUPPORT,
DRM_MODE_CONNECTOR_LVDS, DRM_MODE_CONNECTOR_LVDS,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_LVDS);
} }
} }
@ -1923,7 +2002,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
radeon_add_legacy_connector(dev, 6, radeon_add_legacy_connector(dev, 6,
ATOM_DEVICE_TV1_SUPPORT, ATOM_DEVICE_TV1_SUPPORT,
DRM_MODE_CONNECTOR_SVIDEO, DRM_MODE_CONNECTOR_SVIDEO,
&ddc_i2c); &ddc_i2c,
CONNECTOR_OBJECT_ID_SVIDEO);
} }
} }
} }

Просмотреть файл

@ -397,6 +397,30 @@ static int radeon_lvds_get_modes(struct drm_connector *connector)
static int radeon_lvds_mode_valid(struct drm_connector *connector, static int radeon_lvds_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
struct drm_encoder *encoder = radeon_best_single_encoder(connector);
if ((mode->hdisplay < 320) || (mode->vdisplay < 240))
return MODE_PANEL;
if (encoder) {
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct drm_display_mode *native_mode = &radeon_encoder->native_mode;
/* AVIVO hardware supports downscaling modes larger than the panel
* to the panel size, but I'm not sure this is desirable.
*/
if ((mode->hdisplay > native_mode->hdisplay) ||
(mode->vdisplay > native_mode->vdisplay))
return MODE_PANEL;
/* if scaling is disabled, block non-native modes */
if (radeon_encoder->rmx_type == RMX_OFF) {
if ((mode->hdisplay != native_mode->hdisplay) ||
(mode->vdisplay != native_mode->vdisplay))
return MODE_PANEL;
}
}
return MODE_OK; return MODE_OK;
} }
@ -512,6 +536,8 @@ static int radeon_vga_get_modes(struct drm_connector *connector)
static int radeon_vga_mode_valid(struct drm_connector *connector, static int radeon_vga_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
/* XXX check mode bandwidth */
/* XXX verify against max DAC output frequency */
return MODE_OK; return MODE_OK;
} }
@ -609,6 +635,8 @@ static int radeon_tv_get_modes(struct drm_connector *connector)
static int radeon_tv_mode_valid(struct drm_connector *connector, static int radeon_tv_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
if ((mode->hdisplay > 1024) || (mode->vdisplay > 768))
return MODE_CLOCK_RANGE;
return MODE_OK; return MODE_OK;
} }
@ -801,9 +829,27 @@ static void radeon_dvi_force(struct drm_connector *connector)
radeon_connector->use_digital = true; radeon_connector->use_digital = true;
} }
static int radeon_dvi_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
/* XXX check mode bandwidth */
if (radeon_connector->use_digital && (mode->clock > 165000)) {
if ((radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I) ||
(radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) ||
(radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_B))
return MODE_OK;
else
return MODE_CLOCK_HIGH;
}
return MODE_OK;
}
struct drm_connector_helper_funcs radeon_dvi_connector_helper_funcs = { struct drm_connector_helper_funcs radeon_dvi_connector_helper_funcs = {
.get_modes = radeon_dvi_get_modes, .get_modes = radeon_dvi_get_modes,
.mode_valid = radeon_vga_mode_valid, .mode_valid = radeon_dvi_mode_valid,
.best_encoder = radeon_dvi_encoder, .best_encoder = radeon_dvi_encoder,
}; };
@ -823,7 +869,8 @@ radeon_add_atom_connector(struct drm_device *dev,
int connector_type, int connector_type,
struct radeon_i2c_bus_rec *i2c_bus, struct radeon_i2c_bus_rec *i2c_bus,
bool linkb, bool linkb,
uint32_t igp_lane_info) uint32_t igp_lane_info,
uint16_t connector_object_id)
{ {
struct radeon_device *rdev = dev->dev_private; struct radeon_device *rdev = dev->dev_private;
struct drm_connector *connector; struct drm_connector *connector;
@ -862,6 +909,7 @@ radeon_add_atom_connector(struct drm_device *dev,
radeon_connector->connector_id = connector_id; radeon_connector->connector_id = connector_id;
radeon_connector->devices = supported_device; radeon_connector->devices = supported_device;
radeon_connector->shared_ddc = shared_ddc; radeon_connector->shared_ddc = shared_ddc;
radeon_connector->connector_object_id = connector_object_id;
switch (connector_type) { switch (connector_type) {
case DRM_MODE_CONNECTOR_VGA: case DRM_MODE_CONNECTOR_VGA:
drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type);
@ -1013,7 +1061,8 @@ radeon_add_legacy_connector(struct drm_device *dev,
uint32_t connector_id, uint32_t connector_id,
uint32_t supported_device, uint32_t supported_device,
int connector_type, int connector_type,
struct radeon_i2c_bus_rec *i2c_bus) struct radeon_i2c_bus_rec *i2c_bus,
uint16_t connector_object_id)
{ {
struct radeon_device *rdev = dev->dev_private; struct radeon_device *rdev = dev->dev_private;
struct drm_connector *connector; struct drm_connector *connector;
@ -1042,6 +1091,7 @@ radeon_add_legacy_connector(struct drm_device *dev,
radeon_connector->connector_id = connector_id; radeon_connector->connector_id = connector_id;
radeon_connector->devices = supported_device; radeon_connector->devices = supported_device;
radeon_connector->connector_object_id = connector_object_id;
switch (connector_type) { switch (connector_type) {
case DRM_MODE_CONNECTOR_VGA: case DRM_MODE_CONNECTOR_VGA:
drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type);

Просмотреть файл

@ -722,14 +722,17 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action)
atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev); atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev);
args.v1.ucAction = action; args.v1.ucAction = action;
if (action == ATOM_TRANSMITTER_ACTION_INIT) {
if (ASIC_IS_DCE32(rdev)) { args.v1.usInitInfo = radeon_connector->connector_object_id;
if (radeon_encoder->pixel_clock > 165000) {
args.v2.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock * 10 * 2) / 100);
args.v2.acConfig.fDualLinkConnector = 1;
} else { } else {
args.v2.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock * 10 * 4) / 100); if (radeon_encoder->pixel_clock > 165000)
args.v1.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock / 2) / 10);
else
args.v1.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10);
} }
if (ASIC_IS_DCE32(rdev)) {
if (radeon_encoder->pixel_clock > 165000)
args.v2.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock / 2) / 10);
if (dig->dig_block) if (dig->dig_block)
args.v2.acConfig.ucEncoderSel = 1; args.v2.acConfig.ucEncoderSel = 1;
@ -754,7 +757,6 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action)
} }
} else { } else {
args.v1.ucConfig = ATOM_TRANSMITTER_CONFIG_CLKSRC_PPLL; args.v1.ucConfig = ATOM_TRANSMITTER_CONFIG_CLKSRC_PPLL;
args.v1.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock) / 10);
switch (radeon_encoder->encoder_id) { switch (radeon_encoder->encoder_id) {
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
@ -1137,6 +1139,7 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder,
/* setup and enable the encoder and transmitter */ /* setup and enable the encoder and transmitter */
atombios_dig_encoder_setup(encoder, ATOM_ENABLE); atombios_dig_encoder_setup(encoder, ATOM_ENABLE);
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_INIT);
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP); atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP);
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE); atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE);
break; break;

Просмотреть файл

@ -317,6 +317,7 @@ struct radeon_connector {
struct edid *edid; struct edid *edid;
void *con_priv; void *con_priv;
bool dac_load_detect; bool dac_load_detect;
uint16_t connector_object_id;
}; };
struct radeon_framebuffer { struct radeon_framebuffer {

Просмотреть файл

@ -0,0 +1,65 @@
/*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Rafał Miłecki <zajec5@gmail.com>
*/
#include "drmP.h"
#include "radeon.h"
int radeon_debugfs_pm_init(struct radeon_device *rdev);
int radeon_pm_init(struct radeon_device *rdev)
{
if (radeon_debugfs_pm_init(rdev)) {
DRM_ERROR("Failed to register debugfs file for CP !\n");
}
return 0;
}
/*
* Debugfs info
*/
#if defined(CONFIG_DEBUG_FS)
static int radeon_debugfs_pm_info(struct seq_file *m, void *data)
{
struct drm_info_node *node = (struct drm_info_node *) m->private;
struct drm_device *dev = node->minor->dev;
struct radeon_device *rdev = dev->dev_private;
seq_printf(m, "engine clock: %u0 Hz\n", radeon_get_engine_clock(rdev));
seq_printf(m, "memory clock: %u0 Hz\n", radeon_get_memory_clock(rdev));
return 0;
}
static struct drm_info_list radeon_pm_info_list[] = {
{"radeon_pm_info", radeon_debugfs_pm_info, 0, NULL},
};
#endif
int radeon_debugfs_pm_init(struct radeon_device *rdev)
{
#if defined(CONFIG_DEBUG_FS)
return radeon_debugfs_add_files(rdev, radeon_pm_info_list, ARRAY_SIZE(radeon_pm_info_list));
#else
return 0;
#endif
}

Просмотреть файл

@ -488,6 +488,8 @@ int rs600_init(struct radeon_device *rdev)
} }
/* Initialize clocks */ /* Initialize clocks */
radeon_get_clock_info(rdev->ddev); radeon_get_clock_info(rdev->ddev);
/* Initialize power management */
radeon_pm_init(rdev);
/* Get vram informations */ /* Get vram informations */
rs600_vram_info(rdev); rs600_vram_info(rdev);
/* Initialize memory controller (also test AGP) */ /* Initialize memory controller (also test AGP) */

Просмотреть файл

@ -706,6 +706,8 @@ int rs690_init(struct radeon_device *rdev)
} }
/* Initialize clocks */ /* Initialize clocks */
radeon_get_clock_info(rdev->ddev); radeon_get_clock_info(rdev->ddev);
/* Initialize power management */
radeon_pm_init(rdev);
/* Get vram informations */ /* Get vram informations */
rs690_vram_info(rdev); rs690_vram_info(rdev);
/* Initialize memory controller (also test AGP) */ /* Initialize memory controller (also test AGP) */

Просмотреть файл

@ -587,6 +587,8 @@ int rv515_init(struct radeon_device *rdev)
} }
/* Initialize clocks */ /* Initialize clocks */
radeon_get_clock_info(rdev->ddev); radeon_get_clock_info(rdev->ddev);
/* Initialize power management */
radeon_pm_init(rdev);
/* Get vram informations */ /* Get vram informations */
rv515_vram_info(rdev); rv515_vram_info(rdev);
/* Initialize memory controller (also test AGP) */ /* Initialize memory controller (also test AGP) */

Просмотреть файл

@ -983,10 +983,13 @@ int rv770_init(struct radeon_device *rdev)
r600_scratch_init(rdev); r600_scratch_init(rdev);
/* Initialize surface registers */ /* Initialize surface registers */
radeon_surface_init(rdev); radeon_surface_init(rdev);
/* Initialize clocks */
radeon_get_clock_info(rdev->ddev); radeon_get_clock_info(rdev->ddev);
r = radeon_clocks_init(rdev); r = radeon_clocks_init(rdev);
if (r) if (r)
return r; return r;
/* Initialize power management */
radeon_pm_init(rdev);
/* Fence driver */ /* Fence driver */
r = radeon_fence_driver_init(rdev); r = radeon_fence_driver_init(rdev);
if (r) if (r)

Просмотреть файл

@ -128,7 +128,7 @@ config I2C_PIIX4
ATI SB600 ATI SB600
ATI SB700 ATI SB700
ATI SB800 ATI SB800
AMD SB900 AMD Hudson-2
Serverworks OSB4 Serverworks OSB4
Serverworks CSB5 Serverworks CSB5
Serverworks CSB6 Serverworks CSB6

Просмотреть файл

@ -22,7 +22,7 @@
Intel PIIX4, 440MX Intel PIIX4, 440MX
Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100 Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100
ATI IXP200, IXP300, IXP400, SB600, SB700, SB800 ATI IXP200, IXP300, IXP400, SB600, SB700, SB800
AMD SB900 AMD Hudson-2
SMSC Victory66 SMSC Victory66
Note: we assume there can only be one device, with one SMBus interface. Note: we assume there can only be one device, with one SMBus interface.
@ -233,9 +233,9 @@ static int __devinit piix4_setup_sb800(struct pci_dev *PIIX4_dev,
unsigned short smba_idx = 0xcd6; unsigned short smba_idx = 0xcd6;
u8 smba_en_lo, smba_en_hi, i2ccfg, i2ccfg_offset = 0x10, smb_en = 0x2c; u8 smba_en_lo, smba_en_hi, i2ccfg, i2ccfg_offset = 0x10, smb_en = 0x2c;
/* SB800 SMBus does not support forcing address */ /* SB800 and later SMBus does not support forcing address */
if (force || force_addr) { if (force || force_addr) {
dev_err(&PIIX4_dev->dev, "SB800 SMBus does not support " dev_err(&PIIX4_dev->dev, "SMBus does not support "
"forcing address!\n"); "forcing address!\n");
return -EINVAL; return -EINVAL;
} }
@ -480,7 +480,7 @@ static struct pci_device_id piix4_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_SMBUS) }, { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_SMBUS) },
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS) }, { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS) },
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS) }, { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_SB900_SMBUS) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS) },
{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS,
PCI_DEVICE_ID_SERVERWORKS_OSB4) }, PCI_DEVICE_ID_SERVERWORKS_OSB4) },
{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS,

Просмотреть файл

@ -1046,15 +1046,6 @@ static void ide_port_init_devices(ide_hwif_t *hwif)
if (port_ops && port_ops->init_dev) if (port_ops && port_ops->init_dev)
port_ops->init_dev(drive); port_ops->init_dev(drive);
} }
ide_port_for_each_dev(i, drive, hwif) {
/*
* default to PIO Mode 0 before we figure out
* the most suited mode for the attached device
*/
if (port_ops && port_ops->set_pio_mode)
port_ops->set_pio_mode(drive, 0);
}
} }
static void ide_init_port(ide_hwif_t *hwif, unsigned int port, static void ide_init_port(ide_hwif_t *hwif, unsigned int port,

Просмотреть файл

@ -960,7 +960,8 @@ static int process_idi_event (diva_strace_context_t* pLib,
if (!strncmp("State\\Layer2 No1", path, pVar->path_length)) { if (!strncmp("State\\Layer2 No1", path, pVar->path_length)) {
char* tmp = &pLib->lines[0].pInterface->Layer2[0]; char* tmp = &pLib->lines[0].pInterface->Layer2[0];
dword l2_state; dword l2_state;
diva_strace_read_uint (pVar, &l2_state); if (diva_strace_read_uint(pVar, &l2_state))
return -1;
switch (l2_state) { switch (l2_state) {
case 0: case 0:

Просмотреть файл

@ -2692,7 +2692,7 @@ static byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
if (!(fax_control_bits & T30_CONTROL_BIT_MORE_DOCUMENTS) if (!(fax_control_bits & T30_CONTROL_BIT_MORE_DOCUMENTS)
|| (fax_feature_bits & T30_FEATURE_BIT_MORE_DOCUMENTS)) || (fax_feature_bits & T30_FEATURE_BIT_MORE_DOCUMENTS))
{ {
len = (byte)(&(((T30_INFO *) 0)->universal_6)); len = offsetof(T30_INFO, universal_6);
fax_info_change = false; fax_info_change = false;
if (ncpi->length >= 4) if (ncpi->length >= 4)
{ {
@ -2754,7 +2754,7 @@ static byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
for (i = 0; i < w; i++) for (i = 0; i < w; i++)
((T30_INFO *)(plci->fax_connect_info_buffer))->station_id[i] = fax_parms[4].info[1+i]; ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id[i] = fax_parms[4].info[1+i];
((T30_INFO *)(plci->fax_connect_info_buffer))->head_line_len = 0; ((T30_INFO *)(plci->fax_connect_info_buffer))->head_line_len = 0;
len = (byte)(((T30_INFO *) 0)->station_id + 20); len = offsetof(T30_INFO, station_id) + 20;
w = fax_parms[5].length; w = fax_parms[5].length;
if (w > 20) if (w > 20)
w = 20; w = 20;
@ -2788,7 +2788,7 @@ static byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
} }
else else
{ {
len = (byte)(&(((T30_INFO *) 0)->universal_6)); len = offsetof(T30_INFO, universal_6);
} }
fax_info_change = true; fax_info_change = true;
@ -2892,7 +2892,7 @@ static byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
&& (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_ENABLE_NSF) && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_ENABLE_NSF)
&& (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_NEGOTIATE_RESP)) && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_NEGOTIATE_RESP))
{ {
len = ((byte)(((T30_INFO *) 0)->station_id + 20)); len = offsetof(T30_INFO, station_id) + 20;
if (plci->fax_connect_info_length < len) if (plci->fax_connect_info_length < len)
{ {
((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0; ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0;
@ -3802,7 +3802,7 @@ static byte manufacturer_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
break; break;
} }
ncpi = &m_parms[1]; ncpi = &m_parms[1];
len = ((byte)(((T30_INFO *) 0)->station_id + 20)); len = offsetof(T30_INFO, station_id) + 20;
if (plci->fax_connect_info_length < len) if (plci->fax_connect_info_length < len)
{ {
((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0; ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0;
@ -6844,7 +6844,7 @@ static void nl_ind(PLCI *plci)
if ((plci->requested_options_conn | plci->requested_options | a->requested_options_table[plci->appl->Id-1]) if ((plci->requested_options_conn | plci->requested_options | a->requested_options_table[plci->appl->Id-1])
& ((1L << PRIVATE_FAX_SUB_SEP_PWD) | (1L << PRIVATE_FAX_NONSTANDARD))) & ((1L << PRIVATE_FAX_SUB_SEP_PWD) | (1L << PRIVATE_FAX_NONSTANDARD)))
{ {
i = ((word)(((T30_INFO *) 0)->station_id + 20)) + ((T30_INFO *)plci->NL.RBuffer->P)->head_line_len; i = offsetof(T30_INFO, station_id) + 20 + ((T30_INFO *)plci->NL.RBuffer->P)->head_line_len;
while (i < plci->NL.RBuffer->length) while (i < plci->NL.RBuffer->length)
plci->ncpi_buffer[++len] = plci->NL.RBuffer->P[i++]; plci->ncpi_buffer[++len] = plci->NL.RBuffer->P[i++];
} }
@ -7236,7 +7236,7 @@ static void nl_ind(PLCI *plci)
{ {
plci->RData[1].P = plci->RData[0].P; plci->RData[1].P = plci->RData[0].P;
plci->RData[1].PLength = plci->RData[0].PLength; plci->RData[1].PLength = plci->RData[0].PLength;
plci->RData[0].P = v120_header_buffer + (-((int) v120_header_buffer) & 3); plci->RData[0].P = v120_header_buffer + (-((unsigned long)v120_header_buffer) & 3);
if ((plci->NL.RBuffer->P[0] & V120_HEADER_EXTEND_BIT) || (plci->NL.RLength == 1)) if ((plci->NL.RBuffer->P[0] & V120_HEADER_EXTEND_BIT) || (plci->NL.RLength == 1))
plci->RData[0].PLength = 1; plci->RData[0].PLength = 1;
else else
@ -8473,7 +8473,7 @@ static word add_b23(PLCI *plci, API_PARSE *bp)
fax_control_bits |= T30_CONTROL_BIT_ACCEPT_SEL_POLLING; fax_control_bits |= T30_CONTROL_BIT_ACCEPT_SEL_POLLING;
} }
len = nlc[0]; len = nlc[0];
pos = ((byte)(((T30_INFO *) 0)->station_id + 20)); pos = offsetof(T30_INFO, station_id) + 20;
if (pos < plci->fax_connect_info_length) if (pos < plci->fax_connect_info_length)
{ {
for (i = 1 + plci->fax_connect_info_buffer[pos]; i != 0; i--) for (i = 1 + plci->fax_connect_info_buffer[pos]; i != 0; i--)
@ -8525,7 +8525,7 @@ static word add_b23(PLCI *plci, API_PARSE *bp)
} }
PUT_WORD(&(((T30_INFO *)&nlc[1])->control_bits_low), fax_control_bits); PUT_WORD(&(((T30_INFO *)&nlc[1])->control_bits_low), fax_control_bits);
len = ((byte)(((T30_INFO *) 0)->station_id + 20)); len = offsetof(T30_INFO, station_id) + 20;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
plci->fax_connect_info_buffer[i] = nlc[1+i]; plci->fax_connect_info_buffer[i] = nlc[1+i];
((T30_INFO *) plci->fax_connect_info_buffer)->head_line_len = 0; ((T30_INFO *) plci->fax_connect_info_buffer)->head_line_len = 0;

Просмотреть файл

@ -594,6 +594,7 @@ Amd7930_l1hw(struct PStack *st, int pr, void *arg)
if (cs->debug & L1_DEB_WARN) if (cs->debug & L1_DEB_WARN)
debugl1(cs, "Amd7930: l1hw: l2l1 tx_skb exist this shouldn't happen"); debugl1(cs, "Amd7930: l1hw: l2l1 tx_skb exist this shouldn't happen");
skb_queue_tail(&cs->sq, skb); skb_queue_tail(&cs->sq, skb);
spin_unlock_irqrestore(&cs->lock, flags);
break; break;
} }
if (cs->debug & DEB_DLOG_HEX) if (cs->debug & DEB_DLOG_HEX)

Просмотреть файл

@ -382,7 +382,7 @@ MemwaitforXFW(struct IsdnCardState *cs, int hscx)
{ {
int to = 50; int to = 50;
while ((!(MemReadHSCX(cs, hscx, HSCX_STAR) & 0x44) == 0x40) && to) { while (((MemReadHSCX(cs, hscx, HSCX_STAR) & 0x44) != 0x40) && to) {
udelay(1); udelay(1);
to--; to--;
} }

Просмотреть файл

@ -477,62 +477,62 @@ static void
modem_set_init(struct IsdnCardState *cs) { modem_set_init(struct IsdnCardState *cs) {
int timeout; int timeout;
#define RCV_DELAY 20000 #define RCV_DELAY 20
modem_write_cmd(cs, MInit_1, strlen(MInit_1)); modem_write_cmd(cs, MInit_1, strlen(MInit_1));
timeout = 1000; timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt) while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000); udelay(1000);
debugl1(cs, "msi tout=%d", timeout); debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY); mdelay(RCV_DELAY);
modem_write_cmd(cs, MInit_2, strlen(MInit_2)); modem_write_cmd(cs, MInit_2, strlen(MInit_2));
timeout = 1000; timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt) while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000); udelay(1000);
debugl1(cs, "msi tout=%d", timeout); debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY); mdelay(RCV_DELAY);
modem_write_cmd(cs, MInit_3, strlen(MInit_3)); modem_write_cmd(cs, MInit_3, strlen(MInit_3));
timeout = 1000; timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt) while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000); udelay(1000);
debugl1(cs, "msi tout=%d", timeout); debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY); mdelay(RCV_DELAY);
modem_write_cmd(cs, MInit_4, strlen(MInit_4)); modem_write_cmd(cs, MInit_4, strlen(MInit_4));
timeout = 1000; timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt) while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000); udelay(1000);
debugl1(cs, "msi tout=%d", timeout); debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY ); mdelay(RCV_DELAY);
modem_write_cmd(cs, MInit_5, strlen(MInit_5)); modem_write_cmd(cs, MInit_5, strlen(MInit_5));
timeout = 1000; timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt) while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000); udelay(1000);
debugl1(cs, "msi tout=%d", timeout); debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY); mdelay(RCV_DELAY);
modem_write_cmd(cs, MInit_6, strlen(MInit_6)); modem_write_cmd(cs, MInit_6, strlen(MInit_6));
timeout = 1000; timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt) while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000); udelay(1000);
debugl1(cs, "msi tout=%d", timeout); debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY); mdelay(RCV_DELAY);
modem_write_cmd(cs, MInit_7, strlen(MInit_7)); modem_write_cmd(cs, MInit_7, strlen(MInit_7));
timeout = 1000; timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt) while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000); udelay(1000);
debugl1(cs, "msi tout=%d", timeout); debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY); mdelay(RCV_DELAY);
} }
static void static void
modem_set_dial(struct IsdnCardState *cs, int outgoing) { modem_set_dial(struct IsdnCardState *cs, int outgoing) {
int timeout; int timeout;
#define RCV_DELAY 20000 #define RCV_DELAY 20
modem_write_cmd(cs, MInit_speed28800, strlen(MInit_speed28800)); modem_write_cmd(cs, MInit_speed28800, strlen(MInit_speed28800));
timeout = 1000; timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt) while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000); udelay(1000);
debugl1(cs, "msi tout=%d", timeout); debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY); mdelay(RCV_DELAY);
if (outgoing) if (outgoing)
modem_write_cmd(cs, MInit_dialout, strlen(MInit_dialout)); modem_write_cmd(cs, MInit_dialout, strlen(MInit_dialout));
else else
@ -541,7 +541,7 @@ modem_set_dial(struct IsdnCardState *cs, int outgoing) {
while(timeout-- && cs->hw.elsa.transcnt) while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000); udelay(1000);
debugl1(cs, "msi tout=%d", timeout); debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY); mdelay(RCV_DELAY);
} }
static void static void

Просмотреть файл

@ -817,8 +817,8 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish)
} }
/* we have a complete hdlc packet */ /* we have a complete hdlc packet */
if (finish) { if (finish) {
if ((!fifo->skbuff->data[fifo->skbuff->len - 1]) if (fifo->skbuff->len > 3 &&
&& (fifo->skbuff->len > 3)) { !fifo->skbuff->data[fifo->skbuff->len - 1]) {
if (fifon == HFCUSB_D_RX) { if (fifon == HFCUSB_D_RX) {
DBG(HFCUSB_DBG_DCHANNEL, DBG(HFCUSB_DBG_DCHANNEL,

Просмотреть файл

@ -32,7 +32,7 @@ waitforXFW(struct IsdnCardState *cs, int hscx)
{ {
int to = 50; int to = 50;
while ((!(READHSCX(cs, hscx, HSCX_STAR) & 0x44) == 0x40) && to) { while (((READHSCX(cs, hscx, HSCX_STAR) & 0x44) != 0x40) && to) {
udelay(1); udelay(1);
to--; to--;
} }

Просмотреть файл

@ -468,6 +468,7 @@ ICC_l1hw(struct PStack *st, int pr, void *arg)
if (cs->debug & L1_DEB_WARN) if (cs->debug & L1_DEB_WARN)
debugl1(cs, " l2l1 tx_skb exist this shouldn't happen"); debugl1(cs, " l2l1 tx_skb exist this shouldn't happen");
skb_queue_tail(&cs->sq, skb); skb_queue_tail(&cs->sq, skb);
spin_unlock_irqrestore(&cs->lock, flags);
break; break;
} }
if (cs->debug & DEB_DLOG_HEX) if (cs->debug & DEB_DLOG_HEX)

Просмотреть файл

@ -364,7 +364,7 @@ add_layer2(struct mISDNchannel *ch, struct mISDNstack *st)
static int static int
st_own_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg) st_own_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg)
{ {
if (!ch->st || ch->st->layer1) if (!ch->st || !ch->st->layer1)
return -EINVAL; return -EINVAL;
return ch->st->layer1->ctrl(ch->st->layer1, cmd, arg); return ch->st->layer1->ctrl(ch->st->layer1, cmd, arg);
} }

Просмотреть файл

@ -6504,7 +6504,8 @@ void md_do_sync(mddev_t *mddev)
skip: skip:
mddev->curr_resync = 0; mddev->curr_resync = 0;
mddev->curr_resync_completed = 0; mddev->curr_resync_completed = 0;
mddev->resync_min = 0; if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery))
/* We completed so max setting can be forgotten. */
mddev->resync_max = MaxSector; mddev->resync_max = MaxSector;
sysfs_notify(&mddev->kobj, NULL, "sync_completed"); sysfs_notify(&mddev->kobj, NULL, "sync_completed");
wake_up(&resync_wait); wake_up(&resync_wait);

Просмотреть файл

@ -4049,6 +4049,8 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped
sector_nr = conf->reshape_progress; sector_nr = conf->reshape_progress;
sector_div(sector_nr, new_data_disks); sector_div(sector_nr, new_data_disks);
if (sector_nr) { if (sector_nr) {
mddev->curr_resync_completed = sector_nr;
sysfs_notify(&mddev->kobj, NULL, "sync_completed");
*skipped = 1; *skipped = 1;
return sector_nr; return sector_nr;
} }

Просмотреть файл

@ -486,6 +486,7 @@ config MTD_BFIN_ASYNC
config MTD_GPIO_ADDR config MTD_GPIO_ADDR
tristate "GPIO-assisted Flash Chip Support" tristate "GPIO-assisted Flash Chip Support"
depends on GENERIC_GPIO || GPIOLIB
depends on MTD_COMPLEX_MAPPINGS depends on MTD_COMPLEX_MAPPINGS
select MTD_PARTITIONS select MTD_PARTITIONS
help help

Просмотреть файл

@ -13,7 +13,9 @@
* Licensed under the GPL-2 or later. * Licensed under the GPL-2 or later.
*/ */
#include <linux/gpio.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
@ -23,9 +25,6 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/types.h> #include <linux/types.h>
#include <asm/gpio.h>
#include <asm/io.h>
#define pr_devinit(fmt, args...) ({ static const __devinitconst char __fmt[] = fmt; printk(__fmt, ## args); }) #define pr_devinit(fmt, args...) ({ static const __devinitconst char __fmt[] = fmt; printk(__fmt, ## args); })
#define DRIVER_NAME "gpio-addr-flash" #define DRIVER_NAME "gpio-addr-flash"

Просмотреть файл

@ -761,6 +761,7 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
* @mtd: mtd info structure * @mtd: mtd info structure
* @chip: nand chip info structure * @chip: nand chip info structure
* @buf: buffer to store read data * @buf: buffer to store read data
* @page: page number to read
* *
* Not for syndrome calculating ecc controllers, which use a special oob layout * Not for syndrome calculating ecc controllers, which use a special oob layout
*/ */
@ -777,6 +778,7 @@ static int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
* @mtd: mtd info structure * @mtd: mtd info structure
* @chip: nand chip info structure * @chip: nand chip info structure
* @buf: buffer to store read data * @buf: buffer to store read data
* @page: page number to read
* *
* We need a special oob layout and handling even when OOB isn't used. * We need a special oob layout and handling even when OOB isn't used.
*/ */
@ -818,6 +820,7 @@ static int nand_read_page_raw_syndrome(struct mtd_info *mtd, struct nand_chip *c
* @mtd: mtd info structure * @mtd: mtd info structure
* @chip: nand chip info structure * @chip: nand chip info structure
* @buf: buffer to store read data * @buf: buffer to store read data
* @page: page number to read
*/ */
static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip, static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
uint8_t *buf, int page) uint8_t *buf, int page)
@ -939,6 +942,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip, uint3
* @mtd: mtd info structure * @mtd: mtd info structure
* @chip: nand chip info structure * @chip: nand chip info structure
* @buf: buffer to store read data * @buf: buffer to store read data
* @page: page number to read
* *
* Not for syndrome calculating ecc controllers which need a special oob layout * Not for syndrome calculating ecc controllers which need a special oob layout
*/ */
@ -983,6 +987,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
* @mtd: mtd info structure * @mtd: mtd info structure
* @chip: nand chip info structure * @chip: nand chip info structure
* @buf: buffer to store read data * @buf: buffer to store read data
* @page: page number to read
* *
* Hardware ECC for large page chips, require OOB to be read first. * Hardware ECC for large page chips, require OOB to be read first.
* For this ECC mode, the write_page method is re-used from ECC_HW. * For this ECC mode, the write_page method is re-used from ECC_HW.
@ -1031,6 +1036,7 @@ static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd,
* @mtd: mtd info structure * @mtd: mtd info structure
* @chip: nand chip info structure * @chip: nand chip info structure
* @buf: buffer to store read data * @buf: buffer to store read data
* @page: page number to read
* *
* The hw generator calculates the error syndrome automatically. Therefor * The hw generator calculates the error syndrome automatically. Therefor
* we need a special oob layout and handling. * we need a special oob layout and handling.

Просмотреть файл

@ -259,6 +259,8 @@ struct be_adapter {
u32 port_num; u32 port_num;
bool promiscuous; bool promiscuous;
u32 cap; u32 cap;
u32 rx_fc; /* Rx flow control */
u32 tx_fc; /* Tx flow control */
}; };
extern const struct ethtool_ops be_ethtool_ops; extern const struct ethtool_ops be_ethtool_ops;

Просмотреть файл

@ -68,7 +68,7 @@ enum {
#define CQE_STATUS_COMPL_MASK 0xFFFF #define CQE_STATUS_COMPL_MASK 0xFFFF
#define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */ #define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */
#define CQE_STATUS_EXTD_MASK 0xFFFF #define CQE_STATUS_EXTD_MASK 0xFFFF
#define CQE_STATUS_EXTD_SHIFT 0 /* bits 0 - 15 */ #define CQE_STATUS_EXTD_SHIFT 16 /* bits 16 - 31 */
struct be_mcc_compl { struct be_mcc_compl {
u32 status; /* dword 0 */ u32 status; /* dword 0 */

Просмотреть файл

@ -323,10 +323,12 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
if (ecmd->autoneg != 0) if (ecmd->autoneg != 0)
return -EINVAL; return -EINVAL;
adapter->tx_fc = ecmd->tx_pause;
adapter->rx_fc = ecmd->rx_pause;
status = be_cmd_set_flow_control(adapter, ecmd->tx_pause, status = be_cmd_set_flow_control(adapter,
ecmd->rx_pause); adapter->tx_fc, adapter->rx_fc);
if (!status) if (status)
dev_warn(&adapter->pdev->dev, "Pause param set failed.\n"); dev_warn(&adapter->pdev->dev, "Pause param set failed.\n");
return status; return status;

Просмотреть файл

@ -1610,11 +1610,21 @@ static int be_open(struct net_device *netdev)
status = be_cmd_link_status_query(adapter, &link_up); status = be_cmd_link_status_query(adapter, &link_up);
if (status) if (status)
return status; goto ret_sts;
be_link_status_update(adapter, link_up); be_link_status_update(adapter, link_up);
status = be_vid_config(adapter);
if (status)
goto ret_sts;
status = be_cmd_set_flow_control(adapter,
adapter->tx_fc, adapter->rx_fc);
if (status)
goto ret_sts;
schedule_delayed_work(&adapter->work, msecs_to_jiffies(100)); schedule_delayed_work(&adapter->work, msecs_to_jiffies(100));
return 0; ret_sts:
return status;
} }
static int be_setup(struct be_adapter *adapter) static int be_setup(struct be_adapter *adapter)
@ -1648,17 +1658,8 @@ static int be_setup(struct be_adapter *adapter)
if (status != 0) if (status != 0)
goto rx_qs_destroy; goto rx_qs_destroy;
status = be_vid_config(adapter);
if (status != 0)
goto mccqs_destroy;
status = be_cmd_set_flow_control(adapter, true, true);
if (status != 0)
goto mccqs_destroy;
return 0; return 0;
mccqs_destroy:
be_mcc_queues_destroy(adapter);
rx_qs_destroy: rx_qs_destroy:
be_rx_queues_destroy(adapter); be_rx_queues_destroy(adapter);
tx_qs_destroy: tx_qs_destroy:
@ -1909,6 +1910,10 @@ static void be_netdev_init(struct net_device *netdev)
adapter->rx_csum = true; adapter->rx_csum = true;
/* Default settings for Rx and Tx flow control */
adapter->rx_fc = true;
adapter->tx_fc = true;
netif_set_gso_max_size(netdev, 65535); netif_set_gso_max_size(netdev, 65535);
BE_SET_NETDEV_OPS(netdev, &be_netdev_ops); BE_SET_NETDEV_OPS(netdev, &be_netdev_ops);
@ -2171,6 +2176,7 @@ static int be_suspend(struct pci_dev *pdev, pm_message_t state)
be_close(netdev); be_close(netdev);
rtnl_unlock(); rtnl_unlock();
} }
be_cmd_get_flow_control(adapter, &adapter->tx_fc, &adapter->rx_fc);
be_clear(adapter); be_clear(adapter);
pci_save_state(pdev); pci_save_state(pdev);

Просмотреть файл

@ -589,6 +589,22 @@ static int can_changelink(struct net_device *dev,
return 0; return 0;
} }
static size_t can_get_size(const struct net_device *dev)
{
struct can_priv *priv = netdev_priv(dev);
size_t size;
size = nla_total_size(sizeof(u32)); /* IFLA_CAN_STATE */
size += sizeof(struct can_ctrlmode); /* IFLA_CAN_CTRLMODE */
size += nla_total_size(sizeof(u32)); /* IFLA_CAN_RESTART_MS */
size += sizeof(struct can_bittiming); /* IFLA_CAN_BITTIMING */
size += sizeof(struct can_clock); /* IFLA_CAN_CLOCK */
if (priv->bittiming_const) /* IFLA_CAN_BITTIMING_CONST */
size += sizeof(struct can_bittiming_const);
return size;
}
static int can_fill_info(struct sk_buff *skb, const struct net_device *dev) static int can_fill_info(struct sk_buff *skb, const struct net_device *dev)
{ {
struct can_priv *priv = netdev_priv(dev); struct can_priv *priv = netdev_priv(dev);
@ -639,6 +655,7 @@ static struct rtnl_link_ops can_link_ops __read_mostly = {
.setup = can_setup, .setup = can_setup,
.newlink = can_newlink, .newlink = can_newlink,
.changelink = can_changelink, .changelink = can_changelink,
.get_size = can_get_size,
.fill_info = can_fill_info, .fill_info = can_fill_info,
.fill_xstats = can_fill_xstats, .fill_xstats = can_fill_xstats,
}; };

Просмотреть файл

@ -319,7 +319,7 @@ static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg)
cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame)); cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
cf->can_id = msg->msg.can_msg.id; cf->can_id = le32_to_cpu(msg->msg.can_msg.id);
cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8); cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8);
if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME
@ -813,6 +813,9 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
msg->length = CPC_CAN_MSG_MIN_SIZE + cf->can_dlc; msg->length = CPC_CAN_MSG_MIN_SIZE + cf->can_dlc;
} }
/* Respect byte order */
msg->msg.can_msg.id = cpu_to_le32(msg->msg.can_msg.id);
for (i = 0; i < MAX_TX_URBS; i++) { for (i = 0; i < MAX_TX_URBS; i++) {
if (dev->tx_contexts[i].echo_index == MAX_TX_URBS) { if (dev->tx_contexts[i].echo_index == MAX_TX_URBS) {
context = &dev->tx_contexts[i]; context = &dev->tx_contexts[i];

Просмотреть файл

@ -4342,11 +4342,11 @@ static int cas_open(struct net_device *dev)
cas_unlock_all_restore(cp, flags); cas_unlock_all_restore(cp, flags);
} }
err = -ENOMEM;
if (cas_tx_tiny_alloc(cp) < 0) if (cas_tx_tiny_alloc(cp) < 0)
return -ENOMEM; goto err_unlock;
/* alloc rx descriptors */ /* alloc rx descriptors */
err = -ENOMEM;
if (cas_alloc_rxds(cp) < 0) if (cas_alloc_rxds(cp) < 0)
goto err_tx_tiny; goto err_tx_tiny;
@ -4386,6 +4386,7 @@ err_spare:
cas_free_rxds(cp); cas_free_rxds(cp);
err_tx_tiny: err_tx_tiny:
cas_tx_tiny_free(cp); cas_tx_tiny_free(cp);
err_unlock:
mutex_unlock(&cp->pm_mutex); mutex_unlock(&cp->pm_mutex);
return err; return err;
} }

Просмотреть файл

@ -2221,7 +2221,7 @@ void emac_poll_controller(struct net_device *ndev)
struct emac_priv *priv = netdev_priv(ndev); struct emac_priv *priv = netdev_priv(ndev);
emac_int_disable(priv); emac_int_disable(priv);
emac_irq(ndev->irq, priv); emac_irq(ndev->irq, ndev);
emac_int_enable(priv); emac_int_enable(priv);
} }
#endif #endif

Просмотреть файл

@ -427,3 +427,4 @@ void fsl_pq_mdio_exit(void)
of_unregister_platform_driver(&fsl_pq_mdio_driver); of_unregister_platform_driver(&fsl_pq_mdio_driver);
} }
module_exit(fsl_pq_mdio_exit); module_exit(fsl_pq_mdio_exit);
MODULE_LICENSE("GPL");

Просмотреть файл

@ -44,6 +44,7 @@
#include "ixgbe.h" #include "ixgbe.h"
#include "ixgbe_common.h" #include "ixgbe_common.h"
#include "ixgbe_dcb_82599.h"
char ixgbe_driver_name[] = "ixgbe"; char ixgbe_driver_name[] = "ixgbe";
static const char ixgbe_driver_string[] = static const char ixgbe_driver_string[] =
@ -226,6 +227,56 @@ static void ixgbe_unmap_and_free_tx_resource(struct ixgbe_adapter *adapter,
/* tx_buffer_info must be completely set up in the transmit path */ /* tx_buffer_info must be completely set up in the transmit path */
} }
/**
* ixgbe_tx_is_paused - check if the tx ring is paused
* @adapter: the ixgbe adapter
* @tx_ring: the corresponding tx_ring
*
* If not in DCB mode, checks TFCS.TXOFF, otherwise, find out the
* corresponding TC of this tx_ring when checking TFCS.
*
* Returns : true if paused
*/
static inline bool ixgbe_tx_is_paused(struct ixgbe_adapter *adapter,
struct ixgbe_ring *tx_ring)
{
int tc;
u32 txoff = IXGBE_TFCS_TXOFF;
#ifdef CONFIG_IXGBE_DCB
if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
int reg_idx = tx_ring->reg_idx;
int dcb_i = adapter->ring_feature[RING_F_DCB].indices;
if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
tc = reg_idx >> 2;
txoff = IXGBE_TFCS_TXOFF0;
} else if (adapter->hw.mac.type == ixgbe_mac_82599EB) {
tc = 0;
txoff = IXGBE_TFCS_TXOFF;
if (dcb_i == 8) {
/* TC0, TC1 */
tc = reg_idx >> 5;
if (tc == 2) /* TC2, TC3 */
tc += (reg_idx - 64) >> 4;
else if (tc == 3) /* TC4, TC5, TC6, TC7 */
tc += 1 + ((reg_idx - 96) >> 3);
} else if (dcb_i == 4) {
/* TC0, TC1 */
tc = reg_idx >> 6;
if (tc == 1) {
tc += (reg_idx - 64) >> 5;
if (tc == 2) /* TC2, TC3 */
tc += (reg_idx - 96) >> 4;
}
}
}
txoff <<= tc;
}
#endif
return IXGBE_READ_REG(&adapter->hw, IXGBE_TFCS) & txoff;
}
static inline bool ixgbe_check_tx_hang(struct ixgbe_adapter *adapter, static inline bool ixgbe_check_tx_hang(struct ixgbe_adapter *adapter,
struct ixgbe_ring *tx_ring, struct ixgbe_ring *tx_ring,
unsigned int eop) unsigned int eop)
@ -237,7 +288,7 @@ static inline bool ixgbe_check_tx_hang(struct ixgbe_adapter *adapter,
adapter->detect_tx_hung = false; adapter->detect_tx_hung = false;
if (tx_ring->tx_buffer_info[eop].time_stamp && if (tx_ring->tx_buffer_info[eop].time_stamp &&
time_after(jiffies, tx_ring->tx_buffer_info[eop].time_stamp + HZ) && time_after(jiffies, tx_ring->tx_buffer_info[eop].time_stamp + HZ) &&
!(IXGBE_READ_REG(&adapter->hw, IXGBE_TFCS) & IXGBE_TFCS_TXOFF)) { !ixgbe_tx_is_paused(adapter, tx_ring)) {
/* detected Tx unit hang */ /* detected Tx unit hang */
union ixgbe_adv_tx_desc *tx_desc; union ixgbe_adv_tx_desc *tx_desc;
tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop); tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop);
@ -412,19 +463,23 @@ static void ixgbe_update_tx_dca(struct ixgbe_adapter *adapter,
u32 txctrl; u32 txctrl;
int cpu = get_cpu(); int cpu = get_cpu();
int q = tx_ring - adapter->tx_ring; int q = tx_ring - adapter->tx_ring;
struct ixgbe_hw *hw = &adapter->hw;
if (tx_ring->cpu != cpu) { if (tx_ring->cpu != cpu) {
txctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_DCA_TXCTRL(q));
if (adapter->hw.mac.type == ixgbe_mac_82598EB) { if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(q));
txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK; txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK;
txctrl |= dca3_get_tag(&adapter->pdev->dev, cpu); txctrl |= dca3_get_tag(&adapter->pdev->dev, cpu);
txctrl |= IXGBE_DCA_TXCTRL_DESC_DCA_EN;
IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(q), txctrl);
} else if (adapter->hw.mac.type == ixgbe_mac_82599EB) { } else if (adapter->hw.mac.type == ixgbe_mac_82599EB) {
txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(q));
txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK_82599; txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK_82599;
txctrl |= (dca3_get_tag(&adapter->pdev->dev, cpu) << txctrl |= (dca3_get_tag(&adapter->pdev->dev, cpu) <<
IXGBE_DCA_TXCTRL_CPUID_SHIFT_82599); IXGBE_DCA_TXCTRL_CPUID_SHIFT_82599);
}
txctrl |= IXGBE_DCA_TXCTRL_DESC_DCA_EN; txctrl |= IXGBE_DCA_TXCTRL_DESC_DCA_EN;
IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_TXCTRL(q), txctrl); IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(q), txctrl);
}
tx_ring->cpu = cpu; tx_ring->cpu = cpu;
} }
put_cpu(); put_cpu();
@ -1913,11 +1968,25 @@ static void ixgbe_configure_tx(struct ixgbe_adapter *adapter)
break; break;
} }
} }
if (hw->mac.type == ixgbe_mac_82599EB) { if (hw->mac.type == ixgbe_mac_82599EB) {
u32 rttdcs;
/* disable the arbiter while setting MTQC */
rttdcs = IXGBE_READ_REG(hw, IXGBE_RTTDCS);
rttdcs |= IXGBE_RTTDCS_ARBDIS;
IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs);
/* We enable 8 traffic classes, DCB only */ /* We enable 8 traffic classes, DCB only */
if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) if (adapter->flags & IXGBE_FLAG_DCB_ENABLED)
IXGBE_WRITE_REG(hw, IXGBE_MTQC, (IXGBE_MTQC_RT_ENA | IXGBE_WRITE_REG(hw, IXGBE_MTQC, (IXGBE_MTQC_RT_ENA |
IXGBE_MTQC_8TC_8TQ)); IXGBE_MTQC_8TC_8TQ));
else
IXGBE_WRITE_REG(hw, IXGBE_MTQC, IXGBE_MTQC_64Q_1PB);
/* re-eable the arbiter */
rttdcs &= ~IXGBE_RTTDCS_ARBDIS;
IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs);
} }
} }
@ -2471,7 +2540,10 @@ static void ixgbe_configure(struct ixgbe_adapter *adapter)
ixgbe_restore_vlan(adapter); ixgbe_restore_vlan(adapter);
#ifdef CONFIG_IXGBE_DCB #ifdef CONFIG_IXGBE_DCB
if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
if (hw->mac.type == ixgbe_mac_82598EB)
netif_set_gso_max_size(netdev, 32768); netif_set_gso_max_size(netdev, 32768);
else
netif_set_gso_max_size(netdev, 65536);
ixgbe_configure_dcb(adapter); ixgbe_configure_dcb(adapter);
} else { } else {
netif_set_gso_max_size(netdev, 65536); netif_set_gso_max_size(netdev, 65536);

Просмотреть файл

@ -223,40 +223,51 @@ static int __devinit macsonic_init(struct net_device *dev)
return 0; return 0;
} }
static int __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev) #define INVALID_MAC(mac) (memcmp(mac, "\x08\x00\x07", 3) && \
memcmp(mac, "\x00\xA0\x40", 3) && \
memcmp(mac, "\x00\x80\x19", 3) && \
memcmp(mac, "\x00\x05\x02", 3))
static void __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev)
{ {
struct sonic_local *lp = netdev_priv(dev); struct sonic_local *lp = netdev_priv(dev);
const int prom_addr = ONBOARD_SONIC_PROM_BASE; const int prom_addr = ONBOARD_SONIC_PROM_BASE;
int i;
/* On NuBus boards we can sometimes look in the ROM resources.
No such luck for comm-slot/onboard. */
for(i = 0; i < 6; i++)
dev->dev_addr[i] = SONIC_READ_PROM(i);
/* Most of the time, the address is bit-reversed. The NetBSD
source has a rather long and detailed historical account of
why this is so. */
if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) &&
memcmp(dev->dev_addr, "\x00\xA0\x40", 3) &&
memcmp(dev->dev_addr, "\x00\x80\x19", 3) &&
memcmp(dev->dev_addr, "\x00\x05\x02", 3))
bit_reverse_addr(dev->dev_addr);
else
return 0;
/* If we still have what seems to be a bogus address, we'll
look in the CAM. The top entry should be ours. */
/* Danger! This only works if MacOS has already initialized
the card... */
if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) &&
memcmp(dev->dev_addr, "\x00\xA0\x40", 3) &&
memcmp(dev->dev_addr, "\x00\x80\x19", 3) &&
memcmp(dev->dev_addr, "\x00\x05\x02", 3))
{
unsigned short val; unsigned short val;
printk(KERN_INFO "macsonic: PROM seems to be wrong, trying CAM entry 15\n"); /*
* On NuBus boards we can sometimes look in the ROM resources.
* No such luck for comm-slot/onboard.
* On the PowerBook 520, the PROM base address is a mystery.
*/
if (hwreg_present((void *)prom_addr)) {
int i;
for (i = 0; i < 6; i++)
dev->dev_addr[i] = SONIC_READ_PROM(i);
if (!INVALID_MAC(dev->dev_addr))
return;
/*
* Most of the time, the address is bit-reversed. The NetBSD
* source has a rather long and detailed historical account of
* why this is so.
*/
bit_reverse_addr(dev->dev_addr);
if (!INVALID_MAC(dev->dev_addr))
return;
/*
* If we still have what seems to be a bogus address, we'll
* look in the CAM. The top entry should be ours.
*/
printk(KERN_WARNING "macsonic: MAC address in PROM seems "
"to be invalid, trying CAM\n");
} else {
printk(KERN_WARNING "macsonic: cannot read MAC address from "
"PROM, trying CAM\n");
}
/* This only works if MacOS has already initialized the card. */
SONIC_WRITE(SONIC_CMD, SONIC_CR_RST); SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
SONIC_WRITE(SONIC_CEP, 15); SONIC_WRITE(SONIC_CEP, 15);
@ -271,21 +282,14 @@ static int __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev)
dev->dev_addr[1] = val >> 8; dev->dev_addr[1] = val >> 8;
dev->dev_addr[0] = val & 0xff; dev->dev_addr[0] = val & 0xff;
printk(KERN_INFO "HW Address from CAM 15: %pM\n", if (!INVALID_MAC(dev->dev_addr))
dev->dev_addr); return;
} else return 0;
if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) && /* Still nonsense ... messed up someplace! */
memcmp(dev->dev_addr, "\x00\xA0\x40", 3) &&
memcmp(dev->dev_addr, "\x00\x80\x19", 3) && printk(KERN_WARNING "macsonic: MAC address in CAM entry 15 "
memcmp(dev->dev_addr, "\x00\x05\x02", 3)) "seems invalid, will use a random MAC\n");
{ random_ether_addr(dev->dev_addr);
/*
* Still nonsense ... messed up someplace!
*/
printk(KERN_ERR "macsonic: ERROR (INVALID MAC)\n");
return -EIO;
} else return 0;
} }
static int __devinit mac_onboard_sonic_probe(struct net_device *dev) static int __devinit mac_onboard_sonic_probe(struct net_device *dev)
@ -402,8 +406,7 @@ static int __devinit mac_onboard_sonic_probe(struct net_device *dev)
SONIC_WRITE(SONIC_ISR, 0x7fff); SONIC_WRITE(SONIC_ISR, 0x7fff);
/* Now look for the MAC address. */ /* Now look for the MAC address. */
if (mac_onboard_sonic_ethernet_addr(dev) != 0) mac_onboard_sonic_ethernet_addr(dev);
return -ENODEV;
/* Shared init code */ /* Shared init code */
return macsonic_init(dev); return macsonic_init(dev);

Просмотреть файл

@ -3916,6 +3916,8 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
goto err_out; goto err_out;
} }
/* Set PCIe reset type for EEH to fundamental. */
pdev->needs_freset = 1;
pci_save_state(pdev); pci_save_state(pdev);
qdev->reg_base = qdev->reg_base =
ioremap_nocache(pci_resource_start(pdev, 1), ioremap_nocache(pci_resource_start(pdev, 1),

Просмотреть файл

@ -499,7 +499,7 @@ static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp)
/* Wait for the interrupt to come in. */ /* Wait for the interrupt to come in. */
status = ql_wait_mbx_cmd_cmplt(qdev); status = ql_wait_mbx_cmd_cmplt(qdev);
if (status) if (status)
goto end; continue;
/* Process the event. If it's an AEN, it /* Process the event. If it's an AEN, it
* will be handled in-line or a worker * will be handled in-line or a worker

Просмотреть файл

@ -188,7 +188,7 @@ static int sfn4111t_reset(struct efx_nic *efx)
efx_oword_t reg; efx_oword_t reg;
/* GPIO 3 and the GPIO register are shared with I2C, so block that */ /* GPIO 3 and the GPIO register are shared with I2C, so block that */
mutex_lock(&efx->i2c_adap.bus_lock); i2c_lock_adapter(&efx->i2c_adap);
/* Pull RST_N (GPIO 2) low then let it up again, setting the /* Pull RST_N (GPIO 2) low then let it up again, setting the
* FLASH_CFG_1 strap (GPIO 3) appropriately. Only change the * FLASH_CFG_1 strap (GPIO 3) appropriately. Only change the
@ -204,7 +204,7 @@ static int sfn4111t_reset(struct efx_nic *efx)
falcon_write(efx, &reg, GPIO_CTL_REG_KER); falcon_write(efx, &reg, GPIO_CTL_REG_KER);
msleep(1); msleep(1);
mutex_unlock(&efx->i2c_adap.bus_lock); i2c_unlock_adapter(&efx->i2c_adap);
ssleep(1); ssleep(1);
return 0; return 0;

Просмотреть файл

@ -174,7 +174,7 @@ config USB_NET_CDCETHER
* Ericsson Mobile Broadband Module (all variants) * Ericsson Mobile Broadband Module (all variants)
* Motorola (DM100 and SB4100) * Motorola (DM100 and SB4100)
* Broadcom Cable Modem (reference design) * Broadcom Cable Modem (reference design)
* Toshiba (PCX1100U and F3507g) * Toshiba (PCX1100U and F3507g/F3607gw)
* ... * ...
This driver creates an interface named "ethX", where X depends on This driver creates an interface named "ethX", where X depends on

Просмотреть файл

@ -544,20 +544,60 @@ static const struct usb_device_id products [] = {
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &cdc_info, .driver_info = (unsigned long) &cdc_info,
}, { }, {
/* Ericsson F3307 */ /* Ericsson F3607gw ver 2 */
USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1905, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &cdc_info,
}, {
/* Ericsson F3607gw ver 3 */
USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1906, USB_CLASS_COMM, USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1906, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &cdc_info, .driver_info = (unsigned long) &cdc_info,
}, {
/* Ericsson F3307 */
USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x190a, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &cdc_info,
}, {
/* Ericsson F3307 ver 2 */
USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1909, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &cdc_info,
}, {
/* Ericsson C3607w */
USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1049, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &cdc_info,
}, { }, {
/* Toshiba F3507g */ /* Toshiba F3507g */
USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x130b, USB_CLASS_COMM, USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x130b, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &cdc_info, .driver_info = (unsigned long) &cdc_info,
}, {
/* Toshiba F3607gw */
USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x130c, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &cdc_info,
}, {
/* Toshiba F3607gw ver 2 */
USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x1311, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &cdc_info,
}, { }, {
/* Dell F3507g */ /* Dell F3507g */
USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8147, USB_CLASS_COMM, USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8147, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &cdc_info, .driver_info = (unsigned long) &cdc_info,
}, {
/* Dell F3607gw */
USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8183, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &cdc_info,
}, {
/* Dell F3607gw ver 2 */
USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8184, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &cdc_info,
}, },
{ }, // END { }, // END
}; };

Просмотреть файл

@ -998,7 +998,7 @@ static unsigned int features[] = {
VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN,
}; };
static struct virtio_driver virtio_net = { static struct virtio_driver virtio_net_driver = {
.feature_table = features, .feature_table = features,
.feature_table_size = ARRAY_SIZE(features), .feature_table_size = ARRAY_SIZE(features),
.driver.name = KBUILD_MODNAME, .driver.name = KBUILD_MODNAME,
@ -1011,12 +1011,12 @@ static struct virtio_driver virtio_net = {
static int __init init(void) static int __init init(void)
{ {
return register_virtio_driver(&virtio_net); return register_virtio_driver(&virtio_net_driver);
} }
static void __exit fini(void) static void __exit fini(void)
{ {
unregister_virtio_driver(&virtio_net); unregister_virtio_driver(&virtio_net_driver);
} }
module_init(init); module_init(init);
module_exit(fini); module_exit(fini);

Просмотреть файл

@ -6325,10 +6325,8 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
fail: fail:
if (dev) { if (dev) {
if (registered) { if (registered)
unregister_ieee80211(priv->ieee);
unregister_netdev(dev); unregister_netdev(dev);
}
ipw2100_hw_stop_adapter(priv); ipw2100_hw_stop_adapter(priv);
@ -6385,7 +6383,6 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
/* Unregister the device first - this results in close() /* Unregister the device first - this results in close()
* being called if the device is open. If we free storage * being called if the device is open. If we free storage
* first, then close() will crash. */ * first, then close() will crash. */
unregister_ieee80211(priv->ieee);
unregister_netdev(dev); unregister_netdev(dev);
/* ipw2100_down will ensure that there is no more pending work /* ipw2100_down will ensure that there is no more pending work

Просмотреть файл

@ -11822,7 +11822,6 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
if (err) { if (err) {
IPW_ERROR("Failed to register promiscuous network " IPW_ERROR("Failed to register promiscuous network "
"device (error %d).\n", err); "device (error %d).\n", err);
unregister_ieee80211(priv->ieee);
unregister_netdev(priv->net_dev); unregister_netdev(priv->net_dev);
goto out_remove_sysfs; goto out_remove_sysfs;
} }
@ -11873,7 +11872,6 @@ static void __devexit ipw_pci_remove(struct pci_dev *pdev)
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
unregister_ieee80211(priv->ieee);
unregister_netdev(priv->net_dev); unregister_netdev(priv->net_dev);
if (priv->rxq) { if (priv->rxq) {

Просмотреть файл

@ -1020,7 +1020,6 @@ static inline int libipw_is_cck_rate(u8 rate)
/* ieee80211.c */ /* ieee80211.c */
extern void free_ieee80211(struct net_device *dev, int monitor); extern void free_ieee80211(struct net_device *dev, int monitor);
extern struct net_device *alloc_ieee80211(int sizeof_priv, int monitor); extern struct net_device *alloc_ieee80211(int sizeof_priv, int monitor);
extern void unregister_ieee80211(struct libipw_device *ieee);
extern int libipw_change_mtu(struct net_device *dev, int new_mtu); extern int libipw_change_mtu(struct net_device *dev, int new_mtu);
extern void libipw_networks_age(struct libipw_device *ieee, extern void libipw_networks_age(struct libipw_device *ieee,

Просмотреть файл

@ -235,17 +235,14 @@ void free_ieee80211(struct net_device *dev, int monitor)
libipw_networks_free(ieee); libipw_networks_free(ieee);
/* free cfg80211 resources */ /* free cfg80211 resources */
if (!monitor) if (!monitor) {
wiphy_free(ieee->wdev.wiphy);
free_netdev(dev);
}
void unregister_ieee80211(struct libipw_device *ieee)
{
wiphy_unregister(ieee->wdev.wiphy); wiphy_unregister(ieee->wdev.wiphy);
kfree(ieee->a_band.channels); kfree(ieee->a_band.channels);
kfree(ieee->bg_band.channels); kfree(ieee->bg_band.channels);
wiphy_free(ieee->wdev.wiphy);
}
free_netdev(dev);
} }
#ifdef CONFIG_LIBIPW_DEBUG #ifdef CONFIG_LIBIPW_DEBUG
@ -333,4 +330,3 @@ module_init(libipw_init);
EXPORT_SYMBOL(alloc_ieee80211); EXPORT_SYMBOL(alloc_ieee80211);
EXPORT_SYMBOL(free_ieee80211); EXPORT_SYMBOL(free_ieee80211);
EXPORT_SYMBOL(unregister_ieee80211);

Просмотреть файл

@ -815,6 +815,8 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
mutex_init(&rt2x00dev->csr_mutex); mutex_init(&rt2x00dev->csr_mutex);
set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
/* /*
* Make room for rt2x00_intf inside the per-interface * Make room for rt2x00_intf inside the per-interface
* structure ieee80211_vif. * structure ieee80211_vif.
@ -871,8 +873,6 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
rt2x00leds_register(rt2x00dev); rt2x00leds_register(rt2x00dev);
rt2x00debug_register(rt2x00dev); rt2x00debug_register(rt2x00dev);
set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
return 0; return 0;
exit: exit:

Просмотреть файл

@ -362,6 +362,7 @@ void rt2x00link_start_tuner(struct rt2x00_dev *rt2x00dev)
rt2x00link_reset_tuner(rt2x00dev, false); rt2x00link_reset_tuner(rt2x00dev, false);
if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
ieee80211_queue_delayed_work(rt2x00dev->hw, ieee80211_queue_delayed_work(rt2x00dev->hw,
&link->work, LINK_TUNE_INTERVAL); &link->work, LINK_TUNE_INTERVAL);
} }
@ -469,6 +470,8 @@ static void rt2x00link_tuner(struct work_struct *work)
* Increase tuner counter, and reschedule the next link tuner run. * Increase tuner counter, and reschedule the next link tuner run.
*/ */
link->count++; link->count++;
if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
ieee80211_queue_delayed_work(rt2x00dev->hw, ieee80211_queue_delayed_work(rt2x00dev->hw,
&link->work, LINK_TUNE_INTERVAL); &link->work, LINK_TUNE_INTERVAL);
} }

Просмотреть файл

@ -47,6 +47,8 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev,
(requesttype == USB_VENDOR_REQUEST_IN) ? (requesttype == USB_VENDOR_REQUEST_IN) ?
usb_rcvctrlpipe(usb_dev, 0) : usb_sndctrlpipe(usb_dev, 0); usb_rcvctrlpipe(usb_dev, 0) : usb_sndctrlpipe(usb_dev, 0);
if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
return -ENODEV;
for (i = 0; i < REGISTER_BUSY_COUNT; i++) { for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
status = usb_control_msg(usb_dev, pipe, request, requesttype, status = usb_control_msg(usb_dev, pipe, request, requesttype,
@ -60,9 +62,11 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev,
* -ENODEV: Device has disappeared, no point continuing. * -ENODEV: Device has disappeared, no point continuing.
* All other errors: Try again. * All other errors: Try again.
*/ */
else if (status == -ENODEV) else if (status == -ENODEV) {
clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
break; break;
} }
}
ERROR(rt2x00dev, ERROR(rt2x00dev,
"Vendor Request 0x%02x failed for offset 0x%04x with error %d.\n", "Vendor Request 0x%02x failed for offset 0x%04x with error %d.\n",
@ -161,6 +165,9 @@ int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev,
{ {
unsigned int i; unsigned int i;
if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
return -ENODEV;
for (i = 0; i < REGISTER_BUSY_COUNT; i++) { for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
rt2x00usb_register_read_lock(rt2x00dev, offset, reg); rt2x00usb_register_read_lock(rt2x00dev, offset, reg);
if (!rt2x00_get_field32(*reg, field)) if (!rt2x00_get_field32(*reg, field))

Просмотреть файл

@ -210,10 +210,10 @@ void rtl8187_leds_exit(struct ieee80211_hw *dev)
/* turn the LED off before exiting */ /* turn the LED off before exiting */
ieee80211_queue_delayed_work(dev, &priv->led_off, 0); ieee80211_queue_delayed_work(dev, &priv->led_off, 0);
cancel_delayed_work_sync(&priv->led_off);
cancel_delayed_work_sync(&priv->led_on);
rtl8187_unregister_led(&priv->led_rx); rtl8187_unregister_led(&priv->led_rx);
rtl8187_unregister_led(&priv->led_tx); rtl8187_unregister_led(&priv->led_tx);
cancel_delayed_work_sync(&priv->led_off);
cancel_delayed_work_sync(&priv->led_on);
} }
#endif /* def CONFIG_RTL8187_LED */ #endif /* def CONFIG_RTL8187_LED */

Просмотреть файл

@ -150,8 +150,6 @@ struct eeepc_hotk {
/* The actual device the driver binds to */ /* The actual device the driver binds to */
static struct eeepc_hotk *ehotk; static struct eeepc_hotk *ehotk;
static void eeepc_rfkill_hotplug(bool real);
/* Platform device/driver */ /* Platform device/driver */
static int eeepc_hotk_thaw(struct device *device); static int eeepc_hotk_thaw(struct device *device);
static int eeepc_hotk_restore(struct device *device); static int eeepc_hotk_restore(struct device *device);
@ -345,16 +343,7 @@ static bool eeepc_wlan_rfkill_blocked(void)
static int eeepc_rfkill_set(void *data, bool blocked) static int eeepc_rfkill_set(void *data, bool blocked)
{ {
unsigned long asl = (unsigned long)data; unsigned long asl = (unsigned long)data;
int ret;
if (asl != CM_ASL_WLAN)
return set_acpi(asl, !blocked); return set_acpi(asl, !blocked);
/* hack to avoid panic with rt2860sta */
if (blocked)
eeepc_rfkill_hotplug(false);
ret = set_acpi(asl, !blocked);
return ret;
} }
static const struct rfkill_ops eeepc_rfkill_ops = { static const struct rfkill_ops eeepc_rfkill_ops = {
@ -367,6 +356,7 @@ static void __devinit eeepc_enable_camera(void)
* If the following call to set_acpi() fails, it's because there's no * If the following call to set_acpi() fails, it's because there's no
* camera so we can ignore the error. * camera so we can ignore the error.
*/ */
if (get_acpi(CM_ASL_CAMERA) == 0)
set_acpi(CM_ASL_CAMERA, 1); set_acpi(CM_ASL_CAMERA, 1);
} }
@ -654,13 +644,13 @@ static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
return 0; return 0;
} }
static void eeepc_rfkill_hotplug(bool real) static void eeepc_rfkill_hotplug(void)
{ {
struct pci_dev *dev; struct pci_dev *dev;
struct pci_bus *bus; struct pci_bus *bus;
bool blocked = real ? eeepc_wlan_rfkill_blocked() : true; bool blocked = eeepc_wlan_rfkill_blocked();
if (real && ehotk->wlan_rfkill) if (ehotk->wlan_rfkill)
rfkill_set_sw_state(ehotk->wlan_rfkill, blocked); rfkill_set_sw_state(ehotk->wlan_rfkill, blocked);
mutex_lock(&ehotk->hotplug_lock); mutex_lock(&ehotk->hotplug_lock);
@ -703,7 +693,7 @@ static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
if (event != ACPI_NOTIFY_BUS_CHECK) if (event != ACPI_NOTIFY_BUS_CHECK)
return; return;
eeepc_rfkill_hotplug(true); eeepc_rfkill_hotplug();
} }
static void eeepc_hotk_notify(struct acpi_device *device, u32 event) static void eeepc_hotk_notify(struct acpi_device *device, u32 event)
@ -861,7 +851,7 @@ static int eeepc_hotk_restore(struct device *device)
{ {
/* Refresh both wlan rfkill state and pci hotplug */ /* Refresh both wlan rfkill state and pci hotplug */
if (ehotk->wlan_rfkill) if (ehotk->wlan_rfkill)
eeepc_rfkill_hotplug(true); eeepc_rfkill_hotplug();
if (ehotk->bluetooth_rfkill) if (ehotk->bluetooth_rfkill)
rfkill_set_sw_state(ehotk->bluetooth_rfkill, rfkill_set_sw_state(ehotk->bluetooth_rfkill,
@ -1004,7 +994,7 @@ static void eeepc_rfkill_exit(void)
* Refresh pci hotplug in case the rfkill state was changed after * Refresh pci hotplug in case the rfkill state was changed after
* eeepc_unregister_rfkill_notifier() * eeepc_unregister_rfkill_notifier()
*/ */
eeepc_rfkill_hotplug(true); eeepc_rfkill_hotplug();
if (ehotk->hotplug_slot) if (ehotk->hotplug_slot)
pci_hp_deregister(ehotk->hotplug_slot); pci_hp_deregister(ehotk->hotplug_slot);
@ -1120,7 +1110,7 @@ static int eeepc_rfkill_init(struct device *dev)
* Refresh pci hotplug in case the rfkill state was changed during * Refresh pci hotplug in case the rfkill state was changed during
* setup. * setup.
*/ */
eeepc_rfkill_hotplug(true); eeepc_rfkill_hotplug();
exit: exit:
if (result && result != -ENODEV) if (result && result != -ENODEV)

Просмотреть файл

@ -1143,7 +1143,7 @@ static void serial_console_write(struct console *co, const char *s,
while ((sci_in(port, SCxSR) & bits) != bits) while ((sci_in(port, SCxSR) & bits) != bits)
cpu_relax(); cpu_relax();
if (sci_port->disable); if (sci_port->disable)
sci_port->disable(port); sci_port->disable(port);
} }

Просмотреть файл

@ -180,15 +180,15 @@ trip_point_type_show(struct device *dev, struct device_attribute *attr,
switch (type) { switch (type) {
case THERMAL_TRIP_CRITICAL: case THERMAL_TRIP_CRITICAL:
return sprintf(buf, "critical"); return sprintf(buf, "critical\n");
case THERMAL_TRIP_HOT: case THERMAL_TRIP_HOT:
return sprintf(buf, "hot"); return sprintf(buf, "hot\n");
case THERMAL_TRIP_PASSIVE: case THERMAL_TRIP_PASSIVE:
return sprintf(buf, "passive"); return sprintf(buf, "passive\n");
case THERMAL_TRIP_ACTIVE: case THERMAL_TRIP_ACTIVE:
return sprintf(buf, "active"); return sprintf(buf, "active\n");
default: default:
return sprintf(buf, "unknown"); return sprintf(buf, "unknown\n");
} }
} }

Просмотреть файл

@ -135,7 +135,7 @@ config TMPFS_POSIX_ACL
config HUGETLBFS config HUGETLBFS
bool "HugeTLB file system support" bool "HugeTLB file system support"
depends on X86 || IA64 || PPC_BOOK3S_64 || SPARC64 || (S390 && 64BIT) || \ depends on X86 || IA64 || SPARC64 || (S390 && 64BIT) || \
SYS_SUPPORTS_HUGETLBFS || BROKEN SYS_SUPPORTS_HUGETLBFS || BROKEN
help help
hugetlbfs is a filesystem backing for HugeTLB pages, based on hugetlbfs is a filesystem backing for HugeTLB pages, based on

Просмотреть файл

@ -388,4 +388,5 @@ extern int CIFSSMBSetPosixACL(const int xid, struct cifsTconInfo *tcon,
const struct nls_table *nls_codepage, int remap_special_chars); const struct nls_table *nls_codepage, int remap_special_chars);
extern int CIFSGetExtAttr(const int xid, struct cifsTconInfo *tcon, extern int CIFSGetExtAttr(const int xid, struct cifsTconInfo *tcon,
const int netfid, __u64 *pExtAttrBits, __u64 *pMask); const int netfid, __u64 *pExtAttrBits, __u64 *pMask);
extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb);
#endif /* _CIFSPROTO_H */ #endif /* _CIFSPROTO_H */

Просмотреть файл

@ -2220,16 +2220,8 @@ is_path_accessible(int xid, struct cifsTconInfo *tcon,
struct cifs_sb_info *cifs_sb, const char *full_path) struct cifs_sb_info *cifs_sb, const char *full_path)
{ {
int rc; int rc;
__u64 inode_num;
FILE_ALL_INFO *pfile_info; FILE_ALL_INFO *pfile_info;
rc = CIFSGetSrvInodeNumber(xid, tcon, full_path, &inode_num,
cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc != -EOPNOTSUPP)
return rc;
pfile_info = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); pfile_info = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
if (pfile_info == NULL) if (pfile_info == NULL)
return -ENOMEM; return -ENOMEM;

Просмотреть файл

@ -512,13 +512,10 @@ int cifs_get_inode_info(struct inode **pinode,
cifs_sb->local_nls, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR); CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc1) { if (rc1 || !fattr.cf_uniqueid) {
cFYI(1, ("GetSrvInodeNum rc %d", rc1)); cFYI(1, ("GetSrvInodeNum rc %d", rc1));
fattr.cf_uniqueid = iunique(sb, ROOT_I); fattr.cf_uniqueid = iunique(sb, ROOT_I);
/* disable serverino if call not supported */ cifs_autodisable_serverino(cifs_sb);
if (rc1 == -EINVAL)
cifs_sb->mnt_cifs_flags &=
~CIFS_MOUNT_SERVER_INUM;
} }
} else { } else {
fattr.cf_uniqueid = iunique(sb, ROOT_I); fattr.cf_uniqueid = iunique(sb, ROOT_I);

Просмотреть файл

@ -715,3 +715,17 @@ cifsConvertToUCS(__le16 *target, const char *source, int maxlen,
ctoUCS_out: ctoUCS_out:
return i; return i;
} }
void
cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb)
{
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
cifs_sb->mnt_cifs_flags &= CIFS_MOUNT_SERVER_INUM;
cERROR(1, ("Autodisabling the use of server inode numbers on "
"%s. This server doesn't seem to support them "
"properly. Hardlinks will not be recognized on this "
"mount. Consider mounting with the \"noserverino\" "
"option to silence this message.",
cifs_sb->tcon->treeName));
}
}

Просмотреть файл

@ -727,11 +727,12 @@ static int cifs_filldir(char *pfindEntry, struct file *file, filldir_t filldir,
cifs_dir_info_to_fattr(&fattr, (FILE_DIRECTORY_INFO *) cifs_dir_info_to_fattr(&fattr, (FILE_DIRECTORY_INFO *)
pfindEntry, cifs_sb); pfindEntry, cifs_sb);
/* FIXME: make _to_fattr functions fill this out */ if (inum && (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)) {
if (pCifsF->srch_inf.info_level == SMB_FIND_FILE_ID_FULL_DIR_INFO)
fattr.cf_uniqueid = inum; fattr.cf_uniqueid = inum;
else } else {
fattr.cf_uniqueid = iunique(sb, ROOT_I); fattr.cf_uniqueid = iunique(sb, ROOT_I);
cifs_autodisable_serverino(cifs_sb);
}
ino = cifs_uniqueid_to_ino_t(fattr.cf_uniqueid); ino = cifs_uniqueid_to_ino_t(fattr.cf_uniqueid);
tmp_dentry = cifs_readdir_lookup(file->f_dentry, &qstring, &fattr); tmp_dentry = cifs_readdir_lookup(file->f_dentry, &qstring, &fattr);

Просмотреть файл

@ -712,8 +712,10 @@ static int fuse_rename(struct inode *olddir, struct dentry *oldent,
fuse_invalidate_attr(newdir); fuse_invalidate_attr(newdir);
/* newent will end up negative */ /* newent will end up negative */
if (newent->d_inode) if (newent->d_inode) {
fuse_invalidate_attr(newent->d_inode);
fuse_invalidate_entry_cache(newent); fuse_invalidate_entry_cache(newent);
}
} else if (err == -EINTR) { } else if (err == -EINTR) {
/* If request was interrupted, DEITY only knows if the /* If request was interrupted, DEITY only knows if the
rename actually took place. If the invalidation rename actually took place. If the invalidation

Просмотреть файл

@ -1063,6 +1063,7 @@ ssize_t fuse_direct_io(struct file *file, const char __user *buf,
break; break;
} }
} }
if (!IS_ERR(req))
fuse_put_request(fc, req); fuse_put_request(fc, req);
if (res > 0) if (res > 0)
*ppos = pos; *ppos = pos;
@ -1599,7 +1600,7 @@ static int fuse_ioctl_copy_user(struct page **pages, struct iovec *iov,
kaddr += copy; kaddr += copy;
} }
kunmap(map); kunmap(page);
} }
return 0; return 0;

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше