Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1406
b: refs/heads/master
c: bef9c55
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed May 26, 2005
1 parent bdacbfd commit f15b1ea
Show file tree
Hide file tree
Showing 28 changed files with 3,592 additions and 1,005 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b463f785837f73bdd88ae3821bb7b69599010c9
refs/heads/master: bef9c558841604116704e10b3d9ff3dbf4939423
2 changes: 2 additions & 0 deletions trunk/arch/x86_64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,12 @@ void handle_BUG(struct pt_regs *regs)
printk(KERN_ALERT "Kernel BUG at %.50s:%d\n", f.filename, f.line);
}

#ifdef CONFIG_BUG
void out_of_line_bug(void)
{
BUG();
}
#endif

static DEFINE_SPINLOCK(die_lock);
static int die_owner = -1;
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/x86_64/kernel/x8664_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ EXPORT_SYMBOL(smp_num_siblings);
extern void do_softirq_thunk(void);
EXPORT_SYMBOL(do_softirq_thunk);

void out_of_line_bug(void);
#ifdef CONFIG_BUG
EXPORT_SYMBOL(out_of_line_bug);
#endif

EXPORT_SYMBOL(init_level4_pgt);

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/char/ipmi/ipmi_devintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ MODULE_PARM_DESC(ipmi_major, "Sets the major number of the IPMI device. By"
" interface. Other values will set the major device number"
" to that value.");

static struct class *ipmi_class;
static struct class_simple *ipmi_class;

static void ipmi_new_smi(int if_num)
{
Expand All @@ -534,7 +534,7 @@ static void ipmi_new_smi(int if_num)

static void ipmi_smi_gone(int if_num)
{
class_simple_device_remove(ipmi_class, MKDEV(ipmi_major, if_num));
class_simple_device_remove(MKDEV(ipmi_major, if_num));
devfs_remove("ipmidev/%d", if_num);
}

Expand Down
35 changes: 18 additions & 17 deletions trunk/drivers/infiniband/core/sa_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ int ib_sa_path_rec_get(struct ib_device *device, u8 port_num,

init_mad(query->sa_query.mad, agent);

query->sa_query.callback = ib_sa_path_rec_callback;
query->sa_query.callback = callback ? ib_sa_path_rec_callback : NULL;
query->sa_query.release = ib_sa_path_rec_release;
query->sa_query.port = port;
query->sa_query.mad->mad_hdr.method = IB_MGMT_METHOD_GET;
Expand Down Expand Up @@ -663,7 +663,7 @@ int ib_sa_mcmember_rec_query(struct ib_device *device, u8 port_num,

init_mad(query->sa_query.mad, agent);

query->sa_query.callback = ib_sa_mcmember_rec_callback;
query->sa_query.callback = callback ? ib_sa_mcmember_rec_callback : NULL;
query->sa_query.release = ib_sa_mcmember_rec_release;
query->sa_query.port = port;
query->sa_query.mad->mad_hdr.method = method;
Expand Down Expand Up @@ -698,20 +698,21 @@ static void send_handler(struct ib_mad_agent *agent,
if (!query)
return;

switch (mad_send_wc->status) {
case IB_WC_SUCCESS:
/* No callback -- already got recv */
break;
case IB_WC_RESP_TIMEOUT_ERR:
query->callback(query, -ETIMEDOUT, NULL);
break;
case IB_WC_WR_FLUSH_ERR:
query->callback(query, -EINTR, NULL);
break;
default:
query->callback(query, -EIO, NULL);
break;
}
if (query->callback)
switch (mad_send_wc->status) {
case IB_WC_SUCCESS:
/* No callback -- already got recv */
break;
case IB_WC_RESP_TIMEOUT_ERR:
query->callback(query, -ETIMEDOUT, NULL);
break;
case IB_WC_WR_FLUSH_ERR:
query->callback(query, -EINTR, NULL);
break;
default:
query->callback(query, -EIO, NULL);
break;
}

dma_unmap_single(agent->device->dma_device,
pci_unmap_addr(query, mapping),
Expand All @@ -736,7 +737,7 @@ static void recv_handler(struct ib_mad_agent *mad_agent,
query = idr_find(&query_idr, mad_recv_wc->wc->wr_id);
spin_unlock_irqrestore(&idr_lock, flags);

if (query) {
if (query && query->callback) {
if (mad_recv_wc->wc->status == IB_WC_SUCCESS)
query->callback(query,
mad_recv_wc->recv_buf.mad->mad_hdr.status ?
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/infiniband/core/user_mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ static int ib_umad_open(struct inode *inode, struct file *filp)
static int ib_umad_close(struct inode *inode, struct file *filp)
{
struct ib_umad_file *file = filp->private_data;
struct ib_umad_packet *packet, *tmp;
int i;

for (i = 0; i < IB_UMAD_MAX_AGENTS; ++i)
Expand All @@ -507,6 +508,9 @@ static int ib_umad_close(struct inode *inode, struct file *filp)
ib_unregister_mad_agent(file->agent[i]);
}

list_for_each_entry_safe(packet, tmp, &file->recv_list, list)
kfree(packet);

kfree(file);

return 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/infiniband/include/ib_sa.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ struct ib_sa_path_rec {
/* reserved */
u8 sl;
u8 mtu_selector;
enum ib_mtu mtu;
u8 mtu;
u8 rate_selector;
u8 rate;
u8 packet_life_time_selector;
Expand Down Expand Up @@ -180,7 +180,7 @@ struct ib_sa_mcmember_rec {
u32 qkey;
u16 mlid;
u8 mtu_selector;
enum ib_mtu mtu;
u8 mtu;
u8 traffic_class;
u16 pkey;
u8 rate_selector;
Expand Down
125 changes: 83 additions & 42 deletions trunk/drivers/macintosh/therm_adt746x.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@
#define MANUAL_MASK 0xe0
#define AUTO_MASK 0x20

static u8 TEMP_REG[3] = {0x26, 0x25, 0x27}; /* local, cpu, gpu */
static u8 LIMIT_REG[3] = {0x6b, 0x6a, 0x6c}; /* local, cpu, gpu */
static u8 TEMP_REG[3] = {0x26, 0x25, 0x27}; /* local, sensor1, sensor2 */
static u8 LIMIT_REG[3] = {0x6b, 0x6a, 0x6c}; /* local, sensor1, sensor2 */
static u8 MANUAL_MODE[2] = {0x5c, 0x5d};
static u8 REM_CONTROL[2] = {0x00, 0x40};
static u8 FAN_SPEED[2] = {0x28, 0x2a};
static u8 FAN_SPD_SET[2] = {0x30, 0x31};

static u8 default_limits_local[3] = {70, 50, 70}; /* local, cpu, gpu */
static u8 default_limits_chip[3] = {80, 65, 80}; /* local, cpu, gpu */
static u8 default_limits_local[3] = {70, 50, 70}; /* local, sensor1, sensor2 */
static u8 default_limits_chip[3] = {80, 65, 80}; /* local, sensor1, sensor2 */
static char *sensor_location[3] = {NULL, NULL, NULL};

static int limit_adjust = 0;
static int fan_speed = -1;
Expand All @@ -58,7 +59,7 @@ MODULE_DESCRIPTION("Driver for ADT746x thermostat in iBook G4 and "
MODULE_LICENSE("GPL");

module_param(limit_adjust, int, 0644);
MODULE_PARM_DESC(limit_adjust,"Adjust maximum temperatures (50 cpu, 70 gpu) "
MODULE_PARM_DESC(limit_adjust,"Adjust maximum temperatures (50 sensor1, 70 sensor2) "
"by N degrees.");

module_param(fan_speed, int, 0644);
Expand Down Expand Up @@ -213,10 +214,10 @@ static void write_fan_speed(struct thermostat *th, int speed, int fan)
if (th->last_speed[fan] != speed) {
if (speed == -1)
printk(KERN_DEBUG "adt746x: Setting speed to automatic "
"for %s fan.\n", fan?"GPU":"CPU");
"for %s fan.\n", sensor_location[fan+1]);
else
printk(KERN_DEBUG "adt746x: Setting speed to %d "
"for %s fan.\n", speed, fan?"GPU":"CPU");
"for %s fan.\n", speed, sensor_location[fan+1]);
} else
return;

Expand Down Expand Up @@ -300,11 +301,11 @@ static void update_fans_speed (struct thermostat *th)
printk(KERN_DEBUG "adt746x: setting fans speed to %d "
"(limit exceeded by %d on %s) \n",
new_speed, var,
fan_number?"GPU/pwr":"CPU");
sensor_location[fan_number+1]);
write_both_fan_speed(th, new_speed);
th->last_var[fan_number] = var;
} else if (var < -2) {
/* don't stop fan if GPU/power is cold and CPU is not
/* don't stop fan if sensor2 is cold and sensor1 is not
* so cold (lastvar >= -1) */
if (i == 2 && lastvar < -1) {
if (th->last_speed[fan_number] != 0)
Expand All @@ -318,7 +319,7 @@ static void update_fans_speed (struct thermostat *th)

if (started)
return; /* we don't want to re-stop the fan
* if CPU is heating and GPU/power is not */
* if sensor1 is heating and sensor2 is not */
}
}

Expand Down Expand Up @@ -353,7 +354,7 @@ static int monitor_task(void *arg)

static void set_limit(struct thermostat *th, int i)
{
/* Set CPU limit higher to avoid powerdowns */
/* Set sensor1 limit higher to avoid powerdowns */
th->limits[i] = default_limits_chip[i] + limit_adjust;
write_reg(th, LIMIT_REG[i], th->limits[i]);

Expand Down Expand Up @@ -461,6 +462,12 @@ static ssize_t show_##name(struct device *dev, char *buf) \
return sprintf(buf, "%d\n", data); \
}

#define BUILD_SHOW_FUNC_STR(name, data) \
static ssize_t show_##name(struct device *dev, char *buf) \
{ \
return sprintf(buf, "%s\n", data); \
}

#define BUILD_SHOW_FUNC_FAN(name, data) \
static ssize_t show_##name(struct device *dev, char *buf) \
{ \
Expand All @@ -476,7 +483,7 @@ static ssize_t store_##name(struct device *dev, const char *buf, size_t n) \
int val; \
int i; \
val = simple_strtol(buf, NULL, 10); \
printk(KERN_INFO "Adjusting limits by %d°C\n", val); \
printk(KERN_INFO "Adjusting limits by %d degrees\n", val); \
limit_adjust = val; \
for (i=0; i < 3; i++) \
set_limit(thermostat, i); \
Expand All @@ -495,35 +502,41 @@ static ssize_t store_##name(struct device *dev, const char *buf, size_t n) \
return n; \
}

BUILD_SHOW_FUNC_INT(cpu_temperature, (read_reg(thermostat, TEMP_REG[1])))
BUILD_SHOW_FUNC_INT(gpu_temperature, (read_reg(thermostat, TEMP_REG[2])))
BUILD_SHOW_FUNC_INT(cpu_limit, thermostat->limits[1])
BUILD_SHOW_FUNC_INT(gpu_limit, thermostat->limits[2])
BUILD_SHOW_FUNC_INT(sensor1_temperature, (read_reg(thermostat, TEMP_REG[1])))
BUILD_SHOW_FUNC_INT(sensor2_temperature, (read_reg(thermostat, TEMP_REG[2])))
BUILD_SHOW_FUNC_INT(sensor1_limit, thermostat->limits[1])
BUILD_SHOW_FUNC_INT(sensor2_limit, thermostat->limits[2])
BUILD_SHOW_FUNC_STR(sensor1_location, sensor_location[1])
BUILD_SHOW_FUNC_STR(sensor2_location, sensor_location[2])

BUILD_SHOW_FUNC_INT(specified_fan_speed, fan_speed)
BUILD_SHOW_FUNC_FAN(cpu_fan_speed, 0)
BUILD_SHOW_FUNC_FAN(gpu_fan_speed, 1)
BUILD_SHOW_FUNC_FAN(sensor1_fan_speed, 0)
BUILD_SHOW_FUNC_FAN(sensor2_fan_speed, 1)

BUILD_STORE_FUNC_INT(specified_fan_speed,fan_speed)
BUILD_SHOW_FUNC_INT(limit_adjust, limit_adjust)
BUILD_STORE_FUNC_DEG(limit_adjust, thermostat)

static DEVICE_ATTR(cpu_temperature, S_IRUGO,
show_cpu_temperature,NULL);
static DEVICE_ATTR(gpu_temperature, S_IRUGO,
show_gpu_temperature,NULL);
static DEVICE_ATTR(cpu_limit, S_IRUGO,
show_cpu_limit, NULL);
static DEVICE_ATTR(gpu_limit, S_IRUGO,
show_gpu_limit, NULL);
static DEVICE_ATTR(sensor1_temperature, S_IRUGO,
show_sensor1_temperature,NULL);
static DEVICE_ATTR(sensor2_temperature, S_IRUGO,
show_sensor2_temperature,NULL);
static DEVICE_ATTR(sensor1_limit, S_IRUGO,
show_sensor1_limit, NULL);
static DEVICE_ATTR(sensor2_limit, S_IRUGO,
show_sensor2_limit, NULL);
static DEVICE_ATTR(sensor1_location, S_IRUGO,
show_sensor1_location, NULL);
static DEVICE_ATTR(sensor2_location, S_IRUGO,
show_sensor2_location, NULL);

static DEVICE_ATTR(specified_fan_speed, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH,
show_specified_fan_speed,store_specified_fan_speed);

static DEVICE_ATTR(cpu_fan_speed, S_IRUGO,
show_cpu_fan_speed, NULL);
static DEVICE_ATTR(gpu_fan_speed, S_IRUGO,
show_gpu_fan_speed, NULL);
static DEVICE_ATTR(sensor1_fan_speed, S_IRUGO,
show_sensor1_fan_speed, NULL);
static DEVICE_ATTR(sensor2_fan_speed, S_IRUGO,
show_sensor2_fan_speed, NULL);

static DEVICE_ATTR(limit_adjust, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH,
show_limit_adjust, store_limit_adjust);
Expand All @@ -534,6 +547,7 @@ thermostat_init(void)
{
struct device_node* np;
u32 *prop;
int i = 0, offset = 0;

np = of_find_node_by_name(NULL, "fan");
if (!np)
Expand All @@ -545,6 +559,12 @@ thermostat_init(void)
else
return -ENODEV;

prop = (u32 *)get_property(np, "hwsensor-params-version", NULL);
printk(KERN_INFO "adt746x: version %d (%ssupported)\n", *prop,
(*prop == 1)?"":"un");
if (*prop != 1)
return -ENODEV;

prop = (u32 *)get_property(np, "reg", NULL);
if (!prop)
return -ENODEV;
Expand All @@ -563,22 +583,41 @@ thermostat_init(void)
"limit_adjust: %d, fan_speed: %d\n",
therm_bus, therm_address, limit_adjust, fan_speed);

if (get_property(np, "hwsensor-location", NULL)) {
for (i = 0; i < 3; i++) {
sensor_location[i] = get_property(np,
"hwsensor-location", NULL) + offset;

if (sensor_location[i] == NULL)
sensor_location[i] = "";

printk(KERN_INFO "sensor %d: %s\n", i, sensor_location[i]);
offset += strlen(sensor_location[i]) + 1;
}
} else {
sensor_location[0] = "?";
sensor_location[1] = "?";
sensor_location[2] = "?";
}

of_dev = of_platform_device_create(np, "temperatures");

if (of_dev == NULL) {
printk(KERN_ERR "Can't register temperatures device !\n");
return -ENODEV;
}

device_create_file(&of_dev->dev, &dev_attr_cpu_temperature);
device_create_file(&of_dev->dev, &dev_attr_gpu_temperature);
device_create_file(&of_dev->dev, &dev_attr_cpu_limit);
device_create_file(&of_dev->dev, &dev_attr_gpu_limit);
device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);
device_create_file(&of_dev->dev, &dev_attr_sensor2_limit);
device_create_file(&of_dev->dev, &dev_attr_sensor1_location);
device_create_file(&of_dev->dev, &dev_attr_sensor2_location);
device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
device_create_file(&of_dev->dev, &dev_attr_cpu_fan_speed);
device_create_file(&of_dev->dev, &dev_attr_sensor1_fan_speed);
if(therm_type == ADT7460)
device_create_file(&of_dev->dev, &dev_attr_gpu_fan_speed);
device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed);

#ifndef CONFIG_I2C_KEYWEST
request_module("i2c-keywest");
Expand All @@ -591,17 +630,19 @@ static void __exit
thermostat_exit(void)
{
if (of_dev) {
device_remove_file(&of_dev->dev, &dev_attr_cpu_temperature);
device_remove_file(&of_dev->dev, &dev_attr_gpu_temperature);
device_remove_file(&of_dev->dev, &dev_attr_cpu_limit);
device_remove_file(&of_dev->dev, &dev_attr_gpu_limit);
device_remove_file(&of_dev->dev, &dev_attr_sensor1_temperature);
device_remove_file(&of_dev->dev, &dev_attr_sensor2_temperature);
device_remove_file(&of_dev->dev, &dev_attr_sensor1_limit);
device_remove_file(&of_dev->dev, &dev_attr_sensor2_limit);
device_remove_file(&of_dev->dev, &dev_attr_sensor1_location);
device_remove_file(&of_dev->dev, &dev_attr_sensor2_location);
device_remove_file(&of_dev->dev, &dev_attr_limit_adjust);
device_remove_file(&of_dev->dev, &dev_attr_specified_fan_speed);
device_remove_file(&of_dev->dev, &dev_attr_cpu_fan_speed);
device_remove_file(&of_dev->dev, &dev_attr_sensor1_fan_speed);

if(therm_type == ADT7460)
device_remove_file(&of_dev->dev,
&dev_attr_gpu_fan_speed);
&dev_attr_sensor2_fan_speed);

of_device_unregister(of_dev);
}
Expand Down
Loading

0 comments on commit f15b1ea

Please sign in to comment.