Skip to content

Commit

Permalink
Merge commit 'v3.6.11' into rpi-3.6.y
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Dec 17, 2012
2 parents d21d26e + b2824f4 commit 197d15b
Show file tree
Hide file tree
Showing 56 changed files with 564 additions and 246 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 6
SUBLEVEL = 10
SUBLEVEL = 11
EXTRAVERSION =
NAME = Terrified Chipmunk

Expand Down
3 changes: 2 additions & 1 deletion arch/arm/include/asm/hwcap.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
#define HWCAP_THUMBEE (1 << 11)
#define HWCAP_NEON (1 << 12)
#define HWCAP_VFPv3 (1 << 13)
#define HWCAP_VFPv3D16 (1 << 14)
#define HWCAP_VFPv3D16 (1 << 14) /* also set for VFPv4-D16 */
#define HWCAP_TLS (1 << 15)
#define HWCAP_VFPv4 (1 << 16)
#define HWCAP_IDIVA (1 << 17)
#define HWCAP_IDIVT (1 << 18)
#define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */
#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)

#if defined(__KERNEL__)
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/include/asm/vfpmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
#if __LINUX_ARM_ARCH__ <= 6
ldr \tmp, =elf_hwcap @ may not have MVFR regs
ldr \tmp, [\tmp, #0]
tst \tmp, #HWCAP_VFPv3D16
ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
addne \base, \base, #32*4 @ step over unused register space
tst \tmp, #HWCAP_VFPD32
ldcnel p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
addeq \base, \base, #32*4 @ step over unused register space
#else
VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
Expand All @@ -51,9 +51,9 @@
#if __LINUX_ARM_ARCH__ <= 6
ldr \tmp, =elf_hwcap @ may not have MVFR regs
ldr \tmp, [\tmp, #0]
tst \tmp, #HWCAP_VFPv3D16
stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
addne \base, \base, #32*4 @ step over unused register space
tst \tmp, #HWCAP_VFPD32
stcnel p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
addeq \base, \base, #32*4 @ step over unused register space
#else
VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
Expand Down
9 changes: 6 additions & 3 deletions arch/arm/vfp/vfpmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,11 +701,14 @@ static int __init vfp_init(void)
elf_hwcap |= HWCAP_VFPv3;

/*
* Check for VFPv3 D16. CPUs in this configuration
* only have 16 x 64bit registers.
* Check for VFPv3 D16 and VFPv4 D16. CPUs in
* this configuration only have 16 x 64bit
* registers.
*/
if (((fmrx(MVFR0) & MVFR0_A_SIMD_MASK)) == 1)
elf_hwcap |= HWCAP_VFPv3D16;
elf_hwcap |= HWCAP_VFPv3D16; /* also v4-D16 */
else
elf_hwcap |= HWCAP_VFPD32;
}
#endif
/*
Expand Down
35 changes: 25 additions & 10 deletions arch/powerpc/platforms/pseries/eeh_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,18 @@ static int eeh_report_error(struct pci_dev *dev, void *userdata)
enum pci_ers_result rc, *res = userdata;
struct pci_driver *driver;

device_lock(&dev->dev);
dev->error_state = pci_channel_io_frozen;

driver = eeh_pcid_get(dev);
if (!driver) return 0;
if (!driver) goto out;

eeh_disable_irq(dev);

if (!driver->err_handler ||
!driver->err_handler->error_detected) {
eeh_pcid_put(dev);
return 0;
goto out;
}

rc = driver->err_handler->error_detected(dev, pci_channel_io_frozen);
Expand All @@ -184,6 +185,8 @@ static int eeh_report_error(struct pci_dev *dev, void *userdata)
if (*res == PCI_ERS_RESULT_NONE) *res = rc;

eeh_pcid_put(dev);
out:
device_unlock(&dev->dev);
return 0;
}

Expand All @@ -201,13 +204,14 @@ static int eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata)
enum pci_ers_result rc, *res = userdata;
struct pci_driver *driver;

device_lock(&dev->dev);
driver = eeh_pcid_get(dev);
if (!driver) return 0;
if (!driver) goto out;

if (!driver->err_handler ||
!driver->err_handler->mmio_enabled) {
eeh_pcid_put(dev);
return 0;
goto out;
}

rc = driver->err_handler->mmio_enabled(dev);
Expand All @@ -217,6 +221,8 @@ static int eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata)
if (*res == PCI_ERS_RESULT_NONE) *res = rc;

eeh_pcid_put(dev);
out:
device_unlock(&dev->dev);
return 0;
}

Expand All @@ -235,17 +241,18 @@ static int eeh_report_reset(struct pci_dev *dev, void *userdata)
enum pci_ers_result rc, *res = userdata;
struct pci_driver *driver;

device_lock(&dev->dev);
dev->error_state = pci_channel_io_normal;

driver = eeh_pcid_get(dev);
if (!driver) return 0;
if (!driver) goto out;

eeh_enable_irq(dev);

if (!driver->err_handler ||
!driver->err_handler->slot_reset) {
eeh_pcid_put(dev);
return 0;
goto out;
}

rc = driver->err_handler->slot_reset(dev);
Expand All @@ -255,6 +262,8 @@ static int eeh_report_reset(struct pci_dev *dev, void *userdata)
rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;

eeh_pcid_put(dev);
out:
device_unlock(&dev->dev);
return 0;
}

Expand All @@ -271,22 +280,25 @@ static int eeh_report_resume(struct pci_dev *dev, void *userdata)
{
struct pci_driver *driver;

device_lock(&dev->dev);
dev->error_state = pci_channel_io_normal;

driver = eeh_pcid_get(dev);
if (!driver) return 0;
if (!driver) goto out;

eeh_enable_irq(dev);

if (!driver->err_handler ||
!driver->err_handler->resume) {
eeh_pcid_put(dev);
return 0;
goto out;
}

driver->err_handler->resume(dev);

eeh_pcid_put(dev);
out:
device_unlock(&dev->dev);
return 0;
}

Expand All @@ -302,22 +314,25 @@ static int eeh_report_failure(struct pci_dev *dev, void *userdata)
{
struct pci_driver *driver;

device_lock(&dev->dev);
dev->error_state = pci_channel_io_perm_failure;

driver = eeh_pcid_get(dev);
if (!driver) return 0;
if (!driver) goto out;

eeh_disable_irq(dev);

if (!driver->err_handler ||
!driver->err_handler->error_detected) {
eeh_pcid_put(dev);
return 0;
goto out;
}

driver->err_handler->error_detected(dev, pci_channel_io_perm_failure);

eeh_pcid_put(dev);
out:
device_unlock(&dev->dev);
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions arch/x86/kernel/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ void hpet_msi_unmask(struct irq_data *data)

/* unmask it */
cfg = hpet_readl(HPET_Tn_CFG(hdev->num));
cfg |= HPET_TN_FSB;
cfg |= HPET_TN_ENABLE | HPET_TN_FSB;
hpet_writel(cfg, HPET_Tn_CFG(hdev->num));
}

Expand All @@ -445,7 +445,7 @@ void hpet_msi_mask(struct irq_data *data)

/* mask it */
cfg = hpet_readl(HPET_Tn_CFG(hdev->num));
cfg &= ~HPET_TN_FSB;
cfg &= ~(HPET_TN_ENABLE | HPET_TN_FSB);
hpet_writel(cfg, HPET_Tn_CFG(hdev->num));
}

Expand Down
77 changes: 77 additions & 0 deletions drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <linux/dmi.h>
#include <linux/slab.h>
#include <linux/suspend.h>
#include <asm/unaligned.h>

#ifdef CONFIG_ACPI_PROCFS_POWER
#include <linux/proc_fs.h>
Expand Down Expand Up @@ -95,6 +96,18 @@ enum {
ACPI_BATTERY_ALARM_PRESENT,
ACPI_BATTERY_XINFO_PRESENT,
ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY,
/* On Lenovo Thinkpad models from 2010 and 2011, the power unit
switches between mWh and mAh depending on whether the system
is running on battery or not. When mAh is the unit, most
reported values are incorrect and need to be adjusted by
10000/design_voltage. Verified on x201, t410, t410s, and x220.
Pre-2010 and 2012 models appear to always report in mWh and
are thus unaffected (tested with t42, t61, t500, x200, x300,
and x230). Also, in mid-2012 Lenovo issued a BIOS update for
the 2011 models that fixes the issue (tested on x220 with a
post-1.29 BIOS), but as of Nov. 2012, no such update is
available for the 2010 models. */
ACPI_BATTERY_QUIRK_THINKPAD_MAH,
};

struct acpi_battery {
Expand Down Expand Up @@ -438,6 +451,21 @@ static int acpi_battery_get_info(struct acpi_battery *battery)
kfree(buffer.pointer);
if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags))
battery->full_charge_capacity = battery->design_capacity;
if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH, &battery->flags) &&
battery->power_unit && battery->design_voltage) {
battery->design_capacity = battery->design_capacity *
10000 / battery->design_voltage;
battery->full_charge_capacity = battery->full_charge_capacity *
10000 / battery->design_voltage;
battery->design_capacity_warning =
battery->design_capacity_warning *
10000 / battery->design_voltage;
/* Curiously, design_capacity_low, unlike the rest of them,
is correct. */
/* capacity_granularity_* equal 1 on the systems tested, so
it's impossible to tell if they would need an adjustment
or not if their values were higher. */
}
return result;
}

Expand Down Expand Up @@ -486,6 +514,11 @@ static int acpi_battery_get_state(struct acpi_battery *battery)
&& battery->capacity_now >= 0 && battery->capacity_now <= 100)
battery->capacity_now = (battery->capacity_now *
battery->full_charge_capacity) / 100;
if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH, &battery->flags) &&
battery->power_unit && battery->design_voltage) {
battery->capacity_now = battery->capacity_now *
10000 / battery->design_voltage;
}
return result;
}

Expand Down Expand Up @@ -595,6 +628,24 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
mutex_unlock(&battery->sysfs_lock);
}

static void find_battery(const struct dmi_header *dm, void *private)
{
struct acpi_battery *battery = (struct acpi_battery *)private;
/* Note: the hardcoded offsets below have been extracted from
the source code of dmidecode. */
if (dm->type == DMI_ENTRY_PORTABLE_BATTERY && dm->length >= 8) {
const u8 *dmi_data = (const u8 *)(dm + 1);
int dmi_capacity = get_unaligned((const u16 *)(dmi_data + 6));
if (dm->length >= 18)
dmi_capacity *= dmi_data[17];
if (battery->design_capacity * battery->design_voltage / 1000
!= dmi_capacity &&
battery->design_capacity * 10 == dmi_capacity)
set_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH,
&battery->flags);
}
}

/*
* According to the ACPI spec, some kinds of primary batteries can
* report percentage battery remaining capacity directly to OS.
Expand All @@ -620,6 +671,32 @@ static void acpi_battery_quirks(struct acpi_battery *battery)
battery->capacity_now = (battery->capacity_now *
battery->full_charge_capacity) / 100;
}

if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH, &battery->flags))
return ;

if (battery->power_unit && dmi_name_in_vendors("LENOVO")) {
const char *s;
s = dmi_get_system_info(DMI_PRODUCT_VERSION);
if (s && !strnicmp(s, "ThinkPad", 8)) {
dmi_walk(find_battery, battery);
if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH,
&battery->flags) &&
battery->design_voltage) {
battery->design_capacity =
battery->design_capacity *
10000 / battery->design_voltage;
battery->full_charge_capacity =
battery->full_charge_capacity *
10000 / battery->design_voltage;
battery->design_capacity_warning =
battery->design_capacity_warning *
10000 / battery->design_voltage;
battery->capacity_now = battery->capacity_now *
10000 / battery->design_voltage;
}
}
}
}

static int acpi_battery_update(struct acpi_battery *battery)
Expand Down
8 changes: 8 additions & 0 deletions drivers/acpi/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
},
{
.callback = init_nvs_nosave,
.ident = "Sony Vaio VPCEB1S1E",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1S1E"),
},
},
{
.callback = init_nvs_nosave,
.ident = "Sony Vaio VGN-FW520F",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
Expand Down
14 changes: 14 additions & 0 deletions drivers/acpi/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@ static int __init video_set_bqc_offset(const struct dmi_system_id *d)
return 0;
}

static int video_ignore_initial_backlight(const struct dmi_system_id *d)
{
use_bios_initial_backlight = 0;
return 0;
}

static struct dmi_system_id video_dmi_table[] __initdata = {
/*
* Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121
Expand Down Expand Up @@ -433,6 +439,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = {
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720"),
},
},
{
.callback = video_ignore_initial_backlight,
.ident = "HP Folio 13-2000",
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
DMI_MATCH(DMI_PRODUCT_NAME, "HP Folio 13 - 2000 Notebook PC"),
},
},
{}
};

Expand Down
Loading

0 comments on commit 197d15b

Please sign in to comment.