2.6.33.4-stable review
Subsystems (65)
cover 2.6.33.4-stable review
This is the start of the stable review cycle for the 2.6.33.4 release. There are 117 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 Wed, May 12, 2010, 22:00:00 UTC. 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.33.4-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Makefile | 2 +- arch/arm/mach-pxa/include/mach/colibri.h | 1 + arch/mips/include/asm/mach-sibyte/war.h | 6 +- arch/mips/sibyte/sb1250/setup.c | 15 +++ arch/powerpc/kernel/head_64.S | 11 ++ arch/powerpc/mm/fsl_booke_mmu.c | 5 - arch/powerpc/platforms/pseries/hotplug-cpu.c | 42 +++----- arch/powerpc/platforms/pseries/offline_states.h | 1 + arch/sparc/include/asm/irqflags_64.h | 23 +++- arch/sparc/include/asm/thread_info_64.h | 2 +- arch/sparc/kernel/pci_common.c | 11 ++- arch/sparc/kernel/rtrap_64.S | 12 ++- arch/sparc/kernel/traps_64.c | 26 +---- arch/sparc/kernel/unaligned_64.c | 6 +- arch/x86/Kconfig | 4 +- arch/x86/kernel/apic/io_apic.c | 3 + arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 3 +- arch/x86/kernel/cpu/intel.c | 21 ++++ arch/x86/kernel/k8.c | 14 +++ arch/x86/kernel/pci-gart_64.c | 2 +- arch/x86/kernel/process_64.c | 4 +- block/blk-timeout.c | 12 +- crypto/async_tx/async_raid6_recov.c | 21 ++-- drivers/Makefile | 2 +- drivers/acpi/power_meter.c | 2 +- drivers/acpi/sleep.c | 144 +++++++++++++++++++++++ drivers/ata/libata-eh.c | 5 + drivers/base/memory.c | 2 +- drivers/char/agp/Kconfig | 2 +- drivers/cpuidle/governors/menu.c | 9 +- drivers/edac/edac_mce_amd.c | 5 +- drivers/gpu/drm/i915/i915_debugfs.c | 2 +- drivers/gpu/drm/i915/i915_dma.c | 16 ++- drivers/gpu/drm/i915/i915_drv.h | 26 ++++- drivers/gpu/drm/i915/i915_gem.c | 8 +- drivers/gpu/drm/i915/i915_gem_tiling.c | 24 ++--- drivers/gpu/drm/i915/i915_irq.c | 18 ++-- drivers/gpu/drm/i915/i915_reg.h | 2 +- drivers/gpu/drm/i915/intel_bios.c | 3 +- drivers/gpu/drm/i915/intel_crt.c | 14 +- drivers/gpu/drm/i915/intel_display.c | 56 +++++----- drivers/gpu/drm/i915/intel_lvds.c | 2 +- drivers/gpu/drm/i915/intel_overlay.c | 2 +- drivers/i2c/i2c-core.c | 21 +++- drivers/md/md.c | 10 ++- drivers/md/raid5.c | 54 ++++----- drivers/media/dvb/ttpci/budget.c | 3 - drivers/net/bnx2.c | 6 +- drivers/net/r8169.c | 13 ++- drivers/net/sfc/efx.c | 4 +- drivers/net/sfc/falcon.c | 4 +- drivers/net/sfc/falcon_boards.c | 13 +-- drivers/net/sfc/nic.h | 2 +- drivers/net/sfc/siena.c | 13 ++- drivers/net/tg3.c | 1 + drivers/net/tun.c | 4 + drivers/net/usb/cdc_ether.c | 1 + drivers/net/usb/dm9601.c | 2 +- drivers/net/wan/hdlc_ppp.c | 6 + drivers/net/wireless/ath/ath9k/main.c | 2 +- drivers/net/wireless/p54/p54pci.c | 2 +- drivers/net/wireless/p54/p54usb.c | 1 + drivers/net/wireless/p54/txrx.c | 2 +- drivers/pci/pci.c | 6 +- drivers/scsi/libiscsi.c | 2 +- drivers/scsi/libsas/sas_ata.c | 4 + drivers/scsi/libsas/sas_scsi_host.c | 4 + drivers/scsi/scsi_debug.c | 3 +- drivers/scsi/scsi_error.c | 15 +++- drivers/scsi/scsi_lib.c | 10 ++- drivers/scsi/sd.c | 1 + drivers/serial/8250_pnp.c | 2 + drivers/staging/hv/Hv.c | 2 +- drivers/staging/hv/RndisFilter.c | 1 + drivers/staging/hv/netvsc_drv.c | 3 +- drivers/staging/usbip/usbip_event.c | 3 + drivers/usb/core/driver.c | 32 +++++- drivers/usb/core/generic.c | 2 +- drivers/usb/core/inode.c | 4 +- drivers/usb/core/message.c | 2 +- drivers/usb/host/ehci-hcd.c | 1 + drivers/usb/host/ehci-mem.c | 2 +- drivers/usb/host/ehci-sched.c | 38 +++++-- drivers/usb/host/ehci.h | 5 +- drivers/usb/host/ohci-hub.c | 2 +- drivers/usb/host/xhci-mem.c | 65 ++++++++++ drivers/usb/host/xhci.h | 4 + drivers/usb/serial/sierra.c | 1 + drivers/w1/slaves/w1_therm.c | 5 +- fs/ext4/extents.c | 9 +- fs/jfs/resize.c | 6 +- fs/nfs/client.c | 2 + fs/nfs/dir.c | 2 + fs/nfsd/nfs4xdr.c | 8 +- fs/ocfs2/buffer_head_io.c | 2 + fs/ocfs2/dlm/dlmfs.c | 2 +- fs/ocfs2/inode.c | 1 + fs/ocfs2/refcounttree.c | 3 + fs/proc/base.c | 2 +- fs/reiserfs/dir.c | 2 - fs/reiserfs/xattr.c | 19 +--- fs/xfs/linux-2.6/xfs_super.c | 5 + fs/xfs/linux-2.6/xfs_sync.c | 107 ++++++++++++++++- fs/xfs/linux-2.6/xfs_sync.h | 7 +- fs/xfs/quota/xfs_qm_syscalls.c | 3 +- fs/xfs/xfs_ag.h | 1 + fs/xfs/xfs_mount.h | 1 + include/drm/drm_pciids.h | 1 + include/linux/ata.h | 4 +- include/linux/poison.h | 9 ++ include/net/sctp/command.h | 1 + include/net/sctp/sctp.h | 1 + init/initramfs.c | 3 +- kernel/cred.c | 2 - kernel/perf_event.c | 2 +- lib/flex_array.c | 2 +- mm/hugetlb.c | 5 +- mm/memcontrol.c | 4 +- net/ieee802154/af_ieee802154.c | 3 + net/ipv4/tcp.c | 1 + net/ipv4/udp.c | 4 +- net/ipv6/tcp_ipv6.c | 2 +- net/ipv6/udp.c | 4 +- net/mac80211/agg-tx.c | 1 - net/sctp/associola.c | 6 +- net/sctp/endpointola.c | 1 + net/sctp/sm_make_chunk.c | 32 ++---- net/sctp/sm_sideeffect.c | 26 ++++ net/sctp/sm_statefuns.c | 8 +- net/sctp/socket.c | 14 ++- net/tipc/bearer.c | 37 +----- net/tipc/bearer.h | 2 +- net/tipc/net.c | 25 +---- security/inode.c | 4 +- security/keys/request_key.c | 9 ++- sound/pci/hda/hda_intel.c | 1 + sound/pci/hda/patch_conexant.c | 7 +- sound/pci/hda/patch_realtek.c | 2 +- sound/pci/hda/patch_sigmatel.c | 6 + sound/pci/maestro3.c | 9 ++ 140 files changed, 989 insertions(+), 405 deletions(-)
PATCH 1/117 USB: EHCI: defer reclamation of siTDs
2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit 0e5f231bc16ff9910882fa5b9d64d80e7691cfab upstream.
This patch (as1369) fixes a problem in ehci-hcd. Some controllers occasionally run into trouble when the driver reclaims siTDs too quickly. This can happen while streaming audio; it causes the controller to crash.
The patch changes siTD reclamation to work the same way as iTD
reclamation: Completed siTDs are stored on a list and not reused until at least one frame has passed.
--- drivers/usb/host/ehci-hcd.c | 1 + drivers/usb/host/ehci-mem.c | 2 +- drivers/usb/host/ehci-sched.c | 38 ++++++++++++++++++++++++++++++-------- drivers/usb/host/ehci.h | 5 +++-- 4 files changed, 35 insertions(+), 11 deletions(-)
drivers/usb/host/ehci-hcd.c +1 -0
@@ -543,6 +543,7 @@ static int ehci_init(struct usb_hcd *hcd*/ ehci->periodic_size =DEFAULT_I_TDPS ;INIT_LIST_HEAD (&ehci->cached_itd_list); +INIT_LIST_HEAD (&ehci->cached_sitd_list);if ((retval =ehci_mem_init (ehci,GFP_KERNEL )) <0 )return retval;
drivers/usb/host/ehci-mem.c +1 -1
@@ -136,7 +136,7 @@ static inline void qh_put (struct ehci_qstatic void ehci_mem_cleanup (struct ehci_hcd *ehci) { -free_cached_itd_list (ehci); +free_cached_lists (ehci);if (ehci->async)qh_put (ehci->async); ehci->async =NULL ;
drivers/usb/host/ehci-sched.c +30 -8
@@ -2137,13 +2137,27 @@ sitd_complete ( (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out"); }iso_stream_put (ehci, stream); -/* OK to recycle this SITD now that its completion callback ran. */ + done: sitd->urb =NULL ; - sitd->stream =NULL ; -list_move (&sitd->sitd_list, &stream->free_list); -iso_stream_put (ehci, stream); - +if (ehci->clock_frame != sitd->frame) { +/* OK to recycle this SITD now. */ + sitd->stream =NULL ; +list_move (&sitd->sitd_list, &stream->free_list); +iso_stream_put (ehci, stream); + }else { +/* HW might remember this SITD, so we can't recycle it yet. +* Move it to a safe place until a new frame starts. +*/ +list_move (&sitd->sitd_list, &ehci->cached_sitd_list); +if (stream->refcount ==2 ) { +/* If iso_stream_put() were called here, stream +* would be freed. Instead, just prevent reuse. +*/ + stream->ep->hcpriv =NULL ; + stream->ep =NULL ; + } + }return retval; }
@@ -2209,9 +2223,10 @@ done:/*-------------------------------------------------------------------------*/ -static void free_cached_itd_list (struct ehci_hcd *ehci) +static void free_cached_lists (struct ehci_hcd *ehci) {struct ehci_itd *itd, *n; +struct ehci_sitd *sitd, *sn;list_for_each_entry_safe (itd, n, &ehci->cached_itd_list, itd_list) {struct ehci_iso_stream *stream = itd->stream;
@@ -2219,6 +2234,13 @@ static void free_cached_itd_list(structlist_move (&itd->itd_list, &stream->free_list);iso_stream_put (ehci, stream); } + +list_for_each_entry_safe (sitd, sn, &ehci->cached_sitd_list, sitd_list) { +struct ehci_iso_stream *stream = sitd->stream; + sitd->stream =NULL ; +list_move (&sitd->sitd_list, &stream->free_list); +iso_stream_put (ehci, stream); + } }/*-------------------------------------------------------------------------*/
@@ -2245,7 +2267,7 @@ scan_periodic (struct ehci_hcd *ehci) clock_frame =-1 ; }if (ehci->clock_frame != clock_frame) { -free_cached_itd_list (ehci); +free_cached_lists (ehci); ehci->clock_frame = clock_frame; } clock %= mod;
@@ -2408,7 +2430,7 @@ restart: clock = now; clock_frame = clock >>3 ;if (ehci->clock_frame != clock_frame) { -free_cached_itd_list (ehci); +free_cached_lists (ehci); ehci->clock_frame = clock_frame; } }else {
drivers/usb/host/ehci.h +3 -2
@@ -87,8 +87,9 @@ struct ehci_hcd { /* one per controlleint next_uframe;/* scan periodic, start here */ unsigned periodic_sched;/* periodic activity count */ -/* list of itds completed while clock_frame was still active */ +/* list of itds & sitds completed while clock_frame was still active */ struct list_head cached_itd_list; +struct list_head cached_sitd_list;unsigned clock_frame;/* per root hub port */
@@ -195,7 +196,7 @@ timer_action_done (struct ehci_hcd *ehciclear_bit (action, &ehci->actions); } -static void free_cached_itd_list (struct ehci_hcd *ehci); +static void free_cached_lists (struct ehci_hcd *ehci);/*-------------------------------------------------------------------------*/
PATCH 2/117 p54usb: Add usbid for Corega CG-WLUSB2GT.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Shimada Hirofumi <[email protected]>
commit 15a69a81731d337a3d9db51692ff8704c1114f43 upstream.
--- drivers/net/wireless/p54/p54usb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/p54/p54usb.c +1 -0
@@ -36,6 +36,7 @@ static struct usb_device_id p54u_table[]/* Version 1 devices (pci chip + net2280) */ {USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */ {USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */ + {USB_DEVICE(0x07aa, 0x001c)}, /* Corega CG-WLUSB2GT */ {USB_DEVICE(0x083a, 0x4501)}, /* Accton 802.11g WN4501 USB */ {USB_DEVICE(0x083a, 0x4502)}, /* Siemens Gigaset USB Adapter */ {USB_DEVICE(0x083a, 0x5501)}, /* Phillips CPWUA054 */
PATCH 3/117 drm/i915: Add initial bits for VGA modesetting bringup on Sandybridge.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Anholt <[email protected]>
commit bad720ff3e8e47a04bd88d9bbc8317e7d7e049d3 upstream.
[needed for stable as it's just a bunch of macros that other drm patches need, it changes no code functionality besides adding support for a new device type. - gregkh]
--- drivers/gpu/drm/i915/i915_debugfs.c | 2 - drivers/gpu/drm/i915/i915_dma.c | 16 ++++++--- drivers/gpu/drm/i915/i915_drv.h | 26 ++++++++++++++- drivers/gpu/drm/i915/i915_gem.c | 2 - drivers/gpu/drm/i915/i915_gem_tiling.c | 2 - drivers/gpu/drm/i915/i915_irq.c | 18 +++++----- drivers/gpu/drm/i915/intel_bios.c | 3 + drivers/gpu/drm/i915/intel_crt.c | 14 ++++---- drivers/gpu/drm/i915/intel_display.c | 56 ++++++++++++++++----------------- drivers/gpu/drm/i915/intel_lvds.c | 2 - drivers/gpu/drm/i915/intel_overlay.c | 2 - include/drm/drm_pciids.h | 1 12 files changed, 88 insertions(+), 56 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +1 -1
@@ -162,7 +162,7 @@ static int i915_interrupt_info(struct sestruct drm_device *dev = node->minor->dev;drm_i915_private_t *dev_priv = dev->dev_private; -if (!IS_IRONLAKE (dev)) { +if (!HAS_PCH_SPLIT (dev)) {seq_printf (m,"Interrupt enable: %08x\n" ,I915_READ (IER )); seq_printf(m, "Interrupt identity: %08x\n",
drivers/gpu/drm/i915/i915_dma.c +11 -5
@@ -978,15 +978,21 @@ static int i915_probe_agp(struct drm_dev* Some of the preallocated space is taken by the GTT * and popup. GTT is 1K per MB of aperture size, and popup is 4K. */ -if (IS_G4X (dev) ||IS_PINEVIEW (dev) ||IS_IRONLAKE (dev)) +if (IS_G4X (dev) ||IS_PINEVIEW (dev) ||IS_IRONLAKE (dev) ||IS_GEN6 (dev)) overhead =4096 ;else overhead = (*aperture_size /1024 ) +4096 ;switch (tmp &INTEL_GMCH_GMS_MASK ) {case INTEL_855_GMCH_GMS_DISABLED : -DRM_ERROR ("video memory is disabled\n" ); -return -1 ; +/* XXX: This is what my A1 silicon has. */ +if (IS_GEN6 (dev)) { + stolen =64 *1024 *1024 ; + }else { +DRM_ERROR ("video memory is disabled\n" ); +return -1 ; + } +break ;case INTEL_855_GMCH_GMS_STOLEN_1M : stolen =1 *1024 *1024 ;break ;
@@ -1064,7 +1070,7 @@ static unsigned long i915_gtt_to_phys(stint gtt_offset, gtt_size;if (IS_I965G (dev)) { -if (IS_G4X (dev) ||IS_IRONLAKE (dev)) { +if (IS_G4X (dev) ||IS_IRONLAKE (dev) ||IS_GEN6 (dev)) { gtt_offset =2 *1024 *1024 ; gtt_size =2 *1024 *1024 ; }else {
@@ -1445,7 +1451,7 @@ int i915_driver_load(struct drm_device * dev->driver->get_vblank_counter = i915_get_vblank_counter; dev->max_vblank_count =0xffffff ;/* only 24 bits of frame count */ -if (IS_G4X (dev) ||IS_IRONLAKE (dev)) { +if (IS_G4X (dev) ||IS_IRONLAKE (dev) ||IS_GEN6 (dev)) { dev->max_vblank_count =0xffffffff ;/* full 32 bit counter */ dev->driver->get_vblank_counter = gm45_get_vblank_counter; }
drivers/gpu/drm/i915/i915_drv.h +25 -1
@@ -1026,7 +1026,7 @@ extern int i915_wait_ring(struct drm_dev#define IS_845G (dev) ((dev)->pci_device == 0x2562)#define IS_I85X (dev) ((dev)->pci_device == 0x3582)#define IS_I865G (dev) ((dev)->pci_device == 0x2572) -#define IS_I8XX (dev) (INTEL_INFO(dev)->is_i8xx) +#define IS_GEN2 (dev) (INTEL_INFO(dev)->is_i8xx)#define IS_I915G (dev) (INTEL_INFO(dev)->is_i915g)#define IS_I915GM (dev) ((dev)->pci_device == 0x2592)#define IS_I945G (dev) ((dev)->pci_device == 0x2772)
@@ -1045,8 +1045,29 @@ extern int i915_wait_ring(struct drm_dev#define IS_I9XX (dev) (INTEL_INFO(dev)->is_i9xx)#define IS_MOBILE (dev) (INTEL_INFO(dev)->is_mobile) +#define IS_GEN3 (dev) (IS_I915G(dev) || \ + IS_I915GM(dev) || \ + IS_I945G(dev) || \ + IS_I945GM(dev) || \ + IS_G33(dev) || \ + IS_PINEVIEW(dev)) +#define IS_GEN4 (dev) ((dev)->pci_device == 0x2972 || \ + (dev)->pci_device == 0x2982 || \ + (dev)->pci_device == 0x2992 || \ + (dev)->pci_device == 0x29A2 || \ + (dev)->pci_device == 0x2A02 || \ + (dev)->pci_device == 0x2A12 || \ + (dev)->pci_device == 0x2E02 || \ + (dev)->pci_device == 0x2E12 || \ + (dev)->pci_device == 0x2E22 || \ + (dev)->pci_device == 0x2E32 || \ + (dev)->pci_device == 0x2A42 || \ + (dev)->pci_device == 0x2E42) +#define I915_NEED_GFX_HWS (dev) (INTEL_INFO(dev)->need_gfx_hws) +#define IS_GEN6 (dev) ((dev)->pci_device == 0x0102) +/* With the 945 and later, Y tiling got adjusted so that it was 32 128-byte * rows, which changed the alignment requirements and fence programming. */
@@ -1067,6 +1088,9 @@ extern int i915_wait_ring(struct drm_dev#define I915_HAS_FBC (dev) (INTEL_INFO(dev)->has_fbc)#define I915_HAS_RC6 (dev) (INTEL_INFO(dev)->has_rc6) +#define HAS_PCH_SPLIT (dev) (IS_IRONLAKE(dev) || \ + IS_GEN6(dev)) +#define PRIMARY_RINGBUFFER_SIZE (128*1024)#endif
drivers/gpu/drm/i915/i915_gem.c +1 -1
@@ -1819,7 +1819,7 @@ i915_do_wait_request(struct drm_device *return -EIO ;if (!i915_seqno_passed (i915_get_gem_seqno (dev), seqno)) { -if (IS_IRONLAKE (dev)) +if (HAS_PCH_SPLIT (dev)) ier =I915_READ (DEIER ) |I915_READ (GTIER );else ier =I915_READ (IER );
drivers/gpu/drm/i915/i915_gem_tiling.c +1 -1
@@ -209,7 +209,7 @@ i915_gem_detect_bit_6_swizzle(struct drmuint32_t swizzle_y =I915_BIT_6_SWIZZLE_UNKNOWN ;bool need_disable; -if (IS_IRONLAKE (dev)) { +if (IS_IRONLAKE (dev) ||IS_GEN6 (dev)) {/* On Ironlake whatever DRAM config, GPU always do * same swizzling setup. */
drivers/gpu/drm/i915/i915_irq.c +9 -9
@@ -576,7 +576,7 @@ irqreturn_t i915_driver_irq_handler(DRM_atomic_inc (&dev_priv->irq_received); -if (IS_IRONLAKE (dev)) +if (HAS_PCH_SPLIT (dev))return ironlake_irq_handler (dev); iir =I915_READ (IIR );
@@ -737,7 +737,7 @@ void i915_user_irq_get(struct drm_devicespin_lock_irqsave (&dev_priv->user_irq_lock, irqflags);if (dev->irq_enabled && (++dev_priv->user_irq_refcount ==1 )) { -if (IS_IRONLAKE (dev)) +if (HAS_PCH_SPLIT (dev))ironlake_enable_graphics_irq (dev_priv,GT_USER_INTERRUPT );else i915_enable_irq (dev_priv,I915_USER_INTERRUPT );
@@ -753,7 +753,7 @@ void i915_user_irq_put(struct drm_devicespin_lock_irqsave (&dev_priv->user_irq_lock, irqflags);BUG_ON (dev->irq_enabled && dev_priv->user_irq_refcount <=0 );if (dev->irq_enabled && (--dev_priv->user_irq_refcount ==0 )) { -if (IS_IRONLAKE (dev)) +if (HAS_PCH_SPLIT (dev))ironlake_disable_graphics_irq (dev_priv,GT_USER_INTERRUPT );else i915_disable_irq (dev_priv,I915_USER_INTERRUPT );
@@ -861,7 +861,7 @@ int i915_enable_vblank(struct drm_devicereturn -EINVAL ;spin_lock_irqsave (&dev_priv->user_irq_lock, irqflags); -if (IS_IRONLAKE (dev)) +if (HAS_PCH_SPLIT (dev))ironlake_enable_display_irq (dev_priv, (pipe ==0 ) ?DE_PIPEA_VBLANK :DE_PIPEB_VBLANK );else if (IS_I965G (dev))
@@ -883,7 +883,7 @@ void i915_disable_vblank(struct drm_deviunsigned long irqflags;spin_lock_irqsave (&dev_priv->user_irq_lock, irqflags); -if (IS_IRONLAKE (dev)) +if (HAS_PCH_SPLIT (dev))ironlake_disable_display_irq (dev_priv, (pipe ==0 ) ?DE_PIPEA_VBLANK :DE_PIPEB_VBLANK );else
@@ -897,7 +897,7 @@ void i915_enable_interrupt (struct drm_d {struct drm_i915_private *dev_priv = dev->dev_private; -if (!IS_IRONLAKE (dev)) +if (!HAS_PCH_SPLIT (dev))opregion_enable_asle (dev); dev_priv->irq_enabled =1 ; }
@@ -1076,7 +1076,7 @@ void i915_driver_irq_preinstall(struct dINIT_WORK (&dev_priv->hotplug_work, i915_hotplug_work_func);INIT_WORK (&dev_priv->error_work, i915_error_work_func); -if (IS_IRONLAKE (dev)) { +if (HAS_PCH_SPLIT (dev)) {ironlake_irq_preinstall (dev);return ; }
@@ -1108,7 +1108,7 @@ int i915_driver_irq_postinstall(struct d dev_priv->vblank_pipe =DRM_I915_VBLANK_PIPE_A |DRM_I915_VBLANK_PIPE_B ; -if (IS_IRONLAKE (dev)) +if (HAS_PCH_SPLIT (dev))return ironlake_irq_postinstall (dev);/* Unmask the interrupts that we always want on. */
@@ -1196,7 +1196,7 @@ void i915_driver_irq_uninstall(struct dr dev_priv->vblank_pipe =0 ; -if (IS_IRONLAKE (dev)) { +if (HAS_PCH_SPLIT (dev)) {ironlake_irq_uninstall (dev);return ; }
drivers/gpu/drm/i915/intel_bios.c +2 -1
@@ -247,6 +247,7 @@ static void parse_general_features(struct drm_i915_private *dev_priv, struct bdb_header *bdb) { + struct drm_device *dev = dev_priv->dev;struct bdb_general_features *general;/* Set sensible defaults in case we can't find the general block */
@@ -263,7 +264,7 @@ parse_general_features(struct drm_i915_pif (IS_I85X (dev_priv->dev)) dev_priv->lvds_ssc_freq = general->ssc_freq ?66 :48 ; -else if (IS_IRONLAKE (dev_priv->dev)) +else if (IS_IRONLAKE (dev_priv->dev) ||IS_GEN6 (dev)) dev_priv->lvds_ssc_freq = general->ssc_freq ?100 :120 ;else
drivers/gpu/drm/i915/intel_crt.c +7 -7
@@ -39,7 +39,7 @@ static void intel_crt_dpms(struct drm_enstruct drm_i915_private *dev_priv = dev->dev_private;u32 temp, reg; -if (IS_IRONLAKE (dev)) +if (HAS_PCH_SPLIT (dev)) reg =PCH_ADPA ;else reg =ADPA ;
@@ -113,7 +113,7 @@ static void intel_crt_mode_set(struct drelse dpll_md_reg =DPLL_B_MD ; -if (IS_IRONLAKE (dev)) +if (HAS_PCH_SPLIT (dev)) adpa_reg =PCH_ADPA ;else adpa_reg =ADPA ;
@@ -122,7 +122,7 @@ static void intel_crt_mode_set(struct dr* Disable separate mode multiplier used when cloning SDVO to CRT * XXX this needs to be adjusted when we really are cloning */ -if (IS_I965G (dev) && !IS_IRONLAKE (dev)) { +if (IS_I965G (dev) && !HAS_PCH_SPLIT (dev)) { dpll_md =I915_READ (dpll_md_reg);I915_WRITE (dpll_md_reg, dpll_md & ~DPLL_MD_UDI_MULTIPLIER_MASK );
@@ -136,11 +136,11 @@ static void intel_crt_mode_set(struct drif (intel_crtc->pipe ==0 ) { adpa |=ADPA_PIPE_A_SELECT ; -if (!IS_IRONLAKE (dev)) +if (!HAS_PCH_SPLIT (dev))I915_WRITE (BCLRPAT_A ,0 ); }else { adpa |=ADPA_PIPE_B_SELECT ; -if (!IS_IRONLAKE (dev)) +if (!HAS_PCH_SPLIT (dev))I915_WRITE (BCLRPAT_B ,0 ); }
@@ -202,7 +202,7 @@ static bool intel_crt_detect_hotplug(stru32 hotplug_en;int i, tries =0 ; -if (IS_IRONLAKE (dev)) +if (HAS_PCH_SPLIT (dev))return intel_ironlake_crt_detect_hotplug (connector);/*
@@ -524,7 +524,7 @@ void intel_crt_init(struct drm_device *d &intel_output->enc);/* Set up the DDC bus. */ -if (IS_IRONLAKE (dev)) +if (HAS_PCH_SPLIT (dev)) i2c_reg =PCH_GPIOA ;else { i2c_reg =GPIOA ;
drivers/gpu/drm/i915/intel_display.c +28 -28
224 lines not on this page · raw message
drivers/gpu/drm/i915/intel_lvds.c +1 -1
@@ -661,7 +661,7 @@ static enum drm_connector_status intel_l/* ACPI lid methods were generally unreliable in this generation, so * don't even bother. */ -if (IS_I8XX (dev)) +if (IS_GEN2 (dev))return connector_status_connected;if (!dmi_check_system (bad_lid_status) && !acpi_lid_open ())
drivers/gpu/drm/i915/intel_overlay.c +1 -1
@@ -172,7 +172,7 @@ struct overlay_registers {#define OFC_UPDATE 0x1#define OVERLAY_NONPHYSICAL (dev) (IS_G33(dev) || IS_I965G(dev)) -#define OVERLAY_EXISTS (dev) (!IS_G4X(dev) && !IS_IRONLAKE(dev)) +#define OVERLAY_EXISTS (dev) (!IS_G4X(dev) && !IS_IRONLAKE(dev) && !IS_GEN6(dev))static struct overlay_registers *intel_overlay_map_regs_atomic (struct intel_overlay *overlay)
include/drm/drm_pciids.h +1 -0
@@ -560,4 +560,5 @@ {0x8086, 0x35e8, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ {0x8086, 0x0042, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ {0x8086, 0x0046, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ + {0x8086, 0x0102, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ {0, 0, 0}
Re: [003/117] drm/i915: Add initial bits for VGA modesetting bringup on Sandybridge.
Quoted 5 lines · Greg KH
2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Anholt <[email protected]>
Quoted 8 lines
commit
bad720ff3e8e47a04bd88d9bbc8317e7d7e049d3upstream.[needed for stable as it's just a bunch of macros that other drm patches need, it changes no code functionality besides adding support for a new device type. - gregkh]
Signed-off-by Eric Anholt <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
This patch should not go in stable because of this hunk:
include/drm/drm_pciids.h line 564
Quoted 8 lines
include/drm/drm_pciids.h +1
-0@@ -560,4 +560,5 @@ {0x8086, 0x35e8, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ {0x8086, 0x0042, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ {0x8086, 0x0046, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ + {0x8086, 0x0102, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ {0, 0, 0}
Without that, it would be fine.
Re: [003/117] drm/i915: Add initial bits for VGA modesetting bringup on Sandybridge.
Quoted 17 lines · Eric Anholt
Quoted 5 lines · Greg KH
2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Anholt <[email protected]>Quoted 8 lines
commit
bad720ff3e8e47a04bd88d9bbc8317e7d7e049d3upstream.[needed for stable as it's just a bunch of macros that other drm patches need, it changes no code functionality besides adding support for a new device type. - gregkh]
Signed-off-by Eric Anholt <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>This patch should not go in stable because of this hunk:
Quoted 10 lines
include/drm/drm_pciids.h line 564
Quoted 8 lines
include/drm/drm_pciids.h +1
-0@@ -560,4 +560,5 @@ {0x8086, 0x35e8, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ {0x8086, 0x0042, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ {0x8086, 0x0046, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ + {0x8086, 0x0102, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ {0, 0, 0}Without that, it would be fine.
Ok, thanks, I've dropped this hunk from the patch now.
greg k-h
PATCH 4/117 drm/i915: fix tiling limits for i915 class hw v2
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel Vetter <[email protected]>
commit c36a2a6de59e4a141a68b7575de837d3b0bd96b3 upstream.
Current code is definitely crap: Largest pitch allowed spills into the TILING_Y bit of the fence registers ... :(
I've rewritten the limits check under the assumption that 3rd gen hw has a 3d pitch limit of 8kb (like 2nd gen). This is supported by an otherwise totally misleading XXX comment.
This bug mostly resulted in tiling-corrupted pixmaps because the kernel allowed too wide buffers to be tiled. Bug brought to the light by the xf86-video-intel 2.11 release because that unconditionally enabled tiling for pixmaps, relying on the kernel to check things. Tiling for the framebuffer was not affected because the ddx does some additional checks there ensure the buffer is within hw-limits.
v2: Instead of computing the value that would be written into the hw fence registers and then checking the limits simply check whether the stride is above the 8kb limit. To better document the hw, add some WARN_ONs in i915_write_fence_reg like I've done for the i830 case (using the right limits).
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27449
--- drivers/gpu/drm/i915/i915_gem.c | 6 ++++++ drivers/gpu/drm/i915/i915_gem_tiling.c | 22 +++++++++------------- drivers/gpu/drm/i915/i915_reg.h | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +6 -0
@@ -2316,6 +2316,12 @@ static void i915_write_fence_reg(struct pitch_val = obj_priv->stride / tile_width; pitch_val =ffs (pitch_val) -1 ; +if (obj_priv->tiling_mode ==I915_TILING_Y && +HAS_128_BYTE_Y_TILING (dev)) +WARN_ON (pitch_val >I830_FENCE_MAX_PITCH_VAL ); +else +WARN_ON (pitch_val >I915_FENCE_MAX_PITCH_VAL ); + val = obj_priv->gtt_offset;if (obj_priv->tiling_mode ==I915_TILING_Y ) val |=1 <<I830_FENCE_TILING_Y_SHIFT ;
drivers/gpu/drm/i915/i915_gem_tiling.c +9 -13
@@ -357,21 +357,17 @@ i915_tiling_ok(struct drm_device *dev, i* reg, so dont bother to check the size */ if (stride /128 >I965_FENCE_MAX_PITCH_VAL )return false; - }else if (IS_I9XX (dev)) { -uint32_t pitch_val =ffs (stride / tile_width) -1 ; - -/* XXX: For Y tiling, FENCE_MAX_PITCH_VAL is actually 6 (8KB) -* instead of 4 (2KB) on 945s. -*/ -if (pitch_val >I915_FENCE_MAX_PITCH_VAL || - size > (I830_FENCE_MAX_SIZE_VAL <<20 )) + }else if (IS_GEN3 (dev) ||IS_GEN2 (dev)) { +if (stride >8192 )return false; - }else { -uint32_t pitch_val =ffs (stride / tile_width) -1 ; -if (pitch_val >I830_FENCE_MAX_PITCH_VAL || - size > (I830_FENCE_MAX_SIZE_VAL <<19 )) -return false; +if (IS_GEN3 (dev)) { +if (size >I830_FENCE_MAX_SIZE_VAL <<20 ) +return false; + }else { +if (size >I830_FENCE_MAX_SIZE_VAL <<19 ) +return false; + } }/* 965+ just needs multiples of tile width */
drivers/gpu/drm/i915/i915_reg.h +1 -1
@@ -221,7 +221,7 @@#define I830_FENCE_SIZE_BITS (size) ((ffs((size) >> 19) - 1) << 8)#define I830_FENCE_PITCH_SHIFT 4#define I830_FENCE_REG_VALID (1<<0) -#define I915_FENCE_MAX_PITCH_VAL 0x10 +#define I915_FENCE_MAX_PITCH_VAL 4#define I830_FENCE_MAX_PITCH_VAL 6#define I830_FENCE_MAX_SIZE_VAL (1<<8)
PATCH 5/117 md/raid5: allow for more than 2^31 chunks.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: NeilBrown <[email protected]>
commit 35f2a591192d0a5d9f7fc696869c76f0b8e49c3d upstream.
With many large drives and small chunk sizes it is possible to create a RAID5 with more than 2^31 chunks. Make sure this works.
--- drivers/md/raid5.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
drivers/md/raid5.c +7 -12
@@ -1649,8 +1649,8 @@ static sector_t raid5_compute_sector(rai int previous, int *dd_idx, struct stripe_head *sh) { - long stripe; -unsigned long chunk_number; + sector_t stripe; +sector_t chunk_number;unsigned int chunk_offset;int pd_idx, qd_idx;int ddf_layout =0 ;
@@ -1670,17 +1670,12 @@ static sector_t raid5_compute_sector(rai*/ chunk_offset =sector_div (r_sector, sectors_per_chunk); chunk_number = r_sector; -BUG_ON (r_sector != chunk_number);/* * Compute the stripe number */ - stripe = chunk_number / data_disks; - -/* -* Compute the data disk and parity disk indexes inside the stripe -*/ - *dd_idx = chunk_number % data_disks; + stripe = chunk_number; + *dd_idx =sector_div (stripe, data_disks);/* * Select the parity disk based on the user selected algorithm.
@@ -1869,14 +1864,14 @@ static sector_t compute_blocknr(struct s : conf->algorithm;sector_t stripe;int chunk_offset; -int chunk_number, dummy1, dd_idx = i; +sector_t chunk_number; +int dummy1, dd_idx = i;sector_t r_sector;struct stripe_head sh2; chunk_offset =sector_div (new_sector, sectors_per_chunk); stripe = new_sector; -BUG_ON (new_sector != stripe);if (i == sh->pd_idx)return 0 ;
@@ -1969,7 +1964,7 @@ static sector_t compute_blocknr(struct s } chunk_number = stripe * data_disks + i; - r_sector = (sector_t )chunk_number * sectors_per_chunk + chunk_offset; + r_sector = chunk_number * sectors_per_chunk + chunk_offset; check =raid5_compute_sector (conf, r_sector, previous, &dummy1, &sh2);
PATCH 6/117 md/raid5: fix previous patch.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: NeilBrown <[email protected]>
commit 6e3b96ed610e5a1838e62ddae9fa0c3463f235fa upstream.
Previous patch changes stripe and chunk_number to sector_t but mistakenly did not update all of the divisions to use sector_dev().
This patch changes all the those divisions (actually the '%' operator) to sector_div.
--- drivers/md/raid5.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-)
drivers/md/raid5.c +18 -17
@@ -1649,7 +1649,7 @@ static sector_t raid5_compute_sector(rai int previous, int *dd_idx, struct stripe_head *sh) { - sector_t stripe; + sector_t stripe, stripe2;sector_t chunk_number;unsigned int chunk_offset;int pd_idx, qd_idx;
@@ -1676,7 +1676,7 @@ static sector_t raid5_compute_sector(rai*/ stripe = chunk_number; *dd_idx =sector_div (stripe, data_disks); - + stripe2 = stripe;/* * Select the parity disk based on the user selected algorithm. */
@@ -1688,21 +1688,21 @@ static sector_t raid5_compute_sector(raicase 5 :switch (algorithm) {case ALGORITHM_LEFT_ASYMMETRIC : - pd_idx = data_disks - stripe % raid_disks; + pd_idx = data_disks -sector_div (stripe2, raid_disks);if (*dd_idx >= pd_idx) (*dd_idx)++;break ;case ALGORITHM_RIGHT_ASYMMETRIC : - pd_idx = stripe % raid_disks; + pd_idx =sector_div (stripe2, raid_disks);if (*dd_idx >= pd_idx) (*dd_idx)++;break ;case ALGORITHM_LEFT_SYMMETRIC : - pd_idx = data_disks - stripe % raid_disks; + pd_idx = data_disks -sector_div (stripe2, raid_disks); *dd_idx = (pd_idx +1 + *dd_idx) % raid_disks;break ;case ALGORITHM_RIGHT_SYMMETRIC : - pd_idx = stripe % raid_disks; + pd_idx =sector_div (stripe2, raid_disks); *dd_idx = (pd_idx +1 + *dd_idx) % raid_disks;break ;case ALGORITHM_PARITY_0 :
@@ -1722,7 +1722,7 @@ static sector_t raid5_compute_sector(raiswitch (algorithm) {case ALGORITHM_LEFT_ASYMMETRIC : - pd_idx = raid_disks -1 - (stripe % raid_disks); + pd_idx = raid_disks -1 -sector_div (stripe2, raid_disks); qd_idx = pd_idx +1 ;if (pd_idx == raid_disks-1 ) { (*dd_idx)++;/* Q D D D P */
@@ -1731,7 +1731,7 @@ static sector_t raid5_compute_sector(rai (*dd_idx) +=2 ;/* D D P Q D */ break ;case ALGORITHM_RIGHT_ASYMMETRIC : - pd_idx = stripe % raid_disks; + pd_idx =sector_div (stripe2, raid_disks); qd_idx = pd_idx +1 ;if (pd_idx == raid_disks-1 ) { (*dd_idx)++;/* Q D D D P */
@@ -1740,12 +1740,12 @@ static sector_t raid5_compute_sector(rai (*dd_idx) +=2 ;/* D D P Q D */ break ;case ALGORITHM_LEFT_SYMMETRIC : - pd_idx = raid_disks -1 - (stripe % raid_disks); + pd_idx = raid_disks -1 -sector_div (stripe2, raid_disks); qd_idx = (pd_idx +1 ) % raid_disks; *dd_idx = (pd_idx +2 + *dd_idx) % raid_disks;break ;case ALGORITHM_RIGHT_SYMMETRIC : - pd_idx = stripe % raid_disks; + pd_idx =sector_div (stripe2, raid_disks); qd_idx = (pd_idx +1 ) % raid_disks; *dd_idx = (pd_idx +2 + *dd_idx) % raid_disks;break ;
@@ -1764,7 +1764,7 @@ static sector_t raid5_compute_sector(rai/* Exactly the same as RIGHT_ASYMMETRIC, but or * of blocks for computing Q is different. */ - pd_idx = stripe % raid_disks; + pd_idx =sector_div (stripe2, raid_disks); qd_idx = pd_idx +1 ;if (pd_idx == raid_disks-1 ) { (*dd_idx)++;/* Q D D D P */
@@ -1779,7 +1779,8 @@ static sector_t raid5_compute_sector(rai* D D D P Q rather than * Q D D D P */ - pd_idx = raid_disks -1 - ((stripe +1 ) % raid_disks); + stripe2 +=1 ; + pd_idx = raid_disks -1 -sector_div (stripe2, raid_disks); qd_idx = pd_idx +1 ;if (pd_idx == raid_disks-1 ) { (*dd_idx)++;/* Q D D D P */
@@ -1791,7 +1792,7 @@ static sector_t raid5_compute_sector(raicase ALGORITHM_ROTATING_N_CONTINUE :/* Same as left_symmetric but Q is before P */ - pd_idx = raid_disks -1 - (stripe % raid_disks); + pd_idx = raid_disks -1 -sector_div (stripe2, raid_disks); qd_idx = (pd_idx + raid_disks -1 ) % raid_disks; *dd_idx = (pd_idx +1 + *dd_idx) % raid_disks; ddf_layout =1 ;
@@ -1799,27 +1800,27 @@ static sector_t raid5_compute_sector(raicase ALGORITHM_LEFT_ASYMMETRIC_6 :/* RAID5 left_asymmetric, with Q on last device */ - pd_idx = data_disks - stripe % (raid_disks-1 ); + pd_idx = data_disks -sector_div (stripe2, raid_disks-1 );if (*dd_idx >= pd_idx) (*dd_idx)++; qd_idx = raid_disks -1 ;break ;case ALGORITHM_RIGHT_ASYMMETRIC_6 : - pd_idx = stripe % (raid_disks-1 ); + pd_idx =sector_div (stripe2, raid_disks-1 );if (*dd_idx >= pd_idx) (*dd_idx)++; qd_idx = raid_disks -1 ;break ;case ALGORITHM_LEFT_SYMMETRIC_6 : - pd_idx = data_disks - stripe % (raid_disks-1 ); + pd_idx = data_disks -sector_div (stripe2, raid_disks-1 ); *dd_idx = (pd_idx +1 + *dd_idx) % (raid_disks-1 ); qd_idx = raid_disks -1 ;break ;case ALGORITHM_RIGHT_SYMMETRIC_6 : - pd_idx = stripe % (raid_disks-1 ); + pd_idx =sector_div (stripe2, raid_disks-1 ); *dd_idx = (pd_idx +1 + *dd_idx) % (raid_disks-1 ); qd_idx = raid_disks -1 ;break ;
PATCH 7/117 libata: fix locking around blk_abort_request()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit fa41efdae7de61191a7bda3a00e88ef69afb5bb9 upstream.
blk_abort_request() expectes queue lock to be held by the caller. Grab it before calling the function.
Lack of this synchronization led to infinite loop on corrupt q->timeout_list.
--- drivers/ata/libata-eh.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/ata/libata-eh.c +4 -0
@@ -879,6 +879,8 @@ static void ata_eh_set_pending(struct atvoid ata_qc_schedule_eh (struct ata_queued_cmd *qc) {struct ata_port *ap = qc->ap; +struct request_queue *q = qc->scsicmd->device->request_queue; +unsigned long flags;WARN_ON (!ap->ops->error_handler);
@@ -890,7 +892,9 @@ void ata_qc_schedule_eh(struct ata_queue* Note that ATA_QCFLAG_FAILED is unconditionally set after * this function completes. */ +spin_lock_irqsave (q->queue_lock, flags);blk_abort_request (qc->scsicmd->request); +spin_unlock_irqrestore (q->queue_lock, flags); }/**
PATCH 8/117 libata: ensure NCQ error result taskfile is fully initialized
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
before returning it via qc->result_tf.
From: Jeff Garzik <[email protected]>
commit a09bf4cd53b8ab000197ef81f15d50f29ecf973c upstream.
--- drivers/ata/libata-eh.c | 1 + 1 file changed, 1 insertion(+)
drivers/ata/libata-eh.c +1 -0
@@ -1628,6 +1628,7 @@ void ata_eh_analyze_ncq_error(struct ata }/* okay, this error is ours */ +memset (&tf,0 ,sizeof (tf)); rc =ata_eh_read_log_10h (dev, &tag, &tf);if (rc) { ata_link_printk(link, KERN_ERR, "failed to read log page 10h "
PATCH 9/117 w1: w1 temp: fix negative termperature calculation
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ian Dall <[email protected]>
commit 9a6a1ecd9e9b5d046a236da2f7eb6b6812f04229 upstream.
Fix regression caused by commit 507e2fbaaacb6f164b4125b87c5002f95143174b ("w1: w1 temp calculation overflow fix") whereby negative temperatures for the DS18B20 are not converted properly.
When the temperature exceeds 32767 milli-degrees the temperature overflows to -32768 millidegrees. These are both well within the -55 - +125 degree range for the sensor.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=12646
--- drivers/w1/slaves/w1_therm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/w1/slaves/w1_therm.c +2 -3
@@ -115,9 +115,8 @@ static struct w1_therm_family_converterstatic inline int w1_DS18B20_convert_temp (u8 rom[9 ]) { -int t = ((s16 )rom[1 ] <<8 ) | rom[0 ]; - t = t*1000 /16 ; -return t; +s16 t =le16_to_cpup ((__le16 *)rom); +return t*1000 /16 ; }static inline int w1_DS18S20_convert_temp (u8 rom[9 ])
PATCH 10/117 memcg: fix prepare migration
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrea Arcangeli <[email protected]>
commit 93d5c9be1ddd57d4063ce463c9ac2be1e5ee14f1 upstream.
If a signal is pending (task being killed by sigkill) __mem_cgroup_try_charge will write NULL into &mem, and css_put will oops on null pointer dereference.
BUG: unable to handle kernel NULL pointer dereference at 0000000000000010 IP: [<ffffffff810fc6cc>] mem_cgroup_prepare_migration+0x7c/0xc0 PGD a5d89067 PUD a5d8a067 PMD 0 Oops: 0000 [#1] SMP last sysfs file: /sys/devices/platform/microcode/firmware/microcode/loading CPU 0 Modules linked in: nfs lockd nfs_acl auth_rpcgss sunrpc acpi_cpufreq pcspkr sg [last unloaded: microcode]
Pid: 5299, comm: largepages Tainted: G W 2.6.34-rc3 #3 Penryn1600SLI-110dB/To Be Filled By O.E.M.
RIP: 0010:[<ffffffff810fc6cc>] [<ffffffff810fc6cc>] mem_cgroup_prepare_migration+0x7c/0xc0
--- mm/memcontrol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/memcontrol.c +2 -2
@@ -2215,12 +2215,12 @@ int mem_cgroup_prepare_migration(struct }unlock_page_cgroup (pc); + *ptr = mem;if (mem) { - ret =__mem_cgroup_try_charge (NULL ,GFP_KERNEL , &mem, false, + ret =__mem_cgroup_try_charge (NULL ,GFP_KERNEL , ptr, false, page);css_put (&mem->css); } - *ptr = mem;return ret; }
PATCH 11/117 mac80211: remove bogus TX agg state assignment
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Johannes Berg <[email protected]>
commit b4bb5c3fd9333024044362df67e23e96158489ed upstream.
When the addba timer expires but has no work to do, it should not affect the state machine. If it does, TX will not see the successfully established and we can also crash trying to re-establish the session.
--- net/mac80211/agg-tx.c | 1 - 1 file changed, 1 deletion(-)
net/mac80211/agg-tx.c +0 -1
@@ -183,7 +183,6 @@ static void sta_addba_resp_timer_expired HT_AGG_STATE_REQ_STOP_BA_MSK)) != HT_ADDBA_REQUESTED_MSK) {spin_unlock_bh (&sta->lock); - *state =HT_AGG_STATE_IDLE ;#ifdef CONFIG_MAC80211_HT_DEBUG printk(KERN_DEBUG "timer expired on tid %d but we are not " "(or no longer) expecting addBA response there",
PATCH 12/117 flex_array: fix the panic when calling flex_array_alloc() without __GFP_ZERO
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Changli Gao <[email protected]>
commit e59464c735db19619cde2aa331609adb02005f5b upstream.
memset() is called with the wrong address and the kernel panics.
--- lib/flex_array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/flex_array.c +1 -1
@@ -99,7 +99,7 @@ struct flex_array *flex_array_alloc(int ret->element_size = element_size; ret->total_nr_elements = total;if (elements_fit_in_base (ret) && !(flags & __GFP_ZERO)) -memset (ret->parts[0 ],FLEX_ARRAY_FREE , +memset (&ret->parts[0 ],FLEX_ARRAY_FREE ,FLEX_ARRAY_BASE_BYTES_LEFT );return ret; }
PATCH 13/117 hugetlb: fix infinite loop in get_futex_key() when backed by huge pages
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mel Gorman <[email protected]>
commit 23be7468e8802a2ac1de6ee3eecb3ec7f14dc703 upstream.
If a futex key happens to be located within a huge page mapped MAP_PRIVATE, get_futex_key() can go into an infinite loop waiting for a page->mapping that will never exist.
See https://bugzilla.redhat.com/show_bug.cgi?id=552257 for more details about the problem.
This patch makes page->mapping a poisoned value that includes PAGE_MAPPING_ANON mapped MAP_PRIVATE. This is enough for futex to continue but because of PAGE_MAPPING_ANON, the poisoned value is not dereferenced or used by futex. No other part of the VM should be dereferencing the page->mapping of a hugetlbfs page as its page cache is not on the LRU.
This patch fixes the problem with the test case described in the bugzilla.
--- include/linux/poison.h | 9 +++++++++ mm/hugetlb.c | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-)
include/linux/poison.h +9 -0
@@ -48,6 +48,15 @@#define POISON_FREE 0x6b/* for use-after-free poisoning */ #define POISON_END 0xa5/* end-byte of poisoning */ +/********** mm/hugetlb.c **********/ +/* +* Private mappings of hugetlb pages use this poisoned value for +* page->mapping. The core VM should not be doing anything with this mapping +* but futex requires the existence of some page->mapping value even though it +* is unused if PAGE_MAPPING_ANON is set. +*/ +#define HUGETLB_POISON ((void *)(0x00300300 + POISON_POINTER_DELTA + PAGE_MAPPING_ANON)) +/********** arch/$ARCH/mm/init.c **********/ #define POISON_FREE_INITMEM 0xcc
mm/hugetlb.c +4 -1
@@ -546,6 +546,7 @@ static void free_huge_page(struct page * mapping = (struct address_space *)page_private (page);set_page_private (page,0 ); + page->mapping =NULL ;BUG_ON (page_count (page));INIT_LIST_HEAD (&page->lru);
@@ -2447,8 +2448,10 @@ retry:spin_lock (&inode->i_lock); inode->i_blocks +=blocks_per_huge_page (h);spin_unlock (&inode->i_lock); - }else + }else {lock_page (page); + page->mapping =HUGETLB_POISON ; + } }/*
PATCH 14/117 reiserfs: fix permissions on .reiserfs_priv
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Mahoney <[email protected]>
commit cac36f707119b792b2396aed371d6b5cdc194890 upstream.
Commit 677c9b2e393a0cd203bd54e9c18b012b2c73305a ("reiserfs: remove privroot hiding in lookup") removed the magic from the lookup code to hide the .reiserfs_priv directory since it was getting loaded at mount-time instead. The intent was that the entry would be hidden from the user via a poisoned d_compare, but this was faulty.
This introduced a security issue where unprivileged users could access and modify extended attributes or ACLs belonging to other users, including root.
This patch resolves the issue by properly hiding .reiserfs_priv. This was the intent of the xattr poisoning code, but it appears to have never worked as expected. This is fixed by using d_revalidate instead of d_compare.
This patch makes -oexpose_privroot a no-op. I'm fine leaving it this way. The effort involved in working out the corner cases wrt permissions and caching outweigh the benefit of the feature.
--- fs/reiserfs/dir.c | 2 -- fs/reiserfs/xattr.c | 17 ++++------------- 2 files changed, 4 insertions(+), 15 deletions(-)
fs/reiserfs/dir.c +0 -2
@@ -45,8 +45,6 @@ static inline bool is_privroot_deh(struc struct reiserfs_de_head *deh) {struct dentry *privroot =REISERFS_SB (dir->d_sb)->priv_root; -if (reiserfs_expose_privroot (dir->d_sb)) -return 0 ;return (dir == dir->d_parent && privroot->d_inode && deh->deh_objectid ==INODE_PKEY (privroot->d_inode)->k_objectid); }
fs/reiserfs/xattr.c +4 -13
@@ -976,21 +976,13 @@ int reiserfs_permission(struct inode *inreturn generic_permission (inode, mask,NULL ); } -/* This will catch lookups from the fs root to .reiserfs_priv */ -static int -xattr_lookup_poison (struct dentry *dentry,struct qstr *q1,struct qstr *name) +static int xattr_hide_revalidate (struct dentry *dentry,struct nameidata *nd) { -struct dentry *priv_root =REISERFS_SB (dentry->d_sb)->priv_root; - if (container_of(q1, struct dentry, d_name) == priv_root) -return -ENOENT ; -if (q1->len == name->len && - !memcmp (q1->name, name->name, name->len)) -return 0 ; -return 1 ; +return -EPERM ; }static const struct dentry_operations xattr_lookup_poison_ops = { - .d_compare = xattr_lookup_poison, + .d_revalidate = xattr_hide_revalidate, };int reiserfs_lookup_privroot (struct super_block *s)
@@ -1004,8 +996,7 @@ int reiserfs_lookup_privroot(struct supe strlen(PRIVROOT_NAME));if (!IS_ERR (dentry)) {REISERFS_SB (s)->priv_root = dentry; -if (!reiserfs_expose_privroot (s)) - s->s_root->d_op = &xattr_lookup_poison_ops; + dentry->d_op = &xattr_lookup_poison_ops;if (dentry->d_inode) dentry->d_inode->i_flags |=S_PRIVATE ; }else
PATCH 15/117 reiserfs: fix corruption during shrinking of xattrs
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Mahoney <[email protected]>
commit fb2162df74bb19552db3d988fd11c787cf5fad56 upstream.
Commit 48b32a3553a54740d236b79a90f20147a25875e3 ("reiserfs: use generic xattr handlers") introduced a problem that causes corruption when extended attributes are replaced with a smaller value.
The issue is that the reiserfs_setattr to shrink the xattr file was moved from before the write to after the write.
The root issue has always been in the reiserfs xattr code, but was papered over by the fact that in the shrink case, the file would just be expanded again while the xattr was written.
The end result is that the last 8 bytes of xattr data are lost.
This patch fixes it to use new_size.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=14826
--- fs/reiserfs/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/reiserfs/xattr.c +1 -1
@@ -557,7 +557,7 @@ reiserfs_xattr_set_handle(struct reiserfif (!err && new_size <i_size_read (dentry->d_inode)) {struct iattr newattrs = { .ia_ctime =current_fs_time (inode->i_sb), - .ia_size = buffer_size, + .ia_size = new_size, .ia_valid =ATTR_SIZE |ATTR_CTIME , };
PATCH 16/117 procfs: fix tid fdinfo
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jerome Marchand <[email protected]>
commit 3835541dd481091c4dbf5ef83c08aed12e50fd61 upstream.
Correct the file_operations struct in fdinfo entry of tid_base_stuff[].
Presently /proc/*/task/*/fdinfo contains symlinks to opened files like /proc/*/fd/.
--- fs/proc/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/proc/base.c +1 -1
@@ -2910,7 +2910,7 @@ out_no_task:*/ static const struct pid_entry tid_base_stuff[] = {DIR ("fd" ,S_IRUSR |S_IXUSR , proc_fd_inode_operations, proc_fd_operations), -DIR ("fdinfo" ,S_IRUSR |S_IXUSR , proc_fdinfo_inode_operations, proc_fd_operations), +DIR ("fdinfo" ,S_IRUSR |S_IXUSR , proc_fdinfo_inode_operations, proc_fdinfo_operations),REG ("environ" ,S_IRUSR , proc_environ_operations),INF ("auxv" ,S_IRUSR , proc_pid_auxv),ONE ("status" ,S_IRUGO , proc_pid_status),
PATCH 17/117 nfsd4: bug in read_buf
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Neil Brown <[email protected]>
commit 2bc3c1179c781b359d4f2f3439cb3df72afc17fc upstream.
When read_buf is called to move over to the next page in the pagelist of an NFSv4 request, it sets argp->end to essentially a random number, certainly not an address within the page which argp->p now points to. So subsequent calls to READ_BUF will think there is much more than a page of spare space (the cast to u32 ensures an unsigned comparison) so we can expect to fall off the end of the second page.
We never encountered thsi in testing because typically the only operations which use more than two pages are write-like operations, which have their own decoding logic. Something like a getattr after a write may cross a page boundary, but it would be very unusual for it to cross another boundary after that.
--- fs/nfsd/nfs4xdr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/nfsd/nfs4xdr.c +4 -4
@@ -160,10 +160,10 @@ static __be32 *read_buf(struct nfsd4_com argp->p =page_address (argp->pagelist[0 ]); argp->pagelist++;if (argp->pagelen <PAGE_SIZE ) { - argp->end = p + (argp->pagelen>>2 ); + argp->end = argp->p + (argp->pagelen>>2 ); argp->pagelen =0 ; }else { - argp->end = p + (PAGE_SIZE >>2 ); + argp->end = argp->p + (PAGE_SIZE >>2 ); argp->pagelen -=PAGE_SIZE ; }memcpy (((char *)p)+avail, argp->p, (nbytes - avail));
@@ -1425,10 +1425,10 @@ nfsd4_decode_compound(struct nfsd4_compo argp->p =page_address (argp->pagelist[0 ]); argp->pagelist++;if (argp->pagelen <PAGE_SIZE ) { - argp->end = p + (argp->pagelen>>2 ); + argp->end = argp->p + (argp->pagelen>>2 ); argp->pagelen =0 ; }else { - argp->end = p + (PAGE_SIZE >>2 ); + argp->end = argp->p + (PAGE_SIZE >>2 ); argp->pagelen -=PAGE_SIZE ; } }
PATCH 18/117 keys: the request_key() syscall should link an existing key to the dest keyring
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Howells <[email protected]>
commit 03449cd9eaa4fa3a7faa4a59474bafe2e90bd143 upstream.
The request_key() system call and request_key_and_link() should make a link from an existing key to the destination keyring (if supplied), not just from a new key to the destination keyring.
This can be tested by:
ring=keyctl newring fred @s
keyctl request2 user debug:a a
keyctl request user debug:a $ring
keyctl list $ring
If it says:
keyring is empty
then it didn't work. If it shows something like:
1 key in keyring: 1070462727: --alswrv 0 0 user: debug:a
then it did.
request_key() system call is meant to recursively search all your keyrings for the key you desire, and, optionally, if it doesn't exist, call out to userspace to create one for you.
If request_key() finds or creates a key, it should, optionally, create a link to that key from the destination keyring specified.
Therefore, if, after a successful call to request_key() with a desination keyring specified, you see the destination keyring empty, the code didn't work correctly.
If you see the found key in the keyring, then it did - which is what the patch is required for.
--- security/keys/request_key.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
security/keys/request_key.c +8 -1
@@ -336,8 +336,10 @@ static int construct_alloc_key(struct ke key_already_present:mutex_unlock (&key_construction_mutex); -if (dest_keyring) +if (dest_keyring) { +__key_link (dest_keyring,key_ref_to_ptr (key_ref));up_write (&dest_keyring->sem); + }mutex_unlock (&user->cons_lock);key_put (key); *_key = key =key_ref_to_ptr (key_ref);
@@ -428,6 +430,11 @@ struct key *request_key_and_link(structif (!IS_ERR (key_ref)) { key =key_ref_to_ptr (key_ref); +if (dest_keyring) { +construct_get_dest_keyring (&dest_keyring); +key_link (dest_keyring, key); +key_put (dest_keyring); + } }else if (PTR_ERR (key_ref) != -EAGAIN ) { key =ERR_CAST (key_ref); }else {
PATCH 19/117 sfc: Wait at most 10ms for the MC to finish reading out MAC statistics
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Hutchings <[email protected]>
commit aabc5649078310094cbffb430fcbf9c25b6268f9 upstream.
The original code would wait indefinitely if MAC stats DMA failed.
--- drivers/net/sfc/siena.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/net/sfc/siena.c +11 -2
@@ -454,8 +454,17 @@ static int siena_try_update_nic_stats(ststatic void siena_update_nic_stats (struct efx_nic *efx) { -while (siena_try_update_nic_stats (efx) == -EAGAIN ) -cpu_relax (); +int retry; + +/* If we're unlucky enough to read statistics wduring the DMA, wait +* up to 10ms for it to finish (typically takes <500us) */ +for (retry =0 ; retry <100 ; ++retry) { +if (siena_try_update_nic_stats (efx) ==0 ) +return ; +udelay (100 ); + } + +/* Use the old values instead */ }static void siena_start_nic_stats (struct efx_nic *efx)
PATCH 20/117 sfc: Always close net device at the end of a disabling reset
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Hutchings <[email protected]>
commit f49a4589e9e25ef525da449b1ce5597cb659bbb5 upstream.
This fixes a regression introduced by commit eb9f6744cbfa97674c13263802259b5aa0034594 "sfc: Implement ethtool reset operation".
--- drivers/net/sfc/efx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/sfc/efx.c +2 -2
@@ -1862,6 +1862,7 @@ out: }if (disabled) { +dev_close (efx->net_dev);EFX_ERR (efx,"has been disabled\n" ); efx->state =STATE_DISABLED ; }else {
@@ -1885,8 +1886,7 @@ static void efx_reset_work(struct work_s }rtnl_lock (); -if (efx_reset (efx, efx->reset_pending)) -dev_close (efx->net_dev); + (void )efx_reset (efx, efx->reset_pending);rtnl_unlock (); }
PATCH 21/117 sfc: Change falcon_probe_board() to fail for unsupported boards
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Hutchings <[email protected]>
commit e41c11ee0cc602bcde68916be85fb97d1a484324 upstream.
The driver needs specific PHY and board support code for each SFC4000 board; there is no point trying to continue if it is missing. Currently unsupported boards can trigger an 'oops'.
--- drivers/net/sfc/falcon.c | 4 +++- drivers/net/sfc/falcon_boards.c | 13 +++---------- drivers/net/sfc/nic.h | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-)
drivers/net/sfc/falcon.c +3 -1
@@ -1317,7 +1317,9 @@ static int falcon_probe_nvconfig(structEFX_LOG (efx,"PHY is %d phy_id %d\n" , efx->phy_type, efx->mdio.prtad); -falcon_probe_board (efx, board_rev); + rc =falcon_probe_board (efx, board_rev); +if (rc) + goto fail2;kfree (nvconfig);return 0 ;
drivers/net/sfc/falcon_boards.c +3 -10
@@ -728,15 +728,7 @@ static const struct falcon_board_type bo }, }; -static const struct falcon_board_type falcon_dummy_board = { - .init = efx_port_dummy_op_int, - .init_phy = efx_port_dummy_op_void, - .fini = efx_port_dummy_op_void, - .set_id_led = efx_port_dummy_op_set_id_led, - .monitor = efx_port_dummy_op_int, -}; - -void falcon_probe_board (struct efx_nic *efx,u16 revision_info) +int falcon_probe_board (struct efx_nic *efx,u16 revision_info) {struct falcon_board *board =falcon_board (efx);u8 type_id =FALCON_BOARD_TYPE (revision_info);
@@ -754,8 +746,9 @@ void falcon_probe_board(struct efx_nic * (efx->pci_dev->subsystem_vendor ==EFX_VENDID_SFC ) ? board->type->ref_model : board->type->gen_type, 'A' + board->major, board->minor); +return 0 ; }else {EFX_ERR (efx,"unknown board type %d\n" , type_id); - board->type = &falcon_dummy_board; +return -ENODEV ; } }
drivers/net/sfc/nic.h +1 -1
@@ -156,7 +156,7 @@ extern struct efx_nic_type siena_a0_nic_************************************************************************** */ -extern void falcon_probe_board (struct efx_nic *efx,u16 revision_info); +extern int falcon_probe_board (struct efx_nic *efx,u16 revision_info);/* TX data path */ extern int efx_nic_probe_tx (struct efx_tx_queue *tx_queue);
PATCH 22/117 staging: usbip: Fix deadlock
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Lescouet <[email protected]>
commit d01f42a22ef381ba973958e977209ac9a8667d57 upstream.
When detaching a port from the client side (usbip --detach 0), the event thread, on the server side, is going to deadlock. The "eh" server thread is getting USBIP_EH_RESET event and calls:
-> stub_device_reset() -> usb_reset_device()
the USB framework is then calling back _in the same "eh" thread_ :
-> stub_disconnect() -> usbip_stop_eh() -> wait_for_completion()
the "eh" thread is being asleep forever, waiting for its own completion. This patch checks if "eh" is the current thread, in usbip_stop_eh().
--- drivers/staging/usbip/usbip_event.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/staging/usbip/usbip_event.c +3 -0
@@ -117,6 +117,9 @@ void usbip_stop_eh(struct usbip_device * {struct usbip_task *eh = &ud->eh; +if (eh->thread == current) +return ;/* do not wait for myself */ +wait_for_completion (&eh->thread_done);usbip_dbg_eh ("usbip_eh has finished\n" ); }
PATCH 23/117 USB: fix remote wakeup settings during system sleep
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
This is a backport of commit 5f677f1d45b2bf08085bbba7394392dfa586fa8e. Some of the functionality had to be removed, but it should still fix the webcam problem.
This patch (as1363b) changes the way USB remote wakeup is handled during system sleeps. It won't be enabled unless an interface driver specifically needs it. Also, it won't be enabled during the FREEZE or QUIESCE phases of hibernation, when the system doesn't respond to wakeup events anyway.
This will fix problems people have reported with certain USB webcams that generate wakeup requests when they shouldn't, and as a result cause system suspends to fail. See
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/515109
--- drivers/usb/core/driver.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-)
drivers/usb/core/driver.c +30 -2
@@ -1255,9 +1255,8 @@ static int usb_suspend_both(struct usb_d udev->state == USB_STATE_SUSPENDED) goto done; - udev->do_remote_wakeup =device_may_wakeup (&udev->dev); -if (msg.event &PM_EVENT_AUTO ) { + udev->do_remote_wakeup =device_may_wakeup (&udev->dev); status =autosuspend_check (udev,0 );if (status <0 ) goto done;
@@ -1789,6 +1788,34 @@ int usb_external_resume_device(struct usreturn status; } +static void choose_wakeup (struct usb_device *udev,pm_message_t msg) +{ +int w, i; +struct usb_interface *intf; + +/* Remote wakeup is needed only when we actually go to sleep. +* For things like FREEZE and QUIESCE, if the device is already +* autosuspended then its current wakeup setting is okay. +*/ +if (msg.event ==PM_EVENT_FREEZE || msg.event ==PM_EVENT_QUIESCE ) { + udev->do_remote_wakeup =0 ; +return ; + } + +/* If remote wakeup is permitted, see whether any interface drivers +* actually want it. +*/ + w =0 ; +if (device_may_wakeup (&udev->dev) && udev->actconfig) { +for (i =0 ; i < udev->actconfig->desc.bNumInterfaces; i++) { + intf = udev->actconfig->interface[i]; + w |= intf->needs_remote_wakeup; + } + } + + udev->do_remote_wakeup = w; +} +int usb_suspend (struct device *dev,pm_message_t msg) {struct usb_device *udev;
@@ -1808,6 +1835,7 @@ int usb_suspend(struct device *dev, pm_m } udev->skip_sys_resume =0 ; +choose_wakeup (udev, msg);return usb_external_suspend_device (udev, msg); }
PATCH 24/117 USB: Add id for HP ev2210 a.k.a Sierra MC5725 miniPCI-e Cell Modem.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: William Lightning <[email protected]>
commit cfbaa39347b34837f26e01fe8f4f8dbbae60b520 upstream.
--- drivers/usb/serial/sierra.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/sierra.c +1 -0
@@ -229,6 +229,7 @@ static const struct sierra_iface_info distatic struct usb_device_id id_table [] = { {USB_DEVICE (0x0F3D ,0x0112 ) },/* Airprime/Sierra PC 5220 */ {USB_DEVICE (0x03F0 ,0x1B1D ) },/* HP ev2200 a.k.a MC5720 */ + {USB_DEVICE (0x03F0 ,0x211D ) },/* HP ev2210 a.k.a MC5725 */ {USB_DEVICE (0x03F0 ,0x1E1D ) },/* HP hs2300 a.k.a MC8775 */ {USB_DEVICE (0x1199 ,0x0017 ) },/* Sierra Wireless EM5625 */
PATCH 25/117 USB: dont read past config->interface[] if usb_control_msg() fails in usb_reset_configuration()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Roel Kluin <[email protected]>
commit e4a3d94658b5760fc947d7f7185c57db47ca362a upstream.
While looping over the interfaces, if usb_hcd_alloc_bandwidth() fails it calls hcd->driver->reset_bandwidth(), so there was no need to reinstate the interface again.
If no break occurred, the index equals config->desc.bNumInterfaces. A subsequent usb_control_msg() failure resulted in a read from config->interface[config->desc.bNumInterfaces] at label reset_old_alts.
In either case the last interface should be skipped.
--- drivers/usb/core/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/core/message.c +1 -1
@@ -1471,7 +1471,7 @@ int usb_reset_configuration(struct usb_d/* If not, reinstate the old alternate settings */ if (retval <0 ) { reset_old_alts: -for (; i >=0 ; i--) { +for (i--; i >=0 ; i--) {struct usb_interface *intf = config->interface[i];struct usb_host_interface *alt;
PATCH 26/117 USB: fix testing the wrong variable in fs_create_by_name()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Carpenter <[email protected]>
commit fa7fe7af146a7b613e36a311eefbbfb5555325d1 upstream.
There is a typo here. We should be testing "*dentry" which was just assigned instead of "dentry". This could result in dereferencing an ERR_PTR inside either usbfs_mkdir() or usbfs_create().
--- drivers/usb/core/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/core/inode.c +2 -2
@@ -515,13 +515,13 @@ static int fs_create_by_name (const char *dentry =NULL ;mutex_lock (&parent->d_inode->i_mutex); *dentry =lookup_one_len (name, parent,strlen (name)); -if (!IS_ERR (dentry)) { +if (!IS_ERR (*dentry)) {if ((mode &S_IFMT ) ==S_IFDIR ) error =usbfs_mkdir (parent->d_inode, *dentry, mode);else error =usbfs_create (parent->d_inode, *dentry, mode); }else - error =PTR_ERR (dentry); + error =PTR_ERR (*dentry);mutex_unlock (&parent->d_inode->i_mutex);return error;
PATCH 27/117 USB: dont choose configs with no interfaces
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit 62f9cfa3ece58268b3e92ca59c23b175f86205aa upstream.
This patch (as1372) fixes a bug in the routine that chooses the default configuration to install when a new USB device is detected. The algorithm is supposed to look for a config whose first interface is for a non-vendor-specific class. But the way it's currently written, it will also accept a config with no interfaces at all, which is not very useful. (Believe it or not, such things do exist.)
--- drivers/usb/core/generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/core/generic.c +1 -1
@@ -120,7 +120,7 @@ int usb_choose_configuration(struct usb_* than a vendor-specific driver. */ else if (udev->descriptor.bDeviceClass != USB_CLASS_VENDOR_SPEC && - (!desc || desc->bInterfaceClass != + (desc && desc->bInterfaceClass !=USB_CLASS_VENDOR_SPEC )) { best = c;break ;
PATCH 28/117 USB: OHCI: dont look at the root hub to get the number of ports
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alan Stern <[email protected]>
commit fcf7d2141f4a363a4a8454c4a0f26bb69e766c5f upstream.
This patch (as1371) fixes a small bug in ohci-hcd. The HCD already knows how many ports the controller has; there's no need to go looking at the root hub's usb_device structure to find out. Especially since the root hub's maxchild value is set correctly only while the root hub is bound to the hub driver.
--- drivers/usb/host/ohci-hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ohci-hub.c +1 -1
@@ -697,7 +697,7 @@ static int ohci_hub_control (u16 wLength ) {struct ohci_hcd *ohci =hcd_to_ohci (hcd); -int ports =hcd_to_bus (hcd)->root_hub->maxchild; +int ports = ohci->num_ports;u32 temp;int retval =0 ;
PATCH 29/117 USB: xhci: properly set the "Mult" field of the endpoint context.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sarah Sharp <[email protected]>
commit 1cf62246c0e394021e494e0a8f1013e80db1a1a9 upstream.
A SuperSpeed interrupt or isochronous endpoint can define the number of "burst transactions" it can handle in a service interval. This is indicated by the "Mult" bits in the bmAttributes of the SuperSpeed Endpoint Companion Descriptor. For example, if it has a max packet size of 1024, a max burst of 11, and a mult of 3, the host may send 33 1024-byte packets in one service interval.
We must tell the xHCI host controller the number of multiple service opportunities (mults) the device can handle when the endpoint is installed. We do that by setting the Mult field of the Endpoint Context before a configure endpoint command is sent down. The Mult field is invalid for control or bulk SuperSpeed endpoints.
--- drivers/usb/host/xhci-mem.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/usb/host/xhci-mem.c +14 -0
@@ -549,6 +549,19 @@ static inline unsigned int xhci_get_endpreturn EP_INTERVAL (interval); } +/* The "Mult" field in the endpoint context is only set for SuperSpeed devices. +* High speed endpoint descriptors can define "the number of additional +* transaction opportunities per microframe", but that goes in the Max Burst +* endpoint context field. +*/ +static inline u32 xhci_get_endpoint_mult (struct usb_device *udev, +struct usb_host_endpoint *ep) +{ +if (udev->speed !=USB_SPEED_SUPER || !ep->ss_ep_comp) +return 0 ; +return ep->ss_ep_comp->desc.bmAttributes; +} +static inline u32 xhci_get_endpoint_type (struct usb_device *udev,struct usb_host_endpoint *ep) {
@@ -611,6 +624,7 @@ int xhci_endpoint_init(struct xhci_hcd * ep_ctx->deq = ep_ring->first_seg->dma | ep_ring->cycle_state; ep_ctx->ep_info =xhci_get_endpoint_interval (udev, ep); + ep_ctx->ep_info |=EP_MULT (xhci_get_endpoint_mult (udev, ep));/* FIXME dig Mult and streams info out of ep companion desc */
PATCH 30/117 USB: xhci: properly set endpoint context fields for periodic eps.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sarah Sharp <[email protected]>
commit 9238f25d5d32a435277eb234ec82bacdd5daed41 upstream.
For periodic endpoints, we must let the xHCI hardware know the maximum payload an endpoint can transfer in one service interval. The xHCI specification refers to this as the Maximum Endpoint Service Interval Time Payload (Max ESIT Payload). This is used by the hardware for bandwidth management and scheduling of packets.
For SuperSpeed endpoints, the maximum is calculated by multiplying the max packet size by the number of bursts and the number of opportunities to transfer within a service interval (the Mult field of the SuperSpeed Endpoint companion descriptor). Devices advertise this in the wBytesPerInterval field of their SuperSpeed Endpoint Companion Descriptor.
For high speed devices, this is taken by multiplying the max packet size by the "number of additional transaction opportunities per microframe" (the high bits of the wMaxPacketSize field in the endpoint descriptor).
For FS/LS devices, this is just the max packet size.
The other thing we must set in the endpoint context is the Average TRB Length. This is supposed to be the average of the total bytes in the transfer descriptor (TD), divided by the number of transfer request blocks (TRBs) it takes to describe the TD. This gives the host controller an indication of whether the driver will be enqueuing a scatter gather list with many entries comprised of small buffers, or one contiguous buffer.
It also takes into account the number of extra TRBs you need for every TD. This includes No-op TRBs and Link TRBs used to link ring segments together. Some drivers may choose to chain an Event Data TRB on the end of every TD, thus increasing the average number of TRBs per TD. The Linux xHCI driver does not use Event Data TRBs.
In theory, if there was an API to allow drivers to state what their bandwidth requirements are, we could set this field accurately. For now, we set it to the same number as the Max ESIT payload.
The Average TRB Length should also be set for bulk and control endpoints, but I have no idea how to guess what it should be.
--- drivers/usb/host/xhci-mem.c | 51 ++++++++++++++++++++++++++++++++++++++++++++ drivers/usb/host/xhci.h | 4 +++ 2 files changed, 55 insertions(+)
drivers/usb/host/xhci-mem.c +51 -0
@@ -592,6 +592,36 @@ static inline u32 xhci_get_endpoint_typereturn type; } +/* Return the maximum endpoint service interval time (ESIT) payload. +* Basically, this is the maxpacket size, multiplied by the burst size +* and mult size. +*/ +static inline u32 xhci_get_max_esit_payload (struct xhci_hcd *xhci, +struct usb_device *udev, +struct usb_host_endpoint *ep) +{ +int max_burst; +int max_packet; + +/* Only applies for interrupt or isochronous endpoints */ +if (usb_endpoint_xfer_control (&ep->desc) || +usb_endpoint_xfer_bulk (&ep->desc)) +return 0 ; + +if (udev->speed ==USB_SPEED_SUPER ) { +if (ep->ss_ep_comp) +return ep->ss_ep_comp->desc.wBytesPerInterval; +xhci_warn (xhci,"WARN no SS endpoint companion descriptor.\n" ); +/* Assume no bursts, no multiple opportunities to send. */ +return ep->desc.wMaxPacketSize; + } + + max_packet = ep->desc.wMaxPacketSize &0x3ff ; + max_burst = (ep->desc.wMaxPacketSize &0x1800 ) >>11 ; +/* A 0 in max burst means 1 transfer per ESIT */ +return max_packet * (max_burst +1 ); +} + int xhci_endpoint_init(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev, struct usb_device *udev,
@@ -603,6 +633,7 @@ int xhci_endpoint_init(struct xhci_hcd *struct xhci_ring *ep_ring;unsigned int max_packet;unsigned int max_burst; +u32 max_esit_payload; ep_index =xhci_get_endpoint_index (&ep->desc); ep_ctx =xhci_get_ep_ctx (xhci, virt_dev->in_ctx, ep_index);
@@ -670,6 +701,26 @@ int xhci_endpoint_init(struct xhci_hcd *default :BUG (); } + max_esit_payload =xhci_get_max_esit_payload (xhci, udev, ep); + ep_ctx->tx_info =MAX_ESIT_PAYLOAD_FOR_EP (max_esit_payload); + +/* +* XXX no idea how to calculate the average TRB buffer length for bulk +* endpoints, as the driver gives us no clue how big each scatter gather +* list entry (or buffer) is going to be. +* +* For isochronous and interrupt endpoints, we set it to the max +* available, until we have new API in the USB core to allow drivers to +* declare how much bandwidth they actually need. +* +* Normally, it would be calculated by taking the total of the buffer +* lengths in the TD and then dividing by the number of TRBs in a TD, +* including link TRBs, No-op TRBs, and Event data TRBs. Since we don't +* use Event Data TRBs, and we don't chain in a link TRB on short +* transfers, we're basically dividing by 1. +*/ + ep_ctx->tx_info |=AVG_TRB_LENGTH_FOR_EP (max_esit_payload); +/* FIXME Debug endpoint context */ return 0 ; }
drivers/usb/host/xhci.h +4 -0
@@ -609,6 +609,10 @@ struct xhci_ep_ctx {#define MAX_PACKET_MASK (0xffff << 16)#define MAX_PACKET_DECODED (p) (((p) >> 16) & 0xffff) +/* tx_info bitmasks */ +#define AVG_TRB_LENGTH_FOR_EP (p) ((p) & 0xffff) +#define MAX_ESIT_PAYLOAD_FOR_EP (p) (((p) & 0xffff) << 16) +/** * struct xhci_input_control_context
PATCH 31/117 ocfs2: Update VFS inodes id info after reflink.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tao Ma <[email protected]>
commit c21a534e2f24968cf74976a4e721ac194db30ded upstream.
In reflink we update the id info on the disk but forgot to update the corresponding information in the VFS inode. Update them accordingly when we want to preserve the attributes.
--- fs/ocfs2/refcounttree.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ocfs2/refcounttree.c +3 -0
@@ -4083,6 +4083,9 @@ static int ocfs2_complete_reflink(struct di->i_attr = s_di->i_attr;if (preserve) { + t_inode->i_uid = s_inode->i_uid; + t_inode->i_gid = s_inode->i_gid; + t_inode->i_mode = s_inode->i_mode; di->i_uid = s_di->i_uid; di->i_gid = s_di->i_gid; di->i_mode = s_di->i_mode;
PATCH 32/117 ocfs2: potential ERR_PTR dereference on error paths
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Carpenter <[email protected]>
commit 0350cb078f5035716ebdad4ad4709d02fe466a8a upstream.
If "handle" is non null at the end of the function then we assume it's a valid pointer and pass it to ocfs2_commit_trans();
--- fs/ocfs2/inode.c | 1 + 1 file changed, 1 insertion(+)
fs/ocfs2/inode.c +1 -0
@@ -559,6 +559,7 @@ static int ocfs2_truncate_for_delete(str handle =ocfs2_start_trans (osb,OCFS2_INODE_UPDATE_CREDITS );if (IS_ERR (handle)) { status =PTR_ERR (handle); + handle =NULL ;mlog_errno (status); goto out; }
PATCH 33/117 ocfs2: Compute metaecc for superblocks during online resize.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Joel Becker <[email protected]>
commit a42ab8e1a37257da37e0f018e707bf365ac24531 upstream.
Online resize writes out the new superblock and its backups directly. The metaecc data wasn't being recomputed. Let's do that directly.
--- fs/ocfs2/buffer_head_io.c | 2 ++ 1 file changed, 2 insertions(+)
fs/ocfs2/buffer_head_io.c +2 -0
@@ -407,6 +407,7 @@ int ocfs2_write_super_or_backup(struct o struct buffer_head *bh) {int ret =0 ; +struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data;mlog_entry_void ();
@@ -426,6 +427,7 @@ int ocfs2_write_super_or_backup(struct oget_bh (bh);/* for end_buffer_write_sync() */ bh->b_end_io = end_buffer_write_sync; +ocfs2_compute_meta_ecc (osb->sb, bh->b_data, &di->i_check);submit_bh (WRITE , bh);wait_on_buffer (bh);
PATCH 34/117 ocfs2_dlmfs: Fix math error when reading LVB.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Joel Becker <[email protected]>
commit a36d515c7a2dfacebcf41729f6812dbc424ebcf0 upstream.
When asked for a partial read of the LVB in a dlmfs file, we can accidentally calculate a negative count.
--- fs/ocfs2/dlm/dlmfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/dlm/dlmfs.c +1 -1
@@ -205,7 +205,7 @@ static ssize_t dlmfs_file_read(struct fiif ((count + *ppos) >i_size_read (inode)) readlen =i_size_read (inode) - *ppos;else - readlen = count - *ppos; + readlen = count; lvb_buf =kmalloc (readlen,GFP_NOFS );if (!lvb_buf)
PATCH 35/117 powernow-k8: Fix frequency reporting
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Langsdorf <[email protected]>
commit b810e94c9d8e3fff6741b66cd5a6f099a7887871 upstream.
With F10, model 10, all valid frequencies are in the ACPI _PST table.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/cpufreq/powernow-k8.c +2 -1
@@ -929,7 +929,8 @@ static int fill_powernow_table_pstate(st powernow_table[i].index = index;/* Frequency may be rounded for these */ -if (boot_cpu_data.x86 ==0x10 || boot_cpu_data.x86 ==0x11 ) { +if ((boot_cpu_data.x86 ==0x10 && boot_cpu_data.x86_model <10 ) + || boot_cpu_data.x86 ==0x11 ) { powernow_table[i].frequency =freq_from_fid_did (lo &0x3f , (lo >>6 ) &7 ); }else
PATCH 36/117 nfs d_revalidate() is too trigger-happy with d_drop()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Al Viro <[email protected]>
commit d9e80b7de91db05c1c4d2e5ebbfd70b3b3ba0e0f upstream.
If dentry found stale happens to be a root of disconnected tree, we can't d_drop() it; its d_hash is actually part of s_anon and d_drop() would simply hide it from shrink_dcache_for_umount(), leading to all sorts of fun, including busy inodes on umount and oopsen after that.
Bug had been there since at least 2006 (commit c636eb already has it), so it's definitely -stable fodder.
--- fs/nfs/dir.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfs/dir.c +2 -0
@@ -837,6 +837,8 @@ out_zap_parent:/* If we have submounts, don't unhash ! */ if (have_submounts (dentry)) goto out_valid; +if (dentry->d_flags &DCACHE_DISCONNECTED ) + goto out_valid;shrink_dcache_parent (dentry); }d_drop (dentry);
PATCH 37/117 NFS: rsize and wsize settings ignored on v4 mounts
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Chuck Lever <[email protected]>
commit 356e76b855bdbfd8d1c5e75bcf0c6bf0dfe83496 upstream.
NFSv4 mounts ignore the rsize and wsize mount options, and always use the default transfer size for both. This seems to be because all NFSv4 mounts are now cloned, and the cloning logic doesn't copy the rsize and wsize settings from the parent nfs_server.
I tested Fedora's 2.6.32.11-99 and it seems to have this problem as well, so I'm guessing that .33, .32, and perhaps older kernels have this issue as well.
--- fs/nfs/client.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfs/client.c +2 -0
@@ -965,6 +965,8 @@ out_error:static void nfs_server_copy_userdata (struct nfs_server *target,struct nfs_server *source) { target->flags = source->flags; + target->rsize = source->rsize; + target->wsize = source->wsize; target->acregmin = source->acregmin; target->acregmax = source->acregmax; target->acdirmin = source->acdirmin;
PATCH 38/117 Staging: hv: Fix a bug affecting IPv6
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Haiyang Zhang <[email protected]>
commit 95beae90aa4afce57fb28e6f8238b78217bd7c98 upstream.
Fix a bug affecting IPv6
Added the multicast flag for proper IPv6 function.
--- drivers/staging/hv/RndisFilter.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/hv/RndisFilter.c +1 -0
@@ -756,6 +756,7 @@ static int RndisFilterOpenDevice(struct ret =RndisFilterSetPacketFilter (Device,NDIS_PACKET_TYPE_BROADCAST | +NDIS_PACKET_TYPE_ALL_MULTICAST |NDIS_PACKET_TYPE_DIRECTED );if (ret ==0 ) Device->State =RNDIS_DEV_DATAINITIALIZED ;
PATCH 39/117 Staging: hv: Fix up memory leak on HvCleanup
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Cyrill Gorcunov <[email protected]>
commit fa8ad0257ea256381126ecf447694622216c600f upstream.
Don't assign NULL too early
--- drivers/staging/hv/Hv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/hv/Hv.c +1 -1
@@ -306,9 +306,9 @@ void HvCleanup(void)DPRINT_ENTER (VMBUS );if (gHvContext.SignalEventBuffer) { +kfree (gHvContext.SignalEventBuffer); gHvContext.SignalEventBuffer =NULL ; gHvContext.SignalEventParam =NULL ; -kfree (gHvContext.SignalEventBuffer); }if (gHvContext.GuestId ==HV_LINUX_GUEST_ID ) {
PATCH 40/117 Staging: hv: name network device ethX rather than sethX
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stephen Hemminger <[email protected]>
commit 546d9e101e7a71e6202f47a13ddcd9b8fb05a52e upstream.
This patch makes the HyperV network device use the same naming scheme as other virtual drivers (Xen, KVM). In an ideal world, userspace tools would not care what the name is, but some users and applications do care. Vyatta CLI is one of the tools that does depend on what the name is.
--- drivers/staging/hv/netvsc_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/hv/netvsc_drv.c +1 -2
@@ -413,8 +413,7 @@ static int netvsc_probe(struct device *dif (!net_drv_obj->Base.OnDeviceAdd)return -1 ; - net =alloc_netdev (sizeof (struct net_device_context ),"seth%d" , - ether_setup); + net =alloc_etherdev (sizeof (struct net_device_context ));if (!net)return -1 ;
PATCH 41/117 i2c: Fix probing of FSC hardware monitoring chips
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
commit b1d4b390ea4bb480e65974ce522a04022608a8df upstream.
Some FSC hardware monitoring chips (Syleus at least) doesn't like quick writes we typically use to probe for I2C chips. Use a regular byte read instead for the address they live at (0x73). These are the only known chips living at this address on PC systems.
For clarity, this fix should not be needed for kernels 2.6.30 and later, as we started instantiating the hwmon devices explicitly based on DMI data. Still, this fix is valuable in the following two cases:
* Support for recent FSC chips on older kernels. The DMI-based device instantiation is more difficult to backport than the device support itself.
* Case where the DMI-based device instantiation fails, whatever the reason. We fall back to probing in that case, so it should work.
This fixes kernel bug #15634:
https://bugzilla.kernel.org/show_bug.cgi?id=15634
--- drivers/i2c/i2c-core.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/i2c/i2c-core.c +16 -5
@@ -1210,12 +1210,23 @@ static int i2c_detect_address(struct i2creturn 0 ;/* Make sure there is something at this address */ -if (i2c_smbus_xfer (adapter, addr,0 ,0 ,0 ,I2C_SMBUS_QUICK ,NULL ) <0 ) -return 0 ; +if (addr ==0x73 && (adapter->class &I2C_CLASS_HWMON )) { +/* Special probe for FSC hwmon chips */ +union i2c_smbus_data dummy; + +if (i2c_smbus_xfer (adapter, addr,0 ,I2C_SMBUS_READ ,0 , +I2C_SMBUS_BYTE_DATA , &dummy) <0 ) +return 0 ; + }else { +if (i2c_smbus_xfer (adapter, addr,0 ,I2C_SMBUS_WRITE ,0 , +I2C_SMBUS_QUICK ,NULL ) <0 ) +return 0 ; -/* Prevent 24RF08 corruption */ -if ((addr & ~0x0f ) ==0x50 ) -i2c_smbus_xfer (adapter, addr,0 ,0 ,0 ,I2C_SMBUS_QUICK ,NULL ); +/* Prevent 24RF08 corruption */ +if ((addr & ~0x0f ) ==0x50 ) +i2c_smbus_xfer (adapter, addr,0 ,I2C_SMBUS_WRITE ,0 , +I2C_SMBUS_QUICK ,NULL ); + }/* Finally call the custom detection function */ memset (&info,0 ,sizeof (struct i2c_board_info ));
PATCH 42/117 perf: Fix resource leak in failure path of perf_event_open()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit 048c852051d2bd5da54a4488bc1f16b0fc74c695 upstream.
perf_event_open() kfrees event after init failure which doesn't release all resources allocated by perf_event_alloc(). Use free_event() instead.
LKML-Reference: <[email protected]>
--- kernel/perf_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/perf_event.c +1 -1
@@ -4811,7 +4811,7 @@ err_fput_free_put_context: err_free_put_context:if (err <0 ) -kfree (event); +free_event (event); err_put_context:if (err <0 )
PATCH 43/117 raid6: fix recovery performance regression
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Williams <[email protected]>
commit 5157b4aa5b7de8787b6318e61bcc285031bb9088 upstream.
The raid6 recovery code should immediately drop back to the optimized synchronous path when a p+q dma resource is not available. Otherwise we run the non-optimized/multi-pass async code in sync mode.
Verified with raid6test (NDISKS=255)
Applies to kernels >= 2.6.32.
--- crypto/async_tx/async_raid6_recov.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)
crypto/async_tx/async_raid6_recov.c +13 -8
@@ -324,6 +324,7 @@ struct dma_async_tx_descriptor * async_raid6_2data_recov(int disks, size_t bytes, int faila, int failb, struct page **blocks, struct async_submit_ctl *submit) { + void *scribble = submit->scribble;int non_zero_srcs, i;BUG_ON (faila == failb);
@@ -332,11 +333,13 @@ async_raid6_2data_recov(int disks, size_pr_debug ("%s: disks: %d len: %zu\n" , __func__, disks, bytes); -/* we need to preserve the contents of 'blocks' for the async -* case, so punt to synchronous if a scribble buffer is not available +/* if a dma resource is not available or a scribble buffer is not +* available punt to the synchronous path. In the 'dma not +* available' case be sure to use the scribble buffer to +* preserve the content of 'blocks' as the caller intended. */ -if (!submit->scribble) { -void **ptrs = (void **) blocks; +if (!async_dma_find_channel (DMA_PQ ) || !scribble) { +void **ptrs = scribble ? scribble : (void **) blocks;async_tx_quiesce (&submit->depend_tx);for (i =0 ; i < disks; i++)
@@ -406,11 +409,13 @@ async_raid6_datap_recov(int disks, size_pr_debug ("%s: disks: %d len: %zu\n" , __func__, disks, bytes); -/* we need to preserve the contents of 'blocks' for the async -* case, so punt to synchronous if a scribble buffer is not available +/* if a dma resource is not available or a scribble buffer is not +* available punt to the synchronous path. In the 'dma not +* available' case be sure to use the scribble buffer to +* preserve the content of 'blocks' as the caller intended. */ -if (!scribble) { -void **ptrs = (void **) blocks; +if (!async_dma_find_channel (DMA_PQ ) || !scribble) { +void **ptrs = scribble ? scribble : (void **) blocks;async_tx_quiesce (&submit->depend_tx);for (i =0 ; i < disks; i++)
PATCH 44/117 serial: 8250_pnp - add Fujitsu Wacom device
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ping Cheng <[email protected]>
commit d9901660b53b92f0f3551c06588b8be38224b245 upstream.
Add Fujitsu Wacom 1FGT Tablet PC device
--- drivers/serial/8250_pnp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/serial/8250_pnp.c +2 -0
@@ -348,6 +348,8 @@ static const struct pnp_device_id pnp_de { "FUJ02E6", 0 },/* Fujitsu Wacom 2FGT Tablet PC device */ { "FUJ02E7", 0 }, +/* Fujitsu Wacom 1FGT Tablet PC device */ + { "FUJ02E9", 0 },/* * LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in * disguise)
PATCH 45/117 block: ensure jiffies wrap is handled correctly in blk_rq_timed_out_timer
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Richard Kennedy <[email protected]>
commit a534dbe96e9929c7245924d8252d89048c23d569 upstream.
blk_rq_timed_out_timer() relied on blk_add_timer() never returning a timer value of zero, but commit 7838c15b8dd18e78a523513749e5b54bda07b0cb removed the code that bumped this value when it was zero. Therefore when jiffies is near wrap we could get unlucky & not set the timeout value correctly.
This patch uses a flag to indicate that the timeout value was set and so handles jiffies wrap correctly, and it keeps all the logic in one function so should be easier to maintain in the future.
--- block/blk-timeout.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
block/blk-timeout.c +5 -7
@@ -109,6 +109,7 @@ void blk_rq_timed_out_timer(unsigned lonstruct request_queue *q = (struct request_queue *) data;unsigned long flags, next =0 ;struct request *rq, *tmp; +int next_set =0 ;spin_lock_irqsave (q->queue_lock, flags);
@@ -122,16 +123,13 @@ void blk_rq_timed_out_timer(unsigned lonif (blk_mark_rq_complete (rq))continue ;blk_rq_timed_out (rq); - }else if (!next ||time_after (next, rq->deadline)) + }else if (!next_set ||time_after (next, rq->deadline)) { next = rq->deadline; + next_set =1 ; + } } -/* -* next can never be 0 here with the list non-empty, since we always -* bump ->deadline to 1 so we can detect if the timer was ever added -* or not. See comment in blk_add_timer() -*/ -if (next) +if (next_set)mod_timer (&q->timeout,round_jiffies_up (next));spin_unlock_irqrestore (q->queue_lock, flags);
PATCH 46/117 Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes"
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Linus Torvalds <[email protected]>
commit 4dc86ae1f925b2121d4e75058675895f83e54c71 upstream.
This reverts commit ba168fc37dea145deeb8fa9e7e71c748d2e00d74.
It changes user-visible sysfs interfaces, and breaks some existing user space applications which apparently rely on the fact that the output does not contain the "0x" prefix.
--- drivers/base/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/memory.c +1 -1
@@ -311,7 +311,7 @@ static SYSDEV_ATTR(removable, 0444, showstatic ssize_t print_block_size (struct class *class,char *buf) { -return sprintf (buf,"%#lx\n" , (unsigned long )PAGES_PER_SECTION *PAGE_SIZE ); +return sprintf (buf,"%lx\n" , (unsigned long )PAGES_PER_SECTION *PAGE_SIZE ); } static CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL);
PATCH 47/117 dm9601: fix phy/eeprom write routine
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Korsgaard <[email protected]>
commit e9162ab1610531d6ea6c1833daeb2613e44275e8 upstream.
Use correct bit positions in DM_SHARED_CTRL register for writes.
Michael Planes recently encountered a 'KY-RS9600 USB-LAN converter', which came with a driver CD containing a Linux driver. This driver turns out to be a copy of dm9601.c with symbols renamed and my copyright stripped. That aside, it did contain 1 functional change in dm_write_shared_word(), and after checking the datasheet the original value was indeed wrong (read versus write bits).
On Michaels HW, this change bumps receive speed from ~30KB/s to ~900KB/s. On other devices the difference is less spectacular, but still significant (~30%).
--- drivers/net/usb/dm9601.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/dm9601.c +1 -1
@@ -238,7 +238,7 @@ static int dm_write_shared_word(struct u goto out;dm_write_reg (dev,DM_SHARED_ADDR , phy ? (reg |0x40 ) : reg); -dm_write_reg (dev,DM_SHARED_CTRL , phy ?0x1c :0x14 ); +dm_write_reg (dev,DM_SHARED_CTRL , phy ?0x1a :0x12 );for (i =0 ; i <DM_TIMEOUT ; i++) {u8 tmp;
PATCH 48/117 p54pci: fix bugs in p54p_check_tx_ring
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hans de Goede <[email protected]>
commit 0250ececdf6813457c98719e2d33b3684881fde0 upstream.
Hans de Goede identified a bug in p54p_check_tx_ring:
there are two ring indices. 1 => tx data and 3 => tx management. But the old code had a constant "1" and this resulted in spurious dma unmapping failures.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=583623
--- drivers/net/wireless/p54/p54pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/p54/p54pci.c +1 -1
@@ -245,7 +245,7 @@ static void p54p_check_tx_ring(struct ieu32 idx, i; i = (*index) % ring_limit; - (*index) = idx =le32_to_cpu (ring_control->device_idx[1 ]); + (*index) = idx =le32_to_cpu (ring_control->device_idx[ring_index]); idx %= ring_limit;while (i != idx) {
PATCH 49/117 edac, mce: Fix wrong mask and macro usage
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Borislav Petkov <[email protected]>
commit 35d824b28fc5544d1eb7c1e3db15a1740df8ec4b upstream.
Correct two mishaps which prevented reporting error type (CECC vs UECC) and extended error description.
--- drivers/edac/edac_mce_amd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/edac/edac_mce_amd.c +2 -3
@@ -294,7 +294,6 @@ wrong_ls_mce:void amd_decode_nb_mce (int node_id,struct err_regs *regs,int handle_errors) {u32 ec =ERROR_CODE (regs->nbsl); -u32 xec =EXT_ERROR_CODE (regs->nbsl);if (!handle_errors)return ;
@@ -324,7 +323,7 @@ void amd_decode_nb_mce(int node_id, strupr_cont ("\n" ); } -pr_emerg ("%s.\n" ,EXT_ERR_MSG (xec)); +pr_emerg ("%s.\n" ,EXT_ERR_MSG (regs->nbsl));if (BUS_ERROR (ec) && nb_bus_decoder)nb_bus_decoder (node_id, regs);
@@ -374,7 +373,7 @@ static int amd_decode_mce(struct notifie ((m->status & MCI_STATUS_PCC) ? "yes" : "no"));/* do the two bits[14:13] together */ - ecc = m->status & (3ULL <<45 ); + ecc = (m->status >>45 ) &0x3 ;if (ecc)pr_cont (", %sECC Error" , ((ecc ==2 ) ?"C" :"U" ));
PATCH 50/117 x86-64: Clear a 64-bit FS/GS base on fork if selector is nonzero
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: H. Peter Anvin <[email protected]>
commit 7ce5a2b9bb2e92902230e3121d8c3047fab9cb47 upstream.
When we do a thread switch, we clear the outgoing FS/GS base if the corresponding selector is nonzero. This is taken by __switch_to() as an entry invariant; it does not verify that it is true on entry. However, copy_thread() doesn't enforce this constraint, which can result in inconsistent results after fork().
Make copy_thread() match the behavior of __switch_to().
LKML-Reference: <[email protected]>
--- arch/x86/kernel/process_64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/process_64.c +2 -2
@@ -282,12 +282,12 @@ int copy_thread(unsigned long clone_flagset_tsk_thread_flag (p,TIF_FORK ); - p->thread.fs = me->thread.fs; - p->thread.gs = me->thread.gs; p->thread.io_bitmap_ptr =NULL ;savesegment (gs, p->thread.gsindex); + p->thread.gs = p->thread.gsindex ?0 : me->thread.gs;savesegment (fs, p->thread.fsindex); + p->thread.fs = p->thread.fsindex ?0 : me->thread.fs;savesegment (es, p->thread.es);savesegment (ds, p->thread.ds);
PATCH 51/117 x86: Disable large pages on CPUs with Atom erratum AAE44
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: H. Peter Anvin <[email protected]>
commit 7a0fc404ae663776e96db43879a0fa24fec1fa3a upstream.
Atom erratum AAE44/AAF40/AAG38/AAH41:
"If software clears the PS (page size) bit in a present PDE (page directory entry), that will cause linear addresses mapped through this PDE to use 4-KByte pages instead of using a large page after old TLB entries are invalidated. Due to this erratum, if a code fetch uses this PDE before the TLB entry for the large page is invalidated then it may fetch from a different physical address than specified by either the old large page translation or the new 4-KByte page translation. This erratum may also cause speculative code fetches from incorrect addresses."
[http://download.intel.com/design/processor/specupdt/319536.pdf]
Where as commit 211b3d03c7400f48a781977a50104c9d12f4e229 seems to workaround errata AAH41 (mixed 4K TLBs) it reduces the window of opportunity for the bug to occur and does not totally remove it. This patch disables mixed 4K/4MB page tables totally avoiding the page splitting and not tripping this processor issue.
This is based on an original patch by Colin King.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/cpu/intel.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
arch/x86/kernel/cpu/intel.c +21 -0
@@ -47,6 +47,27 @@ static void __cpuinit early_init_intel(s (c->x86 == 0x6 && c->x86_model >= 0x0e))set_cpu_cap (c,X86_FEATURE_CONSTANT_TSC ); +/* +* Atom erratum AAE44/AAF40/AAG38/AAH41: +* +* A race condition between speculative fetches and invalidating +* a large page. This is worked around in microcode, but we +* need the microcode to have already been loaded... so if it is +* not, recommend a BIOS update and disable large pages. +*/ +if (c->x86 ==6 && c->x86_model ==0x1c && c->x86_mask <=2 ) { +u32 ucode, junk; + +wrmsr (MSR_IA32_UCODE_REV ,0 ,0 ); +sync_core (); +rdmsr (MSR_IA32_UCODE_REV , junk, ucode); + +if (ucode <0x20e ) { +printk (KERN_WARNING "Atom PSE erratum detected, BIOS microcode update recommended\n" ); +clear_cpu_cap (c,X86_FEATURE_PSE ); + } + } +#ifdef CONFIG_X86_64 set_cpu_cap (c,X86_FEATURE_SYSENTER32 );#else
PATCH 52/117 x86: Fix NULL pointer access in irq_force_complete_move() for Xen guests
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Prarit Bhargava <[email protected]>
commit bbd391a15d82e14efe9d69ba64cadb855b061dba upstream.
Upstream PV guests fail to boot because of a NULL pointer in irq_force_complete_move(). It is possible that xen guests have irq_desc->chip_data = NULL.
Test for NULL chip_data pointer before attempting to complete an irq move.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/apic/io_apic.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kernel/apic/io_apic.c +3 -0
@@ -2539,6 +2539,9 @@ void irq_force_complete_move(int irq)struct irq_desc *desc =irq_to_desc (irq);struct irq_cfg *cfg = desc->chip_data; +if (!cfg) +return ; + __irq_complete_move(&desc, cfg->vector); }#else
PATCH 53/117 x86, k8 nb: Fix boot crash: enable k8_northbridges unconditionally on AMD systems
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Borislav Petkov <[email protected]>
commit 0e152cd7c16832bd5cadee0c2e41d9959bc9b6f9 upstream.
de957628ce7c84764ff41331111036b3ae5bad0f changed setting of the x86_init.iommu.iommu_init function ptr only when GART IOMMU is found.
One side effect of it is that num_k8_northbridges
is not initialized anymore if not explicitly
called. This resulted in uninitialized pointers in <arch/x86/kernel/cpu/intel_cacheinfo.c:amd_calc_l3_indices()>, for example, which uses the num_k8_northbridges thing through node_to_k8_nb_misc().
Fix that through an initcall that runs right after the PCI subsystem and does all the scanning. Then, remove initialization in gart_iommu_init() which is a rootfs_initcall and we're running before that.
What is more, since num_k8_northbridges is being used in other places beside GART IOMMU, include it whenever we add AMD CPU support. The previous dependency chain in kconfig contained
K8_NB depends on AGP_AMD64|GART_IOMMU
which was clearly incorrect. The more natural way in terms of hardware dependency should be
AGP_AMD64|GART_IOMMU depends on K8_NB depends on CPU_SUP_AMD && PCI. Make it so Number One!
LKML-Reference: <20100312144303.GA29262@aftab>
--- arch/x86/Kconfig | 4 ++-- arch/x86/kernel/k8.c | 14 ++++++++++++++ arch/x86/kernel/pci-gart_64.c | 2 +- drivers/char/agp/Kconfig | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-)
arch/x86/Kconfig +2 -2
@@ -627,7 +627,7 @@ config GART_IOMMU bool "GART IOMMU support" if EMBEDDED default y select SWIOTLB - depends on X86_64 && PCI + depends on X86_64 && PCI && K8_NB ---help--- Support for full DMA access of devices with 32bit memory access only on systems with more than 3GB. This is usually needed for USB,
@@ -2026,7 +2026,7 @@ endif # X86_32 config K8_NB def_bool y - depends on AGP_AMD64 || (X86_64 && (GART_IOMMU || (PCI && NUMA))) + depends on CPU_SUP_AMD && PCI source "drivers/pcmcia/Kconfig"
arch/x86/kernel/k8.c +14 -0
@@ -121,3 +121,17 @@ void k8_flush_garts(void) }EXPORT_SYMBOL_GPL (k8_flush_garts); +static __init int init_k8_nbs (void ) +{ +int err =0 ; + + err =cache_k8_northbridges (); + +if (err <0 ) +printk (KERN_NOTICE "K8 NB: Cannot enumerate AMD northbridges.\n" ); + +return err; +} + +/* This has to go after the PCI subsystem */ +fs_initcall (init_k8_nbs);
arch/x86/kernel/pci-gart_64.c +1 -1
@@ -738,7 +738,7 @@ int __init gart_iommu_init(void)unsigned long scratch;long i; -if (cache_k8_northbridges () <0 || num_k8_northbridges ==0 ) +if (num_k8_northbridges ==0 )return 0 ;#ifndef CONFIG_AGP_AMD64
drivers/char/agp/Kconfig +1 -1
@@ -57,7 +57,7 @@ config AGP_AMD config AGP_AMD64 tristate "AMD Opteron/Athlon64 on-CPU GART support" - depends on AGP && X86 + depends on AGP && X86 && K8_NB help This option gives you AGP support for the GLX component of X using the on-CPU northbridge of the AMD Athlon64/Opteron CPUs.
PATCH 54/117 ALSA: hda: Use LPIB quirk for DG965OT board version AAD63733-203
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 0e0280dc2b0c7395a880d25544b47f3e3e3f79db upstream.
The OR has verified with 2.6.32.11 and the latest alsa-driver stable daily snapshot that position_fix=1 is necessary for the external mic to work and for PulseAudio not to crash constantly.
This patch is necessary also for 2.6.32.11 and 2.6.33.2.
--- sound/pci/hda/hda_intel.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/hda_intel.c +1 -0
@@ -2273,6 +2273,7 @@ static struct snd_pci_quirk position_fixSND_PCI_QUIRK (0x1462 ,0x1002 ,"MSI Wind U115" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1565 ,0x820f ,"Biostar Microtech" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1565 ,0x8218 ,"Biostar Microtech" ,POS_FIX_LPIB ), +SND_PCI_QUIRK (0x8086 ,0x2503 ,"DG965OT AAD63733-203" ,POS_FIX_LPIB ), SND_PCI_QUIRK(0x8086, 0xd601, "eMachines T5212", POS_FIX_LPIB), {} };
PATCH 55/117 ALSA: hda - Add PCI quirk for HP dv6-1110ax.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Kunal Gangakhedkar <[email protected]>
commit e3d2530a6cea80987f77b75d8784a00f3aaf22ff upstream.
Adding this PCI quirk fixes the board config detection.
This also fixes jack sensing by using "hp_detect=1" via properly detected board config.
--- sound/pci/hda/patch_sigmatel.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/patch_sigmatel.c +2 -0
@@ -1725,6 +1725,8 @@ static struct snd_pci_quirk stac92hd71bx "HP HDX", STAC_HP_HDX), /* HDX16 */SND_PCI_QUIRK_MASK (PCI_VENDOR_ID_HP ,0xfff0 ,0x3620 ,"HP dv6" ,STAC_HP_DV5 ), +SND_PCI_QUIRK (PCI_VENDOR_ID_HP ,0x3061 , +"HP dv6" ,STAC_HP_DV5 ),/* HP dv6-1110ax */ SND_PCI_QUIRK_MASK (PCI_VENDOR_ID_HP ,0xfff0 ,0x7010 ,"HP" ,STAC_HP_DV5 ), SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
PATCH 56/117 ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio XPS 1645
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit aac78daf8f37256283f56820ae858add7139c56c upstream.
The OR has verified that the dell-m6 model quirk is necessary for audio to be audible by default on the Dell Studio XPS 1645.
This change is necessary for 2.6.32.11 and 2.6.33.2 alike.
--- sound/pci/hda/patch_sigmatel.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/patch_sigmatel.c +2 -0
@@ -1602,6 +1602,8 @@ static struct snd_pci_quirk stac92hd73xx "Dell Studio 1555", STAC_DELL_M6_DMIC), SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02bd, "Dell Studio 1557", STAC_DELL_M6_DMIC), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe, + "Dell Studio XPS 1645", STAC_DELL_M6_BOTH), {}/* terminator */ };
PATCH 57/117 ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 5c1bccf645d4ab65e4c7502acb42e8b9afdb5bdc upstream.
The OR has verified that the dell-m6 model quirk is necessary for audio to be audible by default on the Dell Studio XPS 1645.
This change is necessary for 2.6.32.11 and 2.6.33.2 alike.
--- sound/pci/hda/patch_sigmatel.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/patch_sigmatel.c +2 -0
@@ -1604,6 +1604,8 @@ static struct snd_pci_quirk stac92hd73xx "Dell Studio 1557", STAC_DELL_M6_DMIC), SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe, "Dell Studio XPS 1645", STAC_DELL_M6_BOTH), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0413, + "Dell Studio 1558", STAC_DELL_M6_BOTH), {}/* terminator */ };
Re: [057/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558
Hi Greg et al.
Quoted 4 lines · Greg KH
2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
Quoted 8 lines
From: Daniel T Chen<[email protected]>
commit
5c1bccf645d4ab65e4c7502acb42e8b9afdb5bdcupstream.The OR has verified that the dell-m6 model quirk is necessary for audio to be audible by default on the Dell Studio XPS 1645.
Just that the commit comment doesn't match the code here.
Regards,
Nigel
Quoted 31 lines
This change is necessary for 2.6.32.11 and 2.6.33.2 alike.
Reported-by Andy Ross<[email protected]>Tested-by Andy Ross<[email protected]>Signed-off-by Daniel T Chen<[email protected]>Signed-off-by Takashi Iwai<[email protected]>Signed-off-by Greg Kroah-Hartman<[email protected]>--- sound/pci/hda/patch_sigmatel.c | 2 ++ 1 file changed, 2 insertions(+)sound/pci/hda/patch_sigmatel.c +2
-1@@ -1604,6 +1604,8 @@ static struct snd_pci_quirk stac92hd73xx "Dell Studio 1557", STAC_DELL_M6_DMIC), SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe, "Dell Studio XPS 1645", STAC_DELL_M6_BOTH), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0413, + "Dell Studio 1558", STAC_DELL_M6_BOTH), {}/* terminator */ }; --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [057/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558
Quoted 2 lines · Greg KH
Quoted 2 lines
2.6.33-stable review patch. If anyone has any objections, please let us know.
...
Quoted 6 lines
Quoted 6 lines
commit
5c1bccf645d4ab65e4c7502acb42e8b9afdb5bdcupstream.The OR has verified that the dell-m6 model quirk is necessary for audio to be audible by default on the Dell Studio XPS 1645.
...
Quoted 13 lines
Quoted 13 lines
sound/pci/hda/patch_sigmatel.c | 2 ++ 1 file changed, 2 insertions(+)sound/pci/hda/patch_sigmatel.c +2
-0@@ -1604,6 +1604,8 @@ static struct snd_pci_quirk stac92hd73xx "Dell Studio 1557", STAC_DELL_M6_DMIC), SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe, "Dell Studio XPS 1645", STAC_DELL_M6_BOTH), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0413, + "Dell Studio 1558", STAC_DELL_M6_BOTH), {}/* terminator */ };
Quoted 1 line · Nigel Cunningham
Just that the commit comment doesn't match the code here.
Oops, simply brown paper bag copy-n'-paste error. I'm happy to respin for clarification if necessary.
Best,
-Dan
Re: [057/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558
Quoted 27 lines · Daniel Chen
Quoted 2 lines · Greg KH
Quoted 2 lines
2.6.33-stable review patch. If anyone has any objections, please let us know.
...
Quoted 6 lines
Quoted 6 lines
commit
5c1bccf645d4ab65e4c7502acb42e8b9afdb5bdcupstream.The OR has verified that the dell-m6 model quirk is necessary for audio to be audible by default on the Dell Studio XPS 1645.
...
Quoted 13 lines
sound/pci/hda/patch_sigmatel.c static struct snd_pci_quirk stac92hd73xx · line 1610
Quoted 13 lines
sound/pci/hda/patch_sigmatel.c | 2 ++ 1 file changed, 2 insertions(+)sound/pci/hda/patch_sigmatel.c +2
-0@@ -1604,6 +1604,8 @@ static struct snd_pci_quirk stac92hd73xx "Dell Studio 1557", STAC_DELL_M6_DMIC), SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe, "Dell Studio XPS 1645", STAC_DELL_M6_BOTH), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0413, + "Dell Studio 1558", STAC_DELL_M6_BOTH), {}/* terminator */ };On Tue, May 11, 2010 at 1:30 AM, Nigel Cunningham <[email protected]> wrote:
Quoted 4 lines
Quoted 1 line
Just that the commit comment doesn't match the code here.
Oops, simply brown paper bag copy-n'-paste error. I'm happy to respin for clarification if necessary.
As this mirrors what is in Linus's tree, I say we just leave it alone, is that ok?
thanks,
greg k-h
Re: [057/117] ALSA: hda: Use STAC_DELL_M6_BOTH quirk for Dell Studio 1558
Quoted 2 lines · Greg KH
As this mirrors what is in Linus's tree, I say we just leave it alone, is that ok?
That, too, is fine. The quirk is correct in the source code.
-Dan
PATCH 58/117 ALSA: hda: Use ALC880_F1734 quirk for Fujitsu Siemens AMILO Xi 1526
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 3353541fe533350a22a03e2fb7dc085b35912575 upstream.
The OR has verified that the existing model quirk, ALC880_UNIWILL, is insufficient for audible playback and capture by default. Instead, the ALC880_F1734 model quirk needs to be used.
This change is necessary for both 2.6.32.11 and 2.6.33.2.
--- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +1 -1
@@ -4033,7 +4033,7 @@ static struct snd_pci_quirk alc880_cfg_tSND_PCI_QUIRK (0x1695 ,0x4012 ,"EPox EP-5LDA" ,ALC880_5ST_DIG ),SND_PCI_QUIRK (0x1734 ,0x107c ,"FSC F1734" ,ALC880_F1734 ),SND_PCI_QUIRK (0x1734 ,0x1094 ,"FSC Amilo M1451G" ,ALC880_FUJITSU ), -SND_PCI_QUIRK (0x1734 ,0x10ac ,"FSC" ,ALC880_UNIWILL ), +SND_PCI_QUIRK (0x1734 ,0x10ac ,"FSC AMILO Xi 1526" ,ALC880_F1734 ),SND_PCI_QUIRK (0x1734 ,0x10b0 ,"Fujitsu" ,ALC880_FUJITSU ),SND_PCI_QUIRK (0x1854 ,0x0018 ,"LG LW20" ,ALC880_LG_LW ), SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG),
PATCH 59/117 ALSA: snd-meastro3: Add amp_gpio quirk for Compaq EVO N600C
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hans de Goede <[email protected]>
commit 7efbfd1ae98ef9efe06352e2a1ad83e8c14ceeb1 upstream.
Without this quirk sound stops working after suspend resume. With this quirk, one still needs to manually unmute the master volume control after a suspend / / resume cycle. That is fixed in another patch in this set.
Note that this patch was submitted to the alsa bug tracker a long time ago:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4319
--- sound/pci/maestro3.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/maestro3.c +1 -0
@@ -884,6 +884,7 @@ static struct pci_device_id snd_m3_ids[]MODULE_DEVICE_TABLE (pci, snd_m3_ids);static struct snd_pci_quirk m3_amp_quirk_list[]__devinitdata = { +SND_PCI_QUIRK (0x0E11 ,0x0094 ,"Compaq Evo N600c" ,0x0c ),SND_PCI_QUIRK (0x10f7 ,0x833e ,"Panasonic CF-28" ,0x0d ),SND_PCI_QUIRK (0x10f7 ,0x833d ,"Panasonic CF-72" ,0x0d ),SND_PCI_QUIRK (0x1033 ,0x80f1 ,"NEC LM800J/7" ,0x03 ),
PATCH 60/117 ALSA: snd-meastro3: Ignore spurious HV interrupts during suspend / resume
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hans de Goede <[email protected]>
commit 715aa675338ce6e1a3b4f77cf87ea611f93058a8 upstream.
Ignore spurious HV interrupts during suspend / resume, this avoids mistaking them for a mute button press. This is not very pretty but it seems the only way to fix the master volume control gets muted after suspend issue I'm seeing. Note that the es1968 driver is doing exactly the same.
--- sound/pci/maestro3.c | 8 ++++++++ 1 file changed, 8 insertions(+)
sound/pci/maestro3.c +8 -0
@@ -849,6 +849,7 @@ struct snd_m3 {struct snd_kcontrol *master_switch;struct snd_kcontrol *master_volume;struct tasklet_struct hwvol_tq; +unsigned int in_suspend;#ifdef CONFIG_PM u16 *suspend_mem;
@@ -1614,6 +1615,11 @@ static void snd_m3_update_hw_volume(unsioutb (0x88 , chip->iobase +SHADOW_MIX_REG_MASTER );outb (0x88 , chip->iobase +HW_VOL_COUNTER_MASTER ); +/* Ignore spurious HV interrupts during suspend / resume, this avoids +mistaking them for a mute button press. */ +if (chip->in_suspend) +return ; +if (!chip->master_switch || !chip->master_volume)return ;
@@ -2425,6 +2431,7 @@ static int m3_suspend(struct pci_dev *pcif (chip->suspend_mem ==NULL )return 0 ; + chip->in_suspend =1 ;snd_power_change_state (card, SNDRV_CTL_POWER_D3hot);snd_pcm_suspend_all (chip->pcm);snd_ac97_suspend (chip->ac97);
@@ -2498,6 +2505,7 @@ static int m3_resume(struct pci_dev *pcisnd_m3_hv_init (chip);snd_power_change_state (card,SNDRV_CTL_POWER_D0 ); + chip->in_suspend =0 ; return 0; }#endif /* CONFIG_PM */
PATCH 61/117 ALSA: hda: Fix 0 dB for Packard Bell models using Conexant CX20549 (Venice)
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 8f0f5ff6777104084b4b2e1ae079541c2a6ed6d9 upstream.
The OR's hardware distorts at PCM 100% because it does not correspond to 0 dB. Fix this in patch_cxt5045() for all Packard Bell models.
--- sound/pci/hda/patch_conexant.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
sound/pci/hda/patch_conexant.c +3 -2
@@ -1174,9 +1174,10 @@ static int patch_cxt5045(struct hda_codeswitch (codec->subsystem_id >>16 ) {case 0x103c : +case 0x1631 :case 0x1734 : -/* HP & Fujitsu-Siemens laptops have really bad sound over 0dB -* on NID 0x17. Fix max PCM level to 0 dB +/* HP, Packard Bell, & Fujitsu-Siemens laptops have really bad +* sound over 0dB on NID 0x17. Fix max PCM level to 0 dB * (originally it has 0x2b steps with 0dB offset 0x14) */ snd_hda_override_amp_caps(codec, 0x17, HDA_INPUT,
PATCH 62/117 ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite Pro T130-15F
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 4442dd4613fe3795b4c8a5f42fc96b7ffb90d01a upstream.
The OR verified that using the olpc-xo-1_5 model quirk allows the headphones to be audible when inserted into the jack. Capture was also verified to work correctly.
--- sound/pci/hda/patch_conexant.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_conexant.c +1 -0
@@ -2472,6 +2472,7 @@ static struct snd_pci_quirk cxt5066_cfg_ CXT5066_DELL_LAPTOP),SND_PCI_QUIRK (0x152d ,0x0833 ,"OLPC XO-1.5" ,CXT5066_OLPC_XO_1_5 ),SND_PCI_QUIRK (0x1028 ,0x0402 ,"Dell Vostro" ,CXT5066_DELL_VOSTO ), + SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), {} };
PATCH 63/117 ALSA: hda: Use olpc-xo-1_5 quirk for Toshiba Satellite P500-PSPGSC-01800T
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit c53666813813a0ea3d0391e1911eefc05a5e6b4f upstream.
The OR verified that using the olpc-xo-1_5 model quirk allows the headphones to be audible when inserted into the jack. Capture was also verified to work correctly.
--- sound/pci/hda/patch_conexant.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_conexant.c +1 -0
@@ -2472,6 +2472,7 @@ static struct snd_pci_quirk cxt5066_cfg_ CXT5066_DELL_LAPTOP),SND_PCI_QUIRK (0x152d ,0x0833 ,"OLPC XO-1.5" ,CXT5066_OLPC_XO_1_5 ),SND_PCI_QUIRK (0x1028 ,0x0402 ,"Dell Vostro" ,CXT5066_DELL_VOSTO ), +SND_PCI_QUIRK (0x1179 ,0xff50 ,"Toshiba Satellite P500-PSPGSC-01800T" ,CXT5066_OLPC_XO_1_5 ), SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), {} };
PATCH 64/117 PCI: Ensure we re-enable devices on resume
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Matthew Garrett <[email protected]>
commit cc2893b6af5265baa1d68b17b136cffca9e40cfa upstream.
If the firmware puts a device back into D0 state at resume time, we'll update its state in resume_noirq and thus skip the platform resume code. Calling that code twice should be safe and we ought to avoid getting to that point anyway, so remove the check and also allow the platform pci code to be called for D0.
Fixes USB not being powered after resume on recent Lenovo machines.
--- drivers/pci/pci.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/pci/pci.c +1 -5
@@ -624,7 +624,7 @@ static void __pci_start_power_transition*/ int __pci_complete_power_transition (struct pci_dev *dev,pci_power_t state) { -return state >PCI_D0 ? +return state >=PCI_D0 ?pci_platform_power_transition (dev, state) : -EINVAL ; }EXPORT_SYMBOL_GPL (__pci_complete_power_transition);
@@ -661,10 +661,6 @@ int pci_set_power_state(struct pci_dev **/ return 0 ; -/* Check if we're already there */ -if (dev->current_state == state) -return 0 ; -__pci_start_power_transition (dev, state);/* This device is quirked not to be put into D3, so
PATCH 65/117 libata: Fix accesses at LBA28 boundary (old bug, but nasty) (v2)
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Lord <[email protected]>
commit 45c4d015a92f72ec47acd0c7557abdc0c8a6499d upstream.
Most drives from Seagate, Hitachi, and possibly other brands, do not allow LBA28 access to sector number 0x0fffffff (2^28 - 1). So instead use LBA48 for such accesses.
This bug could bite a lot of systems, especially when the user has taken care to align partitions to 4KB boundaries. On misaligned systems, it is less likely to be encountered, since a 4KB read would end at 0x10000000 rather than at 0x0fffffff.
--- include/linux/ata.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/ata.h +2 -2
@@ -1024,8 +1024,8 @@ static inline int ata_ok(u8 status)static inline int lba_28_ok (u64 block,u32 n_block) { -/* check the ending block number */ -return ((block + n_block) < ((u64 )1 <<28 )) && (n_block <=256 ); +/* check the ending block number: must be LESS THAN 0x0fffffff */ +return ((block + n_block) < ((1 <<28 ) -1 )) && (n_block <=256 ); }static inline int lba_48_ok (u64 block,u32 n_block)
PATCH 66/117 ext4: correctly calculate number of blocks for fiemap
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Leonard Michlmayr <[email protected]>
commit aca92ff6f57c000d1b4523e383c8bd6b8269b8b1 upstream.
ext4_fiemap() rounds the length of the requested range down to blocksize, which is is not the true number of blocks that cover the requested region. This problem is especially impressive if the user requests only the first byte of a file: not a single extent will be reported.
We fix this by calculating the last block of the region and then subtract to find the number of blocks in the extents.
--- fs/ext4/extents.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
fs/ext4/extents.c +7 -2
@@ -3767,7 +3767,6 @@ int ext4_fiemap(struct inode *inode, str __u64 start, __u64 len) {ext4_lblk_t start_blk; -ext4_lblk_t len_blks;int error =0 ;/* fallback to generic here if not in extents fmt */
@@ -3781,8 +3780,14 @@ int ext4_fiemap(struct inode *inode, strif (fieinfo->fi_flags &FIEMAP_FLAG_XATTR ) { error =ext4_xattr_fiemap (inode, fieinfo); }else { +ext4_lblk_t len_blks; +__u64 last_blk; + start_blk = start >> inode->i_sb->s_blocksize_bits; - len_blks = len >> inode->i_sb->s_blocksize_bits; + last_blk = (start + len -1 ) >> inode->i_sb->s_blocksize_bits; +if (last_blk >=EXT_MAX_BLOCK ) + last_blk =EXT_MAX_BLOCK -1 ; + len_blks = ((ext4_lblk_t ) last_blk) - start_blk +1 ;/* * Walk the extent tree gathering extent information.
PATCH 67/117 initramfs: handle unrecognised decompressor when unpacking
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Phillip Lougher <[email protected]>
commit df37bd156dcb4f5441beaf5bde444adac974e9a0 upstream.
The unpack routine fails to handle the decompress_method() returning unrecognised decompressor (compress_name == NULL). This results in the routine looping eventually oopsing on an out of bounds memory access.
Note this bug is usually hidden, only triggering on trailing junk after one or more correct compressed blocks. The case of the compressed archive being complete junk is (by accident?) caught by the if (state != Reset) check because state is initialised to Start, but not updated due to the decompressor not having been called. Obviously if the junk is trailing a correctly decompressed buffer, state == Reset from the previous call to the decompressor.
--- init/initramfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
init/initramfs.c +2 -1
@@ -457,7 +457,8 @@ static char * __init unpack_to_rootfs(ch compress_name); message = msg_buf; } - } + }else +error ("junk in compressed archive" );if (state != Reset)error ("junk in compressed archive" ); this_header = saved_offset + my_inptr;
PATCH 68/117 CRED: Fix a race in creds_are_invalid() in credentials debugging
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Howells <[email protected]>
commit e134d200d57d43b171dcb0b55c178a1a0c7db14a upstream.
creds_are_invalid() reads both cred->usage and cred->subscribers and then compares them to make sure the number of processes subscribed to a cred struct never exceeds the refcount of that cred struct.
The problem is that this can cause a race with both copy_creds() and exit_creds() as the two counters, whilst they are of atomic_t type, are only atomic with respect to themselves, and not atomic with respect to each other.
This means that if creds_are_invalid() can read the values on one CPU whilst they're being modified on another CPU, and so can observe an evolving state in which the subscribers count now is greater than the usage count a moment before.
Switching the order in which the counts are read cannot help, so the thing to do is to remove that particular check.
I had considered rechecking the values to see if they're in flux if the test fails, but I can't guarantee they won't appear the same, even if they've changed several times in the meantime.
Note that this can only happen if CONFIG_DEBUG_CREDENTIALS is enabled.
The problem is only likely to occur with multithreaded programs, and can be tested by the tst-eintr1 program from glibc's "make check". The symptoms look like:
CRED: Invalid credentials
CRED: At include/linux/cred.h:240
CRED: Specified credentials: ffff88003dda5878 [real][eff]
CRED: ->magic=43736564, put_addr=(null)
CRED: ->usage=766, subscr=766
CRED: ->*uid = { 0,0,0,0 }
CRED: ->*gid = { 0,0,0,0 }
CRED: ->security is ffff88003d72f538
CRED: ->security {359, 359}
------------[ cut here ]------------
kernel BUG at kernel/cred.c:850!
...
RIP: 0010:[<ffffffff81049889>] [<ffffffff81049889>] __invalid_creds+0x4e/0x52
...
Call Trace:
[<ffffffff8104a37b>] copy_creds+0x6b/0x23fNote the ->usage=766 and subscr=766. The values appear the same because they've been re-read since the check was made.
--- kernel/cred.c | 2 -- 1 file changed, 2 deletions(-)
kernel/cred.c +0 -2
@@ -786,8 +786,6 @@ bool creds_are_invalid(const struct cred {if (cred->magic !=CRED_MAGIC )return true; -if (atomic_read (&cred->usage) <atomic_read (&cred->subscribers)) -return true;#ifdef CONFIG_SECURITY_SELINUX if (selinux_is_enabled ()) {if ((unsigned long ) cred->security <PAGE_SIZE )
PATCH 69/117 jfs: fix diAllocExt error in resizing filesystem
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bill Pemberton <[email protected]>
commit 2b0b39517d1af5294128dbc2fd7ed39c8effa540 upstream.
Resizing the filesystem would result in an diAllocExt error in some instances because changes in bmp->db_agsize would not get noticed if goto extendBmap was called.
--- fs/jfs/resize.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/jfs/resize.c +5 -1
@@ -81,6 +81,7 @@ int jfs_extendfs(struct super_block *sb,struct inode *iplist[1 ];struct jfs_superblock *j_sb, *j_sb2;uint old_agsize; +int agsizechanged =0 ;struct buffer_head *bh, *bh2;/* If the volume hasn't grown, get out now */
@@ -333,6 +334,9 @@ int jfs_extendfs(struct super_block *sb,*/ if ((rc =dbExtendFS (ipbmap, XAddress, nblocks))) goto error_out; + + agsizechanged |= (bmp->db_agsize != old_agsize); +/* * the map now has extended to cover additional nblocks: * dn_mapsize = oldMapsize + nblocks;
@@ -432,7 +436,7 @@ int jfs_extendfs(struct super_block *sb,* will correctly identify the new ag); */ /* if new AG size the same as old AG size, done! */ -if (bmp->db_agsize != old_agsize) { +if (agsizechanged) {if ((rc =diExtendFS (ipimap, ipbmap))) goto error_out;
PATCH 70/117 drivers/net/wireless/p54/txrx.c Fix off by one error
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Darren Jenkins <[email protected]>
commit 088ea189c4c75cdf211146faa4b341a0f7476be6 upstream.
fix off by one error in the queue size check of p54_tx_qos_accounting_alloc()
Coverity CID: 13314
--- drivers/net/wireless/p54/txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/p54/txrx.c +1 -1
@@ -186,7 +186,7 @@ static int p54_tx_qos_accounting_alloc(sstruct ieee80211_tx_queue_stats *queue;unsigned long flags; -if (WARN_ON (p54_queue >P54_QUEUE_NUM )) +if (WARN_ON (p54_queue >=P54_QUEUE_NUM ))return -EINVAL ; queue = &priv->tx_stats[p54_queue];
PATCH 71/117 kgdb: dont needlessly skip PAGE_USER test for Fsl booke
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Wufei <[email protected]>
commit 56151e753468e34aeb322af4b0309ab727c97d2e upstream.
The bypassing of this test is a leftover from 2.4 vintage kernels, and is no longer appropriate, or even used by KGDB. Currently KGDB uses probe_kernel_write() for all access to memory via the KGDB core, so it can simply be deleted.
This fixes CVE-2010-1446.
--- arch/powerpc/mm/fsl_booke_mmu.c | 5 ----- 1 file changed, 5 deletions(-)
arch/powerpc/mm/fsl_booke_mmu.c +0 -5
@@ -155,15 +155,10 @@ static void settlbcam(int index, unsigneif (cur_cpu_spec->cpu_features &MMU_FTR_BIG_PHYS )TLBCAM [index].MAS7 = (u64 )phys >>32 ; -#ifndef CONFIG_KGDB /* want user access for breakpoints */ if (flags & _PAGE_USER) {TLBCAM [index].MAS3 |=MAS3_UX |MAS3_UR ;TLBCAM [index].MAS3 |= ((flags & _PAGE_RW) ?MAS3_UW :0 ); } -#else -TLBCAM [index].MAS3 |=MAS3_UX |MAS3_UR ; -TLBCAM [index].MAS3 |= ((flags & _PAGE_RW) ?MAS3_UW :0 ); -#endif tlbcam_addrs[index].start = virt; tlbcam_addrs[index].limit = virt + size -1 ;
PATCH 72/117 r8169: use correct barrier between cacheable and non-cacheable memory
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Dillow <[email protected]>
commit 4c020a961a812ffae9846b917304cea504c3a733 upstream.
r8169 needs certain writes to be visible to other CPUs or the NIC before touching the hardware, but was using smp_wmb() which is only required to order cacheable memory access. Switch to wmb() which is required to order both cacheable and non-cacheable memory.
Noticed by Catalin Marinas and Paul Mackerras.
--- drivers/net/r8169.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/r8169.c +2 -2
@@ -4316,7 +4316,7 @@ static netdev_tx_t rtl8169_start_xmit(st tp->cur_tx += frags +1 ; -smp_wmb (); +wmb ();RTL_W8 (TxPoll,NPQ );/* set polling bit */
@@ -4675,7 +4675,7 @@ static int rtl8169_poll(struct napi_stru* until it does. */ tp->intr_mask =0xffff ; -smp_wmb (); +wmb ();RTL_W16 (IntrMask, tp->intr_event); }
PATCH 73/117 r8169: fix broken register writes
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Francois Romieu <[email protected]>
commit 78f1cd02457252e1ffbc6caa44a17424a45286b8 upstream.
This is quite similar to b39fe41f481d20c201012e4483e76c203802dda7 though said registers are not even documented as 64-bit registers
- as opposed to the initial TxDescStartAddress ones - but as single bytes which must be combined into 32 bits at the MMIO read/write level before being merged into a 64 bit logical entity.
Credits go to Ben Hutchings <[email protected]> for the MAR registers (aka "multicast is broken for ages on ARM) and to Timo Teräs <[email protected]> for the MAC registers.
--- drivers/net/r8169.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/r8169.c +2 -2
@@ -2832,8 +2832,8 @@ static void rtl_rar_set(struct rtl8169_pspin_lock_irq (&tp->lock);RTL_W8 (Cfg9346, Cfg9346_Unlock); -RTL_W32 (MAC0 , low);RTL_W32 (MAC4 , high); +RTL_W32 (MAC0 , low);RTL_W8 (Cfg9346, Cfg9346_Lock);spin_unlock_irq (&tp->lock);
@@ -4813,8 +4813,8 @@ static void rtl_set_rx_mode(struct net_d mc_filter[1 ] =swab32 (data); } -RTL_W32 (MAR0 +0 , mc_filter[0 ]);RTL_W32 (MAR0 +4 , mc_filter[1 ]); +RTL_W32 (MAR0 +0 , mc_filter[0 ]);RTL_W32 (RxConfig, tmp);
PATCH 74/117 r8169: more broken register writes workaround
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <[email protected]>
commit 908ba2bfd22253f26fa910cd855e4ccffb1467d0 upstream.
78f1cd02457252e1ffbc6caa44a17424a45286b8 ("fix broken register writes") does not work for Al Viro's r8169 (XID 18000000).
--- drivers/net/r8169.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/r8169.c +5 -0
@@ -2832,8 +2832,13 @@ static void rtl_rar_set(struct rtl8169_pspin_lock_irq (&tp->lock);RTL_W8 (Cfg9346, Cfg9346_Unlock); +RTL_W32 (MAC4 , high); +RTL_R32 (MAC4 ); +RTL_W32 (MAC0 , low); +RTL_R32 (MAC0 ); +RTL_W8 (Cfg9346, Cfg9346_Lock);spin_unlock_irq (&tp->lock);
PATCH 75/117 ath9k: reorder ieee80211_free_hw behind ath9k_uninit_hw to avoid oops
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: John W. Linville <[email protected]>
This code only exists in 2.6.33 -- 2.6.32 and 2.6.34 are not affected.
---
drivers/net/wireless/ath/ath9k/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/main.c +1 -1
@@ -1358,9 +1358,9 @@ void ath_cleanup(struct ath_softc *sc)free_irq (sc->irq, sc);ath_bus_cleanup (common);kfree (sc->sec_wiphy); -ieee80211_free_hw (sc->hw);ath9k_uninit_hw (sc); +ieee80211_free_hw (sc->hw); } static int ath9k_reg_notifier(struct wiphy *wiphy,
PATCH 76/117 skip sense logging for some ATA PASS-THROUGH cdbs
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Douglas Gilbert <[email protected]>
commit e7efe5932b1d3916c79326a4221693ea90a900e2 upstream.
Further to the lsml thread titled:
"does scsi_io_completion need to dump sense data for ata pass through (ck_cond =
1) ?"
This is a patch to skip logging when the sense data is associated with a SENSE_KEY of "RECOVERED_ERROR" and the additional sense code is "ATA PASS-THROUGH INFORMATION AVAILABLE". This only occurs with the SAT ATA PASS-THROUGH commands when CK_COND=1 (in the cdb). It indicates that the sense data contains ATA registers.
Smartmontools uses such commands on ATA disks connected via SAT. Periodic checks such as those done by smartd cause nuisance entries into logs that are:
- neither errors nor warnings
- pointless unless the cdb that caused them are also logged
--- drivers/scsi/scsi_lib.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/scsi/scsi_lib.c +8 -2
@@ -773,8 +773,14 @@ void scsi_io_completion(struct scsi_cmnd* we already took a copy of the original into rq->errors which * is what gets returned to the user */ -if (sense_valid && sshdr.sense_key ==RECOVERED_ERROR ) { -if (!(req->cmd_flags &REQ_QUIET )) +if (sense_valid && (sshdr.sense_key ==RECOVERED_ERROR )) { +/* if ATA PASS-THROUGH INFORMATION AVAILABLE skip +* print since caller wants ATA registers. Only occurs on +* SCSI ATA PASS_THROUGH commands when CK_COND=1 +*/ +if ((sshdr.asc ==0x0 ) && (sshdr.ascq ==0x1d )) + ; +else if (!(req->cmd_flags &REQ_QUIET ))scsi_print_sense ("" , cmd); result =0 ;/* BLOCK_PC may have set error */
PATCH 77/117 tg3: Fix INTx fallback when MSI fails
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andre Detsch <[email protected]>
commit dc8bf1b1a6edfc92465526de19772061302f0929 upstream.
tg3: Fix INTx fallback when MSI fails
MSI setup changes the value of irq_vec in struct tg3 *tp. This attribute must be taken into account and restored before we try to do a new request_irq for INTx fallback.
In powerpc, the original code was leading to an EINVAL return within request_irq, because the driver was trying to use the disabled MSI virtual irq number instead of tp->pdev->irq.
--- drivers/net/tg3.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/tg3.c +1 -0
@@ -8572,6 +8572,7 @@ static int tg3_test_msi(struct tg3 *tp)pci_disable_msi (tp->pdev); tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI ; + tp->napi[0 ].irq_vec = tp->pdev->irq; err =tg3_request_irq (tp,0 );if (err)
PATCH 78/117 xfs: add a shrinker to background inode reclaim
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dave Chinner <[email protected]>
commit 9bf729c0af67897ea8498ce17c29b0683f7f2028 upstream
On low memory boxes or those with highmem, kernel can OOM before the background reclaims inodes via xfssyncd. Add a shrinker to run inode reclaim so that it inode reclaim is expedited when memory is low.
This is more complex than it needs to be because the VM folk don't want a context added to the shrinker infrastructure. Hence we need to add a global list of XFS mount structures so the shrinker can traverse them.
--- fs/xfs/linux-2.6/xfs_super.c | 5 + fs/xfs/linux-2.6/xfs_sync.c | 107 ++++++++++++++++++++++++++++++++++++++--- fs/xfs/linux-2.6/xfs_sync.h | 7 ++ fs/xfs/quota/xfs_qm_syscalls.c | 3 - fs/xfs/xfs_ag.h | 1 fs/xfs/xfs_mount.h | 1 6 files changed, 115 insertions(+), 9 deletions(-)
fs/xfs/linux-2.6/xfs_super.c +5 -0
@@ -1160,6 +1160,7 @@ xfs_fs_put_super(xfs_unmountfs (mp);xfs_freesb (mp); +xfs_inode_shrinker_unregister (mp);xfs_icsb_destroy_counters (mp);xfs_close_devices (mp);xfs_dmops_put (mp);
@@ -1523,6 +1524,8 @@ xfs_fs_fill_super(if (error) goto fail_vnrele; +xfs_inode_shrinker_register (mp); +kfree (mtpt);return 0 ;
@@ -1767,6 +1770,7 @@ init_xfs_fs(void) goto out_cleanup_procfs;vfs_initquota (); +xfs_inode_shrinker_init (); error =register_filesystem (&xfs_fs_type);if (error)
@@ -1794,6 +1798,7 @@ exit_xfs_fs(void) {vfs_exitquota ();unregister_filesystem (&xfs_fs_type); +xfs_inode_shrinker_destroy ();xfs_sysctl_unregister ();xfs_cleanup_procfs ();xfs_buf_terminate ();
fs/xfs/linux-2.6/xfs_sync.c +100 -7
168 lines not on this page · raw message
fs/xfs/linux-2.6/xfs_sync.h +6 -1
@@ -54,6 +54,11 @@ void __xfs_inode_clear_reclaim_tag(strucint xfs_sync_inode_valid (struct xfs_inode *ip,struct xfs_perag *pag);int xfs_inode_ag_iterator (struct xfs_mount *mp,int (*execute)(struct xfs_inode *ip,struct xfs_perag *pag,int flags), -int flags,int tag,int write_lock); +int flags,int tag,int write_lock,int *nr_to_scan); + +void xfs_inode_shrinker_init (void ); +void xfs_inode_shrinker_destroy (void ); +void xfs_inode_shrinker_register (struct xfs_mount *mp); +void xfs_inode_shrinker_unregister (struct xfs_mount *mp);#endif
fs/xfs/quota/xfs_qm_syscalls.c +2 -1
@@ -891,7 +891,8 @@ xfs_qm_dqrele_all_inodes( uint flags) {ASSERT (mp->m_quotainfo); -xfs_inode_ag_iterator (mp, xfs_dqrele_inode, flags,XFS_ICI_NO_TAG ,0 ); +xfs_inode_ag_iterator (mp, xfs_dqrele_inode, flags, +XFS_ICI_NO_TAG ,0 ,NULL ); }/*------------------------------------------------------------------------*/
fs/xfs/xfs_ag.h +1 -0
@@ -229,6 +229,7 @@ typedef struct xfs_peragint pag_ici_init;/* incore inode cache initialised */ rwlock_t pag_ici_lock;/* incore inode lock */ struct radix_tree_root pag_ici_root;/* incore inode cache root */ +int pag_ici_reclaimable;/* reclaimable inodes */ #endif } xfs_perag_t;
fs/xfs/xfs_mount.h +1 -0
@@ -257,6 +257,7 @@ typedef struct xfs_mount {wait_queue_head_t m_wait_single_sync_task;__int64_t m_update_flags;/* sb flags we need to update on the next remount,rw */ +struct list_head m_mplist;/* inode shrinker mount list */ } xfs_mount_t;/*
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [078/117] xfs: add a shrinker to background inode reclaim
Quoted 1 line · Greg KH
2.6.33-stable review patch. If anyone has any objections, please let us know.
Quoted 10 lines
------------------
From: Dave Chinner <[email protected]>
commit
9bf729c0af67897ea8498ce17c29b0683f7f2028upstreamOn low memory boxes or those with highmem, kernel can OOM before the background reclaims inodes via xfssyncd. Add a shrinker to run inode reclaim so that it inode reclaim is expedited when memory is low.
...
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 79/117 powerpc: Reset kernel stack on cpu online from cede state
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vaidyanathan Srinivasan <[email protected]>
commit 8dbce53cc249a76e9450708d291fce5a7e29c6a1 upstream.
Cpu hotplug (offline) without dlpar operation will place cpu in cede state and the extended_cede_processor() function will return when resumed.
Kernel stack pointer needs to be reset before start_secondary() is called to continue the online operation.
Added new function start_secondary_resume() to do the above steps.
--- arch/powerpc/kernel/head_64.S | 11 +++++++++++ arch/powerpc/platforms/pseries/hotplug-cpu.c | 9 ++++----- arch/powerpc/platforms/pseries/offline_states.h | 1 + 3 files changed, 16 insertions(+), 5 deletions(-)
arch/powerpc/kernel/head_64.S +11 -0
@@ -615,6 +615,17 @@ _GLOBAL(start_secondary_prolog) std r3,0(r1) /* Zero the stack frame pointer */ bl .start_secondary b . +/* + * Reset stack pointer and call start_secondary + * to continue with online operation when woken up + * from cede in cpu offline. + */ +_GLOBAL(start_secondary_resume) + ld r1,PACAKSAVE(r13) /* Reload kernel stack pointer */ + li r3,0 + std r3,0(r1) /* Zero the stack frame pointer */ + bl .start_secondary + b . #endif /*
arch/powerpc/platforms/pseries/hotplug-cpu.c +4 -5
@@ -146,12 +146,11 @@ static void pseries_mach_cpu_die(void)unregister_slb_shadow (hwcpu,__pa (get_slb_shadow ()));/* -* NOTE: Calling start_secondary() here for now to -* start new context. -* However, need to do it cleanly by resetting the -* stack pointer. +* Call to start_secondary_resume() will not return. +* Kernel stack will be reset and start_secondary() +* will be called to continue the online operation. */ -start_secondary (); +start_secondary_resume (); }else if (get_preferred_offline_state (cpu) ==CPU_STATE_OFFLINE ) {
arch/powerpc/platforms/pseries/offline_states.h +1 -0
@@ -35,4 +35,5 @@ static inline void set_default_offline_sextern enum cpu_state_vals get_preferred_offline_state (int cpu);extern int start_secondary (void ); +extern void start_secondary_resume (void );#endif
PATCH 80/117 powerpc: Move checks in pseries_mach_cpu_die()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vaidyanathan Srinivasan <[email protected]>
commit 0212f2602a38e740d5a96aba4cebfc2ebc993ecf upstream.
Rearrange condition checks for better code readability and
prevention of possible race conditions when preferred_offline_state can potentially change during the execution of pseries_mach_cpu_die(). The patch will make pseries_mach_cpu_die() put cpu in one of the consistent states and not hit the run over BUG()
--- arch/powerpc/platforms/pseries/hotplug-cpu.c | 30 +++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-)
arch/powerpc/platforms/pseries/hotplug-cpu.c +15 -15
@@ -140,25 +140,25 @@ static void pseries_mach_cpu_die(void)if (!get_lppaca ()->shared_proc)get_lppaca ()->donate_dedicated_cpu =0 ;get_lppaca ()->idle =0 ; - } -if (get_preferred_offline_state (cpu) ==CPU_STATE_ONLINE ) { -unregister_slb_shadow (hwcpu,__pa (get_slb_shadow ())); +if (get_preferred_offline_state (cpu) ==CPU_STATE_ONLINE ) { +unregister_slb_shadow (hwcpu,__pa (get_slb_shadow ())); -/* -* Call to start_secondary_resume() will not return. -* Kernel stack will be reset and start_secondary() -* will be called to continue the online operation. -*/ -start_secondary_resume (); +/* +* Call to start_secondary_resume() will not return. +* Kernel stack will be reset and start_secondary() +* will be called to continue the online operation. +*/ +start_secondary_resume (); + } + } - }else if (get_preferred_offline_state (cpu) ==CPU_STATE_OFFLINE ) { +/* Requested state is CPU_STATE_OFFLINE at this point */ +WARN_ON (get_preferred_offline_state (cpu) !=CPU_STATE_OFFLINE ); -set_cpu_current_state (cpu,CPU_STATE_OFFLINE ); -unregister_slb_shadow (hard_smp_processor_id (), -__pa (get_slb_shadow ())); -rtas_stop_self (); - } +set_cpu_current_state (cpu,CPU_STATE_OFFLINE ); +unregister_slb_shadow (hwcpu,__pa (get_slb_shadow ())); +rtas_stop_self ();/* Should never get here... */ BUG ();
PATCH 81/117 powerpc: Reduce printk from pseries_mach_cpu_die()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vaidyanathan Srinivasan <[email protected]>
commit a8e6da093ea8642b1320fb5d64134366f2a8d0ac upstream.
Remove debug printks in pseries_mach_cpu_die(). These are noisy at runtime. Traceevents can be added to instrument this section of code.
The following KERN_INFO printks are removed:
cpu 62 (hwid 62) returned from cede.
Decrementer value = b2802fff Timebase value = 2fa8f95035f4a cpu 62 (hwid 62) got prodded to go online
cpu 58 (hwid 58) ceding for offline with hint 2
--- arch/powerpc/platforms/pseries/hotplug-cpu.c | 11 ----------- 1 file changed, 11 deletions(-)
arch/powerpc/platforms/pseries/hotplug-cpu.c +0 -11
@@ -122,21 +122,10 @@ static void pseries_mach_cpu_die(void)if (!get_lppaca ()->shared_proc)get_lppaca ()->donate_dedicated_cpu =1 ; -printk (KERN_INFO -"cpu %u (hwid %u) ceding for offline with hint %d\n" , - cpu, hwcpu, cede_latency_hint);while (get_preferred_offline_state (cpu) ==CPU_STATE_INACTIVE ) {extended_cede_processor (cede_latency_hint); -printk (KERN_INFO "cpu %u (hwid %u) returned from cede.\n" , - cpu, hwcpu); -printk (KERN_INFO -"Decrementer value = %x Timebase value = %llx\n" , -get_dec (),get_tb ()); } -printk (KERN_INFO "cpu %u (hwid %u) got prodded to go online\n" , - cpu, hwcpu); -if (!get_lppaca ()->shared_proc)get_lppaca ()->donate_dedicated_cpu =0 ;get_lppaca ()->idle =0 ;
PATCH 82/117 bnx2: Fix lost MSI-X problem on 5709 NICs.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Michael Chan <[email protected]>
commit c441b8d2cb2194b05550a558d6d95d8944e56a84 upstream.
It has been reported that under certain heavy traffic conditions in MSI-X mode, the driver can lose an MSI-X vector causing all packets in the associated rx/tx ring pair to be dropped. The problem is caused by the chip dropping the write to unmask the MSI-X vector by the kernel (when migrating the IRQ for example).
This can be prevented by increasing the GRC timeout value for these register read and write operations.
Thanks to Dell for helping us debug this problem.
--- drivers/net/bnx2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/bnx2.c +5 -1
@@ -4772,8 +4772,12 @@ bnx2_reset_chip(struct bnx2 *bp, u32 res rc =bnx2_alloc_bad_rbuf (bp); } -if (bp->flags &BNX2_FLAG_USING_MSIX ) +if (bp->flags &BNX2_FLAG_USING_MSIX ) {bnx2_setup_msix_tbl (bp); +/* Prevent MSIX table reads and write from timing out */ +REG_WR (bp,BNX2_MISC_ECO_HW_CTL , +BNX2_MISC_ECO_HW_CTL_LARGE_GRC_TMOUT_EN ); + }return rc; }
PATCH 83/117 cdc_ether: fix autosuspend for mbm devices
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Torgny Johansson <[email protected]>
[ Upstream commit 55964d72d63b15df49a5df11ef91dc8601270815 ]
Autosuspend works until you bring the wwan interface up, then the device does not enter autosuspend anymore.
The following patch fixes the problem by setting the .manage_power field in the mbm_info struct to the same as in the cdc_info struct (cdc_manager_power).
--- drivers/net/usb/cdc_ether.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/usb/cdc_ether.c +1 -0
@@ -433,6 +433,7 @@ static const struct driver_info mbm_info .bind = cdc_bind, .unbind = usbnet_cdc_unbind, .status = cdc_status, + .manage_power = cdc_manage_power, };/*-------------------------------------------------------------------------*/
PATCH 84/117 ieee802154: Fix oops during ieee802154_sock_ioctl
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stefan Schmidt <[email protected]>
[ Upstream commit 93c0c8b4a5a174645550d444bd5c3ff0cccf74cb ]
Trying to run izlisten (from lowpan-tools tests) on a device that does not exists I got the oops below. The problem is that we are using get_dev_by_name without checking if we really get a device back. We don't in this case and writing to dev->type generates this oops.
[Oops code removed by Dmitry Eremin-Solenikov]
If possible this patch should be applied to the current -rc fixes branch.
--- net/ieee802154/af_ieee802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/af_ieee802154.c +3 -0
@@ -147,6 +147,9 @@ static int ieee802154_dev_ioctl(struct sdev_load (sock_net (sk), ifr.ifr_name); dev =dev_get_by_name (sock_net (sk), ifr.ifr_name); +if (!dev) +return -ENODEV ; +if (dev->type ==ARPHRD_IEEE802154 && dev->netdev_ops->ndo_do_ioctl) ret = dev->netdev_ops->ndo_do_ioctl (dev, &ifr, cmd);
PATCH 85/117 ipv6: Fix tcp_v6_send_response transport header setting.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Herbert Xu <[email protected]>
[ Upstream commit 6651ffc8e8bdd5fb4b7d1867c6cfebb4f309512c ]
My recent patch to remove the open-coded checksum sequence in tcp_v6_send_response broke it as we did not set the transport header pointer on the new packet.
Actually, there is code there trying to set the transport header properly, but it sets it for the wrong skb ('skb' instead of 'buff').
This bug was introduced by commit a8fdf2b331b38d61fb5f11f3aec4a4f9fb2dedcb ("ipv6: Fix tcp_v6_send_response(): it didn't set skb transport header")
--- net/ipv6/tcp_ipv6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/tcp_ipv6.c +1 -1
@@ -1006,7 +1006,7 @@ static void tcp_v6_send_response(structskb_reserve (buff,MAX_HEADER +sizeof (struct ipv6hdr ) + tot_len); t1 = (struct tcphdr *)skb_push (buff, tot_len); -skb_reset_transport_header (skb); +skb_reset_transport_header (buff);/* Swap the send and the receive. */ memset (t1,0 ,sizeof (*t1));
PATCH 86/117 sctp: avoid irq lock inversion while call sk->sk_data_ready()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Wei Yongjun <[email protected]>
[ Upstream commit 561b1733a465cf9677356b40c27653dd45f1ac56 ]
sk->sk_data_ready() of sctp socket can be called from both BH and non-BH contexts, but the default sk->sk_data_ready(), sock_def_readable(), can not be used in this case. Therefore, we have to make a new function sctp_data_ready() to grab sk->sk_data_ready() with BH disabling.
=========================================================
[ INFO: possible irq lock inversion dependency detected ] 2.6.33-rc6 #129
---------------------------------------------------------
sctp_darn/1517 just changed the state of lock:
(clock-AF_INET){++.?..}, at: [<c06aab60>] sock_def_readable+0x20/0x80
but this lock took another, SOFTIRQ-unsafe lock in the past:
(slock-AF_INET){+.-...}
and interrupts could create inverse lock ordering between them.
other info that might help us debug this:
1 lock held by sctp_darn/1517:
#0: (sk_lock-AF_INET){+.+.+.}, at: [<cdfe363d>] sctp_sendmsg+0x23d/0xc00 [sctp]
--- include/net/sctp/sctp.h | 1 + net/sctp/endpointola.c | 1 + net/sctp/socket.c | 10 ++++++++++ 3 files changed, 12 insertions(+)
include/net/sctp/sctp.h +1 -0
@@ -128,6 +128,7 @@ extern int sctp_register_pf(struct sctp_int sctp_backlog_rcv (struct sock *sk,struct sk_buff *skb);int sctp_inet_listen (struct socket *sock,int backlog);void sctp_write_space (struct sock *sk); +void sctp_data_ready (struct sock *sk,int len);unsigned int sctp_poll (struct file *file,struct socket *sock,poll_table *wait);void sctp_sock_rfree (struct sk_buff *skb);
net/sctp/endpointola.c +1 -0
@@ -144,6 +144,7 @@ static struct sctp_endpoint *sctp_endpoi/* Use SCTP specific send buffer space queues. */ ep->sndbuf_policy = sctp_sndbuf_policy; + sk->sk_data_ready = sctp_data_ready; sk->sk_write_space = sctp_write_space;sock_set_flag (sk,SOCK_USE_WRITE_QUEUE );
net/sctp/socket.c +10 -0
@@ -6188,6 +6188,16 @@ do_nonblock: goto out; } +void sctp_data_ready (struct sock *sk,int len) +{ +read_lock_bh (&sk->sk_callback_lock); +if (sk_has_sleeper (sk)) +wake_up_interruptible_sync_poll (sk->sk_sleep,POLLIN | +POLLRDNORM |POLLRDBAND ); +sk_wake_async (sk,SOCK_WAKE_WAITD ,POLL_IN ); +read_unlock_bh (&sk->sk_callback_lock); +} +/* If socket sndbuf has changed, wake up all per association waiters. */ void sctp_write_space (struct sock *sk) {
PATCH 87/117 sctp: fix potential reference of a freed pointer
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vlad Yasevich <[email protected]>
[ Upstream commit 0c42749cffbb4a06be86c5e5db6c7ebad548781f ]
When sctp attempts to update an assocition, it removes any addresses that were not in the updated INITs. However, the loop may attempt to refrence a transport with address after removing it.
--- net/sctp/associola.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/sctp/associola.c +4 -2
@@ -1194,8 +1194,10 @@ void sctp_assoc_update(struct sctp_assoc/* Remove any peer addresses not present in the new association. */ list_for_each_safe (pos, temp, &asoc->peer.transport_addr_list) { trans = list_entry(pos, struct sctp_transport, transports); -if (!sctp_assoc_lookup_paddr (new, &trans->ipaddr)) -sctp_assoc_del_peer (asoc, &trans->ipaddr); +if (!sctp_assoc_lookup_paddr (new, &trans->ipaddr)) { +sctp_assoc_rm_peer (asoc, trans); +continue ; + }if (asoc->state >=SCTP_STATE_ESTABLISHED )sctp_transport_reset (trans);
PATCH 88/117 sctp: per_cpu variables should be in bh_disabled section
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vlad Yasevich <[email protected]>
[ Upstream commit 81419d862db743fe4450a021893f24bab4698c1d ]
Since the change of the atomics to percpu variables, we now have to disable BH in process context when touching percpu variables.
--- net/sctp/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/sctp/socket.c +2 -2
@@ -3718,12 +3718,12 @@ SCTP_STATIC int sctp_init_sock(struct so sp->hmac =NULL ;SCTP_DBG_OBJCNT_INC (sock); -percpu_counter_inc (&sctp_sockets_allocated);/* Set socket backlog limit. */ sk->sk_backlog.limit = sysctl_sctp_rmem[1 ];local_bh_disable (); +percpu_counter_inc (&sctp_sockets_allocated);sock_prot_inuse_add (sock_net (sk), sk->sk_prot,1 );local_bh_enable ();
@@ -3740,8 +3740,8 @@ SCTP_STATIC void sctp_destroy_sock(struc/* Release our hold on the endpoint. */ ep =sctp_sk (sk)->ep;sctp_endpoint_free (ep); -percpu_counter_dec (&sctp_sockets_allocated);local_bh_disable (); +percpu_counter_dec (&sctp_sockets_allocated);sock_prot_inuse_add (sock_net (sk), sk->sk_prot,-1 );local_bh_enable (); }
PATCH 89/117 sctp: fix to calc the INIT/INIT-ACK chunk length correctly is set
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Wei Yongjun <[email protected]>
[ Upstream commita8170c35e738d62e9919ce5b109cf4ed66e95bde ]
When calculating the INIT/INIT-ACK chunk length, we should not only account the length of parameters, but also the parameters zero padding length, such as AUTH HMACS parameter and CHUNKS parameter. Without the parameters zero padding length we may get following oops.
skb_over_panic: text:ce2068d2 len:130 put:6 head:cac3fe00 data:cac3fe00 tail:0xcac3fe82 end:0xcac3fe80 dev:<NULL>
------------[ cut here ]------------ kernel BUG at net/core/skbuff.c:127! invalid opcode: 0000 [#2] SMP last sysfs file: /sys/module/aes_generic/initstate Modules linked in: authenc ......
Pid: 4102, comm: sctp_darn Tainted: G D 2.6.34-rc2 #6
EIP: 0060:[<c0607630>] EFLAGS: 00010282 CPU: 0
EIP is at skb_over_panic+0x37/0x3e
EAX: 00000078 EBX: c07c024b ECX: c07c02b9 EDX: cb607b78
ESI: 00000000 EDI: cac3fe7a EBP: 00000002 ESP: cb607b74
DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process sctp_darn (pid: 4102, ti=cb607000 task=cabdc990 task.ti=cb607000)
Stack: c07c02b9 ce2068d2 00000082 00000006 cac3fe00 cac3fe00 cac3fe82 cac3fe80 <0> c07c024b cac3fe7c cac3fe7a c0608dec ca986e80 ce2068d2 00000006 0000007a <0> cb8120ca ca986e80 cb812000 00000003 cb8120c4 ce208a25 cb8120ca cadd9400 Call Trace: [<ce2068d2>] ? sctp_addto_chunk+0x45/0x85 [sctp] [<c0608dec>] ? skb_put+0x2e/0x32 [<ce2068d2>] ? sctp_addto_chunk+0x45/0x85 [sctp] [<ce208a25>] ? sctp_make_init+0x279/0x28c [sctp] [<c0686a92>] ? apic_timer_interrupt+0x2a/0x30 [<ce1fdc0b>] ? sctp_sf_do_prm_asoc+0x2b/0x7b [sctp] [<ce202823>] ? sctp_do_sm+0xa0/0x14a [sctp] [<ce2133b9>] ? sctp_pname+0x0/0x14 [sctp] [<ce211d72>] ? sctp_primitive_ASSOCIATE+0x2b/0x31 [sctp] [<ce20f3cf>] ? sctp_sendmsg+0x7a0/0x9eb [sctp] [<c064eb1e>] ? inet_sendmsg+0x3b/0x43 [<c04244b7>] ? task_tick_fair+0x2d/0xd9 [<c06031e1>] ? sock_sendmsg+0xa7/0xc1 [<c0416afe>] ? smp_apic_timer_interrupt+0x6b/0x75 [<c0425123>] ? dequeue_task_fair+0x34/0x19b [<c0446abb>] ? sched_clock_local+0x17/0x11e [<c052ea87>] ? _copy_from_user+0x2b/0x10c [<c060ab3a>] ? verify_iovec+0x3c/0x6a [<c06035ca>] ? sys_sendmsg+0x186/0x1e2 [<c042176b>] ? __wake_up_common+0x34/0x5b [<c04240c2>] ? __wake_up+0x2c/0x3b [<c057e35c>] ? tty_wakeup+0x43/0x47 [<c04430f2>] ? remove_wait_queue+0x16/0x24 [<c0580c94>] ? n_tty_read+0x5b8/0x65e [<c042be02>] ? default_wake_function+0x0/0x8 [<c0604e0e>] ? sys_socketcall+0x17f/0x1cd [<c040264c>] ? sysenter_do_call+0x12/0x22 Code: 0f 45 de 53 ff b0 98 00 00 00 ff b0 94 ...... EIP: [<c0607630>] skb_over_panic+0x37/0x3e SS:ESP 0068:cb607b74
To reproduce:
# modprobe sctp # echo 1 > /proc/sys/net/sctp/addip_enable # echo 1 > /proc/sys/net/sctp/auth_enable # sctp_test -H 3ffe:501:ffff:100:20c:29ff:fe4d:f37e -P 800 -l # sctp_darn -H 3ffe:501:ffff:100:20c:29ff:fe4d:f37e -P 900 -h 192.168.0.21 -p 800 -I -s -t sctp_darn ready to send... 3ffe:501:ffff:100:20c:29ff:fe4d:f37e:900-192.168.0.21:800 Interactive mode> bindx-add=192.168.0.21 3ffe:501:ffff:100:20c:29ff:fe4d:f37e:900-192.168.0.21:800 Interactive mode> bindx-add=192.168.1.21 3ffe:501:ffff:100:20c:29ff:fe4d:f37e:900-192.168.0.21:800 Interactive mode> snd=10
------------------------------------------------------------------
eth0 has addresses: 3ffe:501:ffff:100:20c:29ff:fe4d:f37e and 192.168.0.21 eth1 has addresses: 192.168.1.21
------------------------------------------------------------------
--- net/sctp/sm_make_chunk.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
net/sctp/sm_make_chunk.c +10 -7
@@ -207,7 +207,8 @@ struct sctp_chunk *sctp_make_init(const sp =sctp_sk (asoc->base.sk); num_types = sp->pf->supported_addrs (sp, types); - chunksize =sizeof (init) + addrs_len +SCTP_SAT_LEN (num_types); + chunksize =sizeof (init) + addrs_len; + chunksize +=WORD_ROUND (SCTP_SAT_LEN (num_types)); chunksize +=sizeof (ecap_param);if (sctp_prsctp_enable)
@@ -237,14 +238,14 @@ struct sctp_chunk *sctp_make_init(const/* Add HMACS parameter length if any were defined */ auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs;if (auth_hmacs->length) - chunksize +=ntohs (auth_hmacs->length); + chunksize +=WORD_ROUND (ntohs (auth_hmacs->length));else auth_hmacs =NULL ;/* Add CHUNKS parameter length */ auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks;if (auth_chunks->length) - chunksize +=ntohs (auth_chunks->length); + chunksize +=WORD_ROUND (ntohs (auth_chunks->length));else auth_chunks =NULL ;
@@ -254,7 +255,8 @@ struct sctp_chunk *sctp_make_init(const/* If we have any extensions to report, account for that */ if (num_ext) - chunksize +=sizeof (sctp_supported_ext_param_t) + num_ext; + chunksize +=WORD_ROUND (sizeof (sctp_supported_ext_param_t) + + num_ext);/* RFC 2960 3.3.2 Initiation (INIT) (1) *
@@ -396,13 +398,13 @@ struct sctp_chunk *sctp_make_init_ack(co auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs;if (auth_hmacs->length) - chunksize +=ntohs (auth_hmacs->length); + chunksize +=WORD_ROUND (ntohs (auth_hmacs->length));else auth_hmacs =NULL ; auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks;if (auth_chunks->length) - chunksize +=ntohs (auth_chunks->length); + chunksize +=WORD_ROUND (ntohs (auth_chunks->length));else auth_chunks =NULL ;
@@ -411,7 +413,8 @@ struct sctp_chunk *sctp_make_init_ack(co }if (num_ext) - chunksize +=sizeof (sctp_supported_ext_param_t) + num_ext; + chunksize +=WORD_ROUND (sizeof (sctp_supported_ext_param_t) + + num_ext);/* Now allocate and fill out the chunk. */ retval =sctp_make_chunk (asoc,SCTP_CID_INIT_ACK ,0 , chunksize);
PATCH 90/117 sctp: Fix oops when sending queued ASCONF chunks
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vlad Yasevich <[email protected]>
[ Upstream commit c0786693404cffd80ca3cb6e75ee7b35186b2825 ]
When we finish processing ASCONF_ACK chunk, we try to send the next queued ASCONF. This action runs the sctp state machine recursively and it's not prepared to do so.
kernel BUG at kernel/timer.c:790!
invalid opcode: 0000 [#1] SMP
last sysfs file: /sys/module/ipv6/initstate
Modules linked in: sha256_generic sctp libcrc32c ipv6 dm_multipath
uinput 8139too i2c_piix4 8139cp mii i2c_core pcspkr virtio_net joydev floppy virtio_blk virtio_pci [last unloaded: scsi_wait_scan]
Pid: 0, comm: swapper Not tainted 2.6.34-rc4 #15 /Bochs
EIP: 0060:[<c044a2ef>] EFLAGS: 00010286 CPU: 0
EIP is at add_timer+0xd/0x1b
EAX: cecbab14 EBX: 000000f0 ECX: c0957b1c EDX: 03595cf4
ESI: cecba800 EDI: cf276f00 EBP: c0957aa0 ESP: c0957aa0
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
Process swapper (pid: 0, ti=c0956000 task=c0988ba0 task.ti=c0956000)
Stack: c0957ae0 d1851214 c0ab62e4 c0ab5f26 0500ffff 00000004 00000005 00000004
<0> 00000000 d18694fd 00000004 1666b892 cecba800 cecba800 c0957b14 00000004
<0> c0957b94 d1851b11 ceda8b00 cecba800 cf276f00 00000001 c0957b14 000000d0
Call Trace: [<d1851214>] ? sctp_side_effects+0x607/0xdfc [sctp] [<d1851b11>] ? sctp_do_sm+0x108/0x159 [sctp] [<d1863386>] ? sctp_pname+0x0/0x1d [sctp] [<d1861a56>] ? sctp_primitive_ASCONF+0x36/0x3b [sctp] [<d185657c>] ? sctp_process_asconf_ack+0x2a4/0x2d3 [sctp] [<d184e35c>] ? sctp_sf_do_asconf_ack+0x1dd/0x2b4 [sctp] [<d1851ac1>] ? sctp_do_sm+0xb8/0x159 [sctp] [<d1863334>] ? sctp_cname+0x0/0x52 [sctp] [<d1854377>] ? sctp_assoc_bh_rcv+0xac/0xe1 [sctp] [<d1858f0f>] ? sctp_inq_push+0x2d/0x30 [sctp] [<d186329d>] ? sctp_rcv+0x797/0x82e [sctp]
--- include/net/sctp/command.h | 1 + net/sctp/sm_make_chunk.c | 15 --------------- net/sctp/sm_sideeffect.c | 26 ++++++++++++++++++++++++++ net/sctp/sm_statefuns.c | 8 +++++++- 4 files changed, 34 insertions(+), 16 deletions(-)
include/net/sctp/command.h +1 -0
@@ -107,6 +107,7 @@ typedef enum {SCTP_CMD_T1_RETRAN ,/* Mark for retransmission after T1 timeout */ SCTP_CMD_UPDATE_INITTAG ,/* Update peer inittag */ SCTP_CMD_SEND_MSG ,/* Send the whole use message */ +SCTP_CMD_SEND_NEXT_ASCONF ,/* Send the next ASCONF after ACK */ SCTP_CMD_LAST } sctp_verb_t;
net/sctp/sm_make_chunk.c +0 -15
@@ -3317,21 +3317,6 @@ int sctp_process_asconf_ack(struct sctp_sctp_chunk_free (asconf); asoc->addip_last_asconf =NULL ; -/* Send the next asconf chunk from the addip chunk queue. */ -if (!list_empty (&asoc->addip_chunk_list)) { -struct list_head *entry = asoc->addip_chunk_list.next; - asconf = list_entry(entry, struct sctp_chunk, list); - -list_del_init (entry); - -/* Hold the chunk until an ASCONF_ACK is received. */ -sctp_chunk_hold (asconf); -if (sctp_primitive_ASCONF (asoc, asconf)) -sctp_chunk_free (asconf); -else - asoc->addip_last_asconf = asconf; - } -return retval; }
net/sctp/sm_sideeffect.c +26 -0
@@ -961,6 +961,29 @@ static int sctp_cmd_send_msg(struct sctp } +/* Sent the next ASCONF packet currently stored in the association. +* This happens after the ASCONF_ACK was succeffully processed. +*/ +static void sctp_cmd_send_asconf (struct sctp_association *asoc) +{ +/* Send the next asconf chunk from the addip chunk +* queue. +*/ +if (!list_empty (&asoc->addip_chunk_list)) { +struct list_head *entry = asoc->addip_chunk_list.next; +struct sctp_chunk *asconf =list_entry (entry, + struct sctp_chunk, list); +list_del_init (entry); + +/* Hold the chunk until an ASCONF_ACK is received. */ +sctp_chunk_hold (asconf); +if (sctp_primitive_ASCONF (asoc, asconf)) +sctp_chunk_free (asconf); +else + asoc->addip_last_asconf = asconf; + } +} +/* These three macros allow us to pull the debugging code out of the * main flow of sctp_do_sm() to keep attention focused on the real
@@ -1616,6 +1639,9 @@ static int sctp_cmd_interpreter(sctp_eve } error =sctp_cmd_send_msg (asoc, cmd->obj.msg);break ; +case SCTP_CMD_SEND_NEXT_ASCONF : +sctp_cmd_send_asconf (asoc); +break ;default :printk (KERN_WARNING "Impossible command: %u, %p\n" , cmd->verb, cmd->obj.ptr);
net/sctp/sm_statefuns.c +7 -1
@@ -3675,8 +3675,14 @@ sctp_disposition_t sctp_sf_do_asconf_ack SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));if (!sctp_process_asconf_ack ((struct sctp_association *)asoc, - asconf_ack)) + asconf_ack)) { +/* Successfully processed ASCONF_ACK. We can +* release the next asconf if we have one. +*/ +sctp_add_cmd_sf (commands,SCTP_CMD_SEND_NEXT_ASCONF , +SCTP_NULL ());return SCTP_DISPOSITION_CONSUME ; + } abort =sctp_make_abort (asoc, asconf_ack,sizeof (sctp_errhdr_t));
PATCH 91/117 net: Fix oops from tcp_collapse() when using splice()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Steven J. Magnani <[email protected]>
[ Upstream commit baff42ab1494528907bf4d5870359e31711746ae ]
tcp_read_sock() can have a eat skbs without immediately advancing copied_seq. This can cause a panic in tcp_collapse() if it is called as a result of the recv_actor dropping the socket lock.
A userspace program that splices data from a socket to either another socket or to a file can trigger this bug.
--- net/ipv4/tcp.c | 1 + 1 file changed, 1 insertion(+)
net/ipv4/tcp.c +1 -0
@@ -1368,6 +1368,7 @@ int tcp_read_sock(struct sock *sk, read_sk_eat_skb (sk, skb,0 );if (!desc->count)break ; + tp->copied_seq = seq; } tp->copied_seq = seq;
PATCH 92/117 tipc: Fix oops on send prior to entering networked mode (v3)
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Neil Horman <[email protected]>
[ Upstream commit d0021b252eaf65ca07ed14f0d66425dd9ccab9a6 ]
Fix TIPC to disallow sending to remote addresses prior to entering NET_MODE
user programs can oops the kernel by sending datagrams via AF_TIPC prior to entering networked mode. The following backtrace has been observed:
ID: 13459 TASK: ffff810014640040 CPU: 0 COMMAND: "tipc-client"
[exception RIP: tipc_node_select_next_hop+90]
RIP: ffffffff8869d3c3 RSP: ffff81002d9a5ab8 RFLAGS: 00010202 RAX: 0000000000000001 RBX: 0000000000000001 RCX: 0000000000000001 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000001001001 RBP: 0000000001001001 R8: 0074736575716552 R9: 0000000000000000 R10: ffff81003fbd0680 R11: 00000000000000c8 R12: 0000000000000008 R13: 0000000000000001 R14: 0000000000000001 R15: ffff810015c6ca00 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 RIP: 0000003cbd8d49a3 RSP: 00007fffc84e0be8 RFLAGS: 00010206 RAX: 000000000000002c RBX: ffffffff8005d116 RCX: 0000000000000000 RDX: 0000000000000008 RSI: 00007fffc84e0c00 RDI: 0000000000000003 RBP: 0000000000000000 R8: 00007fffc84e0c10 R9: 0000000000000010 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffc84e0d10 R14: 0000000000000000 R15: 00007fffc84e0c30 ORIG_RAX: 000000000000002c CS: 0033 SS: 002b
What happens is that, when the tipc module in inserted it enters a standalone node mode in which communication to its own address is allowed <0.0.0> but not to other addresses, since the appropriate data structures have not been allocated yet (specifically the tipc_net pointer). There is nothing stopping a client from trying to send such a message however, and if that happens, we attempt to dereference tipc_net.zones while the pointer is still NULL, and explode. The fix is pretty straightforward. Since these oopses all arise from the dereference of global pointers prior to their assignment to allocated values, and since these allocations are small (about 2k total), lets convert these pointers to static arrays of the appropriate size. All the accesses to these bits consider 0/NULL to be a non match when searching, so all the lookups still work properly, and there is no longer a chance of a bad dererence anywhere. As a bonus, this lets us eliminate the setup/teardown routines for those pointers, and elimnates the need to preform any locking around them to prevent access while their being allocated/freed.
I've updated the tipc_net structure to behave this way to fix the exact reported problem, and also fixed up the tipc_bearers and media_list arrays to fix an obvious simmilar problem that arises from issuing tipc-config commands to manipulate bearers/links prior to entering networked mode
I've tested this for a few hours by running the sanity tests and stress test with the tipcutils suite, and nothing has fallen over. There have been a few lockdep warnings, but those were there before, and can be addressed later, as they didn't actually result in any deadlock.
--- net/tipc/bearer.c | 37 ++++++------------------------------- net/tipc/bearer.h | 2 +- net/tipc/net.c | 25 ++++--------------------- 3 files changed, 11 insertions(+), 53 deletions(-)
net/tipc/bearer.c +6 -31
@@ -45,10 +45,10 @@#define MAX_ADDR_STR 32 -static struct media *media_list =NULL ; +static struct media media_list[MAX_MEDIA ];static u32 media_count =0 ; -struct bearer *tipc_bearers =NULL ; +struct bearer tipc_bearers[MAX_BEARERS ];/** * media_name_valid - validate media name
@@ -108,9 +108,11 @@ int tipc_register_media(u32 media_type,int res = -EINVAL ;write_lock_bh (&tipc_net_lock); -if (!media_list) - goto exit; +if (tipc_mode !=TIPC_NET_MODE ) { +warn ("Media <%s> rejected, not in networked mode yet\n" , name); + goto exit; + }if (!media_name_valid (name)) {warn ("Media <%s> rejected, illegal name\n" , name); goto exit;
@@ -660,33 +662,10 @@ int tipc_disable_bearer(const char *name -int tipc_bearer_init (void ) -{ -int res; - -write_lock_bh (&tipc_net_lock); - tipc_bearers =kcalloc (MAX_BEARERS ,sizeof (struct bearer ),GFP_ATOMIC ); - media_list =kcalloc (MAX_MEDIA ,sizeof (struct media ),GFP_ATOMIC ); -if (tipc_bearers && media_list) { - res =0 ; - }else { -kfree (tipc_bearers); -kfree (media_list); - tipc_bearers =NULL ; - media_list =NULL ; - res = -ENOMEM ; - } -write_unlock_bh (&tipc_net_lock); -return res; -} -void tipc_bearer_stop (void ) {u32 i; -if (!tipc_bearers) -return ; -for (i =0 ; i <MAX_BEARERS ; i++) {if (tipc_bearers[i].active) tipc_bearers[i].publ.blocked =1 ;
@@ -695,10 +674,6 @@ void tipc_bearer_stop(void)if (tipc_bearers[i].active)bearer_disable (tipc_bearers[i].publ.name); } -kfree (tipc_bearers); -kfree (media_list); - tipc_bearers =NULL ; - media_list =NULL ; media_count =0 ; }
net/tipc/bearer.h +1 -1
@@ -114,7 +114,7 @@ struct bearer_name {struct link ; -extern struct bearer *tipc_bearers; +extern struct bearer tipc_bearers[];void tipc_media_addr_printf (struct print_buf *pb,struct tipc_media_addr *a);struct sk_buff *tipc_media_get_names (void );
net/tipc/net.c +4 -21
@@ -116,7 +116,8 @@*/ DEFINE_RWLOCK (tipc_net_lock); -struct network tipc_net = {NULL }; +struct _zone *tipc_zones[256 ] = {NULL , }; +struct network tipc_net = { tipc_zones };struct tipc_node *tipc_net_select_remote_node (u32 addr,u32 ref) {
@@ -158,28 +159,12 @@ void tipc_net_send_external_routes(u32 d } } -static int net_init (void ) -{ -memset (&tipc_net,0 ,sizeof (tipc_net)); - tipc_net.zones =kcalloc (tipc_max_zones +1 ,sizeof (struct _zone *),GFP_ATOMIC ); -if (!tipc_net.zones) { -return -ENOMEM ; - } -return 0 ; -} -static void net_stop (void ) {u32 z_num; -if (!tipc_net.zones) -return ; - -for (z_num =1 ; z_num <= tipc_max_zones; z_num++) { +for (z_num =1 ; z_num <= tipc_max_zones; z_num++)tipc_zone_delete (tipc_net.zones[z_num]); - } -kfree (tipc_net.zones); - tipc_net.zones =NULL ; }static void net_route_named_msg (struct sk_buff *buf)
@@ -282,9 +267,7 @@ int tipc_net_start(u32 addr)tipc_named_reinit ();tipc_port_reinit (); -if ((res =tipc_bearer_init ()) || - (res =net_init ()) || - (res =tipc_cltr_init ()) || +if ((res =tipc_cltr_init ()) || (res =tipc_bclink_init ())) {return res; }
PATCH 93/117 tun: orphan an skb on tx
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Michael S. Tsirkin <[email protected]>
[ Upstream commit 0110d6f22f392f976e84ab49da1b42f85b64a3c5 ]
The following situation was observed in the field:
tap1 sends packets, tap2 does not consume them, as a result tap1 can not be closed. This happens because tun/tap devices can hang on to skbs undefinitely.
As noted by Herbert, possible solutions include a timeout followed by a copy/change of ownership of the skb, or always copying/changing ownership if we're going into a hostile device.
This patch implements the second approach.
Note: one issue still remaining is that since skbs keep reference to tun socket and tun socket has a reference to tun device, we won't flush backlog, instead simply waiting for all skbs to get transmitted. At least this is not user-triggerable, and this was not reported in practice, my assumption is other devices besides tap complete an skb within finite time after it has been queued.
A possible solution for the second issue would not to have socket reference the device, instead, implement dev->destructor for tun, and wait for all skbs to complete there, but this needs some thought, probably too risky for 2.6.34.
--- drivers/net/tun.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/tun.c +4 -0
@@ -380,6 +380,10 @@ static netdev_tx_t tun_net_xmit(struct s } } +/* Orphan the skb - required as we might hang on to it +* for indefinite time. */ +skb_orphan (skb); +/* Enqueue packet */ skb_queue_tail (&tun->socket.sk->sk_receive_queue, skb); dev->trans_start = jiffies;
PATCH 94/117 udp: fix for unicast RX path optimization
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jorge Boncompte [DTI2] <[email protected]>
[ Upstream commit 1223c67c0938d2df309fde618bd82c87c8c1af04 ]
Commits 5051ebd275de672b807c28d93002c2fb0514a3c9 and 5051ebd275de672b807c28d93002c2fb0514a3c9 ("ipv[46]: udp: optimize unicast RX path") broke some programs.
After upgrading a L2TP server to 2.6.33 it started to fail, tunnels going up an
down, after the 10th tunnel came up. My modified rp-l2tp uses a global unconnected socket bound to (INADDR_ANY, 1701) and one connected socket per tunnel after parameter negotiation.
After ten sockets were open and due to mixed parameters to
udp[46]_lib_lookup2() kernel started to drop packets.
--- net/ipv4/udp.c | 4 ++-- net/ipv6/udp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
net/ipv4/udp.c +2 -2
@@ -471,8 +471,8 @@ static struct sock *__udp4_lib_lookup(stif (hslot->count < hslot2->count) goto begin; - result =udp4_lib_lookup2 (net,INADDR_ANY , sport, - daddr, hnum, dif, + result =udp4_lib_lookup2 (net, saddr, sport, +INADDR_ANY , hnum, dif, hslot2, slot2); }rcu_read_unlock ();
net/ipv6/udp.c +2 -2
@@ -258,8 +258,8 @@ static struct sock *__udp6_lib_lookup(stif (hslot->count < hslot2->count) goto begin; - result =udp6_lib_lookup2 (net, &in6addr_any, sport, - daddr, hnum, dif, + result =udp6_lib_lookup2 (net, saddr, sport, + &in6addr_any, hnum, dif, hslot2, slot2); }rcu_read_unlock ();
PATCH 95/117 WAN: flush tx_queue in hdlc_ppp to prevent panic on rmmod hw_driver.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Krzysztof Halasa <[email protected]>
[ Upstream commit 31f634a63de7068c6a5dcb0d7b09b24b61a5cf88 ]
tx_queue is used as a temporary queue when not allowed to queue skb directly to the hw device driver (which may sleep). Most paths flush it before returning, but ppp_start() currently cannot. Make sure we don't leave skbs pointing to a non-existent device.
Thanks to Michael Barkowski for reporting this problem.
--- drivers/net/wan/hdlc_ppp.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wan/hdlc_ppp.c +6 -0
@@ -628,9 +628,15 @@ static void ppp_stop(struct net_device *ppp_cp_event (dev,PID_LCP ,STOP ,0 ,0 ,0 ,NULL ); } +static void ppp_close (struct net_device *dev) +{ +ppp_tx_flush (); +} +static struct hdlc_proto proto = { .start = ppp_start, .stop = ppp_stop, + .close = ppp_close, .type_trans = ppp_type_trans, .ioctl = ppp_ioctl, .netif_rx = ppp_rx,
PATCH 96/117 sparc64: Use correct pt_regs in decode_access_size() error paths.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commit baa06775e224e9f74e5c2de894c95cd49678beff ]
--- arch/sparc/kernel/unaligned_64.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/sparc/kernel/unaligned_64.c +3 -3
@@ -49,7 +49,7 @@ static inline enum direction decode_dire }/* 16 = double-word, 8 = extra-word, 4 = word, 2 = half-word */ -static inline int decode_access_size (unsigned int insn) +static inline int decode_access_size (struct pt_regs *regs,unsigned int insn) {unsigned int tmp;
@@ -65,7 +65,7 @@ static inline int decode_access_size(unsreturn 2 ; else {printk ("Impossible unaligned trap. insn=%08x\n" , insn); -die_if_kernel ("Byte sized unaligned access?!?!" ,current_thread_info ()->kregs); +die_if_kernel ("Byte sized unaligned access?!?!" , regs);/* GCC should never warn that control reaches the end * of this function without returning a value because
@@ -289,7 +289,7 @@ static void log_unaligned(struct pt_regs asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn) {enum direction dir =decode_direction (insn); -int size =decode_access_size (insn); +int size =decode_access_size (regs, insn);int orig_asi, asi;current_thread_info ()->kern_una_regs = regs;
PATCH 97/117 sparc64: Fix PREEMPT_ACTIVE value.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commit 6c94b1ee0ca2bfb526d779c088ec20da6a3761db ]
It currently overlaps the NMI bit.
--- arch/sparc/include/asm/thread_info_64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/include/asm/thread_info_64.h +1 -1
@@ -121,7 +121,7 @@ struct thread_info {#define THREAD_SHIFT PAGE_SHIFT#endif /* PAGE_SHIFT == 13 */ -#define PREEMPT_ACTIVE 0x4000000 +#define PREEMPT_ACTIVE 0x10000000/* * macros/functions for gaining access to the thread information structure
PATCH 98/117 sparc64: Fix hardirq tracing in trap return path.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commit 28a1f533ae8606020238b840b82ae70a3f87609e ]
We can overflow the hardirq stack if we set the %pil here so early, just let the normal control flow do it.
This is fine as we are allowed to do the actual IRQ enable at any point after we call trace_hardirqs_on.
--- arch/sparc/kernel/rtrap_64.S | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
arch/sparc/kernel/rtrap_64.S +11 -1
@@ -172,7 +172,17 @@ rtrap_xcall: nop call trace_hardirqs_on nop - wrpr %l4, %pil + /* Do not actually set the %pil here. We will do that + * below after we clear PSTATE_IE in the %pstate register. + * If we re-enable interrupts here, we can recurse down + * the hardirq stack potentially endlessly, causing a + * stack overflow. + * + * It is tempting to put this test and trace_hardirqs_on + * call at the 'rt_continue' label, but that will not work + * as that path hits unconditionally and we do not want to + * execute this in NMI return paths, for example. + */ #endif rtrap_no_irq_enable: andcc %l1, TSTATE_PRIV, %l3
PATCH 99/117 sparc64: Use kstack_valid() in die_if_kernel().
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commit cb256aa60409efd803806cfb0528a4b3f8397dba ]
This gets rid of a local function (is_kernel_stack()) which tries to do the same thing, yet poorly in that it doesn't handle IRQ stacks properly.
--- arch/sparc/kernel/traps_64.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-)
arch/sparc/kernel/traps_64.c +3 -23
@@ -2202,27 +2202,6 @@ void dump_stack(void)EXPORT_SYMBOL (dump_stack); -static inline int is_kernel_stack (struct task_struct *task, -struct reg_window *rw) -{ -unsigned long rw_addr = (unsigned long ) rw; -unsigned long thread_base, thread_end; - -if (rw_addr <PAGE_OFFSET ) { -if (task != &init_task) -return 0 ; - } - - thread_base = (unsigned long )task_stack_page (task); - thread_end = thread_base +sizeof (union thread_union ); -if (rw_addr >= thread_base && - rw_addr < thread_end && - !(rw_addr &0x7UL )) -return 1 ; - -return 0 ; -} -static inline struct reg_window *kernel_stack_up (struct reg_window *rw) {unsigned long fp = rw->ins[6 ];
@@ -2251,6 +2230,7 @@ void die_if_kernel(char *str, struct pt_show_regs (regs);add_taint (TAINT_DIE );if (regs->tstate &TSTATE_PRIV ) { +struct thread_info *tp =current_thread_info ();struct reg_window *rw = (struct reg_window *) (regs->u_regs[UREG_FP ] +STACK_BIAS );
@@ -2258,8 +2238,8 @@ void die_if_kernel(char *str, struct pt_* find some badly aligned kernel stack. */ while (rw && - count++ <30 && -is_kernel_stack (current, rw)) { + count++ <30 && +kstack_valid (tp, (unsigned long ) rw)) {printk ("Caller[%016lx]: %pS\n" , rw->ins[7 ], (void *) rw->ins[7 ]);
PATCH 100/117 sparc64: Adjust __raw_local_irq_save() to cooperate in NMIs.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commits 0c25e9e6cbe7b233bb91d14d0e2c258bf8e6ec83 and
c011f80ba0912486fe51dd2b3f71d9b33a151188 ]
If we are in an NMI then doing a plain raw_local_irq_disable() will write PIL_NORMAL_MAX into %pil, which is lower than PIL_NMI, and thus we'll re-enable NMIs and recurse.
Doing a simple:
%pil = %pil | PIL_NORMAL_MAX
does what we want, if we're already at PIL_NMI (15) we leave it at that setting, else we set it to PIL_NORMAL_MAX (14).
This should get the function tracer working on sparc64.
--- arch/sparc/include/asm/irqflags_64.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
arch/sparc/include/asm/irqflags_64.h +19 -2
@@ -76,9 +76,26 @@ static inline int raw_irqs_disabled(void*/ static inline unsigned long __raw_local_irq_save (void ) { -unsigned long flags =__raw_local_save_flags (); +unsigned long flags, tmp; -raw_local_irq_disable (); +/* Disable interrupts to PIL_NORMAL_MAX unless we already +* are using PIL_NMI, in which case PIL_NMI is retained. +* +* The only values we ever program into the %pil are 0, +* PIL_NORMAL_MAX and PIL_NMI. +* +* Since PIL_NMI is the largest %pil value and all bits are +* set in it (0xf), it doesn't matter what PIL_NORMAL_MAX +* actually is. +*/ + __asm__ __volatile__( +"rdpr %%pil, %0\n\t" +"or %0, %2, %1\n\t" +"wrpr %1, 0x0, %%pil" + :"=r" (flags),"=r" (tmp) + :"i" (PIL_NORMAL_MAX ) + :"memory" + );return flags; }
PATCH 101/117 sparc64: Fix memory leak in pci_register_iommu_region().
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: David S. Miller <[email protected]>
[ Upstream commit e182c77cc291456eed127b1472952ddb59a81a9d ]
Found by kmemleak.
If request_resource() fails, we leak the struct resource we allocated to represent the IOMMU mapping area.
This actually happens on sun4v machines because the IOMEM area is only reported sans the IOMMU region, unlike all previous systems. I'll need to fix that at some point, but for now fix the leak.
--- arch/sparc/kernel/pci_common.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
arch/sparc/kernel/pci_common.c +8 -3
@@ -371,14 +371,19 @@ static void pci_register_iommu_region(ststruct resource *rp =kzalloc (sizeof (*rp),GFP_KERNEL );if (!rp) { -prom_printf ("Cannot allocate IOMMU resource.\n" ); -prom_halt (); +pr_info ("%s: Cannot allocate IOMMU resource.\n" , + pbm->name); +return ; } rp->name ="IOMMU" ; rp->start = pbm->mem_space.start + (unsigned long ) vdma[0 ]; rp->end = rp->start + (unsigned long ) vdma[1 ] -1UL ; rp->flags =IORESOURCE_BUSY ; -request_resource (&pbm->mem_space, rp); +if (request_resource (&pbm->mem_space, rp)) { +pr_info ("%s: Unable to request IOMMU resource.\n" , + pbm->name); +kfree (rp); + } } }
PATCH 102/117 security: testing the wrong variable in create_by_name()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Carpenter <[email protected]>
commit b338cc8207eae46640a8d534738fda7b5e48511d upstream.
There is a typo here. We should be testing "*dentry" instead of "dentry". If "*dentry" is an ERR_PTR, it gets dereferenced in either mkdir() or create() which would cause an OOPs.
--- security/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
security/inode.c +2 -2
@@ -161,13 +161,13 @@ static int create_by_name(const char *namutex_lock (&parent->d_inode->i_mutex); *dentry =lookup_one_len (name, parent,strlen (name)); -if (!IS_ERR (dentry)) { +if (!IS_ERR (*dentry)) {if ((mode &S_IFMT ) ==S_IFDIR ) error =mkdir (parent->d_inode, *dentry, mode);else error =create (parent->d_inode, *dentry, mode); }else - error =PTR_ERR (dentry); + error =PTR_ERR (*dentry);mutex_unlock (&parent->d_inode->i_mutex);return error;
PATCH 103/117 md: restore ability of spare drives to spin down.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: NeilBrown <[email protected]>
commit 1176568de7e066c0be9e46c37503b9fd4730edcf upstream.
Some time ago we stopped the clean/active metadata updates from being written to a 'spare' device in most cases so that it could spin down and say spun down. Device failure/removal etc are still recorded on spares.
However commit 51d5668cb2e3fd1827a55 broke this 50% of the time, depending on whether the event count is even or odd. The change log entry said:
This means that the alignment between 'odd/even' and
'clean/dirty' might take a little longer to attain,
how ever the code makes no attempt to create that alignment, so it could take arbitrarily long.
So when we find that clean/dirty is not aligned with odd/even, force a second metadata-update immediately. There are already cases where a second metadata-update is needed immediately (e.g. when a device fails during the metadata update). We just piggy-back on that.
--- drivers/md/md.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/md/md.c +8 -2
@@ -2108,12 +2108,18 @@ repeat:if (!mddev->in_sync || mddev->recovery_cp != MaxSector) {/* not clean */ /* .. if the array isn't clean, an 'even' event must also go * to spares. */ -if ((mddev->events&1 )==0 ) +if ((mddev->events&1 )==0 ) { nospares =0 ; + sync_req =2 ;/* force a second update to get the +* even/odd in sync */ + } }else {/* otherwise an 'odd' event must go to spares */ -if ((mddev->events&1 )) +if ((mddev->events&1 )) { nospares =0 ; + sync_req =2 ;/* force a second update to get the +* even/odd in sync */ + } } }
PATCH 104/117 virtio: initialize earlier
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Stijn Tintel <[email protected]>
commit e2dbe06c271f3bb2a495627980aad3d1d8ccef2a upstream.
Move initialization of the virtio framework before the initialization of mtd, so that block2mtd can be used on virtio-based block devices.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=15644
--- drivers/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/Makefile +1 -1
@@ -17,6 +17,7 @@ obj-$(CONFIG_SFI) += sfi/ obj-$(CONFIG_PNP) += pnp/ obj-$(CONFIG_ARM_AMBA) += amba/ +obj-$(CONFIG_VIRTIO) += virtio/ obj-$(CONFIG_XEN) += xen/ # regulators early, since some subsystems rely on them to initialize
@@ -106,7 +107,6 @@ obj-$(CONFIG_HID) += hid/ obj-$(CONFIG_PPC_PS3) += ps3/ obj-$(CONFIG_OF) += of/ obj-$(CONFIG_SSB) += ssb/ -obj-$(CONFIG_VIRTIO) += virtio/ obj-$(CONFIG_VLYNQ) += vlynq/ obj-$(CONFIG_STAGING) += staging/ obj-y += platform/
PATCH 105/117 md/raid6: Fix raid-6 read-error correction in degraded state
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Gabriele A. Trombetti <[email protected]>
commit 87aa63000c484bfb9909989316f615240dfee018 upstream.
Fix: Raid-6 was not trying to correct a read-error when in singly-degraded state and was instead dropping one more device, going to doubly-degraded state. This patch fixes this behaviour.
--- drivers/md/raid5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/raid5.c +1 -1
@@ -1526,7 +1526,7 @@ static void raid5_end_read_request(strucclear_bit (R5_UPTODATE , &sh->dev[i].flags);atomic_inc (&rdev->read_errors); -if (conf->mddev->degraded) +if (conf->mddev->degraded >= conf->max_degraded) printk_rl(KERN_WARNING "raid5:%s: read error not correctable " "(sector %llu on %s).\n",
PATCH 106/117 V4L/DVB: budget: Oops: "BUG: unable to handle kernel NULL pointer dereference"
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Bjørn Mork <[email protected]>
commit 6f550dc08369ee0bc6402963c377e65f0f2e3b71 upstream.
Never call dvb_frontend_detach if we failed to attach a frontend. This fixes the following oops, which will be triggered by a missing stv090x module:
[ 8.172997] DVB: registering new adapter (TT-Budget S2-1600 PCI) [ 8.209018] adapter has MAC addr = 00:d0:5c:cc:a7:29 [ 8.328665] Intel ICH 0000:00:1f.5: PCI INT B -> GSI 17 (level, low) -> IRQ 17 [ 8.328753] Intel ICH 0000:00:1f.5: setting latency timer to 64 [ 8.562047] DVB: Unable to find symbol stv090x_attach() [ 8.562117] BUG: unable to handle kernel NULL pointer dereference at 000000ac [ 8.562239] IP: [<e08b04a3>] dvb_frontend_detach+0x4/0x67 [dvb_core]
Ref http://bugs.debian.org/575207
--- drivers/media/dvb/ttpci/budget.c | 3 --- 1 file changed, 3 deletions(-)
drivers/media/dvb/ttpci/budget.c +0 -3
@@ -643,9 +643,6 @@ static void frontend_init(struct budget &budget->i2c_adap, &tt1600_isl6423_config); - }else { -dvb_frontend_detach (budget->dvb_frontend); - budget->dvb_frontend =NULL ; } }break ;
PATCH 107/117 ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Chiang <[email protected]>
commit 07bedca29b0973f36a6b6db36936deed367164ed upstream.
Multiple Lenovo ThinkPad models with Intel Core i5/i7 CPUs can successfully suspend/resume once, and then hang on the second s/r cycle.
We got confirmation that this was due to a BIOS defect. The BIOS did not properly set SCI_EN coming out of S3. The BIOS guys hinted that The Other Leading OS ignores the fact that hardware owns the bit and sets it manually.
In any case, an existing DMI table exists for machines where this defect is a known problem. Lenovo promise to fix their BIOS, but for folks who either won't or can't upgrade their BIOS, allow Linux to workaround the issue.
https://bugzilla.kernel.org/show_bug.cgi?id=15407
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/532374
Confirmed by numerous testers in the launchpad bug that using acpi_sleep=sci_force_enable fixes the issue. We add the machines to acpisleep_dmi_table[] to automatically enable this workaround.
--- drivers/acpi/sleep.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+)
drivers/acpi/sleep.c +120 -0
@@ -450,6 +450,126 @@ static struct dmi_system_id __initdata a }, }, { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T410", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T510", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad W510", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad X201", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad X201", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T410", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T510", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad W510", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad X201", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad X201", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T410", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T510", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad W510", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad X201", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad X201", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), + }, + }, + { .callback = init_old_suspend_ordering, .ident = "Panasonic CF51-2L", .matches = {
Re: [107/117] ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads
Hm, this patch looks a little wonky.
Why is every entry repeated 3x?
Quoted 2 lines
(quoted diff) +2
-0+ .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T410",
[snip]
Review
Quoted 2 lines
(quoted diff) +2
-0+ .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T410",
[snip[
Review
Quoted 2 lines
(quoted diff) +2
-0+ .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T410",
Oh crap, it's broken upstream too. :(
Not sure what happened, but I think some sort of hiccup occurred when the patch was applied, since this is what hit the mailing lists:
https://patchwork.kernel.org/patch/94711/
Len, Greg, what would you like me to do? I think the cleanest thing to do to help keep -stable clean would be to:
a) drop this patch from current -stable queue
b) revert 07bedca29b09 upstream
c) apply the patch from patchwork
d) re-apply to -stable
Thoughts?
Thanks,
/ac
Re: [107/117] ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads
Quoted 30 lines · Alex Chiang
Hm, this patch looks a little wonky.
Why is every entry repeated 3x?
Quoted 2 lines
(quoted diff) +2
-0+ .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T410",[snip]
Review
Quoted 2 lines
(quoted diff) +2
-0+ .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T410",[snip[
Review
Quoted 2 lines
(quoted diff) +2
-0+ .callback = init_set_sci_en_on_resume, + .ident = "Lenovo ThinkPad T410",Oh crap, it's broken upstream too. :(
Not sure what happened, but I think some sort of hiccup occurred when the patch was applied, since this is what hit the mailing lists:
https://patchwork.kernel.org/patch/94711/
Len, Greg, what would you like me to do? I think the cleanest thing to do to help keep -stable clean would be to:
Quoted 6 lines
a) drop this patch from current -stable queue
b) revert07bedca29b09upstream
c) apply the patch from patchwork
d) re-apply to -stableThoughts?
How about getting a fixup patch into Linus's tree and then I'll apply that fixup patch to stable as well?
In the meantime, triplicates don't hurt anyone :)
thanks,
greg k-h
Re: [107/117] ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads
* Greg KH <[email protected]>:
Quoted 11 lines
Quoted 8 lines
Len, Greg, what would you like me to do? I think the cleanest thing to do to help keep -stable clean would be to:
a) drop this patch from current -stable queue
b) revert07bedca29b09upstream
c) apply the patch from patchwork
d) re-apply to -stableHow about getting a fixup patch into Linus's tree and then I'll apply that fixup patch to stable as well?
Sure, here's a patch against Linus's latest. I'll leave it up to Len to decide which approach he'd prefer.
From: Alex Chiang <[email protected]>
ACPI: sleep: eliminate duplicate entries in acpisleep_dmi_table[]
Duplicate entries ended up acpisleep_dmi_table[] by accident. They don't hurt functionality, but they are ugly, so let's get rid of them.
---
drivers/acpi/sleep.c +1 -89
@@ -475,101 +475,13 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { }, { .callback = init_set_sci_en_on_resume, - .ident = "Lenovo ThinkPad X201", + .ident = "Lenovo ThinkPad X201[s]", .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"), }, }, { - .callback = init_set_sci_en_on_resume, - .ident = "Lenovo ThinkPad X201", - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), - }, - }, - { - .callback = init_set_sci_en_on_resume, - .ident = "Lenovo ThinkPad T410", - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"), - }, - }, - { - .callback = init_set_sci_en_on_resume, - .ident = "Lenovo ThinkPad T510", - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"), - }, - }, - { - .callback = init_set_sci_en_on_resume, - .ident = "Lenovo ThinkPad W510", - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"), - }, - }, - { - .callback = init_set_sci_en_on_resume, - .ident = "Lenovo ThinkPad X201", - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"), - }, - }, - { - .callback = init_set_sci_en_on_resume, - .ident = "Lenovo ThinkPad X201", - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), - }, - }, - { - .callback = init_set_sci_en_on_resume, - .ident = "Lenovo ThinkPad T410", - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"), - }, - }, - { - .callback = init_set_sci_en_on_resume, - .ident = "Lenovo ThinkPad T510", - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"), - }, - }, - { - .callback = init_set_sci_en_on_resume, - .ident = "Lenovo ThinkPad W510", - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"), - }, - }, - { - .callback = init_set_sci_en_on_resume, - .ident = "Lenovo ThinkPad X201", - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"), - }, - }, - { - .callback = init_set_sci_en_on_resume, - .ident = "Lenovo ThinkPad X201", - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), - }, - }, - { .callback = init_old_suspend_ordering, .ident = "Panasonic CF51-2L", .matches = {
PATCH 108/117 power_meter: acpi_device_class "power_meter_resource" too long
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Carpenter <[email protected]>
commit 18262714ca0fb65c290b8ea1807b2b02bb52d0e3 upstream.
acpi_device_class can only be 19 characters and a NULL terminator.
The current code has a buffer overflow in acpi_power_meter_add():
strcpy(acpi_device_class(device), ACPI_POWER_METER_CLASS);
--- drivers/acpi/power_meter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/power_meter.c +1 -1
@@ -34,7 +34,7 @@#define ACPI_POWER_METER_NAME "power_meter"ACPI_MODULE_NAME (ACPI_POWER_METER_NAME );#define ACPI_POWER_METER_DEVICE_NAME "Power Meter" -#define ACPI_POWER_METER_CLASS "power_meter_resource" +#define ACPI_POWER_METER_CLASS "pwr_meter_resource"#define NUM_SENSORS 17
PATCH 109/117 ACPI: sleep: init_set_sci_en_on_resume for Dell Studio 155x
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Kamal Mostafa <[email protected]>
commit ea5bc73f4f56449b2d450068d492bcd17a675d7a upstream.
Add Dell Studio models (1558, 1557, 1555) to the 'set_sci_en_on_resume' list to fix hang on resume.
--- drivers/acpi/sleep.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/acpi/sleep.c +24 -0
@@ -578,6 +578,30 @@ static struct dmi_system_id __initdata a DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), }, }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Dell Studio 1558", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), + DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1558"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Dell Studio 1557", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), + DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1557"), + }, + }, + { + .callback = init_set_sci_en_on_resume, + .ident = "Dell Studio 1555", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), + DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1555"), + }, + }, {}, };#endif /* CONFIG_SUSPEND */
PATCH 110/117 cpuidle: Fix incorrect optimization
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Arjan van de Ven <[email protected]>
commit 1c6fe0364fa7bf28248488753ee0afb6b759cd04 upstream.
commit 672917dcc78 ("cpuidle: menu governor: reduce latency on exit") added an optimization, where the analysis on the past idle period moved from the end of idle, to the beginning of the new idle.
Unfortunately, this optimization had a bug where it zeroed one key variable for new use, that is needed for the analysis. The fix is simple, zero the variable after doing the work from the previous idle.
During the audit of the code that found this issue, another issue was also found; the ->measured_us data structure member is never set, a local variable is always used instead.
--- drivers/cpuidle/governors/menu.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/cpuidle/governors/menu.c +4 -5
@@ -101,7 +101,6 @@ struct menu_device {unsigned int expected_us;u64 predicted_us; -unsigned int measured_us;unsigned int exit_us;unsigned int bucket;u64 correction_factor[BUCKETS ];
@@ -187,14 +186,14 @@ static int menu_select(struct cpuidle_deint i;int multiplier; - data->last_state_idx =0 ; - data->exit_us =0 ; -if (data->needs_update) {menu_update (dev); data->needs_update =0 ; } + data->last_state_idx =0 ; + data->exit_us =0 ; +/* Special case when user has set very strict latency requirement */ if (unlikely (latency_req ==0 ))return 0 ;
@@ -294,7 +293,7 @@ static void menu_update(struct cpuidle_d new_factor = data->correction_factor[data->bucket] * (DECAY -1 ) /DECAY ; -if (data->expected_us >0 && data->measured_us <MAX_INTERESTING ) +if (data->expected_us >0 && measured_us <MAX_INTERESTING ) new_factor +=RESOLUTION * measured_us / data->expected_us;else /*
PATCH 111/117 pxa/colibri: fix missing #include <mach/mfp.h> in colibri.h
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jakob Viketoft <[email protected]>
commit ccb8d8d070b8f25f0163da5c9ceacf63a5169540 upstream.
The use of mfp_cfg_t causes build errors without including <mach/mfp.h>.
--- arch/arm/mach-pxa/include/mach/colibri.h | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-pxa/include/mach/colibri.h +1 -0
@@ -2,6 +2,7 @@#define _COLIBRI_H_#include <net/ax88796.h> +#include <mach/mfp.h> /* * common settings for all modules
PATCH 112/117 SCSI: fix locking around blk_abort_request()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit 70b25f890ce9f0520c64075ce9225a5b020a513e upstream.
blk_abort_request() expects queue lock to be held by the caller. Grab it before calling the function.
Lack of this synchronization led to infinite loop on corrupt q->timeout_list.
--- drivers/scsi/libsas/sas_ata.c | 4 ++++ drivers/scsi/libsas/sas_scsi_host.c | 4 ++++ 2 files changed, 8 insertions(+)
drivers/scsi/libsas/sas_ata.c +4 -0
@@ -394,11 +394,15 @@ int sas_ata_init_host_and_port(struct dovoid sas_ata_task_abort (struct sas_task *task) {struct ata_queued_cmd *qc = task->uldd_task; +struct request_queue *q = qc->scsicmd->device->request_queue;struct completion *waiting; +unsigned long flags;/* Bounce SCSI-initiated commands to the SCSI EH */ if (qc->scsicmd) { +spin_lock_irqsave (q->queue_lock, flags);blk_abort_request (qc->scsicmd->request); +spin_unlock_irqrestore (q->queue_lock, flags);scsi_schedule_eh (qc->scsicmd->device->host);return ; }
drivers/scsi/libsas/sas_scsi_host.c +4 -0
@@ -1029,6 +1029,8 @@ int __sas_task_abort(struct sas_task *tavoid sas_task_abort (struct sas_task *task) {struct scsi_cmnd *sc = task->uldd_task; +struct request_queue *q = sc->device->request_queue; +unsigned long flags;/* Escape for libsas internal commands */ if (!sc) {
@@ -1043,7 +1045,9 @@ void sas_task_abort(struct sas_task *tasreturn ; } +spin_lock_irqsave (q->queue_lock, flags);blk_abort_request (sc->request); +spin_unlock_irqrestore (q->queue_lock, flags);scsi_schedule_eh (sc->device->host); }
PATCH 113/117 SCSI: libiscsi: regression: fix header digest errors
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mike Christie <[email protected]>
commit 96b1f96dcab87756c0a1e7ba76bc5dc2add82b88 upstream.
This fixes a regression introduced with this commit:
commit d3305f3407fa3e9452079ec6cc8379067456e4aa
Author: Mike Christie <[email protected]> Date: Thu Aug 20 15:10:58 2009 -0500
[SCSI] libiscsi: don't increment cmdsn if cmd is not sent
in 2.6.32.
When I moved the hdr->cmdsn after init_task, I added a bug when header digests are used. The problem is that the LLD may calculate the header digest in init_task, so if we then set the cmdsn after the init_task call we change what the digest will be calculated by the target.
--- drivers/scsi/libiscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/libiscsi.c +1 -1
@@ -470,12 +470,12 @@ static int iscsi_prep_scsi_cmd_pdu(strucWARN_ON (hdrlength >=256 ); hdr->hlength = hdrlength &0xFF ; + hdr->cmdsn = task->cmdsn =cpu_to_be32 (session->cmdsn);if (session->tt->init_task && session->tt->init_task (task))return -EIO ; task->state =ISCSI_TASK_RUNNING ; - hdr->cmdsn = task->cmdsn =cpu_to_be32 (session->cmdsn); session->cmdsn++; conn->scsicmd_pdus_cnt++;
PATCH 114/117 scsi_debug: virtual_gb ignores sector_size
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Douglas Gilbert <[email protected]>
commit 5447ed6c968e7270b656afa273c2b79d15d82edd upstream.
In the scsi_debug driver, the virtual_gb option ignores the sector_size, implicitly assuming that is 512 bytes. So if 'virtual_gb=1 sector_size=4096' the result is an 8 GB (virtual) disk.
--- drivers/scsi/scsi_debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/scsi_debug.c +2 -1
@@ -956,7 +956,8 @@ static int resp_start_stop(struct scsi_cstatic sector_t get_sdebug_capacity (void ) {if (scsi_debug_virtual_gb >0 ) -return 2048 *1024 * (sector_t )scsi_debug_virtual_gb; +return (sector_t )scsi_debug_virtual_gb * + (1073741824 / scsi_debug_sector_size);else return sdebug_store_sectors; }
PATCH 115/117 Enable retries for SYNCRONIZE_CACHE commands to fix I/O error
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hannes Reinecke <[email protected]>
commit c213e1407be6b04b144794399a91472e0ef92aec upstream.
Some arrays are giving I/O errors with ext3 filesystems when SYNCHRONIZE_CACHE gets a UNIT_ATTENTION. What is happening is that these commands have no retries, so the UNIT_ATTENTION causes the barrier to fail. We should be enable retries here to clear any transient error and allow the barrier to succeed.
--- drivers/scsi/sd.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/sd.c +1 -0
@@ -1039,6 +1039,7 @@ static void sd_prepare_flush(struct requ { rq->cmd_type =REQ_TYPE_BLOCK_PC ; rq->timeout =SD_TIMEOUT ; + rq->retries =SD_MAX_RETRIES ; rq->cmd[0 ] =SYNCHRONIZE_CACHE ; rq->cmd_len =10 ; }
PATCH 116/117 SCSI: Retry commands with UNIT_ATTENTION sense codes to fix ext3/ext4 I/O error
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
From: James Bottomley <[email protected]>
commit 77a4229719e511a0d38d9c355317ae1469adeb54 upstream.
There's nastyness in the way we currently handle barriers (and discards): They're effectively filesystem commands, but they get processed as BLOCK_PC commands. Unfortunately BLOCK_PC commands are taken by SCSI to be SG_IO commands and the issuer expects to see and handle any returned errors, however trivial. This leads to a huge problem, because the block layer doesn't expect this to happen and any trivially retryable error on a barrier causes an immediate I/O error to the filesystem.
The only real way to hack around this is to take the usual class of offending errors (unit attentions) and make them all retryable in the case of a REQ_HARDBARRIER. A correct fix would involve a rework of the entire block and SCSI submit system, and so is out of scope for a quick fix.
--- drivers/scsi/scsi_error.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/scsi/scsi_error.c +14 -1
@@ -301,7 +301,20 @@ static int scsi_check_sense(struct scsi_if (scmd->device->allow_restart && (sshdr.asc ==0x04 ) && (sshdr.ascq ==0x02 ))return FAILED ; -return SUCCESS ; + +if (blk_barrier_rq (scmd->request)) +/* +* barrier requests should always retry on UA +* otherwise block will get a spurious error +*/ +return NEEDS_RETRY ; +else +/* +* for normal (non barrier) commands, pass the +* UA upwards for a determination in the +* completion functions +*/ +return SUCCESS ;/* these three are not supported */ case COPY_ABORTED :
PATCH 117/117 MIPS: Sibyte: Apply M3 workaround only on affected chip types and versions.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let us know.
------------------
(cherry picked from commit e65c7f33d75e977350ca350573d93c517ec02776)
Previously it was unconditionally used on all Sibyte family SOCs. The M3 bug has to be handled in the TLB exception handler which is extremly performance sensitive, so this modification is expected to deliver around 2-3% performance improvment. This is important as required changes to the M3 workaround will make it more costly.
--- arch/mips/include/asm/mach-sibyte/war.h | 6 +++++- arch/mips/sibyte/sb1250/setup.c | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-)
arch/mips/include/asm/mach-sibyte/war.h +5 -1
@@ -16,7 +16,11 @@#if defined(CONFIG_SB1_PASS_1_WORKAROUNDS ) || \ defined(CONFIG_SB1_PASS_2_WORKAROUNDS ) -#define BCM1250_M3_WAR 1 +#ifndef __ASSEMBLY__ +extern int sb1250_m3_workaround_needed (void ); +#endif + +#define BCM1250_M3_WAR sb1250_m3_workaround_needed()#define SIBYTE_1956_WAR 1#else
arch/mips/sibyte/sb1250/setup.c +15 -0
@@ -87,6 +87,21 @@ static int __init setup_bcm1250(void)return ret; } +int sb1250_m3_workaround_needed (void ) +{ +switch (soc_type) { +case K_SYS_SOC_TYPE_BCM1250 : +case K_SYS_SOC_TYPE_BCM1250_ALT : +case K_SYS_SOC_TYPE_BCM1250_ALT2 : +case K_SYS_SOC_TYPE_BCM1125 : +case K_SYS_SOC_TYPE_BCM1125H : +return soc_pass <K_SYS_REVISION_BCM1250_C0 ; + +default : +return 0 ; + } +} +static int __init setup_bcm112x (void ) {int ret =0 ;