From 30dbc75ba465059b381767d0b77e958415700762 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 21 May 2013 19:26:55 -0700 Subject: [PATCH] 3.9-stable patches added patches: drm-nouveau-bios-fix-thinko-in-zm_mask_add-opcode.patch drm-radeon-fix-vram-size-calculation-for-vram-4gb.patch hwmon-fix-error-return-code-in-abituguru_probe.patch i2c-designware-always-clear-interrupts-before-enabling-them.patch i2c-designware-fix-rx-fifo-overrun.patch x86-fix-bit-corruption-at-cpu-resume-time.patch --- ...ios-fix-thinko-in-zm_mask_add-opcode.patch | 29 +++++++ ...x-vram-size-calculation-for-vram-4gb.patch | 58 +++++++++++++ ...error-return-code-in-abituguru_probe.patch | 47 ++++++++++ ...lear-interrupts-before-enabling-them.patch | 38 ++++++++ .../i2c-designware-fix-rx-fifo-overrun.patch | 87 +++++++++++++++++++ queue-3.9/series | 6 ++ ...ix-bit-corruption-at-cpu-resume-time.patch | 40 +++++++++ 7 files changed, 305 insertions(+) create mode 100644 queue-3.9/drm-nouveau-bios-fix-thinko-in-zm_mask_add-opcode.patch create mode 100644 queue-3.9/drm-radeon-fix-vram-size-calculation-for-vram-4gb.patch create mode 100644 queue-3.9/hwmon-fix-error-return-code-in-abituguru_probe.patch create mode 100644 queue-3.9/i2c-designware-always-clear-interrupts-before-enabling-them.patch create mode 100644 queue-3.9/i2c-designware-fix-rx-fifo-overrun.patch create mode 100644 queue-3.9/x86-fix-bit-corruption-at-cpu-resume-time.patch diff --git a/queue-3.9/drm-nouveau-bios-fix-thinko-in-zm_mask_add-opcode.patch b/queue-3.9/drm-nouveau-bios-fix-thinko-in-zm_mask_add-opcode.patch new file mode 100644 index 00000000000..32ae389ca7c --- /dev/null +++ b/queue-3.9/drm-nouveau-bios-fix-thinko-in-zm_mask_add-opcode.patch @@ -0,0 +1,29 @@ +From 46b47b8a7d9223b12ddcabf1f3fc6e753e2d84a1 Mon Sep 17 00:00:00 2001 +From: Ben Skeggs +Date: Tue, 7 May 2013 15:54:13 +1000 +Subject: drm/nouveau/bios: fix thinko in ZM_MASK_ADD opcode + +From: Ben Skeggs + +commit 46b47b8a7d9223b12ddcabf1f3fc6e753e2d84a1 upstream. + +Signed-off-by: Ben Skeggs +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/nouveau/core/subdev/bios/init.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c ++++ b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c +@@ -1926,8 +1926,8 @@ init_zm_mask_add(struct nvbios_init *ini + trace("ZM_MASK_ADD\tR[0x%06x] &= 0x%08x += 0x%08x\n", addr, mask, add); + init->offset += 13; + +- data = init_rd32(init, addr) & mask; +- data |= ((data + add) & ~mask); ++ data = init_rd32(init, addr); ++ data = (data & mask) | ((data + add) & ~mask); + init_wr32(init, addr, data); + } + diff --git a/queue-3.9/drm-radeon-fix-vram-size-calculation-for-vram-4gb.patch b/queue-3.9/drm-radeon-fix-vram-size-calculation-for-vram-4gb.patch new file mode 100644 index 00000000000..c72b2ee7dc9 --- /dev/null +++ b/queue-3.9/drm-radeon-fix-vram-size-calculation-for-vram-4gb.patch @@ -0,0 +1,58 @@ +From fc986034540102cd090237bf3f70262e1ae80d9c Mon Sep 17 00:00:00 2001 +From: Niels Ole Salscheider +Date: Sat, 18 May 2013 21:19:23 +0200 +Subject: drm/radeon: Fix VRAM size calculation for VRAM >= 4GB + +From: Niels Ole Salscheider + +commit fc986034540102cd090237bf3f70262e1ae80d9c upstream. + +Add ULL prefix to avoid overflow. + +Signed-off-by: Niels Ole Salscheider +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/evergreen.c | 4 ++-- + drivers/gpu/drm/radeon/radeon_ttm.c | 2 +- + drivers/gpu/drm/radeon/si.c | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/gpu/drm/radeon/evergreen.c ++++ b/drivers/gpu/drm/radeon/evergreen.c +@@ -2400,8 +2400,8 @@ int evergreen_mc_init(struct radeon_devi + rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); + } else { + /* size in MB on evergreen/cayman/tn */ +- rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; +- rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; ++ rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024ULL * 1024ULL; ++ rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024ULL * 1024ULL; + } + rdev->mc.visible_vram_size = rdev->mc.aper_size; + r700_vram_gtt_location(rdev, &rdev->mc); +--- a/drivers/gpu/drm/radeon/radeon_ttm.c ++++ b/drivers/gpu/drm/radeon/radeon_ttm.c +@@ -726,7 +726,7 @@ int radeon_ttm_init(struct radeon_device + return r; + } + DRM_INFO("radeon: %uM of VRAM memory ready\n", +- (unsigned)rdev->mc.real_vram_size / (1024 * 1024)); ++ (unsigned) (rdev->mc.real_vram_size / (1024 * 1024))); + r = ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_TT, + rdev->mc.gtt_size >> PAGE_SHIFT); + if (r) { +--- a/drivers/gpu/drm/radeon/si.c ++++ b/drivers/gpu/drm/radeon/si.c +@@ -2644,8 +2644,8 @@ static int si_mc_init(struct radeon_devi + rdev->mc.aper_base = pci_resource_start(rdev->pdev, 0); + rdev->mc.aper_size = pci_resource_len(rdev->pdev, 0); + /* size in MB on si */ +- rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; +- rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; ++ rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024ULL * 1024ULL; ++ rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024ULL * 1024ULL; + rdev->mc.visible_vram_size = rdev->mc.aper_size; + si_vram_gtt_location(rdev, &rdev->mc); + radeon_update_bandwidth_info(rdev); diff --git a/queue-3.9/hwmon-fix-error-return-code-in-abituguru_probe.patch b/queue-3.9/hwmon-fix-error-return-code-in-abituguru_probe.patch new file mode 100644 index 00000000000..57975d04181 --- /dev/null +++ b/queue-3.9/hwmon-fix-error-return-code-in-abituguru_probe.patch @@ -0,0 +1,47 @@ +From ecacb0b17c08fae89f65468727f0e4b8e91da4e1 Mon Sep 17 00:00:00 2001 +From: Wei Yongjun +Date: Mon, 13 May 2013 14:01:43 +0800 +Subject: hwmon: fix error return code in abituguru_probe() + +From: Wei Yongjun + +commit ecacb0b17c08fae89f65468727f0e4b8e91da4e1 upstream. + +Fix to return a negative error code from the error handling +case instead of 0, as done elsewhere in this function. + +Signed-off-by: Wei Yongjun +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hwmon/abituguru.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +--- a/drivers/hwmon/abituguru.c ++++ b/drivers/hwmon/abituguru.c +@@ -1411,14 +1411,18 @@ static int abituguru_probe(struct platfo + pr_info("found Abit uGuru\n"); + + /* Register sysfs hooks */ +- for (i = 0; i < sysfs_attr_i; i++) +- if (device_create_file(&pdev->dev, +- &data->sysfs_attr[i].dev_attr)) ++ for (i = 0; i < sysfs_attr_i; i++) { ++ res = device_create_file(&pdev->dev, ++ &data->sysfs_attr[i].dev_attr); ++ if (res) + goto abituguru_probe_error; +- for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++) +- if (device_create_file(&pdev->dev, +- &abituguru_sysfs_attr[i].dev_attr)) ++ } ++ for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++) { ++ res = device_create_file(&pdev->dev, ++ &abituguru_sysfs_attr[i].dev_attr); ++ if (res) + goto abituguru_probe_error; ++ } + + data->hwmon_dev = hwmon_device_register(&pdev->dev); + if (!IS_ERR(data->hwmon_dev)) diff --git a/queue-3.9/i2c-designware-always-clear-interrupts-before-enabling-them.patch b/queue-3.9/i2c-designware-always-clear-interrupts-before-enabling-them.patch new file mode 100644 index 00000000000..294392dfef3 --- /dev/null +++ b/queue-3.9/i2c-designware-always-clear-interrupts-before-enabling-them.patch @@ -0,0 +1,38 @@ +From 2a2d95e9d6d29e726cc294b65391917ed2e32bf4 Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +Date: Mon, 13 May 2013 00:54:30 +0000 +Subject: i2c: designware: always clear interrupts before enabling them + +From: Mika Westerberg + +commit 2a2d95e9d6d29e726cc294b65391917ed2e32bf4 upstream. + +If the I2C bus is put to a low power state by an ACPI method it might pull +the SDA line low (as its power is removed). Once the bus is put to full +power state again, the SDA line is pulled back to high. This transition +looks like a STOP condition from the controller point-of-view which sets +STOP detected bit in its status register causing the driver to fail +subsequent transfers. + +Fix this by always clearing all interrupts before we start a transfer. + +Signed-off-by: Mika Westerberg +Signed-off-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/i2c/busses/i2c-designware-core.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/i2c/busses/i2c-designware-core.c ++++ b/drivers/i2c/busses/i2c-designware-core.c +@@ -361,7 +361,8 @@ static void i2c_dw_xfer_init(struct dw_i + /* Enable the adapter */ + dw_writel(dev, 1, DW_IC_ENABLE); + +- /* Enable interrupts */ ++ /* Clear and enable interrupts */ ++ i2c_dw_clear_int(dev); + dw_writel(dev, DW_IC_INTR_DEFAULT_MASK, DW_IC_INTR_MASK); + } + diff --git a/queue-3.9/i2c-designware-fix-rx-fifo-overrun.patch b/queue-3.9/i2c-designware-fix-rx-fifo-overrun.patch new file mode 100644 index 00000000000..51b8c0c834c --- /dev/null +++ b/queue-3.9/i2c-designware-fix-rx-fifo-overrun.patch @@ -0,0 +1,87 @@ +From e6f34cea56f5b95498070eaa9f4aa3ba4a9e4f62 Mon Sep 17 00:00:00 2001 +From: Josef Ahmad +Date: Fri, 19 Apr 2013 17:28:10 +0100 +Subject: i2c: designware: fix RX FIFO overrun + +From: Josef Ahmad + +commit e6f34cea56f5b95498070eaa9f4aa3ba4a9e4f62 upstream. + +i2c_dw_xfer_msg() pushes a number of bytes to transmit/receive +to/from the bus into the TX FIFO. +For master-rx transactions, the maximum amount of data that can be +received is calculated depending solely on TX and RX FIFO load. + +This is racy - TX FIFO may contain master-rx data yet to be +processed, which will eventually land into the RX FIFO. This +data is not taken into account and the function may request more +data than the controller is actually capable of storing. + +This patch ensures the driver takes into account the outstanding +master-rx data in TX FIFO to prevent RX FIFO overrun. + +Signed-off-by: Josef Ahmad +Acked-by: Mika Westerberg +Signed-off-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/i2c/busses/i2c-designware-core.c | 11 ++++++++++- + drivers/i2c/busses/i2c-designware-core.h | 2 ++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +--- a/drivers/i2c/busses/i2c-designware-core.c ++++ b/drivers/i2c/busses/i2c-designware-core.c +@@ -426,8 +426,14 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev) + cmd |= BIT(9); + + if (msgs[dev->msg_write_idx].flags & I2C_M_RD) { ++ ++ /* avoid rx buffer overrun */ ++ if (rx_limit - dev->rx_outstanding <= 0) ++ break; ++ + dw_writel(dev, cmd | 0x100, DW_IC_DATA_CMD); + rx_limit--; ++ dev->rx_outstanding++; + } else + dw_writel(dev, cmd | *buf++, DW_IC_DATA_CMD); + tx_limit--; buf_len--; +@@ -480,8 +486,10 @@ i2c_dw_read(struct dw_i2c_dev *dev) + + rx_valid = dw_readl(dev, DW_IC_RXFLR); + +- for (; len > 0 && rx_valid > 0; len--, rx_valid--) ++ for (; len > 0 && rx_valid > 0; len--, rx_valid--) { + *buf++ = dw_readl(dev, DW_IC_DATA_CMD); ++ dev->rx_outstanding--; ++ } + + if (len > 0) { + dev->status |= STATUS_READ_IN_PROGRESS; +@@ -539,6 +547,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, st + dev->msg_err = 0; + dev->status = STATUS_IDLE; + dev->abort_source = 0; ++ dev->rx_outstanding = 0; + + ret = i2c_dw_wait_bus_not_busy(dev); + if (ret < 0) +--- a/drivers/i2c/busses/i2c-designware-core.h ++++ b/drivers/i2c/busses/i2c-designware-core.h +@@ -60,6 +60,7 @@ + * @adapter: i2c subsystem adapter node + * @tx_fifo_depth: depth of the hardware tx fifo + * @rx_fifo_depth: depth of the hardware rx fifo ++ * @rx_outstanding: current master-rx elements in tx fifo + */ + struct dw_i2c_dev { + struct device *dev; +@@ -88,6 +89,7 @@ struct dw_i2c_dev { + u32 master_cfg; + unsigned int tx_fifo_depth; + unsigned int rx_fifo_depth; ++ int rx_outstanding; + }; + + #define ACCESS_SWAP 0x00000001 diff --git a/queue-3.9/series b/queue-3.9/series index 71cdff75656..48b243e5980 100644 --- a/queue-3.9/series +++ b/queue-3.9/series @@ -1,3 +1,9 @@ arm64-debug-clear-mdscr_el1-instead-of-taking-the-os-lock.patch arm64-mm-fix-operands-of-clz-in-__flush_dcache_all.patch btrfs-don-t-stop-searching-after-encountering-the-wrong-item.patch +hwmon-fix-error-return-code-in-abituguru_probe.patch +i2c-designware-fix-rx-fifo-overrun.patch +i2c-designware-always-clear-interrupts-before-enabling-them.patch +x86-fix-bit-corruption-at-cpu-resume-time.patch +drm-nouveau-bios-fix-thinko-in-zm_mask_add-opcode.patch +drm-radeon-fix-vram-size-calculation-for-vram-4gb.patch diff --git a/queue-3.9/x86-fix-bit-corruption-at-cpu-resume-time.patch b/queue-3.9/x86-fix-bit-corruption-at-cpu-resume-time.patch new file mode 100644 index 00000000000..ee4d85a6d79 --- /dev/null +++ b/queue-3.9/x86-fix-bit-corruption-at-cpu-resume-time.patch @@ -0,0 +1,40 @@ +From 5e427ec2d066b48a5c27b3a5a3315f7e4e729077 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Mon, 20 May 2013 11:36:03 -0700 +Subject: x86: Fix bit corruption at CPU resume time + +From: Linus Torvalds + +commit 5e427ec2d066b48a5c27b3a5a3315f7e4e729077 upstream. + +In commit 78d77df71510 ("x86-64, init: Do not set NX bits on non-NX +capable hardware") we added the early_pmd_flags that gets the NX bit set +when a CPU supports NX. However, the new variable was marked __initdata, +because the main _use_ of this is in an __init routine. + +However, the bit setting happens from secondary_startup_64(), which is +called not only at bootup, but on every secondary CPU start. Including +resuming from STR and at CPU hotplug time. So the value cannot be +__initdata. + +Reported-bisected-and-tested-by: Michal Hocko +Acked-by: Peter Anvin +Cc: Fernando Luis Vázquez Cao +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/head64.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/kernel/head64.c ++++ b/arch/x86/kernel/head64.c +@@ -34,7 +34,7 @@ + extern pgd_t early_level4_pgt[PTRS_PER_PGD]; + extern pmd_t early_dynamic_pgts[EARLY_DYNAMIC_PAGE_TABLES][PTRS_PER_PMD]; + static unsigned int __initdata next_early_pgt = 2; +-pmdval_t __initdata early_pmd_flags = __PAGE_KERNEL_LARGE & ~(_PAGE_GLOBAL | _PAGE_NX); ++pmdval_t early_pmd_flags = __PAGE_KERNEL_LARGE & ~(_PAGE_GLOBAL | _PAGE_NX); + + /* Wipe all early page tables except for the kernel symbol map */ + static void __init reset_early_page_tables(void) -- 2.47.3