Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211459
b: refs/heads/master
c: 0acc1b2
h: refs/heads/master
i:
  211457: 74b2af7
  211455: 08ff593
v: v3
  • Loading branch information
Linus Torvalds committed Oct 12, 2010
1 parent b017555 commit d24498e
Show file tree
Hide file tree
Showing 12 changed files with 113 additions and 46 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: 47008cd887c1836bcadda123ba73e1863de7a6c4
refs/heads/master: 0acc1b2afb6ded060b7d6b1b5e6ac8a00ec47547
10 changes: 9 additions & 1 deletion trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5030,6 +5030,12 @@ F: drivers/media/common/saa7146*
F: drivers/media/video/*7146*
F: include/media/*7146*

SAMSUNG AUDIO (ASoC) DRIVERS
M: Jassi Brar <jassi.brar@samsung.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Supported
F: sound/soc/s3c24xx

TLG2300 VIDEO4LINUX-2 DRIVER
M: Huang Shijie <shijie8@gmail.com>
M: Kang Yong <kangyong@telegent.com>
Expand Down Expand Up @@ -6472,8 +6478,10 @@ F: include/linux/wm97xx.h
WOLFSON MICROELECTRONICS DRIVERS
M: Mark Brown <broonie@opensource.wolfsonmicro.com>
M: Ian Lartey <ian@opensource.wolfsonmicro.com>
M: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
T: git git://opensource.wolfsonmicro.com/linux-2.6-asoc
T: git git://opensource.wolfsonmicro.com/linux-2.6-audioplus
W: http://opensource.wolfsonmicro.com/node/8
W: http://opensource.wolfsonmicro.com/content/linux-drivers-wolfson-devices
S: Supported
F: Documentation/hwmon/wm83??
F: drivers/leds/leds-wm83*.c
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/input/tablet/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,10 @@ static void wacom_intuos_general(struct wacom_wac *wacom)
/* general pen packet */
if ((data[1] & 0xb8) == 0xa0) {
t = (data[6] << 2) | ((data[7] >> 6) & 3);
if (features->type >= INTUOS4S && features->type <= INTUOS4L)
if ((features->type >= INTUOS4S && features->type <= INTUOS4L) ||
features->type == WACOM_21UX2) {
t = (t << 1) | (data[1] & 1);
}
input_report_abs(input, ABS_PRESSURE, t);
input_report_abs(input, ABS_TILT_X,
((data[7] << 1) & 0x7e) | (data[8] >> 7));
Expand Down
122 changes: 90 additions & 32 deletions trunk/drivers/platform/x86/intel_ips.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
* TODO:
* - handle CPU hotplug
* - provide turbo enable/disable api
* - make sure we can write turbo enable/disable reg based on MISC_EN
*
* Related documents:
* - CDI 403777, 403778 - Auburndale EDS vol 1 & 2
Expand Down Expand Up @@ -230,7 +229,7 @@
#define THM_TC2 0xac
#define THM_DTV 0xb0
#define THM_ITV 0xd8
#define ITV_ME_SEQNO_MASK 0x000f0000 /* ME should update every ~200ms */
#define ITV_ME_SEQNO_MASK 0x00ff0000 /* ME should update every ~200ms */
#define ITV_ME_SEQNO_SHIFT (16)
#define ITV_MCH_TEMP_MASK 0x0000ff00
#define ITV_MCH_TEMP_SHIFT (8)
Expand Down Expand Up @@ -325,6 +324,7 @@ struct ips_driver {
bool gpu_preferred;
bool poll_turbo_status;
bool second_cpu;
bool turbo_toggle_allowed;
struct ips_mcp_limits *limits;

/* Optional MCH interfaces for if i915 is in use */
Expand Down Expand Up @@ -415,7 +415,7 @@ static void ips_cpu_lower(struct ips_driver *ips)
new_limit = cur_limit - 8; /* 1W decrease */

/* Clamp to SKU TDP limit */
if (((new_limit * 10) / 8) < (ips->orig_turbo_limit & TURBO_TDP_MASK))
if (new_limit < (ips->orig_turbo_limit & TURBO_TDP_MASK))
new_limit = ips->orig_turbo_limit & TURBO_TDP_MASK;

thm_writew(THM_MPCPC, (new_limit * 10) / 8);
Expand Down Expand Up @@ -461,7 +461,8 @@ static void ips_enable_cpu_turbo(struct ips_driver *ips)
if (ips->__cpu_turbo_on)
return;

on_each_cpu(do_enable_cpu_turbo, ips, 1);
if (ips->turbo_toggle_allowed)
on_each_cpu(do_enable_cpu_turbo, ips, 1);

ips->__cpu_turbo_on = true;
}
Expand Down Expand Up @@ -498,7 +499,8 @@ static void ips_disable_cpu_turbo(struct ips_driver *ips)
if (!ips->__cpu_turbo_on)
return;

on_each_cpu(do_disable_cpu_turbo, ips, 1);
if (ips->turbo_toggle_allowed)
on_each_cpu(do_disable_cpu_turbo, ips, 1);

ips->__cpu_turbo_on = false;
}
Expand Down Expand Up @@ -598,17 +600,29 @@ static bool mcp_exceeded(struct ips_driver *ips)
{
unsigned long flags;
bool ret = false;
u32 temp_limit;
u32 avg_power;
const char *msg = "MCP limit exceeded: ";

spin_lock_irqsave(&ips->turbo_status_lock, flags);
if (ips->mcp_avg_temp > (ips->mcp_temp_limit * 100))
ret = true;
if (ips->cpu_avg_power + ips->mch_avg_power > ips->mcp_power_limit)

temp_limit = ips->mcp_temp_limit * 100;
if (ips->mcp_avg_temp > temp_limit) {
dev_info(&ips->dev->dev,
"%sAvg temp %u, limit %u\n", msg, ips->mcp_avg_temp,
temp_limit);
ret = true;
spin_unlock_irqrestore(&ips->turbo_status_lock, flags);
}

if (ret)
avg_power = ips->cpu_avg_power + ips->mch_avg_power;
if (avg_power > ips->mcp_power_limit) {
dev_info(&ips->dev->dev,
"MCP power or thermal limit exceeded\n");
"%sAvg power %u, limit %u\n", msg, avg_power,
ips->mcp_power_limit);
ret = true;
}

spin_unlock_irqrestore(&ips->turbo_status_lock, flags);

return ret;
}
Expand Down Expand Up @@ -662,6 +676,27 @@ static bool mch_exceeded(struct ips_driver *ips)
return ret;
}

/**
* verify_limits - verify BIOS provided limits
* @ips: IPS structure
*
* BIOS can optionally provide non-default limits for power and temp. Check
* them here and use the defaults if the BIOS values are not provided or
* are otherwise unusable.
*/
static void verify_limits(struct ips_driver *ips)
{
if (ips->mcp_power_limit < ips->limits->mcp_power_limit ||
ips->mcp_power_limit > 35000)
ips->mcp_power_limit = ips->limits->mcp_power_limit;

if (ips->mcp_temp_limit < ips->limits->core_temp_limit ||
ips->mcp_temp_limit < ips->limits->mch_temp_limit ||
ips->mcp_temp_limit > 150)
ips->mcp_temp_limit = min(ips->limits->core_temp_limit,
ips->limits->mch_temp_limit);
}

/**
* update_turbo_limits - get various limits & settings from regs
* @ips: IPS driver struct
Expand All @@ -680,12 +715,21 @@ static void update_turbo_limits(struct ips_driver *ips)
u32 hts = thm_readl(THM_HTS);

ips->cpu_turbo_enabled = !(hts & HTS_PCTD_DIS);
ips->gpu_turbo_enabled = !(hts & HTS_GTD_DIS);
/*
* Disable turbo for now, until we can figure out why the power figures
* are wrong
*/
ips->cpu_turbo_enabled = false;

if (ips->gpu_busy)
ips->gpu_turbo_enabled = !(hts & HTS_GTD_DIS);

ips->core_power_limit = thm_readw(THM_MPCPC);
ips->mch_power_limit = thm_readw(THM_MMGPC);
ips->mcp_temp_limit = thm_readw(THM_PTL);
ips->mcp_power_limit = thm_readw(THM_MPPC);

verify_limits(ips);
/* Ignore BIOS CPU vs GPU pref */
}

Expand Down Expand Up @@ -858,7 +902,7 @@ static u32 get_cpu_power(struct ips_driver *ips, u32 *last, int period)
ret = (ret * 1000) / 65535;
*last = val;

return ret;
return 0;
}

static const u16 temp_decay_factor = 2;
Expand Down Expand Up @@ -940,15 +984,14 @@ static int ips_monitor(void *data)
kfree(mch_samples);
kfree(cpu_samples);
kfree(mchp_samples);
kthread_stop(ips->adjust);
return -ENOMEM;
}

last_seqno = (thm_readl(THM_ITV) & ITV_ME_SEQNO_MASK) >>
ITV_ME_SEQNO_SHIFT;
seqno_timestamp = get_jiffies_64();

old_cpu_power = thm_readl(THM_CEC) / 65535;
old_cpu_power = thm_readl(THM_CEC);
schedule_timeout_interruptible(msecs_to_jiffies(IPS_SAMPLE_PERIOD));

/* Collect an initial average */
Expand Down Expand Up @@ -1150,11 +1193,18 @@ static irqreturn_t ips_irq_handler(int irq, void *arg)
STS_GPL_SHIFT;
/* ignore EC CPU vs GPU pref */
ips->cpu_turbo_enabled = !(sts & STS_PCTD_DIS);
ips->gpu_turbo_enabled = !(sts & STS_GTD_DIS);
/*
* Disable turbo for now, until we can figure
* out why the power figures are wrong
*/
ips->cpu_turbo_enabled = false;
if (ips->gpu_busy)
ips->gpu_turbo_enabled = !(sts & STS_GTD_DIS);
ips->mcp_temp_limit = (sts & STS_PTL_MASK) >>
STS_PTL_SHIFT;
ips->mcp_power_limit = (tc1 & STS_PPL_MASK) >>
STS_PPL_SHIFT;
verify_limits(ips);
spin_unlock(&ips->turbo_status_lock);

thm_writeb(THM_SEC, SEC_ACK);
Expand Down Expand Up @@ -1333,8 +1383,10 @@ static struct ips_mcp_limits *ips_detect_cpu(struct ips_driver *ips)
* turbo manually or we'll get an illegal MSR access, even though
* turbo will still be available.
*/
if (!(misc_en & IA32_MISC_TURBO_EN))
; /* add turbo MSR write allowed flag if necessary */
if (misc_en & IA32_MISC_TURBO_EN)
ips->turbo_toggle_allowed = true;
else
ips->turbo_toggle_allowed = false;

if (strstr(boot_cpu_data.x86_model_id, "CPU M"))
limits = &ips_sv_limits;
Expand All @@ -1351,9 +1403,10 @@ static struct ips_mcp_limits *ips_detect_cpu(struct ips_driver *ips)
tdp = turbo_power & TURBO_TDP_MASK;

/* Sanity check TDP against CPU */
if (limits->mcp_power_limit != (tdp / 8) * 1000) {
dev_warn(&ips->dev->dev, "Warning: CPU TDP doesn't match expected value (found %d, expected %d)\n",
tdp / 8, limits->mcp_power_limit / 1000);
if (limits->core_power_limit != (tdp / 8) * 1000) {
dev_info(&ips->dev->dev, "CPU TDP doesn't match expected value (found %d, expected %d)\n",
tdp / 8, limits->core_power_limit / 1000);
limits->core_power_limit = (tdp / 8) * 1000;
}

out:
Expand Down Expand Up @@ -1390,7 +1443,7 @@ static bool ips_get_i915_syms(struct ips_driver *ips)
return true;

out_put_busy:
symbol_put(i915_gpu_turbo_disable);
symbol_put(i915_gpu_busy);
out_put_lower:
symbol_put(i915_gpu_lower);
out_put_raise:
Expand Down Expand Up @@ -1532,22 +1585,27 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id)
/* Save turbo limits & ratios */
rdmsrl(TURBO_POWER_CURRENT_LIMIT, ips->orig_turbo_limit);

ips_enable_cpu_turbo(ips);
ips->cpu_turbo_enabled = true;
ips_disable_cpu_turbo(ips);
ips->cpu_turbo_enabled = false;

/* Set up the work queue and monitor/adjust threads */
ips->monitor = kthread_run(ips_monitor, ips, "ips-monitor");
if (IS_ERR(ips->monitor)) {
/* Create thermal adjust thread */
ips->adjust = kthread_create(ips_adjust, ips, "ips-adjust");
if (IS_ERR(ips->adjust)) {
dev_err(&dev->dev,
"failed to create thermal monitor thread, aborting\n");
"failed to create thermal adjust thread, aborting\n");
ret = -ENOMEM;
goto error_free_irq;

}

ips->adjust = kthread_create(ips_adjust, ips, "ips-adjust");
if (IS_ERR(ips->adjust)) {
/*
* Set up the work queue and monitor thread. The monitor thread
* will wake up ips_adjust thread.
*/
ips->monitor = kthread_run(ips_monitor, ips, "ips-monitor");
if (IS_ERR(ips->monitor)) {
dev_err(&dev->dev,
"failed to create thermal adjust thread, aborting\n");
"failed to create thermal monitor thread, aborting\n");
ret = -ENOMEM;
goto error_thread_cleanup;
}
Expand All @@ -1566,7 +1624,7 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id)
return ret;

error_thread_cleanup:
kthread_stop(ips->monitor);
kthread_stop(ips->adjust);
error_free_irq:
free_irq(ips->dev->irq, ips);
error_unmap:
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/notify/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ config FSNOTIFY

source "fs/notify/dnotify/Kconfig"
source "fs/notify/inotify/Kconfig"
source "fs/notify/fanotify/Kconfig"
#source "fs/notify/fanotify/Kconfig"
1 change: 0 additions & 1 deletion trunk/include/linux/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ header-y += eventpoll.h
header-y += ext2_fs.h
header-y += fadvise.h
header-y += falloc.h
header-y += fanotify.h
header-y += fb.h
header-y += fcntl.h
header-y += fd.h
Expand Down
2 changes: 1 addition & 1 deletion trunk/scripts/kconfig/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static void check_conf(struct menu *menu)
if (sym->name && !sym_is_choice_value(sym)) {
printf("CONFIG_%s\n", sym->name);
}
} else {
} else if (input_mode != oldnoconfig) {
if (!conf_cnt++)
printf(_("*\n* Restart config...\n*\n"));
rootEntry = menu_get_parent_menu(menu);
Expand Down
1 change: 0 additions & 1 deletion trunk/scripts/kconfig/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ struct menu {
struct symbol *sym;
struct property *prompt;
struct expr *dep;
struct expr *dir_dep;
unsigned int flags;
char *help;
struct file *file;
Expand Down
7 changes: 2 additions & 5 deletions trunk/scripts/kconfig/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ static struct expr *menu_check_dep(struct expr *e)
void menu_add_dep(struct expr *dep)
{
current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep));
current_entry->dir_dep = current_entry->dep;
}

void menu_set_type(int type)
Expand Down Expand Up @@ -291,10 +290,6 @@ void menu_finalize(struct menu *parent)
for (menu = parent->list; menu; menu = menu->next)
menu_finalize(menu);
} else if (sym) {
/* ignore inherited dependencies for dir_dep */
sym->dir_dep.expr = expr_transform(expr_copy(parent->dir_dep));
sym->dir_dep.expr = expr_eliminate_dups(sym->dir_dep.expr);

basedep = parent->prompt ? parent->prompt->visible.expr : NULL;
basedep = expr_trans_compare(basedep, E_UNEQUAL, &symbol_no);
basedep = expr_eliminate_dups(expr_transform(basedep));
Expand Down Expand Up @@ -325,6 +320,8 @@ void menu_finalize(struct menu *parent)
parent->next = last_menu->next;
last_menu->next = NULL;
}

sym->dir_dep.expr = parent->dep;
}
for (menu = parent->list; menu; menu = menu->next) {
if (sym && sym_is_choice(sym) &&
Expand Down
2 changes: 2 additions & 0 deletions trunk/scripts/kconfig/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ void sym_calc_value(struct symbol *sym)
}
}
calc_newval:
#if 0
if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) {
fprintf(stderr, "warning: (");
expr_fprint(sym->rev_dep.expr, stderr);
Expand All @@ -358,6 +359,7 @@ void sym_calc_value(struct symbol *sym)
expr_fprint(sym->dir_dep.expr, stderr);
fprintf(stderr, ")\n");
}
#endif
newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri);
}
if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN)
Expand Down
4 changes: 2 additions & 2 deletions trunk/sound/oss/soundcard.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,11 @@ static long sound_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case SND_DEV_DSP:
case SND_DEV_DSP16:
case SND_DEV_AUDIO:
return audio_ioctl(dev, file, cmd, p);
ret = audio_ioctl(dev, file, cmd, p);
break;

case SND_DEV_MIDIN:
return MIDIbuf_ioctl(dev, file, cmd, p);
ret = MIDIbuf_ioctl(dev, file, cmd, p);
break;

}
Expand Down
Loading

0 comments on commit d24498e

Please sign in to comment.