Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20110
b: refs/heads/master
c: 423ab71
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Feb 8, 2006
1 parent c48f0a1 commit 78f6481
Show file tree
Hide file tree
Showing 21 changed files with 1,529 additions and 256 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: 63f716b9419420defb3e550a1e5f526c11b2ed2d
refs/heads/master: 423ab71a8bd2345f87724abe320092a3a516b0bb
25 changes: 4 additions & 21 deletions trunk/arch/alpha/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ cpumask_t cpu_online_map;

EXPORT_SYMBOL(cpu_online_map);

/* cpus reported in the hwrpb */
static unsigned long hwrpb_cpu_present_mask __initdata = 0;

int smp_num_probed; /* Internal processor count */
int smp_num_cpus = 1; /* Number that came online. */

Expand Down Expand Up @@ -442,7 +439,7 @@ setup_smp(void)
if ((cpu->flags & 0x1cc) == 0x1cc) {
smp_num_probed++;
/* Assume here that "whami" == index */
hwrpb_cpu_present_mask |= (1UL << i);
cpu_set(i, cpu_possible_map);
cpu->pal_revision = boot_cpu_palrev;
}

Expand All @@ -453,12 +450,12 @@ setup_smp(void)
}
} else {
smp_num_probed = 1;
hwrpb_cpu_present_mask = (1UL << boot_cpuid);
cpu_set(boot_cpuid, cpu_possible_map);
}
cpu_present_mask = cpumask_of_cpu(boot_cpuid);

printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n",
smp_num_probed, hwrpb_cpu_present_mask);
smp_num_probed, cpu_possible_map.bits[0]);
}

/*
Expand All @@ -467,8 +464,6 @@ setup_smp(void)
void __init
smp_prepare_cpus(unsigned int max_cpus)
{
int cpu_count, i;

/* Take care of some initial bookkeeping. */
memset(ipi_data, 0, sizeof(ipi_data));

Expand All @@ -486,19 +481,7 @@ smp_prepare_cpus(unsigned int max_cpus)

printk(KERN_INFO "SMP starting up secondaries.\n");

cpu_count = 1;
for (i = 0; (i < NR_CPUS) && (cpu_count < max_cpus); i++) {
if (i == boot_cpuid)
continue;

if (((hwrpb_cpu_present_mask >> i) & 1) == 0)
continue;

cpu_set(i, cpu_possible_map);
cpu_count++;
}

smp_num_cpus = cpu_count;
smp_num_cpus = smp_num_probed;
}

void __devinit
Expand Down
70 changes: 38 additions & 32 deletions trunk/block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ void elv_requeue_request(request_queue_t *q, struct request *rq)

rq->flags &= ~REQ_STARTED;

__elv_add_request(q, rq, ELEVATOR_INSERT_REQUEUE, 0);
elv_insert(q, rq, ELEVATOR_INSERT_REQUEUE);
}

static void elv_drain_elevator(request_queue_t *q)
Expand All @@ -310,41 +310,11 @@ static void elv_drain_elevator(request_queue_t *q)
}
}

void __elv_add_request(request_queue_t *q, struct request *rq, int where,
int plug)
void elv_insert(request_queue_t *q, struct request *rq, int where)
{
struct list_head *pos;
unsigned ordseq;

if (q->ordcolor)
rq->flags |= REQ_ORDERED_COLOR;

if (rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER)) {
/*
* toggle ordered color
*/
if (blk_barrier_rq(rq))
q->ordcolor ^= 1;

/*
* barriers implicitly indicate back insertion
*/
if (where == ELEVATOR_INSERT_SORT)
where = ELEVATOR_INSERT_BACK;

/*
* this request is scheduling boundary, update end_sector
*/
if (blk_fs_request(rq)) {
q->end_sector = rq_end_sector(rq);
q->boundary_rq = rq;
}
} else if (!(rq->flags & REQ_ELVPRIV) && where == ELEVATOR_INSERT_SORT)
where = ELEVATOR_INSERT_BACK;

if (plug)
blk_plug_device(q);

rq->q = q;

switch (where) {
Expand Down Expand Up @@ -425,6 +395,42 @@ void __elv_add_request(request_queue_t *q, struct request *rq, int where,
}
}

void __elv_add_request(request_queue_t *q, struct request *rq, int where,
int plug)
{
if (q->ordcolor)
rq->flags |= REQ_ORDERED_COLOR;

if (rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER)) {
/*
* toggle ordered color
*/
if (blk_barrier_rq(rq))
q->ordcolor ^= 1;

/*
* barriers implicitly indicate back insertion
*/
if (where == ELEVATOR_INSERT_SORT)
where = ELEVATOR_INSERT_BACK;

/*
* this request is scheduling boundary, update
* end_sector
*/
if (blk_fs_request(rq)) {
q->end_sector = rq_end_sector(rq);
q->boundary_rq = rq;
}
} else if (!(rq->flags & REQ_ELVPRIV) && where == ELEVATOR_INSERT_SORT)
where = ELEVATOR_INSERT_BACK;

if (plug)
blk_plug_device(q);

elv_insert(q, rq, where);
}

void elv_add_request(request_queue_t *q, struct request *rq, int where,
int plug)
{
Expand Down
4 changes: 2 additions & 2 deletions trunk/block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ static void queue_flush(request_queue_t *q, unsigned which)
rq->end_io = end_io;
q->prepare_flush_fn(q, rq);

__elv_add_request(q, rq, ELEVATOR_INSERT_FRONT, 0);
elv_insert(q, rq, ELEVATOR_INSERT_FRONT);
}

static inline struct request *start_ordered(request_queue_t *q,
Expand Down Expand Up @@ -490,7 +490,7 @@ static inline struct request *start_ordered(request_queue_t *q,
else
q->ordseq |= QUEUE_ORDSEQ_POSTFLUSH;

__elv_add_request(q, rq, ELEVATOR_INSERT_FRONT, 0);
elv_insert(q, rq, ELEVATOR_INSERT_FRONT);

if (q->ordered & QUEUE_ORDERED_PREFLUSH) {
queue_flush(q, QUEUE_ORDERED_PREFLUSH);
Expand Down
3 changes: 3 additions & 0 deletions trunk/block/scsi_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ static int sg_io(struct file *file, request_queue_t *q,
if (!rq->timeout)
rq->timeout = BLK_DEFAULT_TIMEOUT;

rq->retries = 0;

start_time = jiffies;

/* ignore return value. All information is passed back to caller
Expand Down Expand Up @@ -427,6 +429,7 @@ static int sg_scsi_ioctl(struct file *file, request_queue_t *q,
rq->data = buffer;
rq->data_len = bytes;
rq->flags |= REQ_BLOCK_PC;
rq->retries = 0;

blk_execute_rq(q, bd_disk, rq, 0);
err = rq->errors & 0xff; /* only 8 bit SCSI status */
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/macintosh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@ config WINDFARM_PM91
This driver provides thermal control for the PowerMac9,1
which is the recent (SMU based) single CPU desktop G5

config WINDFARM_PM112
tristate "Support for thermal management on PowerMac11,2"
depends on WINDFARM && I2C && PMAC_SMU
select I2C_POWERMAC
help
This driver provides thermal control for the PowerMac11,2
which are the recent dual and quad G5 machines using the
970MP dual-core processor.

config ANSLCD
tristate "Support for ANS LCD display"
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/macintosh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ obj-$(CONFIG_WINDFARM_PM91) += windfarm_smu_controls.o \
windfarm_smu_sensors.o \
windfarm_lm75_sensor.o windfarm_pid.o \
windfarm_cpufreq_clamp.o windfarm_pm91.o
obj-$(CONFIG_WINDFARM_PM112) += windfarm_pm112.o windfarm_smu_sat.o \
windfarm_smu_controls.o \
windfarm_smu_sensors.o \
windfarm_max6690_sensor.o \
windfarm_lm75_sensor.o windfarm_pid.o
3 changes: 3 additions & 0 deletions trunk/drivers/macintosh/windfarm.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/list.h>
#include <linux/module.h>
#include <linux/notifier.h>
#include <linux/device.h>

/* Display a 16.16 fixed point value */
#define FIX32TOPRINT(f) ((f) >> 16),((((f) & 0xffff) * 1000) >> 16)
Expand All @@ -39,6 +40,7 @@ struct wf_control {
char *name;
int type;
struct kref ref;
struct device_attribute attr;
};

#define WF_CONTROL_TYPE_GENERIC 0
Expand Down Expand Up @@ -87,6 +89,7 @@ struct wf_sensor {
struct wf_sensor_ops *ops;
char *name;
struct kref ref;
struct device_attribute attr;
};

/* Same lifetime rules as controls */
Expand Down
69 changes: 65 additions & 4 deletions trunk/drivers/macintosh/windfarm_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ static unsigned int wf_overtemp;
static unsigned int wf_overtemp_counter;
struct task_struct *wf_thread;

static struct platform_device wf_platform_device = {
.name = "windfarm",
};

/*
* Utilities & tick thread
*/
Expand Down Expand Up @@ -157,6 +161,40 @@ static void wf_control_release(struct kref *kref)
kfree(ct);
}

static ssize_t wf_show_control(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct wf_control *ctrl = container_of(attr, struct wf_control, attr);
s32 val = 0;
int err;

err = ctrl->ops->get_value(ctrl, &val);
if (err < 0)
return err;
return sprintf(buf, "%d\n", val);
}

/* This is really only for debugging... */
static ssize_t wf_store_control(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct wf_control *ctrl = container_of(attr, struct wf_control, attr);
int val;
int err;
char *endp;

val = simple_strtoul(buf, &endp, 0);
while (endp < buf + count && (*endp == ' ' || *endp == '\n'))
++endp;
if (endp - buf < count)
return -EINVAL;
err = ctrl->ops->set_value(ctrl, val);
if (err < 0)
return err;
return count;
}

int wf_register_control(struct wf_control *new_ct)
{
struct wf_control *ct;
Expand All @@ -173,6 +211,13 @@ int wf_register_control(struct wf_control *new_ct)
kref_init(&new_ct->ref);
list_add(&new_ct->link, &wf_controls);

new_ct->attr.attr.name = new_ct->name;
new_ct->attr.attr.owner = THIS_MODULE;
new_ct->attr.attr.mode = 0644;
new_ct->attr.show = wf_show_control;
new_ct->attr.store = wf_store_control;
device_create_file(&wf_platform_device.dev, &new_ct->attr);

DBG("wf: Registered control %s\n", new_ct->name);

wf_notify(WF_EVENT_NEW_CONTROL, new_ct);
Expand Down Expand Up @@ -247,6 +292,19 @@ static void wf_sensor_release(struct kref *kref)
kfree(sr);
}

static ssize_t wf_show_sensor(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct wf_sensor *sens = container_of(attr, struct wf_sensor, attr);
s32 val = 0;
int err;

err = sens->ops->get_value(sens, &val);
if (err < 0)
return err;
return sprintf(buf, "%d.%03d\n", FIX32TOPRINT(val));
}

int wf_register_sensor(struct wf_sensor *new_sr)
{
struct wf_sensor *sr;
Expand All @@ -263,6 +321,13 @@ int wf_register_sensor(struct wf_sensor *new_sr)
kref_init(&new_sr->ref);
list_add(&new_sr->link, &wf_sensors);

new_sr->attr.attr.name = new_sr->name;
new_sr->attr.attr.owner = THIS_MODULE;
new_sr->attr.attr.mode = 0444;
new_sr->attr.show = wf_show_sensor;
new_sr->attr.store = NULL;
device_create_file(&wf_platform_device.dev, &new_sr->attr);

DBG("wf: Registered sensor %s\n", new_sr->name);

wf_notify(WF_EVENT_NEW_SENSOR, new_sr);
Expand Down Expand Up @@ -396,10 +461,6 @@ int wf_is_overtemp(void)
}
EXPORT_SYMBOL_GPL(wf_is_overtemp);

static struct platform_device wf_platform_device = {
.name = "windfarm",
};

static int __init windfarm_core_init(void)
{
DBG("wf: core loaded\n");
Expand Down
Loading

0 comments on commit 78f6481

Please sign in to comment.