Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote-tracking branch 'github/3.7/misc' into 3.7/master

  • Loading branch information...
commit 5f8a5e582d22c5dc62f5298a9a3642a36d2e5568 2 parents 39d1f6c + ac5de53
@heftig heftig authored
View
36 arch/x86/kernel/acpi/boot.c
@@ -1423,6 +1423,42 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
},
},
+ /* ThinkPad Edge 11 (AMD) */
+ {
+ .callback = dmi_ignore_irq0_timer_override,
+ .ident = "ThinkPad Edge",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "254523U"),
+ },
+ },
+ /* ThinkPad Edge 13 (AMD) */
+ {
+ .callback = dmi_ignore_irq0_timer_override,
+ .ident = "ThinkPad Edge",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "022120U"),
+ },
+ },
+ /* ThinkPad Edge 14 (AMD) */
+ {
+ .callback = dmi_ignore_irq0_timer_override,
+ .ident = "ThinkPad Edge",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "019923U"),
+ },
+ },
+ /* ThinkPad Edge 15 (AMD) */
+ {
+ .callback = dmi_ignore_irq0_timer_override,
+ .ident = "ThinkPad Edge",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "030222U"),
+ },
+ },
{}
};
View
5 arch/x86/kernel/apic/io_apic.c
@@ -3639,6 +3639,11 @@ int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity)
{
int ioapic, pin, idx;
+#ifdef CONFIG_ACPI
+ if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC)
+ return -1;
+#endif
+
if (skip_ioapic_setup)
return -1;
View
51 arch/x86/kernel/cpu/intel.c
@@ -30,6 +30,7 @@
static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
{
u64 misc_enable;
+ bool allow_fast_string = true;
/* Unmask CPUID levels if masked: */
if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
@@ -120,10 +121,11 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
* (model 2) with the same problem.
*/
if (c->x86 == 15) {
- rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
+ allow_fast_string = false;
+ rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
if (misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING) {
- printk(KERN_INFO "kmemcheck: Disabling fast string operations\n");
+ printk_once(KERN_INFO "kmemcheck: Disabling fast string operations\n");
misc_enable &= ~MSR_IA32_MISC_ENABLE_FAST_STRING;
wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
@@ -132,13 +134,29 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
#endif
/*
- * If fast string is not enabled in IA32_MISC_ENABLE for any reason,
- * clear the fast string and enhanced fast string CPU capabilities.
+ * If BIOS didn't enable fast string operation, try to enable
+ * it ourselves. If that fails, then clear the fast string
+ * and enhanced fast string CPU capabilities.
*/
if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
+
+ if (allow_fast_string &&
+ !(misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING)) {
+ misc_enable |= MSR_IA32_MISC_ENABLE_FAST_STRING;
+ wrmsr_safe(MSR_IA32_MISC_ENABLE, (u32)misc_enable,
+ (u32)(misc_enable >> 32));
+
+ /* Re-read to make sure it stuck. */
+ rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
+
+ if (misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING)
+ printk_once(KERN_INFO FW_WARN "IA32_MISC_ENABLE.FAST_STRING_ENABLE was not set\n");
+ }
+
if (!(misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING)) {
- printk(KERN_INFO "Disabled fast string operations\n");
+ if (allow_fast_string)
+ printk_once(KERN_INFO "Failed to enable fast string operations\n");
setup_clear_cpu_cap(X86_FEATURE_REP_GOOD);
setup_clear_cpu_cap(X86_FEATURE_ERMS);
}
@@ -474,6 +492,29 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c)
wrmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb);
}
}
+
+ /* Enable monitor/mwait if BIOS didn't do it for us. */
+ if (!cpu_has(c, X86_FEATURE_MWAIT) && cpu_has(c, X86_FEATURE_XMM3)
+ && c->x86 >= 6 && !(c->x86 == 6 && c->x86_model < 0x1c)
+ && !(c->x86 == 0xf && c->x86_model < 3)) {
+ u64 misc_enable;
+ rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
+ misc_enable |= MSR_IA32_MISC_ENABLE_MWAIT;
+
+ /*
+ * Some non-SSE3 cpus will #GP. We check for that,
+ * but it can't hurt to be safe.
+ */
+ wrmsr_safe(MSR_IA32_MISC_ENABLE, (u32)misc_enable,
+ (u32)(misc_enable >> 32));
+
+ /* Re-read monitor capability. */
+ if (cpuid_ecx(1) & 0x8) {
+ set_cpu_cap(c, X86_FEATURE_MWAIT);
+
+ printk(KERN_WARNING FW_WARN "IA32_MISC_ENABLE.ENABLE_MONITOR_FSM was not set\n");
+ }
+ }
}
#ifdef CONFIG_X86_32
View
10 drivers/acpi/video.c
@@ -567,8 +567,14 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag)
video->dos_setting = arg0.integer.value;
status = acpi_evaluate_object(video->device->handle, "_DOS",
&args, NULL);
- if (ACPI_FAILURE(status))
- return -EIO;
+ if (ACPI_FAILURE(status)) {
+ /*
+ * some platforms don't have _DOS, but the ACPI
+ * backlight control still works
+ */
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No _DOS\n"));
+ return 0;
+ }
return 0;
}
View
4 drivers/input/mouse/synaptics.c
@@ -1293,7 +1293,9 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
/* Clickpads report only left button */
__clear_bit(BTN_RIGHT, dev->keybit);
__clear_bit(BTN_MIDDLE, dev->keybit);
- }
+ } else if (SYN_CAP_CLICKPAD2BTN(priv->ext_cap_0c) ||
+ SYN_CAP_CLICKPAD2BTN2(priv->ext_cap_0c))
+ __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
}
static ssize_t synaptics_show_disable_gesture(struct psmouse *psmouse,
View
1  drivers/input/mouse/synaptics.h
@@ -81,6 +81,7 @@
*/
#define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */
#define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */
+#define SYN_CAP_CLICKPAD2BTN2(ex0c) ((ex0c) & 0x200000) /* 2-button ClickPad */
#define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000)
#define SYN_CAP_MIN_DIMENSIONS(ex0c) ((ex0c) & 0x002000)
#define SYN_CAP_ADV_GESTURE(ex0c) ((ex0c) & 0x080000)
View
1  drivers/net/wireless/hostap/hostap.h
@@ -90,6 +90,7 @@ extern const struct iw_handler_def hostap_iw_handler_def;
extern const struct ethtool_ops prism2_ethtool_ops;
int hostap_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
+int hostap_restore_power(struct net_device *dev);
#endif /* HOSTAP_H */
View
24 drivers/net/wireless/hostap/hostap_ap.c
@@ -2340,13 +2340,13 @@ int prism2_ap_get_sta_qual(local_info_t *local, struct sockaddr addr[],
addr[count].sa_family = ARPHRD_ETHER;
memcpy(addr[count].sa_data, sta->addr, ETH_ALEN);
if (sta->last_rx_silence == 0)
- qual[count].qual = sta->last_rx_signal < 27 ?
- 0 : (sta->last_rx_signal - 27) * 92 / 127;
+ qual[count].qual = (sta->last_rx_signal - 156) == 0 ?
+ 0 : (sta->last_rx_signal - 156) * 92 / 64;
else
- qual[count].qual = sta->last_rx_signal -
- sta->last_rx_silence - 35;
- qual[count].level = HFA384X_LEVEL_TO_dBm(sta->last_rx_signal);
- qual[count].noise = HFA384X_LEVEL_TO_dBm(sta->last_rx_silence);
+ qual[count].qual = (sta->last_rx_signal -
+ sta->last_rx_silence) * 92 / 64;
+ qual[count].level = sta->last_rx_signal;
+ qual[count].noise = sta->last_rx_silence;
qual[count].updated = sta->last_rx_updated;
sta->last_rx_updated = IW_QUAL_DBM;
@@ -2412,13 +2412,13 @@ int prism2_ap_translate_scan(struct net_device *dev,
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = IWEVQUAL;
if (sta->last_rx_silence == 0)
- iwe.u.qual.qual = sta->last_rx_signal < 27 ?
- 0 : (sta->last_rx_signal - 27) * 92 / 127;
+ iwe.u.qual.qual = (sta->last_rx_signal -156) == 0 ?
+ 0 : (sta->last_rx_signal - 156) * 92 / 64;
else
- iwe.u.qual.qual = sta->last_rx_signal -
- sta->last_rx_silence - 35;
- iwe.u.qual.level = HFA384X_LEVEL_TO_dBm(sta->last_rx_signal);
- iwe.u.qual.noise = HFA384X_LEVEL_TO_dBm(sta->last_rx_silence);
+ iwe.u.qual.qual = (sta->last_rx_signal -
+ sta->last_rx_silence) * 92 / 64;
+ iwe.u.qual.level = sta->last_rx_signal;
+ iwe.u.qual.noise = sta->last_rx_silence;
iwe.u.qual.updated = sta->last_rx_updated;
iwe.len = IW_EV_QUAL_LEN;
current_ev = iwe_stream_add_event(info, current_ev, end_buf,
View
5 drivers/net/wireless/hostap/hostap_config.h
@@ -45,4 +45,9 @@
*/
/* #define PRISM2_NO_STATION_MODES */
+/* Enable TX power Setting functions
+ * (min att = -128 , max att = 127)
+ */
+#define RAW_TXPOWER_SETTING
+
#endif /* HOSTAP_CONFIG_H */
View
1  drivers/net/wireless/hostap/hostap_hw.c
@@ -928,6 +928,7 @@ static int hfa384x_set_rid(struct net_device *dev, u16 rid, void *buf, int len)
prism2_hw_reset(dev);
}
+ hostap_restore_power(dev);
return res;
}
View
5 drivers/net/wireless/hostap/hostap_info.c
@@ -435,6 +435,11 @@ static void handle_info_queue_linkstatus(local_info_t *local)
}
/* Get BSSID if we have a valid AP address */
+
+ if ( val == HFA384X_LINKSTATUS_CONNECTED ||
+ val == HFA384X_LINKSTATUS_DISCONNECTED )
+ hostap_restore_power(local->dev);
+
if (connected) {
netif_carrier_on(local->dev);
netif_carrier_on(local->ddev);
View
43 drivers/net/wireless/hostap/hostap_ioctl.c
@@ -1479,23 +1479,20 @@ static int prism2_txpower_hfa386x_to_dBm(u16 val)
val = 255;
tmp = val;
- tmp >>= 2;
- return -12 - tmp;
+ return tmp;
}
static u16 prism2_txpower_dBm_to_hfa386x(int val)
{
signed char tmp;
- if (val > 20)
- return 128;
- else if (val < -43)
+ if (val > 127)
return 127;
+ else if (val < -128)
+ return 128;
tmp = val;
- tmp = -12 - tmp;
- tmp <<= 2;
return (unsigned char) tmp;
}
@@ -4052,3 +4049,35 @@ int hostap_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
return ret;
}
+
+/* BUG FIX: Restore power setting value when lost due to F/W bug */
+
+int hostap_restore_power(struct net_device *dev)
+{
+ struct hostap_interface *iface = netdev_priv(dev);
+ local_info_t *local = iface->local;
+
+ u16 val;
+ int ret = 0;
+
+ if (local->txpower_type == PRISM2_TXPOWER_OFF) {
+ val = 0xff; /* use all standby and sleep modes */
+ ret = local->func->cmd(dev, HFA384X_CMDCODE_WRITEMIF,
+ HFA386X_CR_A_D_TEST_MODES2,
+ &val, NULL);
+ }
+
+#ifdef RAW_TXPOWER_SETTING
+ if (local->txpower_type == PRISM2_TXPOWER_FIXED) {
+ val = HFA384X_TEST_CFG_BIT_ALC;
+ local->func->cmd(dev, HFA384X_CMDCODE_TEST |
+ (HFA384X_TEST_CFG_BITS << 8), 0, &val, NULL);
+ val = prism2_txpower_dBm_to_hfa386x(local->txpower);
+ ret = (local->func->cmd(dev, HFA384X_CMDCODE_WRITEMIF,
+ HFA386X_CR_MANUAL_TX_POWER, &val, NULL));
+ }
+#endif /* RAW_TXPOWER_SETTING */
+ return (ret ? -EOPNOTSUPP : 0);
+}
+
+EXPORT_SYMBOL(hostap_restore_power);
View
9 drivers/staging/zram/zram_drv.c
@@ -265,8 +265,13 @@ static int zram_read_before_write(struct zram *zram, char *mem, u32 index)
}
cmem = zs_map_object(zram->mem_pool, handle, ZS_MM_RO);
- ret = lzo1x_decompress_safe(cmem, zram->table[index].size,
- mem, &clen);
+ if (zram->table[index].size == PAGE_SIZE) {
+ memcpy(mem, cmem, PAGE_SIZE);
+ ret = LZO_E_OK;
+ } else {
+ ret = lzo1x_decompress_safe(cmem, zram->table[index].size,
+ mem, &clen);
+ }
zs_unmap_object(zram->mem_pool, handle);
/* Should NEVER happen. Return bio error if it does. */

0 comments on commit 5f8a5e5

Please sign in to comment.
Something went wrong with that request. Please try again.