Skip to contentSkip to conversation

2.6.37.2-stable review

PATCH In review Greg KH 6 participants 81 messages Feb 22, 2011 – Feb 25, 2011

Subsystems (50)
lore
Share & tools
lore

Greg KH

author
#0 lore raw

cover 2.6.37.2-stable review

This is the start of the stable review cycle for the 2.6.37.2 release. There are 70 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let us know. If anyone is a maintainer of the proper subsystem, and wants to add a Signed-off-by: line to the patch, please respond with it.

Responses should be made by Thursday, Feb 24 22:00:00 UTC 2011. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

	kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.37.2-rc1.gz

and the diffstat can be found below.

thanks,

greg k-h

 Documentation/hwmon/jc42                     |   21 ++++++++---
 Documentation/hwmon/k10temp                  |    8 ++++-
 Makefile                                     |    2 +-
 arch/arm/kernel/signal.c                     |    4 ++-
 arch/arm/kernel/vmlinux.lds.S                |    9 +++++
 arch/arm/mach-sa1100/simpad.c                |    7 ++--
 arch/s390/include/asm/processor.h            |    5 ---
 arch/s390/kernel/traps.c                     |   37 --------------------
 arch/x86/include/asm/cpu.h                   |    1 +
 arch/x86/kernel/apb_timer.c                  |    8 +++--
 arch/x86/kernel/irq_32.c                     |    7 +---
 arch/x86/kernel/process.c                    |    5 ++-
 arch/x86/kernel/smpboot.c                    |    3 +-
 arch/x86/xen/mmu.c                           |   12 ++++++
 drivers/acpi/wakeup.c                        |    6 +++-
 drivers/char/tpm/tpm.c                       |   18 +---------
 drivers/char/tpm/tpm.h                       |    2 -
 drivers/char/tpm/tpm_tis.c                   |    4 +--
 drivers/gpu/drm/i915/intel_dp.c              |   27 ++++++++++++--
 drivers/gpu/drm/i915/intel_sdvo.c            |   32 +++++++++++++++---
 drivers/gpu/drm/nouveau/Kconfig              |    2 +-
 drivers/gpu/drm/radeon/atombios_crtc.c       |   46 ++++++++-----------------
 drivers/gpu/drm/radeon/r600_cs.c             |   46 ++++++++++++++-----------
 drivers/gpu/drm/radeon/radeon_combios.c      |   47 ++++++++++++++++++++++++++
 drivers/gpu/drm/radeon/radeon_display.c      |   10 +++++
 drivers/gpu/drm/radeon/radeon_encoders.c     |   20 ++++++++---
 drivers/gpu/drm/radeon/radeon_mode.h         |    1 +
 drivers/gpu/drm/radeon/radeon_ttm.c          |    4 +-
 drivers/hid/hid-cando.c                      |    2 +
 drivers/hid/hid-core.c                       |    2 +
 drivers/hid/hid-ids.h                        |    1 +
 drivers/hid/hid-magicmouse.c                 |    5 +++
 drivers/hid/hid-mosart.c                     |    1 +
 drivers/hid/usbhid/hid-quirks.c              |    1 -
 drivers/hwmon/Kconfig                        |   19 +++++-----
 drivers/hwmon/jc42.c                         |   35 ++++++++++++++++---
 drivers/hwmon/k10temp.c                      |    5 ++-
 drivers/hwmon/lm85.c                         |   23 +++++++++++-
 drivers/media/dvb/ttpci/av7110_ca.c          |    2 +-
 drivers/media/radio/radio-aimslab.c          |    1 +
 drivers/message/fusion/mptctl.c              |    8 ++++
 drivers/message/fusion/mptscsih.c            |    7 ++--
 drivers/net/can/janz-ican3.c                 |    2 +-
 drivers/net/wireless/iwlwifi/iwl-3945.c      |    1 -
 drivers/pci/pci-sysfs.c                      |    3 +-
 drivers/pcmcia/pcmcia_resource.c             |    2 +
 drivers/platform/x86/acer-wmi.c              |    4 +-
 drivers/platform/x86/asus_acpi.c             |    8 +----
 drivers/platform/x86/tc1100-wmi.c            |    2 +-
 drivers/staging/brcm80211/sys/wlc_mac80211.c |    1 -
 drivers/tty/vt/vt.c                          |    9 ++++-
 fs/btrfs/ioctl.c                             |   10 ++++-
 fs/cifs/netmisc.c                            |    8 ++--
 fs/cifs/sess.c                               |    8 ++--
 fs/ecryptfs/inode.c                          |    2 +
 fs/file_table.c                              |    2 +-
 fs/nfsd/nfs4xdr.c                            |    8 ++--
 fs/nfsd/vfs.c                                |    2 +-
 fs/partitions/mac.c                          |   17 +++++----
 fs/proc/array.c                              |    3 --
 fs/xfs/quota/xfs_qm.c                        |   46 +++++++++++--------------
 include/linux/pci_ids.h                      |    1 +
 include/linux/security.h                     |    6 ++--
 include/pcmcia/ds.h                          |    1 +
 kernel/capability.c                          |    2 +-
 kernel/cred.c                                |   16 +++++---
 kernel/irq/internals.h                       |    6 +++
 kernel/irq/irqdesc.c                         |   11 +++++-
 kernel/irq/manage.c                          |    2 +-
 kernel/irq/resend.c                          |    2 +-
 kernel/perf_event.c                          |   19 ++++++++--
 kernel/power/snapshot.c                      |    7 +---
 kernel/workqueue.c                           |   13 ++++++-
 net/core/dev.c                               |    2 +
 net/netfilter/nf_conntrack_netlink.c         |   15 +++-----
 security/security.c                          |    5 +--
 security/selinux/hooks.c                     |    6 +++-
 sound/pci/hda/hda_intel.c                    |    1 +
 sound/pci/hda/patch_conexant.c               |    2 +-
 sound/soc/codecs/wm8903.c                    |    2 +-
 sound/usb/caiaq/audio.c                      |    2 +-
 sound/usb/caiaq/midi.c                       |    2 +-
 tools/perf/builtin-timechart.c               |    2 +-
 83 files changed, 482 insertions(+), 287 deletions(-)
author
#1 lore raw

PATCH 1/70 NFSD: memory corruption due to writing beyond the stat array

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Konstantin Khorenko <[email protected]>

commit 3aa6e0aa8ab3e64bbfba092c64d42fd1d006b124 upstream.

If nfsd fails to find an exported via NFS file in the readahead cache, it should increment corresponding nfsdstats counter (ra_depth[10]), but due to a bug it may instead write to ra_depth[11], corrupting the following field.

In a kernel with NFSDv4 compiled in the corruption takes the form of an increment of a counter of the number of NFSv4 operation 0's received; since there is no operation 0, this is harmless.

In a kernel with NFSDv4 disabled it corrupts whatever happens to be in the memory beyond nfsdstats.

---
 fs/nfsd/vfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/vfs.c +1 -1
@@ -809,7 +809,7 @@ nfsd_get_raparms(dev_t dev, ino_t ino)
 		if (ra->p_count == 0)
 			frap = rap;
 	}
-	depth = nfsdstats.ra_size*11/10;
+	depth = nfsdstats.ra_size;
 	if (!frap) {	
 		spin_unlock(&rab->pb_lock);
 		return NULL;
author
#2 lore raw

PATCH 2/70 mptfusion: mptctl_release is required in mptctl.c

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Kashyap, Desai <[email protected]>

commit 84857c8bf83e8aa87afc57d2956ba01f11d82386 upstream.

Added missing release callback for file_operations mptctl_fops. Without release callback there will be never freed. It remains on mptctl's eent list even after the file is closed and released.

Relavent RHEL bugzilla is 660871

---
 drivers/message/fusion/mptctl.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/message/fusion/mptctl.c +8 -0
@@ -597,6 +597,13 @@ mptctl_event_process(MPT_ADAPTER *ioc, E
 }
 
 static int
+mptctl_release(struct inode *inode, struct file *filep)
+{
+	fasync_helper(-1, filep, 0, &async_queue);
+	return 0;
+}
+
+static int
 mptctl_fasync(int fd, struct file *filep, int mode)
 {
 	MPT_ADAPTER	*ioc;
@@ -2815,6 +2822,7 @@ static const struct file_operations mptc
 	.llseek =	no_llseek,
 	.fasync = 	mptctl_fasync,
 	.unlocked_ioctl = mptctl_ioctl,
+	.release =	mptctl_release,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl = compat_mpctl_ioctl,
 #endif
author
#3 lore raw

PATCH 3/70 mptfusion: Fix Incorrect return value in mptscsih_dev_reset

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Kashyap, Desai <[email protected]>

commit bcfe42e98047f1935c5571c8ea77beb2d43ec19d upstream.

There's a branch at the end of this function that is supposed to normalize the return value with what the mid-layer expects. In this one case, we get it wrong.

Also increase the verbosity of the INFO level printk at the end of mptscsih_abort to include the actual return value and the scmd->serial_number. The reason being success or failure is actually determined by the state of
the internal tag list when a TMF is issued, and not the return value of the TMF cmd. The serial_number is also used in this decision, thus it's useful to know for debugging purposes.

---
 drivers/message/fusion/mptscsih.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/message/fusion/mptscsih.c +4 -3
@@ -1873,8 +1873,9 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
 	}
 
  out:
-	printk(MYIOC_s_INFO_FMT "task abort: %s (sc=%p)\n",
-	    ioc->name, ((retval == SUCCESS) ? "SUCCESS" : "FAILED"), SCpnt);
+	printk(MYIOC_s_INFO_FMT "task abort: %s (rv=%04x) (sc=%p) (sn=%ld)\n",
+	    ioc->name, ((retval == SUCCESS) ? "SUCCESS" : "FAILED"), retval,
+	    SCpnt, SCpnt->serial_number);
 
 	return retval;
 }
@@ -1911,7 +1912,7 @@ mptscsih_dev_reset(struct scsi_cmnd * SC
 
 	vdevice = SCpnt->device->hostdata;
 	if (!vdevice || !vdevice->vtarget) {
-		retval = SUCCESS;
+		retval = 0;
 		goto out;
 	}
 
author
#4 lore raw

PATCH 4/70 drm/i915/sdvo: If we have an EDID confirm it matches the mode of the connection

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Chris Wilson <[email protected]>

commit 139467433e50926d22338e9dc754feaaf94b9db0 upstream.

If we have an EDID for a digital panel, but we are probing a non-TMDS connector then we know that this is a false detection, and vice versa. This should reduce the number of bogus outputs on multi-function adapters that report the same output on multiple connectors.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34101

---
 drivers/gpu/drm/i915/intel_sdvo.c |   32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_sdvo.c +27 -5
@@ -46,6 +46,7 @@
                          SDVO_TV_MASK)
 
 #define IS_TV(c)	(c->output_flag & SDVO_TV_MASK)
+#define IS_TMDS(c)	(c->output_flag & SDVO_TMDS_MASK)
 #define IS_LVDS(c)	(c->output_flag & SDVO_LVDS_MASK)
 #define IS_TV_OR_LVDS(c) (c->output_flag & (SDVO_TV_MASK | SDVO_LVDS_MASK))
 
@@ -1356,7 +1357,8 @@ intel_sdvo_hdmi_sink_detect(struct drm_c
 				intel_sdvo->has_hdmi_monitor = drm_detect_hdmi_monitor(edid);
 				intel_sdvo->has_hdmi_audio = drm_detect_monitor_audio(edid);
 			}
-		}
+		} else
+			status = connector_status_disconnected;
 		connector->display_info.raw_edid = NULL;
 		kfree(edid);
 	}
@@ -1404,10 +1406,25 @@ intel_sdvo_detect(struct drm_connector *
 
 	if ((intel_sdvo_connector->output_flag & response) == 0)
 		ret = connector_status_disconnected;
-	else if (response & SDVO_TMDS_MASK)
+	else if (IS_TMDS(intel_sdvo_connector))
 		ret = intel_sdvo_hdmi_sink_detect(connector);
-	else
-		ret = connector_status_connected;
+	else {
+		struct edid *edid;
+
+		/* if we have an edid check it matches the connection */
+		edid = intel_sdvo_get_edid(connector);
+		if (edid == NULL)
+			edid = intel_sdvo_get_analog_edid(connector);
+		if (edid != NULL) {
+			if (edid->input & DRM_EDID_INPUT_DIGITAL)
+				ret = connector_status_disconnected;
+			else
+				ret = connector_status_connected;
+			connector->display_info.raw_edid = NULL;
+			kfree(edid);
+		} else
+			ret = connector_status_connected;
+	}
 
 	/* May update encoder flag for like clock for SDVO TV, etc.*/
 	if (ret == connector_status_connected) {
@@ -1443,10 +1460,15 @@ static void intel_sdvo_get_ddc_modes(str
 		edid = intel_sdvo_get_analog_edid(connector);
 
 	if (edid != NULL) {
-		if (edid->input & DRM_EDID_INPUT_DIGITAL) {
+		struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector);
+		bool monitor_is_digital = !!(edid->input & DRM_EDID_INPUT_DIGITAL);
+		bool connector_is_digital = !!IS_TMDS(intel_sdvo_connector);
+
+		if (connector_is_digital == monitor_is_digital) {
 			drm_mode_connector_update_edid_property(connector, edid);
 			drm_add_edid_modes(connector, edid);
 		}
+
 		connector->display_info.raw_edid = NULL;
 		kfree(edid);
 	}
author
#5 lore raw

PATCH 5/70 drm/radeon/kms: fix interlaced modes on dce4+

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Alex Deucher <[email protected]>

commit c9417bdd4c6b1b92a21608c07e83afa419c7bb62 upstream.

- set scaler table clears the interleave bit, need to reset it in encoder quirks, this was already done for pre-dce4.
- remove the interleave settings from set_base() functions this is now handled in the encoder quirks functions, and isn't technically part of the display base setup.
- rename evergreen_do_set_base() to dce4_do_set_base() since it's used on both evergreen and NI asics.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=28182

---
 drivers/gpu/drm/radeon/atombios_crtc.c   |   22 +++++-----------------
 drivers/gpu/drm/radeon/radeon_encoders.c |   20 +++++++++++++++-----
 2 files changed, 20 insertions(+), 22 deletions(-)
drivers/gpu/drm/radeon/atombios_crtc.c +5 -17
@@ -959,9 +959,9 @@ static void atombios_crtc_set_pll(struct
 	}
 }
 
-static int evergreen_crtc_do_set_base(struct drm_crtc *crtc,
-				      struct drm_framebuffer *fb,
-				      int x, int y, int atomic)
+static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
+				 struct drm_framebuffer *fb,
+				 int x, int y, int atomic)
 {
 	struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
 	struct drm_device *dev = crtc->dev;
@@ -1093,12 +1093,6 @@ static int evergreen_crtc_do_set_base(st
 	WREG32(EVERGREEN_VIEWPORT_SIZE + radeon_crtc->crtc_offset,
 	       (crtc->mode.hdisplay << 16) | crtc->mode.vdisplay);
 
-	if (crtc->mode.flags & DRM_MODE_FLAG_INTERLACE)
-		WREG32(EVERGREEN_DATA_FORMAT + radeon_crtc->crtc_offset,
-		       EVERGREEN_INTERLEAVE_EN);
-	else
-		WREG32(EVERGREEN_DATA_FORMAT + radeon_crtc->crtc_offset, 0);
-
 	if (!atomic && fb && fb != crtc->fb) {
 		radeon_fb = to_radeon_framebuffer(fb);
 		rbo = radeon_fb->obj->driver_private;
@@ -1247,12 +1241,6 @@ static int avivo_crtc_do_set_base(struct
 	WREG32(AVIVO_D1MODE_VIEWPORT_SIZE + radeon_crtc->crtc_offset,
 	       (crtc->mode.hdisplay << 16) | crtc->mode.vdisplay);
 
-	if (crtc->mode.flags & DRM_MODE_FLAG_INTERLACE)
-		WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset,
-		       AVIVO_D1MODE_INTERLEAVE_EN);
-	else
-		WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset, 0);
-
 	if (!atomic && fb && fb != crtc->fb) {
 		radeon_fb = to_radeon_framebuffer(fb);
 		rbo = radeon_fb->obj->driver_private;
@@ -1276,7 +1264,7 @@ int atombios_crtc_set_base(struct drm_cr
 	struct radeon_device *rdev = dev->dev_private;
 
 	if (ASIC_IS_DCE4(rdev))
-		return evergreen_crtc_do_set_base(crtc, old_fb, x, y, 0);
+		return dce4_crtc_do_set_base(crtc, old_fb, x, y, 0);
 	else if (ASIC_IS_AVIVO(rdev))
 		return avivo_crtc_do_set_base(crtc, old_fb, x, y, 0);
 	else
@@ -1291,7 +1279,7 @@ int atombios_crtc_set_base_atomic(struct
        struct radeon_device *rdev = dev->dev_private;
 
 	if (ASIC_IS_DCE4(rdev))
-		return evergreen_crtc_do_set_base(crtc, fb, x, y, 1);
+		return dce4_crtc_do_set_base(crtc, fb, x, y, 1);
 	else if (ASIC_IS_AVIVO(rdev))
 		return avivo_crtc_do_set_base(crtc, fb, x, y, 1);
 	else
drivers/gpu/drm/radeon/radeon_encoders.c +15 -5
@@ -1465,11 +1465,21 @@ atombios_apply_encoder_quirks(struct drm
 	}
 
 	/* set scaler clears this on some chips */
-	/* XXX check DCE4 */
-	if (!(radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT))) {
-		if (ASIC_IS_AVIVO(rdev) && (mode->flags & DRM_MODE_FLAG_INTERLACE))
-			WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset,
-			       AVIVO_D1MODE_INTERLEAVE_EN);
+	if (ASIC_IS_AVIVO(rdev) &&
+	    (!(radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)))) {
+		if (ASIC_IS_DCE4(rdev)) {
+			if (mode->flags & DRM_MODE_FLAG_INTERLACE)
+				WREG32(EVERGREEN_DATA_FORMAT + radeon_crtc->crtc_offset,
+				       EVERGREEN_INTERLEAVE_EN);
+			else
+				WREG32(EVERGREEN_DATA_FORMAT + radeon_crtc->crtc_offset, 0);
+		} else {
+			if (mode->flags & DRM_MODE_FLAG_INTERLACE)
+				WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset,
+				       AVIVO_D1MODE_INTERLEAVE_EN);
+			else
+				WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset, 0);
+		}
 	}
 }
 
author
#6 lore raw

PATCH 6/70 drm/radeon: fix memory debugging since d961db75ce86a84f1f04e91ad1014653ed7d9f46

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Dave Airlie <[email protected]>

commit 16f9fdcbcce74102bed9a4b7ccc1fb05b5dd6ca3 upstream.

The old code dereferenced a value, the new code just needs to pass the ptr.

fixes an oops looking at files in debugfs.

---
 drivers/gpu/drm/radeon/radeon_ttm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_ttm.c +2 -2
@@ -787,9 +787,9 @@ static int radeon_ttm_debugfs_init(struc
 		radeon_mem_types_list[i].show = &radeon_mm_dump_table;
 		radeon_mem_types_list[i].driver_features = 0;
 		if (i == 0)
-			radeon_mem_types_list[i].data = &rdev->mman.bdev.man[TTM_PL_VRAM].priv;
+			radeon_mem_types_list[i].data = rdev->mman.bdev.man[TTM_PL_VRAM].priv;
 		else
-			radeon_mem_types_list[i].data = &rdev->mman.bdev.man[TTM_PL_TT].priv;
+			radeon_mem_types_list[i].data = rdev->mman.bdev.man[TTM_PL_TT].priv;
 
 	}
 	/* Add ttm page pool to debugfs */
author
#7 lore raw

PATCH 7/70 drm/radeon/kms: add connector table for mac g5 9600

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Alex Deucher <[email protected]>

commit 9fad321ac6bedd96f449754a1a25289ea1789a49 upstream.

PPC Mac cards do not provide connector tables in their vbios. Their connector/encoder configurations must be hardcoded in the driver.

verified by nyef on #radeon

---
 drivers/gpu/drm/radeon/radeon_combios.c |   47 ++++++++++++++++++++++++++++++++
 drivers/gpu/drm/radeon/radeon_mode.h    |    1 
 2 files changed, 48 insertions(+)
drivers/gpu/drm/radeon/radeon_combios.c +47 -0
@@ -1503,6 +1503,11 @@ bool radeon_get_legacy_connector_info_fr
 			   (rdev->pdev->subsystem_device == 0x4a48)) {
 			/* Mac X800 */
 			rdev->mode_info.connector_table = CT_MAC_X800;
+		} else if ((rdev->pdev->device == 0x4150) &&
+			   (rdev->pdev->subsystem_vendor == 0x1002) &&
+			   (rdev->pdev->subsystem_device == 0x4150)) {
+			/* Mac G5 9600 */
+			rdev->mode_info.connector_table = CT_MAC_G5_9600;
 		} else
 #endif /* CONFIG_PPC_PMAC */
 #ifdef CONFIG_PPC64
@@ -2021,6 +2026,48 @@ bool radeon_get_legacy_connector_info_fr
 					    CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I,
 					    &hpd);
 		break;
+	case CT_MAC_G5_9600:
+		DRM_INFO("Connector Table: %d (mac g5 9600)\n",
+			 rdev->mode_info.connector_table);
+		/* DVI - tv dac, dvo */
+		ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
+		hpd.hpd = RADEON_HPD_1; /* ??? */
+		radeon_add_legacy_encoder(dev,
+					  radeon_get_encoder_enum(dev,
+								  ATOM_DEVICE_DFP2_SUPPORT,
+								  0),
+					  ATOM_DEVICE_DFP2_SUPPORT);
+		radeon_add_legacy_encoder(dev,
+					  radeon_get_encoder_enum(dev,
+								  ATOM_DEVICE_CRT2_SUPPORT,
+								  2),
+					  ATOM_DEVICE_CRT2_SUPPORT);
+		radeon_add_legacy_connector(dev, 0,
+					    ATOM_DEVICE_DFP2_SUPPORT |
+					    ATOM_DEVICE_CRT2_SUPPORT,
+					    DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
+					    CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I,
+					    &hpd);
+		/* ADC - primary dac, internal tmds */
+		ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
+		hpd.hpd = RADEON_HPD_2; /* ??? */
+		radeon_add_legacy_encoder(dev,
+					  radeon_get_encoder_enum(dev,
+								  ATOM_DEVICE_DFP1_SUPPORT,
+								  0),
+					  ATOM_DEVICE_DFP1_SUPPORT);
+		radeon_add_legacy_encoder(dev,
+					  radeon_get_encoder_enum(dev,
+								  ATOM_DEVICE_CRT1_SUPPORT,
+								  1),
+					  ATOM_DEVICE_CRT1_SUPPORT);
+		radeon_add_legacy_connector(dev, 1,
+					    ATOM_DEVICE_DFP1_SUPPORT |
+					    ATOM_DEVICE_CRT1_SUPPORT,
+					    DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
+					    CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I,
+					    &hpd);
+		break;
 	default:
 		DRM_INFO("Connector table: %d (invalid)\n",
 			 rdev->mode_info.connector_table);
drivers/gpu/drm/radeon/radeon_mode.h +1 -0
@@ -209,6 +209,7 @@ enum radeon_connector_table {
 	CT_EMAC,
 	CT_RN50_POWER,
 	CT_MAC_X800,
+	CT_MAC_G5_9600,
 };
 
 enum radeon_dvo_chip {
author
#8 lore raw

PATCH 8/70 drm/radeon/kms: improve 6xx/7xx CS error output

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Alex Deucher <[email protected]>

commit c2049b3d29f47ed3750226dc51251a3404c85876 upstream.

Makes debugging CS rejections much easier.

---
 drivers/gpu/drm/radeon/r600_cs.c |   46 ++++++++++++++++++++++-----------------
 1 file changed, 26 insertions(+), 20 deletions(-)
drivers/gpu/drm/radeon/r600_cs.c +26 -20
@@ -295,17 +295,18 @@ static inline int r600_cs_track_validate
 	}
 
 	if (!IS_ALIGNED(pitch, pitch_align)) {
-		dev_warn(p->dev, "%s:%d cb pitch (%d) invalid\n",
-			 __func__, __LINE__, pitch);
+		dev_warn(p->dev, "%s:%d cb pitch (%d, 0x%x, %d) invalid\n",
+			 __func__, __LINE__, pitch, pitch_align, array_mode);
 		return -EINVAL;
 	}
 	if (!IS_ALIGNED(height, height_align)) {
-		dev_warn(p->dev, "%s:%d cb height (%d) invalid\n",
-			 __func__, __LINE__, height);
+		dev_warn(p->dev, "%s:%d cb height (%d, 0x%x, %d) invalid\n",
+			 __func__, __LINE__, height, height_align, array_mode);
 		return -EINVAL;
 	}
 	if (!IS_ALIGNED(base_offset, base_align)) {
-		dev_warn(p->dev, "%s offset[%d] 0x%llx not aligned\n", __func__, i, base_offset);
+		dev_warn(p->dev, "%s offset[%d] 0x%llx 0x%llx, %d not aligned\n", __func__, i,
+			 base_offset, base_align, array_mode);
 		return -EINVAL;
 	}
 
@@ -320,7 +321,10 @@ static inline int r600_cs_track_validate
 			 * broken userspace.
 			 */
 		} else {
-			dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i]));
+			dev_warn(p->dev, "%s offset[%d] %d %d %d %lu too big\n", __func__, i,
+				 array_mode,
+				 track->cb_color_bo_offset[i], tmp,
+				 radeon_bo_size(track->cb_color_bo[i]));
 			return -EINVAL;
 		}
 	}
@@ -455,17 +459,18 @@ static int r600_cs_track_check(struct ra
 			}
 
 			if (!IS_ALIGNED(pitch, pitch_align)) {
-				dev_warn(p->dev, "%s:%d db pitch (%d) invalid\n",
-					 __func__, __LINE__, pitch);
+				dev_warn(p->dev, "%s:%d db pitch (%d, 0x%x, %d) invalid\n",
+					 __func__, __LINE__, pitch, pitch_align, array_mode);
 				return -EINVAL;
 			}
 			if (!IS_ALIGNED(height, height_align)) {
-				dev_warn(p->dev, "%s:%d db height (%d) invalid\n",
-					 __func__, __LINE__, height);
+				dev_warn(p->dev, "%s:%d db height (%d, 0x%x, %d) invalid\n",
+					 __func__, __LINE__, height, height_align, array_mode);
 				return -EINVAL;
 			}
 			if (!IS_ALIGNED(base_offset, base_align)) {
-				dev_warn(p->dev, "%s offset[%d] 0x%llx not aligned\n", __func__, i, base_offset);
+				dev_warn(p->dev, "%s offset[%d] 0x%llx, 0x%llx, %d not aligned\n", __func__, i,
+					 base_offset, base_align, array_mode);
 				return -EINVAL;
 			}
 
@@ -473,9 +478,10 @@ static int r600_cs_track_check(struct ra
 			nviews = G_028004_SLICE_MAX(track->db_depth_view) + 1;
 			tmp = ntiles * bpe * 64 * nviews;
 			if ((tmp + track->db_offset) > radeon_bo_size(track->db_bo)) {
-				dev_warn(p->dev, "z/stencil buffer too small (0x%08X %d %d %d -> %u have %lu)\n",
-						track->db_depth_size, ntiles, nviews, bpe, tmp + track->db_offset,
-						radeon_bo_size(track->db_bo));
+				dev_warn(p->dev, "z/stencil buffer (%d) too small (0x%08X %d %d %d -> %u have %lu)\n",
+					 array_mode,
+					 track->db_depth_size, ntiles, nviews, bpe, tmp + track->db_offset,
+					 radeon_bo_size(track->db_bo));
 				return -EINVAL;
 			}
 		}
@@ -1227,18 +1233,18 @@ static inline int r600_check_texture_res
 	/* XXX check height as well... */
 
 	if (!IS_ALIGNED(pitch, pitch_align)) {
-		dev_warn(p->dev, "%s:%d tex pitch (%d) invalid\n",
-			 __func__, __LINE__, pitch);
+		dev_warn(p->dev, "%s:%d tex pitch (%d, 0x%x, %d) invalid\n",
+			 __func__, __LINE__, pitch, pitch_align, G_038000_TILE_MODE(word0));
 		return -EINVAL;
 	}
 	if (!IS_ALIGNED(base_offset, base_align)) {
-		dev_warn(p->dev, "%s:%d tex base offset (0x%llx) invalid\n",
-			 __func__, __LINE__, base_offset);
+		dev_warn(p->dev, "%s:%d tex base offset (0x%llx, 0x%llx, %d) invalid\n",
+			 __func__, __LINE__, base_offset, base_align, G_038000_TILE_MODE(word0));
 		return -EINVAL;
 	}
 	if (!IS_ALIGNED(mip_offset, base_align)) {
-		dev_warn(p->dev, "%s:%d tex mip offset (0x%llx) invalid\n",
-			 __func__, __LINE__, mip_offset);
+		dev_warn(p->dev, "%s:%d tex mip offset (0x%llx, 0x%llx, %d) invalid\n",
+			 __func__, __LINE__, mip_offset, base_align, G_038000_TILE_MODE(word0));
 		return -EINVAL;
 	}
 
author
#9 lore raw

PATCH 9/70 drm/radeon/kms: add bounds checking to avivo pll algo

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Alex Deucher <[email protected]>

commit a4b40d5d97f5c9ad0b7f4bf2818291ca184bb433 upstream.

Prevent divider overflow.
Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=28932

---
 drivers/gpu/drm/radeon/radeon_display.c |   10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/gpu/drm/radeon/radeon_display.c +10 -0
@@ -461,6 +461,11 @@ static void avivo_get_fb_div(struct rade
 	tmp *= target_clock;
 	*fb_div = tmp / pll->reference_freq;
 	*frac_fb_div = tmp % pll->reference_freq;
+
+        if (*fb_div > pll->max_feedback_div)
+		*fb_div = pll->max_feedback_div;
+        else if (*fb_div < pll->min_feedback_div)
+                *fb_div = pll->min_feedback_div;
 }
 
 static u32 avivo_get_post_div(struct radeon_pll *pll,
@@ -494,6 +499,11 @@ static u32 avivo_get_post_div(struct rad
 			post_div--;
 	}
 
+	if (post_div > pll->max_post_div)
+		post_div = pll->max_post_div;
+	else if (post_div < pll->min_post_div)
+		post_div = pll->min_post_div;
+
 	return post_div;
 }
 
author
#10 lore raw

PATCH 10/70 drm/radeon/kms: hopefully fix pll issues for real (v3)

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Alex Deucher <[email protected]>

commit 5b40ddf888398ce4cccbf3b9d0a18d90149ed7ff upstream.

The problematic boards have a recommended reference divider to be used when spread spectrum is enabled on the laptop panel. Enable the use of the recommended reference divider along with the new pll algo.

v2: testing options

v3: When using the fixed reference divider with LVDS, prefer min m to max p and use fractional feedback dividers.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=28852
https://bugzilla.kernel.org/show_bug.cgi?id=24462
https://bugzilla.kernel.org/show_bug.cgi?id=26552
MacbookPro issues reported by Justin Mattock <[email protected]>

---
 drivers/gpu/drm/radeon/atombios_crtc.c |   22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)
drivers/gpu/drm/radeon/atombios_crtc.c +8 -14
@@ -514,7 +514,6 @@ static u32 atombios_adjust_pll(struct dr
 			pll->flags |= RADEON_PLL_PREFER_HIGH_FB_DIV;
 		else
 			pll->flags |= RADEON_PLL_PREFER_LOW_REF_DIV;
-
 	}
 
 	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
@@ -531,29 +530,28 @@ static u32 atombios_adjust_pll(struct dr
 					dp_clock = dig_connector->dp_clock;
 				}
 			}
-/* this might work properly with the new pll algo */
-#if 0 /* doesn't work properly on some laptops */
+
 			/* use recommended ref_div for ss */
 			if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
+				pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
 				if (ss_enabled) {
 					if (ss->refdiv) {
 						pll->flags |= RADEON_PLL_USE_REF_DIV;
 						pll->reference_div = ss->refdiv;
+						if (ASIC_IS_AVIVO(rdev))
+							pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV;
 					}
 				}
 			}
-#endif
+
 			if (ASIC_IS_AVIVO(rdev)) {
 				/* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */
 				if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1)
 					adjusted_clock = mode->clock * 2;
 				if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT))
 					pll->flags |= RADEON_PLL_PREFER_CLOSEST_LOWER;
-				/* rv515 needs more testing with this option */
-				if (rdev->family != CHIP_RV515) {
-					if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT))
-						pll->flags |= RADEON_PLL_IS_LCD;
-				}
+				if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT))
+					pll->flags |= RADEON_PLL_IS_LCD;
 			} else {
 				if (encoder->encoder_type != DRM_MODE_ENCODER_DAC)
 					pll->flags |= RADEON_PLL_NO_ODD_POST_DIV;
@@ -921,11 +919,7 @@ static void atombios_crtc_set_pll(struct
 	/* adjust pixel clock as needed */
 	adjusted_clock = atombios_adjust_pll(crtc, mode, pll, ss_enabled, &ss);
 
-	/* rv515 seems happier with the old algo */
-	if (rdev->family == CHIP_RV515)
-		radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
-					  &ref_div, &post_div);
-	else if (ASIC_IS_AVIVO(rdev))
+	if (ASIC_IS_AVIVO(rdev))
 		radeon_compute_pll_avivo(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
 					 &ref_div, &post_div);
 	else
author
#11 lore raw

PATCH 11/70 drm/nouveau: Only select ACPI_VIDEO if its dependencies are met

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Ben Hutchings <[email protected]>

commit c42988012ad9c1807b7c7a5ff855cd630094989b upstream.

CONFIG_ACPI_VIDEO depends on more than just CONFIG_ACPI, so add those dependencies to the Kconfig select condition. The case where some dependencies fail to be satisfied should be handled correctly, because in that case the ACPI_VIDEO symbols we use are converted into static-inline stubs.

---
 drivers/gpu/drm/nouveau/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/Kconfig +1 -1
@@ -10,7 +10,7 @@ config DRM_NOUVEAU
 	select FB
 	select FRAMEBUFFER_CONSOLE if !EMBEDDED
 	select FB_BACKLIGHT if DRM_NOUVEAU_BACKLIGHT
-	select ACPI_VIDEO if ACPI
+	select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT
 	help
 	  Choose this option for open-source nVidia support.
 
author
#12 lore raw

PATCH v3 20/70 av7110: check for negative array offset

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Dan Carpenter <[email protected]>

commit cb26a24ee9706473f31d34cc259f4dcf45cd0644 upstream.

info->num comes from the user. It's type int. If the user passes in a negative value that would cause memory corruption.

---
 drivers/media/dvb/ttpci/av7110_ca.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb/ttpci/av7110_ca.c +1 -1
@@ -277,7 +277,7 @@ static int dvb_ca_ioctl(struct file *fil
 	{
 		ca_slot_info_t *info=(ca_slot_info_t *)parg;
 
-		if (info->num > 1)
+		if (info->num < 0 || info->num > 1)
 			return -EINVAL;
 		av7110->ci_slot[info->num].num = info->num;
 		av7110->ci_slot[info->num].type = FW_CI_LL_SUPPORT(av7110->arm_app) ?
author
#13 lore raw

PATCH 12/70 vt: fix issue when fbcon wants to takeover a second time.

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Dave Airlie <[email protected]>

commit c55c63c6539499379ab4a7e8a5c0f857351fb946 upstream.

With framebuffer handover and multiple GPUs, we get into a position where the fbcon unbinds the vesafb framebuffer for GPU 1, but we still have a radeon framebuffer bound from GPU 0, so we don't unregister the console driver. Then when we tried to bind the new radeon framebuffer for GPU1 we never get to the bind call as we fail due to the console being registered already.

This changes the return value to -EBUSY when the driver is already registered and continues to bind for -EBUSY.

---
 drivers/tty/vt/vt.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/tty/vt/vt.c +7 -2
@@ -3524,7 +3524,7 @@ int register_con_driver(const struct con
 
 		/* already registered */
 		if (con_driver->con == csw)
-			retval = -EINVAL;
+			retval = -EBUSY;
 	}
 
 	if (retval)
@@ -3635,7 +3635,12 @@ int take_over_console(const struct consw
 	int err;
 
 	err = register_con_driver(csw, first, last);
-
+	/* if we get an busy error we still want to bind the console driver
+	 * and return success, as we may have unbound the console driver
+	 * but not unregistered it.
+	*/
+	if (err == -EBUSY)
+		err = 0;
 	if (!err)
 		bind_con_driver(csw, first, last, deflt);
 
author
#14 lore raw

PATCH 13/70 ARM: 6606/1: sa1100: Fix platform device registration

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Jochen Friedrich <[email protected]>

commit 4f444e2b59dd4255d121b57ec41a4a8c5d6bce46 upstream.

Since commit 7a5b4e16c880f8350d255dc188f81622905618c1, simpad devices don't boot anymore, since platform devices are registered too early. Fix by moving the registration from map_io to arch_initcall as done on other sa1100 boards.

---
 arch/arm/mach-sa1100/simpad.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
arch/arm/mach-sa1100/simpad.c +4 -3
@@ -166,9 +166,6 @@ static void __init simpad_map_io(void)
 	PCFR = 0;
 	PSDR = 0;
 
-	sa11x0_register_mtd(&simpad_flash_data, simpad_flash_resources,
-			      ARRAY_SIZE(simpad_flash_resources));
-	sa11x0_register_mcp(&simpad_mcp_data);
 }
 
 static void simpad_power_off(void)
@@ -216,6 +213,10 @@ static int __init simpad_init(void)
 
 	pm_power_off = simpad_power_off;
 
+	sa11x0_register_mtd(&simpad_flash_data, simpad_flash_resources,
+			      ARRAY_SIZE(simpad_flash_resources));
+	sa11x0_register_mcp(&simpad_mcp_data);
+
 	ret = platform_add_devices(devices, ARRAY_SIZE(devices));
 	if(ret)
 		printk(KERN_WARNING "simpad: Unable to register mq200 framebuffer device");
author
#15 lore raw

PATCH 14/70 HID: magicmouse: Dont report REL_{X, Y} for Magic Trackpad

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Chase Douglas <[email protected]>

[ Linus' tree commit 6a66bbd693c12f71697c61207aa18bc5a12da0ab ]

With the recent switch to having the hid layer handle standard axis initialization, the Magic Trackpad now reports relative axes. This would be fine in the normal mode, but the driver puts the device in multitouch mode where no relative events are generated. Also, userspace software depends on accurate axis information for device type detection. Thus, ignoring the relative axes from the Magic Trackpad is best.

---
 drivers/hid/hid-magicmouse.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/hid/hid-magicmouse.c +5 -0
@@ -433,6 +433,11 @@ static int magicmouse_input_mapping(stru
 	if (!msc->input)
 		msc->input = hi->input;
 
+	/* Magic Trackpad does not give relative data after switching to MT */
+	if (hi->input->id.product == USB_DEVICE_ID_APPLE_MAGICTRACKPAD &&
+	    field->flags & HID_MAIN_ITEM_RELATIVE)
+		return -1;
+
 	return 0;
 }
 
author
#16 lore raw

PATCH 15/70 perf timechart: Adjust perf timechart to the new power events

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Thomas Renninger <[email protected]>

commit 20c457b8587bee4644d998331d9e13be82e05b4c upstream.

[This patch is part of mainline git commit 20c457b8587bee4644d9.
This should fix:
http://www.mail-archive.com/[email protected]/msg00057.html

The regression was introduced by git commit:
4c21adf26f8fcf86a755b9b9f55c2e9fd241e1fb]

builtin-timechart must only pass -e power:xy events if they are supported by the running kernel, otherwise try to fetch the old power:power{start,end} events.

For this I added the tiny helper function:

int is_valid_tracepoint(const char *event_string)

to parse-events.[hc], which could be more generic as an interface and support hardware/software/... events, not only tracepoints, but someone else could extend that if needed...

LKML-Reference: <[email protected]>

---
 tools/perf/builtin-timechart.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-timechart.c +1 -1
@@ -502,7 +502,7 @@ static int process_sample_event(event_t
 			c_state_start(pe->cpu_id, data.time, pe->value);
 
 		if (strcmp(event_str, "power:power_end") == 0)
-			c_state_end(pe->cpu_id, data.time);
+			c_state_end(data.cpu, data.time);
 
 		if (strcmp(event_str, "power:power_frequency") == 0)
 			p_state_change(pe->cpu_id, data.time, pe->value);
#17 lore raw

Re: [15/70] perf timechart: Adjust perf timechart to the new power events

Hi,

I should have split out this segfault fix.

Quoted 9 lines · On Tuesday 22 February 2011 23:16:54 Greg KH wrote:

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Thomas Renninger <[email protected]>

commit 20c457b8587bee4644d998331d9e13be82e05b4c upstream.

Quoted 7 lines

[This patch is part of mainline git commit 20c457b8587bee4644d9.
This should fix:
http://www.mail-archive.com/linux-perf-
[email protected]/msg00057.html

The regression was introduced by git commit:
4c21adf26f8fcf86a755b9b9f55c2e9fd241e1fb]

Above link is a nice pointer.
the rest of the changelog (below) does not fit and describes the mainline patch, the tiny fix was part of.

Don't know whether it's worth to touch it, but if, the changelog (or title) of the patch should be as short as:
perf: timechart (userspace): Do not segfault on power_end events

Thomas

Quoted 1 line

builtin-timechart must only pass -e power:xy events if they are

supported by

Quoted 1 line

the running kernel, otherwise try to fetch the old

power:power{start,end}

Quoted 7 lines

events.

For this I added the tiny helper function:

int is_valid_tracepoint(const char *event_string)

to parse-events.[hc], which could be more generic as an interface and

support

Quoted 1 line

hardware/software/... events, not only tracepoints, but someone else

could

Quoted 27 lines

extend that if needed...

LKML-Reference: <[email protected]>

---
 tools/perf/builtin-timechart.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-timechart.c +1 -1
@@ -502,7 +502,7 @@ static int process_sample_event(event_t
 			c_state_start(pe->cpu_id, data.time, pe->value);
 
 		if (strcmp(event_str, "power:power_end") == 0)
-			c_state_end(pe->cpu_id, data.time);
+			c_state_end(data.cpu, data.time);
 
 		if (strcmp(event_str, "power:power_frequency") == 0)
 			p_state_change(pe->cpu_id, data.time, pe->value);
author
#18 lore raw

Re: [15/70] perf timechart: Adjust perf timechart to the new power events

Quoted 21 lines · Thomas Renninger

Hi,

I should have split out this segfault fix.

Quoted 9 lines · On Tuesday 22 February 2011 23:16:54 Greg KH wrote:

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Thomas Renninger <[email protected]>

commit 20c457b8587bee4644d998331d9e13be82e05b4c upstream.

Quoted 7 lines

[This patch is part of mainline git commit 20c457b8587bee4644d9.
This should fix:
http://www.mail-archive.com/linux-perf-
[email protected]/msg00057.html

The regression was introduced by git commit:
4c21adf26f8fcf86a755b9b9f55c2e9fd241e1fb]

Quoted 7 lines

Above link is a nice pointer.
the rest of the changelog (below) does not fit and describes the mainline patch, the tiny fix was part of.

Don't know whether it's worth to touch it, but if, the changelog (or title) of the patch should be as short as:
perf: timechart (userspace): Do not segfault on power_end events

I'll leave it as-is as I like to keep the commit messages as close as possible.

thanks,

greg k-h

author
#19 lore raw

PATCH 16/70 x86: Clear irqstack thread_info

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Brian Gerst <[email protected]>

commit 7b698ea377e10b074ceef0d79218e6622d618421 upstream.

Mathias Merz reported that v2.6.37 failed to boot on his system.

Make sure that the thread_info part of the irqstack is initialized to zeroes.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/irq_32.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
arch/x86/kernel/irq_32.c +2 -5
@@ -129,8 +129,7 @@ void __cpuinit irq_ctx_init(int cpu)
 	irqctx = page_address(alloc_pages_node(cpu_to_node(cpu),
 					       THREAD_FLAGS,
 					       THREAD_ORDER));
-	irqctx->tinfo.task		= NULL;
-	irqctx->tinfo.exec_domain	= NULL;
+	memset(&irqctx->tinfo, 0, sizeof(struct thread_info));
 	irqctx->tinfo.cpu		= cpu;
 	irqctx->tinfo.preempt_count	= HARDIRQ_OFFSET;
 	irqctx->tinfo.addr_limit	= MAKE_MM_SEG(0);
@@ -140,10 +139,8 @@ void __cpuinit irq_ctx_init(int cpu)
 	irqctx = page_address(alloc_pages_node(cpu_to_node(cpu),
 					       THREAD_FLAGS,
 					       THREAD_ORDER));
-	irqctx->tinfo.task		= NULL;
-	irqctx->tinfo.exec_domain	= NULL;
+	memset(&irqctx->tinfo, 0, sizeof(struct thread_info));
 	irqctx->tinfo.cpu		= cpu;
-	irqctx->tinfo.preempt_count	= 0;
 	irqctx->tinfo.addr_limit	= MAKE_MM_SEG(0);
 
 	per_cpu(softirq_ctx, cpu) = irqctx;
author
#20 lore raw

PATCH 17/70 drm/i915: make DP training try a little harder

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Jesse Barnes <[email protected]>

commit 37f809755845cc3e18e8216c04525bdb885fa13b upstream.

When trying to do channel equalization, we need to make sure we still have clock recovery on all lanes while training. We also need to try clock recovery again if we lose the clock or if channel eq fails 5 times. We'll try clock recovery up to 5 more times before giving up entirely.

Gets suspend/resume working on my Vaio again and brings us back into compliance with the DP training sequence spec.

---
 drivers/gpu/drm/i915/intel_dp.c |   27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +23 -4
@@ -1343,17 +1343,24 @@ intel_dp_complete_link_train(struct inte
 	struct drm_device *dev = intel_dp->base.base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	bool channel_eq = false;
-	int tries;
+	int tries, cr_tries;
 	u32 reg;
 	uint32_t DP = intel_dp->DP;
 
 	/* channel equalization */
 	tries = 0;
+	cr_tries = 0;
 	channel_eq = false;
 	for (;;) {
 		/* Use intel_dp->train_set[0] to set the voltage and pre emphasis values */
 		uint32_t    signal_levels;
 
+		if (cr_tries > 5) {
+			DRM_ERROR("failed to train DP, aborting\n");
+			intel_dp_link_down(intel_dp);
+			break;
+		}
+
 		if (IS_GEN6(dev) && is_edp(intel_dp)) {
 			signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]);
 			DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels;
@@ -1376,14 +1383,26 @@ intel_dp_complete_link_train(struct inte
 		if (!intel_dp_get_link_status(intel_dp))
 			break;
 
+		/* Make sure clock is still ok */
+		if (!intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) {
+			intel_dp_start_link_train(intel_dp);
+			cr_tries++;
+			continue;
+		}
+
 		if (intel_channel_eq_ok(intel_dp)) {
 			channel_eq = true;
 			break;
 		}
 
-		/* Try 5 times */
-		if (tries > 5)
-			break;
+		/* Try 5 times, then try clock recovery if that fails */
+		if (tries > 5) {
+			intel_dp_link_down(intel_dp);
+			intel_dp_start_link_train(intel_dp);
+			tries = 0;
+			cr_tries++;
+			continue;
+		}
 
 		/* Compute new intel_dp->train_set as requested by target */
 		intel_get_adjust_train(intel_dp);
author
#21 lore raw

PATCH 18/70 xen: p2m: correctly initialize partial p2m leaf

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Stefan Bader <[email protected]>

commit 8e1b4cf2108488ccfb9a3e7ed7cd85a435e01d4b upstream.

After changing the p2m mapping to a tree by

commit 58e05027b530ff081ecea68e38de8d59db8f87e0
xen: convert p2m to a 3 level tree

and trying to boot a DomU with 615MB of memory, the following crash was observed in the dump:

kernel direct mapping tables up to 26f00000 @ 1ec4000-1fff000

BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<c0107397>] xen_set_pte+0x27/0x60

*pdpt = 0000000000000000 *pde = 0000000000000000

Adding further debug statements showed that when trying to set up pfn=0x26700 the returned mapping was invalid.

pfn=0x266ff calling set_pte(0xc1fe77f8, 0x6b3003)
pfn=0x26700 calling set_pte(0xc1fe7800, 0x3)

Although the last_pfn obtained from the startup info is 0x26700, which should in turn not be hit, the additional 8MB which are added as extra memory normally seem to be ok. This lead to looking into the initial p2m tree construction, which uses the smaller value and assuming that there is other code handling the extra memory.

When the p2m tree is set up, the leaves are directly pointed to the array which the domain builder set up. But if the mapping is not on a boundary that fits into one p2m page, this will result in the last leaf being only partially valid. And as the invalid entries are not initialized in that case, things go badly wrong.

I am trying to fix that by checking whether the current leaf is a complete map and if not, allocate a completely new page and copy only the valid pointers there. This may not be the most efficient or elegant solution, but at least it seems to allow me booting DomUs with memory assignments all over the range.

[v2: Redid a bit of commit wording and fixed a compile warning]
---
 arch/x86/xen/mmu.c |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
arch/x86/xen/mmu.c +19 -1
@@ -395,7 +395,25 @@ void __init xen_build_dynamic_phys_to_ma
 			p2m_top[topidx] = mid;
 		}
 
-		p2m_top[topidx][mididx] = &mfn_list[pfn];
+		/*
+		 * As long as the mfn_list has enough entries to completely
+		 * fill a p2m page, pointing into the array is ok. But if
+		 * not the entries beyond the last pfn will be undefined.
+		 * And guessing that the 'what-ever-there-is' does not take it
+		 * too kindly when changing it to invalid markers, a new page
+		 * is allocated, initialized and filled with the valid part.
+		 */
+		if (unlikely(pfn + P2M_PER_PAGE > max_pfn)) {
+			unsigned long p2midx;
+			unsigned long *p2m = extend_brk(PAGE_SIZE, PAGE_SIZE);
+			p2m_init(p2m);
+
+			for (p2midx = 0; pfn + p2midx < max_pfn; p2midx++) {
+				p2m[p2midx] = mfn_list[pfn + p2midx];
+			}
+			p2m_top[topidx][mididx] = p2m;
+		} else
+			p2m_top[topidx][mididx] = &mfn_list[pfn];
 	}
 }
 
author
#22 lore raw

PATCH 19/70 xen/p2m: Mark INVALID_P2M_ENTRY the mfn_list past max_pfn.

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Stefan Bader <[email protected]>

commit cf04d120d9413de581437cf9a29f138ec1178f65 upstream.

In case the mfn_list does not have enough entries to fill a p2m page we do not want the entries from max_pfn up to the boundary to be filled with unknown values. Hence set them to INVALID_P2M_ENTRY.

---
 arch/x86/xen/mmu.c |   16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
arch/x86/xen/mmu.c +5 -11
@@ -399,21 +399,15 @@ void __init xen_build_dynamic_phys_to_ma
 		 * As long as the mfn_list has enough entries to completely
 		 * fill a p2m page, pointing into the array is ok. But if
 		 * not the entries beyond the last pfn will be undefined.
-		 * And guessing that the 'what-ever-there-is' does not take it
-		 * too kindly when changing it to invalid markers, a new page
-		 * is allocated, initialized and filled with the valid part.
 		 */
 		if (unlikely(pfn + P2M_PER_PAGE > max_pfn)) {
 			unsigned long p2midx;
-			unsigned long *p2m = extend_brk(PAGE_SIZE, PAGE_SIZE);
-			p2m_init(p2m);
 
-			for (p2midx = 0; pfn + p2midx < max_pfn; p2midx++) {
-				p2m[p2midx] = mfn_list[pfn + p2midx];
-			}
-			p2m_top[topidx][mididx] = p2m;
-		} else
-			p2m_top[topidx][mididx] = &mfn_list[pfn];
+			p2midx = max_pfn % P2M_PER_PAGE;
+			for ( ; p2midx < P2M_PER_PAGE; p2midx++)
+				mfn_list[pfn + p2midx] = INVALID_P2M_ENTRY;
+		}
+		p2m_top[topidx][mididx] = &mfn_list[pfn];
 	}
 }
 
author
#23 lore raw

PATCH 21/70 xfs: fix dquot shaker deadlock

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Dave Chinner <[email protected]>

commit 0fbca4d1c3932c27c4794bf5c2b5fc961cf5a54f upstream.

Commit 368e136 ("xfs: remove duplicate code from dquot reclaim") fails to unlock the dquot freelist when the number of loop restarts is exceeded in xfs_qm_dqreclaim_one(). This causes hangs in memory reclaim.

Rework the loop control logic into an unwind stack that all the different cases jump into. This means there is only one set of code that processes the loop exit criteria, and simplifies the unlocking of all the items from different points in the loop. It also fixes a double increment of the restart counter from the qi_dqlist_lock case.

---
 fs/xfs/quota/xfs_qm.c |   46 +++++++++++++++++++++-------------------------
 1 file changed, 21 insertions(+), 25 deletions(-)
fs/xfs/quota/xfs_qm.c +21 -25
@@ -1863,12 +1863,14 @@ xfs_qm_dqreclaim_one(void)
 	xfs_dquot_t	*dqpout;
 	xfs_dquot_t	*dqp;
 	int		restarts;
+	int		startagain;
 
 	restarts = 0;
 	dqpout = NULL;
 
 	/* lockorder: hashchainlock, freelistlock, mplistlock, dqlock, dqflock */
-startagain:
+again:
+	startagain = 0;
 	mutex_lock(&xfs_Gqm->qm_dqfrlist_lock);
 
 	list_for_each_entry(dqp, &xfs_Gqm->qm_dqfrlist, q_freelist) {
@@ -1885,13 +1887,10 @@ startagain:
 			ASSERT(! (dqp->dq_flags & XFS_DQ_INACTIVE));
 
 			trace_xfs_dqreclaim_want(dqp);
-
-			xfs_dqunlock(dqp);
-			mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock);
-			if (++restarts >= XFS_QM_RECLAIM_MAX_RESTARTS)
-				return NULL;
 			XQM_STATS_INC(xqmstats.xs_qm_dqwants);
-			goto startagain;
+			restarts++;
+			startagain = 1;
+			goto dqunlock;
 		}
 
 		/*
@@ -1906,23 +1905,20 @@ startagain:
 			ASSERT(list_empty(&dqp->q_mplist));
 			list_del_init(&dqp->q_freelist);
 			xfs_Gqm->qm_dqfrlist_cnt--;
-			xfs_dqunlock(dqp);
 			dqpout = dqp;
 			XQM_STATS_INC(xqmstats.xs_qm_dqinact_reclaims);
-			break;
+			goto dqunlock;
 		}
 
 		ASSERT(dqp->q_hash);
 		ASSERT(!list_empty(&dqp->q_mplist));
 
 		/*
-		 * Try to grab the flush lock. If this dquot is in the process of
-		 * getting flushed to disk, we don't want to reclaim it.
+		 * Try to grab the flush lock. If this dquot is in the process
+		 * of getting flushed to disk, we don't want to reclaim it.
 		 */
-		if (!xfs_dqflock_nowait(dqp)) {
-			xfs_dqunlock(dqp);
-			continue;
-		}
+		if (!xfs_dqflock_nowait(dqp))
+			goto dqunlock;
 
 		/*
 		 * We have the flush lock so we know that this is not in the
@@ -1944,8 +1940,7 @@ startagain:
 				xfs_fs_cmn_err(CE_WARN, mp,
 			"xfs_qm_dqreclaim: dquot %p flush failed", dqp);
 			}
-			xfs_dqunlock(dqp); /* dqflush unlocks dqflock */
-			continue;
+			goto dqunlock;
 		}
 
 		/*
@@ -1967,13 +1962,8 @@ startagain:
 		 */
 		if (!mutex_trylock(&mp->m_quotainfo->qi_dqlist_lock)) {
 			restarts++;
-			mutex_unlock(&dqp->q_hash->qh_lock);
-			xfs_dqfunlock(dqp);
-			xfs_dqunlock(dqp);
-			mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock);
-			if (restarts++ >= XFS_QM_RECLAIM_MAX_RESTARTS)
-				return NULL;
-			goto startagain;
+			startagain = 1;
+			goto qhunlock;
 		}
 
 		ASSERT(dqp->q_nrefs == 0);
@@ -1986,14 +1976,20 @@ startagain:
 		xfs_Gqm->qm_dqfrlist_cnt--;
 		dqpout = dqp;
 		mutex_unlock(&mp->m_quotainfo->qi_dqlist_lock);
+qhunlock:
 		mutex_unlock(&dqp->q_hash->qh_lock);
 dqfunlock:
 		xfs_dqfunlock(dqp);
+dqunlock:
 		xfs_dqunlock(dqp);
 		if (dqpout)
 			break;
 		if (restarts >= XFS_QM_RECLAIM_MAX_RESTARTS)
-			return NULL;
+			break;
+		if (startagain) {
+			mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock);
+			goto again;
+		}
 	}
 	mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock);
 	return dqpout;
author
#24 lore raw

PATCH 22/70 HID: add Add Cando touch screen 10.1-inch product id

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Benjamin Tissoires <[email protected]>

commit bc5ab083a68bfec212780281f8e57d871d8882a0 upstream.

This device has been reported to be an hid-cando one.

---
 drivers/hid/hid-cando.c |    2 ++
 drivers/hid/hid-core.c  |    1 +
 drivers/hid/hid-ids.h   |    1 +
 3 files changed, 4 insertions(+)
drivers/hid/hid-cando.c +2 -0
@@ -236,6 +236,8 @@ static const struct hid_device_id cando_
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
 			USB_DEVICE_ID_CANDO_MULTI_TOUCH) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
+			USB_DEVICE_ID_CANDO_MULTI_TOUCH_10_1) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
 			USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
 		USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6) },
drivers/hid/hid-core.c +1 -0
@@ -1287,6 +1287,7 @@ static const struct hid_device_id hid_bl
 	{ HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE_2) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH_10_1) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) },
drivers/hid/hid-ids.h +1 -0
@@ -135,6 +135,7 @@
 
 #define USB_VENDOR_ID_CANDO		0x2087
 #define USB_DEVICE_ID_CANDO_MULTI_TOUCH	0x0a01
+#define USB_DEVICE_ID_CANDO_MULTI_TOUCH_10_1 0x0a02
 #define USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6 0x0b03
 #define USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6 0x0f01
 
author
#25 lore raw

PATCH 23/70 HID: Switch turbox/mosart touchscreen to hid-mosart

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Benjamin Tissoires <[email protected]>

commit c64f6f934c7490faff76faf96217066a1b3570a0 upstream.

This device used the MULTI_INPUT quirk whereas it could be used with hid-mosart instead to support the multitouch part.

Reference: https://bugs.launchpad.net/ubuntu/+bug/620609/

---
 drivers/hid/hid-core.c          |    1 +
 drivers/hid/hid-mosart.c        |    1 +
 drivers/hid/usbhid/hid-quirks.c |    1 -
 3 files changed, 2 insertions(+), 1 deletion(-)
drivers/hid/hid-core.c +1 -0
@@ -1391,6 +1391,7 @@ static const struct hid_device_id hid_bl
 	{ HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U) },
drivers/hid/hid-mosart.c +1 -0
@@ -240,6 +240,7 @@ static void mosart_remove(struct hid_dev
 static const struct hid_device_id mosart_devices[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_T91MT) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUSTEK_MULTITOUCH_YFO) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART) },
 	{ }
 };
 MODULE_DEVICE_TABLE(hid, mosart_devices);
drivers/hid/usbhid/hid-quirks.c +0 -1
@@ -35,7 +35,6 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD },
 	{ USB_VENDOR_ID_DWAV, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER, HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_MOJO, USB_DEVICE_ID_RETRO_ADAPTER, HID_QUIRK_MULTI_INPUT },
-	{ USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART, HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
author
#26 lore raw

PATCH 24/70 CRED: Fix kernel panic upon security_file_alloc() failure.

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Tetsuo Handa <[email protected]>

commit 78d2978874e4e10e97dfd4fd79db45bdc0748550 upstream.

In get_empty_filp() since 2.6.29, file_free(f) is called with f->f_cred == NULL when security_file_alloc() returned an error. As a result, kernel will panic() due to put_cred(NULL) call within RCU callback.

Fix this bug by assigning f->f_cred before calling security_file_alloc().

---
 fs/file_table.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/file_table.c +1 -1
@@ -125,13 +125,13 @@ struct file *get_empty_filp(void)
 		goto fail;
 
 	percpu_counter_inc(&nr_files);
+	f->f_cred = get_cred(cred);
 	if (security_file_alloc(f))
 		goto fail_sec;
 
 	INIT_LIST_HEAD(&f->f_u.fu_list);
 	atomic_long_set(&f->f_count, 1);
 	rwlock_init(&f->f_owner.lock);
-	f->f_cred = get_cred(cred);
 	spin_lock_init(&f->f_lock);
 	eventpoll_init_file(f);
 	/* f->f_version: 0 */
author
#27 lore raw

PATCH 25/70 btrfs: prevent heap corruption in btrfs_ioctl_space_info()

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Dan Rosenberg <[email protected]>

commit 51788b1bdd0d68345bab0af4301e7fa429277228 upstream.

Commit bf5fc093c5b625e4259203f1cee7ca73488a5620 refactored btrfs_ioctl_space_info() and introduced several security issues.

space_args.space_slots is an unsigned 64-bit type controlled by a possibly unprivileged caller. The comparison as a signed int type allows providing values that are treated as negative and cause the subsequent allocation size calculation to wrap, or be truncated to 0. By providing a size that's truncated to 0, kmalloc() will return ZERO_SIZE_PTR. It's also possible to provide a value smaller than the slot count. The subsequent loop ignores the allocation size when copying data in, resulting in a heap overflow or write to ZERO_SIZE_PTR.

The fix changes the slot count type and comparison typecast to u64, which prevents truncation or signedness errors, and also ensures that we don't copy more data than we've allocated in the subsequent loop. Note that zero-size allocations are no longer possible since there is already an explicit check for space_args.space_slots being 0 and truncation of this value is no longer an issue.

---
 fs/btrfs/ioctl.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
fs/btrfs/ioctl.c +8 -2
@@ -2087,7 +2087,7 @@ long btrfs_ioctl_space_info(struct btrfs
 	int num_types = 4;
 	int alloc_size;
 	int ret = 0;
-	int slot_count = 0;
+	u64 slot_count = 0;
 	int i, c;
 
 	if (copy_from_user(&space_args,
@@ -2126,7 +2126,7 @@ long btrfs_ioctl_space_info(struct btrfs
 		goto out;
 	}
 
-	slot_count = min_t(int, space_args.space_slots, slot_count);
+	slot_count = min_t(u64, space_args.space_slots, slot_count);
 
 	alloc_size = sizeof(*dest) * slot_count;
 
@@ -2146,6 +2146,9 @@ long btrfs_ioctl_space_info(struct btrfs
 	for (i = 0; i < num_types; i++) {
 		struct btrfs_space_info *tmp;
 
+		if (!slot_count)
+			break;
+
 		info = NULL;
 		rcu_read_lock();
 		list_for_each_entry_rcu(tmp, &root->fs_info->space_info,
@@ -2167,7 +2170,10 @@ long btrfs_ioctl_space_info(struct btrfs
 				memcpy(dest, &space, sizeof(space));
 				dest++;
 				space_args.total_spaces++;
+				slot_count--;
 			}
+			if (!slot_count)
+				break;
 		}
 		up_read(&info->groups_sem);
 	}
author
#28 lore raw

PATCH 26/70 CRED: Fix BUG() upon security_cred_alloc_blank() failure

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Tetsuo Handa <[email protected]>

commit 2edeaa34a6e3f2c43b667f6c4f7b27944b811695 upstream.

In cred_alloc_blank() since 2.6.32, abort_creds(new) is called with new->security == NULL and new->magic == 0 when security_cred_alloc_blank() returns an error. As a result, BUG() will be triggered if SELinux is enabled or CONFIG_DEBUG_CREDENTIALS=y.

If CONFIG_DEBUG_CREDENTIALS=y, BUG() is called from __invalid_creds() because cred->magic == 0. Failing that, BUG() is called from selinux_cred_free() because selinux_cred_free() is not expecting cred->security == NULL. This does not affect smack_cred_free(), tomoyo_cred_free() or apparmor_cred_free().

Fix these bugs by

(1) Set new->magic before calling security_cred_alloc_blank().

(2) Handle null cred->security in creds_are_invalid() and selinux_cred_free().

---
 kernel/cred.c            |   12 ++++++++----
 security/selinux/hooks.c |    6 +++++-
 2 files changed, 13 insertions(+), 5 deletions(-)
kernel/cred.c +8 -4
@@ -252,13 +252,13 @@ struct cred *cred_alloc_blank(void)
 #endif
 
 	atomic_set(&new->usage, 1);
+#ifdef CONFIG_DEBUG_CREDENTIALS
+	new->magic = CRED_MAGIC;
+#endif
 
 	if (security_cred_alloc_blank(new, GFP_KERNEL) < 0)
 		goto error;
 
-#ifdef CONFIG_DEBUG_CREDENTIALS
-	new->magic = CRED_MAGIC;
-#endif
 	return new;
 
 error:
@@ -748,7 +748,11 @@ bool creds_are_invalid(const struct cred
 	if (cred->magic != CRED_MAGIC)
 		return true;
 #ifdef CONFIG_SECURITY_SELINUX
-	if (selinux_is_enabled()) {
+	/*
+	 * cred->security == NULL if security_cred_alloc_blank() or
+	 * security_prepare_creds() returned an error.
+	 */
+	if (selinux_is_enabled() && cred->security) {
 		if ((unsigned long) cred->security < PAGE_SIZE)
 			return true;
 		if ((*(u32 *)cred->security & 0xffffff00) ==
security/selinux/hooks.c +5 -1
@@ -3198,7 +3198,11 @@ static void selinux_cred_free(struct cre
 {
 	struct task_security_struct *tsec = cred->security;
 
-	BUG_ON((unsigned long) cred->security < PAGE_SIZE);
+	/*
+	 * cred->security == NULL if security_cred_alloc_blank() or
+	 * security_prepare_creds() returned an error.
+	 */
+	BUG_ON(cred->security && (unsigned long) cred->security < PAGE_SIZE);
 	cred->security = (void *) 0x7UL;
 	kfree(tsec);
 }
author
#29 lore raw

PATCH 27/70 CRED: Fix memory and refcount leaks upon security_prepare_creds() failure

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Tetsuo Handa <[email protected]>

commit fb2b2a1d37f80cc818fd4487b510f4e11816e5e1 upstream.

In prepare_kernel_cred() since 2.6.29, put_cred(new) is called without assigning new->usage when security_prepare_creds() returned an error. As a result, memory for new and refcount for new->{user,group_info,tgcred} are leaked because put_cred(new) won't call __put_cred() unless old->usage == 1.

Fix these leaks by assigning new->usage (and new->subscribers which was added in 2.6.32) before calling security_prepare_creds().

---
 kernel/cred.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/cred.c +2 -2
@@ -657,6 +657,8 @@ struct cred *prepare_kernel_cred(struct
 	validate_creds(old);
 
 	*new = *old;
+	atomic_set(&new->usage, 1);
+	set_cred_subscribers(new, 0);
 	get_uid(new->user);
 	get_group_info(new->group_info);
 
@@ -674,8 +676,6 @@ struct cred *prepare_kernel_cred(struct
 	if (security_prepare_creds(new, old, GFP_KERNEL) < 0)
 		goto error;
 
-	atomic_set(&new->usage, 1);
-	set_cred_subscribers(new, 0);
 	put_cred(old);
 	validate_creds(new);
 	return new;
author
#30 lore raw

PATCH 28/70 staging: brcm80211: bugfix for softmac crash on multi cpu configurations

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Roland Vossen <[email protected]>

commit 6a3be6e6e7feb4cb35275475d6a863b748d59cc3 upstream.

Solved a locking issue that resulted in driver crashes with the 43224 and 43225 chips. The problem has been reported on several fora. Root cause was two fold:
hardware was being manipulated by two unsynchronized threads, and a scan operation could interfere with an ongoing dynamic calibration process. Fix was to invoke a lock on wl_ops_config() operation and to set internal flags when a scan operation is started and stopped.

Please add this to the staging-linus branch.

---
 drivers/staging/brcm80211/sys/wlc_mac80211.c |    1 -
 1 file changed, 1 deletion(-)
drivers/staging/brcm80211/sys/wlc_mac80211.c +0 -1
@@ -5336,7 +5336,6 @@ wlc_sendpkt_mac80211(wlc_info_t *wlc, vo
 	fifo = prio2fifo[prio];
 
 	ASSERT((uint) PKTHEADROOM(sdu) >= TXOFF);
-	ASSERT(!PKTSHARED(sdu));
 	ASSERT(!PKTNEXT(sdu));
 	ASSERT(!PKTLINK(sdu));
 	ASSERT(fifo < NFIFO);
#31 lore raw

Re: [Stable-review] [28/70] staging: brcm80211: bugfix for softmac crash on multi cpu configurations

Quoted 7 lines · Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Roland Vossen <[email protected]>

commit 6a3be6e6e7feb4cb35275475d6a863b748d59cc3 upstream.

The upstream commit looks completely different; the diffstat is:

 drivers/staging/brcm80211/sys/wl_mac80211.c  |   12 ++++++++++--
 drivers/staging/brcm80211/sys/wlc_mac80211.c |   13 +++++++++++++
 drivers/staging/brcm80211/sys/wlc_pub.h      |    2 ++
 3 files changed, 25 insertions(+), 2 deletions(-)

Why is this so different?

Ben.

[...]

Quoted 13 lines
 drivers/staging/brcm80211/sys/wlc_mac80211.c |    1 -
 1 file changed, 1 deletion(-)
drivers/staging/brcm80211/sys/wlc_mac80211.c +0 -1
@@ -5336,7 +5336,6 @@ wlc_sendpkt_mac80211(wlc_info_t *wlc, vo
 	fifo = prio2fifo[prio];
 
 	ASSERT((uint) PKTHEADROOM(sdu) >= TXOFF);
-	ASSERT(!PKTSHARED(sdu));
 	ASSERT(!PKTNEXT(sdu));
 	ASSERT(!PKTLINK(sdu));
 	ASSERT(fifo < NFIFO);
Signature · 2 lines
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
#32 lore raw

Re: [Stable-review] [28/70] staging: brcm80211: bugfix for softmac crash on multi cpu configurations

Quoted 7 lines · Ben Hutchings
Quoted 3 lines · Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

Why is this so different?

Hi Ben,

I think you are right. The diff below actually is from another commit which I posted for stable review titled:

staging: brcm80211: remove assert to avoid panic since 2.6.37 kernel

Gr. AvS

Quoted 6 lines

Ben.

[...]

Quoted 2 lines
 drivers/staging/brcm80211/sys/wlc_mac80211.c |    1 -
 1 file changed, 1 deletion(-)
Signature · 2 lines
"The most merciful thing in the world, I think, is the inability of the human
mind to correlate all its contents." - "The Call of Cthulhu"
author
#33 lore raw

Re: [Stable-review] [28/70] staging: brcm80211: bugfix for softmac crash on multi cpu configurations

Quoted 12 lines · Arend van Spriel
Quoted 8 lines · Ben Hutchings
Quoted 4 lines · Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

Why is this so different?

Quoted 6 lines

Hi Ben,

I think you are right. The diff below actually is from another commit which I posted for stable review titled:

staging: brcm80211: remove assert to avoid panic since 2.6.37 kernel

So, what should I do here? Drop the referenced patch from the .37-stable queue, or do you have the text for the changelog that I should use here instead?

confused,

greg k-h

#34 lore raw

Re: [Stable-review] [28/70] staging: brcm80211: bugfix for softmac crash on multi cpu configurations

Quoted 4 lines · Greg KH
Quoted 3 lines · Arend van Spriel

On Wed, 23 Feb 2011 03:23:07 +0100, Ben Hutchings
<[email protected]> wrote:

Quoted 9 lines
Quoted 2 lines
Quoted 2 lines · Greg KH
Quoted 1 line

2.6.37-stable review patch. If anyone has any objections,

So, what should I do here? Drop the referenced patch from the .37-stable queue, or do you have the text for the changelog that I should use here instead?

confused,

Hi Greg,

Dito here. I submitted a patch for the stable kernel and Roland did one (if I am correct). I have no clue how his commit message came with my patch or vice versa.

Quoted 3 lines

greg k-h

Gr. AvS

Signature · 2 lines
"The most merciful thing in the world, I think, is the inability of the human
mind to correlate all its contents." - "The Call of Cthulhu"
#35 lore raw

Re: [Stable-review] [28/70] staging: brcm80211: bugfix for softmac crash on multi cpu configurations

Hi Greg,

Quoted 11 lines
Quoted 6 lines

So, what should I do here? Drop the referenced patch from the .37-stable queue, or do you have the text for the changelog that I should use here instead?

confused,

Dito here. I submitted a patch for the stable kernel and Roland did one (if I am correct). I have no clue how his commit message came with my patch or vice versa.

Let me try to clear up part of the confusion.

The short story is: for some mysterious reason, a patch exists that is a mixup of two patches (one from Arend and one from me). It contains the commit message from me, but the file changes from Arend. This 'hybrid' patch was submitted for review by you. This patch did not make it yet into the 2.6.37-stable tree.

Also, neither Arends nor my Patch ended up in the 2.6.37-stable tree.

To fix this problem, I think that this hybrid patch has to be review rejected. Next, new patches have to be created based on Rolands patch (6a3be6e6e7feb4cb35275475d6a863b748d59cc3, as submitted into gregkh/staging-2.6.git::staging-linus branch) as well as Arends patch (d062d44a8386c82c06e483f0c0d1124ba3cab2c8). These patches would then have to be reviewed for the 2.6.37-stable tree.

-------------- Long story follows:

Both Arend and I submitted a patch for the 2.6.38 tree (gregkh/staging-2.6.git). The commits were:

commit d062d44a8386c82c06e483f0c0d1124ba3cab2c8
Author: Arend van Spriel <[email protected]>
Date: Fri Jan 21 13:34:15 2011 +0100
staging: brcm80211: remove assert to avoid panic since 2.6.37 kernel

and:

commit 6a3be6e6e7feb4cb35275475d6a863b748d59cc3
Author: Roland Vossen <[email protected]>
Date: Tue Jan 25 11:51:56 2011 +0100
staging: brcm80211: bugfix for softmac crash on multi cpu configurations

Rolands patch was added to the 2.6.37 tree since I got the following email from you:

-------- Original Message --------
Subject: Patch "staging: brcm80211: bugfix for softmac crash on multi cpu configurations" has been added to the 2.6.37-stable tree
Date: Wed, 16 Feb 2011 15:06:28 -0800
From: [email protected] <[email protected]>
To: Roland Vossen <[email protected]>, Arend Van Spriel <[email protected]>, Brett Rudley <[email protected]>, "[email protected]" <[email protected]>
-------- /Original Message --------

I do not see a similar email for Arends patch.

Now something strange happened: I see a patch that is a hybrid: I bears Rolands patch title with Rolands commit message, but the files touched are related to Arends patch. See: http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git;a=blob;f=review-2.6.37/staging-brcm80211-bugfix-for-softmac-crash-on-multi-cpu-configurations.patch;h=e0315e2ecaf4671256c39a491b2b623ade9d0e7b;hb=HEAD

I checked if my file changes are present in the 2.6.37 stable tree, which I would expect, but they are not, at least not when I look at: http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.37.y.git;a=blob;f=drivers/staging/brcm80211/sys/wl_mac80211.c;h=cb2041a61d78a78eea4ff8a71896ba2cff21bcda;hb=HEAD

Arends changes are also not present in the 2.6.37 stable tree: http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.37.y.git;a=blob;f=drivers/staging/brcm80211/sys/wlc_mac80211.c;h=feaffcc64ec6f7889168d2de1a811d867a2f91a8;hb=HEAD

Bye, Roland.

author
#36 lore raw

Re: [Stable-review] [28/70] staging: brcm80211: bugfix for softmac crash on multi cpu configurations

Quoted 22 lines · Roland Vossen

Hi Greg,

Quoted 11 lines
Quoted 6 lines

So, what should I do here? Drop the referenced patch from the .37-stable queue, or do you have the text for the changelog that I should use here instead?

confused,

Dito here. I submitted a patch for the stable kernel and Roland did one (if I am correct). I have no clue how his commit message came with my patch or vice versa.

Let me try to clear up part of the confusion.

The short story is: for some mysterious reason, a patch exists that is a mixup of two patches (one from Arend and one from me). It contains the commit message from me, but the file changes from Arend. This 'hybrid' patch was submitted for review by you. This patch did not make it yet into the 2.6.37-stable tree.

Quoted 8 lines

Also, neither Arends nor my Patch ended up in the 2.6.37-stable tree.

To fix this problem, I think that this hybrid patch has to be review rejected. Next, new patches have to be created based on Rolands patch (6a3be6e6e7feb4cb35275475d6a863b748d59cc3, as submitted into gregkh/staging-2.6.git::staging-linus branch) as well as Arends patch (d062d44a8386c82c06e483f0c0d1124ba3cab2c8). These patches would then have to be reviewed for the 2.6.37-stable tree.

Ok, I'm going to drop this patch now.

Can someone create the needed patches for the .37-stable tree that should be included and send them to me and cc: [email protected] so I can queue them up for the next .37-stable release after this?

thanks,

greg k-h

#37 lore raw

Re: [Stable-review] [28/70] staging: brcm80211: bugfix for softmac crash on multi cpu configurations

Quoted 7 lines · Greg KH

Ok, I'm going to drop this patch now.

Can someone create the needed patches for the .37-stable tree that should be included and send them to me and cc: [email protected] so I can queue them up for the next .37-stable release after this?

Hi Greg,

I sent both patches to you.

Quoted 5 lines

thanks,

greg k-h

Gr. AvS

Signature · 2 lines
"The most merciful thing in the world, I think, is the inability of the human
mind to correlate all its contents." - "The Call of Cthulhu"
#38 lore raw

Re: [stable] [Stable-review] [28/70] staging: brcm80211: bugfix for softmac crash on multi cpu configurations

Quoted 5 lines · Arend van Spriel
Quoted 3 lines · Greg KH

Ok, I'm going to drop this patch now.

Quoted 8 lines
Quoted 4 lines

Can someone create the needed patches for the .37-stable tree that should be included and send them to me and cc: [email protected] so I can queue them up for the next .37-stable release after this?

Hi Greg,

I sent both patches to you.

Thanks, I got them, I'll queue them up for the next .37-stable release.

greg k-h

author
#39 lore raw

PATCH 29/70 security: add cred argument to security_capable()

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Chris Wright <[email protected]>

commit 6037b715d6fab139742c3df8851db4c823081561 upstream.

Expand security_capable() to include cred, so that it can be usable in a wider range of call sites.

---
 include/linux/security.h |    6 +++---
 kernel/capability.c      |    2 +-
 security/security.c      |    5 ++---
 3 files changed, 6 insertions(+), 7 deletions(-)
include/linux/security.h +3 -3
@@ -1664,7 +1664,7 @@ int security_capset(struct cred *new, co
 		    const kernel_cap_t *effective,
 		    const kernel_cap_t *inheritable,
 		    const kernel_cap_t *permitted);
-int security_capable(int cap);
+int security_capable(const struct cred *cred, int cap);
 int security_real_capable(struct task_struct *tsk, int cap);
 int security_real_capable_noaudit(struct task_struct *tsk, int cap);
 int security_sysctl(struct ctl_table *table, int op);
@@ -1857,9 +1857,9 @@ static inline int security_capset(struct
 	return cap_capset(new, old, effective, inheritable, permitted);
 }
 
-static inline int security_capable(int cap)
+static inline int security_capable(const struct cred *cred, int cap)
 {
-	return cap_capable(current, current_cred(), cap, SECURITY_CAP_AUDIT);
+	return cap_capable(current, cred, cap, SECURITY_CAP_AUDIT);
 }
 
 static inline int security_real_capable(struct task_struct *tsk, int cap)
kernel/capability.c +1 -1
@@ -306,7 +306,7 @@ int capable(int cap)
 		BUG();
 	}
 
-	if (security_capable(cap) == 0) {
+	if (security_capable(current_cred(), cap) == 0) {
 		current->flags |= PF_SUPERPRIV;
 		return 1;
 	}
security/security.c +2 -3
@@ -154,10 +154,9 @@ int security_capset(struct cred *new, co
 				    effective, inheritable, permitted);
 }
 
-int security_capable(int cap)
+int security_capable(const struct cred *cred, int cap)
 {
-	return security_ops->capable(current, current_cred(), cap,
-				     SECURITY_CAP_AUDIT);
+	return security_ops->capable(current, cred, cap, SECURITY_CAP_AUDIT);
 }
 
 int security_real_capable(struct task_struct *tsk, int cap)
author
#40 lore raw

PATCH 30/70 pci: use security_capable() when checking capablities during config space read

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Chris Wright <[email protected]>

commit a628e7b87e100befac9702aa0c3b9848a7685e49 upstream.

This reintroduces commit 47970b1b which was subsequently reverted as f00eaeea. The original change was broken and caused X startup failures and generally made privileged processes incapable of reading device dependent config space. The normal capable() interface returns true on success, but the LSM interface returns 0 on success. This thinko is now fixed in this patch, and has been confirmed to work properly.

So, once again...Eric Paris noted that commit de139a3 ("pci: check caps from sysfs file open to read device dependent config space") caused the capability check to bypass security modules and potentially auditing. Rectify this by calling security_capable() when checking the open file's capabilities for config space reads.

---
 drivers/pci/pci-sysfs.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pci/pci-sysfs.c +2 -1
@@ -23,6 +23,7 @@
 #include <linux/mm.h>
 #include <linux/fs.h>
 #include <linux/capability.h>
+#include <linux/security.h>
 #include <linux/pci-aspm.h>
 #include <linux/slab.h>
 #include "pci.h"
@@ -368,7 +369,7 @@ pci_read_config(struct file *filp, struc
 	u8 *data = (u8*) buf;
 
 	/* Several chips lock up trying to read undefined config space */
-	if (cap_raised(filp->f_cred->cap_effective, CAP_SYS_ADMIN)) {
+	if (security_capable(filp->f_cred, CAP_SYS_ADMIN) == 0) {
 		size = dev->cfg_size;
 	} else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
 		size = 128;
author
#41 lore raw

PATCH 31/70 ACPI / Wakeup: Enable button GPEs unconditionally during initialization

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Rafael J. Wysocki <[email protected]>

This is a backport of mainline kernel commit
2a5d24286e8bdafdc272b37ec5bdd9e977b3767c.

Commit 9630bdd (ACPI: Use GPE reference counting to support shared GPEs) introduced a suspend regression where boxes resume immediately after being suspended due to the lid or sleep button wakeup status not being cleared properly. This happens if the GPEs corresponding to those devices are not enabled all the time, which apparently is expected by some BIOSes.

To fix this problem, enable button and lid GPEs unconditionally during initialization and keep them enabled all the time, regardless of whether or not the ACPI button driver is used.

References: https://bugzilla.kernel.org/show_bug.cgi?id=27372

---
 drivers/acpi/wakeup.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/acpi/wakeup.c +5 -1
@@ -84,8 +84,12 @@ int __init acpi_wakeup_device_init(void)
 		struct acpi_device *dev = container_of(node,
 						       struct acpi_device,
 						       wakeup_list);
-		if (dev->wakeup.flags.always_enabled)
+		if (dev->wakeup.flags.always_enabled) {
+			/* Button GPEs are supposed to be always enabled. */
+			acpi_enable_gpe(dev->wakeup.gpe_device,
+					dev->wakeup.gpe_number);
 			dev->wakeup.state.enabled = 1;
+		}
 	}
 	mutex_unlock(&acpi_device_lock);
 	return 0;
author
#42 lore raw

PATCH 32/70 nfsd: correctly handle return value from nfsd_map_name_to_*

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: NeilBrown <[email protected]>

commit 47c85291d3dd1a51501555000b90f8e281a0458e upstream.

These functions return an nfs status, not a host_err. So don't try to convert before returning.

This is a regression introduced by 3c726023402a2f3b28f49b9d90ebf9e71151157d; I fixed up two of the callers, but missed these two.

---
 fs/nfsd/nfs4xdr.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/nfsd/nfs4xdr.c +4 -4
@@ -316,8 +316,8 @@ nfsd4_decode_fattr(struct nfsd4_compound
 		READ_BUF(dummy32);
 		len += (XDR_QUADLEN(dummy32) << 2);
 		READMEM(buf, dummy32);
-		if ((host_err = nfsd_map_name_to_uid(argp->rqstp, buf, dummy32, &iattr->ia_uid)))
-			goto out_nfserr;
+		if ((status = nfsd_map_name_to_uid(argp->rqstp, buf, dummy32, &iattr->ia_uid)))
+			return status;
 		iattr->ia_valid |= ATTR_UID;
 	}
 	if (bmval[1] & FATTR4_WORD1_OWNER_GROUP) {
@@ -327,8 +327,8 @@ nfsd4_decode_fattr(struct nfsd4_compound
 		READ_BUF(dummy32);
 		len += (XDR_QUADLEN(dummy32) << 2);
 		READMEM(buf, dummy32);
-		if ((host_err = nfsd_map_name_to_gid(argp->rqstp, buf, dummy32, &iattr->ia_gid)))
-			goto out_nfserr;
+		if ((status = nfsd_map_name_to_gid(argp->rqstp, buf, dummy32, &iattr->ia_gid)))
+			return status;
 		iattr->ia_valid |= ATTR_GID;
 	}
 	if (bmval[1] & FATTR4_WORD1_TIME_ACCESS_SET) {
author
#43 lore raw

PATCH 33/70 x86, hotplug: Fix powersavings with offlined cores on AMD

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Borislav Petkov <[email protected]>

Upstream commits: 93789b32dbf355e70f18b17a82e8661677a7f7fb,

	 1c9d16e35911090dee3f9313e6af13af623d66ee

ea53069231f9317062910d6e772cca4ce93de8c8 made a CPU use monitor/mwait when offline. This is not the optimal choice for AMD wrt to powersavings and we'd prefer our cores to halt (i.e. enter C1) instead. For this, the same selection whether to use monitor/mwait has to be used as when we select the idle routine for the machine.

With this patch, offlining cores 1-5 on a X6 machine allows core0 to boost again.

[ hpa: putting this in urgent since it is a (power) regression fix ]

Cc H. Peter Anvin <[email protected]>
Cc Arjan van de Ven <[email protected]>
Cc Len Brown <[email protected]>
Cc Venkatesh Pallipadi <[email protected]>
Cc Peter Zijlstra <[email protected]>

LKML-Reference: <[email protected]>

---
 arch/x86/include/asm/cpu.h |    1 +
 arch/x86/kernel/process.c  |    5 +++--
 arch/x86/kernel/smpboot.c  |    3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)
arch/x86/include/asm/cpu.h +1 -0
@@ -32,5 +32,6 @@ extern void arch_unregister_cpu(int);
 
 DECLARE_PER_CPU(int, cpu_state);
 
+int mwait_usable(const struct cpuinfo_x86 *);
 
 #endif /* _ASM_X86_CPU_H */
arch/x86/kernel/process.c +3 -2
@@ -14,6 +14,7 @@
 #include <linux/utsname.h>
 #include <trace/events/power.h>
 #include <linux/hw_breakpoint.h>
+#include <asm/cpu.h>
 #include <asm/system.h>
 #include <asm/apic.h>
 #include <asm/syscalls.h>
@@ -509,13 +510,13 @@ static void poll_idle(void)
  *
  * idle=mwait overrides this decision and forces the usage of mwait.
  */
-static int __cpuinitdata force_mwait;
+static int force_mwait;
 
 #define MWAIT_INFO			0x05
 #define MWAIT_ECX_EXTENDED_INFO		0x01
 #define MWAIT_EDX_C1			0xf0
 
-static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)
+int mwait_usable(const struct cpuinfo_x86 *c)
 {
 	u32 eax, ebx, ecx, edx;
 
arch/x86/kernel/smpboot.c +2 -1
@@ -1396,8 +1396,9 @@ static inline void mwait_play_dead(void)
 	unsigned int highest_subcstate = 0;
 	int i;
 	void *mwait_ptr;
+	struct cpuinfo_x86 *c = &current_cpu_data;
 
-	if (!cpu_has(&current_cpu_data, X86_FEATURE_MWAIT))
+	if (!(cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)))
 		return;
 	if (!cpu_has(&current_cpu_data, X86_FEATURE_CLFLSH))
 		return;
author
#44 lore raw

PATCH 34/70 s390: remove task_show_regs

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Martin Schwidefsky <[email protected]>

commit 261cd298a8c363d7985e3482946edb4bfedacf98 upstream.

task_show_regs used to be a debugging aid in the early bringup days of Linux on s390. /proc/<pid>/status is a world readable file, it is not a good idea to show the registers of a process. The only correct fix is to remove task_show_regs.

---
 arch/s390/include/asm/processor.h |    5 -----
 arch/s390/kernel/traps.c          |   37 -------------------------------------
 fs/proc/array.c                   |    3 ---
 3 files changed, 45 deletions(-)
arch/s390/include/asm/processor.h +0 -5
@@ -148,11 +148,6 @@ extern int kernel_thread(int (*fn)(void
  */
 extern unsigned long thread_saved_pc(struct task_struct *t);
 
-/*
- * Print register of task into buffer. Used in fs/proc/array.c.
- */
-extern void task_show_regs(struct seq_file *m, struct task_struct *task);
-
 extern void show_code(struct pt_regs *regs);
 
 unsigned long get_wchan(struct task_struct *p);
arch/s390/kernel/traps.c +0 -37
@@ -237,43 +237,6 @@ void show_regs(struct pt_regs *regs)
 	show_last_breaking_event(regs);
 }
 
-/* This is called from fs/proc/array.c */
-void task_show_regs(struct seq_file *m, struct task_struct *task)
-{
-	struct pt_regs *regs;
-
-	regs = task_pt_regs(task);
-	seq_printf(m, "task: %p, ksp: %p\n",
-		       task, (void *)task->thread.ksp);
-	seq_printf(m, "User PSW : %p %p\n",
-		       (void *) regs->psw.mask, (void *)regs->psw.addr);
-
-	seq_printf(m, "User GPRS: " FOURLONG,
-			  regs->gprs[0], regs->gprs[1],
-			  regs->gprs[2], regs->gprs[3]);
-	seq_printf(m, "           " FOURLONG,
-			  regs->gprs[4], regs->gprs[5],
-			  regs->gprs[6], regs->gprs[7]);
-	seq_printf(m, "           " FOURLONG,
-			  regs->gprs[8], regs->gprs[9],
-			  regs->gprs[10], regs->gprs[11]);
-	seq_printf(m, "           " FOURLONG,
-			  regs->gprs[12], regs->gprs[13],
-			  regs->gprs[14], regs->gprs[15]);
-	seq_printf(m, "User ACRS: %08x %08x %08x %08x\n",
-			  task->thread.acrs[0], task->thread.acrs[1],
-			  task->thread.acrs[2], task->thread.acrs[3]);
-	seq_printf(m, "           %08x %08x %08x %08x\n",
-			  task->thread.acrs[4], task->thread.acrs[5],
-			  task->thread.acrs[6], task->thread.acrs[7]);
-	seq_printf(m, "           %08x %08x %08x %08x\n",
-			  task->thread.acrs[8], task->thread.acrs[9],
-			  task->thread.acrs[10], task->thread.acrs[11]);
-	seq_printf(m, "           %08x %08x %08x %08x\n",
-			  task->thread.acrs[12], task->thread.acrs[13],
-			  task->thread.acrs[14], task->thread.acrs[15]);
-}
-
 static DEFINE_SPINLOCK(die_lock);
 
 void die(const char * str, struct pt_regs * regs, long err)
fs/proc/array.c +0 -3
@@ -353,9 +353,6 @@ int proc_pid_status(struct seq_file *m,
 	task_cap(m, task);
 	task_cpus_allowed(m, task);
 	cpuset_task_status_allowed(m, task);
-#if defined(CONFIG_S390)
-	task_show_regs(m, task);
-#endif
 	task_context_switch_counts(m, task);
 	return 0;
 }
author
#45 lore raw

PATCH 35/70 x86, mrst: Set correct APB timer IRQ affinity for secondary cpu

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Jacob Pan <[email protected]>

This is a backport for 2.6.37 stable. The original commit ID is 6550904ddbc3c286798a87edf95eeebcc62bc58a

Offlining the secondary CPU causes the timer irq affinity to be set to CPU 0. When the secondary CPU is back online again, the wrong irq affinity will be used.

This patch ensures secondary per CPU timer always has the correct IRQ affinity when enabled.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/apb_timer.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
arch/x86/kernel/apb_timer.c +5 -3
@@ -313,10 +313,12 @@ static void apbt_setup_irq(struct apbt_d
 	if (adev->irq == 0)
 		return;
 
+	irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT);
+	irq_set_affinity(adev->irq, cpumask_of(adev->cpu));
+	/* APB timer irqs are set up as mp_irqs, timer is edge type */
+	__set_irq_handler(adev->irq, handle_edge_irq, 0, "edge");
+
 	if (system_state == SYSTEM_BOOTING) {
-		irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT);
-		/* APB timer irqs are set up as mp_irqs, timer is edge type */
-		__set_irq_handler(adev->irq, handle_edge_irq, 0, "edge");
 		if (request_irq(adev->irq, apbt_interrupt_handler,
 				IRQF_TIMER | IRQF_DISABLED | IRQF_NOBALANCING,
 				adev->name, adev)) {
author
#46 lore raw

PATCH 36/70 PM / Hibernate: Return error code when alloc_image_page() fails

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Stanislaw Gruszka <[email protected]>

commit 2e725a065b0153f0c449318da1923a120477633d upstream.

Currently we return 0 in swsusp_alloc() when alloc_image_page() fails. Fix that. Also remove unneeded "error" variable since the only useful value of error is -ENOMEM.

[rjw: Fixed up the changelog and changed subject.]

---
 kernel/power/snapshot.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
kernel/power/snapshot.c +2 -5
@@ -1519,11 +1519,8 @@ static int
 swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm,
 		unsigned int nr_pages, unsigned int nr_highmem)
 {
-	int error = 0;
-
 	if (nr_highmem > 0) {
-		error = get_highmem_buffer(PG_ANY);
-		if (error)
+		if (get_highmem_buffer(PG_ANY))
 			goto err_out;
 		if (nr_highmem > alloc_highmem) {
 			nr_highmem -= alloc_highmem;
@@ -1546,7 +1543,7 @@ swsusp_alloc(struct memory_bitmap *orig_
 
  err_out:
 	swsusp_free();
-	return error;
+	return -ENOMEM;
 }
 
 asmlinkage int swsusp_save(void)
author
#47 lore raw

PATCH 37/70 drm/radeon/kms: add missing frac fb div flag for dce4+

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Alex Deucher <[email protected]>

commit 9f4283f49f0a96a64c5a45fe56f0f8c942885eef upstream.

The fixed ref/post dividers are set by the AdjustPll table rather than the ss info table on dce4+. Make sure we enable the fractional feedback dividers when using a fixed post or ref divider on them as well.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=29272

---
 drivers/gpu/drm/radeon/atombios_crtc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/atombios_crtc.c +3 -1
@@ -533,9 +533,9 @@ static u32 atombios_adjust_pll(struct dr
 
 			/* use recommended ref_div for ss */
 			if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
-				pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
 				if (ss_enabled) {
 					if (ss->refdiv) {
+						pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
 						pll->flags |= RADEON_PLL_USE_REF_DIV;
 						pll->reference_div = ss->refdiv;
 						if (ASIC_IS_AVIVO(rdev))
@@ -650,10 +650,12 @@ static u32 atombios_adjust_pll(struct dr
 						   index, (uint32_t *)&args);
 				adjusted_clock = le32_to_cpu(args.v3.sOutput.ulDispPllFreq) * 10;
 				if (args.v3.sOutput.ucRefDiv) {
+					pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV;
 					pll->flags |= RADEON_PLL_USE_REF_DIV;
 					pll->reference_div = args.v3.sOutput.ucRefDiv;
 				}
 				if (args.v3.sOutput.ucPostDiv) {
+					pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV;
 					pll->flags |= RADEON_PLL_USE_POST_DIV;
 					pll->post_div = args.v3.sOutput.ucPostDiv;
 				}
author
#48 lore raw

PATCH 38/70 fs/partitions: Validate map_count in Mac partition tables

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Timo Warns <[email protected]>

commit fa7ea87a057958a8b7926c1a60a3ca6d696328ed upstream.

Validate number of blocks in map and remove redundant variable.

---
 fs/partitions/mac.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
fs/partitions/mac.c +9 -8
@@ -29,10 +29,9 @@ static inline void mac_fix_string(char *
 
 int mac_partition(struct parsed_partitions *state)
 {
-	int slot = 1;
 	Sector sect;
 	unsigned char *data;
-	int blk, blocks_in_map;
+	int slot, blocks_in_map;
 	unsigned secsize;
 #ifdef CONFIG_PPC_PMAC
 	int found_root = 0;
@@ -59,10 +58,14 @@ int mac_partition(struct parsed_partitio
 		put_dev_sector(sect);
 		return 0;		/* not a MacOS disk */
 	}
-	strlcat(state->pp_buf, " [mac]", PAGE_SIZE);
 	blocks_in_map = be32_to_cpu(part->map_count);
-	for (blk = 1; blk <= blocks_in_map; ++blk) {
-		int pos = blk * secsize;
+	if (blocks_in_map < 0 || blocks_in_map >= DISK_MAX_PARTS) {
+		put_dev_sector(sect);
+		return 0;
+	}
+	strlcat(state->pp_buf, " [mac]", PAGE_SIZE);
+	for (slot = 1; slot <= blocks_in_map; ++slot) {
+		int pos = slot * secsize;
 		put_dev_sector(sect);
 		data = read_part_sector(state, pos/512, &sect);
 		if (!data)
@@ -113,13 +116,11 @@ int mac_partition(struct parsed_partitio
 			}
 
 			if (goodness > found_root_goodness) {
-				found_root = blk;
+				found_root = slot;
 				found_root_goodness = goodness;
 			}
 		}
 #endif /* CONFIG_PPC_PMAC */
-
-		++slot;
 	}
 #ifdef CONFIG_PPC_PMAC
 	if (found_root_goodness)
author
#49 lore raw

PATCH 39/70 workqueue: wake up a worker when a rescuer is leaving a gcwq

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Tejun Heo <[email protected]>

commit 7576958a9d5a4a677ad7dd40901cdbb6c1110c98 upstream.

After executing the matching works, a rescuer leaves the gcwq whether there are more pending works or not. This may decrease the concurrency level to zero and stall execution until a new work item is queued on the gcwq.

Make rescuer wake up a regular worker when it leaves a gcwq if there are more works to execute, so that execution isn't stalled.

---
 kernel/workqueue.c |    9 +++++++++
 1 file changed, 9 insertions(+)
kernel/workqueue.c +9 -0
@@ -2009,6 +2009,15 @@ repeat:
 				move_linked_works(work, scheduled, &n);
 
 		process_scheduled_works(rescuer);
+
+		/*
+		 * Leave this gcwq.  If keep_working() is %true, notify a
+		 * regular worker; otherwise, we end up with 0 concurrency
+		 * and stalling the execution.
+		 */
+		if (keep_working(gcwq))
+			wake_up_worker(gcwq);
+
 		spin_unlock_irq(&gcwq->lock);
 	}
 
author
#50 lore raw

PATCH 40/70 workqueue: make sure MAYDAY_INITIAL_TIMEOUT is at least 2 jiffies long

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Tejun Heo <[email protected]>

commit 3233cdbd9fa347a6d6897a94cc6ed0302ae83c4f upstream.

MAYDAY_INITIAL_TIMEOUT is defined as HZ / 100 and depending on configuration may end up 0 or 1. Even when it's 1, depending on when the mayday timer is added in the current jiffy interval, it may expire way before a jiffy has passed.

Make sure MAYDAY_INITIAL_TIMEOUT is at least two to guarantee that at least a full jiffy has passed before calling rescuers.

---
 kernel/workqueue.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/workqueue.c +3 -1
@@ -79,7 +79,9 @@ enum {
 	MAX_IDLE_WORKERS_RATIO	= 4,		/* 1/4 of busy can be idle */
 	IDLE_WORKER_TIMEOUT	= 300 * HZ,	/* keep idle ones for 5 mins */
 
-	MAYDAY_INITIAL_TIMEOUT	= HZ / 100,	/* call for help after 10ms */
+	MAYDAY_INITIAL_TIMEOUT  = HZ / 100 >= 2 ? HZ / 100 : 2,
+						/* call for help after 10ms
+						   (min two ticks) */
 	MAYDAY_INTERVAL		= HZ / 10,	/* and then every 100ms */
 	CREATE_COOLDOWN		= HZ,		/* time to breath after fail */
 	TRUSTEE_COOLDOWN	= HZ / 10,	/* for trustee draining */
author
#51 lore raw

PATCH 41/70 net: deinit automatic LIST_HEAD

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Eric Dumazet <[email protected]>

commit ceaaec98ad99859ac90ac6863ad0a6cd075d8e0e upstream.

commit 9b5e383c11b08784 (net: Introduce unregister_netdevice_many()) left an active LIST_HEAD() in rollback_registered(), with possible memory corruption.

Even if device is freed without touching its unreg_list (and therefore touching the previous memory location holding LISTE_HEAD(single), better close the bug for good, since its really subtle.

(Same fix for default_device_exit_batch() for completeness)

---
 net/core/dev.c |    2 ++
 1 file changed, 2 insertions(+)
net/core/dev.c +2 -0
@@ -4945,6 +4945,7 @@ static void rollback_registered(struct n
 
 	list_add(&dev->unreg_list, &single);
 	rollback_registered_many(&single);
+	list_del(&single);
 }
 
 unsigned long netdev_fix_features(unsigned long features, const char *name)
@@ -6114,6 +6115,7 @@ static void __net_exit default_device_ex
 		}
 	}
 	unregister_netdevice_many(&dev_kill_list);
+	list_del(&dev_kill_list);
 	rtnl_unlock();
 }
 
author
#52 lore raw

PATCH 42/70 iwl3945: remove plcp check

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Stanislaw Gruszka <[email protected]>

commit c91d01556f52255a31575be0cb1981c92a2a5028 upstream.

Patch fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=654599

Many users report very low speed problem on 3945 devices, this patch fixes problem, but only for some of them.

For unknown reason, sometimes after hw scanning, device is not able to receive frames at high rate. Since plcp health check may request hw scan to "reset radio", performance problem start to be observable after update kernel to .35, where plcp check was introduced.

Bug reporter confirmed that removing plcp check fixed problem for him.

---
 drivers/net/wireless/iwlwifi/iwl-3945.c |    1 -
 1 file changed, 1 deletion(-)
drivers/net/wireless/iwlwifi/iwl-3945.c +0 -1
@@ -2727,7 +2727,6 @@ static struct iwl_lib_ops iwl3945_lib =
 	.config_ap = iwl3945_config_ap,
 	.manage_ibss_station = iwl3945_manage_ibss_station,
 	.recover_from_tx_stall = iwl_bg_monitor_recover,
-	.check_plcp_health = iwl3945_good_plcp_health,
 
 	.debugfs_ops = {
 		.rx_stats_read = iwl3945_ucode_rx_stats_read,
author
#53 lore raw

PATCH 43/70 ALSA: HDA: Add position_fix quirk for an Asus device

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: David Henningsson <[email protected]>

commit b540afc2b3d6e4cd1d1f137ef6d9e9c78d67fecd upstream.

The bug reporter claims that position_fix=1 is needed for his microphone to work. The controller PCI vendor-id is [1002:4383] (rev 40).

---
 sound/pci/hda/hda_intel.c |    1 +
 1 file changed, 1 insertion(+)
sound/pci/hda/hda_intel.c +1 -0
@@ -2305,6 +2305,7 @@ static struct snd_pci_quirk position_fix
 	SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB),
+	SND_PCI_QUIRK(0x1043, 0x8410, "ASUS", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB),
 	SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba A100-259", POS_FIX_LPIB),
author
#54 lore raw

PATCH 44/70 ALSA: caiaq - Fix possible string-buffer overflow

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Takashi Iwai <[email protected]>

commit eaae55dac6b64c0616046436b294e69fc5311581 upstream.

Use strlcpy() to assure not to overflow the string array sizes by too long USB device name string.

---
 sound/usb/caiaq/audio.c |    2 +-
 sound/usb/caiaq/midi.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
sound/usb/caiaq/audio.c +1 -1
@@ -785,7 +785,7 @@ int snd_usb_caiaq_audio_init(struct snd_
 	}
 
 	dev->pcm->private_data = dev;
-	strcpy(dev->pcm->name, dev->product_name);
+	strlcpy(dev->pcm->name, dev->product_name, sizeof(dev->pcm->name));
 
 	memset(dev->sub_playback, 0, sizeof(dev->sub_playback));
 	memset(dev->sub_capture, 0, sizeof(dev->sub_capture));
sound/usb/caiaq/midi.c +1 -1
@@ -136,7 +136,7 @@ int snd_usb_caiaq_midi_init(struct snd_u
 	if (ret < 0)
 		return ret;
 
-	strcpy(rmidi->name, device->product_name);
+	strlcpy(rmidi->name, device->product_name, sizeof(rmidi->name));
 
 	rmidi->info_flags = SNDRV_RAWMIDI_INFO_DUPLEX;
 	rmidi->private_data = device;
author
#55 lore raw

PATCH 45/70 ALSA: HDA: Do not announce false surround in Conexant auto

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: David Henningsson <[email protected]>

commit 89724958e5d596bb91328644c97dd80399443e87 upstream.

Without this patch, one line-out and one speaker and Conexant's auto parser would announce (non-working) surround capabilities.

---
 sound/pci/hda/patch_conexant.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_conexant.c +1 -1
@@ -3401,7 +3401,7 @@ static void cx_auto_parse_output(struct
 		}
 	}
 	spec->multiout.dac_nids = spec->private_dac_nids;
-	spec->multiout.max_channels = nums * 2;
+	spec->multiout.max_channels = spec->multiout.num_dacs * 2;
 
 	if (cfg->hp_outs > 0)
 		spec->auto_mute = 1;
author
#56 lore raw

PATCH 46/70 hwmon: (lm85) extend to support EMC6D103 chips

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Jan Beulich <[email protected]>

commit f065a93e168299569078bc6f52128b57f602fff3 upstream.

The interface is identical EMC6D102, so all that needs to be added are some definitions and their uses.

Registers apparently missing in EMC6D103S/EMC6D103:A2 compared to EMC6D103:A0, EMC6D103:A1, and EMC6D102 (according to the data sheets), but used unconditionally in the driver: 62[5:7], 6D[0:7], and 6E[0:7]. For that reason, EMC6D103S chips don't get enabled for the time being.

(Guenter Roeck: Replaced EMC6D103_A2 with EMC6D103S per EMC6D103S datasheet)

---
 drivers/hwmon/Kconfig |    2 +-
 drivers/hwmon/lm85.c  |   23 +++++++++++++++++++++--
 2 files changed, 22 insertions(+), 3 deletions(-)
drivers/hwmon/Kconfig +1 -1
@@ -564,7 +564,7 @@ config SENSORS_LM85
 	help
 	  If you say yes here you get support for National Semiconductor LM85
 	  sensor chips and clones: ADM1027, ADT7463, ADT7468, EMC6D100,
-	  EMC6D101 and EMC6D102.
+	  EMC6D101, EMC6D102, and EMC6D103.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called lm85.
drivers/hwmon/lm85.c +21 -2
@@ -41,7 +41,7 @@ static const unsigned short normal_i2c[]
 enum chips {
 	any_chip, lm85b, lm85c,
 	adm1027, adt7463, adt7468,
-	emc6d100, emc6d102
+	emc6d100, emc6d102, emc6d103
 };
 
 /* The LM85 registers */
@@ -90,6 +90,9 @@ enum chips {
 #define	LM85_VERSTEP_EMC6D100_A0        0x60
 #define	LM85_VERSTEP_EMC6D100_A1        0x61
 #define	LM85_VERSTEP_EMC6D102		0x65
+#define	LM85_VERSTEP_EMC6D103_A0	0x68
+#define	LM85_VERSTEP_EMC6D103_A1	0x69
+#define	LM85_VERSTEP_EMC6D103S		0x6A	/* Also known as EMC6D103:A2 */
 
 #define	LM85_REG_CONFIG			0x40
 
@@ -348,6 +351,7 @@ static const struct i2c_device_id lm85_i
 	{ "emc6d100", emc6d100 },
 	{ "emc6d101", emc6d100 },
 	{ "emc6d102", emc6d102 },
+	{ "emc6d103", emc6d103 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, lm85_id);
@@ -1250,6 +1254,20 @@ static int lm85_detect(struct i2c_client
 		case LM85_VERSTEP_EMC6D102:
 			type_name = "emc6d102";
 			break;
+		case LM85_VERSTEP_EMC6D103_A0:
+		case LM85_VERSTEP_EMC6D103_A1:
+			type_name = "emc6d103";
+			break;
+		/*
+		 * Registers apparently missing in EMC6D103S/EMC6D103:A2
+		 * compared to EMC6D103:A0, EMC6D103:A1, and EMC6D102
+		 * (according to the data sheets), but used unconditionally
+		 * in the driver: 62[5:7], 6D[0:7], and 6E[0:7].
+		 * So skip EMC6D103S for now.
+		case LM85_VERSTEP_EMC6D103S:
+			type_name = "emc6d103s";
+			break;
+		 */
 		}
 	} else {
 		dev_dbg(&adapter->dev,
@@ -1283,6 +1301,7 @@ static int lm85_probe(struct i2c_client
 	case adt7468:
 	case emc6d100:
 	case emc6d102:
+	case emc6d103:
 		data->freq_map = adm1027_freq_map;
 		break;
 	default:
@@ -1468,7 +1487,7 @@ static struct lm85_data *lm85_update_dev
 			/* More alarm bits */
 			data->alarms |= lm85_read_value(client,
 						EMC6D100_REG_ALARM3) << 16;
-		} else if (data->type == emc6d102) {
+		} else if (data->type == emc6d102 || data->type == emc6d103) {
 			/* Have to read LSB bits after the MSB ones because
 			   the reading of the MSB bits has frozen the
 			   LSBs (backward from the ADM1027).
author
#57 lore raw

PATCH 47/70 x86, AMD, PCI: Add AMD northbridge PCI device id for CPU families 12h and 14h

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Robert Richter <[email protected]>

commit ca86828ccd3128513f6d4e200b437deac95408db upstream.

This patch adds the PCI northbridge device id for AMD CPU families 12h and 14h. Both families have implemented the same PCI northbridge device.

There are some future use cases that use this PCI device and we would like to clarify its naming.

LKML-Reference: <[email protected]>

---
 include/linux/pci_ids.h |    1 +
 1 file changed, 1 insertion(+)
include/linux/pci_ids.h +1 -0
@@ -518,6 +518,7 @@
 #define PCI_DEVICE_ID_AMD_11H_NB_MISC	0x1303
 #define PCI_DEVICE_ID_AMD_11H_NB_LINK	0x1304
 #define PCI_DEVICE_ID_AMD_15H_NB_MISC	0x1603
+#define PCI_DEVICE_ID_AMD_CNB17H_F3	0x1703
 #define PCI_DEVICE_ID_AMD_LANCE		0x2000
 #define PCI_DEVICE_ID_AMD_LANCE_HOME	0x2001
 #define PCI_DEVICE_ID_AMD_SCSI		0x2020
author
#58 lore raw

PATCH 48/70 hwmon: (k10temp) add support for AMD Family 12h/14h CPUs

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Clemens Ladisch <[email protected]>

commit aa4790a6287818078ca968164a5f0d0870326602 upstream.

Add the PCI ID to support the internal temperature sensor of the AMD "Llano" and "Brazos" processor families.

---
 Documentation/hwmon/k10temp |    8 +++++++-
 drivers/hwmon/Kconfig       |    6 +++---
 drivers/hwmon/k10temp.c     |    5 +++--
 3 files changed, 13 insertions(+), 6 deletions(-)
Documentation/hwmon/k10temp +7 -1
@@ -9,6 +9,8 @@ Supported chips:
   Socket S1G3: Athlon II, Sempron, Turion II
 * AMD Family 11h processors:
   Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra)
+* AMD Family 12h processors: "Llano"
+* AMD Family 14h processors: "Brazos" (C/E/G-Series)
 
   Prefix: 'k10temp'
   Addresses scanned: PCI space
@@ -17,10 +19,14 @@ Supported chips:
     http://support.amd.com/us/Processor_TechDocs/31116.pdf
   BIOS and Kernel Developer's Guide (BKDG) for AMD Family 11h Processors:
     http://support.amd.com/us/Processor_TechDocs/41256.pdf
+  BIOS and Kernel Developer's Guide (BKDG) for AMD Family 14h Models 00h-0Fh Processors:
+    http://support.amd.com/us/Processor_TechDocs/43170.pdf
   Revision Guide for AMD Family 10h Processors:
     http://support.amd.com/us/Processor_TechDocs/41322.pdf
   Revision Guide for AMD Family 11h Processors:
     http://support.amd.com/us/Processor_TechDocs/41788.pdf
+  Revision Guide for AMD Family 14h Models 00h-0Fh Processors:
+    http://support.amd.com/us/Processor_TechDocs/47534.pdf
   AMD Family 11h Processor Power and Thermal Data Sheet for Notebooks:
     http://support.amd.com/us/Processor_TechDocs/43373.pdf
   AMD Family 10h Server and Workstation Processor Power and Thermal Data Sheet:
@@ -34,7 +40,7 @@ Description
 -----------
 
 This driver permits reading of the internal temperature sensor of AMD
-Family 10h and 11h processors.
+Family 10h/11h/12h/14h processors.
 
 All these processors have a sensor, but on those for Socket F or AM2+,
 the sensor may return inconsistent values (erratum 319).  The driver
drivers/hwmon/Kconfig +3 -3
@@ -238,13 +238,13 @@ config SENSORS_K8TEMP
 	  will be called k8temp.
 
 config SENSORS_K10TEMP
-	tristate "AMD Phenom/Sempron/Turion/Opteron temperature sensor"
+	tristate "AMD Family 10h/11h/12h/14h temperature sensor"
 	depends on X86 && PCI
 	help
 	  If you say yes here you get support for the temperature
 	  sensor(s) inside your CPU. Supported are later revisions of
-	  the AMD Family 10h and all revisions of the AMD Family 11h
-	  microarchitectures.
+	  the AMD Family 10h and all revisions of the AMD Family 11h,
+	  12h (Llano), and 14h (Brazos) microarchitectures.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called k10temp.
drivers/hwmon/k10temp.c +3 -2
@@ -1,5 +1,5 @@
 /*
- * k10temp.c - AMD Family 10h/11h processor hardware monitoring
+ * k10temp.c - AMD Family 10h/11h/12h/14h processor hardware monitoring
  *
  * Copyright (c) 2009 Clemens Ladisch <[email protected]>
  *
@@ -25,7 +25,7 @@
 #include <linux/pci.h>
 #include <asm/processor.h>
 
-MODULE_DESCRIPTION("AMD Family 10h/11h CPU core temperature monitor");
+MODULE_DESCRIPTION("AMD Family 10h/11h/12h/14h CPU core temperature monitor");
 MODULE_AUTHOR("Clemens Ladisch <[email protected]>");
 MODULE_LICENSE("GPL");
 
@@ -208,6 +208,7 @@ static void __devexit k10temp_remove(str
 static const struct pci_device_id k10temp_id_table[] = {
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) },
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) },
+	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) },
 	{}
 };
 MODULE_DEVICE_TABLE(pci, k10temp_id_table);
author
#59 lore raw

PATCH 49/70 hwmon: (jc42) fix type mismatch

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Clemens Ladisch <[email protected]>

commit e866729605a43a739fc56023a8530b07a93d3458 upstream.

In set_temp_crit_hyst(), make the variable 'val' have the correct type for strict_strtoul().

---
 drivers/hwmon/jc42.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/jc42.c +1 -1
@@ -332,7 +332,7 @@ static ssize_t set_temp_crit_hyst(struct
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct jc42_data *data = i2c_get_clientdata(client);
-	long val;
+	unsigned long val;
 	int diff, hyst;
 	int err;
 	int ret = count;
author
#60 lore raw

PATCH 50/70 hwmon: (jc42) more helpful documentation

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Clemens Ladisch <[email protected]>

commit d5622f5b6c4671d1588ccc9056705366d4eb312a upstream.

The documentation lists standard numbers and chip names in excruciating detail, but that's all it does. To help mere mortals in deciding whether to enable this driver, mention what this sensor is for and in which systems it might be found.

Also add a link to the actual JC 42.4 specification.

---
 Documentation/hwmon/jc42 |    9 +++++++--
 drivers/hwmon/Kconfig    |   11 ++++++-----
 2 files changed, 13 insertions(+), 7 deletions(-)
Documentation/hwmon/jc42 +7 -2
@@ -51,7 +51,8 @@ Supported chips:
   * JEDEC JC 42.4 compliant temperature sensor chips
     Prefix: 'jc42'
     Addresses scanned: I2C 0x18 - 0x1f
-    Datasheet: -
+    Datasheet:
+	http://www.jedec.org/sites/default/files/docs/4_01_04R19.pdf
 
 Author:
 	Guenter Roeck <[email protected]>
@@ -60,7 +61,11 @@ Author:
 Description
 -----------
 
-This driver implements support for JEDEC JC 42.4 compliant temperature sensors.
+This driver implements support for JEDEC JC 42.4 compliant temperature sensors,
+which are used on many DDR3 memory modules for mobile devices and servers. Some
+systems use the sensor to prevent memory overheating by automatically throttling
+the memory controller.
+
 The driver auto-detects the chips listed above, but can be manually instantiated
 to support other JC 42.4 compliant chips.
 
drivers/hwmon/Kconfig +6 -5
@@ -445,13 +445,14 @@ config SENSORS_JZ4740
 	  called jz4740-hwmon.
 
 config SENSORS_JC42
-	tristate "JEDEC JC42.4 compliant temperature sensors"
+	tristate "JEDEC JC42.4 compliant memory module temperature sensors"
 	depends on I2C
 	help
-	  If you say yes here you get support for Jedec JC42.4 compliant
-	  temperature sensors. Support will include, but not be limited to,
-	  ADT7408, CAT34TS02,, CAT6095, MAX6604, MCP9805, MCP98242, MCP98243,
-	  MCP9843, SE97, SE98, STTS424, TSE2002B3, and TS3000B3.
+	  If you say yes here, you get support for JEDEC JC42.4 compliant
+	  temperature sensors, which are used on many DDR3 memory modules for
+	  mobile devices and servers.  Support will include, but not be limited
+	  to, ADT7408, CAT34TS02, CAT6095, MAX6604, MCP9805, MCP98242, MCP98243,
+	  MCP9843, SE97, SE98, STTS424(E), TSE2002B3, and TS3000B3.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called jc42.
author
#61 lore raw

PATCH 51/70 hwmon: (jc42) do not allow writing to locked registers

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Clemens Ladisch <[email protected]>

commit 2c6315da6a1657a49e03970a4084dc3d1958ad70 upstream.

On systems where the temperature sensor is actually used, the BIOS is likely to have locked the alarm registers. In that case, all writes through the corresponding sysfs files would be silently ignored.

To prevent this, detect the locks and make the affected sysfs files read-only.

---
 Documentation/hwmon/jc42 |   12 ++++++++----
 drivers/hwmon/jc42.c     |   33 +++++++++++++++++++++++++++++----
 2 files changed, 37 insertions(+), 8 deletions(-)
Documentation/hwmon/jc42 +8 -4
@@ -86,15 +86,19 @@ limits. The chip supports only a single
 which applies to all limits. This register can be written by writing into
 temp1_crit_hyst. Other hysteresis attributes are read-only.
 
+If the BIOS has configured the sensor for automatic temperature management, it
+is likely that it has locked the registers, i.e., that the temperature limits
+cannot be changed.
+
 Sysfs entries
 -------------
 
 temp1_input		Temperature (RO)
-temp1_min		Minimum temperature (RW)
-temp1_max		Maximum temperature (RW)
-temp1_crit		Critical high temperature (RW)
+temp1_min		Minimum temperature (RO or RW)
+temp1_max		Maximum temperature (RO or RW)
+temp1_crit		Critical high temperature (RO or RW)
 
-temp1_crit_hyst		Critical hysteresis temperature (RW)
+temp1_crit_hyst		Critical hysteresis temperature (RO or RW)
 temp1_max_hyst		Maximum hysteresis temperature (RO)
 
 temp1_min_alarm		Temperature low alarm
drivers/hwmon/jc42.c +29 -4
@@ -53,6 +53,8 @@ static const unsigned short normal_i2c[]
 
 /* Configuration register defines */
 #define JC42_CFG_CRIT_ONLY	(1 << 2)
+#define JC42_CFG_TCRIT_LOCK	(1 << 6)
+#define JC42_CFG_EVENT_LOCK	(1 << 7)
 #define JC42_CFG_SHUTDOWN	(1 << 8)
 #define JC42_CFG_HYST_SHIFT	9
 #define JC42_CFG_HYST_MASK	0x03
@@ -380,14 +382,14 @@ static ssize_t show_alarm(struct device
 
 static DEVICE_ATTR(temp1_input, S_IRUGO,
 		   show_temp_input, NULL);
-static DEVICE_ATTR(temp1_crit, S_IWUSR | S_IRUGO,
+static DEVICE_ATTR(temp1_crit, S_IRUGO,
 		   show_temp_crit, set_temp_crit);
-static DEVICE_ATTR(temp1_min, S_IWUSR | S_IRUGO,
+static DEVICE_ATTR(temp1_min, S_IRUGO,
 		   show_temp_min, set_temp_min);
-static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO,
+static DEVICE_ATTR(temp1_max, S_IRUGO,
 		   show_temp_max, set_temp_max);
 
-static DEVICE_ATTR(temp1_crit_hyst, S_IWUSR | S_IRUGO,
+static DEVICE_ATTR(temp1_crit_hyst, S_IRUGO,
 		   show_temp_crit_hyst, set_temp_crit_hyst);
 static DEVICE_ATTR(temp1_max_hyst, S_IRUGO,
 		   show_temp_max_hyst, NULL);
@@ -412,8 +414,31 @@ static struct attribute *jc42_attributes
 	NULL
 };
 
+static mode_t jc42_attribute_mode(struct kobject *kobj,
+				  struct attribute *attr, int index)
+{
+	struct device *dev = container_of(kobj, struct device, kobj);
+	struct i2c_client *client = to_i2c_client(dev);
+	struct jc42_data *data = i2c_get_clientdata(client);
+	unsigned int config = data->config;
+	bool readonly;
+
+	if (attr == &dev_attr_temp1_crit.attr)
+		readonly = config & JC42_CFG_TCRIT_LOCK;
+	else if (attr == &dev_attr_temp1_min.attr ||
+		 attr == &dev_attr_temp1_max.attr)
+		readonly = config & JC42_CFG_EVENT_LOCK;
+	else if (attr == &dev_attr_temp1_crit_hyst.attr)
+		readonly = config & (JC42_CFG_EVENT_LOCK | JC42_CFG_TCRIT_LOCK);
+	else
+		readonly = true;
+
+	return S_IRUGO | (readonly ? 0 : S_IWUSR);
+}
+
 static const struct attribute_group jc42_group = {
 	.attrs = jc42_attributes,
+	.is_visible = jc42_attribute_mode,
 };
 
 /* Return 0 if detection is successful, -ENODEV otherwise */
author
#62 lore raw

PATCH 52/70 netfilter: fix race in conntrack between dump_table and destroy

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Stephen Hemminger <[email protected]>

commit 13ee6ac579574a2a95e982b19920fd2495dce8cd upstream.

The netlink interface to dump the connection tracking table has a race when entries are deleted at the same time. A customer reported a crash and the backtrace showed thatctnetlink_dump_table was running while a conntrack entry was being destroyed.
(see https://bugzilla.vyatta.com/show_bug.cgi?id=6402).

According to RCU documentation, when using hlist_nulls the reader must handle the case of seeing a deleted entry and not proceed further down the linked list. The old code would continue which caused the scan to walk into the free list.

This patch uses locking (rather than RCU) for this operation which is guaranteed safe, and no longer requires getting reference while doing dump operation.

---
 net/netfilter/nf_conntrack_netlink.c |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
net/netfilter/nf_conntrack_netlink.c +5 -9
@@ -642,25 +642,23 @@ ctnetlink_dump_table(struct sk_buff *skb
 	struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
 	u_int8_t l3proto = nfmsg->nfgen_family;
 
-	rcu_read_lock();
+	spin_lock_bh(&nf_conntrack_lock);
 	last = (struct nf_conn *)cb->args[1];
 	for (; cb->args[0] < net->ct.htable_size; cb->args[0]++) {
 restart:
-		hlist_nulls_for_each_entry_rcu(h, n, &net->ct.hash[cb->args[0]],
+		hlist_nulls_for_each_entry(h, n, &net->ct.hash[cb->args[0]],
 					 hnnode) {
 			if (NF_CT_DIRECTION(h) != IP_CT_DIR_ORIGINAL)
 				continue;
 			ct = nf_ct_tuplehash_to_ctrack(h);
-			if (!atomic_inc_not_zero(&ct->ct_general.use))
-				continue;
 			/* Dump entries of a given L3 protocol number.
 			 * If it is not specified, ie. l3proto == 0,
 			 * then dump everything. */
 			if (l3proto && nf_ct_l3num(ct) != l3proto)
-				goto releasect;
+				continue;
 			if (cb->args[1]) {
 				if (ct != last)
-					goto releasect;
+					continue;
 				cb->args[1] = 0;
 			}
 			if (ctnetlink_fill_info(skb, NETLINK_CB(cb->skb).pid,
@@ -678,8 +676,6 @@ restart:
 				if (acct)
 					memset(acct, 0, sizeof(struct nf_conn_counter[IP_CT_DIR_MAX]));
 			}
-releasect:
-		nf_ct_put(ct);
 		}
 		if (cb->args[1]) {
 			cb->args[1] = 0;
@@ -687,7 +683,7 @@ releasect:
 		}
 	}
 out:
-	rcu_read_unlock();
+	spin_unlock_bh(&nf_conntrack_lock);
 	if (last)
 		nf_ct_put(last);
 
author
#63 lore raw

PATCH 53/70 netfilter: ctnetlink: fix missing refcount increment during dumps

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Pablo Neira Ayuso <[email protected]>

commit c71caf4114a0e1da3451cc92fba6a152929cd4c2 upstream.

In 13ee6ac netfilter: fix race in conntrack between dump_table and destroy, we recovered spinlocks to protect the dump of the conntrack table according to reports from Stephen and acknowledgments on the issue from Eric.

In that patch, the refcount bump that allows to keep a reference to the current ct object was removed. However, we still decrement the refcount for that object in the output path of ctnetlink_dump_table():

        if (last)
                nf_ct_put(last)
---
 net/netfilter/nf_conntrack_netlink.c |    1 +
 1 file changed, 1 insertion(+)
net/netfilter/nf_conntrack_netlink.c +1 -0
@@ -664,6 +664,7 @@ restart:
 			if (ctnetlink_fill_info(skb, NETLINK_CB(cb->skb).pid,
 						cb->nlh->nlmsg_seq,
 						IPCTNL_MSG_CT_NEW, ct) < 0) {
+				nf_conntrack_get(&ct->ct_general);
 				cb->args[1] = (unsigned long)ct;
 				goto out;
 			}
author
#64 lore raw

PATCH 54/70 radio-aimslab.c needs #include <linux/delay.h>

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Geert Uytterhoeven <[email protected]>

commit 2400982a2e8a8e4e95f0a0e1517bbe63cc88038f upstream.

Commit e3c92215198cb6aa00ad38db2780faa6b72e0a3f ("[media] radio-aimslab.c: Fix gcc 4.5+ bug") removed the include, but introduced new callers of msleep():

| drivers/media/radio/radio-aimslab.c: In function ‘rt_decvol’:
| drivers/media/radio/radio-aimslab.c:76: error: implicit declaration of function ‘msleep’

---
 drivers/media/radio/radio-aimslab.c |    1 +
 1 file changed, 1 insertion(+)
drivers/media/radio/radio-aimslab.c +1 -0
@@ -31,6 +31,7 @@
 #include <linux/module.h>	/* Modules 			*/
 #include <linux/init.h>		/* Initdata			*/
 #include <linux/ioport.h>	/* request_region		*/
+#include <linux/delay.h>	/* msleep			*/
 #include <linux/videodev2.h>	/* kernel radio structs		*/
 #include <linux/version.h>	/* for KERNEL_VERSION MACRO	*/
 #include <linux/io.h>		/* outb, outb_p			*/
author
#65 lore raw

PATCH 55/70 ARM: Ensure predictable endian state on signal handler entry

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Russell King <[email protected]>

commit 53399053eb505cf541b2405bd9d9bca5ecfb96fb upstream.

Ensure a predictable endian state when entering signal handlers. This avoids programs which use SETEND to momentarily switch their endian state from having their signal handlers entered with an unpredictable endian state.

---
 arch/arm/kernel/signal.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/kernel/signal.c +3 -1
@@ -474,7 +474,9 @@ setup_return(struct pt_regs *regs, struc
 	unsigned long handler = (unsigned long)ka->sa.sa_handler;
 	unsigned long retcode;
 	int thumb = 0;
-	unsigned long cpsr = regs->ARM_cpsr & ~PSR_f;
+	unsigned long cpsr = regs->ARM_cpsr & ~(PSR_f | PSR_E_BIT);
+
+	cpsr |= PSR_ENDSTATE;
 
 	/*
 	 * Maybe we need to deliver a 32-bit signal to a 26-bit task.
author
#66 lore raw

PATCH 56/70 ARM: Keep exit text/data around for SMP_ON_UP

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Russell King <[email protected]>

commit a9ad21fed09cb95d34af9474be0831525b30c4c6 upstream.

When SMP_ON_UP is used and the spinlocks are inlined, we end up with inline spinlocks in the exit code, with references from the SMP alternatives section to the exit sections. This causes link time errors. Avoid this by placing the exit sections in the init-discarded region.

---
 arch/arm/kernel/vmlinux.lds.S |    9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/kernel/vmlinux.lds.S +9 -0
@@ -21,6 +21,12 @@
 #define ARM_CPU_KEEP(x)
 #endif
 
+#if defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)
+#define ARM_EXIT_KEEP(x)	x
+#else
+#define ARM_EXIT_KEEP(x)
+#endif
+
 OUTPUT_ARCH(arm)
 ENTRY(stext)
 
@@ -43,6 +49,7 @@ SECTIONS
 		_sinittext = .;
 			HEAD_TEXT
 			INIT_TEXT
+			ARM_EXIT_KEEP(EXIT_TEXT)
 		_einittext = .;
 		ARM_CPU_DISCARD(PROC_INFO)
 		__arch_info_begin = .;
@@ -67,6 +74,7 @@ SECTIONS
 #ifndef CONFIG_XIP_KERNEL
 		__init_begin = _stext;
 		INIT_DATA
+		ARM_EXIT_KEEP(EXIT_DATA)
 #endif
 	}
 
@@ -161,6 +169,7 @@ SECTIONS
 		. = ALIGN(PAGE_SIZE);
 		__init_begin = .;
 		INIT_DATA
+		ARM_EXIT_KEEP(EXIT_DATA)
 		. = ALIGN(PAGE_SIZE);
 		__init_end = .;
 #endif
author
#67 lore raw

PATCH 57/70 cifs: fix handling of scopeid in cifs_convert_address

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Jeff Layton <[email protected]>

commit 9616125611ee47693186533d76e403856a36b3c8 upstream.

The code finds, the '%' sign in an ipv6 address and copies that to a buffer allocated on the stack. It then ignores that buffer, and passes 'pct' to simple_strtoul(), which doesn't work right because we're comparing 'endp' against a completely different string.

Fix it by passing the correct pointer. While we're at it, this is a good candidate for conversion to strict_strtoul as well.

---
 fs/cifs/netmisc.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/cifs/netmisc.c +4 -4
@@ -170,7 +170,7 @@ cifs_convert_address(struct sockaddr *ds
 {
 	int rc, alen, slen;
 	const char *pct;
-	char *endp, scope_id[13];
+	char scope_id[13];
 	struct sockaddr_in *s4 = (struct sockaddr_in *) dst;
 	struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) dst;
 
@@ -197,9 +197,9 @@ cifs_convert_address(struct sockaddr *ds
 		memcpy(scope_id, pct + 1, slen);
 		scope_id[slen] = '\0';
 
-		s6->sin6_scope_id = (u32) simple_strtoul(pct, &endp, 0);
-		if (endp != scope_id + slen)
-			return 0;
+		rc = strict_strtoul(scope_id, 0,
+					(unsigned long *)&s6->sin6_scope_id);
+		rc = (rc == 0) ? 1 : 0;
 	}
 
 	return rc;
author
#68 lore raw

PATCH 58/70 cifs: Fix regression in LANMAN (LM) auth code

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Shirish Pargaonkar <[email protected]>

commit 5e640927a597a7c3e72b61e8bce74c22e906de65 upstream.

LANMAN response length was changed to 16 bytes instead of 24 bytes. Revert it back to 24 bytes.

---
 fs/cifs/sess.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/cifs/sess.c +4 -4
@@ -667,13 +667,13 @@ ssetup_ntlmssp_authenticate:
 
 	if (type == LANMAN) {
 #ifdef CONFIG_CIFS_WEAK_PW_HASH
-		char lnm_session_key[CIFS_SESS_KEY_SIZE];
+		char lnm_session_key[CIFS_AUTH_RESP_SIZE];
 
 		pSMB->req.hdr.Flags2 &= ~SMBFLG2_UNICODE;
 
 		/* no capabilities flags in old lanman negotiation */
 
-		pSMB->old_req.PasswordLength = cpu_to_le16(CIFS_SESS_KEY_SIZE);
+		pSMB->old_req.PasswordLength = cpu_to_le16(CIFS_AUTH_RESP_SIZE);
 
 		/* Calculate hash with password and copy into bcc_ptr.
 		 * Encryption Key (stored as in cryptkey) gets used if the
@@ -686,8 +686,8 @@ ssetup_ntlmssp_authenticate:
 					true : false, lnm_session_key);
 
 		ses->flags |= CIFS_SES_LANMAN;
-		memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_SESS_KEY_SIZE);
-		bcc_ptr += CIFS_SESS_KEY_SIZE;
+		memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_AUTH_RESP_SIZE);
+		bcc_ptr += CIFS_AUTH_RESP_SIZE;
 
 		/* can not sign if LANMAN negotiated so no need
 		to calculate signing key? but what if server
author
#69 lore raw

PATCH 59/70 acer-wmi: Fix capitalisation of GUID

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Matthew Garrett <[email protected]>

commit bbb706079abe955a9e3f208f541de97d99449236 upstream.

6AF4F258-B401-42fd-BE91-3D4AC2D7C0D3 needs to be 6AF4F258-B401-42FD-BE91-3D4AC2D7C0D3 to match the hardware alias.

---
 drivers/platform/x86/acer-wmi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/acer-wmi.c +1 -1
@@ -80,7 +80,7 @@ MODULE_LICENSE("GPL");
  */
 #define AMW0_GUID1		"67C3371D-95A3-4C37-BB61-DD47B491DAAB"
 #define AMW0_GUID2		"431F16ED-0C2B-444C-B267-27DEB140CF9C"
-#define WMID_GUID1		"6AF4F258-B401-42fd-BE91-3D4AC2D7C0D3"
+#define WMID_GUID1		"6AF4F258-B401-42FD-BE91-3D4AC2D7C0D3"
 #define WMID_GUID2		"95764E09-FB56-4e83-B31A-37761F60994A"
 
 MODULE_ALIAS("wmi:67C3371D-95A3-4C37-BB61-DD47B491DAAB");
author
#70 lore raw

PATCH 60/70 pcmcia: re-enable Zoomed Video support

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Dominik Brodowski <[email protected]>

commit 33619f0d3ff715a2a5499520967d526ad931d70d upstream.

Allow drivers to enable Zoomed Video support. Currently, this is only used by out-of-tree drivers (L64020 DVB driver in particular).

---
 drivers/pcmcia/pcmcia_resource.c |    2 ++
 include/pcmcia/ds.h              |    1 +
 2 files changed, 3 insertions(+)
drivers/pcmcia/pcmcia_resource.c +2 -0
@@ -518,6 +518,8 @@ int pcmcia_enable_device(struct pcmcia_d
 		flags |= CONF_ENABLE_IOCARD;
 	if (flags & CONF_ENABLE_IOCARD)
 		s->socket.flags |= SS_IOCARD;
+	if (flags & CONF_ENABLE_ZVCARD)
+		s->socket.flags |= SS_ZVCARD | SS_IOCARD;
 	if (flags & CONF_ENABLE_SPKR) {
 		s->socket.flags |= SS_SPKR_ENA;
 		status = CCSR_AUDIO_ENA;
include/pcmcia/ds.h +1 -0
@@ -261,6 +261,7 @@ void pcmcia_disable_device(struct pcmcia
 #define CONF_ENABLE_ESR         0x0008
 #define CONF_ENABLE_IOCARD	0x0010 /* auto-enabled if IO resources or IRQ
 					* (CONF_ENABLE_IRQ) in use */
+#define CONF_ENABLE_ZVCARD	0x0020
 
 /* flags used by pcmcia_loop_config() autoconfiguration */
 #define CONF_AUTO_CHECK_VCC	0x0100 /* check for matching Vcc? */
author
#71 lore raw

PATCH 61/70 eCryptfs: Copy up lower inode attrs in getattr

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Tyler Hicks <[email protected]>

commit 55f9cf6bbaa682958a7dd2755f883b768270c3ce upstream.

The lower filesystem may do some type of inode revalidation during a getattr call. eCryptfs should take advantage of that by copying the lower inode attributes to the eCryptfs inode after a call to vfs_getattr() on the lower inode.

I originally wrote this fix while working on eCryptfs on nfsv3 support, but discovered it also fixed an eCryptfs on ext4 nanosecond timestamp bug that was reported.

https://bugs.launchpad.net/bugs/613873

---
 fs/ecryptfs/inode.c |    2 ++
 1 file changed, 2 insertions(+)
fs/ecryptfs/inode.c +2 -0
@@ -1095,6 +1095,8 @@ int ecryptfs_getattr(struct vfsmount *mn
 	rc = vfs_getattr(ecryptfs_dentry_to_lower_mnt(dentry),
 			 ecryptfs_dentry_to_lower(dentry), &lower_stat);
 	if (!rc) {
+		fsstack_copy_attr_all(dentry->d_inode,
+				      ecryptfs_inode_to_lower(dentry->d_inode));
 		generic_fillattr(dentry->d_inode, stat);
 		stat->blocks = lower_stat.blocks;
 	}
author
#72 lore raw

PATCH 62/70 genirq: Prevent access beyond allocated_irqs bitmap

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Thomas Gleixner <[email protected]>

commit c1ee6264280e740a9d3ff3feef38642cf0a57013 upstream.

Lars-Peter Clausen pointed out:

I stumbled upon this while looking through the existing archs using SPARSE_IRQ. Even with SPARSE_IRQ the NR_IRQS is still the upper limit for the number of IRQs.

Both PXA and MMP set NR_IRQS to IRQ_BOARD_START, with IRQ_BOARD_START being the number of IRQs used by the core.

In various machine files the nr_irqs field of the ARM machine defintion struct is then set to "IRQ_BOARD_START + NR_BOARD_IRQS".

As a result "nr_irqs" will greater then NR_IRQS which then again causes the "allocated_irqs" bitmap in the core irq code to be accessed beyond its size overwriting unrelated data.

The core code really misses a sanity check there.

This went unnoticed so far as by chance the compiler/linker places data behind that bitmap which gets initialized later on those affected platforms.

So the obvious fix would be to add a sanity check in early_irq_init() and break all affected platforms. Though that check wants to be backported to stable as well, which will require to fix all known problematic platforms and probably some more yet not known ones as well. Lots of churn.

A way simpler solution is to allocate a slightly larger bitmap and avoid the whole churn w/o breaking anything. Add a few warnings when an arch returns utter crap.

---
 kernel/irq/internals.h |    6 ++++++
 kernel/irq/irqdesc.c   |   11 ++++++++++-
 kernel/irq/resend.c    |    2 +-
 3 files changed, 17 insertions(+), 2 deletions(-)
kernel/irq/internals.h +6 -0
@@ -3,6 +3,12 @@
  */
 #include <linux/irqdesc.h>
 
+#ifdef CONFIG_SPARSE_IRQ
+# define IRQ_BITMAP_BITS	(NR_IRQS + 8196)
+#else
+# define IRQ_BITMAP_BITS	NR_IRQS
+#endif
+
 extern int noirqdebug;
 
 #define irq_data_to_desc(data)	container_of(data, struct irq_desc, irq_data)
kernel/irq/irqdesc.c +10 -1
@@ -91,7 +91,7 @@ int nr_irqs = NR_IRQS;
 EXPORT_SYMBOL_GPL(nr_irqs);
 
 static DEFINE_MUTEX(sparse_irq_lock);
-static DECLARE_BITMAP(allocated_irqs, NR_IRQS);
+static DECLARE_BITMAP(allocated_irqs, IRQ_BITMAP_BITS);
 
 #ifdef CONFIG_SPARSE_IRQ
 
@@ -215,6 +215,15 @@ int __init early_irq_init(void)
 	initcnt = arch_probe_nr_irqs();
 	printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d %d\n", NR_IRQS, nr_irqs, initcnt);
 
+	if (WARN_ON(nr_irqs > IRQ_BITMAP_BITS))
+		nr_irqs = IRQ_BITMAP_BITS;
+
+	if (WARN_ON(initcnt > IRQ_BITMAP_BITS))
+		initcnt = IRQ_BITMAP_BITS;
+
+	if (initcnt > nr_irqs)
+		nr_irqs = initcnt;
+
 	for (i = 0; i < initcnt; i++) {
 		desc = alloc_desc(i, node);
 		set_bit(i, allocated_irqs);
kernel/irq/resend.c +1 -1
@@ -23,7 +23,7 @@
 #ifdef CONFIG_HARDIRQS_SW_RESEND
 
 /* Bitmap to handle software resend of interrupts: */
-static DECLARE_BITMAP(irqs_resend, NR_IRQS);
+static DECLARE_BITMAP(irqs_resend, IRQ_BITMAP_BITS);
 
 /*
  * Run software resends of IRQ's
author
#73 lore raw

PATCH 63/70 genirq: Disable the SHIRQ_DEBUG call in request_threaded_irq for now

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Thomas Gleixner <[email protected]>

commit 6d83f94db95cfe65d2a6359cccdf61cf087c2598 upstream.

With CONFIG_SHIRQ_DEBUG=y we call a newly installed interrupt handler in request_threaded_irq().

The original implementation (commit a304e1b8) called the handler _BEFORE_ it was installed, but that caused problems with handlers calling disable_irq_nosync(). See commit 377bf1e4.

It's braindead in the first place to call disable_irq_nosync in shared handlers, but ....

Moving this call after we installed the handler looks innocent, but it is very subtle broken on SMP.

Interrupt handlers rely on the fact, that the irq core prevents reentrancy.

Now this debug call violates that promise because we run the handler w/o the IRQ_INPROGRESS protection - which we cannot apply here because that would result in a possibly forever masked interrupt line.

A concurrent real hardware interrupt on a different CPU results in handler reentrancy and can lead to complete wreckage, which was unfortunately observed in reality and took a fricking long time to debug.

Leave the code here for now. We want this debug feature, but that's not easy to fix. We really should get rid of those disable_irq_nosync() abusers and remove that function completely.

Cc Anton Vorontsov <[email protected]>
Cc David Woodhouse <[email protected]>
Cc Arjan van de Ven <[email protected]>
---
 kernel/irq/manage.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/manage.c +1 -1
@@ -1098,7 +1098,7 @@ int request_threaded_irq(unsigned int ir
 	if (retval)
 		kfree(action);
 
-#ifdef CONFIG_DEBUG_SHIRQ
+#ifdef CONFIG_DEBUG_SHIRQ_FIXME
 	if (!retval && (irqflags & IRQF_SHARED)) {
 		/*
 		 * It's a shared IRQ -- the driver ought to be prepared for it
author
#74 lore raw

PATCH 64/70 perf: Fix throttle logic

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Peter Zijlstra <[email protected]>

commit 4fe757dd48a9e95e1a071291f15dda5421dacb66 upstream.

It was possible to call pmu::start() on an already running event. In particular this lead so some wreckage as the hrtimer events would re-initialize active timers.

This was due to throttled events being activated again by scheduling. Scheduling in a context would add and force start events, resulting in running events with a possible throttle status. The next tick to hit that task will then try to unthrottle the event and call ->start() on an already running event.

LKML-Reference: <new-submission>

---
 kernel/perf_event.c |   19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
kernel/perf_event.c +15 -4
@@ -652,6 +652,10 @@ retry:
 	raw_spin_unlock_irq(&ctx->lock);
 }
 
+#define MAX_INTERRUPTS (~0ULL)
+
+static void perf_log_throttle(struct perf_event *event, int enable);
+
 static int
 event_sched_in(struct perf_event *event,
 		 struct perf_cpu_context *cpuctx,
@@ -662,6 +666,17 @@ event_sched_in(struct perf_event *event,
 
 	event->state = PERF_EVENT_STATE_ACTIVE;
 	event->oncpu = smp_processor_id();
+
+	/*
+	 * Unthrottle events, since we scheduled we might have missed several
+	 * ticks already, also for a heavily scheduling task there is little
+	 * guarantee it'll get a tick in a timely manner.
+	 */
+	if (unlikely(event->hw.interrupts == MAX_INTERRUPTS)) {
+		perf_log_throttle(event, 1);
+		event->hw.interrupts = 0;
+	}
+
 	/*
 	 * The new state must be visible before we turn it on in the hardware:
 	 */
@@ -1469,10 +1484,6 @@ void __perf_event_task_sched_in(struct t
 	}
 }
 
-#define MAX_INTERRUPTS (~0ULL)
-
-static void perf_log_throttle(struct perf_event *event, int enable);
-
 static u64 perf_calculate_period(struct perf_event *event, u64 nsec, u64 count)
 {
 	u64 frequency = event->attr.sample_freq;
author
#75 lore raw

PATCH 65/70 ASoC: WM8903: Fix mic detection enable logic

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Stephen Warren <[email protected]>

commit 3088e3b4963d26d6f6f54987f595b974ed6d48d8 upstream.

The mic detection HW should be enabled when either mic or short detection is required, not when only both are required.

---
 sound/soc/codecs/wm8903.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm8903.c +1 -1
@@ -1479,7 +1479,7 @@ int wm8903_mic_detect(struct snd_soc_cod
 			    WM8903_MICDET_EINT | WM8903_MICSHRT_EINT,
 			    irq_mask);
 
-	if (det && shrt) {
+	if (det || shrt) {
 		/* Enable mic detection, this may not have been set through
 		 * platform data (eg, if the defaults are OK). */
 		snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0,
author
#76 lore raw

PATCH 66/70 net: can: janz-ican3: world-writable sysfs termination file

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <[email protected]>

commit 1e6d93e45b231b3ae87c01902ede2315aacfe976 upstream.

Don't allow everybody to set terminator via sysfs.

---
 drivers/net/can/janz-ican3.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/janz-ican3.c +1 -1
@@ -1627,7 +1627,7 @@ static ssize_t ican3_sysfs_set_term(stru
 	return count;
 }
 
-static DEVICE_ATTR(termination, S_IWUGO | S_IRUGO, ican3_sysfs_show_term,
+static DEVICE_ATTR(termination, S_IWUSR | S_IRUGO, ican3_sysfs_show_term,
 						   ican3_sysfs_set_term);
 
 static struct attribute *ican3_sysfs_attrs[] = {
author
#77 lore raw

PATCH 67/70 platform: x86: acer-wmi: world-writable sysfs threeg file

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <[email protected]>

commit b80b168f918bba4b847e884492415546b340e19d upstream.

Don't allow everybody to write to hardware registers.

---
 drivers/platform/x86/acer-wmi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/acer-wmi.c +1 -1
@@ -1065,7 +1065,7 @@ static ssize_t set_bool_threeg(struct de
 			return -EINVAL;
 	return count;
 }
-static DEVICE_ATTR(threeg, S_IWUGO | S_IRUGO | S_IWUSR, show_bool_threeg,
+static DEVICE_ATTR(threeg, S_IRUGO | S_IWUSR, show_bool_threeg,
 	set_bool_threeg);
 
 static ssize_t show_interface(struct device *dev, struct device_attribute *attr,
author
#78 lore raw

PATCH 68/70 platform: x86: asus_acpi: world-writable procfs files

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <[email protected]>

commit 8040835760adf0ef66876c063d47f79f015fb55d upstream.

Don't allow everybody to change ACPI settings. The comment says that it is done deliberatelly, however, the comment before disp_proc_write() says that at least one of these setting is experimental.

---
 drivers/platform/x86/asus_acpi.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/platform/x86/asus_acpi.c +1 -7
@@ -1081,14 +1081,8 @@ static int asus_hotk_add_fs(struct acpi_
 	struct proc_dir_entry *proc;
 	mode_t mode;
 
-	/*
-	 * If parameter uid or gid is not changed, keep the default setting for
-	 * our proc entries (-rw-rw-rw-) else, it means we care about security,
-	 * and then set to -rw-rw----
-	 */
-
 	if ((asus_uid == 0) && (asus_gid == 0)) {
-		mode = S_IFREG | S_IRUGO | S_IWUGO;
+		mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP;
 	} else {
 		mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP;
 		printk(KERN_WARNING "  asus_uid and asus_gid parameters are "
author
#79 lore raw

PATCH 69/70 platform: x86: tc1100-wmi: world-writable sysfs wireless and jogdial files

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <[email protected]>

commit 8a6a142c1286797978e4db266d22875a5f424897 upstream.

Don't allow everybody to change WMI settings.

---
 drivers/platform/x86/tc1100-wmi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/tc1100-wmi.c +1 -1
@@ -162,7 +162,7 @@ set_bool_##value(struct device *dev, str
 			return -EINVAL; \
 	return count; \
 } \
-static DEVICE_ATTR(value, S_IWUGO | S_IRUGO | S_IWUSR, \
+static DEVICE_ATTR(value, S_IRUGO | S_IWUSR, \
 	show_bool_##value, set_bool_##value);
 
 show_set_bool(wireless, TC1100_INSTANCE_WIRELESS);
author
#80 lore raw

PATCH 70/70 Revert: tpm_tis: Use timeouts returned from TPM

In reply to Greg KH

2.6.37-stable review patch. If anyone has any objections, please let us know.

------------------

This is a revert of commit 9b29050f8f75916f974a2d231ae5d3cd59792296 upstream which has been found to prevent suspend from working on a number of systems.

Thanks to Jiri Slaby <[email protected]> for tracing this down.

Cc Jiri Slaby <[email protected]>
Cc Rafael Wysocki <[email protected]>
Cc Stefan Berger <[email protected]>
Cc Guillaume Chazarain <[email protected]>
Cc Rajiv Andrade <[email protected]>
---
 drivers/char/tpm/tpm.c     |   18 ++----------------
 drivers/char/tpm/tpm.h     |    2 --
 drivers/char/tpm/tpm_tis.c |    4 +---
 3 files changed, 3 insertions(+), 21 deletions(-)
drivers/char/tpm/tpm.c +2 -16
@@ -577,11 +577,9 @@ duration:
 	if (rc)
 		return;
 
-	if (be32_to_cpu(tpm_cmd.header.out.return_code) != 0 ||
-	    be32_to_cpu(tpm_cmd.header.out.length)
-	    != sizeof(tpm_cmd.header.out) + sizeof(u32) + 3 * sizeof(u32))
+	if (be32_to_cpu(tpm_cmd.header.out.return_code)
+	    != 3 * sizeof(u32))
 		return;
-
 	duration_cap = &tpm_cmd.params.getcap_out.cap.duration;
 	chip->vendor.duration[TPM_SHORT] =
 	    usecs_to_jiffies(be32_to_cpu(duration_cap->tpm_short));
@@ -925,18 +923,6 @@ ssize_t tpm_show_caps_1_2(struct device
 }
 EXPORT_SYMBOL_GPL(tpm_show_caps_1_2);
 
-ssize_t tpm_show_timeouts(struct device *dev, struct device_attribute *attr,
-			  char *buf)
-{
-	struct tpm_chip *chip = dev_get_drvdata(dev);
-
-	return sprintf(buf, "%d %d %d\n",
-	               jiffies_to_usecs(chip->vendor.duration[TPM_SHORT]),
-	               jiffies_to_usecs(chip->vendor.duration[TPM_MEDIUM]),
-	               jiffies_to_usecs(chip->vendor.duration[TPM_LONG]));
-}
-EXPORT_SYMBOL_GPL(tpm_show_timeouts);
-
 ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr,
 			const char *buf, size_t count)
 {
drivers/char/tpm/tpm.h +0 -2
@@ -56,8 +56,6 @@ extern ssize_t tpm_show_owned(struct dev
 				char *);
 extern ssize_t tpm_show_temp_deactivated(struct device *,
 					 struct device_attribute *attr, char *);
-extern ssize_t tpm_show_timeouts(struct device *,
-				 struct device_attribute *attr, char *);
 
 struct tpm_chip;
 
drivers/char/tpm/tpm_tis.c +1 -3
@@ -376,7 +376,6 @@ static DEVICE_ATTR(temp_deactivated, S_I
 		   NULL);
 static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL);
 static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
-static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL);
 
 static struct attribute *tis_attrs[] = {
 	&dev_attr_pubek.attr,
@@ -386,8 +385,7 @@ static struct attribute *tis_attrs[] = {
 	&dev_attr_owned.attr,
 	&dev_attr_temp_deactivated.attr,
 	&dev_attr_caps.attr,
-	&dev_attr_cancel.attr,
-	&dev_attr_timeouts.attr, NULL,
+	&dev_attr_cancel.attr, NULL,
 };
 
 static struct attribute_group tis_attr_grp = {