2.6.36.2-stable review
Subsystems (103)
cover 2.6.36.2-stable review
This is the start of the stable review cycle for the 2.6.36.2 release. There are 289 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let us know. If anyone is a maintainer of the proper subsystem, and wants to add a Signed-off-by: line to the patch, please respond with it.
Responses should be made by Thursday, December 9, 2010, 20: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.36.2-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Makefile | 2 +- arch/arm/include/asm/assembler.h | 2 +- arch/arm/lib/findbit.S | 6 +- arch/arm/mach-cns3xxx/pcie.c | 2 +- arch/arm/mm/fault-armv.c | 28 +++- arch/arm/plat-omap/dma.c | 50 +++++- arch/arm/plat-omap/include/plat/dma.h | 4 + arch/microblaze/Makefile | 8 +- arch/powerpc/mm/hash_utils_64.c | 2 +- arch/s390/kernel/nmi.c | 10 +- arch/s390/kernel/vtime.c | 19 ++ arch/s390/lib/delay.c | 14 +- arch/sh/include/asm/syscalls_32.h | 7 +- arch/um/drivers/line.c | 5 +- arch/um/kernel/uml.lds.S | 2 +- arch/um/os-Linux/time.c | 2 +- arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 1 + arch/x86/kernel/hw_breakpoint.c | 4 + arch/x86/kvm/svm.c | 2 +- arch/x86/kvm/vmx.c | 19 +- arch/x86/kvm/x86.c | 14 +- arch/x86/xen/enlighten.c | 4 - block/blk-map.c | 2 + block/blk-settings.c | 2 +- block/genhd.c | 6 +- block/scsi_ioctl.c | 34 +++- drivers/acpi/battery.c | 38 ++++- drivers/acpi/bus.c | 7 +- drivers/acpi/debugfs.c | 2 +- drivers/ata/libata-scsi.c | 5 +- drivers/ata/sata_via.c | 9 +- drivers/char/agp/intel-agp.c | 1 + drivers/char/agp/intel-gtt.c | 63 +++---- drivers/char/hpet.c | 17 ++ drivers/char/ipmi/ipmi_si_intf.c | 30 ++- drivers/char/tty_buffer.c | 14 ++- drivers/char/tty_io.c | 13 +- drivers/char/tty_ldisc.c | 51 +++++- drivers/char/vt_ioctl.c | 11 +- drivers/crypto/padlock-aes.c | 2 +- drivers/firewire/ohci.c | 64 +++++-- drivers/gpio/cs5535-gpio.c | 16 ++- drivers/gpu/drm/i915/i915_dma.c | 3 + drivers/gpu/drm/i915/i915_irq.c | 21 ++- drivers/gpu/drm/i915/i915_reg.h | 7 + drivers/gpu/drm/i915/i915_suspend.c | 4 +- drivers/gpu/drm/i915/intel_crt.c | 3 +- drivers/gpu/drm/i915/intel_display.c | 7 + drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_overlay.c | 8 + drivers/gpu/drm/i915/intel_sdvo.c | 8 +- drivers/gpu/drm/radeon/atom.c | 1 + drivers/gpu/drm/radeon/r100.c | 6 + drivers/gpu/drm/radeon/r100_track.h | 1 + drivers/gpu/drm/radeon/r200.c | 2 + drivers/gpu/drm/radeon/r600.c | 15 +- drivers/gpu/drm/radeon/r600_blit_kms.c | 8 +- drivers/gpu/drm/radeon/r600_cs.c | 4 +- drivers/gpu/drm/radeon/r600_reg.h | 1 + drivers/gpu/drm/radeon/radeon_atombios.c | 16 ++ drivers/gpu/drm/radeon/radeon_bios.c | 13 +- drivers/gpu/drm/radeon/radeon_combios.c | 15 ++- drivers/gpu/drm/radeon/radeon_connectors.c | 34 ++++ drivers/gpu/drm/radeon/radeon_encoders.c | 36 +++- drivers/gpu/drm/radeon/radeon_i2c.c | 1 + drivers/gpu/drm/radeon/radeon_object.c | 4 +- drivers/gpu/drm/radeon/radeon_reg.h | 1 + drivers/gpu/drm/radeon/rv770.c | 9 +- drivers/hid/hid-egalax.c | 16 +- drivers/hid/usbhid/hid-quirks.c | 1 - drivers/hwmon/lm85.c | 1 + drivers/i2c/busses/i2c-pca-platform.c | 2 +- drivers/input/serio/i8042-x86ia64io.h | 7 + drivers/isdn/gigaset/bas-gigaset.c | 89 ++++----- drivers/isdn/gigaset/isocdata.c | 8 +- drivers/leds/leds-ss4200.c | 1 + drivers/md/md.c | 6 +- drivers/md/raid1.c | 1 + drivers/media/video/cx23885/cx23885-core.c | 1 + drivers/media/video/gspca/gspca.c | 4 +- drivers/media/video/gspca/sonixj.c | 3 +- drivers/media/video/hdpvr/hdpvr-video.c | 1 + drivers/media/video/msp3400-driver.c | 7 +- drivers/media/video/saa7134/saa7134-cards.c | 24 ++-- drivers/misc/ad525x_dpot-spi.c | 4 +- drivers/misc/sgi-xp/xpc_partition.c | 25 ++- drivers/mmc/core/core.c | 2 +- drivers/net/e1000/e1000_main.c | 12 +- drivers/net/jme.c | 22 ++- drivers/net/pcmcia/pcnet_cs.c | 1 + drivers/net/phy/marvell.c | 35 ++-- drivers/net/r6040.c | 22 ++- drivers/net/r8169.c | 19 +- drivers/net/usb/usbnet.c | 11 + drivers/net/wireless/ath/ath.h | 1 + drivers/net/wireless/ath/ath9k/ar9002_hw.c | 3 + .../net/wireless/ath/ath9k/ar9003_2p2_initvals.h | 191 +++++++++++++------ drivers/net/wireless/ath/ath9k/ar9003_mac.c | 3 +- drivers/net/wireless/ath/ath9k/ar9003_paprd.c | 14 +- drivers/net/wireless/ath/ath9k/ath9k.h | 7 +- drivers/net/wireless/ath/ath9k/beacon.c | 2 +- drivers/net/wireless/ath/ath9k/common.c | 11 + drivers/net/wireless/ath/ath9k/eeprom_9287.c | 2 +- drivers/net/wireless/ath/ath9k/hif_usb.c | 20 ++- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 + drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 2 +- drivers/net/wireless/ath/ath9k/hw.c | 1 + drivers/net/wireless/ath/ath9k/init.c | 40 +++- drivers/net/wireless/ath/ath9k/mac.c | 5 +- drivers/net/wireless/ath/ath9k/main.c | 61 +++++-- drivers/net/wireless/ath/ath9k/rc.c | 8 +- drivers/net/wireless/ath/ath9k/recv.c | 45 +++-- drivers/net/wireless/ath/ath9k/reg.h | 9 +- drivers/net/wireless/ath/ath9k/xmit.c | 112 ++++++------ drivers/net/wireless/b43/sdio.c | 3 + drivers/oprofile/timer_int.c | 13 ++ drivers/pci/pci-sysfs.c | 22 ++- drivers/pci/pci.h | 7 +- drivers/pci/proc.c | 2 +- drivers/pcmcia/soc_common.c | 1 + drivers/platform/x86/wmi.c | 2 +- drivers/pnp/pnpacpi/core.c | 29 +++- drivers/power/olpc_battery.c | 8 +- drivers/scsi/qla2xxx/qla_gbl.h | 1 + drivers/scsi/qla2xxx/qla_init.c | 5 +- drivers/scsi/qla2xxx/qla_os.c | 5 + drivers/serial/mfd.c | 18 +- drivers/ssb/b43_pci_bridge.c | 1 + drivers/staging/asus_oled/asus_oled.c | 8 +- drivers/staging/batman-adv/soft-interface.c | 4 + drivers/staging/frontier/tranzport.c | 2 +- drivers/staging/iio/accel/adis16220_core.c | 2 +- drivers/staging/line6/control.c | 204 ++++++++++---------- drivers/staging/line6/midi.c | 4 +- drivers/staging/line6/pod.c | 32 ++-- drivers/staging/line6/toneport.c | 4 +- drivers/staging/line6/variax.c | 12 +- drivers/staging/rt2860/usb_main_dev.c | 2 + drivers/staging/rtl8187se/r8185b_init.c | 30 ++- drivers/staging/samsung-laptop/samsung-laptop.c | 2 +- drivers/staging/udlfb/udlfb.c | 2 +- drivers/usb/atm/ueagle-atm.c | 7 +- drivers/usb/core/devio.c | 7 +- drivers/usb/gadget/atmel_usba_udc.c | 2 +- drivers/usb/host/ehci-dbg.c | 2 +- drivers/usb/host/ehci-hcd.c | 10 +- drivers/usb/host/ehci-pci.c | 12 ++ drivers/usb/host/ohci-jz4740.c | 2 +- drivers/usb/host/xhci-hub.c | 7 + drivers/usb/host/xhci-mem.c | 168 ++++++++++++++++- drivers/usb/host/xhci-ring.c | 1 - drivers/usb/host/xhci.c | 18 ++ drivers/usb/host/xhci.h | 32 +++ drivers/usb/misc/cypress_cy7c63.c | 6 +- drivers/usb/misc/iowarrior.c | 1 + drivers/usb/misc/sisusbvga/sisusb.c | 1 + drivers/usb/misc/trancevibrator.c | 2 +- drivers/usb/misc/usbled.c | 2 +- drivers/usb/misc/usbsevseg.c | 10 +- drivers/usb/musb/musb_core.c | 1 - drivers/usb/serial/ftdi_sio.c | 4 + drivers/usb/serial/ftdi_sio_ids.h | 11 + drivers/usb/serial/option.c | 2 +- drivers/usb/serial/usb-serial.c | 3 + drivers/usb/storage/sierra_ms.c | 2 +- drivers/video/backlight/backlight.c | 12 +- drivers/video/via/accel.c | 7 +- drivers/video/via/via_i2c.c | 27 +++- drivers/xen/events.c | 2 +- fs/bio.c | 23 ++- fs/cifs/dns_resolve.c | 2 +- fs/cifs/inode.c | 12 +- fs/compat.c | 28 ++-- fs/ecryptfs/inode.c | 11 +- fs/exec.c | 36 +++- fs/ext4/super.c | 1 + fs/fuse/file.c | 10 + fs/hostfs/hostfs.h | 3 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hostfs/hostfs_user.c | 9 +- fs/nfs/file.c | 17 +- fs/nfs/nfs4proc.c | 9 +- fs/nfs/nfs4state.c | 16 +- fs/nfs/pagelist.c | 8 +- fs/pipe.c | 14 ++- fs/proc/base.c | 2 +- fs/reiserfs/ioctl.c | 7 +- fs/reiserfs/xattr_acl.c | 6 +- fs/splice.c | 24 +-- include/linux/binfmts.h | 5 + include/linux/blkdev.h | 4 +- include/linux/gfp.h | 4 +- include/linux/kfifo.h | 7 +- include/linux/netfilter.h | 2 +- include/linux/pci_ids.h | 1 + include/linux/perf_event.h | 1 + include/linux/pipe_fs_i.h | 1 + include/linux/radix-tree.h | 36 ++-- include/linux/socket.h | 2 +- include/linux/tty.h | 1 + include/net/mac80211.h | 16 ++ ipc/compat.c | 6 + ipc/compat_mq.c | 5 + ipc/shm.c | 1 + kernel/exit.c | 9 + kernel/irq/proc.c | 2 +- kernel/latencytop.c | 17 +- kernel/perf_event.c | 22 ++- kernel/pm_qos_params.c | 4 +- kernel/power/hibernate.c | 22 ++- kernel/power/suspend.c | 5 +- kernel/power/user.c | 2 + kernel/sched.c | 12 ++ lib/percpu_counter.c | 1 + lib/radix-tree.c | 83 ++++++--- mm/filemap.c | 29 ++-- mm/hugetlb.c | 8 +- mm/internal.h | 2 +- mm/memcontrol.c | 43 +++-- mm/memory_hotplug.c | 2 +- mm/mempolicy.c | 2 +- mm/mprotect.c | 2 +- mm/nommu.c | 1 + mm/page_alloc.c | 21 ++- net/8021q/vlan_core.c | 3 + net/can/bcm.c | 2 +- net/compat.c | 10 +- net/core/dev.c | 19 ++- net/core/filter.c | 64 ++++--- net/core/iovec.c | 20 +- net/decnet/af_decnet.c | 2 + net/econet/af_econet.c | 91 ++++----- net/irda/iriap.c | 3 +- net/irda/parameters.c | 4 +- net/mac80211/agg-tx.c | 2 + net/mac80211/cfg.c | 5 +- net/mac80211/ibss.c | 1 + net/mac80211/ieee80211_i.h | 2 + net/mac80211/main.c | 3 +- net/mac80211/mesh_plink.c | 17 ++- net/mac80211/mlme.c | 48 +++-- net/mac80211/offchannel.c | 7 + net/mac80211/rate.c | 3 + net/mac80211/rc80211_minstrel_ht.c | 7 +- net/mac80211/status.c | 1 + net/netfilter/nf_conntrack_core.c | 3 +- net/rds/rdma.c | 2 +- net/socket.c | 4 + net/sunrpc/clnt.c | 2 +- net/wireless/chan.c | 51 +++++ net/wireless/nl80211.c | 11 +- net/wireless/reg.c | 2 +- net/wireless/scan.c | 12 +- net/x25/x25_facilities.c | 20 ++- net/x25/x25_in.c | 2 + scripts/kconfig/conf.c | 2 +- sound/core/oss/mixer_oss.c | 12 +- sound/core/oss/pcm_oss.c | 19 +- sound/pci/hda/hda_codec.c | 8 +- sound/pci/hda/hda_codec.h | 1 + sound/pci/hda/hda_intel.c | 25 ++- sound/pci/hda/patch_analog.c | 7 + sound/pci/hda/patch_ca0110.c | 2 +- sound/pci/hda/patch_conexant.c | 1 + sound/pci/hda/patch_realtek.c | 51 +++++- sound/pci/hda/patch_sigmatel.c | 16 ++ sound/pci/intel8x0.c | 6 + sound/soc/codecs/wm8900.c | 6 - sound/soc/codecs/wm8961.c | 4 +- 269 files changed, 2563 insertions(+), 1114 deletions(-)
PATCH 1/289 block: Ensure physical block size is unsigned int
2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Martin K. Petersen <[email protected]>
commit 892b6f90db81cccb723d5d92f4fddc2d68b206e1 upstream.
Physical block size was declared unsigned int to accomodate the maximum size reported by READ CAPACITY(16). Make sure we use the right type in the related functions.
--- block/blk-settings.c | 2 +- include/linux/blkdev.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
block/blk-settings.c +1 -1
@@ -343,7 +343,7 @@ EXPORT_SYMBOL(blk_queue_logical_block_si* hardware can operate on without reverting to read-modify-write * operations. */ -void blk_queue_physical_block_size (struct request_queue *q,unsigned short size) +void blk_queue_physical_block_size (struct request_queue *q,unsigned int size) { q->limits.physical_block_size = size;
include/linux/blkdev.h +2 -2
@@ -851,7 +851,7 @@ extern void blk_queue_max_segment_size(sextern void blk_queue_max_discard_sectors (struct request_queue *q,unsigned int max_discard_sectors);extern void blk_queue_logical_block_size (struct request_queue *,unsigned short ); -extern void blk_queue_physical_block_size (struct request_queue *,unsigned short ); +extern void blk_queue_physical_block_size (struct request_queue *,unsigned int );extern void blk_queue_alignment_offset (struct request_queue *q,unsigned int alignment);extern void blk_limits_io_min (struct queue_limits *limits,unsigned int min);
@@ -1004,7 +1004,7 @@ static inline unsigned int queue_physicareturn q->limits.physical_block_size; } -static inline int bdev_physical_block_size (struct block_device *bdev) +static inline unsigned int bdev_physical_block_size (struct block_device *bdev) {return queue_physical_block_size (bdev_get_queue (bdev)); }
cover 2.6.36.2-stable review
In reply to Greg KHThis is the start of the stable review cycle for the 2.6.36.2 release. There are 289 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let us know. If anyone is a maintainer of the proper subsystem, and wants to add a Signed-off-by: line to the patch, please respond with it.
Responses should be made by Thursday, December 9, 2010, 20: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.36.2-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Makefile | 2 +- arch/arm/include/asm/assembler.h | 2 +- arch/arm/lib/findbit.S | 6 +- arch/arm/mach-cns3xxx/pcie.c | 2 +- arch/arm/mm/fault-armv.c | 28 +++- arch/arm/plat-omap/dma.c | 50 +++++- arch/arm/plat-omap/include/plat/dma.h | 4 + arch/microblaze/Makefile | 8 +- arch/powerpc/mm/hash_utils_64.c | 2 +- arch/s390/kernel/nmi.c | 10 +- arch/s390/kernel/vtime.c | 19 ++ arch/s390/lib/delay.c | 14 +- arch/sh/include/asm/syscalls_32.h | 7 +- arch/um/drivers/line.c | 5 +- arch/um/kernel/uml.lds.S | 2 +- arch/um/os-Linux/time.c | 2 +- arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 1 + arch/x86/kernel/hw_breakpoint.c | 4 + arch/x86/kvm/svm.c | 2 +- arch/x86/kvm/vmx.c | 19 +- arch/x86/kvm/x86.c | 14 +- arch/x86/xen/enlighten.c | 4 - block/blk-map.c | 2 + block/blk-settings.c | 2 +- block/genhd.c | 6 +- block/scsi_ioctl.c | 34 +++- drivers/acpi/battery.c | 38 ++++- drivers/acpi/bus.c | 7 +- drivers/acpi/debugfs.c | 2 +- drivers/ata/libata-scsi.c | 5 +- drivers/ata/sata_via.c | 9 +- drivers/char/agp/intel-agp.c | 1 + drivers/char/agp/intel-gtt.c | 63 +++---- drivers/char/hpet.c | 17 ++ drivers/char/ipmi/ipmi_si_intf.c | 30 ++- drivers/char/tty_buffer.c | 14 ++- drivers/char/tty_io.c | 13 +- drivers/char/tty_ldisc.c | 51 +++++- drivers/char/vt_ioctl.c | 11 +- drivers/crypto/padlock-aes.c | 2 +- drivers/firewire/ohci.c | 64 +++++-- drivers/gpio/cs5535-gpio.c | 16 ++- drivers/gpu/drm/i915/i915_dma.c | 3 + drivers/gpu/drm/i915/i915_irq.c | 21 ++- drivers/gpu/drm/i915/i915_reg.h | 7 + drivers/gpu/drm/i915/i915_suspend.c | 4 +- drivers/gpu/drm/i915/intel_crt.c | 3 +- drivers/gpu/drm/i915/intel_display.c | 7 + drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_overlay.c | 8 + drivers/gpu/drm/i915/intel_sdvo.c | 8 +- drivers/gpu/drm/radeon/atom.c | 1 + drivers/gpu/drm/radeon/r100.c | 6 + drivers/gpu/drm/radeon/r100_track.h | 1 + drivers/gpu/drm/radeon/r200.c | 2 + drivers/gpu/drm/radeon/r600.c | 15 +- drivers/gpu/drm/radeon/r600_blit_kms.c | 8 +- drivers/gpu/drm/radeon/r600_cs.c | 4 +- drivers/gpu/drm/radeon/r600_reg.h | 1 + drivers/gpu/drm/radeon/radeon_atombios.c | 16 ++ drivers/gpu/drm/radeon/radeon_bios.c | 13 +- drivers/gpu/drm/radeon/radeon_combios.c | 15 ++- drivers/gpu/drm/radeon/radeon_connectors.c | 34 ++++ drivers/gpu/drm/radeon/radeon_encoders.c | 36 +++- drivers/gpu/drm/radeon/radeon_i2c.c | 1 + drivers/gpu/drm/radeon/radeon_object.c | 4 +- drivers/gpu/drm/radeon/radeon_reg.h | 1 + drivers/gpu/drm/radeon/rv770.c | 9 +- drivers/hid/hid-egalax.c | 16 +- drivers/hid/usbhid/hid-quirks.c | 1 - drivers/hwmon/lm85.c | 1 + drivers/i2c/busses/i2c-pca-platform.c | 2 +- drivers/input/serio/i8042-x86ia64io.h | 7 + drivers/isdn/gigaset/bas-gigaset.c | 89 ++++----- drivers/isdn/gigaset/isocdata.c | 8 +- drivers/leds/leds-ss4200.c | 1 + drivers/md/md.c | 6 +- drivers/md/raid1.c | 1 + drivers/media/video/cx23885/cx23885-core.c | 1 + drivers/media/video/gspca/gspca.c | 4 +- drivers/media/video/gspca/sonixj.c | 3 +- drivers/media/video/hdpvr/hdpvr-video.c | 1 + drivers/media/video/msp3400-driver.c | 7 +- drivers/media/video/saa7134/saa7134-cards.c | 24 ++-- drivers/misc/ad525x_dpot-spi.c | 4 +- drivers/misc/sgi-xp/xpc_partition.c | 25 ++- drivers/mmc/core/core.c | 2 +- drivers/net/e1000/e1000_main.c | 12 +- drivers/net/jme.c | 22 ++- drivers/net/pcmcia/pcnet_cs.c | 1 + drivers/net/phy/marvell.c | 35 ++-- drivers/net/r6040.c | 22 ++- drivers/net/r8169.c | 19 +- drivers/net/usb/usbnet.c | 11 + drivers/net/wireless/ath/ath.h | 1 + drivers/net/wireless/ath/ath9k/ar9002_hw.c | 3 + .../net/wireless/ath/ath9k/ar9003_2p2_initvals.h | 191 +++++++++++++------ drivers/net/wireless/ath/ath9k/ar9003_mac.c | 3 +- drivers/net/wireless/ath/ath9k/ar9003_paprd.c | 14 +- drivers/net/wireless/ath/ath9k/ath9k.h | 7 +- drivers/net/wireless/ath/ath9k/beacon.c | 2 +- drivers/net/wireless/ath/ath9k/common.c | 11 + drivers/net/wireless/ath/ath9k/eeprom_9287.c | 2 +- drivers/net/wireless/ath/ath9k/hif_usb.c | 20 ++- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 + drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 2 +- drivers/net/wireless/ath/ath9k/hw.c | 1 + drivers/net/wireless/ath/ath9k/init.c | 40 +++- drivers/net/wireless/ath/ath9k/mac.c | 5 +- drivers/net/wireless/ath/ath9k/main.c | 61 +++++-- drivers/net/wireless/ath/ath9k/rc.c | 8 +- drivers/net/wireless/ath/ath9k/recv.c | 45 +++-- drivers/net/wireless/ath/ath9k/reg.h | 9 +- drivers/net/wireless/ath/ath9k/xmit.c | 112 ++++++------ drivers/net/wireless/b43/sdio.c | 3 + drivers/oprofile/timer_int.c | 13 ++ drivers/pci/pci-sysfs.c | 22 ++- drivers/pci/pci.h | 7 +- drivers/pci/proc.c | 2 +- drivers/pcmcia/soc_common.c | 1 + drivers/platform/x86/wmi.c | 2 +- drivers/pnp/pnpacpi/core.c | 29 +++- drivers/power/olpc_battery.c | 8 +- drivers/scsi/qla2xxx/qla_gbl.h | 1 + drivers/scsi/qla2xxx/qla_init.c | 5 +- drivers/scsi/qla2xxx/qla_os.c | 5 + drivers/serial/mfd.c | 18 +- drivers/ssb/b43_pci_bridge.c | 1 + drivers/staging/asus_oled/asus_oled.c | 8 +- drivers/staging/batman-adv/soft-interface.c | 4 + drivers/staging/frontier/tranzport.c | 2 +- drivers/staging/iio/accel/adis16220_core.c | 2 +- drivers/staging/line6/control.c | 204 ++++++++++---------- drivers/staging/line6/midi.c | 4 +- drivers/staging/line6/pod.c | 32 ++-- drivers/staging/line6/toneport.c | 4 +- drivers/staging/line6/variax.c | 12 +- drivers/staging/rt2860/usb_main_dev.c | 2 + drivers/staging/rtl8187se/r8185b_init.c | 30 ++- drivers/staging/samsung-laptop/samsung-laptop.c | 2 +- drivers/staging/udlfb/udlfb.c | 2 +- drivers/usb/atm/ueagle-atm.c | 7 +- drivers/usb/core/devio.c | 7 +- drivers/usb/gadget/atmel_usba_udc.c | 2 +- drivers/usb/host/ehci-dbg.c | 2 +- drivers/usb/host/ehci-hcd.c | 10 +- drivers/usb/host/ehci-pci.c | 12 ++ drivers/usb/host/ohci-jz4740.c | 2 +- drivers/usb/host/xhci-hub.c | 7 + drivers/usb/host/xhci-mem.c | 168 ++++++++++++++++- drivers/usb/host/xhci-ring.c | 1 - drivers/usb/host/xhci.c | 18 ++ drivers/usb/host/xhci.h | 32 +++ drivers/usb/misc/cypress_cy7c63.c | 6 +- drivers/usb/misc/iowarrior.c | 1 + drivers/usb/misc/sisusbvga/sisusb.c | 1 + drivers/usb/misc/trancevibrator.c | 2 +- drivers/usb/misc/usbled.c | 2 +- drivers/usb/misc/usbsevseg.c | 10 +- drivers/usb/musb/musb_core.c | 1 - drivers/usb/serial/ftdi_sio.c | 4 + drivers/usb/serial/ftdi_sio_ids.h | 11 + drivers/usb/serial/option.c | 2 +- drivers/usb/serial/usb-serial.c | 3 + drivers/usb/storage/sierra_ms.c | 2 +- drivers/video/backlight/backlight.c | 12 +- drivers/video/via/accel.c | 7 +- drivers/video/via/via_i2c.c | 27 +++- drivers/xen/events.c | 2 +- fs/bio.c | 23 ++- fs/cifs/dns_resolve.c | 2 +- fs/cifs/inode.c | 12 +- fs/compat.c | 28 ++-- fs/ecryptfs/inode.c | 11 +- fs/exec.c | 36 +++- fs/ext4/super.c | 1 + fs/fuse/file.c | 10 + fs/hostfs/hostfs.h | 3 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hostfs/hostfs_user.c | 9 +- fs/nfs/file.c | 17 +- fs/nfs/nfs4proc.c | 9 +- fs/nfs/nfs4state.c | 16 +- fs/nfs/pagelist.c | 8 +- fs/pipe.c | 14 ++- fs/proc/base.c | 2 +- fs/reiserfs/ioctl.c | 7 +- fs/reiserfs/xattr_acl.c | 6 +- fs/splice.c | 24 +-- include/linux/binfmts.h | 5 + include/linux/blkdev.h | 4 +- include/linux/gfp.h | 4 +- include/linux/kfifo.h | 7 +- include/linux/netfilter.h | 2 +- include/linux/pci_ids.h | 1 + include/linux/perf_event.h | 1 + include/linux/pipe_fs_i.h | 1 + include/linux/radix-tree.h | 36 ++-- include/linux/socket.h | 2 +- include/linux/tty.h | 1 + include/net/mac80211.h | 16 ++ ipc/compat.c | 6 + ipc/compat_mq.c | 5 + ipc/shm.c | 1 + kernel/exit.c | 9 + kernel/irq/proc.c | 2 +- kernel/latencytop.c | 17 +- kernel/perf_event.c | 22 ++- kernel/pm_qos_params.c | 4 +- kernel/power/hibernate.c | 22 ++- kernel/power/suspend.c | 5 +- kernel/power/user.c | 2 + kernel/sched.c | 12 ++ lib/percpu_counter.c | 1 + lib/radix-tree.c | 83 ++++++--- mm/filemap.c | 29 ++-- mm/hugetlb.c | 8 +- mm/internal.h | 2 +- mm/memcontrol.c | 43 +++-- mm/memory_hotplug.c | 2 +- mm/mempolicy.c | 2 +- mm/mprotect.c | 2 +- mm/nommu.c | 1 + mm/page_alloc.c | 21 ++- net/8021q/vlan_core.c | 3 + net/can/bcm.c | 2 +- net/compat.c | 10 +- net/core/dev.c | 19 ++- net/core/filter.c | 64 ++++--- net/core/iovec.c | 20 +- net/decnet/af_decnet.c | 2 + net/econet/af_econet.c | 91 ++++----- net/irda/iriap.c | 3 +- net/irda/parameters.c | 4 +- net/mac80211/agg-tx.c | 2 + net/mac80211/cfg.c | 5 +- net/mac80211/ibss.c | 1 + net/mac80211/ieee80211_i.h | 2 + net/mac80211/main.c | 3 +- net/mac80211/mesh_plink.c | 17 ++- net/mac80211/mlme.c | 48 +++-- net/mac80211/offchannel.c | 7 + net/mac80211/rate.c | 3 + net/mac80211/rc80211_minstrel_ht.c | 7 +- net/mac80211/status.c | 1 + net/netfilter/nf_conntrack_core.c | 3 +- net/rds/rdma.c | 2 +- net/socket.c | 4 + net/sunrpc/clnt.c | 2 +- net/wireless/chan.c | 51 +++++ net/wireless/nl80211.c | 11 +- net/wireless/reg.c | 2 +- net/wireless/scan.c | 12 +- net/x25/x25_facilities.c | 20 ++- net/x25/x25_in.c | 2 + scripts/kconfig/conf.c | 2 +- sound/core/oss/mixer_oss.c | 12 +- sound/core/oss/pcm_oss.c | 19 +- sound/pci/hda/hda_codec.c | 8 +- sound/pci/hda/hda_codec.h | 1 + sound/pci/hda/hda_intel.c | 25 ++- sound/pci/hda/patch_analog.c | 7 + sound/pci/hda/patch_ca0110.c | 2 +- sound/pci/hda/patch_conexant.c | 1 + sound/pci/hda/patch_realtek.c | 51 +++++- sound/pci/hda/patch_sigmatel.c | 16 ++ sound/pci/intel8x0.c | 6 + sound/soc/codecs/wm8900.c | 6 - sound/soc/codecs/wm8961.c | 4 +- 269 files changed, 2563 insertions(+), 1114 deletions(-)
PATCH 2/289 block: Fix race during disk initialization
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jan Kara <[email protected]>
commit 01ea50638bc04ca5259f5711fcdedefcdde1cf43 upstream.
When a new disk is being discovered, add_disk() first ties the bdev to gendisk (via register_disk()->blkdev_get()) and only after that calls bdi_register_bdev(). Because register_disk() also creates disk's kobject, it can happen that userspace manages to open and modify the device's data (or inode) before its BDI is properly initialized leading to a warning in __mark_inode_dirty().
Fix the problem by registering BDI early enough.
This patch addresses https://bugzilla.kernel.org/show_bug.cgi?id=16312
--- block/genhd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
block/genhd.c +4 -2
@@ -541,13 +541,15 @@ void add_disk(struct gendisk *disk) disk->major =MAJOR (devt); disk->first_minor =MINOR (devt); +/* Register BDI before referencing it from bdev */ + bdi = &disk->queue->backing_dev_info; +bdi_register_dev (bdi,disk_devt (disk)); +blk_register_region (disk_devt (disk), disk->minors,NULL , exact_match, exact_lock, disk);register_disk (disk);blk_register_queue (disk); - bdi = &disk->queue->backing_dev_info; -bdi_register_dev (bdi,disk_devt (disk)); retval =sysfs_create_link (&disk_to_dev (disk)->kobj, &bdi->dev->kobj,"bdi" );WARN_ON (retval);
PATCH 3/289 block: limit vec count in bio_kmalloc() and bio_alloc_map_data()
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jens Axboe <[email protected]>
commit f3f63c1c28bc861a931fac283b5bc3585efb8967 upstream.
--- fs/bio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
fs/bio.c +8 -1
@@ -370,6 +370,9 @@ struct bio *bio_kmalloc(gfp_t gfp_mask, {struct bio *bio; +if (nr_iovecs >UIO_MAXIOV ) +return NULL ; + bio =kmalloc (sizeof (struct bio ) + nr_iovecs *sizeof (struct bio_vec ), gfp_mask);if (unlikely (!bio))
@@ -697,8 +700,12 @@ static void bio_free_map_data(struct biostatic struct bio_map_data *bio_alloc_map_data (int nr_segs,int iov_count,gfp_t gfp_mask) { -struct bio_map_data *bmd =kmalloc (sizeof (*bmd), gfp_mask); +struct bio_map_data *bmd; + +if (iov_count >UIO_MAXIOV ) +return NULL ; + bmd =kmalloc (sizeof (*bmd), gfp_mask);if (!bmd)return NULL ;
PATCH 4/289 block: take care not to overflow when calculating total iov length
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jens Axboe <[email protected]>
commit 9f864c80913467312c7b8690e41fb5ebd1b50e92 upstream.
--- block/scsi_ioctl.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-)
block/scsi_ioctl.c +24 -10
@@ -321,33 +321,47 @@ static int sg_io(struct request_queue *qif (hdr->iovec_count) {const int size =sizeof (struct sg_iovec ) * hdr->iovec_count;size_t iov_data_len; -struct sg_iovec *iov; +struct sg_iovec *sg_iov; +struct iovec *iov; +int i; - iov =kmalloc (size,GFP_KERNEL ); -if (!iov) { + sg_iov =kmalloc (size,GFP_KERNEL ); +if (!sg_iov) { ret = -ENOMEM ; goto out; } -if (copy_from_user (iov, hdr->dxferp, size)) { -kfree (iov); +if (copy_from_user (sg_iov, hdr->dxferp, size)) { +kfree (sg_iov); ret = -EFAULT ; goto out; } +/* +* Sum up the vecs, making sure they don't overflow +*/ + iov = (struct iovec *) sg_iov; + iov_data_len =0 ; +for (i =0 ; i < hdr->iovec_count; i++) { +if (iov_data_len + iov[i].iov_len < iov_data_len) { +kfree (sg_iov); + ret = -EINVAL ; + goto out; + } + iov_data_len += iov[i].iov_len; + } +/* SG_IO howto says that the shorter of the two wins */ - iov_data_len =iov_length ((struct iovec *)iov, - hdr->iovec_count);if (hdr->dxfer_len < iov_data_len) { - hdr->iovec_count =iov_shorten ((struct iovec *)iov, + hdr->iovec_count =iov_shorten (iov, hdr->iovec_count, hdr->dxfer_len); iov_data_len = hdr->dxfer_len; } - ret =blk_rq_map_user_iov (q, rq,NULL , iov, hdr->iovec_count, + ret =blk_rq_map_user_iov (q, rq,NULL , sg_iov, hdr->iovec_count, iov_data_len,GFP_KERNEL ); -kfree (iov); +kfree (sg_iov); }else if (hdr->dxfer_len) ret =blk_rq_map_user (q, rq,NULL , hdr->dxferp, hdr->dxfer_len,GFP_KERNEL );
PATCH 5/289 block: check for proper length of iov entries in blk_rq_map_user_iov()
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jens Axboe <[email protected]>
commit 9284bcf4e335e5f18a8bc7b26461c33ab60d0689 upstream.
Ensure that we pass down properly validated iov segments before calling into the mapping or copy functions.
--- block/blk-map.c | 2 ++ 1 file changed, 2 insertions(+)
block/blk-map.c +2 -0
@@ -205,6 +205,8 @@ int blk_rq_map_user_iov(struct request_q unaligned =1 ;break ; } +if (!iov[i].iov_len) +return -EINVAL ; }if (unaligned || (q->dma_pad_mask & len) || map_data)
PATCH 6/289 drm/radeon/kms: dont disable shared encoders on pre-DCE3 display blocks
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit a0ae5864d42b41c411368bd689462bf063c029c8 upstream.
The A/B links aren't independantly useable on these blocks so when we disable the encoders, make sure to only disable the encoder when there is no connector using it.
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=18564
--- drivers/gpu/drm/radeon/radeon_encoders.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/gpu/drm/radeon/radeon_encoders.c +18 -0
@@ -1547,6 +1547,23 @@ static void radeon_atom_encoder_disable(struct radeon_device *rdev = dev->dev_private;struct radeon_encoder *radeon_encoder =to_radeon_encoder (encoder);struct radeon_encoder_atom_dig *dig; + +/* check for pre-DCE3 cards with shared encoders; +* can't really use the links individually, so don't disable +* the encoder if it's in use by another connector +*/ +if (!ASIC_IS_DCE3 (rdev)) { +struct drm_encoder *other_encoder; +struct radeon_encoder *other_radeon_encoder; + +list_for_each_entry (other_encoder, &dev->mode_config.encoder_list, head) { + other_radeon_encoder =to_radeon_encoder (other_encoder); +if ((radeon_encoder->encoder_id == other_radeon_encoder->encoder_id) && +drm_helper_encoder_in_use (other_encoder)) + goto disable_done; + } + } +radeon_atom_encoder_dpms (encoder,DRM_MODE_DPMS_OFF );switch (radeon_encoder->encoder_id) {
@@ -1586,6 +1603,7 @@ static void radeon_atom_encoder_disable(break ; } +disable_done:if (radeon_encoder_is_digital (encoder)) {if (atombios_get_encoder_mode (encoder) ==ATOM_ENCODER_MODE_HDMI )r600_hdmi_disable (encoder);
PATCH 7/289 jme: Fix PHY power-off error
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Guo-Fu Tseng <[email protected]>
commit c8a8684d5cfb0f110a962c93586630c0bf91ebc1 upstream.
Adding phy_on in opposition to phy_off.
--- drivers/net/jme.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
drivers/net/jme.c +18 -4
@@ -1575,6 +1575,16 @@ jme_free_irq(struct jme_adapter *jme) } } +static inline void +jme_phy_on (struct jme_adapter *jme) +{ +u32 bmcr; + + bmcr =jme_mdio_read (jme->dev, jme->mii_if.phy_id,MII_BMCR ); + bmcr &= ~BMCR_PDOWN ; +jme_mdio_write (jme->dev, jme->mii_if.phy_id,MII_BMCR , bmcr); +} +static int jme_open (struct net_device *netdev) {
@@ -1595,10 +1605,12 @@ jme_open(struct net_device *netdev)jme_start_irq (jme); -if (test_bit (JME_FLAG_SSET , &jme->flags)) +if (test_bit (JME_FLAG_SSET , &jme->flags)) { +jme_phy_on (jme);jme_set_settings (netdev, &jme->old_ecmd); -else + }else {jme_reset_phy_processor (jme); + }jme_reset_link (jme);
@@ -3006,10 +3018,12 @@ jme_resume(struct pci_dev *pdev)jme_clear_pm (jme);pci_restore_state (pdev); -if (test_bit (JME_FLAG_SSET , &jme->flags)) +if (test_bit (JME_FLAG_SSET , &jme->flags)) { +jme_phy_on (jme);jme_set_settings (netdev, &jme->old_ecmd); -else + }else {jme_reset_phy_processor (jme); + }jme_start_irq (jme);netif_device_attach (netdev);
PATCH 8/289 irda: Fix parameter extraction stack overflow
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Samuel Ortiz <[email protected]>
commit efc463eb508798da4243625b08c7396462cabf9f upstream.
--- net/irda/parameters.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/irda/parameters.c +3 -1
@@ -298,6 +298,8 @@ static int irda_extract_string(void *sel p.pi = pi;/* In case handler needs to know */ p.pl = buf[1 ];/* Extract length of value */ +if (p.pl >32 ) + p.pl =32 ;IRDA_DEBUG (2 ,"%s(), pi=%#x, pl=%d\n" , __func__, p.pi, p.pl);
@@ -318,7 +320,7 @@ static int irda_extract_string(void *sel (__u8) str[0], (__u8) str[1]);/* Null terminate string */ - str[p.pl+1 ] ='\0' ; + str[p.pl] ='\0' ; p.pv.c = str;/* Handler will need to take a copy */
PATCH 9/289 irda: Fix heap memory corruption in iriap.c
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Samuel Ortiz <[email protected]>
commit 37f9fc452d138dfc4da2ee1ce5ae85094efc3606 upstream.
While parsing the GetValuebyClass command frame, we could potentially write passed the skb->data pointer.
--- net/irda/iriap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/irda/iriap.c +2 -1
@@ -502,7 +502,8 @@ static void iriap_getvaluebyclass_confirIRDA_DEBUG (4 ,"%s(), strlen=%d\n" , __func__, value_len);/* Make sure the string is null-terminated */ - fp[n+value_len] =0x00 ; +if (n + value_len < skb->len) + fp[n + value_len] =0x00 ;IRDA_DEBUG (4 ,"Got string %s\n" , fp+n);/* Will truncate to IAS_MAX_STRING bytes */
PATCH 10/289 r6040: Fix multicast filter some more
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Hutchings <[email protected]>
commit e2269308359d5863b6aa1fcb95a425a2ab255f1f upstream.
This code has been broken forever, but in several different and creative ways.
So far as I can work out, the R6040 MAC filter has 4 exact-match entries, the first of which the driver uses for its assigned unicast address, plus a 64-entry hash-based filter for multicast addresses (maybe unicast as well?).
The original version of this code would write the first 4 multicast addresses as exact-match entries from offset 1 (bug #1: there is no entry 4 so this could write to some PHY registers). It would fill the remainder of the exact-match entries with the broadcast address (bug #2:
this would overwrite the last used entry). If more than 4 multicast addresses were configured, it would set up the hash table, write some random crap to the MAC control register (bug #3) and finally walk off the end of the list when filling the exact-match entries (bug #4).
All of this seems to be pointless, since it sets the promiscuous bit when the interface is made promiscuous or if >4 multicast addresses are enabled, and never clears it (bug #5, masking bug #2).
The recent(ish) changes to the multicast list fixed bug #4, but completely removed the limit on iteration over the exact-match entries (bug #6).
Bug #4 was reported as
<https://bugzilla.kernel.org/show_bug.cgi?id=15355> and more recently as <http://bugs.debian.org/600155>. Florian Fainelli attempted to fix these in commit 3bcf8229a8c49769e48d3e0bd1e20d8e003f8106, but that actually dealt with bugs #1-3, bug #4 having been fixed in mainline at that point.
That commit fixes the most important current bug #6.
--- drivers/net/r6040.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
drivers/net/r6040.c +12 -10
@@ -893,16 +893,18 @@ static void r6040_multicast_list(struct/* Multicast Address 1~4 case */ i =0 ;netdev_for_each_mc_addr (ha, dev) { -if (i <MCAST_MAX ) { - adrp = (u16 *) ha->addr; -iowrite16 (adrp[0 ], ioaddr +MID_1L +8 * i); -iowrite16 (adrp[1 ], ioaddr +MID_1M +8 * i); -iowrite16 (adrp[2 ], ioaddr +MID_1H +8 * i); - }else { -iowrite16 (0xffff , ioaddr +MID_1L +8 * i); -iowrite16 (0xffff , ioaddr +MID_1M +8 * i); -iowrite16 (0xffff , ioaddr +MID_1H +8 * i); - } +if (i >=MCAST_MAX ) +break ; + adrp = (u16 *) ha->addr; +iowrite16 (adrp[0 ], ioaddr +MID_1L +8 * i); +iowrite16 (adrp[1 ], ioaddr +MID_1M +8 * i); +iowrite16 (adrp[2 ], ioaddr +MID_1H +8 * i); + i++; + } +while (i <MCAST_MAX ) { +iowrite16 (0xffff , ioaddr +MID_1L +8 * i); +iowrite16 (0xffff , ioaddr +MID_1M +8 * i); +iowrite16 (0xffff , ioaddr +MID_1H +8 * i); i++; } }
PATCH 11/289 drm/radeon/kms: fix 2D tile height alignment in the r600 CS checker
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit 354da653233898ed1e51f20cebac9705456bf9b1 upstream.
macro tile heights are aligned to num channels, not num banks.
Noticed by Dave Airlie.
--- drivers/gpu/drm/radeon/r600_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/r600_cs.c +2 -2
@@ -228,7 +228,7 @@ static inline int r600_cs_track_validate __func__, __LINE__, pitch);return -EINVAL ; } -if (!IS_ALIGNED ((height /8 ), track->nbanks)) { +if (!IS_ALIGNED ((height /8 ), track->npipes)) {dev_warn (p->dev,"%s:%d cb height (%d) invalid\n" , __func__, __LINE__, height);return -EINVAL ;
@@ -367,7 +367,7 @@ static int r600_cs_track_check(struct ra __func__, __LINE__, pitch);return -EINVAL ; } -if ((height /8 ) & (track->nbanks -1 )) { +if (!IS_ALIGNED ((height /8 ), track->npipes)) {dev_warn (p->dev,"%s:%d db height (%d) invalid\n" , __func__, __LINE__, height);return -EINVAL ;
PATCH 12/289 ath9k: built-in rate control A-MPDU fix
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: =?UTF-8?q?Bj=C3=B6rn=20Smedman?= <[email protected]>
commit a8909cfb1832ac623142898df2a9374722cfe68f upstream.
This patch attempts to ensure that ath9k's built-in rate control algorithm does not rely on the value of the ampdu_len and ampdu_ack_len tx status fields unless the IEEE80211_TX_STAT_AMPDU flag is set.
This patch has not been tested.
--- drivers/net/wireless/ath/ath9k/rc.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wireless/ath/ath9k/rc.c +6 -0
@@ -1359,6 +1359,12 @@ static void ath_tx_status(void *priv, stif (tx_info->flags &IEEE80211_TX_STAT_TX_FILTERED )return ; +if (!(tx_info->flags &IEEE80211_TX_STAT_AMPDU )) { + tx_info->status.ampdu_ack_len = + (tx_info->flags &IEEE80211_TX_STAT_ACK ?1 :0 ); + tx_info->status.ampdu_len =1 ; + } +/* * If an underrun error is seen assume it as an excessive retry only * if max frame trigger level has been reached (2 KB for singel stream,
PATCH 13/289 ath9k: fix channel flag / regd issues with multiple cards
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Felix Fietkau <[email protected]>
commit f209f5298217cf54cd5a9163e18b08d093faf8d9 upstream.
Since the regulatory code touches the channel array, it needs to be copied for each device instance. That way the original channel array can also be made const.
--- drivers/net/wireless/ath/ath9k/init.c | 37 ++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath9k/init.c +31 -6
@@ -56,7 +56,7 @@ MODULE_PARM_DESC(blink, "Enable LED blin* on 5 MHz steps, we support the channels which we know * we have calibration data for all cards though to make * this static */ -static struct ieee80211_channel ath9k_2ghz_chantable[] = { +static const struct ieee80211_channel ath9k_2ghz_chantable[] = {CHAN2G (2412 ,0 ),/* Channel 1 */ CHAN2G (2417 ,1 ),/* Channel 2 */ CHAN2G (2422 ,2 ),/* Channel 3 */
@@ -77,7 +77,7 @@ static struct ieee80211_channel ath9k_2g* on 5 MHz steps, we support the channels which we know * we have calibration data for all cards though to make * this static */ -static struct ieee80211_channel ath9k_5ghz_chantable[] = { +static const struct ieee80211_channel ath9k_5ghz_chantable[] = {/* _We_ call this UNII 1 */ CHAN5G (5180 ,14 ),/* Channel 36 */ CHAN5G (5200 ,15 ),/* Channel 40 */
@@ -477,10 +477,17 @@ err:return -EIO ; } -static void ath9k_init_channels_rates (struct ath_softc *sc) +static int ath9k_init_channels_rates (struct ath_softc *sc) { +void *channels; +if (test_bit (ATH9K_MODE_11G , sc->sc_ah->caps.wireless_modes)) { - sc->sbands[IEEE80211_BAND_2GHZ ].channels = ath9k_2ghz_chantable; + channels =kmemdup (ath9k_2ghz_chantable, +sizeof (ath9k_2ghz_chantable),GFP_KERNEL ); +if (!channels) +return -ENOMEM ; + + sc->sbands[IEEE80211_BAND_2GHZ ].channels = channels; sc->sbands[IEEE80211_BAND_2GHZ ].band =IEEE80211_BAND_2GHZ ; sc->sbands[IEEE80211_BAND_2GHZ ].n_channels =ARRAY_SIZE (ath9k_2ghz_chantable);
@@ -490,7 +497,15 @@ static void ath9k_init_channels_rates(st }if (test_bit (ATH9K_MODE_11A , sc->sc_ah->caps.wireless_modes)) { - sc->sbands[IEEE80211_BAND_5GHZ ].channels = ath9k_5ghz_chantable; + channels =kmemdup (ath9k_5ghz_chantable, +sizeof (ath9k_5ghz_chantable),GFP_KERNEL ); +if (!channels) { +if (sc->sbands[IEEE80211_BAND_2GHZ ].channels) +kfree (sc->sbands[IEEE80211_BAND_2GHZ ].channels); +return -ENOMEM ; + } + + sc->sbands[IEEE80211_BAND_5GHZ ].channels = channels; sc->sbands[IEEE80211_BAND_5GHZ ].band =IEEE80211_BAND_5GHZ ; sc->sbands[IEEE80211_BAND_5GHZ ].n_channels =ARRAY_SIZE (ath9k_5ghz_chantable);
@@ -499,6 +514,7 @@ static void ath9k_init_channels_rates(st sc->sbands[IEEE80211_BAND_5GHZ ].n_bitrates =ARRAY_SIZE (ath9k_legacy_rates) -4 ; } +return 0 ; }static void ath9k_init_misc (struct ath_softc *sc)
@@ -593,8 +609,11 @@ static int ath9k_init_softc(u16 devid, sif (ret) goto err_btcoex; + ret =ath9k_init_channels_rates (sc); +if (ret) + goto err_btcoex; +ath9k_init_crypto (sc); -ath9k_init_channels_rates (sc);ath9k_init_misc (sc);return 0 ;
@@ -751,6 +770,12 @@ static void ath9k_deinit_softc(struct at {int i =0 ; +if (sc->sbands[IEEE80211_BAND_2GHZ ].channels) +kfree (sc->sbands[IEEE80211_BAND_2GHZ ].channels); + +if (sc->sbands[IEEE80211_BAND_5GHZ ].channels) +kfree (sc->sbands[IEEE80211_BAND_5GHZ ].channels); +if ((sc->btcoex.no_stomp_timer) && sc->sc_ah->btcoex_hw.scheme ==ATH_BTCOEX_CFG_3WIRE )ath_gen_timer_free (sc->sc_ah, sc->btcoex.no_stomp_timer);
PATCH 14/289 ath9k: A-MPDU rate control info fix
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: =?UTF-8?q?Bj=C3=B6rn=20Smedman?= <[email protected]>
commit ebd022873aa61937603d2c4dfea19ce63ea1a3c8 upstream.
This patch fixes the following problems with the rate control feedback generated by ath9k for A-MPDU frames:
1. Rate control feedback is carried on the first frame of an aggregate that is either ACKed, or has execeeded the software retry count and is considered failed. However, ath9k would incorrectly assume the aggregate had the length 1 if one of these conditions did not apply to the first frame of the aggregate, but instead a later frame. This fix therefor copies the bf_nframes field of the buffer in the same manner as the rates field of the tx status.
2. Sometimes the ampdu_len and ampdu_ack_len fields of the tx status was left uninitialized eventhough the IEEE80211_TX_STAT_AMPDU flag was set. This is now avoid by setting flag and fields in the same place.
3. Even if a frame has been selected for aggregation by mac80211 and marked with the IEEE80211_TX_CTL_AMPDU flag it can sometimes happen that ath9k transmits the frame without aggregation. In these cases the ampdu_ack_len field could be incorrectly computed because the nbad parameter to ath_tx_rc_status was incorrect.
--- drivers/net/wireless/ath/ath9k/xmit.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath9k/xmit.c +13 -6
@@ -312,6 +312,7 @@ static void ath_tx_complete_aggr(structint isaggr, txfail, txpending, sendbar =0 , needreset =0 , nbad =0 ;bool rc_update = true;struct ieee80211_tx_rate rates[4 ]; +int nframes; skb = bf->bf_mpdu; hdr = (struct ieee80211_hdr *)skb->data;
@@ -320,6 +321,7 @@ static void ath_tx_complete_aggr(struct hw = bf->aphy->hw;memcpy (rates, tx_info->control.rates,sizeof (rates)); + nframes = bf->bf_nframes;rcu_read_lock ();
@@ -337,7 +339,7 @@ static void ath_tx_complete_aggr(struct !bf->bf_stale || bf_next != NULL)list_move_tail (&bf->list, &bf_head); -ath_tx_rc_status (bf, ts,0 ,0 , false); +ath_tx_rc_status (bf, ts,1 ,0 , false);ath_tx_complete_buf (sc, bf, txq, &bf_head, ts,0 ,0 );
@@ -442,6 +444,7 @@ static void ath_tx_complete_aggr(structif (rc_update && (acked_cnt ==1 || txfail_cnt ==1 )) {memcpy (tx_info->control.rates, rates,sizeof (rates)); + bf->bf_nframes = nframes;ath_tx_rc_status (bf, ts, nbad, txok, true); rc_update = false; }else {
@@ -2024,9 +2027,15 @@ static void ath_tx_rc_status(struct ath_if (ts->ts_status &ATH9K_TXERR_FILT ) tx_info->flags |=IEEE80211_TX_STAT_TX_FILTERED ; -if ((tx_info->flags &IEEE80211_TX_CTL_AMPDU ) && update_rc) +if ((tx_info->flags &IEEE80211_TX_CTL_AMPDU ) && update_rc) { tx_info->flags |=IEEE80211_TX_STAT_AMPDU ; +BUG_ON (nbad > bf->bf_nframes); + + tx_info->status.ampdu_len = bf->bf_nframes; + tx_info->status.ampdu_ack_len = bf->bf_nframes - nbad; + } +if ((ts->ts_status &ATH9K_TXERR_FILT ) ==0 && (bf->bf_flags &ATH9K_TXDESC_NOACK ) ==0 && update_rc) {if (ieee80211_is_data (hdr->frame_control)) {
@@ -2036,8 +2045,6 @@ static void ath_tx_rc_status(struct ath_if ((ts->ts_status &ATH9K_TXERR_XRETRY ) || (ts->ts_status &ATH9K_TXERR_FIFO )) tx_info->pad[0 ] |=ATH_TX_INFO_XRETRY ; - tx_info->status.ampdu_len = bf->bf_nframes; - tx_info->status.ampdu_ack_len = bf->bf_nframes - nbad; } }
@@ -2159,7 +2166,7 @@ static void ath_tx_processq(struct ath_s*/ if (ts.ts_status &ATH9K_TXERR_XRETRY ) bf->bf_state.bf_type |=BUF_XRETRY ; -ath_tx_rc_status (bf, &ts,0 , txok, true); +ath_tx_rc_status (bf, &ts, txok ?0 :1 , txok, true); }if (bf_isampdu (bf))
@@ -2288,7 +2295,7 @@ void ath_tx_edma_tasklet(struct ath_softif (!bf_isampdu (bf)) {if (txs.ts_status &ATH9K_TXERR_XRETRY ) bf->bf_state.bf_type |=BUF_XRETRY ; -ath_tx_rc_status (bf, &txs,0 , txok, true); +ath_tx_rc_status (bf, &txs, txok ?0 :1 , txok, true); }if (bf_isampdu (bf))
PATCH 15/289 ath9k: Fix tx struck state with paprd
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vasanthakumar Thiagarajan <[email protected]>
commit 9094537c3a9ef9e127e844254a74186735c9a90b upstream.
Paprd needs to be done only on active chains(not for all the chains that hw can support). The paprd training frames which are sent for inactive chains would be hanging on the hw queue without getting transmitted and would make the connection so unstable. This issue happens only with the hw which supports paprd cal(ar9003).
--- drivers/net/wireless/ath/ath9k/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +4 -2
@@ -269,6 +269,7 @@ static void ath_paprd_activate(struct at {struct ath_hw *ah = sc->sc_ah;struct ath9k_hw_cal_data *caldata = ah->caldata; +struct ath_common *common =ath9k_hw_common (ah);int chain;if (!caldata || !caldata->paprd_done)
@@ -277,7 +278,7 @@ static void ath_paprd_activate(struct atath9k_ps_wakeup (sc);ar9003_paprd_enable (ah, false);for (chain =0 ; chain <AR9300_MAX_CHAINS ; chain++) { -if (!(ah->caps.tx_chainmask &BIT (chain))) +if (!(common->tx_chainmask &BIT (chain)))continue ;ar9003_paprd_populate_single_table (ah, caldata, chain);
@@ -299,6 +300,7 @@ void ath_paprd_calibrate(struct work_strstruct ieee80211_supported_band *sband = &sc->sbands[band];struct ath_tx_control txctl;struct ath9k_hw_cal_data *caldata = ah->caldata; +struct ath_common *common =ath9k_hw_common (ah);int qnum, ftype;int chain_ok =0 ;int chain;
@@ -332,7 +334,7 @@ void ath_paprd_calibrate(struct work_strath9k_ps_wakeup (sc);ar9003_paprd_init_table (ah);for (chain =0 ; chain <AR9300_MAX_CHAINS ; chain++) { -if (!(ah->caps.tx_chainmask &BIT (chain))) +if (!(common->tx_chainmask &BIT (chain)))continue ; chain_ok =0 ;
PATCH 16/289 ath9k: clean up / fix aggregation session flush
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Felix Fietkau <[email protected]>
commit 90fa539ca3f07323da5a90f5c8f4e5cd952875e7 upstream.
The tid aggregation cleanup is a bit fragile, as it discards failed subframes in some places, and retransmits them in others. This could block the cleanup of an existing aggregation session, if a retransmission for a tid is issued, yet the tid is never scheduled again because of the cleanup state.
Fix this by getting rid of as many subframes as possible, as early as possible, and immediately transmitting pending subframes as regular HT frames instead of waiting for the cleanup to complete.
Drop all pending subframes while keeping track of the Block ACK window during aggregate tx completion to prevent sending out stale subframes, which could confuse the receiver side.
--- drivers/net/wireless/ath/ath9k/xmit.c | 63 ++++++++++++++-------------------- 1 file changed, 26 insertions(+), 37 deletions(-)
drivers/net/wireless/ath/ath9k/xmit.c +26 -37
@@ -61,6 +61,8 @@ static int ath_tx_num_badfrms(struct ath struct ath_tx_status *ts, int txok);static void ath_tx_rc_status (struct ath_buf *bf,struct ath_tx_status *ts,int nbad,int txok,bool update_rc); +static void ath_tx_update_baw (struct ath_softc *sc,struct ath_atx_tid *tid, +int seqno);enum {MCS_HT20 ,
@@ -143,18 +145,23 @@ static void ath_tx_flush_tid(struct ath_struct ath_txq *txq = &sc->tx.txq[tid->ac->qnum];struct ath_buf *bf;struct list_head bf_head; -INIT_LIST_HEAD (&bf_head); +struct ath_tx_status ts; -WARN_ON (!tid->paused); +INIT_LIST_HEAD (&bf_head); +memset (&ts,0 ,sizeof (ts));spin_lock_bh (&txq->axq_lock); - tid->paused = false;while (!list_empty (&tid->buf_q)) { bf = list_first_entry(&tid->buf_q, struct ath_buf, list); -BUG_ON (bf_isretried (bf));list_move_tail (&bf->list, &bf_head); -ath_tx_send_ht_normal (sc, txq, tid, &bf_head); + +if (bf_isretried (bf)) { +ath_tx_update_baw (sc, tid, bf->bf_seqno); +ath_tx_complete_buf (sc, bf, txq, &bf_head, &ts,0 ,0 ); + }else { +ath_tx_send_ht_normal (sc, txq, tid, &bf_head); + } }spin_unlock_bh (&txq->axq_lock);
@@ -433,7 +440,7 @@ static void ath_tx_complete_aggr(structlist_move_tail (&bf->list, &bf_head); } -if (!txpending) { +if (!txpending || (tid->state &AGGR_CLEANUP )) {/* * complete the acked-ones/xretried ones; update * block-ack window
@@ -513,15 +520,12 @@ static void ath_tx_complete_aggr(struct }if (tid->state &AGGR_CLEANUP ) { +ath_tx_flush_tid (sc, tid); +if (tid->baw_head == tid->baw_tail) { tid->state &= ~AGGR_ADDBA_COMPLETE ; tid->state &= ~AGGR_CLEANUP ; - -/* send buffered frames as singles */ -ath_tx_flush_tid (sc, tid); } -rcu_read_unlock (); -return ; }rcu_read_unlock ();
@@ -806,12 +810,6 @@ void ath_tx_aggr_stop(struct ath_softc *struct ath_node *an = (struct ath_node *)sta->drv_priv;struct ath_atx_tid *txtid =ATH_AN_2_TID (an, tid);struct ath_txq *txq = &sc->tx.txq[txtid->ac->qnum]; -struct ath_tx_status ts; -struct ath_buf *bf; -struct list_head bf_head; - -memset (&ts,0 ,sizeof (ts)); -INIT_LIST_HEAD (&bf_head);if (txtid->state &AGGR_CLEANUP )return ;
@@ -821,31 +819,22 @@ void ath_tx_aggr_stop(struct ath_softc *return ; } -/* drop all software retried frames and mark this TID */ spin_lock_bh (&txq->axq_lock); txtid->paused = true; -while (!list_empty (&txtid->buf_q)) { - bf = list_first_entry(&txtid->buf_q, struct ath_buf, list); -if (!bf_isretried (bf)) { -/* -* NB: it's based on the assumption that -* software retried frame will always stay -* at the head of software queue. -*/ -break ; - } -list_move_tail (&bf->list, &bf_head); -ath_tx_update_baw (sc, txtid, bf->bf_seqno); -ath_tx_complete_buf (sc, bf, txq, &bf_head, &ts,0 ,0 ); - } -spin_unlock_bh (&txq->axq_lock); -if (txtid->baw_head != txtid->baw_tail) { +/* +* If frames are still being transmitted for this TID, they will be +* cleaned up during tx completion. To prevent race conditions, this +* TID can only be reused after all in-progress subframes have been +* completed. +*/ +if (txtid->baw_head != txtid->baw_tail) txtid->state |=AGGR_CLEANUP ; - }else { +else txtid->state &= ~AGGR_ADDBA_COMPLETE ; -ath_tx_flush_tid (sc, txtid); - } +spin_unlock_bh (&txq->axq_lock); + +ath_tx_flush_tid (sc, txtid); }void ath_tx_aggr_resume (struct ath_softc *sc,struct ieee80211_sta *sta,u16 tid)
PATCH 17/289 ath9k: fix power save race conditions
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit 8ab2cd09fecc8819bbaee2d0fd8f3a092d866ce3 upstream.
ath9k has a race on putting the chip into network sleep and having registers read from hardware. The race occurs because although ath9k_ps_restore() locks its own callers it makes use of some variables which get altered in the driver at different code paths. The variables are the ps_enabled and ps_flags.
This is easily reprodicible in large network environments when roaming with the wpa_supplicant simple bgscan. You'd get some 0xdeadbeef read out on certain registers such as:
ath: timeout (100000 us) on reg 0x806c: 0xdeadbeef & 0x01f00000 != 0x00000000
ath: RX failed to go idle in 10 ms RXSM=0xdeadbeef
ath: timeout (100000 us) on reg 0x7000: 0xdeadbeef & 0x00000003 != 0x00000000
ath: Chip reset failed
The fix is to protect the ath9k_config(hw, IEEE80211_CONF_CHANGE_PS) calls with a spin_lock_irqsave() which will disable contendors for these variables from interrupt context, timers, re-entry from mac80211 on the same callback, and most importantly from ath9k_ps_restore() which is the only call which will put the device into network sleep.
There are quite a few threads and bug reports on these a few of them are:
https://bugs.launchpad.net/ubuntu/karmic/+source/linux/+bug/407040
http://code.google.com/p/chromium-os/issues/detail?id=5709
http://code.google.com/p/chromium-os/issues/detail?id=5943
Stable fixes apply to [2.6.32+]
--- drivers/net/wireless/ath/ath9k/main.c | 5 ++++- drivers/net/wireless/ath/ath9k/recv.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/main.c +4 -1
@@ -1558,6 +1558,8 @@ static int ath9k_config(struct ieee80211* IEEE80211_CONF_CHANGE_PS is only passed by mac80211 for STA mode. */ if (changed &IEEE80211_CONF_CHANGE_PS ) { +unsigned long flags; +spin_lock_irqsave (&sc->sc_pm_lock, flags);if (conf->flags &IEEE80211_CONF_PS ) { sc->ps_flags |=PS_ENABLED ;/*
@@ -1572,7 +1574,7 @@ static int ath9k_config(struct ieee80211 sc->ps_enabled = false; sc->ps_flags &= ~(PS_ENABLED |PS_NULLFUNC_COMPLETED ); -ath9k_setpower (sc,ATH9K_PM_AWAKE ); +ath9k_hw_setpower (sc->sc_ah,ATH9K_PM_AWAKE );if (!(ah->caps.hw_caps &ATH9K_HW_CAP_AUTOSLEEP )) {ath9k_hw_setrxabort (sc->sc_ah,0 );
@@ -1587,6 +1589,7 @@ static int ath9k_config(struct ieee80211 } } } +spin_unlock_irqrestore (&sc->sc_pm_lock, flags); }if (changed &IEEE80211_CONF_CHANGE_MONITOR ) {
drivers/net/wireless/ath/ath9k/recv.c +3 -0
@@ -1096,6 +1096,7 @@ int ath_rx_tasklet(struct ath_softc *sc,u8 rx_status_len = ah->caps.rx_status_len;u64 tsf =0 ;u32 tsf_lower =0 ; +unsigned long flags;if (edma) dma_type =DMA_BIDIRECTIONAL ;
@@ -1204,11 +1205,13 @@ int ath_rx_tasklet(struct ath_softc *sc, sc->rx.rxotherant =0 ; } +spin_lock_irqsave (&sc->sc_pm_lock, flags);if (unlikely (ath9k_check_auto_sleep (sc) || (sc->ps_flags & (PS_WAIT_FOR_BEACON |PS_WAIT_FOR_CAB |PS_WAIT_FOR_PSPOLL_DATA ))))ath_rx_ps (sc, skb); +spin_unlock_irqrestore (&sc->sc_pm_lock, flags);ath_rx_send_to_mac80211 (hw, sc, skb, rxs);
PATCH 18/289 ath9k: fix an aggregation start related race condition
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Felix Fietkau <[email protected]>
commit 231c3a1f0630c07a584905507a1cb7b705a56ab7 upstream.
A new aggregation session start can be issued by mac80211, even when the cleanup of the previous session has not completed yet. Since the data structure for the session is not recreated, this could corrupt the block ack window and lock up the aggregation session. Fix this by delaying the new session until the old one has been cleaned up.
--- drivers/net/wireless/ath/ath9k/ath9k.h | 4 ++-- drivers/net/wireless/ath/ath9k/main.c | 5 +++-- drivers/net/wireless/ath/ath9k/xmit.c | 10 ++++++++-- 3 files changed, 13 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +2 -2
@@ -346,8 +346,8 @@ void ath_tx_tasklet(struct ath_softc *scvoid ath_tx_edma_tasklet (struct ath_softc *sc);void ath_tx_cabq (struct ieee80211_hw *hw,struct sk_buff *skb);bool ath_tx_aggr_check (struct ath_softc *sc,struct ath_node *an,u8 tidno); -void ath_tx_aggr_start (struct ath_softc *sc,struct ieee80211_sta *sta, -u16 tid,u16 *ssn); +int ath_tx_aggr_start (struct ath_softc *sc,struct ieee80211_sta *sta, +u16 tid,u16 *ssn);void ath_tx_aggr_stop (struct ath_softc *sc,struct ieee80211_sta *sta,u16 tid);void ath_tx_aggr_resume (struct ath_softc *sc,struct ieee80211_sta *sta,u16 tid);void ath9k_enable_ps (struct ath_softc *sc);
drivers/net/wireless/ath/ath9k/main.c +3 -2
@@ -1973,8 +1973,9 @@ static int ath9k_ampdu_action(struct ieebreak ;case IEEE80211_AMPDU_TX_START :ath9k_ps_wakeup (sc); -ath_tx_aggr_start (sc, sta, tid, ssn); -ieee80211_start_tx_ba_cb_irqsafe (vif, sta->addr, tid); + ret =ath_tx_aggr_start (sc, sta, tid, ssn); +if (!ret) +ieee80211_start_tx_ba_cb_irqsafe (vif, sta->addr, tid);ath9k_ps_restore (sc);break ;case IEEE80211_AMPDU_TX_STOP :
drivers/net/wireless/ath/ath9k/xmit.c +8 -2
@@ -792,17 +792,23 @@ static void ath_tx_sched_aggr(struct ath status != ATH_AGGR_BAW_CLOSED); } -void ath_tx_aggr_start (struct ath_softc *sc,struct ieee80211_sta *sta, -u16 tid,u16 *ssn) +int ath_tx_aggr_start (struct ath_softc *sc,struct ieee80211_sta *sta, +u16 tid,u16 *ssn) {struct ath_atx_tid *txtid;struct ath_node *an; an = (struct ath_node *)sta->drv_priv; txtid =ATH_AN_2_TID (an, tid); + +if (txtid->state & (AGGR_CLEANUP |AGGR_ADDBA_COMPLETE )) +return -EAGAIN ; + txtid->state |=AGGR_ADDBA_PROGRESS ; txtid->paused = true; *ssn = txtid->seq_start; + +return 0 ; }void ath_tx_aggr_stop (struct ath_softc *sc,struct ieee80211_sta *sta,u16 tid)
PATCH 19/289 ath9k: fix regression which prevents chip sleep after CAB data
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Senthil Balasubramanian <[email protected]>
commit 3fac6dfdcd2b893c22b20a03dd1bf1af8b627c4b upstream.
The patch:
commit 293dc5dfdbcc16cde06e40a688394cc8ab083e48
Author: Gabor Juhos <[email protected]> Date: Fri Jun 19 12:17:48 2009 +0200
ath9k: remove ath_rx_ps_back_to_sleep helper
This helper only clears the SC_OP_WAIT_FOR_{BEACON,CAB} flags. Remove it and clear these flags directly in the approptiate places instead.
Changes-licensed-under: ISC
introduced a regression which forgot to lift the beacon flag after we received all broadcast and multicast data. This meant we never went to sleep consuming about ~650mW on idle. This pretty much broke power save completely.
This patch has fixes for stable kernels [2.6.32+].
--- drivers/net/wireless/ath/ath9k/recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/recv.c +1 -1
@@ -631,7 +631,7 @@ static void ath_rx_ps(struct ath_softc ** No more broadcast/multicast frames to be received at this * point. */ - sc->ps_flags &= ~PS_WAIT_FOR_CAB ; + sc->ps_flags &= ~(PS_WAIT_FOR_CAB |PS_WAIT_FOR_BEACON );ath_print (common,ATH_DBG_PS ,"All PS CAB frames received, back to sleep\n" ); } else if ((sc->ps_flags & PS_WAIT_FOR_PSPOLL_DATA) &&
PATCH 20/289 ath9k_hw: handle rx key miss
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Felix Fietkau <[email protected]>
commit 3ae74c33c4f799f6bf6d67240a94a0814a8f1944 upstream.
If AR_KeyMiss is set in the rx descriptor and AR_RxFrameOK is unset, the hardware could not locate a valid key during a decryption attempt.
In this case, the frame must not be reported as decrypted, otherwise mac80211 sees only random garbage.
--- drivers/net/wireless/ath/ath9k/ar9003_mac.c | 3 ++- drivers/net/wireless/ath/ath9k/mac.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/ar9003_mac.c +2 -1
@@ -616,7 +616,8 @@ int ath9k_hw_process_rxdesc_edma(struct rxs->rs_status |=ATH9K_RXERR_DECRYPT ; }else if (rxsp->status11 & AR_MichaelErr) { rxs->rs_status |=ATH9K_RXERR_MIC ; - } + }else if (rxsp->status11 & AR_KeyMiss) + rxs->rs_status |=ATH9K_RXERR_DECRYPT ; }return 0 ;
drivers/net/wireless/ath/ath9k/mac.c +2 -0
@@ -713,6 +713,8 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a rs->rs_status |=ATH9K_RXERR_DECRYPT ; else if (ads.ds_rxstatus8 & AR_MichaelErr) rs->rs_status |= ATH9K_RXERR_MIC; + else if (ads.ds_rxstatus8 & AR_KeyMiss) + rs->rs_status |= ATH9K_RXERR_DECRYPT; }return 0 ;
PATCH 21/289 ath9k: fix regression which disabled ps on ath9k
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit 008443def34db1dcc8016763587a288254ea5735 upstream.
The patch titled "ath9k: Add new file init.c" shuffled some code around but in dong so for some reason also removed the revision check for disablign power save. Add this revision check again so we can get power save re-enabled again by default on cards newer than AR5416 and AR5418.
$ git describe --contains 556242049cc3992d0ee625e9f15c4b00ea4baac8 v2.6.34-rc1~233^2~49^2~343
This patch has fixes for stable kernels [2.6.34+].
--- drivers/net/wireless/ath/ath9k/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/init.c +2 -1
@@ -660,7 +660,8 @@ void ath9k_set_hw_capab(struct ath_softcBIT (NL80211_IFTYPE_ADHOC ) |BIT (NL80211_IFTYPE_MESH_POINT ); - hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT ; +if (AR_SREV_5416 (sc->sc_ah)) + hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT ; hw->queues =4 ; hw->max_rates =4 ;
PATCH 22/289 ath9k: fix regression on beacon loss after bgscan
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit 52b8ac92496e03d6b5619204d7f3bae6ce6eae45 upstream.
When we return to the home channel we were never reseting our beacon timers, this was casued by the fact that the scanning flag was still on even after we returned to our home channel. There are also other reasons why we would get a reset and if we are not off channel we always need to resynch our beacon timers, because a reset will clear them.
This bug is a regression introduced on 2.6.36. The order of the changes are as follows:
5ee08656 - Sat Jul 31 - ath9k: prevent calibration during off-channel activity a0daa0e7 - Tue Jul 27 - Revert "mac80211: fix sw scan bracketing" 543708be - Fri Jun 18 - mac80211: fix sw scan bracketing
mcgrof@tux ~/linux-2.6-allstable (git::master)$ git describe \
--contains 5ee0865615f65f84e6ee9174771a6716c29e08e1v2.6.36-rc1~43^2~34^2~22
mcgrof@tux ~/linux-2.6-allstable (git::master)$ git describe \
--contains a0daa0e7592ada797d6835f11529097aabc27ad2v2.6.36-rc1~571^2~64^2~13
mcgrof@tux ~/linux-2.6-allstable (git::master)$ git describe \
--contains 543708be320d7df692d24b349ca01a947b340764v2.6.36-rc1~571^2~107^2~187
So 5ee08656 would have worked if a0daa0e7 was not committed but it was so this means 5ee08656 was broken since it assumed that when we were in the channel change routine the scan flag would be lifted. As it turns out the scan flag will be set when we are already on the home channel.
For more details refer to:
http://code.google.com/p/chromium-os/issues/detail?id=5715
These issues will need to be considered for our solution on reshifting the scan complete callback location on mac80211 on current development kernel work.
This patch has stable fixes which apply down to [2.6.36+]
--- drivers/net/wireless/ath/ath9k/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +4 -2
@@ -257,9 +257,11 @@ int ath_set_channel(struct ath_softc *scif (!(sc->sc_flags & (SC_OP_OFFCHANNEL |SC_OP_SCANNING ))) {ath_start_ani (common);ieee80211_queue_delayed_work (sc->hw, &sc->tx_complete_work,0 ); -ath_beacon_config (sc,NULL ); } +if (!(sc->sc_flags & (SC_OP_OFFCHANNEL ))) +ath_beacon_config (sc,NULL ); + ps_restore:ath9k_ps_restore (sc);return r;
@@ -953,7 +955,7 @@ int ath_reset(struct ath_softc *sc, boolath_update_txpow (sc); -if (sc->sc_flags &SC_OP_BEACONS ) +if ((sc->sc_flags &SC_OP_BEACONS ) || !(sc->sc_flags & (SC_OP_OFFCHANNEL )))ath_beacon_config (sc,NULL );/* restart beacons */ ath9k_hw_set_interrupts (ah, ah->imask);
PATCH 23/289 ath9k: fix spurious MIC failure reports
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Felix Fietkau <[email protected]>
commit 56363ddeeed3afc5277ca227209773bc1042cc7b upstream.
According to the hardware documentation, the MIC failure bit is only valid if the frame was decrypted using a valid TKIP key and is not a fragment.
In some setups I've seen hardware-reported MIC failures on an AP that was configured for CCMP only, so it's clear that additional checks are necessary.
--- drivers/net/wireless/ath/ath.h | 1 + drivers/net/wireless/ath/ath9k/common.c | 11 +++++++++++ drivers/net/wireless/ath/ath9k/mac.c | 3 ++- drivers/net/wireless/ath/ath9k/recv.c | 19 +++++++++++-------- 4 files changed, 25 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath.h +1 -0
@@ -119,6 +119,7 @@ struct ath_common {u32 keymax;DECLARE_BITMAP (keymap,ATH_KEYMAX ); +DECLARE_BITMAP (tkip_keymap,ATH_KEYMAX );u8 splitmic;struct ath_regulatory regulatory;
drivers/net/wireless/ath/ath9k/common.c +11 -0
@@ -366,9 +366,13 @@ int ath9k_cmn_key_config(struct ath_commset_bit (idx, common->keymap);if (key->alg ==ALG_TKIP ) {set_bit (idx +64 , common->keymap); +set_bit (idx, common->tkip_keymap); +set_bit (idx +64 , common->tkip_keymap);if (common->splitmic) {set_bit (idx +32 , common->keymap);set_bit (idx +64 +32 , common->keymap); +set_bit (idx +32 , common->tkip_keymap); +set_bit (idx +64 +32 , common->tkip_keymap); } }
@@ -393,10 +397,17 @@ void ath9k_cmn_key_delete(struct ath_comreturn ;clear_bit (key->hw_key_idx +64 , common->keymap); + +clear_bit (key->hw_key_idx, common->tkip_keymap); +clear_bit (key->hw_key_idx +64 , common->tkip_keymap); +if (common->splitmic) {ath9k_hw_keyreset (ah, key->hw_key_idx +32 );clear_bit (key->hw_key_idx +32 , common->keymap);clear_bit (key->hw_key_idx +64 +32 , common->keymap); + +clear_bit (key->hw_key_idx +32 , common->tkip_keymap); +clear_bit (key->hw_key_idx +64 +32 , common->tkip_keymap); } }EXPORT_SYMBOL (ath9k_cmn_key_delete);
drivers/net/wireless/ath/ath9k/mac.c +2 -1
@@ -711,7 +711,8 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a rs->rs_phyerr = phyerr; }else if (ads.ds_rxstatus8 & AR_DecryptCRCErr) rs->rs_status |=ATH9K_RXERR_DECRYPT ; -else if (ads.ds_rxstatus8 & AR_MichaelErr) +else if ((ads.ds_rxstatus8 & AR_MichaelErr) && + rs->rs_keyix !=ATH9K_RXKEYIX_INVALID ) rs->rs_status |=ATH9K_RXERR_MIC ;else if (ads.ds_rxstatus8 & AR_KeyMiss) rs->rs_status |=ATH9K_RXERR_DECRYPT ;
drivers/net/wireless/ath/ath9k/recv.c +11 -8
@@ -870,15 +870,18 @@ static bool ath9k_rx_accept(struct ath_cif (rx_stats->rs_status &ATH9K_RXERR_DECRYPT ) { *decrypt_error = true; }else if (rx_stats->rs_status &ATH9K_RXERR_MIC ) { -if (ieee80211_is_ctl (fc)) -/* -* Sometimes, we get invalid -* MIC failures on valid control frames. -* Remove these mic errors. -*/ - rx_stats->rs_status &= ~ATH9K_RXERR_MIC ; -else +/* +* The MIC error bit is only valid if the frame +* is not a control frame or fragment, and it was +* decrypted using a valid TKIP key. +*/ +if (!ieee80211_is_ctl (fc) && + !ieee80211_has_morefrags (fc) && + !(le16_to_cpu (hdr->seq_ctrl) &IEEE80211_SCTL_FRAG ) && +test_bit (rx_stats->rs_keyix, common->tkip_keymap)) rxs->flag |=RX_FLAG_MMIC_ERROR ; +else + rx_stats->rs_status &= ~ATH9K_RXERR_MIC ; }/* * Reject error frames with the exception of
PATCH 24/289 ath9k: resume aggregation immediately after a hardware reset
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Felix Fietkau <[email protected]>
commit fac6b6a065da42f826088c58bddad82e1b1ccb40 upstream.
Since aggregation is usually triggered by tx completion, a hardware reset (because of beacon stuck, tx hang or baseband hang) can significantly delay the transmission of the next AMPDU (until the next tx completion event).
Fix this by rescheduling aggregation after such a reset.
--- drivers/net/wireless/ath/ath9k/beacon.c | 2 +- drivers/net/wireless/ath/ath9k/main.c | 4 ++-- drivers/net/wireless/ath/ath9k/xmit.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath9k/beacon.c +1 -1
@@ -366,7 +366,7 @@ void ath_beacon_tasklet(unsigned long daath_print (common,ATH_DBG_BEACON ,"beacon is officially stuck\n" ); sc->sc_flags |=SC_OP_TSF_RESET ; -ath_reset (sc, false); +ath_reset (sc, true); }return ;
drivers/net/wireless/ath/ath9k/main.c +2 -2
@@ -554,7 +554,7 @@ void ath_hw_check(struct work_struct *womsleep (1 ); } -ath_reset (sc, false); +ath_reset (sc, true); out:ath9k_ps_restore (sc);
@@ -572,7 +572,7 @@ void ath9k_tasklet(unsigned long data)ath9k_ps_wakeup (sc);if (status &ATH9K_INT_FATAL ) { -ath_reset (sc, false); +ath_reset (sc, true);ath9k_ps_restore (sc);return ; }
drivers/net/wireless/ath/ath9k/xmit.c +1 -1
@@ -2206,7 +2206,7 @@ static void ath_tx_complete_poll_work(stath_print (ath9k_hw_common (sc->sc_ah),ATH_DBG_RESET ,"tx hung, resetting the chip\n" );ath9k_ps_wakeup (sc); -ath_reset (sc, false); +ath_reset (sc, true);ath9k_ps_restore (sc); }
PATCH 25/289 ath9k_hw: Fix divide by zero cases in paprd.
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Senthil Balasubramanian <[email protected]>
commit 2d3fca180710c6832de22c44155ce6a3a4953c6b upstream.
We are not handling all divide by zero cases in paprd. Add additional checks for divide by zero cases in papard.
This patch has fixes intended for kernel 2.6.36.
--- drivers/net/wireless/ath/ath9k/ar9003_paprd.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_paprd.c +9 -5
@@ -347,6 +347,10 @@ static bool create_pa_curve(u32 *data_L, (((Y [6 ] -Y [3 ]) *1 << scale_factor) + (x_est[6 ] - x_est[3 ])) / (x_est[6 ] - x_est[3 ]); +/* prevent division by zero */ +if (G_fxp ==0 ) +return false; + Y_intercept = (G_fxp * (x_est[0 ] - x_est[3 ]) + (1 << scale_factor)) / (1 << scale_factor) +Y [3 ];
@@ -356,14 +360,12 @@ static bool create_pa_curve(u32 *data_L,for (i =0 ; i <=3 ; i++) { y_est[i] = i *32 ; - -/* prevent division by zero */ -if (G_fxp ==0 ) -return false; - x_est[i] = ((y_est[i] *1 << scale_factor) + G_fxp) / G_fxp; } +if (y_est[max_index] ==0 ) +return false; + x_est_fxp1_nonlin = x_est[max_index] - ((1 << scale_factor) * y_est[max_index] + G_fxp) / G_fxp;
@@ -457,6 +459,8 @@ static bool create_pa_curve(u32 *data_L, Q_scale_B =find_proper_scale (find_expn (abs (scale_B)),10 ); scale_B = scale_B / (1 << Q_scale_B); +if (scale_B ==0 ) +return false; Q_beta =find_proper_scale (find_expn (abs (beta_raw)),10 ); Q_alpha =find_proper_scale (find_expn (abs (alpha_raw)),10 ); beta_raw = beta_raw / (1 << Q_beta);
PATCH 26/289 ath9k_hw: Fix TX carrier leakage for IEEE compliance on AR9003 2.2
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit 0dfa6dbb7372e581d3beb38b11772152114796b8 upstream.
This updates the initvals for the AR9003 2.2 chipsets. The initvals are the initial register values we use for our registers upon hardware reset. This synchs up the initvals to match what our latest recommendation from our systems engineering team.
The description of changes in this update:
Improves ability to support very strong Rx conditions. Enhances DFS support for AP-mode.
Improves performance of Tx carrier leak calibration. Adds support for Japan channel 14 Tx filtering requirements. Improves Tx power accuracy.
Impact:
Update required to address degraded throughput at very short range. Update required for AP-mode DFS certification.
Update required to comply to IEEE Tx carrier leak specification. May not meet expected +/- 2 dB Tx power accuracy without update.
The most important fix here would be the TX carrier leakage required to comply with IEEE 802.11 specifications. The group of changes have been tested all together in one release.
References:
Osprey 2.2 header file ver #33
Checksums:
$ ./initvals -f ar9003-2p2 0x000000004a488fc7 ar9300_2p2_radio_postamble 0x0000000046cb1300 ar9300Modes_lowest_ob_db_tx_gain_table_2p2 0x00000000e912711f ar9300Modes_fast_clock_2p2 0x0000000037ac0ee8 ar9300_2p2_radio_core 0x00000000047a7700 ar9300Common_rx_gain_table_merlin_2p2 0x0000000003f783bb ar9300_2p2_mac_postamble 0x00000000301fc841 ar9300_2p2_soc_postamble 0x000000005ec8075f ar9200_merlin_2p2_radio_core 0x0000000083372ffa ar9300_2p2_baseband_postamble 0x00000000c4f59974 ar9300_2p2_baseband_core 0x00000000e20d2e72 ar9300Modes_high_power_tx_gain_table_2p2 0x000000007fd55c70 ar9300Modes_high_ob_db_tx_gain_table_2p2 0x0000000029495000 ar9300Common_rx_gain_table_2p2 0x0000000042cb1300 ar9300Modes_low_ob_db_tx_gain_table_2p2 0x00000000c4739cd6 ar9300_2p2_mac_core 0x000000003521a300 ar9300Common_wo_xlna_rx_gain_table_2p2 0x00000000a15ccf1b ar9300_2p2_soc_preamble 0x0000000029734396 ar9300PciePhy_pll_on_clkreq_disable_L1_2p2 0x000000002d834396 ar9300PciePhy_clkreq_enable_L1_2p2 0x0000000029834396 ar9300PciePhy_clkreq_disable_L1_2p2
$ ./initvals -f ar9003-2p2 | sha1sum 0ceddb5cf66737610fb51f04cf3e9ff71870c7b4 -
--- drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h | 191 +++++++++++++------ 1 file changed, 135 insertions(+), 56 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h +135 -56
@@ -34,6 +34,10 @@ static const u32 ar9300_2p2_radio_postamstatic const u32 ar9300Modes_lowest_ob_db_tx_gain_table_2p2[][5 ] = {/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ + {0x0000a2dc ,0x0380c7fc ,0x0380c7fc ,0x00637800 ,0x00637800 }, + {0x0000a2e0 ,0x0000f800 ,0x0000f800 ,0x03838000 ,0x03838000 }, + {0x0000a2e4 ,0x03ff0000 ,0x03ff0000 ,0x03fc0000 ,0x03fc0000 }, + {0x0000a2e8 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 }, {0x0000a410 ,0x000050d9 ,0x000050d9 ,0x000050d9 ,0x000050d9 }, {0x0000a500 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 }, {0x0000a504 ,0x06000003 ,0x06000003 ,0x04000002 ,0x04000002 },
@@ -99,6 +103,30 @@ static const u32 ar9300Modes_lowest_ob_d {0x0000a5f4, 0x7782b08c, 0x7782b08c, 0x5d801eec, 0x5d801eec}, {0x0000a5f8, 0x7782b08c, 0x7782b08c, 0x5d801eec, 0x5d801eec}, {0x0000a5fc, 0x7782b08c, 0x7782b08c, 0x5d801eec, 0x5d801eec}, + {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000}, + {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501}, + {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501}, + {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03}, + {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04}, + {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04}, + {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005}, + {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005}, + {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005}, + {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005}, + {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005}, + {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x00637800, 0x00637800}, + {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03838000, 0x03838000}, + {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03fc0000, 0x03fc0000}, + {0x0000b2e8, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000c2dc, 0x0380c7fc, 0x0380c7fc, 0x00637800, 0x00637800}, + {0x0000c2e0, 0x0000f800, 0x0000f800, 0x03838000, 0x03838000}, + {0x0000c2e4, 0x03ff0000, 0x03ff0000, 0x03fc0000, 0x03fc0000}, + {0x0000c2e8, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, {0x00016048, 0x62480001, 0x62480001, 0x62480001, 0x62480001}, {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
@@ -118,7 +146,7 @@ static const u32 ar9300Modes_fast_clock_ {0x00008014, 0x044c044c, 0x08980898}, {0x0000801c, 0x148ec02b, 0x148ec057}, {0x00008318, 0x000044c0, 0x00008980}, - {0x00009e00, 0x03721821, 0x03721821}, + {0x00009e00, 0x0372131c, 0x0372131c}, {0x0000a230, 0x0000000b, 0x00000016}, {0x0000a254, 0x00000898, 0x00001130}, };
@@ -595,15 +623,16 @@ static const u32 ar9300_2p2_baseband_pos {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4}, {0x00009830, 0x0000059c, 0x0000059c, 0x0000119c, 0x0000119c}, {0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4}, - {0x00009e00, 0x0372161e, 0x0372161e, 0x037216a0, 0x037216a0}, - {0x00009e04, 0x00802020, 0x00802020, 0x00802020, 0x00802020}, + {0x00009e00, 0x0372111a, 0x0372111a, 0x037216a0, 0x037216a0}, + {0x00009e04, 0x001c2020, 0x001c2020, 0x001c2020, 0x001c2020}, {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2}, {0x00009e10, 0x7ec88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec84d2e}, - {0x00009e14, 0x31395d5e, 0x3139605e, 0x3139605e, 0x31395d5e}, + {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3379605e, 0x33795d5e}, {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce}, {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021}, + {0x00009e3c, 0xcf946220, 0xcf946220, 0xcf946222, 0xcf946222}, {0x00009e44, 0x02321e27, 0x02321e27, 0x02291e27, 0x02291e27}, {0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012}, {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
@@ -624,16 +653,16 @@ static const u32 ar9300_2p2_baseband_pos {0x0000a28c, 0x00022222, 0x00022222, 0x00022222, 0x00022222}, {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18}, {0x0000a2d0, 0x00071981, 0x00071981, 0x00071981, 0x00071982}, - {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a}, + {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a}, {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x0000a830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c}, - {0x0000ae04, 0x00800000, 0x00800000, 0x00800000, 0x00800000}, + {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x001c0000}, {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c}, {0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce}, {0x0000b284, 0x00000000, 0x00000000, 0x00000150, 0x00000150}, {0x0000b830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c}, - {0x0000be04, 0x00800000, 0x00800000, 0x00800000, 0x00800000}, + {0x0000be04, 0x001c0000, 0x001c0000, 0x001c0000, 0x001c0000}, {0x0000be18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x0000be1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c}, {0x0000be20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce},
@@ -649,13 +678,13 @@ static const u32 ar9300_2p2_baseband_cor {0x00009814, 0x9280c00a}, {0x00009818, 0x00000000}, {0x0000981c, 0x00020028}, - {0x00009834, 0x5f3ca3de}, + {0x00009834, 0x6400a290}, {0x00009838, 0x0108ecff}, {0x0000983c, 0x14750600}, {0x00009880, 0x201fff00}, {0x00009884, 0x00001042}, {0x000098a4, 0x00200400}, - {0x000098b0, 0x52440bbe}, + {0x000098b0, 0x32840bbe}, {0x000098d0, 0x004b6a8e}, {0x000098d4, 0x00000820}, {0x000098dc, 0x00000000},
@@ -681,7 +710,6 @@ static const u32 ar9300_2p2_baseband_cor {0x00009e30, 0x06336f77}, {0x00009e34, 0x6af6532f}, {0x00009e38, 0x0cc80c00}, - {0x00009e3c, 0xcf946222}, {0x00009e40, 0x0d261820}, {0x00009e4c, 0x00001004}, {0x00009e50, 0x00ff03f1},
@@ -694,7 +722,7 @@ static const u32 ar9300_2p2_baseband_cor {0x0000a220, 0x00000000}, {0x0000a224, 0x00000000}, {0x0000a228, 0x10002310}, - {0x0000a22c, 0x01036a1e}, + {0x0000a22c, 0x01036a27}, {0x0000a23c, 0x00000000}, {0x0000a244, 0x0c000000}, {0x0000a2a0, 0x00000001},
@@ -702,10 +730,6 @@ static const u32 ar9300_2p2_baseband_cor {0x0000a2c8, 0x00000000}, {0x0000a2cc, 0x18c43433}, {0x0000a2d4, 0x00000000}, - {0x0000a2dc, 0x00000000}, - {0x0000a2e0, 0x00000000}, - {0x0000a2e4, 0x00000000}, - {0x0000a2e8, 0x00000000}, {0x0000a2ec, 0x00000000}, {0x0000a2f0, 0x00000000}, {0x0000a2f4, 0x00000000},
@@ -753,33 +777,17 @@ static const u32 ar9300_2p2_baseband_cor {0x0000a430, 0x1ce739ce}, {0x0000a434, 0x00000000}, {0x0000a438, 0x00001801}, - {0x0000a43c, 0x00000000}, + {0x0000a43c, 0x00100000}, {0x0000a440, 0x00000000}, {0x0000a444, 0x00000000}, {0x0000a448, 0x06000080}, {0x0000a44c, 0x00000001}, {0x0000a450, 0x00010000}, {0x0000a458, 0x00000000}, - {0x0000a600, 0x00000000}, - {0x0000a604, 0x00000000}, - {0x0000a608, 0x00000000}, - {0x0000a60c, 0x00000000}, - {0x0000a610, 0x00000000}, - {0x0000a614, 0x00000000}, - {0x0000a618, 0x00000000}, - {0x0000a61c, 0x00000000}, - {0x0000a620, 0x00000000}, - {0x0000a624, 0x00000000}, - {0x0000a628, 0x00000000}, - {0x0000a62c, 0x00000000}, - {0x0000a630, 0x00000000}, - {0x0000a634, 0x00000000}, - {0x0000a638, 0x00000000}, - {0x0000a63c, 0x00000000}, {0x0000a640, 0x00000000}, {0x0000a644, 0x3fad9d74}, {0x0000a648, 0x0048060a}, - {0x0000a64c, 0x00000637}, + {0x0000a64c, 0x00003c37}, {0x0000a670, 0x03020100}, {0x0000a674, 0x09080504}, {0x0000a678, 0x0d0c0b0a},
@@ -802,10 +810,6 @@ static const u32 ar9300_2p2_baseband_cor {0x0000a8f4, 0x00000000}, {0x0000b2d0, 0x00000080}, {0x0000b2d4, 0x00000000}, - {0x0000b2dc, 0x00000000}, - {0x0000b2e0, 0x00000000}, - {0x0000b2e4, 0x00000000}, - {0x0000b2e8, 0x00000000}, {0x0000b2ec, 0x00000000}, {0x0000b2f0, 0x00000000}, {0x0000b2f4, 0x00000000},
@@ -820,10 +824,6 @@ static const u32 ar9300_2p2_baseband_cor {0x0000b8f4, 0x00000000}, {0x0000c2d0, 0x00000080}, {0x0000c2d4, 0x00000000}, - {0x0000c2dc, 0x00000000}, - {0x0000c2e0, 0x00000000}, - {0x0000c2e4, 0x00000000}, - {0x0000c2e8, 0x00000000}, {0x0000c2ec, 0x00000000}, {0x0000c2f0, 0x00000000}, {0x0000c2f4, 0x00000000},
@@ -835,6 +835,10 @@ static const u32 ar9300_2p2_baseband_corstatic const u32 ar9300Modes_high_power_tx_gain_table_2p2[][5 ] = {/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ + {0x0000a2dc ,0x0380c7fc ,0x0380c7fc ,0x00637800 ,0x00637800 }, + {0x0000a2e0 ,0x0000f800 ,0x0000f800 ,0x03838000 ,0x03838000 }, + {0x0000a2e4 ,0x03ff0000 ,0x03ff0000 ,0x03fc0000 ,0x03fc0000 }, + {0x0000a2e8 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 }, {0x0000a410 ,0x000050d8 ,0x000050d8 ,0x000050d9 ,0x000050d9 }, {0x0000a500 ,0x00002220 ,0x00002220 ,0x00000000 ,0x00000000 }, {0x0000a504 ,0x04002222 ,0x04002222 ,0x04000002 ,0x04000002 },
@@ -855,7 +859,7 @@ static const u32 ar9300Modes_high_power_ {0x0000a540, 0x49005e72, 0x49005e72, 0x38001660, 0x38001660}, {0x0000a544, 0x4e005eb2, 0x4e005eb2, 0x3b001861, 0x3b001861}, {0x0000a548, 0x53005f12, 0x53005f12, 0x3e001a81, 0x3e001a81}, - {0x0000a54c, 0x59025eb5, 0x59025eb5, 0x42001a83, 0x42001a83}, + {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83}, {0x0000a550, 0x5e025f12, 0x5e025f12, 0x44001c84, 0x44001c84}, {0x0000a554, 0x61027f12, 0x61027f12, 0x48001ce3, 0x48001ce3}, {0x0000a558, 0x6702bf12, 0x6702bf12, 0x4c001ce5, 0x4c001ce5},
@@ -900,6 +904,30 @@ static const u32 ar9300Modes_high_power_ {0x0000a5f4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, {0x0000a5f8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, {0x0000a5fc, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, + {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000}, + {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000}, + {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501}, + {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501}, + {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03}, + {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04}, + {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04}, + {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x00637800, 0x00637800}, + {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03838000, 0x03838000}, + {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03fc0000, 0x03fc0000}, + {0x0000b2e8, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000c2dc, 0x0380c7fc, 0x0380c7fc, 0x00637800, 0x00637800}, + {0x0000c2e0, 0x0000f800, 0x0000f800, 0x03838000, 0x03838000}, + {0x0000c2e4, 0x03ff0000, 0x03ff0000, 0x03fc0000, 0x03fc0000}, + {0x0000c2e8, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00016044, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6}, {0x00016048, 0xae480001, 0xae480001, 0xae480001, 0xae480001}, {0x00016068, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c},
@@ -913,6 +941,10 @@ static const u32 ar9300Modes_high_power_static const u32 ar9300Modes_high_ob_db_tx_gain_table_2p2[][5 ] = {/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ + {0x0000a2dc ,0x01feee00 ,0x01feee00 ,0x00637800 ,0x00637800 }, + {0x0000a2e0 ,0x0000f000 ,0x0000f000 ,0x03838000 ,0x03838000 }, + {0x0000a2e4 ,0x01ff0000 ,0x01ff0000 ,0x03fc0000 ,0x03fc0000 }, + {0x0000a2e8 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 }, {0x0000a410 ,0x000050d8 ,0x000050d8 ,0x000050d9 ,0x000050d9 }, {0x0000a500 ,0x00002220 ,0x00002220 ,0x00000000 ,0x00000000 }, {0x0000a504 ,0x04002222 ,0x04002222 ,0x04000002 ,0x04000002 },
@@ -933,7 +965,7 @@ static const u32 ar9300Modes_high_ob_db_ {0x0000a540, 0x49005e72, 0x49005e72, 0x38001660, 0x38001660}, {0x0000a544, 0x4e005eb2, 0x4e005eb2, 0x3b001861, 0x3b001861}, {0x0000a548, 0x53005f12, 0x53005f12, 0x3e001a81, 0x3e001a81}, - {0x0000a54c, 0x59025eb5, 0x59025eb5, 0x42001a83, 0x42001a83}, + {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83}, {0x0000a550, 0x5e025f12, 0x5e025f12, 0x44001c84, 0x44001c84}, {0x0000a554, 0x61027f12, 0x61027f12, 0x48001ce3, 0x48001ce3}, {0x0000a558, 0x6702bf12, 0x6702bf12, 0x4c001ce5, 0x4c001ce5},
@@ -978,6 +1010,30 @@ static const u32 ar9300Modes_high_ob_db_ {0x0000a5f4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, {0x0000a5f8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, {0x0000a5fc, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, + {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000}, + {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000}, + {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501}, + {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501}, + {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03}, + {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04}, + {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04}, + {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, + {0x0000b2dc, 0x01feee00, 0x01feee00, 0x00637800, 0x00637800}, + {0x0000b2e0, 0x0000f000, 0x0000f000, 0x03838000, 0x03838000}, + {0x0000b2e4, 0x01ff0000, 0x01ff0000, 0x03fc0000, 0x03fc0000}, + {0x0000b2e8, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000c2dc, 0x01feee00, 0x01feee00, 0x00637800, 0x00637800}, + {0x0000c2e0, 0x0000f000, 0x0000f000, 0x03838000, 0x03838000}, + {0x0000c2e4, 0x01ff0000, 0x01ff0000, 0x03fc0000, 0x03fc0000}, + {0x0000c2e8, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00016044, 0x056db2e4, 0x056db2e4, 0x056db2e4, 0x056db2e4}, {0x00016048, 0x8e480001, 0x8e480001, 0x8e480001, 0x8e480001}, {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
@@ -1151,14 +1207,14 @@ static const u32 ar9300Common_rx_gain_ta {0x0000b074, 0x00000000}, {0x0000b078, 0x00000000}, {0x0000b07c, 0x00000000}, - {0x0000b080, 0x32323232}, - {0x0000b084, 0x2f2f3232}, - {0x0000b088, 0x23282a2d}, - {0x0000b08c, 0x1c1e2123}, - {0x0000b090, 0x14171919}, - {0x0000b094, 0x0e0e1214}, - {0x0000b098, 0x03050707}, - {0x0000b09c, 0x00030303}, + {0x0000b080, 0x2a2d2f32}, + {0x0000b084, 0x21232328}, + {0x0000b088, 0x19191c1e}, + {0x0000b08c, 0x12141417}, + {0x0000b090, 0x07070e0e}, + {0x0000b094, 0x03030305}, + {0x0000b098, 0x00000003}, + {0x0000b09c, 0x00000000}, {0x0000b0a0, 0x00000000}, {0x0000b0a4, 0x00000000}, {0x0000b0a8, 0x00000000},
@@ -1251,6 +1307,10 @@ static const u32 ar9300Common_rx_gain_tastatic const u32 ar9300Modes_low_ob_db_tx_gain_table_2p2[][5 ] = {/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ + {0x0000a2dc ,0x0380c7fc ,0x0380c7fc ,0x00637800 ,0x00637800 }, + {0x0000a2e0 ,0x0000f800 ,0x0000f800 ,0x03838000 ,0x03838000 }, + {0x0000a2e4 ,0x03ff0000 ,0x03ff0000 ,0x03fc0000 ,0x03fc0000 }, + {0x0000a2e8 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 }, {0x0000a410 ,0x000050d9 ,0x000050d9 ,0x000050d9 ,0x000050d9 }, {0x0000a500 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 }, {0x0000a504 ,0x06000003 ,0x06000003 ,0x04000002 ,0x04000002 },
@@ -1316,6 +1376,30 @@ static const u32 ar9300Modes_low_ob_db_t {0x0000a5f4, 0x7782b08c, 0x7782b08c, 0x5d801eec, 0x5d801eec}, {0x0000a5f8, 0x7782b08c, 0x7782b08c, 0x5d801eec, 0x5d801eec}, {0x0000a5fc, 0x7782b08c, 0x7782b08c, 0x5d801eec, 0x5d801eec}, + {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000}, + {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501}, + {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501}, + {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03}, + {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04}, + {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04}, + {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005}, + {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005}, + {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005}, + {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005}, + {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005}, + {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x00637800, 0x00637800}, + {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03838000, 0x03838000}, + {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03fc0000, 0x03fc0000}, + {0x0000b2e8, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000c2dc, 0x0380c7fc, 0x0380c7fc, 0x00637800, 0x00637800}, + {0x0000c2e0, 0x0000f800, 0x0000f800, 0x03838000, 0x03838000}, + {0x0000c2e4, 0x03ff0000, 0x03ff0000, 0x03fc0000, 0x03fc0000}, + {0x0000c2e8, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, {0x00016048, 0x66480001, 0x66480001, 0x66480001, 0x66480001}, {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
@@ -1414,15 +1498,10 @@ static const u32 ar9300_2p2_mac_core[][2 {0x00008144, 0xffffffff}, {0x00008168, 0x00000000}, {0x0000816c, 0x00000000}, - {0x00008170, 0x18486200}, - {0x00008174, 0x33332210}, - {0x00008178, 0x00000000}, - {0x0000817c, 0x00020000}, {0x000081c0, 0x00000000}, {0x000081c4, 0x33332210}, {0x000081c8, 0x00000000}, {0x000081cc, 0x00000000}, - {0x000081d4, 0x00000000}, {0x000081ec, 0x00000000}, {0x000081f0, 0x00000000}, {0x000081f4, 0x00000000},
PATCH 27/289 ath9k_htc: Set proper firmware offset for Netgear WNDA3200
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rajkumar Manoharan <[email protected]>
commit d654567dec75782d6fd9add4b7b9c50e0926d369 upstream.
Netgear WNDA3200 device uses ar7010 firmware but it is failed to set correct firmware offset on firmware download which causes device initialization failure.
--- drivers/net/wireless/ath/ath9k/hif_usb.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/hif_usb.c +8 -2
@@ -799,10 +799,16 @@ static int ath9k_hif_usb_download_fw(str }kfree (buf); -if ((hif_dev->device_id ==0x7010 ) || (hif_dev->device_id ==0x7015 )) +switch (hif_dev->device_id) { +case 0x7010 : +case 0x7015 : +case 0x9018 : firm_offset =AR7010_FIRMWARE_TEXT ; -else +break ; +default : firm_offset =AR9271_FIRMWARE_TEXT ; +break ; + }/* * Issue FW download complete command to firmware.
PATCH 28/289 ath9k: Fix incorrect access of rate flags in RC
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mohammed Shafi Shajakhan <[email protected]>
commit 4fc4fbd1d9a05fa4f348b499aca3a6f8d3c9bbe6 upstream.
The index variable to access the rate flags should be obtained from the inner loop counter which corresponds to the rate table structure.This fixes the invalid rate selection i.e when the supported basic rate is invalid on a particular band and also the following warning message. Thanks to Raj for finding this out.
Call Trace: [<ffffffff8104ee4a>] warn_slowpath_common+0x7a/0xb0 [<ffffffff8104ee95>] warn_slowpath_null+0x15/0x20 [<ffffffffa0583c45>] ath_get_rate+0x595/0x5b0 [ath9k]
[<ffffffff811a0636>] ? cpumask_next_and+0x36/0x50
[<ffffffffa0405186>] rate_control_get_rate+0x86/0x160 [mac80211] [<ffffffffa040dfac>] invoke_tx_handlers+0x81c/0x12d0 [mac80211] [<ffffffffa040eae9>] ieee80211_tx+0x89/0x2b0 [mac80211]
[<ffffffff812891bc>] ? pskb_expand_head+0x1cc/0x1f0
[<ffffffffa040edc5>] ieee80211_xmit+0xb5/0x1c0 [mac80211] [<ffffffffa041026f>] ieee80211_tx_skb+0x4f/0x60 [mac80211] [<ffffffffa03fe016>] ieee80211_send_nullfunc+0x46/0x60 [mac80211] [<ffffffffa03f91d7>] ieee80211_offchannel_stop_station+0x107/0x150
[mac80211]
[<ffffffff812891bc>] ? pskb_expand_head+0x1cc/0x1f0
[<ffffffffa040edc5>] ieee80211_xmit+0xb5/0x1c0 [mac80211] [<ffffffffa041026f>] ieee80211_tx_skb+0x4f/0x60 [mac80211] [<ffffffffa03fe016>] ieee80211_send_nullfunc+0x46/0x60 [mac80211] [<ffffffffa03f91d7>] ieee80211_offchannel_stop_station+0x107/0x150
[mac80211]
[<ffffffffa03f8896>] ieee80211_scan_work+0x146/0x600 [mac80211]
[<ffffffff8133a375>] ? schedule+0x2f5/0x8e0
[<ffffffffa03f8750>] ? ieee80211_scan_work+0x0/0x600 [mac80211]
[<ffffffff81064fcf>] process_one_work+0x10f/0x380 [<ffffffff81066bc2>] worker_thread+0x162/0x340
[<ffffffff81066a60>] ? worker_thread+0x0/0x340
--- drivers/net/wireless/ath/ath9k/rc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/rc.c +1 -1
@@ -538,7 +538,7 @@ static u8 ath_rc_setvalid_rates(struct afor (i =0 ; i < rateset->rs_nrates; i++) {for (j =0 ; j < rate_table->rate_cnt; j++) {u32 phy = rate_table->info[j].phy; -u16 rate_flags = rate_table->info[i].rate_flags; +u16 rate_flags = rate_table->info[j].rate_flags;u8 rate = rateset->rs_rates[i];u8 dot11rate = rate_table->info[j].dot11rate;
PATCH 29/289 ath9k: rename rxflushlock to pcu_lock
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit b79b33c4baf2532aac2c0924dce5a738099b888c upstream.
The real way to lock RX is to contend on the PCU and reset, this will be fixed in the next patch but for now just do the renames so that the next patch which changes the locking order is crystal clear.
This is part of a series that will help resolve the bug:
https://bugzilla.kernel.org/show_bug.cgi?id=14624
For more details about this issue refer to:
http://marc.info/?l=linux-wireless&m=128629803703756&w=2
--- drivers/net/wireless/ath/ath9k/ath9k.h | 2 +- drivers/net/wireless/ath/ath9k/main.c | 4 ++-- drivers/net/wireless/ath/ath9k/recv.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +1 -1
@@ -312,7 +312,7 @@ struct ath_rx {u8 rxotherant;u32 *rxlink;unsigned int rxfilter; -spinlock_t rxflushlock; +spinlock_t pcu_lock;spinlock_t rxbuflock;struct list_head rxbuf;struct ath_descdma rxdma;
drivers/net/wireless/ath/ath9k/main.c +2 -2
@@ -587,7 +587,7 @@ void ath9k_tasklet(unsigned long data) rxmask = (ATH9K_INT_RX |ATH9K_INT_RXEOL |ATH9K_INT_RXORN );if (status & rxmask) { -spin_lock_bh (&sc->rx.rxflushlock); +spin_lock_bh (&sc->rx.pcu_lock);/* Check for high priority Rx first */ if ((ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) &&
@@ -595,7 +595,7 @@ void ath9k_tasklet(unsigned long data)ath_rx_tasklet (sc,0 , true);ath_rx_tasklet (sc,0 , false); -spin_unlock_bh (&sc->rx.rxflushlock); +spin_unlock_bh (&sc->rx.pcu_lock); }if (status &ATH9K_INT_TX ) {
drivers/net/wireless/ath/ath9k/recv.c +3 -3
@@ -310,7 +310,7 @@ int ath_rx_init(struct ath_softc *sc, instruct ath_buf *bf;int error =0 ; -spin_lock_init (&sc->rx.rxflushlock); +spin_lock_init (&sc->rx.pcu_lock); sc->sc_flags &= ~SC_OP_RXFLUSH ;spin_lock_init (&sc->rx.rxbuflock);
@@ -522,13 +522,13 @@ bool ath_stoprecv(struct ath_softc *sc)void ath_flushrecv (struct ath_softc *sc) { -spin_lock_bh (&sc->rx.rxflushlock); +spin_lock_bh (&sc->rx.pcu_lock); sc->sc_flags |=SC_OP_RXFLUSH ;if (sc->sc_ah->caps.hw_caps &ATH9K_HW_CAP_EDMA )ath_rx_tasklet (sc,1 , true);ath_rx_tasklet (sc,1 , false); sc->sc_flags &= ~SC_OP_RXFLUSH ; -spin_unlock_bh (&sc->rx.rxflushlock); +spin_unlock_bh (&sc->rx.pcu_lock); }static bool ath_beacon_dtim_pending_cab (struct sk_buff *skb)
PATCH 30/289 ath9k: fix tx aggregation flush on AR9003
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Felix Fietkau <[email protected]>
commit e609e2ea2cdb3448e7849703179cd792a28dcc55 upstream.
Completing aggregate frames can lead to new buffers being pushed into the tid queues due to software retransmission.
When the tx queues are being drained, all pending aggregates must be completed before the tid queues get drained, otherwise buffers might be leaked.
--- drivers/net/wireless/ath/ath9k/xmit.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath9k/xmit.c +9 -9
@@ -1101,15 +1101,6 @@ void ath_draintxq(struct ath_softc *sc, txq->axq_tx_inprogress = false;spin_unlock_bh (&txq->axq_lock); -/* flush any pending frames if aggregation is enabled */ -if (sc->sc_flags &SC_OP_TXAGGR ) { -if (!retry_tx) { -spin_lock_bh (&txq->axq_lock); -ath_txq_drain_pending_buffers (sc, txq); -spin_unlock_bh (&txq->axq_lock); - } - } -if (sc->sc_ah->caps.hw_caps &ATH9K_HW_CAP_EDMA ) {spin_lock_bh (&txq->axq_lock);while (!list_empty (&txq->txq_fifo_pending)) {
@@ -1130,6 +1121,15 @@ void ath_draintxq(struct ath_softc *sc, }spin_unlock_bh (&txq->axq_lock); } + +/* flush any pending frames if aggregation is enabled */ +if (sc->sc_flags &SC_OP_TXAGGR ) { +if (!retry_tx) { +spin_lock_bh (&txq->axq_lock); +ath_txq_drain_pending_buffers (sc, txq); +spin_unlock_bh (&txq->axq_lock); + } + } }void ath_drain_all_txq (struct ath_softc *sc,bool retry_tx)
PATCH 31/289 ath9k: add locking for stopping RX
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit 1e450285281bdf766272c181ecd43d4f2f0711ce upstream.
ath9k locks for starting RX but not for stopping RX. We could potentially run into a situation where tried to stop RX but immediately started RX. This allows for races on the the RX engine deciding what buffer we last left off on and could potentially cause ath9k to DMA into already free'd memory or in the worst case at a later time to already given memory to other drivers.
Fix this by locking stopping RX.
This is part of a series that will help resolve the bug:
https://bugzilla.kernel.org/show_bug.cgi?id=14624
For more details about this issue refer to:
http://marc.info/?l=linux-wireless&m=128629803703756&w=2
--- drivers/net/wireless/ath/ath9k/recv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/recv.c +2 -2
@@ -297,10 +297,8 @@ static void ath_edma_start_recv(struct astatic void ath_edma_stop_recv (struct ath_softc *sc) { -spin_lock_bh (&sc->rx.rxbuflock);ath_rx_remove_buffer (sc,ATH9K_RX_QUEUE_HP );ath_rx_remove_buffer (sc,ATH9K_RX_QUEUE_LP ); -spin_unlock_bh (&sc->rx.rxbuflock); }int ath_rx_init (struct ath_softc *sc,int nbufs)
@@ -508,6 +506,7 @@ bool ath_stoprecv(struct ath_softc *sc)struct ath_hw *ah = sc->sc_ah;bool stopped; +spin_lock_bh (&sc->rx.rxbuflock);ath9k_hw_stoppcurecv (ah);ath9k_hw_setrxfilter (ah,0 ); stopped =ath9k_hw_stopdmarecv (ah);
@@ -516,6 +515,7 @@ bool ath_stoprecv(struct ath_softc *sc)ath_edma_stop_recv (sc); else sc->rx.rxlink = NULL; +spin_unlock_bh (&sc->rx.rxbuflock);return stopped; }
PATCH 32/289 ath9k: fix enabling ANI / tx monitor after bg scan
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit 48a6a468198aadb54bc5d3fdd065364d43ff5197 upstream.
ath9k's entire logic with SC_OP_SCANNING is incorrect due to the way mac80211 currently implements the scan complete callback and we handle it in ath9k. This patch removes the flag completely in preference for the SC_OP_OFFCHANNEL which is really what we wanted.
The scanning flag was used to ensure we reset ANI to the old values when we go back to the home channel, but if we are offchannel we use some defaults. The flag was also used to re-enable the TX monitor.
Without this patch we simply never re-enabled ANI and the TX monitor after going offchannel. This means that after one background scan we are prone to noise issues and if we had a TX hang we would not recover. To get this to work properly we must enable ANI after we have configured the beacon timers, otherwise hardware acts really oddly.
This patch has stable fixes which apply down to [2.6.36+], there *may* be a to fix this on older kernels but requires a bit of work since this patch relies on the new mac80211 flag IEEE80211_CONF_OFFCHANNEL which was introduced as of 2.6.36.
--- drivers/net/wireless/ath/ath9k/ath9k.h | 1 - drivers/net/wireless/ath/ath9k/main.c | 10 +++------- drivers/net/wireless/ath/ath9k/recv.c | 4 ++-- 3 files changed, 5 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +0 -1
@@ -516,7 +516,6 @@ void ath_deinit_leds(struct ath_softc *s#define SC_OP_RXFLUSH BIT(7)#define SC_OP_LED_ASSOCIATED BIT(8)#define SC_OP_LED_ON BIT(9) -#define SC_OP_SCANNING BIT(10)#define SC_OP_TSF_RESET BIT(11)#define SC_OP_BT_PRIORITY_DETECTED BIT(12)#define SC_OP_BT_SCAN BIT(13)
drivers/net/wireless/ath/ath9k/main.c +3 -7
@@ -254,14 +254,12 @@ int ath_set_channel(struct ath_softc *scath_update_txpow (sc);ath9k_hw_set_interrupts (ah, ah->imask); -if (!(sc->sc_flags & (SC_OP_OFFCHANNEL |SC_OP_SCANNING ))) { -ath_start_ani (common); +if (!(sc->sc_flags & (SC_OP_OFFCHANNEL ))) { +ath_beacon_config (sc,NULL );ieee80211_queue_delayed_work (sc->hw, &sc->tx_complete_work,0 ); +ath_start_ani (common); } -if (!(sc->sc_flags & (SC_OP_OFFCHANNEL ))) -ath_beacon_config (sc,NULL ); - ps_restore:ath9k_ps_restore (sc);return r;
@@ -2040,7 +2038,6 @@ static void ath9k_sw_scan_start(struct i aphy->state =ATH_WIPHY_SCAN ;ath9k_wiphy_pause_all_forced (sc, aphy); - sc->sc_flags |=SC_OP_SCANNING ;mutex_unlock (&sc->mutex); }
@@ -2055,7 +2052,6 @@ static void ath9k_sw_scan_complete(strucmutex_lock (&sc->mutex); aphy->state =ATH_WIPHY_ACTIVE ; - sc->sc_flags &= ~SC_OP_SCANNING ;mutex_unlock (&sc->mutex); }
drivers/net/wireless/ath/ath9k/recv.c +2 -2
@@ -292,7 +292,7 @@ static void ath_edma_start_recv(struct aath_opmode_init (sc); -ath9k_hw_startpcureceive (sc->sc_ah, (sc->sc_flags &SC_OP_SCANNING )); +ath9k_hw_startpcureceive (sc->sc_ah, (sc->sc_flags &SC_OP_OFFCHANNEL )); }static void ath_edma_stop_recv (struct ath_softc *sc)
@@ -496,7 +496,7 @@ int ath_startrecv(struct ath_softc *sc) start_recv:spin_unlock_bh (&sc->rx.rxbuflock);ath_opmode_init (sc); -ath9k_hw_startpcureceive (ah, (sc->sc_flags &SC_OP_SCANNING )); +ath9k_hw_startpcureceive (ah, (sc->sc_flags &SC_OP_OFFCHANNEL ));return 0 ; }
PATCH 33/289 ath9k_hw: Fix memory leak on ath9k_hw_rf_alloc_ext_banks failure
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rajkumar Manoharan <[email protected]>
commit 48a7c3df14d0cda850337a9b3f9e667a0b12a996 upstream.
The allocated externel radio banks have to be freed in case of ath9k_hw_rf_alloc_ext_banks failure.
--- drivers/net/wireless/ath/ath9k/hw.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath9k/hw.c +1 -0
@@ -486,6 +486,7 @@ static int ath9k_hw_post_init(struct athath_print (ath9k_hw_common (ah),ATH_DBG_FATAL ,"Failed allocating banks for " "external radio\n" ); +ath9k_hw_rf_free_ext_banks (ah);return ecode; }
PATCH 34/289 ath9k_hw: Fix AR9280 surprise removal during frequent idle on/off
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vasanthakumar Thiagarajan <[email protected]>
commit f119da3015712dc32bdf1c311652479e02dcb49a upstream.
Bit 22 of AR_WA should be set to fix the situation where chip reset is asynchronous to clock of analog shift registers, such that when reset is released, it could mess up the values of analog shift registers and cause some hw issue on AR9280.
This bit is write only, but the driver does a read-modify-write on AR_WA without setting bit 22 in ar9002_hw_configpcipowersave() during radio disable. This causes surprise removal of hw. It can never recover from this state and the hw will become usable only after a power on/off cycle, and sometimes only during a cold reboot.
This issue can be triggered by doing frequent roaming with the simple/test-roam script available from the wifi-test project [1] when roaming between APs quickly. When roaming there is a is a high possibility that the device being put into idle (radio disable) state by mac80211 during AUTH->ASSOC. A device hardware reset would fail and the kernel would output:
[40251.363799] ath: AWAKE -> FULL-SLEEP [40251.363815] ieee80211 phy17: device no longer idle - working [40251.363817] ath: Marking phy17 as not-idle [40251.363819] ath: FULL-SLEEP -> AWAKE [40251.415978] pciehp 0000:00:1c.3:pcie04: Card not present on Slot(3) [40251.419896] ath: ah->misc_mode 0x4 [40251.428138] pciehp 0000:00:1c.3:pcie04: Card present on Slot(3) [40251.532247] ath: timeout (100000 us) on reg 0x9860: 0xffffffff & 0x00000001 != 0x00000000 [40251.532250] ath: Unable to reset channel (2462 MHz), reset status -5 [40251.532422] ath: Set channel: 5745 MHz [40251.540639] ath: Failed to stop TX DMA in 100 msec after killing last frame [40251.548826] ath: Failed to stop TX DMA in 100 msec after killing last frame [40251.557023] ath: Failed to stop TX DMA in 100 msec after killing last frame [40251.565211] ath: Failed to stop TX DMA in 100 msec after killing last frame [40251.573415] ath: Failed to stop TX DMA in 100 msec after killing last frame [40251.581603] ath: Failed to stop TX DMA in 100 msec after killing last frame [40251.581606] ath: Failed to stop TX DMA. Resetting hardware! [40251.592679] ath: DMA failed to stop in 10 ms AR_CR=0xffffffff AR_DIAG_SW=0xffffffff [40251.703330] ath: timeout (100000 us) on reg 0x7000: 0xffffffff & 0x00000003 != 0x00000000 [40251.703333] ath: RTC stuck in MAC reset [40251.703334] ath: Chip reset failed [40251.703335] ath: Unable to reset hardware; reset status -22
This is currently only reproducible with some HB92 (Half Mini-PCIE) cards but the fix applies to all AR9280 cards. This patch fixes this issue by setting bit 22 during radio disable.
This patch has fixes for all kernels that has ath9k.
[1] http://wireless.kernel.org/en/developers/Testing/wifi-test
--- drivers/net/wireless/ath/ath9k/ar9002_hw.c | 3 +++ drivers/net/wireless/ath/ath9k/reg.h | 1 + 2 files changed, 4 insertions(+)
drivers/net/wireless/ath/ath9k/ar9002_hw.c +3 -0
@@ -411,6 +411,9 @@ static void ar9002_hw_configpcipowersave val &= ~(AR_WA_BIT6 |AR_WA_BIT7 ); } +if (AR_SREV_9280 (ah)) + val |=AR_WA_BIT22 ; +if (AR_SREV_9285E_20 (ah)) val |=AR_WA_BIT23 ;
drivers/net/wireless/ath/ath9k/reg.h +1 -0
@@ -709,6 +709,7 @@#define AR_WA_RESET_EN (1 << 18)/* Sw Control to enable PCI-Reset to POR (bit 15) */ #define AR_WA_ANALOG_SHIFT (1 << 20)#define AR_WA_POR_SHORT (1 << 21)/* PCI-E Phy reset control */ +#define AR_WA_BIT22 (1 << 22)#define AR9285_WA_DEFAULT 0x004a050b#define AR9280_WA_DEFAULT 0x0040073b#define AR_WA_DEFAULT 0x0000073f
PATCH 35/289 ath9k_htc: Avoid setting QoS control for non-QoS frames
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rajkumar Manoharan <[email protected]>
commit 3bf30b56c4f0a1c4fae34050b7db4527c92891e8 upstream.
Setting tid information in the TX header is required only for QoS frames. Not handling this case causes severe data loss with some APs.
--- drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +1 -1
@@ -121,7 +121,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_ tx_hdr.data_type =ATH9K_HTC_NORMAL ; } -if (ieee80211_is_data (fc)) { +if (ieee80211_is_data_qos (fc)) { qc =ieee80211_get_qos_ctl (hdr); tx_hdr.tidno = qc[0 ] &IEEE80211_QOS_CTL_TID_MASK ; }
PATCH 36/289 ath9k: add locking for starting the PCU on RX
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit 7583c550c3e635dcc61ab127c36ecefd59fb8dc8 upstream.
There was some locking for starting some parts of RX but not for starting the PCU. Include this otherwise we can content against stopping the PCU.
This can potentially lead to races against different buffers on the PCU which can lead to to the DMA RX engine writing to buffers which are already freed.
This is part of a series that will help resolve the bug:
https://bugzilla.kernel.org/show_bug.cgi?id=14624
For more details about this issue refer to:
http://marc.info/?l=linux-wireless&m=128629803703756&w=2
index e581b1f..b3c9baf 100644
--- drivers/net/wireless/ath/ath9k/recv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/recv.c +4 -3
@@ -288,11 +288,11 @@ static void ath_edma_start_recv(struct aath_rx_addbuffer_edma (sc,ATH9K_RX_QUEUE_LP , sc->rx.rx_edma[ATH9K_RX_QUEUE_LP ].rx_fifo_hwsize); -spin_unlock_bh (&sc->rx.rxbuflock); -ath_opmode_init (sc);ath9k_hw_startpcureceive (sc->sc_ah, (sc->sc_flags &SC_OP_OFFCHANNEL )); + +spin_unlock_bh (&sc->rx.rxbuflock); }static void ath_edma_stop_recv (struct ath_softc *sc)
@@ -494,10 +494,11 @@ int ath_startrecv(struct ath_softc *sc)ath9k_hw_rxena (ah); start_recv: -spin_unlock_bh (&sc->rx.rxbuflock);ath_opmode_init (sc);ath9k_hw_startpcureceive (ah, (sc->sc_flags &SC_OP_OFFCHANNEL )); +spin_unlock_bh (&sc->rx.rxbuflock); +return 0 ; }
PATCH 37/289 ath9k_hw: Set proper eeprom offset for AR9287 HTC devices
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rajkumar Manoharan <[email protected]>
commit b5261cf4f3860bd772346a3e692683b6144dd44c upstream.
AR9287 based PCI & USB devices are differed in eeprom start offset. So set proper the offset for HTC devices to read nvram correctly.
--- drivers/net/wireless/ath/ath9k/eeprom_9287.c | 2 +- drivers/net/wireless/ath/ath9k/reg.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/eeprom_9287.c +1 -1
@@ -37,7 +37,7 @@ static bool ath9k_hw_ar9287_fill_eeprom(int addr, eep_start_loc; eep_data = (u16 *)eep; -if (ah->hw_version.devid ==0x7015 ) +if (AR9287_HTC_DEVID (ah)) eep_start_loc =AR9287_HTC_EEP_START_LOC ;else eep_start_loc =AR9287_EEP_START_LOC ;
drivers/net/wireless/ath/ath9k/reg.h +4 -0
@@ -903,6 +903,10 @@ ((_ah)->hw_version.devid == 0x7015) || \ ((_ah)->hw_version.devid == 0x9018)) +#define AR9287_HTC_DEVID (_ah) \ + (((_ah)->hw_version.devid == 0x7015) || \ + ((_ah)->hw_version.devid == 0x1200)) +#define AR_RADIO_SREV_MAJOR 0xf0#define AR_RAD5133_SREV_MAJOR 0xc0#define AR_RAD2133_SREV_MAJOR 0xd0
PATCH 38/289 ath9k_htc: Add new devices into AR7010
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rajkumar Manoharan <[email protected]>
commit 7cbf2611dac8d5f76fe64795a9426b8c97e6c3f8 upstream.
Treat new PIDs (0xA704, 0x1200) as AR7010 devices.
--- drivers/net/wireless/ath/ath9k/hif_usb.c | 4 ++++ drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 ++ drivers/net/wireless/ath/ath9k/reg.h | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/hif_usb.c +4 -0
@@ -803,6 +803,8 @@ static int ath9k_hif_usb_download_fw(strcase 0x7010 :case 0x7015 :case 0x9018 : +case 0xA704 : +case 0x1200 : firm_offset =AR7010_FIRMWARE_TEXT ;break ;default :
@@ -909,6 +911,8 @@ static int ath9k_hif_usb_probe(struct uscase 0x7010 :case 0x7015 :case 0x9018 : +case 0xA704 : +case 0x1200 :if (le16_to_cpu (udev->descriptor.bcdDevice) ==0x0202 ) hif_dev->fw_name =FIRMWARE_AR7010_1_1 ;else
drivers/net/wireless/ath/ath9k/htc_drv_init.c +2 -0
@@ -247,6 +247,8 @@ static int ath9k_init_htc_services(struccase 0x7010 :case 0x7015 :case 0x9018 : +case 0xA704 : +case 0x1200 : priv->htc->credits =45 ;break ;default :
drivers/net/wireless/ath/ath9k/reg.h +3 -1
@@ -901,7 +901,9 @@#define AR_DEVID_7010 (_ah) \ (((_ah)->hw_version.devid == 0x7010) || \ ((_ah)->hw_version.devid == 0x7015) || \ - ((_ah)->hw_version.devid == 0x9018)) + ((_ah)->hw_version.devid == 0x9018) || \ + ((_ah)->hw_version.devid == 0xA704) || \ + ((_ah)->hw_version.devid == 0x1200))#define AR9287_HTC_DEVID (_ah) \ (((_ah)->hw_version.devid == 0x7015) || \
PATCH 39/289 ath9k_htc: Add support for device ID 3346
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Haitao Zhang <[email protected]>
commit ac618d70aeb681df7b77c1107fdf26f3249f855f upstream.
This patch adds support for USB dongle with device ID 3346 from IMC Networks.
--- drivers/net/wireless/ath/ath9k/hif_usb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath9k/hif_usb.c +1 -0
@@ -35,6 +35,7 @@ static struct usb_device_id ath9k_hif_us { USB_DEVICE(0x07D1, 0x3A10) }, /* Dlink Wireless 150 */ { USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */ { USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */ + { USB_DEVICE(0x13D3, 0x3346) }, /* IMC Networks */ { USB_DEVICE(0x04CA, 0x4605) }, /* Liteon */ { USB_DEVICE(0x083A, 0xA704) }, /* SMC Networks */ { },
PATCH 40/289 ath9k_htc: Update usb device ID list
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rajkumar Manoharan <[email protected]>
commit 32b089558c54792028f14ae830ca7c0a8d9ac9a3 upstream.
Added new VID/PIDs into supported devices list
--- drivers/net/wireless/ath/ath9k/hif_usb.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/wireless/ath/ath9k/hif_usb.c +5 -0
@@ -36,8 +36,13 @@ static struct usb_device_id ath9k_hif_us { USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */ { USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */ { USB_DEVICE(0x13D3, 0x3346) }, /* IMC Networks */ + { USB_DEVICE(0x13D3, 0x3348) }, /* Azurewave */ + { USB_DEVICE(0x13D3, 0x3349) }, /* Azurewave */ + { USB_DEVICE(0x13D3, 0x3350) }, /* Azurewave */ { USB_DEVICE(0x04CA, 0x4605) }, /* Liteon */ { USB_DEVICE(0x083A, 0xA704) }, /* SMC Networks */ + { USB_DEVICE(0x040D, 0x3801) }, /* VIA */ + { USB_DEVICE(0x1668, 0x1200) }, /* Verizon */ { }, };
PATCH 41/289 ath9k: lock reset and PCU start/stopping
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit 5e848f789d60000d39d9a5f26ab02dbdd963f6cd upstream.
Apart from locking the start and stop PCU we need to ensure we also content starting and stopping the PCU between hardware resets.
This is part of a series that will help resolve the bug:
https://bugzilla.kernel.org/show_bug.cgi?id=14624
For more details about this issue refer to:
http://marc.info/?l=linux-wireless&m=128629803703756&w=2
--- drivers/net/wireless/ath/ath9k/main.c | 27 +++++++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/recv.c | 2 -- 2 files changed, 27 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +27 -0
@@ -213,6 +213,9 @@ int ath_set_channel(struct ath_softc *sc*/ ath9k_hw_set_interrupts (ah,0 );ath_drain_all_txq (sc, false); + +spin_lock_bh (&sc->rx.pcu_lock); + stopped =ath_stoprecv (sc);/* XXX: do not flush receive queue here. We don't want
@@ -239,6 +242,7 @@ int ath_set_channel(struct ath_softc *sc"reset status %d\n" , channel->center_freq, r);spin_unlock_bh (&sc->sc_resetlock); +spin_unlock_bh (&sc->rx.pcu_lock); goto ps_restore; }spin_unlock_bh (&sc->sc_resetlock);
@@ -247,9 +251,12 @@ int ath_set_channel(struct ath_softc *scath_print (common,ATH_DBG_FATAL ,"Unable to restart recv logic\n" ); r = -EIO ; +spin_unlock_bh (&sc->rx.pcu_lock); goto ps_restore; } +spin_unlock_bh (&sc->rx.pcu_lock); +ath_cache_conf_rate (sc, &hw->conf);ath_update_txpow (sc);ath9k_hw_set_interrupts (ah, ah->imask);
@@ -840,6 +847,7 @@ void ath_radio_enable(struct ath_softc *if (!ah->curchan) ah->curchan =ath_get_curchannel (sc, sc->hw); +spin_lock_bh (&sc->rx.pcu_lock);spin_lock_bh (&sc->sc_resetlock); r =ath9k_hw_reset (ah, ah->curchan, ah->caldata, false);if (r) {
@@ -854,8 +862,10 @@ void ath_radio_enable(struct ath_softc *if (ath_startrecv (sc) !=0 ) {ath_print (common,ATH_DBG_FATAL ,"Unable to restart recv logic\n" ); +spin_unlock_bh (&sc->rx.pcu_lock);return ; } +spin_unlock_bh (&sc->rx.pcu_lock);if (sc->sc_flags &SC_OP_BEACONS )ath_beacon_config (sc,NULL );/* restart beacons */
@@ -894,6 +904,9 @@ void ath_radio_disable(struct ath_softcath9k_hw_set_interrupts (ah,0 );ath_drain_all_txq (sc, false);/* clear pending tx frames */ + +spin_lock_bh (&sc->rx.pcu_lock); +ath_stoprecv (sc);/* turn off frame recv */ ath_flushrecv (sc);/* flush recv queue */
@@ -911,6 +924,9 @@ void ath_radio_disable(struct ath_softcspin_unlock_bh (&sc->sc_resetlock);ath9k_hw_phy_disable (ah); + +spin_unlock_bh (&sc->rx.pcu_lock); +ath9k_hw_configpcipowersave (ah,1 ,1 );ath9k_ps_restore (sc);ath9k_setpower (sc,ATH9K_PM_FULL_SLEEP );
@@ -930,6 +946,9 @@ int ath_reset(struct ath_softc *sc, boolath9k_hw_set_interrupts (ah,0 );ath_drain_all_txq (sc, retry_tx); + +spin_lock_bh (&sc->rx.pcu_lock); +ath_stoprecv (sc);ath_flushrecv (sc);
@@ -944,6 +963,8 @@ int ath_reset(struct ath_softc *sc, boolath_print (common,ATH_DBG_FATAL ,"Unable to start recv logic\n" ); +spin_unlock_bh (&sc->rx.pcu_lock); +/* * We may be doing a reset in response to a request * that changes the channel so update any state that
@@ -1108,6 +1129,7 @@ static int ath9k_start(struct ieee80211_* be followed by initialization of the appropriate bits * and then setup of the interrupt mask. */ +spin_lock_bh (&sc->rx.pcu_lock);spin_lock_bh (&sc->sc_resetlock); r =ath9k_hw_reset (ah, init_channel, ah->caldata, false);if (r) {
@@ -1116,6 +1138,7 @@ static int ath9k_start(struct ieee80211_"(freq %u MHz)\n" , r, curchan->center_freq);spin_unlock_bh (&sc->sc_resetlock); +spin_unlock_bh (&sc->rx.pcu_lock); goto mutex_unlock; }spin_unlock_bh (&sc->sc_resetlock);
@@ -1137,8 +1160,10 @@ static int ath9k_start(struct ieee80211_ath_print (common,ATH_DBG_FATAL ,"Unable to start recv logic\n" ); r = -EIO ; +spin_unlock_bh (&sc->rx.pcu_lock); goto mutex_unlock; } +spin_unlock_bh (&sc->rx.pcu_lock);/* Setup our intr mask. */ ah->imask = ATH9K_INT_TX | ATH9K_INT_RXEOL |
@@ -1340,12 +1365,14 @@ static void ath9k_stop(struct ieee80211_* before setting the invalid flag. */ ath9k_hw_set_interrupts (ah,0 ); +spin_lock_bh (&sc->rx.pcu_lock);if (!(sc->sc_flags &SC_OP_INVALID )) {ath_drain_all_txq (sc, false);ath_stoprecv (sc);ath9k_hw_phy_disable (ah); }else sc->rx.rxlink =NULL ; +spin_unlock_bh (&sc->rx.pcu_lock);/* disable HAL and put h/w to sleep */ ath9k_hw_disable (ah);
drivers/net/wireless/ath/ath9k/recv.c +0 -2
@@ -523,13 +523,11 @@ bool ath_stoprecv(struct ath_softc *sc)void ath_flushrecv (struct ath_softc *sc) { -spin_lock_bh (&sc->rx.pcu_lock); sc->sc_flags |=SC_OP_RXFLUSH ;if (sc->sc_ah->caps.hw_caps &ATH9K_HW_CAP_EDMA )ath_rx_tasklet (sc,1 , true);ath_rx_tasklet (sc,1 , false); sc->sc_flags &= ~SC_OP_RXFLUSH ; -spin_unlock_bh (&sc->rx.pcu_lock); }static bool ath_beacon_dtim_pending_cab (struct sk_buff *skb)
PATCH 42/289 cfg80211: fix BSS double-unlinking
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Johannes Berg <[email protected]>
commit 3207390a8b58bfc1335750f91cf6783c48ca19ca upstream.
When multiple interfaces are actively trying to associate with the same BSS, they may both find that the BSS isn't there and then try to unlink it. This can cause errors since the unlinking code can't currently deal with items that have already been unlinked.
Normally this doesn't happen as most people don't try to use multiple station interfaces that associate at the same time too.
Fix this by using the list entry as a flag to see if the item is still on a list.
--- net/wireless/scan.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
net/wireless/scan.c +6 -6
@@ -650,14 +650,14 @@ void cfg80211_unlink_bss(struct wiphy *w bss = container_of(pub, struct cfg80211_internal_bss, pub);spin_lock_bh (&dev->bss_lock); +if (!list_empty (&bss->list)) { +list_del_init (&bss->list); + dev->bss_generation++; +rb_erase (&bss->rbn, &dev->bss_tree); -list_del (&bss->list); - dev->bss_generation++; -rb_erase (&bss->rbn, &dev->bss_tree); - +kref_put (&bss->ref, bss_release); + }spin_unlock_bh (&dev->bss_lock); - -kref_put (&bss->ref, bss_release); }EXPORT_SYMBOL (cfg80211_unlink_bss);
PATCH 43/289 cfg80211: fix locking
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Johannes Berg <[email protected]>
commit 2234362c427e2ef667595b9b81c0125003ac5607 upstream.
Add missing unlocking of the wiphy in set_channel, and don't try to unlock a non-existing wiphy in set_cqm.
--- net/wireless/nl80211.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
net/wireless/nl80211.c +7 -4
@@ -761,11 +761,13 @@ static int nl80211_set_channel(struct sk result =get_rdev_dev_by_info_ifindex (info, &rdev, &netdev);if (result) - goto unlock; + goto unlock_rtnl; result =__nl80211_set_channel (rdev, netdev->ieee80211_ptr, info); - unlock: +dev_put (netdev); +cfg80211_unlock_rdev (rdev); + unlock_rtnl:rtnl_unlock ();return result;
@@ -4996,7 +4998,7 @@ static int nl80211_set_cqm_rssi(struct g err =get_rdev_dev_by_info_ifindex (info, &rdev, &dev);if (err) - goto unlock_rdev; + goto unlock_rtnl; wdev = dev->ieee80211_ptr;
@@ -5013,9 +5015,10 @@ static int nl80211_set_cqm_rssi(struct g err = rdev->ops->set_cqm_rssi_config (wdev->wiphy, dev, threshold, hysteresis); -unlock_rdev: + unlock_rdev:cfg80211_unlock_rdev (rdev);dev_put (dev); + unlock_rtnl:rtnl_unlock ();return err;
PATCH 44/289 cfg80211: fix regression on processing country IEs
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit a171fba491f54216e356efa46096171a7ed01d10 upstream.
The patch 4f366c5:
wireless: only use alpha2 regulatory information from country IE
removed some complex intersection we were always doing between the AP's country IE info and what we got from CRDA. When CRDA sent us back a regulatory domain we would do some sanity checks on that regulatory domain response we just got. Part of these sanity checks included checking that we already had performed an intersection for the request of NL80211_REGDOM_SET_BY_COUNTRY_IE type.
This mean that cfg80211 was only processing country IEs for cases where we already had an intersection, but since we removed enforcing this this is no longer required, we should just apply the country IE country hint with the data received from CRDA.
This patch has fixes intended for kernels >= 2.6.36.
--- net/wireless/reg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/reg.c +1 -1
@@ -1170,7 +1170,7 @@ static int ignore_request(struct wiphy *return 0 ;return -EALREADY ; } -return REG_INTERSECT ; +return 0 ;case NL80211_REGDOM_SET_BY_DRIVER :if (last_request->initiator ==NL80211_REGDOM_SET_BY_CORE ) {if (regdom_changes (pending_request->alpha2))
PATCH 45/289 mac80211: minstrel_ht A-MPDU fix
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: =?UTF-8?q?Bj=C3=B6rn=20Smedman?= <[email protected]>
commit 15d46f38df87f89242e470f5797120fa384c1fc3 upstream.
This patch fixes two problems with the minstrel_ht rate control algorithms handling of A-MPDU frames:
1. The ampdu_len field of the tx status is not always initialized for non-HT frames (and it would probably be unreasonable to require all drivers to do so). This could cause rate control statistics to be corrupted. We now trust the ampdu_len and ampdu_ack_len fields only when the frame is marked with the IEEE80211_TX_STAT_AMPDU flag.
2. Successful transmission attempts where only recognized when the A-MPDU subframe carrying the rate control status information was marked with the IEEE80211_TX_STAT_ACK flag. If this information happed to be carried on a frame that failed to be ACKed then the other subframes (which may have succeeded) where not correctly registered. We now update rate control statistics regardless of whether the subframe carrying the information was ACKed or not.
--- net/mac80211/rc80211_minstrel_ht.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
net/mac80211/rc80211_minstrel_ht.c +4 -3
@@ -397,8 +397,9 @@ minstrel_ht_tx_status(void *priv, struct !(info->flags & IEEE80211_TX_STAT_AMPDU)) return; -if (!info->status.ampdu_len) { - info->status.ampdu_ack_len =1 ; +if (!(info->flags &IEEE80211_TX_STAT_AMPDU )) { + info->status.ampdu_ack_len = + (info->flags &IEEE80211_TX_STAT_ACK ?1 :0 ); info->status.ampdu_len =1 ; }
@@ -426,7 +427,7 @@ minstrel_ht_tx_status(void *priv, struct group =minstrel_ht_get_group_idx (&ar[i]); rate = &mi->groups[group].rates[ar[i].idx %8 ]; -if (last && (info->flags &IEEE80211_TX_STAT_ACK )) +if (last) rate->success += info->status.ampdu_ack_len; rate->attempts += ar[i].count * info->status.ampdu_len;
PATCH 46/289 mac80211: fix possible null-pointer de-reference
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christian Lamparter <[email protected]>
commit d12c74528e3065c90df70fbc06ec6ffd6e804738 upstream.
This patch not only fixes a null-pointer de-reference that would be triggered by a PLINK_OPEN frame with mis- matching/incompatible mesh configuration, but also responds correctly to non-compatible PLINK_OPEN frames by generating a PLINK_CLOSE with the right reason code.
The original bug was detected by smatch.
( http://repo.or.cz/w/smatch.git )
net/mac80211/mesh_plink.c +574 mesh_rx_plink_frame(168)
error: we previously assumed 'sta' could be null.
--- net/mac80211/mesh_plink.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
net/mac80211/mesh_plink.c +14 -3
@@ -412,7 +412,7 @@ void mesh_rx_plink_frame(struct ieee8021enum plink_event event;enum plink_frame_type ftype;size_t baselen; -bool deactivated; +bool deactivated, matches_local = true;u8 ie_len;u8 *baseaddr;__le16 plid, llid, reason;
@@ -487,6 +487,7 @@ void mesh_rx_plink_frame(struct ieee8021/* Now we will figure out the appropriate event... */ event =PLINK_UNDEFINED ;if (ftype !=PLINK_CLOSE && (!mesh_matches_local (&elems, sdata))) { + matches_local = false;switch (ftype) {case PLINK_OPEN : event =OPN_RJCT ;
@@ -498,7 +499,15 @@ void mesh_rx_plink_frame(struct ieee8021/* avoid warning */ break ; } -spin_lock_bh (&sta->lock); + } + +if (!sta && !matches_local) { +rcu_read_unlock (); + reason =cpu_to_le16 (MESH_CAPABILITY_POLICY_VIOLATION ); + llid =0 ; +mesh_plink_frame_tx (sdata,PLINK_CLOSE , mgmt->sa, llid, + plid, reason); +return ; }else if (!sta) {/* ftype == PLINK_OPEN */ u32 rates;
@@ -522,7 +531,7 @@ void mesh_rx_plink_frame(struct ieee8021 } event =OPN_ACPT ;spin_lock_bh (&sta->lock); - }else { + }else if (matches_local) {spin_lock_bh (&sta->lock);switch (ftype) {case PLINK_OPEN :
@@ -564,6 +573,8 @@ void mesh_rx_plink_frame(struct ieee8021rcu_read_unlock ();return ; } + }else { +spin_lock_bh (&sta->lock); } mpl_dbg("Mesh plink (peer, state, llid, plid, event): %pM %s %d %d %d\n",
PATCH 47/289 mac80211: fix channel assumption for association done work
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit e7480bbb926c5816e4fbfca70748096bbe0e4978 upstream.
Be consistent and use the wk->chan instead of the local->hw.conf.channel for the association done work. This prevents any possible races against channel changes while we run this work.
In the case that the race did happen we would be initializing the bit rates for the new AP under the assumption of a wrong channel and in the worst case, wrong band. This could lead to trying to assuming we could use CCK frames on 5 GHz, for example.
This patch has a fix for kernels >= v2.6.34
--- net/mac80211/mlme.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/mac80211/mlme.c +3 -3
@@ -1262,7 +1262,7 @@ static bool ieee80211_assoc_success(stru rates =0 ; basic_rates =0 ; - sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; + sband = local->hw.wiphy->bands[wk->chan->band];for (i =0 ; i < elems.supp_rates_len; i++) {int rate = (elems.supp_rates[i] &0x7f ) *5 ;
@@ -1298,11 +1298,11 @@ static bool ieee80211_assoc_success(stru } } - sta->sta.supp_rates[local->hw.conf.channel->band] = rates; + sta->sta.supp_rates[wk->chan->band] = rates; sdata->vif.bss_conf.basic_rates = basic_rates;/* cf. IEEE 802.11 9.2.12 */ -if (local->hw.conf.channel->band ==IEEE80211_BAND_2GHZ && +if (wk->chan->band ==IEEE80211_BAND_2GHZ && have_higher_than_11mbit) sdata->flags |=IEEE80211_SDATA_OPERATING_GMODE ;else
PATCH 48/289 mac80211: fix offchannel assumption upon association
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit 8d4780eb1ece4e8109b4f6b2e5e61f7fc593c3f4 upstream.
Association is dealt with as an atomic offchannel operation, we do this because we don't know we are associated until we get the associatin response from the AP. When we do get the associatin response though we were never clearing the offchannel state. This has a few implications, we told drivers we were still offchannel, and the first configured TX power for the channel does not take into account any power constraints.
For ath9k this meant ANI calibration would not start upon association, and we'd have to wait until the first bgscan to be triggered. There may be other issues this resolves but I'm too lazy to comb the code to check.
--- net/mac80211/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/mac80211/main.c +2 -1
@@ -108,7 +108,8 @@ int ieee80211_hw_config(struct ieee80211 chan = scan_chan; channel_type =NL80211_CHAN_NO_HT ; local->hw.conf.flags |=IEEE80211_CONF_OFFCHANNEL ; - }else if (local->tmp_channel) { + }else if (local->tmp_channel && + local->oper_channel != local->tmp_channel) { chan = scan_chan = local->tmp_channel; channel_type = local->tmp_channel_type; local->hw.conf.flags |=IEEE80211_CONF_OFFCHANNEL ;
PATCH 49/289 mac80211: Fix signal strength average initialization for CQM events
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jouni Malinen <[email protected]>
commit 3ba06c6fbd651ed3377e584026d1c112b492cc8b upstream.
The ave_beacon_signal value uses 1/16 dB unit and as such, must be initialized with the signal level of the first Beacon frame multiplied by 16. This fixes an issue where the initial CQM events are reported incorrectly with a burst of events while the running average approaches the correct value after the incorrect initialization. This could cause user space -based roaming decision process to get quite confused at the moment when we would like to go through authentication and DHCP.
--- net/mac80211/mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/mlme.c +1 -1
@@ -1540,7 +1540,7 @@ static void ieee80211_rx_mgmt_beacon(str ifmgd->last_beacon_signal = rx_status->signal;if (ifmgd->flags &IEEE80211_STA_RESET_SIGNAL_AVE ) { ifmgd->flags &= ~IEEE80211_STA_RESET_SIGNAL_AVE ; - ifmgd->ave_beacon_signal = rx_status->signal; + ifmgd->ave_beacon_signal = rx_status->signal *16 ; ifmgd->last_cqm_event_signal =0 ; }else { ifmgd->ave_beacon_signal =
PATCH 50/289 mac80211: reset connection idle when going offchannel
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit 4730d5977f3e12b828d354f7752cffd94bdf39e5 upstream.
When we go offchannel mac80211 currently leaves alive the connection idle monitor. This should be instead postponed until we come back to our home channel, otherwise by the time we get back to the home channel we could be triggering unecesary probe requests. For APs that do not respond to unicast probe requests (Nexus One is a simple example) this means we essentially get disconnected after the probes fails.
This patch has stable fixes for kernels [2.6.35+]
--- net/mac80211/offchannel.c | 5 +++++ 1 file changed, 5 insertions(+)
net/mac80211/offchannel.c +5 -0
@@ -22,12 +22,15 @@static void ieee80211_offchannel_ps_enable (struct ieee80211_sub_if_data *sdata) {struct ieee80211_local *local = sdata->local; +struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; local->offchannel_ps_enabled = false;/* FIXME: what to do when local->pspolling is true? */ del_timer_sync (&local->dynamic_ps_timer); +del_timer_sync (&ifmgd->conn_mon_timer); +cancel_work_sync (&local->dynamic_ps_enable_work);if (local->hw.conf.flags &IEEE80211_CONF_PS ) {
@@ -85,6 +88,8 @@ static void ieee80211_offchannel_ps_disamod_timer (&local->dynamic_ps_timer, jiffies +msecs_to_jiffies (local->hw.conf.dynamic_ps_timeout)); } + +ieee80211_sta_reset_conn_monitor (sdata); }void ieee80211_offchannel_stop_beaconing (struct ieee80211_local *local)
PATCH 51/289 mac80211: add helper for reseting the connection monitor
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit be099e82e9cf6d5d65d044e9ef6fc8bee3c7a113 upstream.
This will be used in another place later. The connection monitor was added as of 2.6.35 so these fixes will be applicable to >= 2.6.35.
--- net/mac80211/ieee80211_i.h | 1 + net/mac80211/mlme.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-)
net/mac80211/ieee80211_i.h +1 -0
@@ -1003,6 +1003,7 @@ void ieee80211_sta_restart(struct ieee80void ieee80211_sta_work (struct ieee80211_sub_if_data *sdata);void ieee80211_sta_rx_queued_mgmt (struct ieee80211_sub_if_data *sdata,struct sk_buff *skb); +void ieee80211_sta_reset_conn_monitor (struct ieee80211_sub_if_data *sdata);/* IBSS code */ void ieee80211_ibss_notify_scan_completed (struct ieee80211_local *local);
net/mac80211/mlme.c +10 -5
@@ -118,6 +118,15 @@ static void mod_beacon_timer(struct ieee round_jiffies_up(jiffies + IEEE80211_BEACON_LOSS_TIME)); } +void ieee80211_sta_reset_conn_monitor (struct ieee80211_sub_if_data *sdata) +{ +if (sdata->local->hw.flags &IEEE80211_HW_CONNECTION_MONITOR ) +return ; + +mod_timer (&sdata->u.mgd.conn_mon_timer, +round_jiffies_up (jiffies +IEEE80211_CONNECTION_IDLE_TIME )); +} +static int ecw2cw (int ecw) {return (1 << ecw) -1 ;
@@ -1006,11 +1015,7 @@ void ieee80211_sta_rx_notify(struct ieeeif (is_multicast_ether_addr (hdr->addr1))return ; -if (sdata->local->hw.flags &IEEE80211_HW_CONNECTION_MONITOR ) -return ; - -mod_timer (&sdata->u.mgd.conn_mon_timer, -round_jiffies_up (jiffies +IEEE80211_CONNECTION_IDLE_TIME )); +ieee80211_sta_reset_conn_monitor (sdata); }static void ieee80211_mgd_probe_ap_send (struct ieee80211_sub_if_data *sdata)
PATCH 52/289 mac80211: make the beacon monitor available externally
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit d3a910a8e4e846b9a767d35483f4dc7c6de7af82 upstream.
This will be used by other components next. The beacon monitor was added as of 2.6.34 so these fixes are applicable only to kernels >= 2.6.34.
--- net/mac80211/ieee80211_i.h | 1 + net/mac80211/mlme.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-)
net/mac80211/ieee80211_i.h +1 -0
@@ -1003,6 +1003,7 @@ void ieee80211_sta_restart(struct ieee80void ieee80211_sta_work (struct ieee80211_sub_if_data *sdata);void ieee80211_sta_rx_queued_mgmt (struct ieee80211_sub_if_data *sdata,struct sk_buff *skb); +void ieee80211_sta_reset_beacon_monitor (struct ieee80211_sub_if_data *sdata);void ieee80211_sta_reset_conn_monitor (struct ieee80211_sub_if_data *sdata);/* IBSS code */
net/mac80211/mlme.c +4 -4
@@ -109,7 +109,7 @@ static void run_again(struct ieee80211_imod_timer (&ifmgd->timer, timeout); } -static void mod_beacon_timer (struct ieee80211_sub_if_data *sdata) +void ieee80211_sta_reset_beacon_monitor (struct ieee80211_sub_if_data *sdata) {if (sdata->local->hw.flags &IEEE80211_HW_BEACON_FILTER )return ;
@@ -1367,7 +1367,7 @@ static bool ieee80211_assoc_success(stru* Also start the timer that will detect beacon loss. */ ieee80211_sta_rx_notify (sdata, (struct ieee80211_hdr *)mgmt); -mod_beacon_timer (sdata); +ieee80211_sta_reset_beacon_monitor (sdata);return true; }
@@ -1470,7 +1470,7 @@ static void ieee80211_rx_mgmt_probe_resp* we have or will be receiving any beacons or data, so let's * schedule the timers again, just in case. */ -mod_beacon_timer (sdata); +ieee80211_sta_reset_beacon_monitor (sdata); mod_timer(&ifmgd->conn_mon_timer, round_jiffies_up(jiffies +
@@ -1593,7 +1593,7 @@ static void ieee80211_rx_mgmt_beacon(str* Push the beacon loss detection into the future since * we are processing a beacon from the AP just now. */ -mod_beacon_timer (sdata); +ieee80211_sta_reset_beacon_monitor (sdata); ncrc =crc32_be (0 , (void *)&mgmt->u.beacon.beacon_int,4 ); ncrc = ieee802_11_parse_elems_crc(mgmt->u.beacon.variable,
PATCH 53/289 mac80211: send last 3/5 probe requests as unicast
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit f01a067d9e4598c71e3c9ee3a84859d2e8af4f8e upstream.
Some buggy APs do not respond to unicast probe requests or send unicast probe requests very delayed so in the worst case we should try to send broadcast probe requests, otherwise we can get disconnected from these APs.
Even if drivers do not have filters to disregard probe responses from foreign APs mac80211 will only process probe responses from our associated AP for re-arming connection monitoring.
We need to do this since the beacon monitor does not push back the connection monitor by design so even if we are getting beacons from these type of APs our connection monitor currently relies heavily on the way the probe requests are received on the AP. An example of an AP affected by this is the Nexus One, but this has also been observed with random APs.
We can probably optimize this later by using null funcs instead of probe requests.
For more details refer to:
http://code.google.com/p/chromium-os/issues/detail?id=5715
This patch has fixes for stable kernels [2.6.35+].
--- net/mac80211/mlme.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
net/mac80211/mlme.c +11 -2
@@ -1022,10 +1022,19 @@ static void ieee80211_mgd_probe_ap_send( {struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;const u8 *ssid; +u8 *dst = ifmgd->associated->bssid; +u8 unicast_limit =max (1 ,IEEE80211_MAX_PROBE_TRIES -3 ); + +/* +* Try sending broadcast probe requests for the last three +* probe requests after the first ones failed since some +* buggy APs only support broadcast probe requests. +*/ +if (ifmgd->probe_send_count >= unicast_limit) + dst =NULL ; ssid =ieee80211_bss_get_ie (ifmgd->associated,WLAN_EID_SSID ); -ieee80211_send_probe_req (sdata, ifmgd->associated->bssid, - ssid +2 , ssid[1 ],NULL ,0 ); +ieee80211_send_probe_req (sdata, dst, ssid +2 , ssid[1 ],NULL ,0 ); ifmgd->probe_send_count++; ifmgd->probe_timeout = jiffies +IEEE80211_PROBE_WAIT ;
PATCH 54/289 mac80211: disable beacon monitor while going offchannel
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit 3bc3c0d748402e8c1f31b8569f5924d25d7b8e30 upstream.
The beacon monitor should be disabled when going off channel to prevent spurious warnings and triggering connection deterioration work such as sending probe requests. Re-enable the beacon monitor once we come back to the home channel.
This patch has fixes for stable kernels [2.6.34+].
--- net/mac80211/offchannel.c | 2 ++ 1 file changed, 2 insertions(+)
net/mac80211/offchannel.c +2 -0
@@ -29,6 +29,7 @@ static void ieee80211_offchannel_ps_enab/* FIXME: what to do when local->pspolling is true? */ del_timer_sync (&local->dynamic_ps_timer); +del_timer_sync (&ifmgd->bcn_mon_timer);del_timer_sync (&ifmgd->conn_mon_timer);cancel_work_sync (&local->dynamic_ps_enable_work);
@@ -89,6 +90,7 @@ static void ieee80211_offchannel_ps_disa msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout)); } +ieee80211_sta_reset_beacon_monitor (sdata);ieee80211_sta_reset_conn_monitor (sdata); }
PATCH 55/289 mac80211: use correct station flags lock
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Johannes Berg <[email protected]>
commit f5521b13880f4f4f612e1d20dd4f565122d16e04 upstream.
This code is modifying the station flags, and as such should hold the flags lock so it can
do so atomically vs. other flags modifications and readers. This issue was introduced when this code was added in eccb8e8f, as it used
the wrong lock (thus not fixing the race that was previously documented in a comment.)
--- net/mac80211/cfg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/mac80211/cfg.c +3 -2
@@ -634,6 +634,7 @@ static void sta_apply_parameters(structstruct sta_info *sta, struct station_parameters *params) { + unsigned long flags;u32 rates;int i, j;struct ieee80211_supported_band *sband;
@@ -642,7 +643,7 @@ static void sta_apply_parameters(struct sband = local->hw.wiphy->bands[local->oper_channel->band]; -spin_lock_bh (&sta->lock); +spin_lock_irqsave (&sta->flaglock, flags); mask = params->sta_flags_mask; set = params->sta_flags_set;
@@ -669,7 +670,7 @@ static void sta_apply_parameters(structif (set &BIT (NL80211_STA_FLAG_MFP )) sta->flags |=WLAN_STA_MFP ; } -spin_unlock_bh (&sta->lock); +spin_unlock_irqrestore (&sta->flaglock, flags);/* * cfg80211 validates this (1-2007) and allows setting the AID
PATCH 56/289 mac80211: clear txflags for ps-filtered frames
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christian Lamparter <[email protected]>
commit eb7d3066cf864342e8ae6a5c1126a1602c4d06c0 upstream.
This patch fixes stale mac80211_tx_control_flags for filtered / retried frames.
Because ieee80211_handle_filtered_frame feeds skbs back into the tx path, they have to be stripped of some tx flags so they won't confuse the stack, driver or device.
--- include/net/mac80211.h | 16 ++++++++++++++++ net/mac80211/status.c | 1 + 2 files changed, 17 insertions(+)
include/net/mac80211.h +16 -0
@@ -315,6 +315,9 @@ struct ieee80211_bss_conf {* @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this * frame and selects the maximum number of streams that it can use. +* +* Note: If you have to add new flags to the enumeration, then don't +* forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. */ enum mac80211_tx_control_flags {IEEE80211_TX_CTL_REQ_TX_STATUS =BIT (0 ),
@@ -344,6 +347,19 @@ enum mac80211_tx_control_flags {#define IEEE80211_TX_CTL_STBC_SHIFT 23 +/* +* This definition is used as a mask to clear all temporary flags, which are +* set by the tx handlers for each transmission attempt by the mac80211 stack. +*/ +#define IEEE80211_TX_TEMPORARY_FLAGS (IEEE80211_TX_CTL_NO_ACK | \ + IEEE80211_TX_CTL_CLEAR_PS_FILT | IEEE80211_TX_CTL_FIRST_FRAGMENT | \ + IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \ + IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \ + IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \ + IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_PSPOLL_RESPONSE | \ + IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \ + IEEE80211_TX_CTL_STBC) +/** * enum mac80211_rate_control_flags - per-rate flags set by the * Rate Control algorithm.
net/mac80211/status.c +1 -0
@@ -58,6 +58,7 @@ static void ieee80211_handle_filtered_fr info->control.vif = &sta->sdata->vif; info->flags |=IEEE80211_TX_INTFL_NEED_TXPROCESSING |IEEE80211_TX_INTFL_RETRANSMISSION ; + info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS ; sta->tx_filtered_count++;
PATCH 57/289 mac80211: reset probe send counter upon connection timer reset
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Luis R. Rodriguez <[email protected]>
commit 0c699c3a75d4e8d0d2c317f83048d8fd3ffe692a upstream.
Upon beacon loss we send probe requests after 30 seconds of idle time and we wait for each probe response 1/2 second. We send a total of 3 probe requests before giving up on the AP. In the case that we reset the connection idle monitor we should reset the probe requests count to 0. Right now this won't help in any way but the next patch will.
This patch has fixes for stable kernel [2.6.35+].
--- net/mac80211/mlme.c | 4 ++++ 1 file changed, 4 insertions(+)
net/mac80211/mlme.c +4 -0
@@ -120,11 +120,15 @@ void ieee80211_sta_reset_beacon_monitor(void ieee80211_sta_reset_conn_monitor (struct ieee80211_sub_if_data *sdata) { +struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; +if (sdata->local->hw.flags &IEEE80211_HW_CONNECTION_MONITOR )return ;mod_timer (&sdata->u.mgd.conn_mon_timer,round_jiffies_up (jiffies +IEEE80211_CONNECTION_IDLE_TIME )); + + ifmgd->probe_send_count =0 ; }static int ecw2cw (int ecw)
PATCH 58/289 mac80211: Fix ibss station got expired immediately
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Rajkumar Manoharan <[email protected]>
commit c8716d9dc13c7f6ee92f2bfc6cc3b723b417bff8 upstream.
Station addition in ieee80211_ibss_rx_queued_mgmt is not updating sta->last_rx which is causing station expiry in ieee80211_ibss_work path. So sta addition and deletion happens repeatedly.
--- net/mac80211/ibss.c | 1 + 1 file changed, 1 insertion(+)
net/mac80211/ibss.c +1 -0
@@ -435,6 +435,7 @@ struct sta_info *ieee80211_ibss_add_sta(if (!sta)return NULL ; + sta->last_rx = jiffies;set_sta_flags (sta,WLAN_STA_AUTHORIZED );/* make sure mandatory rates are always added */
PATCH 59/289 mac80211: dont sanitize invalid rates
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christian Lamparter <[email protected]>
commit 5f4e6b2d3c74c1adda1cbfd9d9d30da22c7484fc upstream.
I found this bug while poking around with a pure-gn AP.
Commit:
cfg80211/mac80211: Use more generic bitrate mask for rate control
Added some sanity checks to ensure that each tx rate index is included in the configured mask and it would change any rate indexes if it wasn't.
But, the current implementation doesn't take into account that the invalid rate index "-1" has a special meaning (= no further attempts) and it should not be "changed".
--- net/mac80211/rate.c | 3 +++ 1 file changed, 3 insertions(+)
net/mac80211/rate.c +3 -0
@@ -328,6 +328,9 @@ void rate_control_get_rate(struct ieee80* if needed. */ for (i =0 ; i <IEEE80211_TX_MAX_RATES ; i++) { +/* Skip invalid rates */ +if (info->control.rates[i].idx <0 ) +break ;/* Rate masking supports only legacy rates for now */ if (info->control.rates[i].flags &IEEE80211_TX_RC_MCS )continue ;
PATCH 60/289 mac80211: delete AddBA response timer
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Johannes Berg <[email protected]>
commit 44271488b91c9eecf249e075a1805dd887e222d2 upstream.
We never delete the addBA response timer, which is typically fine, but if the station it belongs to is deleted very quickly after starting the BA session, before the peer had a chance to reply, the timer may fire after the station struct has been freed already. Therefore, we need to delete the timer in a suitable spot -- best when the session is being stopped (which will happen even then) in which case the delete will be a no-op most of the time.
I've reproduced the scenario and tested the fix.
This fixes the crash reported at
http://mid.gmane.org/[email protected]
--- net/mac80211/agg-tx.c | 2 ++ 1 file changed, 2 insertions(+)
net/mac80211/agg-tx.c +2 -0
@@ -177,6 +177,8 @@ int ___ieee80211_stop_tx_ba_session(strudel_timer_sync (&tid_tx->addba_resp_timer); +del_timer_sync (&tid_tx->addba_resp_timer); +/* * After this packets are no longer handed right through * to the driver but are put onto tid_tx->pending instead,
PATCH 61/289 isdn/gigaset: fix bas_gigaset AT read error handling
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tilman Schmidt <[email protected]>
commit c8701a08d6a4efeae45d84d0aa87172f23b14e3c upstream.
Rework the handling of USB errors in AT response reads to fix a possible infinite retry loop and a memory leak, and silence a few overly verbose kernel messages.
--- drivers/isdn/gigaset/bas-gigaset.c | 83 ++++++++++++++----------------------- 1 file changed, 33 insertions(+), 50 deletions(-)
drivers/isdn/gigaset/bas-gigaset.c +33 -50
@@ -438,23 +438,27 @@ static void cmd_in_timeout(unsigned longreturn ; } -if (ucs->retry_cmd_in++ <BAS_RETRY ) { -dev_notice (cs->dev,"control read: timeout, retry %d\n" , - ucs->retry_cmd_in); - rc =atread_submit (cs,BAS_TIMEOUT ); -if (rc >=0 || rc == -ENODEV ) -/* resubmitted or disconnected */ -/* - bypass regular exit block */ -return ; - }else { +if (ucs->retry_cmd_in++ >=BAS_RETRY ) {dev_err (cs->dev,"control read: timeout, giving up after %d tries\n" , ucs->retry_cmd_in); +kfree (ucs->rcvbuf); + ucs->rcvbuf =NULL ; + ucs->rcvbuf_size =0 ; +error_reset (cs); +return ; + } + +gig_dbg (DEBUG_USBREQ ,"%s: timeout, retry %d" , + __func__, ucs->retry_cmd_in); + rc =atread_submit (cs,BAS_TIMEOUT ); +if (rc <0 ) { +kfree (ucs->rcvbuf); + ucs->rcvbuf =NULL ; + ucs->rcvbuf_size =0 ; +if (rc != -ENODEV ) +error_reset (cs); } -kfree (ucs->rcvbuf); - ucs->rcvbuf =NULL ; - ucs->rcvbuf_size =0 ; -error_reset (cs); }/* read_ctrl_callback
@@ -470,18 +474,11 @@ static void read_ctrl_callback(struct urstruct cardstate *cs = inbuf->cs;struct bas_cardstate *ucs = cs->hw.bas;int status = urb->status; -int have_data =0 ;unsigned numbytes;int rc;update_basstate (ucs,0 ,BS_ATRDPEND );wake_up (&ucs->waitqueue); - -if (!ucs->rcvbuf_size) { -dev_warn (cs->dev,"%s: no receive in progress\n" , __func__); -return ; - } -del_timer (&ucs->timer_cmd_in);switch (status) {
@@ -495,19 +492,10 @@ static void read_ctrl_callback(struct ur numbytes = ucs->rcvbuf_size; } -/* copy received bytes to inbuf */ - have_data =gigaset_fill_inbuf (inbuf, ucs->rcvbuf, numbytes); - -if (unlikely (numbytes < ucs->rcvbuf_size)) { -/* incomplete - resubmit for remaining bytes */ - ucs->rcvbuf_size -= numbytes; - ucs->retry_cmd_in =0 ; - rc =atread_submit (cs,BAS_TIMEOUT ); -if (rc >=0 || rc == -ENODEV ) -/* resubmitted or disconnected */ -/* - bypass regular exit block */ -return ; -error_reset (cs); +/* copy received bytes to inbuf, notify event layer */ +if (gigaset_fill_inbuf (inbuf, ucs->rcvbuf, numbytes)) { +gig_dbg (DEBUG_INTR ,"%s-->BH" , __func__); +gigaset_schedule_event (cs); }break ;
@@ -516,37 +504,32 @@ static void read_ctrl_callback(struct urcase -EINPROGRESS :/* pending */ case -ENODEV :/* device removed */ case -ESHUTDOWN :/* device shut down */ -/* no action necessary */ +/* no further action necessary */ gig_dbg (DEBUG_USBREQ ,"%s: %s" , __func__,get_usb_statmsg (status));break ; -default :/* severe trouble */ -dev_warn (cs->dev,"control read: %s\n" , -get_usb_statmsg (status)); +default :/* other errors: retry */ if (ucs->retry_cmd_in++ <BAS_RETRY ) { -dev_notice (cs->dev,"control read: retry %d\n" , - ucs->retry_cmd_in); +gig_dbg (DEBUG_USBREQ ,"%s: %s, retry %d" , __func__, +get_usb_statmsg (status), ucs->retry_cmd_in); rc =atread_submit (cs,BAS_TIMEOUT ); -if (rc >=0 || rc == -ENODEV ) -/* resubmitted or disconnected */ -/* - bypass regular exit block */ +if (rc >=0 ) +/* successfully resubmitted, skip freeing */ return ; - }else { -dev_err (cs->dev, -"control read: giving up after %d tries\n" , - ucs->retry_cmd_in); +if (rc == -ENODEV ) +/* disconnect, no further action necessary */ +break ; } +dev_err (cs->dev,"control read: %s, giving up after %d tries\n" , +get_usb_statmsg (status), ucs->retry_cmd_in);error_reset (cs); } +/* read finished, free buffer */ kfree (ucs->rcvbuf); ucs->rcvbuf =NULL ; ucs->rcvbuf_size =0 ; -if (have_data) { -gig_dbg (DEBUG_INTR ,"%s-->BH" , __func__); -gigaset_schedule_event (cs); - } }/* atread_submit
PATCH 62/289 isdn/gigaset: correct bas_gigaset rx buffer handling
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tilman Schmidt <[email protected]>
commit f3d531b99fb30945b4a64d6e2e86e1e62605aca5 upstream.
In transparent data reception, avoid a NULL pointer dereference in case an skbuff cannot be allocated, remove an inappropriate call to the HDLC flush routine, and correct the accounting of received bytes for continued buffers.
--- drivers/isdn/gigaset/isocdata.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/isdn/gigaset/isocdata.c +5 -3
@@ -842,13 +842,14 @@ static inline void trans_receive(unsigneif (unlikely (bcs->ignore)) { bcs->ignore--; -hdlc_flush (bcs);return ; } skb = bcs->rx_skb; -if (skb ==NULL ) +if (skb ==NULL ) { skb =gigaset_new_rx_skb (bcs); - bcs->hw.bas->goodbytes += skb->len; +if (skb ==NULL ) +return ; + } dobytes = bcs->rx_bufsize - skb->len;while (count >0 ) { dst =skb_put (skb, count < dobytes ? count : dobytes);
@@ -860,6 +861,7 @@ static inline void trans_receive(unsigneif (dobytes ==0 ) {dump_bytes (DEBUG_STREAM_DUMP ,"rcv data" , skb->data, skb->len); + bcs->hw.bas->goodbytes += skb->len;gigaset_skb_rcvd (bcs, skb); skb =gigaset_new_rx_skb (bcs);if (skb ==NULL )
PATCH 63/289 isdn/gigaset: bas_gigaset locking fix
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tilman Schmidt <[email protected]>
commit b33ffa5cbf52ee751bb8068218ebb3c742c5a515 upstream.
Unlock cs->lock before calling error_hangup() which is marked "cs->lock must not be held".
--- drivers/isdn/gigaset/bas-gigaset.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/isdn/gigaset/bas-gigaset.c +3 -3
@@ -1581,13 +1581,13 @@ static int gigaset_init_bchannel(struct ret =starturbs (bcs);if (ret <0 ) { +spin_unlock_irqrestore (&cs->lock, flags);dev_err (cs->dev,"could not start isochronous I/O for channel B%d: %s\n" , bcs->channel +1 , ret == -EFAULT ?"null URB" :get_usb_rcmsg (ret));if (ret != -ENODEV )error_hangup (bcs); -spin_unlock_irqrestore (&cs->lock, flags);return ret; }
@@ -1597,11 +1597,11 @@ static int gigaset_init_bchannel(structdev_err (cs->dev,"could not open channel B%d\n" , bcs->channel +1 );stopurbs (bcs->hw.bas); -if (ret != -ENODEV ) -error_hangup (bcs); }spin_unlock_irqrestore (&cs->lock, flags); +if (ret <0 && ret != -ENODEV ) +error_hangup (bcs);return ret; }
PATCH 64/289 i2c-pca-platform: Change device name of request_irq
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Nobuhiro Iwamatsu <[email protected]>
commit 323584436db0cb05286425d4dfd9516fce88487f upstream.
i2c->adap.name shouldn't be used in request_irq. Instead the driver name "i2c-pca-platform" should be used.
--- drivers/i2c/busses/i2c-pca-platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-pca-platform.c +1 -1
@@ -224,7 +224,7 @@ static int __devinit i2c_pca_pf_probe(stif (irq) { ret =request_irq (irq, i2c_pca_pf_handler, -IRQF_TRIGGER_FALLING , i2c->adap.name, i2c); +IRQF_TRIGGER_FALLING , pdev->name, i2c);if (ret) goto e_reqirq; }
PATCH 65/289 viafb: fix i2c_transfer error handling
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Florian Tobias Schandinat <[email protected]>
commit 85c5702ac046b14713f776d59768252d8ed8018f upstream.
i2c_transfer returns negative errno on error and number of messages processed on success. Just returning this value would give a poor interface as it is not obvious that you must compare with 2 after reading 1 or n bytes and with 1 after writing 1 byte to determine if it was successful. To avoid this error prone interface convert the error code of a successful read/write to zero and all other non-negative values to an negative error code.
This fixes a regression introduced by
via: Rationalize vt1636 detection
which resulted in no longer detecting a VT1636 chip and therefore has broken the output in configurations which contain this chip.
--- drivers/video/via/via_i2c.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-)
drivers/video/via/via_i2c.c +24 -3
@@ -114,6 +114,7 @@ static void via_i2c_setsda(void *data, iint viafb_i2c_readbyte (u8 adap,u8 slave_addr,u8 index,u8 *pdata) { +int ret;u8 mm1[] = {0x00 };struct i2c_msg msgs[2 ];
@@ -126,11 +127,18 @@ int viafb_i2c_readbyte(u8 adap, u8 slave mm1[0 ] = index; msgs[0 ].len =1 ; msgs[1 ].len =1 ; msgs[0 ].buf = mm1; msgs[1 ].buf = pdata; -return i2c_transfer (&via_i2c_par[adap].adapter, msgs,2 ); + ret =i2c_transfer (&via_i2c_par[adap].adapter, msgs,2 ); +if (ret ==2 ) + ret =0 ; +else if (ret >=0 ) + ret = -EIO ; + +return ret; }int viafb_i2c_writebyte (u8 adap,u8 slave_addr,u8 index,u8 data) { +int ret;u8 msg[2 ] = { index, data };struct i2c_msg msgs;
@@ -140,11 +148,18 @@ int viafb_i2c_writebyte(u8 adap, u8 slav msgs.addr = slave_addr /2 ; msgs.len =2 ; msgs.buf = msg; -return i2c_transfer (&via_i2c_par[adap].adapter, &msgs,1 ); + ret =i2c_transfer (&via_i2c_par[adap].adapter, &msgs,1 ); +if (ret ==1 ) + ret =0 ; +else if (ret >=0 ) + ret = -EIO ; + +return ret; }int viafb_i2c_readbytes (u8 adap,u8 slave_addr,u8 index,u8 *buff,int buff_len) { +int ret;u8 mm1[] = {0x00 };struct i2c_msg msgs[2 ];
@@ -156,7 +171,13 @@ int viafb_i2c_readbytes(u8 adap, u8 slav mm1[0 ] = index; msgs[0 ].len =1 ; msgs[1 ].len = buff_len; msgs[0 ].buf = mm1; msgs[1 ].buf = buff; -return i2c_transfer (&via_i2c_par[adap].adapter, msgs,2 ); + ret =i2c_transfer (&via_i2c_par[adap].adapter, msgs,2 ); +if (ret ==2 ) + ret =0 ; +else if (ret >=0 ) + ret = -EIO ; + +return ret; }/*
PATCH 66/289 drm/radeon/kms: register an i2c adapter name for the dp aux bus
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit a5193fe50e7f21c26d22c17c8196420fac1a3ca7 upstream.
This causes the connector to not be added since i2c init fails for the adapter. Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=31688
Noticed by Ari Savolainen.
--- drivers/gpu/drm/radeon/radeon_i2c.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/radeon/radeon_i2c.c +1 -0
@@ -946,6 +946,7 @@ struct radeon_i2c_chan *radeon_i2c_creat i2c->rec = *rec; i2c->adapter.owner =THIS_MODULE ; i2c->dev = dev; +sprintf (i2c->adapter.name,"Radeon aux bus %s" , name);i2c_set_adapdata (&i2c->adapter, i2c); i2c->adapter.algo_data = &i2c->algo.dp; i2c->algo.dp.aux_ch = radeon_dp_i2c_aux_ch;
PATCH 67/289 ALSA: hda - Disable sticky PCM stream assignment for AD codecs
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <[email protected]>
commit 0e7adbe263f89ea2ef15b5af5e80a812b2a85025 upstream.
The sticky PCM stream assignment introduced in 2.6.36 kernel seems causing problems on AD codecs. At some time later, the streaming no longer works by unknown reason. A simple workaround is to disable sticky-assignment for these codecs.
--- sound/pci/hda/hda_codec.c | 3 +++ sound/pci/hda/hda_codec.h | 1 + sound/pci/hda/patch_analog.c | 7 +++++++ 3 files changed, 11 insertions(+)
sound/pci/hda/hda_codec.c +3 -0
@@ -1281,6 +1281,9 @@ void __snd_hda_codec_cleanup_stream(struif (!nid)return ; +if (codec->no_sticky_stream) + do_now =1 ; +snd_printdd ("hda_codec_cleanup_stream: NID=0x%x\n" , nid); p =get_hda_cvt_setup (codec, nid);if (p) {
sound/pci/hda/hda_codec.h +1 -0
@@ -850,6 +850,7 @@ struct hda_codec { unsigned int pin_amp_workaround:1; /* pin out-amp takes index* (e.g. Conexant codecs) */ + unsigned int no_sticky_stream:1; /* no sticky-PCM stream assignment */ unsigned int pins_shutup:1; /* pins are shut up */ unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */#ifdef CONFIG_SND_HDA_POWER_SAVE
sound/pci/hda/patch_analog.c +7 -0
@@ -1276,6 +1276,7 @@ static int patch_ad1986a(struct hda_code spec->multiout.no_share_stream =1 ; codec->no_trigger_sense =1 ; + codec->no_sticky_stream =1 ;return 0 ; }
@@ -1463,6 +1464,7 @@ static int patch_ad1983(struct hda_codec codec->patch_ops = ad198x_patch_ops; codec->no_trigger_sense =1 ; + codec->no_sticky_stream =1 ;return 0 ; }
@@ -1917,6 +1919,7 @@ static int patch_ad1981(struct hda_codec } codec->no_trigger_sense =1 ; + codec->no_sticky_stream =1 ;return 0 ; }
@@ -3235,6 +3238,7 @@ static int patch_ad1988(struct hda_codec spec->vmaster_nid =0x04 ; codec->no_trigger_sense =1 ; + codec->no_sticky_stream =1 ;return 0 ; }
@@ -3449,6 +3453,7 @@ static int patch_ad1884(struct hda_codec codec->patch_ops = ad198x_patch_ops; codec->no_trigger_sense =1 ; + codec->no_sticky_stream =1 ;return 0 ; }
@@ -4422,6 +4427,7 @@ static int patch_ad1884a(struct hda_code } codec->no_trigger_sense =1 ; + codec->no_sticky_stream =1 ;return 0 ; }
@@ -4761,6 +4767,7 @@ static int patch_ad1882(struct hda_codec } codec->no_trigger_sense =1 ; + codec->no_sticky_stream =1 ;return 0 ; }
PATCH 68/289 ALSA: hda - Add workarounds for CT-IBG controllers
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <[email protected]>
commit 62b7e5e09bcb854ff05e6ee1aa161f8283dc36ee upstream.
Creative IBG controllers require the playback stream-tags to be started from 1, instead of capture+1. Otherwise the stream stalls.
--- sound/pci/hda/hda_codec.c | 5 ++++- sound/pci/hda/hda_intel.c | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-)
sound/pci/hda/hda_codec.c +4 -1
@@ -1216,6 +1216,7 @@ void snd_hda_codec_setup_stream(struct hstruct hda_codec *c;struct hda_cvt_setup *p;unsigned int oldval, newval; +int type;int i;if (!nid)
@@ -1254,10 +1255,12 @@ void snd_hda_codec_setup_stream(struct h p->dirty =0 ;/* make other inactive cvts with the same stream-tag dirty */ + type =get_wcaps_type (get_wcaps (codec, nid));list_for_each_entry (c, &codec->bus->codec_list, list) {for (i =0 ; i < c->cvt_setups.used; i++) { p =snd_array_elem (&c->cvt_setups, i); -if (!p->active && p->stream_tag == stream_tag) +if (!p->active && p->stream_tag == stream_tag && +get_wcaps_type (get_wcaps (codec, p->nid)) == type) p->dirty =1 ; } }
sound/pci/hda/hda_intel.c +7 -2
@@ -1647,7 +1647,7 @@ static int azx_pcm_prepare(struct snd_pcstruct azx_dev *azx_dev =get_azx_dev (substream);struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream];struct snd_pcm_runtime *runtime = substream->runtime; -unsigned int bufsize, period_bytes, format_val; +unsigned int bufsize, period_bytes, format_val, stream_tag;int err;azx_stream_reset (chip, azx_dev);
@@ -1689,7 +1689,12 @@ static int azx_pcm_prepare(struct snd_pcelse azx_dev->fifo_size =0 ; -return snd_hda_codec_prepare (apcm->codec, hinfo, azx_dev->stream_tag, + stream_tag = azx_dev->stream_tag; +/* CA-IBG chips need the playback stream starting from 1 */ +if (chip->driver_type ==AZX_DRIVER_CTX && + stream_tag > chip->capture_streams) + stream_tag -= chip->capture_streams; +return snd_hda_codec_prepare (apcm->codec, hinfo, stream_tag, azx_dev->format_val, substream); }
PATCH 69/289 ALSA: hda - Fix wrong SPDIF NID assignment for CA0110
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <[email protected]>
commit 24b55c69b66eb2a122842820ec14ab215fc8572f upstream.
The dig_out_nid field must take a digital-converter widget, but the current ca0110 parser passed the pin wrongly instead.
--- sound/pci/hda/patch_ca0110.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_ca0110.c +1 -1
@@ -489,7 +489,7 @@ static void parse_digital(struct hda_codif (cfg->dig_outs &&snd_hda_get_connections (codec, cfg->dig_out_pins[0 ], &spec->dig_out,1 ) ==1 ) - spec->multiout.dig_out_nid = cfg->dig_out_pins[0 ]; + spec->multiout.dig_out_nid = spec->dig_out; }static int ca0110_parse_auto_config (struct hda_codec *codec)
PATCH 70/289 ALSA: hda - Add some workarounds for Creative IBG
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <[email protected]>
commit 14d34f166c57e77e3d7f9bc8b43d349186d922c1 upstream.
Creative HD-audio controller chips require some workarounds:
- Additional delay before RIRB response
- Set the initial RIRB counter to 0xc0
The latter seems to be done in general in Windows driver, so we may use this value later for all types if it's confirmed to work better.
--- sound/pci/hda/hda_intel.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
sound/pci/hda/hda_intel.c +12 -4
@@ -458,6 +458,7 @@ enum {AZX_DRIVER_ULI ,AZX_DRIVER_NVIDIA ,AZX_DRIVER_TERA , +AZX_DRIVER_CTX ,AZX_DRIVER_GENERIC , AZX_NUM_DRIVERS, /* keep this as last entry */ };
@@ -473,6 +474,7 @@ static char *driver_short_names[] __devi [AZX_DRIVER_ULI] = "HDA ULI M5461", [AZX_DRIVER_NVIDIA] = "HDA NVidia", [AZX_DRIVER_TERA] = "HDA Teradici", + [AZX_DRIVER_CTX] = "HDA Creative", [AZX_DRIVER_GENERIC] = "HD-Audio Generic", };
@@ -563,7 +565,10 @@ static void azx_init_cmd_io(struct azx */* reset the rirb hw write pointer */ azx_writew (chip,RIRBWP ,ICH6_RIRBWP_RST );/* set N=1, get RIRB response interrupt for new entry */ -azx_writew (chip,RINTCNT ,1 ); +if (chip->driver_type ==AZX_DRIVER_CTX ) +azx_writew (chip,RINTCNT ,0xc0 ); +else +azx_writew (chip,RINTCNT ,1 );/* enable rirb dma and response irq */ azx_writeb (chip,RIRBCTL ,ICH6_RBCTL_DMA_EN |ICH6_RBCTL_IRQ_EN );spin_unlock_irq (&chip->reg_lock);
@@ -1136,8 +1141,11 @@ static irqreturn_t azx_interrupt(int irq/* clear rirb int */ status =azx_readb (chip,RIRBSTS );if (status &RIRB_INT_MASK ) { -if (status &RIRB_INT_RESPONSE ) +if (status &RIRB_INT_RESPONSE ) { +if (chip->driver_type ==AZX_DRIVER_CTX ) +udelay (80 );azx_update_rirb (chip); + }azx_writeb (chip,RIRBSTS ,RIRB_INT_MASK ); }
@@ -2799,10 +2807,10 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) { PCI_DEVICE(PCI_VENDOR_ID_CREATIVE, PCI_ANY_ID), .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8, .class_mask = 0xffffff, - .driver_data = AZX_DRIVER_GENERIC }, + .driver_data = AZX_DRIVER_CTX }, #else /* this entry seems still valid -- i.e. without emu20kx chip */ - { PCI_DEVICE(0x1102, 0x0009), .driver_data = AZX_DRIVER_GENERIC }, + { PCI_DEVICE(0x1102, 0x0009), .driver_data = AZX_DRIVER_CTX }, #endif /* AMD/ATI Generic, PCI class code and Vendor ID for HD Audio */ { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID),
PATCH 71/289 ALSA: OSS mixer emulation - fix locking
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jaroslav Kysela <[email protected]>
commit 838c364ff05c143fd1810e8ad1469935d6c23a7a upstream.
Fix mutex release and cleanup some locking code.
--- sound/core/oss/mixer_oss.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
sound/core/oss/mixer_oss.c +8 -4
@@ -618,8 +618,10 @@ static void snd_mixer_oss_put_volume1_voif (numid ==ID_UNKNOWN )return ;down_read (&card->controls_rwsem); -if ((kctl =snd_ctl_find_numid (card, numid)) ==NULL ) +if ((kctl =snd_ctl_find_numid (card, numid)) ==NULL ) { +up_read (&card->controls_rwsem);return ; + } uinfo =kzalloc (sizeof (*uinfo),GFP_KERNEL ); uctl =kzalloc (sizeof (*uctl),GFP_KERNEL );if (uinfo ==NULL || uctl ==NULL )
@@ -658,7 +660,7 @@ static void snd_mixer_oss_put_volume1_swreturn ;down_read (&card->controls_rwsem);if ((kctl =snd_ctl_find_numid (card, numid)) ==NULL ) { -up_read (&fmixer->card->controls_rwsem); +up_read (&card->controls_rwsem);return ; } uinfo =kzalloc (sizeof (*uinfo),GFP_KERNEL );
@@ -797,7 +799,7 @@ static int snd_mixer_oss_get_recsrc2(str uctl =kzalloc (sizeof (*uctl),GFP_KERNEL );if (uinfo ==NULL || uctl ==NULL ) { err = -ENOMEM ; - goto __unlock; + goto __free_only; }down_read (&card->controls_rwsem); kctl =snd_mixer_oss_test_id (mixer,"Capture Source" ,0 );
@@ -826,6 +828,7 @@ static int snd_mixer_oss_get_recsrc2(str err =0 ; __unlock:up_read (&card->controls_rwsem); + __free_only:kfree (uctl);kfree (uinfo);return err;
@@ -847,7 +850,7 @@ static int snd_mixer_oss_put_recsrc2(str uctl =kzalloc (sizeof (*uctl),GFP_KERNEL );if (uinfo ==NULL || uctl ==NULL ) { err = -ENOMEM ; - goto __unlock; + goto __free_only; }down_read (&card->controls_rwsem); kctl =snd_mixer_oss_test_id (mixer,"Capture Source" ,0 );
@@ -880,6 +883,7 @@ static int snd_mixer_oss_put_recsrc2(str err =0 ; __unlock:up_read (&card->controls_rwsem); + __free_only:kfree (uctl);kfree (uinfo);return err;
PATCH 72/289 ALSA: HDA: Enable internal mic on Dell E6410 and Dell E6510
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Henningsson <[email protected]>
[Not upstream as .37 fixes this differently in a much more complete way that is not able to be backported easily.]
(Ported on top of 2.6.36)
--- sound/pci/hda/patch_sigmatel.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
sound/pci/hda/patch_sigmatel.c +14 -0
@@ -93,6 +93,7 @@ enum {STAC_92HD83XXX_REF ,STAC_92HD83XXX_PWR_REF ,STAC_DELL_S14 , +STAC_DELL_E6410 ,STAC_92HD83XXX_HP ,STAC_HP_DV7_4000 ,STAC_92HD83XXX_MODELS
@@ -1633,6 +1634,13 @@ static unsigned int dell_s14_pin_configs 0x40f000f0, 0x40f000f0, }; +/* Deliberately turn off 0x0f (Dock Mic) to make it choose Int Mic instead */ +static unsigned int dell_e6410_pin_configs[10 ] = { +0x04a11020 ,0x0421101f ,0x400000f0 ,0x90170110 , +0x23011050 ,0x40f000f0 ,0x400000f0 ,0x90a60130 , +0x40f000f0 ,0x40f000f0 , +}; +static unsigned int hp_dv7_4000_pin_configs[10 ] = {0x03a12050 ,0x0321201f ,0x40f000f0 ,0x90170110 ,0x40f000f0 ,0x40f000f0 ,0x90170110 ,0xd5a30140 ,
@@ -1643,6 +1651,7 @@ static unsigned int *stac92hd83xxx_brd_t [STAC_92HD83XXX_REF] = ref92hd83xxx_pin_configs, [STAC_92HD83XXX_PWR_REF] = ref92hd83xxx_pin_configs, [STAC_DELL_S14] = dell_s14_pin_configs, + [STAC_DELL_E6410] = dell_e6410_pin_configs, [STAC_HP_DV7_4000] = hp_dv7_4000_pin_configs, };
@@ -1651,6 +1660,7 @@ static const char *stac92hd83xxx_models[ [STAC_92HD83XXX_REF] = "ref", [STAC_92HD83XXX_PWR_REF] = "mic-ref", [STAC_DELL_S14] = "dell-s14", + [STAC_DELL_E6410] = "dell-e6410", [STAC_92HD83XXX_HP] = "hp", [STAC_HP_DV7_4000] = "hp-dv7-4000", };
@@ -1663,6 +1673,10 @@ static struct snd_pci_quirk stac92hd83xx "DFI LanParty", STAC_92HD83XXX_REF),SND_PCI_QUIRK (PCI_VENDOR_ID_DELL ,0x02ba ,"unknown Dell" ,STAC_DELL_S14 ), +SND_PCI_QUIRK (PCI_VENDOR_ID_DELL ,0x040a , +"Dell E6410" ,STAC_DELL_E6410 ), +SND_PCI_QUIRK (PCI_VENDOR_ID_DELL ,0x040b , +"Dell E6510" ,STAC_DELL_E6410 ),SND_PCI_QUIRK_MASK (PCI_VENDOR_ID_HP ,0xff00 ,0x3600 , "HP", STAC_92HD83XXX_HP), {} /* terminator */
PATCH 73/289 powerpc: Fix call to subpage_protection()
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Michael Neuling <[email protected]>
commit 1c2c25c78740b2796c7c06640784cb6732fa4907 upstream.
In:
powerpc/mm: Fix pgtable cache cleanup with CONFIG_PPC_SUBPAGE_PROT commit d28513bc7f675d28b479db666d572e078ecf182d
Author: David Gibson <[email protected]>
subpage_protection() was changed to to take an mm rather a pgdir but it didn't change calling site in hashpage_preload(). The change wasn't noticed at compile time since hashpage_preload() used a void* as the parameter to subpage_protection().
This is obviously wrong and can trigger the following crash when CONFIG_SLAB, CONFIG_DEBUG_SLAB, CONFIG_PPC_64K_PAGES CONFIG_PPC_SUBPAGE_PROT are enabled.
Freeing unused kernel memory: 704k freed
Unable to handle kernel paging request for data at address 0x6b6b6b6b6b6c49b7
Faulting instruction address: 0xc0000000000410f4
cpu 0x2: Vector: 300 (Data Access) at [c00000004233f590]
pc: c0000000000410f4: .hash_preload+0x258/0x338
lr: c000000000041054: .hash_preload+0x1b8/0x338
sp: c00000004233f810 msr: 8000000000009032
dar: 6b6b6b6b6b6c49b7
dsisr: 40000000
current = 0xc00000007e2c0070
paca = 0xc000000007fe0500
pid = 1, comm = init
enter ? for help
[c00000004233f810] c000000000041020 .hash_preload+0x184/0x338 (unreliable) [c00000004233f8f0] c00000000003ed98 .update_mmu_cache+0xb0/0xd0 [c00000004233f990] c000000000157754 .__do_fault+0x48c/0x5dc [c00000004233faa0] c000000000158fd0 .handle_mm_fault+0x508/0xa8c [c00000004233fb90] c0000000006acdd4 .do_page_fault+0x428/0x6ac [c00000004233fe30] c000000000005260 handle_page_fault+0x20/0x74
--- arch/powerpc/mm/hash_utils_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/mm/hash_utils_64.c +1 -1
@@ -1122,7 +1122,7 @@ void hash_preload(struct mm_struct *mm, else#endif /* CONFIG_PPC_HAS_HASH_64K */ rc =__hash_page_4K (ea, access, vsid, ptep, trap, local, ssize, -subpage_protection (pgdir, ea)); +subpage_protection (mm, ea));/* Dump some info in case of hash insertion failure, they should * never happen so it is really useful to know if/when they do
PATCH 74/289 SUNRPC: After calling xprt_release(), we must restart from call_reserve
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <[email protected]>
commit 118df3d17f11733b294ea2cd988d56ee376ef9fd upstream.
Rob Leslie reports seeing the following Oops after his Kerberos session expired.
BUG: unable to handle kernel NULL pointer dereference at 00000058 IP: [<e186ed94>] rpcauth_refreshcred+0x11/0x12c [sunrpc] *pde = 00000000 Oops: 0000 [#1] last sysfs file: /sys/devices/platform/pc87360.26144/temp3_input Modules linked in: autofs4 authenc esp4 xfrm4_mode_transport ipt_LOG ipt_REJECT xt_limit xt_state ipt_REDIRECT xt_owner xt_HL xt_hl xt_tcpudp xt_mark cls_u32 cls_tcindex sch_sfq sch_htb sch_dsmark geodewdt deflate ctr twofish_generic twofish_i586 twofish_common camellia serpent blowfish cast5 cbc xcbc rmd160 sha512_generic sha1_generic hmac crypto_null af_key rpcsec_gss_krb5 nfsd exportfs nfs lockd fscache nfs_acl auth_rpcgss sunrpc ip_gre sit tunnel4 dummy ext3 jbd nf_nat_irc nf_conntrack_irc nf_nat_ftp nf_conntrack_ftp iptable_mangle iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 iptable_filter ip_tables x_tables pc8736x_gpio nsc_gpio pc87360 hwmon_vid loop aes_i586 aes_generic sha256_generic dm_crypt cs5535_gpio serio_raw cs5535_mfgpt hifn_795x des_generic geode_rng rng_core led_class ext4 mbcache jbd2 crc16 dm_mirror dm_region_hash dm_log dm_snapshot dm_mod sd_mod crc_t10dif ide_pci_generic cs5536 amd74xx ide_core pata_cs5536 ata_generic libata usb_stora ge via_rhine mii scsi_mod btrfs zlib_deflate crc32c libcrc32c [last unloaded: scsi_wait_scan]
Pid: 12875, comm: sudo Not tainted 2.6.36-net5501 #1 /
EIP: 0060:[<e186ed94>] EFLAGS: 00010292 CPU: 0
EIP is at rpcauth_refreshcred+0x11/0x12c [sunrpc]
EAX: 00000000 EBX: defb13a0 ECX: 00000006 EDX: e18683b8
ESI: defb13a0 EDI: 00000000 EBP: 00000000 ESP: de571d58
DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
Process sudo (pid: 12875, ti=de570000 task=decd1430 task.ti=de570000)
Stack: e186e008 00000000 defb13a0 0000000d deda6000 e1868f22 e196f12b defb13a0 <0> defb13d8 00000000 00000000 e186e0aa 00000000 defb13a0 de571dac 00000000 <0> e186956c de571e34 debea5c0 de571dc8 e186967a 00000000 debea5c0 de571e34 Call Trace: [<e186e008>] ? rpc_wake_up_next+0x114/0x11b [sunrpc] [<e1868f22>] ? call_decode+0x24a/0x5af [sunrpc] [<e196f12b>] ? nfs4_xdr_dec_access+0x0/0xa2 [nfs] [<e186e0aa>] ? __rpc_execute+0x62/0x17b [sunrpc] [<e186956c>] ? rpc_run_task+0x91/0x97 [sunrpc] [<e186967a>] ? rpc_call_sync+0x40/0x5b [sunrpc] [<e1969ca2>] ? nfs4_proc_access+0x10a/0x176 [nfs] [<e19572fa>] ? nfs_do_access+0x2b1/0x2c0 [nfs] [<e186ed61>] ? rpcauth_lookupcred+0x62/0x84 [sunrpc] [<e19573b6>] ? nfs_permission+0xad/0x13b [nfs] [<c0177824>] ? exec_permission+0x15/0x4b [<c0177fbd>] ? link_path_walk+0x4f/0x456 [<c017867d>] ? path_walk+0x4c/0xa8 [<c0179678>] ? do_path_lookup+0x1f/0x68 [<c017a3fb>] ? user_path_at+0x37/0x5f [<c016359c>] ? handle_mm_fault+0x229/0x55b [<c0170a2d>] ? sys_faccessat+0x93/0x146 [<c0170aef>] ? sys_access+0xf/0x13 [<c02cf615>] ? syscall_call+0x7/0xb Code: 0f 94 c2 84 d2 74 09 8b 44 24 0c e8 6a e9 8b de 83 c4 14 89 d8 5b 5e 5f 5d c3 55 57 56 53 83 ec 1c fc 89 c6 8b 40 10 89 44 24 04 <8b> 58 58 85 db 0f 85 d4 00 00 00 0f b7 46 70 8b 56 20 89 c5 83 EIP: [<e186ed94>] rpcauth_refreshcred+0x11/0x12c [sunrpc] SS:ESP 0068:de571d58
CR2: 0000000000000058
This appears to be caused by the function rpc_verify_header() first calling xprt_release(), then doing a call_refresh. If we release the transport slot, we should _always_ jump back to call_reserve before calling anything else.
--- net/sunrpc/clnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/clnt.c +1 -1
@@ -1675,7 +1675,7 @@ rpc_verify_header(struct rpc_task *task)rpcauth_invalcred (task);/* Ensure we obtain a new XID! */ xprt_release (task); - task->tk_action = call_refresh; + task->tk_action = call_reserve; goto out_retry;case RPC_AUTH_BADCRED :case RPC_AUTH_BADVERF :
PATCH 75/289 microblaze: Fix build with make 3.82
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Backlund <[email protected]>
commit b843e4ec01991a386a9e0e9030703524446e03da upstream.
When running make headers_install_all on x86_64 and make 3.82 I hit this:
arch/microblaze/Makefile:80: *** mixed implicit and normal rules. Stop.
make: *** [headers_install_all] Error 2
So split the rules to satisfy make 3.82.
--- arch/microblaze/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
arch/microblaze/Makefile +6 -2
@@ -72,12 +72,16 @@ export MMU DTB all: linux.bin -BOOT_TARGETS = linux.bin linux.bin.gz simpleImage.% +# With make 3.82 we cannot mix normal and wildcard targets +BOOT_TARGETS1 = linux.bin linux.bin.gz +BOOT_TARGETS2 = simpleImage.% archclean: $(Q)$(MAKE) $(clean)=$(boot) -$(BOOT_TARGETS): vmlinux +$(BOOT_TARGETS1): vmlinux + $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ +$(BOOT_TARGETS2): vmlinux $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ define archhelp
PATCH 76/289 phy/marvell: fix 88e1121 support
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Arnaud Patard <[email protected]>
commit be8c648051048bc66fbca590d00f3e8543ec32af upstream.
Commit c477d0447db08068a497e7beb892b2b2a7bff64b added support for RGMII rx/tx delays except that it ends up clearing rx/tx delays bit for modes differents that RGMII*ID. Due to this, ethernet is not working anymore on my guruplug server +. This patch is fixing that.
--- drivers/net/phy/marvell.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-)
drivers/net/phy/marvell.c +19 -12
@@ -196,20 +196,27 @@ static int m88e1121_config_aneg(struct p MII_88E1121_PHY_MSCR_PAGE);if (err <0 )return err; - mscr =phy_read (phydev,MII_88E1121_PHY_MSCR_REG ) & -MII_88E1121_PHY_MSCR_DELAY_MASK ; -if (phydev->interface ==PHY_INTERFACE_MODE_RGMII_ID ) - mscr |= (MII_88E1121_PHY_MSCR_RX_DELAY | -MII_88E1121_PHY_MSCR_TX_DELAY ); -else if (phydev->interface ==PHY_INTERFACE_MODE_RGMII_RXID ) - mscr |=MII_88E1121_PHY_MSCR_RX_DELAY ; -else if (phydev->interface ==PHY_INTERFACE_MODE_RGMII_TXID ) - mscr |=MII_88E1121_PHY_MSCR_TX_DELAY ; +if ((phydev->interface ==PHY_INTERFACE_MODE_RGMII ) || + (phydev->interface ==PHY_INTERFACE_MODE_RGMII_ID ) || + (phydev->interface ==PHY_INTERFACE_MODE_RGMII_RXID ) || + (phydev->interface ==PHY_INTERFACE_MODE_RGMII_TXID )) { - err =phy_write (phydev,MII_88E1121_PHY_MSCR_REG , mscr); -if (err <0 ) -return err; + mscr =phy_read (phydev,MII_88E1121_PHY_MSCR_REG ) & +MII_88E1121_PHY_MSCR_DELAY_MASK ; + +if (phydev->interface ==PHY_INTERFACE_MODE_RGMII_ID ) + mscr |= (MII_88E1121_PHY_MSCR_RX_DELAY | +MII_88E1121_PHY_MSCR_TX_DELAY ); +else if (phydev->interface ==PHY_INTERFACE_MODE_RGMII_RXID ) + mscr |=MII_88E1121_PHY_MSCR_RX_DELAY ; +else if (phydev->interface ==PHY_INTERFACE_MODE_RGMII_TXID ) + mscr |=MII_88E1121_PHY_MSCR_TX_DELAY ; + + err =phy_write (phydev,MII_88E1121_PHY_MSCR_REG , mscr); +if (err <0 ) +return err; + }phy_write (phydev,MII_88E1121_PHY_PAGE , oldpage);
PATCH 77/289 NFSv4: Dont call nfs4_reclaim_complete() on receiving NFS4ERR_STALE_CLIENTID
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <[email protected]>
commit 6eaa61496fb3b93cceface7a296415fc4c030bce upstream.
If the server sends us an NFS4ERR_STALE_CLIENTID while the state management thread is busy reclaiming state, we do want to treat all state that wasn't reclaimed before the STALE_CLIENTID as if a network partition occurred (see the edge conditions described in RFC3530 and RFC5661).
What we do not want to do is to send an nfs4_reclaim_complete(), since we haven't yet even started reclaiming state after the server rebooted.
--- fs/nfs/nfs4state.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
fs/nfs/nfs4state.c +11 -5
@@ -1138,16 +1138,14 @@ static void nfs4_reclaim_complete(struct (void )ops->reclaim_complete (clp); } -static void nfs4_state_end_reclaim_reboot (struct nfs_client *clp) +static int nfs4_state_clear_reclaim_reboot (struct nfs_client *clp) {struct nfs4_state_owner *sp;struct rb_node *pos;struct nfs4_state *state;if (!test_and_clear_bit (NFS4CLNT_RECLAIM_REBOOT , &clp->cl_state)) -return ; - -nfs4_reclaim_complete (clp, clp->cl_mvops->reboot_recovery_ops); +return 0 ;for (pos =rb_first (&clp->cl_state_owners); pos !=NULL ; pos =rb_next (pos)) { sp = rb_entry(pos, struct nfs4_state_owner, so_client_node);
@@ -1161,6 +1159,14 @@ static void nfs4_state_end_reclaim_reboo }nfs_delegation_reap_unclaimed (clp); +return 1 ; +} + +static void nfs4_state_end_reclaim_reboot (struct nfs_client *clp) +{ +if (!nfs4_state_clear_reclaim_reboot (clp)) +return ; +nfs4_reclaim_complete (clp, clp->cl_mvops->reboot_recovery_ops); }static void nfs_delegation_clear_all (struct nfs_client *clp)
@@ -1187,7 +1193,7 @@ static int nfs4_recovery_handle_error(stcase -NFS4ERR_STALE_CLIENTID :case -NFS4ERR_LEASE_MOVED :set_bit (NFS4CLNT_LEASE_EXPIRED , &clp->cl_state); -nfs4_state_end_reclaim_reboot (clp); +nfs4_state_clear_reclaim_reboot (clp);nfs4_state_start_reclaim_reboot (clp);break ;case -NFS4ERR_EXPIRED :
PATCH 78/289 NFSv4: Dont call nfs4_state_mark_reclaim_reboot() from error handlers
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <[email protected]>
commit ae1007d37e00144b72906a4bdc47d517ae91bcc1 upstream.
In the case of a server reboot, the state recovery thread starts by calling nfs4_state_end_reclaim_reboot() in order to avoid edge conditions when the server reboots while the client is in the middle of recovery.
However, if the client has already marked the nfs4_state as requiring reboot recovery, then the above behaviour will cause the recovery thread to treat the open as if it was part of such an edge condition: the open will be recovered as if it was part of a lease expiration (and all the locks will be lost).
Fix is to remove the call to nfs4_state_mark_reclaim_reboot from nfs4_async_handle_error(), and nfs4_handle_exception(). Instead we leave it to the recovery thread to do this for us.
--- fs/nfs/nfs4proc.c | 6 ------ 1 file changed, 6 deletions(-)
fs/nfs/nfs4proc.c +0 -6
@@ -255,9 +255,6 @@ static int nfs4_handle_exception(const snfs4_state_mark_reclaim_nograce (clp, state); goto do_state_recovery;case -NFS4ERR_STALE_STATEID : -if (state ==NULL ) -break ; -nfs4_state_mark_reclaim_reboot (clp, state);case -NFS4ERR_STALE_CLIENTID :case -NFS4ERR_EXPIRED : goto do_state_recovery;
@@ -3490,9 +3487,6 @@ nfs4_async_handle_error(struct rpc_tasknfs4_state_mark_reclaim_nograce (clp, state); goto do_state_recovery;case -NFS4ERR_STALE_STATEID : -if (state ==NULL ) -break ; -nfs4_state_mark_reclaim_reboot (clp, state);case -NFS4ERR_STALE_CLIENTID :case -NFS4ERR_EXPIRED : goto do_state_recovery;
PATCH 79/289 NFSv4: Fix open recovery
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <[email protected]>
commit b0ed9dbc24f1fd912b2dd08b995153cafc1d5b1c upstream.
NFSv4 open recovery is currently broken: since we do not clear the state->flags states before attempting recovery, we end up with the 'can_open_cached()' function triggering. This again leads to no OPEN call being put on the wire.
--- fs/nfs/nfs4proc.c | 3 +++ 1 file changed, 3 insertions(+)
fs/nfs/nfs4proc.c +3 -0
@@ -1117,6 +1117,7 @@ static int nfs4_open_recover(struct nfs4clear_bit (NFS_DELEGATED_STATE , &state->flags);smp_rmb ();if (state->n_rdwr !=0 ) { +clear_bit (NFS_O_RDWR_STATE , &state->flags); ret =nfs4_open_recover_helper (opendata,FMODE_READ |FMODE_WRITE , &newstate);if (ret !=0 )return ret;
@@ -1124,6 +1125,7 @@ static int nfs4_open_recover(struct nfs4return -ESTALE ; }if (state->n_wronly !=0 ) { +clear_bit (NFS_O_WRONLY_STATE , &state->flags); ret =nfs4_open_recover_helper (opendata,FMODE_WRITE , &newstate);if (ret !=0 )return ret;
@@ -1131,6 +1133,7 @@ static int nfs4_open_recover(struct nfs4return -ESTALE ; }if (state->n_rdonly !=0 ) { +clear_bit (NFS_O_RDONLY_STATE , &state->flags); ret =nfs4_open_recover_helper (opendata,FMODE_READ , &newstate);if (ret !=0 )return ret;
PATCH 80/289 NFS: Dont SIGBUS if nfs_vm_page_mkwrite races with a cache invalidation
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Trond Myklebust <[email protected]>
commit bc4866b6e0b44f8ea0df22a16e5927714beb4983 upstream.
In the case where we lock the page, and then find out that the page has been thrown out of the page cache, we should just return VM_FAULT_NOPAGE. This is what block_page_mkwrite() does in these situations.
--- fs/nfs/file.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
fs/nfs/file.c +8 -9
@@ -551,7 +551,7 @@ static int nfs_vm_page_mkwrite(struct vmstruct file *filp = vma->vm_file;struct dentry *dentry = filp->f_path.dentry;unsigned pagelen; -int ret = -EINVAL ; +int ret =VM_FAULT_NOPAGE ;struct address_space *mapping; dfprintk(PAGECACHE, "NFS: vm_page_mkwrite(%s/%s(%ld), offset %lld)\n",
@@ -567,21 +567,20 @@ static int nfs_vm_page_mkwrite(struct vmif (mapping != dentry->d_inode->i_mapping) goto out_unlock; - ret =0 ; pagelen =nfs_page_length (page);if (pagelen ==0 ) goto out_unlock; - ret =nfs_flush_incompatible (filp, page); -if (ret !=0 ) - goto out_unlock; + ret =VM_FAULT_LOCKED ; +if (nfs_flush_incompatible (filp, page) ==0 && +nfs_updatepage (filp, page,0 , pagelen) ==0 ) + goto out; - ret =nfs_updatepage (filp, page,0 , pagelen); + ret =VM_FAULT_SIGBUS ; out_unlock: -if (!ret) -return VM_FAULT_LOCKED ;unlock_page (page); -return VM_FAULT_SIGBUS ; +out: +return ret; }static const struct vm_operations_struct nfs_file_vm_ops = {
PATCH 81/289 drm/radeon/kms: MC vram map needs to be >= pci aperture size
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit b7d8cce5b558e0c0aa6898c9865356481598b46d upstream.
The vram map in the radeon memory controller needs to be
Quoted 1 line
= the pci aperture size. Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=28402
The problematic cards in the above bug have 64 MB of vram, but the pci aperture is 128 MB and the MC vram map was only 64 MB. This can lead to hangs.
--- drivers/gpu/drm/radeon/r100.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/radeon/r100.c +3 -0
@@ -2318,6 +2318,9 @@ void r100_vram_init_sizes(struct radeon_/* Fix for RN50, M6, M7 with 8/16/32(??) MBs of VRAM - * Novell bug 204882 + along with lots of ubuntu ones */ +if (rdev->mc.aper_size > config_aper_size) + config_aper_size = rdev->mc.aper_size; +if (config_aper_size > rdev->mc.real_vram_size) rdev->mc.mc_vram_size = config_aper_size;else
PATCH 82/289 drm/radeon/kms: properly compute group_size on 6xx/7xx
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit 881fe6c1d06bf49f4ab7aef212cdaf66bd059614 upstream.
Needed for tiled surfaces.
--- drivers/gpu/drm/radeon/r600.c | 7 +++++-- drivers/gpu/drm/radeon/rv770.c | 9 +++++---- 2 files changed, 10 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/r600.c +5 -2
@@ -1608,8 +1608,11 @@ void r600_gpu_init(struct radeon_device rdev->config.r600.tiling_npipes = rdev->config.r600.max_tile_pipes; rdev->config.r600.tiling_nbanks =4 << ((ramcfg &NOOFBANK_MASK ) >>NOOFBANK_SHIFT ); tiling_config |=BANK_TILING ((ramcfg &NOOFBANK_MASK ) >>NOOFBANK_SHIFT ); - tiling_config |=GROUP_SIZE (0 ); - rdev->config.r600.tiling_group_size =256 ; + tiling_config |=GROUP_SIZE ((ramcfg &BURSTLENGTH_MASK ) >>BURSTLENGTH_SHIFT ); +if ((ramcfg &BURSTLENGTH_MASK ) >>BURSTLENGTH_SHIFT ) + rdev->config.r600.tiling_group_size =512 ; +else + rdev->config.r600.tiling_group_size =256 ; tmp = (ramcfg &NOOFROWS_MASK ) >>NOOFROWS_SHIFT ;if (tmp >3 ) { tiling_config |=ROW_TILING (3 );
drivers/gpu/drm/radeon/rv770.c +5 -4
@@ -643,10 +643,11 @@ static void rv770_gpu_init(struct radeonelse gb_tiling_config |=BANK_TILING ((mc_arb_ramcfg &NOOFBANK_MASK ) >>NOOFBANK_SHIFT ); rdev->config.rv770.tiling_nbanks =4 << ((gb_tiling_config >>4 ) &0x3 ); - - gb_tiling_config |=GROUP_SIZE (0 ); - rdev->config.rv770.tiling_group_size =256 ; - + gb_tiling_config |=GROUP_SIZE ((mc_arb_ramcfg &BURSTLENGTH_MASK ) >>BURSTLENGTH_SHIFT ); +if ((mc_arb_ramcfg &BURSTLENGTH_MASK ) >>BURSTLENGTH_SHIFT ) + rdev->config.rv770.tiling_group_size =512 ; +else + rdev->config.rv770.tiling_group_size =256 ;if (((mc_arb_ramcfg &NOOFROWS_MASK ) >>NOOFROWS_SHIFT ) >3 ) { gb_tiling_config |=ROW_TILING (3 ); gb_tiling_config |=SAMPLE_SPLIT (3 );
PATCH 83/289 drm/i915: Update hotplug interrupts register definitions for Sandybridge
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Yuanhan Liu <[email protected]>
commit 2d7b8366ae4a9ec2183c30e432a4a9a495c82bcd upstream.
On Sandybridge, the bit definition for hotplug on SDE has changed, so update the code to new definition.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30378
--- drivers/gpu/drm/i915/i915_irq.c | 21 ++++++++++++++++----- drivers/gpu/drm/i915/i915_reg.h | 4 ++++ 2 files changed, 20 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_irq.c +16 -5
@@ -310,6 +310,7 @@ irqreturn_t ironlake_irq_handler(structdrm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;int ret =IRQ_NONE ;u32 de_iir, gt_iir, de_ier, pch_iir; +u32 hotplug_mask;struct drm_i915_master_private *master_priv;struct intel_ring_buffer *render_ring = &dev_priv->render_ring;
@@ -325,6 +326,11 @@ irqreturn_t ironlake_irq_handler(structif (de_iir ==0 && gt_iir ==0 && pch_iir ==0 ) goto done; +if (HAS_PCH_CPT (dev)) + hotplug_mask =SDE_HOTPLUG_MASK_CPT ; +else + hotplug_mask =SDE_HOTPLUG_MASK ; + ret =IRQ_HANDLED ;if (dev->primary->master) {
@@ -366,10 +372,8 @@ irqreturn_t ironlake_irq_handler(structdrm_handle_vblank (dev,1 );/* check event from PCH */ -if ((de_iir &DE_PCH_EVENT ) && - (pch_iir &SDE_HOTPLUG_MASK )) { +if ((de_iir &DE_PCH_EVENT ) && (pch_iir & hotplug_mask))queue_work (dev_priv->wq, &dev_priv->hotplug_work); - }if (de_iir &DE_PCU_EVENT ) {I915_WRITE16 (MEMINTRSTS ,I915_READ (MEMINTRSTS ));
@@ -1424,8 +1428,7 @@ static int ironlake_irq_postinstall(struu32 display_mask =DE_MASTER_IRQ_CONTROL |DE_GSE |DE_PCH_EVENT |DE_PLANEA_FLIP_DONE |DE_PLANEB_FLIP_DONE ;u32 render_mask =GT_PIPE_NOTIFY |GT_BSD_USER_INTERRUPT ; -u32 hotplug_mask =SDE_CRT_HOTPLUG |SDE_PORTB_HOTPLUG | -SDE_PORTC_HOTPLUG |SDE_PORTD_HOTPLUG ; +u32 hotplug_mask; dev_priv->irq_mask_reg = ~display_mask; dev_priv->de_irq_enable_reg = display_mask |DE_PIPEA_VBLANK |DE_PIPEB_VBLANK ;
@@ -1450,6 +1453,14 @@ static int ironlake_irq_postinstall(struI915_WRITE (GTIER , dev_priv->gt_irq_enable_reg); (void )I915_READ (GTIER ); +if (HAS_PCH_CPT (dev)) { + hotplug_mask =SDE_CRT_HOTPLUG_CPT |SDE_PORTB_HOTPLUG_CPT | +SDE_PORTC_HOTPLUG_CPT |SDE_PORTD_HOTPLUG_CPT ; + }else { + hotplug_mask =SDE_CRT_HOTPLUG |SDE_PORTB_HOTPLUG | +SDE_PORTC_HOTPLUG |SDE_PORTD_HOTPLUG ; + } + dev_priv->pch_irq_mask_reg = ~hotplug_mask; dev_priv->pch_irq_enable_reg = hotplug_mask;
drivers/gpu/drm/i915/i915_reg.h +4 -0
@@ -2551,6 +2551,10 @@#define SDE_PORTD_HOTPLUG_CPT (1 << 23)#define SDE_PORTC_HOTPLUG_CPT (1 << 22)#define SDE_PORTB_HOTPLUG_CPT (1 << 21) +#define SDE_HOTPLUG_MASK_CPT (SDE_CRT_HOTPLUG_CPT | \ + SDE_PORTD_HOTPLUG_CPT | \ + SDE_PORTC_HOTPLUG_CPT | \ + SDE_PORTB_HOTPLUG_CPT)#define SDEISR 0xc4000#define SDEIMR 0xc4004
PATCH 84/289 drm/radeon/kms: make sure blit addr masks are 64 bit
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit 2126d0a4a205e2d6b763434f892524cd60f74228 upstream.
--- drivers/gpu/drm/radeon/r600_blit_kms.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/r600_blit_kms.c +4 -4
@@ -650,8 +650,8 @@ void r600_kms_blit_copy(struct radeon_deint src_x = src_gpu_addr &255 ;int dst_x = dst_gpu_addr &255 ;int h =1 ; - src_gpu_addr = src_gpu_addr & ~255 ; - dst_gpu_addr = dst_gpu_addr & ~255 ; + src_gpu_addr = src_gpu_addr & ~255ULL ; + dst_gpu_addr = dst_gpu_addr & ~255ULL ;if (!src_x && !dst_x) { h = (cur_size / max_bytes);
@@ -744,8 +744,8 @@ void r600_kms_blit_copy(struct radeon_deint src_x = (src_gpu_addr &255 );int dst_x = (dst_gpu_addr &255 );int h =1 ; - src_gpu_addr = src_gpu_addr & ~255 ; - dst_gpu_addr = dst_gpu_addr & ~255 ; + src_gpu_addr = src_gpu_addr & ~255ULL ; + dst_gpu_addr = dst_gpu_addr & ~255ULL ;if (!src_x && !dst_x) { h = (cur_size / max_bytes);
PATCH 85/289 drm/radeon/kms: fix handling of tex lookup disable in cs checker on r2xx
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <[email protected]>
commit 43b93fbffc2c080dba2e84df6fce8d7e6c0a2581 upstream.
There are cases when multiple texture units have to be enabled, but not actually used to sample. This patch checks to see if the lookup_disable bit is set and if so, skips the texture check.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=25544
--- drivers/gpu/drm/radeon/r100.c | 3 +++ drivers/gpu/drm/radeon/r100_track.h | 1 + drivers/gpu/drm/radeon/r200.c | 2 ++ drivers/gpu/drm/radeon/radeon_reg.h | 1 + 4 files changed, 7 insertions(+)
drivers/gpu/drm/radeon/r100.c +3 -0
@@ -3228,6 +3228,8 @@ static int r100_cs_track_texture_check(sfor (u =0 ; u < track->num_texture; u++) {if (!track->textures[u].enabled)continue ; +if (track->textures[u].lookup_disable) +continue ; robj = track->textures[u].robj;if (robj ==NULL ) {DRM_ERROR ("No texture bound to unit %u\n" , u);
@@ -3462,6 +3464,7 @@ void r100_cs_track_clear(struct radeon_d track->textures[i].robj =NULL ;/* CS IB emission code makes sure texture unit are disabled */ track->textures[i].enabled = false; + track->textures[i].lookup_disable = false; track->textures[i].roundup_w = true; track->textures[i].roundup_h = true;if (track->separate_cube)
drivers/gpu/drm/radeon/r100_track.h +1 -0
@@ -46,6 +46,7 @@ struct r100_cs_track_texture {unsigned height_11;bool use_pitch;bool enabled; +bool lookup_disable;bool roundup_w;bool roundup_h;unsigned compress_format;
drivers/gpu/drm/radeon/r200.c +2 -0
@@ -447,6 +447,8 @@ int r200_packet0_check(struct radeon_cs_ track->textures[i].width =1 << ((idx_value >>RADEON_TXFORMAT_WIDTH_SHIFT ) &RADEON_TXFORMAT_WIDTH_MASK ); track->textures[i].height =1 << ((idx_value >>RADEON_TXFORMAT_HEIGHT_SHIFT ) &RADEON_TXFORMAT_HEIGHT_MASK ); } +if (idx_value &R200_TXFORMAT_LOOKUP_DISABLE ) + track->textures[i].lookup_disable = true;switch ((idx_value &RADEON_TXFORMAT_FORMAT_MASK )) {case R200_TXFORMAT_I8 :case R200_TXFORMAT_RGB332 :
drivers/gpu/drm/radeon/radeon_reg.h +1 -0
@@ -2836,6 +2836,7 @@# define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24)# define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24)# define R200_TXFORMAT_ST_ROUTE_SHIFT 24 +# define R200_TXFORMAT_LOOKUP_DISABLE (1 << 27)# define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28)# define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29)# define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30)
PATCH 86/289 drm/i915/crt: Make sure the hotplug interrupt is enabled
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Yuanhan Liu <[email protected]>
commit 1510a97182b4ddb5fe3c4e8d05240f7cd6fd13e7 upstream.
After disabling the hotplug interrupts for VGA detection on Ironlake, be sure to re-enable them again afterwards.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30378
--- drivers/gpu/drm/i915/intel_crt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_crt.c +2 -1
@@ -191,7 +191,8 @@ static bool intel_ironlake_crt_detect_hoDRM_DEBUG_KMS ("timed out waiting for FORCE_TRIGGER" );if (turn_off_dac) { -I915_WRITE (PCH_ADPA , temp); +/* Make sure hotplug is enabled */ +I915_WRITE (PCH_ADPA , temp |ADPA_CRT_HOTPLUG_ENABLE ); (void )I915_READ (PCH_ADPA ); }
PATCH 87/289 drm/i915: Free hardware status page on unload when physically mapped
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Keith Packard <[email protected]>
commit c2873e9633fe908dccd36dbb1d370e9c59a1ca62 upstream.
A physically mapped hardware status page is allocated at driver load time but was never freed. Call the existing code to free this page at driver unload time on hardware which uses this kind.
[ickle: call before tearing down registers on KMS-only path, as pointed out by Dave Airlie]
--- drivers/gpu/drm/i915/i915_dma.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/i915_dma.c +3 -0
@@ -2306,6 +2306,9 @@ int i915_driver_unload(struct drm_devicei915_gem_lastclose (dev);intel_cleanup_overlay (dev); + +if (!I915_NEED_GFX_HWS (dev)) +i915_free_hws (dev); }intel_teardown_mchbar (dev);
PATCH 88/289 drm/i915: diasable clock gating for the panel power sequencer
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jesse Barnes <[email protected]>
commit 382b09362711d7d03272230a33767015a277926e upstream.
Needed on Ibex Peak and Cougar Point or the panel won't always come on.
--- drivers/gpu/drm/i915/i915_reg.h | 3 +++ drivers/gpu/drm/i915/intel_display.c | 7 +++++++ 2 files changed, 10 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +3 -0
@@ -2726,6 +2726,9 @@#define FDI_RXB_CHICKEN 0xc2010#define FDI_RX_PHASE_SYNC_POINTER_ENABLE (1) +#define SOUTH_DSPCLK_GATE_D 0xc2020 +#define PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29) +/* CPU: FDI_TX */ #define FDI_TXA_CTL 0x60100#define FDI_TXB_CTL 0x61100
drivers/gpu/drm/i915/intel_display.c +7 -0
@@ -5674,6 +5674,13 @@ void intel_init_clock_gating(struct drm_I915_WRITE (PCH_DSPCLK_GATE_D , dspclk_gate);/* +* On Ibex Peak and Cougar Point, we need to disable clock +* gating for the panel power sequencer or it will fail to +* start up when no ports are active. +*/ +I915_WRITE (SOUTH_DSPCLK_GATE_D ,PCH_DPLSUNIT_CLOCK_GATE_DISABLE ); + +/* * According to the spec the following bits should be set in * order to enable memory self-refresh * The bit 22/21 of 0x42004
PATCH 89/289 drm/i915/overlay: Ensure that the reg_bo is in the GTT prior to writing.
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Chris Wilson <[email protected]>
commit 0ddc1289f3ffd779779ddd3922f26ae7d0a21604 upstream.
Just makes sure that writes are not being aliased by the CPU cache and do make it out to main memory.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=24977
--- drivers/gpu/drm/i915/intel_overlay.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/i915/intel_overlay.c +8 -0
@@ -1367,6 +1367,12 @@ void intel_setup_overlay(struct drm_devi goto out_free_bo; } overlay->flip_addr = overlay->reg_bo->gtt_offset; + + ret =i915_gem_object_set_to_gtt_domain (reg_bo, true); +if (ret) { +DRM_ERROR ("failed to move overlay register bo into the GTT\n" ); + goto out_unpin_bo; + } }else { ret = i915_gem_attach_phys_object(dev, reg_bo, I915_GEM_PHYS_OVERLAY_REGS,
@@ -1399,6 +1405,8 @@ void intel_setup_overlay(struct drm_deviDRM_INFO ("initialized overlay support\n" );return ; +out_unpin_bo: +i915_gem_object_unpin (reg_bo); out_free_bo:drm_gem_object_unreference (reg_bo); out_free:
PATCH 90/289 pcnet_cs: add new_id
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ken Kawasaki <[email protected]>
commit 62391f97babb7fe0c769830b6f0e0bd184bd0704 upstream.
pcnet_cs:
add new_id: "corega Ether CF-TD" 10Base-T PCMCIA card.
--- drivers/net/pcmcia/pcnet_cs.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/pcmcia/pcnet_cs.c +1 -0
@@ -1622,6 +1622,7 @@ static struct pcmcia_device_id pcnet_idsPCMCIA_DEVICE_PROD_ID12 ("COMPU-SHACK" ,"FASTline PCMCIA 10/100 Fast-Ethernet" ,0xfa2e424d ,0x3953d9b9 ),PCMCIA_DEVICE_PROD_ID12 ("CONTEC" ,"C-NET(PC)C-10L" ,0x21cab552 ,0xf6f90722 ),PCMCIA_DEVICE_PROD_ID12 ("corega" ,"FEther PCC-TXF" ,0x0a21501a ,0xa51564a2 ), +PCMCIA_DEVICE_PROD_ID12 ("corega" ,"Ether CF-TD" ,0x0a21501a ,0x6589340a ),PCMCIA_DEVICE_PROD_ID12 ("corega K.K." ,"corega EtherII PCC-T" ,0x5261440f ,0xfa9d85bd ),PCMCIA_DEVICE_PROD_ID12 ("corega K.K." ,"corega EtherII PCC-TD" ,0x5261440f ,0xc49bd73d ), PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d),
PATCH 91/289 SH: Add missing consts to sys_execve() declaration
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Howells <[email protected]>
commit d8b5fc01683c66060edc202d6bb5635365822181 upstream.
Add missing consts to the sys_execve() declaration which result in the following error:
arch/sh/kernel/process_32.c:303: error: conflicting types for 'sys_execve' /warthog/nfs/linux-2.6-fscache/arch/sh/include/asm/syscalls_32.h:24: error: previous declaration of 'sys_execve' was here
--- arch/sh/include/asm/syscalls_32.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
arch/sh/include/asm/syscalls_32.h +4 -3
@@ -19,9 +19,10 @@ asmlinkage int sys_clone(unsigned long c asmlinkage int sys_vfork(unsigned long r4, unsigned long r5,unsigned long r6,unsigned long r7,struct pt_regs __regs); -asmlinkage int sys_execve(const char __user *ufilename, char __user * __user *uargv, -char __user *__user *uenvp,unsigned long r7, -struct pt_regs __regs); +asmlinkage int sys_execve(const char __user *ufilename, +const char __user *const __user *uargv, +const char __user *const __user *uenvp, +unsigned long r7,struct pt_regs __regs); asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r5,unsigned long r6,unsigned long r7,struct pt_regs __regs);
PATCH 92/289 reiserfs: fix inode mutex - reiserfs lock misordering
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Frederic Weisbecker <[email protected]>
commit da905873effecd1c0166e578bc4b5006f041b18b upstream.
reiserfs_unpack() locks the inode mutex with reiserfs_mutex_lock_safe() to protect against reiserfs lock dependency. However this protection requires to have the reiserfs lock to be locked.
This is the case if reiserfs_unpack() is called by reiserfs_ioctl but not from reiserfs_quota_on() when it tries to unpack tails of quota files.
Fix the ordering of the two locks in reiserfs_unpack() to fix this issue.
--- fs/reiserfs/ioctl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
fs/reiserfs/ioctl.c +3 -4
@@ -186,12 +186,11 @@ int reiserfs_unpack(struct inode *inode,return 0 ; } -/* we need to make sure nobody is changing the file size beneath -** us -*/ -reiserfs_mutex_lock_safe (&inode->i_mutex, inode->i_sb); depth =reiserfs_write_lock_once (inode->i_sb); +/* we need to make sure nobody is changing the file size beneath us */ +reiserfs_mutex_lock_safe (&inode->i_mutex, inode->i_sb); + write_from = inode->i_size & (blocksize -1 );/* if we are on a block boundary, we are already unpacked. */ if (write_from ==0 ) {
PATCH 93/289 reiserfs: dont acquire lock recursively in reiserfs_acl_chmod
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Frederic Weisbecker <[email protected]>
commit 238af8751f64a75f8b638193353b1c31ea32e738 upstream.
reiserfs_acl_chmod() can be called by reiserfs_set_attr() and then take the reiserfs lock a second time. Thereafter it may call journal_begin() that definitely requires the lock not to be nested in order to release it before taking the journal mutex because the reiserfs lock depends on the journal mutex already.
So, aviod nesting the lock in reiserfs_acl_chmod().
--- fs/reiserfs/xattr_acl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/reiserfs/xattr_acl.c +4 -2
@@ -472,7 +472,9 @@ int reiserfs_acl_chmod(struct inode *inostruct reiserfs_transaction_handle th;size_t size =reiserfs_xattr_nblocks (inode,reiserfs_acl_size (clone->a_count)); -reiserfs_write_lock (inode->i_sb); +int depth; + + depth =reiserfs_write_lock_once (inode->i_sb); error =journal_begin (&th, inode->i_sb, size *2 );if (!error) {int error2;
@@ -482,7 +484,7 @@ int reiserfs_acl_chmod(struct inode *inoif (error2) error = error2; } -reiserfs_write_unlock (inode->i_sb); +reiserfs_write_unlock_once (inode->i_sb, depth); }posix_acl_release (clone);return error;
PATCH 94/289 staging: rt2870: Add new USB ID for Belkin F6D4050 v1
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Larry Finger <[email protected]>
commit 705059a670f3af2b37695e82de0ee58e75e656ed upstream.
Add new USB ID for FT2870 for Belkin F6D4050 v1
Reported- and Tested-by: James Long <[email protected]>
--- drivers/staging/rt2860/usb_main_dev.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/rt2860/usb_main_dev.c +1 -0
@@ -65,6 +65,7 @@ struct usb_device_id rtusb_usb_id[] = { {USB_DEVICE(0x14B2, 0x3C07)}, /* AL */ {USB_DEVICE(0x050D, 0x8053)}, /* Belkin */ {USB_DEVICE(0x050D, 0x825B)}, /* Belkin */ + {USB_DEVICE(0x050D, 0x935A)}, /* Belkin F6D4050 v1 */ {USB_DEVICE(0x050D, 0x935B)}, /* Belkin F6D4050 v2 */ {USB_DEVICE(0x14B2, 0x3C23)}, /* Airlink */ {USB_DEVICE(0x14B2, 0x3C27)}, /* Airlink */
PATCH 95/289 Staging: asus_oled: fix up some sysfs attribute permissions
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit 590b0b9754bd8928926bae7194b6da7ead9bda3b upstream.
They should not be writable by any user
--- drivers/staging/asus_oled/asus_oled.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/asus_oled/asus_oled.c +4 -4
@@ -620,13 +620,13 @@ static ssize_t class_set_picture(struct#define ASUS_OLED_DEVICE_ATTR (_file) dev_attr_asus_oled_##_file -static DEVICE_ATTR(asus_oled_enabled, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(asus_oled_enabled, S_IRUSR | S_IRUGO, get_enabled, set_enabled); -static DEVICE_ATTR(asus_oled_picture, S_IWUGO , NULL, set_picture); +static DEVICE_ATTR(asus_oled_picture, S_IRUSR , NULL, set_picture); -static DEVICE_ATTR(enabled, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(enabled, S_IRUSR | S_IRUGO, class_get_enabled, class_set_enabled); -static DEVICE_ATTR(picture, S_IWUGO, NULL, class_set_picture); +static DEVICE_ATTR(picture, S_IRUSR, NULL, class_set_picture);static int asus_oled_probe (struct usb_interface *interface,const struct usb_device_id *id)
PATCH 96/289 Staging: asus_oled: fix up my fixup for some sysfs attribute permissions
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit 515b4987ccd097cdf5416530b05fdf9e01afe95a upstream.
They should be writable by root, not readable. Doh, stupid me with the wrong flags.
--- drivers/staging/asus_oled/asus_oled.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/asus_oled/asus_oled.c +4 -4
@@ -620,13 +620,13 @@ static ssize_t class_set_picture(struct#define ASUS_OLED_DEVICE_ATTR (_file) dev_attr_asus_oled_##_file -static DEVICE_ATTR(asus_oled_enabled, S_IRUSR | S_IRUGO, +static DEVICE_ATTR(asus_oled_enabled, S_IWUSR | S_IRUGO, get_enabled, set_enabled); -static DEVICE_ATTR(asus_oled_picture, S_IRUSR , NULL, set_picture); +static DEVICE_ATTR(asus_oled_picture, S_IWUSR , NULL, set_picture); -static DEVICE_ATTR(enabled, S_IRUSR | S_IRUGO, +static DEVICE_ATTR(enabled, S_IWUSR | S_IRUGO, class_get_enabled, class_set_enabled); -static DEVICE_ATTR(picture, S_IRUSR, NULL, class_set_picture); +static DEVICE_ATTR(picture, S_IWUSR, NULL, class_set_picture);static int asus_oled_probe (struct usb_interface *interface,const struct usb_device_id *id)
PATCH 97/289 ALSA: hda: Use hp-laptop quirk to enable headphones automute for Asus A52J
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 673f7a8984c3a9e2cb1108ce221da1ebbd9e5d09 upstream.
The original reporter states that, in 2.6.35, headphones do not appear to work, nor does inserting them mute the A52J's onboard speakers. Upon inspecting the codec dump, it appears that the newly committed hp-laptop quirk will suffice to enable this basic functionality. Testing was done with an alsa-driver build from 2010-11-21.
--- sound/pci/hda/patch_conexant.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_conexant.c +1 -0
@@ -3092,6 +3092,7 @@ static struct snd_pci_quirk cxt5066_cfg_SND_PCI_QUIRK (0x1028 ,0x0402 ,"Dell Vostro" ,CXT5066_DELL_VOSTO ),SND_PCI_QUIRK (0x1028 ,0x0408 ,"Dell Inspiron One 19T" ,CXT5066_IDEAPAD ),SND_PCI_QUIRK (0x103c ,0x360b ,"HP G60" ,CXT5066_HP_LAPTOP ), +SND_PCI_QUIRK (0x1043 ,0x13f3 ,"Asus A52J" ,CXT5066_HP_LAPTOP ),SND_PCI_QUIRK (0x1179 ,0xff1e ,"Toshiba Satellite C650D" ,CXT5066_IDEAPAD ),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 98/289 Staging: line6: fix up some sysfs attribute permissions
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit 2018845b6a169f75341f8e68ad1089cb6697cf24 and 2018845b6a169f75341f8e68ad1089cb6697cf24 upstream merged together as it had to be backported by hand.
They should not be writable by any user
--- drivers/staging/line6/control.c | 204 +++++++++++++++++++-------------------- drivers/staging/line6/midi.c | 4 drivers/staging/line6/pod.c | 32 +++--- drivers/staging/line6/toneport.c | 4 drivers/staging/line6/variax.c | 12 +- 5 files changed, 128 insertions(+), 128 deletions(-)
drivers/staging/line6/control.c +102 -102
@@ -268,210 +268,210 @@ VARIAX_PARAM_R(float, mix2);VARIAX_PARAM_R (float, mix1);VARIAX_PARAM_R (int, pickup_wiring); -static DEVICE_ATTR(tweak, S_IWUGO | S_IRUGO, pod_get_tweak, pod_set_tweak); -static DEVICE_ATTR(wah_position, S_IWUGO | S_IRUGO, pod_get_wah_position, +static DEVICE_ATTR(tweak, S_IWUSR | S_IRUGO, pod_get_tweak, pod_set_tweak); +static DEVICE_ATTR(wah_position, S_IWUSR | S_IRUGO, pod_get_wah_position, pod_set_wah_position); -static DEVICE_ATTR(compression_gain, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(compression_gain, S_IWUSR | S_IRUGO, pod_get_compression_gain, pod_set_compression_gain); -static DEVICE_ATTR(vol_pedal_position, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(vol_pedal_position, S_IWUSR | S_IRUGO, pod_get_vol_pedal_position, pod_set_vol_pedal_position); -static DEVICE_ATTR(compression_threshold, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(compression_threshold, S_IWUSR | S_IRUGO, pod_get_compression_threshold, pod_set_compression_threshold); -static DEVICE_ATTR(pan, S_IWUGO | S_IRUGO, pod_get_pan, pod_set_pan); -static DEVICE_ATTR(amp_model_setup, S_IWUGO | S_IRUGO, pod_get_amp_model_setup, +static DEVICE_ATTR(pan, S_IWUSR | S_IRUGO, pod_get_pan, pod_set_pan); +static DEVICE_ATTR(amp_model_setup, S_IWUSR | S_IRUGO, pod_get_amp_model_setup, pod_set_amp_model_setup); -static DEVICE_ATTR(amp_model, S_IWUGO | S_IRUGO, pod_get_amp_model, +static DEVICE_ATTR(amp_model, S_IWUSR | S_IRUGO, pod_get_amp_model, pod_set_amp_model); -static DEVICE_ATTR(drive, S_IWUGO | S_IRUGO, pod_get_drive, pod_set_drive); -static DEVICE_ATTR(bass, S_IWUGO | S_IRUGO, pod_get_bass, pod_set_bass); -static DEVICE_ATTR(mid, S_IWUGO | S_IRUGO, pod_get_mid, pod_set_mid); -static DEVICE_ATTR(lowmid, S_IWUGO | S_IRUGO, pod_get_lowmid, pod_set_lowmid); -static DEVICE_ATTR(treble, S_IWUGO | S_IRUGO, pod_get_treble, pod_set_treble); -static DEVICE_ATTR(highmid, S_IWUGO | S_IRUGO, pod_get_highmid, +static DEVICE_ATTR(drive, S_IWUSR | S_IRUGO, pod_get_drive, pod_set_drive); +static DEVICE_ATTR(bass, S_IWUSR | S_IRUGO, pod_get_bass, pod_set_bass); +static DEVICE_ATTR(mid, S_IWUSR | S_IRUGO, pod_get_mid, pod_set_mid); +static DEVICE_ATTR(lowmid, S_IWUSR | S_IRUGO, pod_get_lowmid, pod_set_lowmid); +static DEVICE_ATTR(treble, S_IWUSR | S_IRUGO, pod_get_treble, pod_set_treble); +static DEVICE_ATTR(highmid, S_IWUSR | S_IRUGO, pod_get_highmid, pod_set_highmid); -static DEVICE_ATTR(chan_vol, S_IWUGO | S_IRUGO, pod_get_chan_vol, +static DEVICE_ATTR(chan_vol, S_IWUSR | S_IRUGO, pod_get_chan_vol, pod_set_chan_vol); -static DEVICE_ATTR(reverb_mix, S_IWUGO | S_IRUGO, pod_get_reverb_mix, +static DEVICE_ATTR(reverb_mix, S_IWUSR | S_IRUGO, pod_get_reverb_mix, pod_set_reverb_mix); -static DEVICE_ATTR(effect_setup, S_IWUGO | S_IRUGO, pod_get_effect_setup, +static DEVICE_ATTR(effect_setup, S_IWUSR | S_IRUGO, pod_get_effect_setup, pod_set_effect_setup); -static DEVICE_ATTR(band_1_frequency, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(band_1_frequency, S_IWUSR | S_IRUGO, pod_get_band_1_frequency, pod_set_band_1_frequency); -static DEVICE_ATTR(presence, S_IWUGO | S_IRUGO, pod_get_presence, +static DEVICE_ATTR(presence, S_IWUSR | S_IRUGO, pod_get_presence, pod_set_presence); -static DEVICE_ATTR2(treble__bass, treble, S_IWUGO | S_IRUGO, +static DEVICE_ATTR2(treble__bass, treble, S_IWUSR | S_IRUGO, pod_get_treble__bass, pod_set_treble__bass); -static DEVICE_ATTR(noise_gate_enable, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(noise_gate_enable, S_IWUSR | S_IRUGO, pod_get_noise_gate_enable, pod_set_noise_gate_enable); -static DEVICE_ATTR(gate_threshold, S_IWUGO | S_IRUGO, pod_get_gate_threshold, +static DEVICE_ATTR(gate_threshold, S_IWUSR | S_IRUGO, pod_get_gate_threshold, pod_set_gate_threshold); -static DEVICE_ATTR(gate_decay_time, S_IWUGO | S_IRUGO, pod_get_gate_decay_time, +static DEVICE_ATTR(gate_decay_time, S_IWUSR | S_IRUGO, pod_get_gate_decay_time, pod_set_gate_decay_time); -static DEVICE_ATTR(stomp_enable, S_IWUGO | S_IRUGO, pod_get_stomp_enable, +static DEVICE_ATTR(stomp_enable, S_IWUSR | S_IRUGO, pod_get_stomp_enable, pod_set_stomp_enable); -static DEVICE_ATTR(comp_enable, S_IWUGO | S_IRUGO, pod_get_comp_enable, +static DEVICE_ATTR(comp_enable, S_IWUSR | S_IRUGO, pod_get_comp_enable, pod_set_comp_enable); -static DEVICE_ATTR(stomp_time, S_IWUGO | S_IRUGO, pod_get_stomp_time, +static DEVICE_ATTR(stomp_time, S_IWUSR | S_IRUGO, pod_get_stomp_time, pod_set_stomp_time); -static DEVICE_ATTR(delay_enable, S_IWUGO | S_IRUGO, pod_get_delay_enable, +static DEVICE_ATTR(delay_enable, S_IWUSR | S_IRUGO, pod_get_delay_enable, pod_set_delay_enable); -static DEVICE_ATTR(mod_param_1, S_IWUGO | S_IRUGO, pod_get_mod_param_1, +static DEVICE_ATTR(mod_param_1, S_IWUSR | S_IRUGO, pod_get_mod_param_1, pod_set_mod_param_1); -static DEVICE_ATTR(delay_param_1, S_IWUGO | S_IRUGO, pod_get_delay_param_1, +static DEVICE_ATTR(delay_param_1, S_IWUSR | S_IRUGO, pod_get_delay_param_1, pod_set_delay_param_1); -static DEVICE_ATTR(delay_param_1_note_value, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(delay_param_1_note_value, S_IWUSR | S_IRUGO, pod_get_delay_param_1_note_value, pod_set_delay_param_1_note_value); -static DEVICE_ATTR2(band_2_frequency__bass, band_2_frequency, S_IWUGO | S_IRUGO, +static DEVICE_ATTR2(band_2_frequency__bass, band_2_frequency, S_IWUSR | S_IRUGO, pod_get_band_2_frequency__bass, pod_set_band_2_frequency__bass); -static DEVICE_ATTR(delay_param_2, S_IWUGO | S_IRUGO, pod_get_delay_param_2, +static DEVICE_ATTR(delay_param_2, S_IWUSR | S_IRUGO, pod_get_delay_param_2, pod_set_delay_param_2); -static DEVICE_ATTR(delay_volume_mix, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(delay_volume_mix, S_IWUSR | S_IRUGO, pod_get_delay_volume_mix, pod_set_delay_volume_mix); -static DEVICE_ATTR(delay_param_3, S_IWUGO | S_IRUGO, pod_get_delay_param_3, +static DEVICE_ATTR(delay_param_3, S_IWUSR | S_IRUGO, pod_get_delay_param_3, pod_set_delay_param_3); -static DEVICE_ATTR(reverb_enable, S_IWUGO | S_IRUGO, pod_get_reverb_enable, +static DEVICE_ATTR(reverb_enable, S_IWUSR | S_IRUGO, pod_get_reverb_enable, pod_set_reverb_enable); -static DEVICE_ATTR(reverb_type, S_IWUGO | S_IRUGO, pod_get_reverb_type, +static DEVICE_ATTR(reverb_type, S_IWUSR | S_IRUGO, pod_get_reverb_type, pod_set_reverb_type); -static DEVICE_ATTR(reverb_decay, S_IWUGO | S_IRUGO, pod_get_reverb_decay, +static DEVICE_ATTR(reverb_decay, S_IWUSR | S_IRUGO, pod_get_reverb_decay, pod_set_reverb_decay); -static DEVICE_ATTR(reverb_tone, S_IWUGO | S_IRUGO, pod_get_reverb_tone, +static DEVICE_ATTR(reverb_tone, S_IWUSR | S_IRUGO, pod_get_reverb_tone, pod_set_reverb_tone); -static DEVICE_ATTR(reverb_pre_delay, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(reverb_pre_delay, S_IWUSR | S_IRUGO, pod_get_reverb_pre_delay, pod_set_reverb_pre_delay); -static DEVICE_ATTR(reverb_pre_post, S_IWUGO | S_IRUGO, pod_get_reverb_pre_post, +static DEVICE_ATTR(reverb_pre_post, S_IWUSR | S_IRUGO, pod_get_reverb_pre_post, pod_set_reverb_pre_post); -static DEVICE_ATTR(band_2_frequency, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(band_2_frequency, S_IWUSR | S_IRUGO, pod_get_band_2_frequency, pod_set_band_2_frequency); -static DEVICE_ATTR2(band_3_frequency__bass, band_3_frequency, S_IWUGO | S_IRUGO, +static DEVICE_ATTR2(band_3_frequency__bass, band_3_frequency, S_IWUSR | S_IRUGO, pod_get_band_3_frequency__bass, pod_set_band_3_frequency__bass); -static DEVICE_ATTR(wah_enable, S_IWUGO | S_IRUGO, pod_get_wah_enable, +static DEVICE_ATTR(wah_enable, S_IWUSR | S_IRUGO, pod_get_wah_enable, pod_set_wah_enable); -static DEVICE_ATTR(modulation_lo_cut, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(modulation_lo_cut, S_IWUSR | S_IRUGO, pod_get_modulation_lo_cut, pod_set_modulation_lo_cut); -static DEVICE_ATTR(delay_reverb_lo_cut, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(delay_reverb_lo_cut, S_IWUSR | S_IRUGO, pod_get_delay_reverb_lo_cut, pod_set_delay_reverb_lo_cut); -static DEVICE_ATTR(volume_pedal_minimum, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(volume_pedal_minimum, S_IWUSR | S_IRUGO, pod_get_volume_pedal_minimum, pod_set_volume_pedal_minimum); -static DEVICE_ATTR(eq_pre_post, S_IWUGO | S_IRUGO, pod_get_eq_pre_post, +static DEVICE_ATTR(eq_pre_post, S_IWUSR | S_IRUGO, pod_get_eq_pre_post, pod_set_eq_pre_post); -static DEVICE_ATTR(volume_pre_post, S_IWUGO | S_IRUGO, pod_get_volume_pre_post, +static DEVICE_ATTR(volume_pre_post, S_IWUSR | S_IRUGO, pod_get_volume_pre_post, pod_set_volume_pre_post); -static DEVICE_ATTR(di_model, S_IWUGO | S_IRUGO, pod_get_di_model, +static DEVICE_ATTR(di_model, S_IWUSR | S_IRUGO, pod_get_di_model, pod_set_di_model); -static DEVICE_ATTR(di_delay, S_IWUGO | S_IRUGO, pod_get_di_delay, +static DEVICE_ATTR(di_delay, S_IWUSR | S_IRUGO, pod_get_di_delay, pod_set_di_delay); -static DEVICE_ATTR(mod_enable, S_IWUGO | S_IRUGO, pod_get_mod_enable, +static DEVICE_ATTR(mod_enable, S_IWUSR | S_IRUGO, pod_get_mod_enable, pod_set_mod_enable); -static DEVICE_ATTR(mod_param_1_note_value, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(mod_param_1_note_value, S_IWUSR | S_IRUGO, pod_get_mod_param_1_note_value, pod_set_mod_param_1_note_value); -static DEVICE_ATTR(mod_param_2, S_IWUGO | S_IRUGO, pod_get_mod_param_2, +static DEVICE_ATTR(mod_param_2, S_IWUSR | S_IRUGO, pod_get_mod_param_2, pod_set_mod_param_2); -static DEVICE_ATTR(mod_param_3, S_IWUGO | S_IRUGO, pod_get_mod_param_3, +static DEVICE_ATTR(mod_param_3, S_IWUSR | S_IRUGO, pod_get_mod_param_3, pod_set_mod_param_3); -static DEVICE_ATTR(mod_param_4, S_IWUGO | S_IRUGO, pod_get_mod_param_4, +static DEVICE_ATTR(mod_param_4, S_IWUSR | S_IRUGO, pod_get_mod_param_4, pod_set_mod_param_4); -static DEVICE_ATTR(mod_param_5, S_IWUGO | S_IRUGO, pod_get_mod_param_5, +static DEVICE_ATTR(mod_param_5, S_IWUSR | S_IRUGO, pod_get_mod_param_5, pod_set_mod_param_5); -static DEVICE_ATTR(mod_volume_mix, S_IWUGO | S_IRUGO, pod_get_mod_volume_mix, +static DEVICE_ATTR(mod_volume_mix, S_IWUSR | S_IRUGO, pod_get_mod_volume_mix, pod_set_mod_volume_mix); -static DEVICE_ATTR(mod_pre_post, S_IWUGO | S_IRUGO, pod_get_mod_pre_post, +static DEVICE_ATTR(mod_pre_post, S_IWUSR | S_IRUGO, pod_get_mod_pre_post, pod_set_mod_pre_post); -static DEVICE_ATTR(modulation_model, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(modulation_model, S_IWUSR | S_IRUGO, pod_get_modulation_model, pod_set_modulation_model); -static DEVICE_ATTR(band_3_frequency, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(band_3_frequency, S_IWUSR | S_IRUGO, pod_get_band_3_frequency, pod_set_band_3_frequency); -static DEVICE_ATTR2(band_4_frequency__bass, band_4_frequency, S_IWUGO | S_IRUGO, +static DEVICE_ATTR2(band_4_frequency__bass, band_4_frequency, S_IWUSR | S_IRUGO, pod_get_band_4_frequency__bass, pod_set_band_4_frequency__bass); -static DEVICE_ATTR(mod_param_1_double_precision, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(mod_param_1_double_precision, S_IWUSR | S_IRUGO, pod_get_mod_param_1_double_precision, pod_set_mod_param_1_double_precision); -static DEVICE_ATTR(delay_param_1_double_precision, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(delay_param_1_double_precision, S_IWUSR | S_IRUGO, pod_get_delay_param_1_double_precision, pod_set_delay_param_1_double_precision); -static DEVICE_ATTR(eq_enable, S_IWUGO | S_IRUGO, pod_get_eq_enable, +static DEVICE_ATTR(eq_enable, S_IWUSR | S_IRUGO, pod_get_eq_enable, pod_set_eq_enable); -static DEVICE_ATTR(tap, S_IWUGO | S_IRUGO, pod_get_tap, pod_set_tap); -static DEVICE_ATTR(volume_tweak_pedal_assign, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(tap, S_IWUSR | S_IRUGO, pod_get_tap, pod_set_tap); +static DEVICE_ATTR(volume_tweak_pedal_assign, S_IWUSR | S_IRUGO, pod_get_volume_tweak_pedal_assign, pod_set_volume_tweak_pedal_assign); -static DEVICE_ATTR(band_5_frequency, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(band_5_frequency, S_IWUSR | S_IRUGO, pod_get_band_5_frequency, pod_set_band_5_frequency); -static DEVICE_ATTR(tuner, S_IWUGO | S_IRUGO, pod_get_tuner, pod_set_tuner); -static DEVICE_ATTR(mic_selection, S_IWUGO | S_IRUGO, pod_get_mic_selection, +static DEVICE_ATTR(tuner, S_IWUSR | S_IRUGO, pod_get_tuner, pod_set_tuner); +static DEVICE_ATTR(mic_selection, S_IWUSR | S_IRUGO, pod_get_mic_selection, pod_set_mic_selection); -static DEVICE_ATTR(cabinet_model, S_IWUGO | S_IRUGO, pod_get_cabinet_model, +static DEVICE_ATTR(cabinet_model, S_IWUSR | S_IRUGO, pod_get_cabinet_model, pod_set_cabinet_model); -static DEVICE_ATTR(stomp_model, S_IWUGO | S_IRUGO, pod_get_stomp_model, +static DEVICE_ATTR(stomp_model, S_IWUSR | S_IRUGO, pod_get_stomp_model, pod_set_stomp_model); -static DEVICE_ATTR(roomlevel, S_IWUGO | S_IRUGO, pod_get_roomlevel, +static DEVICE_ATTR(roomlevel, S_IWUSR | S_IRUGO, pod_get_roomlevel, pod_set_roomlevel); -static DEVICE_ATTR(band_4_frequency, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(band_4_frequency, S_IWUSR | S_IRUGO, pod_get_band_4_frequency, pod_set_band_4_frequency); -static DEVICE_ATTR(band_6_frequency, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(band_6_frequency, S_IWUSR | S_IRUGO, pod_get_band_6_frequency, pod_set_band_6_frequency); -static DEVICE_ATTR(stomp_param_1_note_value, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(stomp_param_1_note_value, S_IWUSR | S_IRUGO, pod_get_stomp_param_1_note_value, pod_set_stomp_param_1_note_value); -static DEVICE_ATTR(stomp_param_2, S_IWUGO | S_IRUGO, pod_get_stomp_param_2, +static DEVICE_ATTR(stomp_param_2, S_IWUSR | S_IRUGO, pod_get_stomp_param_2, pod_set_stomp_param_2); -static DEVICE_ATTR(stomp_param_3, S_IWUGO | S_IRUGO, pod_get_stomp_param_3, +static DEVICE_ATTR(stomp_param_3, S_IWUSR | S_IRUGO, pod_get_stomp_param_3, pod_set_stomp_param_3); -static DEVICE_ATTR(stomp_param_4, S_IWUGO | S_IRUGO, pod_get_stomp_param_4, +static DEVICE_ATTR(stomp_param_4, S_IWUSR | S_IRUGO, pod_get_stomp_param_4, pod_set_stomp_param_4); -static DEVICE_ATTR(stomp_param_5, S_IWUGO | S_IRUGO, pod_get_stomp_param_5, +static DEVICE_ATTR(stomp_param_5, S_IWUSR | S_IRUGO, pod_get_stomp_param_5, pod_set_stomp_param_5); -static DEVICE_ATTR(stomp_param_6, S_IWUGO | S_IRUGO, pod_get_stomp_param_6, +static DEVICE_ATTR(stomp_param_6, S_IWUSR | S_IRUGO, pod_get_stomp_param_6, pod_set_stomp_param_6); -static DEVICE_ATTR(amp_switch_select, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(amp_switch_select, S_IWUSR | S_IRUGO, pod_get_amp_switch_select, pod_set_amp_switch_select); -static DEVICE_ATTR(delay_param_4, S_IWUGO | S_IRUGO, pod_get_delay_param_4, +static DEVICE_ATTR(delay_param_4, S_IWUSR | S_IRUGO, pod_get_delay_param_4, pod_set_delay_param_4); -static DEVICE_ATTR(delay_param_5, S_IWUGO | S_IRUGO, pod_get_delay_param_5, +static DEVICE_ATTR(delay_param_5, S_IWUSR | S_IRUGO, pod_get_delay_param_5, pod_set_delay_param_5); -static DEVICE_ATTR(delay_pre_post, S_IWUGO | S_IRUGO, pod_get_delay_pre_post, +static DEVICE_ATTR(delay_pre_post, S_IWUSR | S_IRUGO, pod_get_delay_pre_post, pod_set_delay_pre_post); -static DEVICE_ATTR(delay_model, S_IWUGO | S_IRUGO, pod_get_delay_model, +static DEVICE_ATTR(delay_model, S_IWUSR | S_IRUGO, pod_get_delay_model, pod_set_delay_model); -static DEVICE_ATTR(delay_verb_model, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(delay_verb_model, S_IWUSR | S_IRUGO, pod_get_delay_verb_model, pod_set_delay_verb_model); -static DEVICE_ATTR(tempo_msb, S_IWUGO | S_IRUGO, pod_get_tempo_msb, +static DEVICE_ATTR(tempo_msb, S_IWUSR | S_IRUGO, pod_get_tempo_msb, pod_set_tempo_msb); -static DEVICE_ATTR(tempo_lsb, S_IWUGO | S_IRUGO, pod_get_tempo_lsb, +static DEVICE_ATTR(tempo_lsb, S_IWUSR | S_IRUGO, pod_get_tempo_lsb, pod_set_tempo_lsb); -static DEVICE_ATTR(wah_model, S_IWUGO | S_IRUGO, pod_get_wah_model, +static DEVICE_ATTR(wah_model, S_IWUSR | S_IRUGO, pod_get_wah_model, pod_set_wah_model); -static DEVICE_ATTR(bypass_volume, S_IWUGO | S_IRUGO, pod_get_bypass_volume, +static DEVICE_ATTR(bypass_volume, S_IWUSR | S_IRUGO, pod_get_bypass_volume, pod_set_bypass_volume); -static DEVICE_ATTR(fx_loop_on_off, S_IWUGO | S_IRUGO, pod_get_fx_loop_on_off, +static DEVICE_ATTR(fx_loop_on_off, S_IWUSR | S_IRUGO, pod_get_fx_loop_on_off, pod_set_fx_loop_on_off); -static DEVICE_ATTR(tweak_param_select, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(tweak_param_select, S_IWUSR | S_IRUGO, pod_get_tweak_param_select, pod_set_tweak_param_select); -static DEVICE_ATTR(amp1_engage, S_IWUGO | S_IRUGO, pod_get_amp1_engage, +static DEVICE_ATTR(amp1_engage, S_IWUSR | S_IRUGO, pod_get_amp1_engage, pod_set_amp1_engage); -static DEVICE_ATTR(band_1_gain, S_IWUGO | S_IRUGO, pod_get_band_1_gain, +static DEVICE_ATTR(band_1_gain, S_IWUSR | S_IRUGO, pod_get_band_1_gain, pod_set_band_1_gain); -static DEVICE_ATTR2(band_2_gain__bass, band_2_gain, S_IWUGO | S_IRUGO, +static DEVICE_ATTR2(band_2_gain__bass, band_2_gain, S_IWUSR | S_IRUGO, pod_get_band_2_gain__bass, pod_set_band_2_gain__bass); -static DEVICE_ATTR(band_2_gain, S_IWUGO | S_IRUGO, pod_get_band_2_gain, +static DEVICE_ATTR(band_2_gain, S_IWUSR | S_IRUGO, pod_get_band_2_gain, pod_set_band_2_gain); -static DEVICE_ATTR2(band_3_gain__bass, band_3_gain, S_IWUGO | S_IRUGO, +static DEVICE_ATTR2(band_3_gain__bass, band_3_gain, S_IWUSR | S_IRUGO, pod_get_band_3_gain__bass, pod_set_band_3_gain__bass); -static DEVICE_ATTR(band_3_gain, S_IWUGO | S_IRUGO, pod_get_band_3_gain, +static DEVICE_ATTR(band_3_gain, S_IWUSR | S_IRUGO, pod_get_band_3_gain, pod_set_band_3_gain); -static DEVICE_ATTR2(band_4_gain__bass, band_4_gain, S_IWUGO | S_IRUGO, +static DEVICE_ATTR2(band_4_gain__bass, band_4_gain, S_IWUSR | S_IRUGO, pod_get_band_4_gain__bass, pod_set_band_4_gain__bass); -static DEVICE_ATTR2(band_5_gain__bass, band_5_gain, S_IWUGO | S_IRUGO, +static DEVICE_ATTR2(band_5_gain__bass, band_5_gain, S_IWUSR | S_IRUGO, pod_get_band_5_gain__bass, pod_set_band_5_gain__bass); -static DEVICE_ATTR(band_4_gain, S_IWUGO | S_IRUGO, pod_get_band_4_gain, +static DEVICE_ATTR(band_4_gain, S_IWUSR | S_IRUGO, pod_get_band_4_gain, pod_set_band_4_gain); -static DEVICE_ATTR2(band_6_gain__bass, band_6_gain, S_IWUGO | S_IRUGO, +static DEVICE_ATTR2(band_6_gain__bass, band_6_gain, S_IWUSR | S_IRUGO, pod_get_band_6_gain__bass, pod_set_band_6_gain__bass); static DEVICE_ATTR(body, S_IRUGO, variax_get_body, line6_nop_write); static DEVICE_ATTR(pickup1_enable, S_IRUGO, variax_get_pickup1_enable,
drivers/staging/line6/midi.c +2 -2
@@ -362,8 +362,8 @@ static ssize_t midi_set_midi_mask_receivreturn count; } -static DEVICE_ATTR(midi_mask_transmit, S_IWUGO | S_IRUGO, midi_get_midi_mask_transmit, midi_set_midi_mask_transmit); -static DEVICE_ATTR(midi_mask_receive, S_IWUGO | S_IRUGO, midi_get_midi_mask_receive, midi_set_midi_mask_receive); +static DEVICE_ATTR(midi_mask_transmit, S_IWUSR | S_IRUGO, midi_get_midi_mask_transmit, midi_set_midi_mask_transmit); +static DEVICE_ATTR(midi_mask_receive, S_IWUSR | S_IRUGO, midi_get_midi_mask_receive, midi_set_midi_mask_receive);/* MIDI device destructor */ static int snd_line6_midi_free (struct snd_device *device)
drivers/staging/line6/pod.c +16 -16
@@ -952,33 +952,33 @@ POD_GET_SYSTEM_PARAM(tuner_pitch, 1, 1);#undef GET_SYSTEM_PARAM/* POD special files: */ -static DEVICE_ATTR(channel, S_IWUGO | S_IRUGO, pod_get_channel, pod_set_channel); +static DEVICE_ATTR(channel, S_IWUSR | S_IRUGO, pod_get_channel, pod_set_channel); static DEVICE_ATTR(clip, S_IRUGO, pod_wait_for_clip, line6_nop_write); static DEVICE_ATTR(device_id, S_IRUGO, pod_get_device_id, line6_nop_write); static DEVICE_ATTR(dirty, S_IRUGO, pod_get_dirty, line6_nop_write); -static DEVICE_ATTR(dump, S_IWUGO | S_IRUGO, pod_get_dump, pod_set_dump); -static DEVICE_ATTR(dump_buf, S_IWUGO | S_IRUGO, pod_get_dump_buf, pod_set_dump_buf); -static DEVICE_ATTR(finish, S_IWUGO, line6_nop_read, pod_set_finish); +static DEVICE_ATTR(dump, S_IWUSR | S_IRUGO, pod_get_dump, pod_set_dump); +static DEVICE_ATTR(dump_buf, S_IWUSR | S_IRUGO, pod_get_dump_buf, pod_set_dump_buf); +static DEVICE_ATTR(finish, S_IWUSR, line6_nop_read, pod_set_finish); static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, line6_nop_write); -static DEVICE_ATTR(midi_postprocess, S_IWUGO | S_IRUGO, pod_get_midi_postprocess, pod_set_midi_postprocess); -static DEVICE_ATTR(monitor_level, S_IWUGO | S_IRUGO, pod_get_monitor_level, pod_set_monitor_level); +static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO, pod_get_midi_postprocess, pod_set_midi_postprocess); +static DEVICE_ATTR(monitor_level, S_IWUSR | S_IRUGO, pod_get_monitor_level, pod_set_monitor_level); static DEVICE_ATTR(name, S_IRUGO, pod_get_name, line6_nop_write); static DEVICE_ATTR(name_buf, S_IRUGO, pod_get_name_buf, line6_nop_write); -static DEVICE_ATTR(retrieve_amp_setup, S_IWUGO, line6_nop_read, pod_set_retrieve_amp_setup); -static DEVICE_ATTR(retrieve_channel, S_IWUGO, line6_nop_read, pod_set_retrieve_channel); -static DEVICE_ATTR(retrieve_effects_setup, S_IWUGO, line6_nop_read, pod_set_retrieve_effects_setup); -static DEVICE_ATTR(routing, S_IWUGO | S_IRUGO, pod_get_routing, pod_set_routing); +static DEVICE_ATTR(retrieve_amp_setup, S_IWUSR, line6_nop_read, pod_set_retrieve_amp_setup); +static DEVICE_ATTR(retrieve_channel, S_IWUSR, line6_nop_read, pod_set_retrieve_channel); +static DEVICE_ATTR(retrieve_effects_setup, S_IWUSR, line6_nop_read, pod_set_retrieve_effects_setup); +static DEVICE_ATTR(routing, S_IWUSR | S_IRUGO, pod_get_routing, pod_set_routing); static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number, line6_nop_write); -static DEVICE_ATTR(store_amp_setup, S_IWUGO, line6_nop_read, pod_set_store_amp_setup); -static DEVICE_ATTR(store_channel, S_IWUGO, line6_nop_read, pod_set_store_channel); -static DEVICE_ATTR(store_effects_setup, S_IWUGO, line6_nop_read, pod_set_store_effects_setup); -static DEVICE_ATTR(tuner_freq, S_IWUGO | S_IRUGO, pod_get_tuner_freq, pod_set_tuner_freq); -static DEVICE_ATTR(tuner_mute, S_IWUGO | S_IRUGO, pod_get_tuner_mute, pod_set_tuner_mute); +static DEVICE_ATTR(store_amp_setup, S_IWUSR, line6_nop_read, pod_set_store_amp_setup); +static DEVICE_ATTR(store_channel, S_IWUSR, line6_nop_read, pod_set_store_channel); +static DEVICE_ATTR(store_effects_setup, S_IWUSR, line6_nop_read, pod_set_store_effects_setup); +static DEVICE_ATTR(tuner_freq, S_IWUSR | S_IRUGO, pod_get_tuner_freq, pod_set_tuner_freq); +static DEVICE_ATTR(tuner_mute, S_IWUSR | S_IRUGO, pod_get_tuner_mute, pod_set_tuner_mute); static DEVICE_ATTR(tuner_note, S_IRUGO, pod_get_tuner_note, line6_nop_write); static DEVICE_ATTR(tuner_pitch, S_IRUGO, pod_get_tuner_pitch, line6_nop_write);#if CREATE_RAW_FILE -static DEVICE_ATTR(raw, S_IWUGO, line6_nop_read, line6_set_raw); +static DEVICE_ATTR(raw, S_IWUSR, line6_nop_read, line6_set_raw);#endif /*
drivers/staging/line6/toneport.c +2 -2
@@ -124,9 +124,9 @@ static ssize_t toneport_set_led_green(streturn count; } -static DEVICE_ATTR(led_red, S_IWUGO | S_IRUGO, line6_nop_read, +static DEVICE_ATTR(led_red, S_IWUSR | S_IRUGO, line6_nop_read, toneport_set_led_red); -static DEVICE_ATTR(led_green, S_IWUGO | S_IRUGO, line6_nop_read, +static DEVICE_ATTR(led_green, S_IWUSR | S_IRUGO, line6_nop_read, toneport_set_led_green);static int toneport_send_cmd (struct usb_device *usbdev,int cmd1,int cmd2)
drivers/staging/line6/variax.c +6 -6
@@ -389,17 +389,17 @@ static ssize_t variax_set_raw2(struct de#endif /* Variax workbench special files: */ -static DEVICE_ATTR(model, S_IWUGO | S_IRUGO, variax_get_model, variax_set_model); -static DEVICE_ATTR(volume, S_IWUGO | S_IRUGO, variax_get_volume, variax_set_volume); -static DEVICE_ATTR(tone, S_IWUGO | S_IRUGO, variax_get_tone, variax_set_tone); +static DEVICE_ATTR(model, S_IWUSR | S_IRUGO, variax_get_model, variax_set_model); +static DEVICE_ATTR(volume, S_IWUSR | S_IRUGO, variax_get_volume, variax_set_volume); +static DEVICE_ATTR(tone, S_IWUSR | S_IRUGO, variax_get_tone, variax_set_tone); static DEVICE_ATTR(name, S_IRUGO, variax_get_name, line6_nop_write); static DEVICE_ATTR(bank, S_IRUGO, variax_get_bank, line6_nop_write); static DEVICE_ATTR(dump, S_IRUGO, variax_get_dump, line6_nop_write); -static DEVICE_ATTR(active, S_IWUGO | S_IRUGO, variax_get_active, variax_set_active); +static DEVICE_ATTR(active, S_IWUSR | S_IRUGO, variax_get_active, variax_set_active);#if CREATE_RAW_FILE -static DEVICE_ATTR(raw, S_IWUGO, line6_nop_read, line6_set_raw); -static DEVICE_ATTR(raw2, S_IWUGO, line6_nop_read, variax_set_raw2); +static DEVICE_ATTR(raw, S_IWUSR, line6_nop_read, line6_set_raw); +static DEVICE_ATTR(raw2, S_IWUSR, line6_nop_read, variax_set_raw2);#endif
PATCH 99/289 kfifo: disable __kfifo_must_check_helper()
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrew Morton <[email protected]>
commit 52c5171214ff3327961d0ce0db7e8d2ce55004fd upstream.
This helper is wrong: it coerces signed values into unsigned ones, so code such as
if (kfifo_alloc(...) < 0) {
error
}will fail to detect the error.
So let's disable __kfifo_must_check_helper() for 2.6.36.
--- include/linux/kfifo.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
include/linux/kfifo.h +2 -5
@@ -171,11 +171,8 @@ struct kfifo_rec_ptr_2 __STRUCT_KFIFO_PT } -static inline unsigned int __must_check -__kfifo_must_check_helper (unsigned int val) -{ -return val; -} +/* __kfifo_must_check_helper() is temporarily disabled because it was faulty */ +#define __kfifo_must_check_helper (x) (x)/** * kfifo_initialized - Check if the fifo is initialized
PATCH 100/289 hpet: fix unwanted interrupt due to stale irq status bit
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Clemens Ladisch <[email protected]>
commit 96e9694df446d1154ec2f4fdba8908588b9cba38 upstream.
Quoted 5 lines · Jaswinder Singh Rajput
By executing
Documentation/timers/hpet_example.cfor polling, I requested for 3 iterations but it seems iteration work for only 2 as first expired time is always very small.
Quoted 12 lines
# ./hpet_example poll /dev/hpet 10 3 -hpet: executing poll hpet_poll: info.hi_flags 0x0 hpet_poll: expired time = 0x13 hpet_poll: revents = 0x1 hpet_poll: data 0x1 hpet_poll: expired time = 0x1868c hpet_poll: revents = 0x1 hpet_poll: data 0x1 hpet_poll: expired time = 0x18645 hpet_poll: revents = 0x1 hpet_poll: data 0x1
Clearing the HPET interrupt enable bit disables interrupt generation but does not disable the timer, so the interrupt status bit will still be set when the timer elapses. If another interrupt arrives before the timer has been correctly programmed (due to some other device on the same interrupt line, or CONFIG_DEBUG_SHIRQ), this results in an extra unwanted interrupt event because the status bit is likely to be set from comparator matches that happened before the device was opened.
Therefore, we have to ensure that the interrupt status bit is and stays cleared until we actually program the timer.
--- drivers/char/hpet.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/char/hpet.c +15 -0
@@ -479,6 +479,21 @@ static int hpet_ioctl_ieon(struct hpet_dif (irq) {unsigned long irq_flags; +if (devp->hd_flags &HPET_SHARED_IRQ ) { +/* +* To prevent the interrupt handler from seeing an +* unwanted interrupt status bit, program the timer +* so that it will not fire in the near future ... +*/ +writel (readl (&timer->hpet_config) & ~Tn_TYPE_CNF_MASK, + &timer->hpet_config); +write_counter (read_counter (&hpet->hpet_mc), + &timer->hpet_compare); +/* ... and clear any left-over status. */ + isr =1 << (devp - devp->hd_hpets->hp_dev); +writel (isr, &hpet->hpet_isr); + } +sprintf (devp->hd_name,"hpet%d" , (int )(devp - hpetp->hp_dev)); irq_flags = devp->hd_flags &HPET_SHARED_IRQ ?IRQF_SHARED :IRQF_DISABLED ;
PATCH 101/289 hpet: unmap unused I/O space
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Slaby <[email protected]>
commit a56d5318716d120e040294bb258901ba89fb9c90 upstream.
When the initialization code in hpet finds a memory resource and does not find an IRQ, it does not unmap the memory resource previously mapped.
There are buggy BIOSes which report resources exactly like this and what is worse the memory region bases point to normal RAM. This normally would not matter since the space is not touched. But when PAT is turned on, ioremap causes the page to be uncached and sets this bit in page->flags.
Then when the page is about to be used by the allocator, it is reported as:
BUG: Bad page state in process md5sum pfn:3ed00 page:ffffea0000dbd800 count:0 mapcount:0 mapping:(null) index:0x0 page flags: 0x20000001000000(uncached) Pid: 7956, comm: md5sum Not tainted 2.6.34-12-desktop #1 Call Trace: [<ffffffff810df851>] bad_page+0xb1/0x100 [<ffffffff810dfa45>] prep_new_page+0x1a5/0x1c0 [<ffffffff810dfe01>] get_page_from_freelist+0x3a1/0x640 [<ffffffff810e01af>] __alloc_pages_nodemask+0x10f/0x6b0
...
In this particular case:
1) HPET returns 3ed00000 as memory region base, but it is not in reserved ranges reported by the BIOS (excerpt):
BIOS-e820: 0000000000100000 - 00000000af6cf000 (usable)
BIOS-e820: 00000000af6cf000 - 00000000afdcf000 (reserved)
2) there is no IRQ resource reported by HPET method. On the other hand, the Intel HPET specs (1.0a) says (3.2.5.1):_CRS (
// Report 1K of memory consumed by this Timer Block memory range consumed
// Optional: only used if BIOS allocates Interrupts [1] IRQs consumed
)
[1] For case where Timer Block is configured to consume IRQ0/IRQ8 AND Legacy 8254/Legacy RTC hardware still exists, the device objects associated with 8254 & RTC devices should not report IRQ0/IRQ8 as "consumed resources".
So in theory we should check whether if it is the case and use those interrupts instead.
Anyway the address reported by the BIOS here is bogus, so non-presence of IRQ doesn't mean the "optional" part in point 2).
Since I got no reply previously, fix this by simply unmapping the space when IRQ is not found and memory region was mapped previously. It would be probably more safe to walk the resources again and unmap appropriately depending on type. But as we now use only ioremap for both 2 memory resource types, it is not necessarily needed right now.
Addresses https://bugzilla.novell.com/show_bug.cgi?id=629908
--- drivers/char/hpet.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/char/hpet.c +2 -0
@@ -985,6 +985,8 @@ static int hpet_acpi_add(struct acpi_devreturn -ENODEV ;if (!data.hd_address || !data.hd_nirqs) { +if (data.hd_address) +iounmap (data.hd_address);printk ("%s: no address or irqs in _CRS\n" , __func__);return -ENODEV ; }
PATCH 102/289 olpc_battery: Fix endian neutral breakage for s16 values
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Richard A. Smith <[email protected]>
commit 7cfbb29466633e6ecdc14f76a693c8478c2b22af upstream.
When the driver was updated to be endian neutral (8e9c7716c) the signed part of the s16 values was lost. This is because be16_to_cpu() returns an unsigned value. This patch casts the values back to a s16 number prior to the the implicit cast up to an int.
--- drivers/power/olpc_battery.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/power/olpc_battery.c +4 -4
@@ -271,14 +271,14 @@ static int olpc_bat_get_property(structif (ret)return ret; - val->intval = (int )be16_to_cpu (ec_word) *9760L /32 ; + val->intval = (s16 )be16_to_cpu (ec_word) *9760L /32 ;break ;case POWER_SUPPLY_PROP_CURRENT_AVG : ret =olpc_ec_cmd (EC_BAT_CURRENT ,NULL ,0 , (void *)&ec_word,2 );if (ret)return ret; - val->intval = (int )be16_to_cpu (ec_word) *15625L /120 ; + val->intval = (s16 )be16_to_cpu (ec_word) *15625L /120 ;break ;case POWER_SUPPLY_PROP_CAPACITY : ret =olpc_ec_cmd (EC_BAT_SOC ,NULL ,0 , &ec_byte,1 );
@@ -299,7 +299,7 @@ static int olpc_bat_get_property(structif (ret)return ret; - val->intval = (int )be16_to_cpu (ec_word) *100 /256 ; + val->intval = (s16 )be16_to_cpu (ec_word) *100 /256 ;break ;case POWER_SUPPLY_PROP_TEMP_AMBIENT : ret =olpc_ec_cmd (EC_AMB_TEMP ,NULL ,0 , (void *)&ec_word,2 );
@@ -313,7 +313,7 @@ static int olpc_bat_get_property(structif (ret)return ret; - val->intval = (int )be16_to_cpu (ec_word) *6250 /15 ; + val->intval = (s16 )be16_to_cpu (ec_word) *6250 /15 ;break ;case POWER_SUPPLY_PROP_SERIAL_NUMBER : ret =olpc_ec_cmd (EC_BAT_SERIAL ,NULL ,0 , (void *)&ser_buf,8 );
PATCH 103/289 percpu: fix list_head init bug in __percpu_counter_init()
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Masanori ITOH <[email protected]>
commit 8474b591faf3bb0a1e08a60d21d6baac498f15e4 upstream.
WARNING: at lib/list_debug.c:26 __list_add+0x3f/0x81() Hardware name: Express5800/B120a [N8400-085] list_add corruption. next->prev should be prev (ffffffff81a7ea00), but was dead000000200200. (next=ffff88080b872d58). Modules linked in: aoe ipt_MASQUERADE iptable_nat nf_nat autofs4 sunrpc bridge 8021q garp stp llc ipv6 cpufreq_ondemand acpi_cpufreq freq_table dm_round_robin dm_multipath kvm_intel kvm uinput lpfc scsi_transport_fc igb ioatdma scsi_tgt i2c_i801 i2c_core dca iTCO_wdt iTCO_vendor_support pcspkr shpchp megaraid_sas [last unloaded: aoe] Pid: 54, comm: events/3 Tainted: G W 2.6.34-vanilla1 #1 Call Trace: [<ffffffff8104bd77>] warn_slowpath_common+0x7c/0x94 [<ffffffff8104bde6>] warn_slowpath_fmt+0x41/0x43 [<ffffffff8120fd2e>] __list_add+0x3f/0x81 [<ffffffff81212a12>] __percpu_counter_init+0x59/0x6b [<ffffffff810d8499>] bdi_init+0x118/0x17e [<ffffffff811f2c50>] blk_alloc_queue_node+0x79/0x143 [<ffffffff811f2d2b>] blk_alloc_queue+0x11/0x13 [<ffffffffa02a931d>] aoeblk_gdalloc+0x8e/0x1c9 [aoe] [<ffffffffa02aa655>] aoecmd_sleepwork+0x25/0xa8 [aoe] [<ffffffff8106186c>] worker_thread+0x1a9/0x237 [<ffffffffa02aa630>] ? aoecmd_sleepwork+0x0/0xa8 [aoe] [<ffffffff81065827>] ? autoremove_wake_function+0x0/0x39 [<ffffffff810616c3>] ? worker_thread+0x0/0x237 [<ffffffff810653ad>] kthread+0x7f/0x87 [<ffffffff8100aa24>] kernel_thread_helper+0x4/0x10 [<ffffffff8106532e>] ? kthread+0x0/0x87 [<ffffffff8100aa20>] ? kernel_thread_helper+0x0/0x10
It's because there is no initialization code for a list_head contained in the struct backing_dev_info under CONFIG_HOTPLUG_CPU, and the bug comes up when block device drivers calling blk_alloc_queue() are used. In case of me, I got them by using aoe.
--- lib/percpu_counter.c | 1 + 1 file changed, 1 insertion(+)
lib/percpu_counter.c +1 -0
@@ -76,6 +76,7 @@ int __percpu_counter_init(struct percpu_if (!fbc->counters)return -ENOMEM ;#ifdef CONFIG_HOTPLUG_CPU +INIT_LIST_HEAD (&fbc->list);mutex_lock (&percpu_counters_lock);list_add (&fbc->list, &percpu_counters);mutex_unlock (&percpu_counters_lock);
PATCH 104/289 hostfs: fix UML crash: remove f_spare from hostfs
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Richard Weinberger <[email protected]>
commit 1b627d5771312c92404b66f0a0b16f66036dd2e1 upstream.
365b1818 ("add f_flags to struct statfs(64)") resized f_spare within struct statfs which caused a UML crash. There is no need to copy f_spare.
--- fs/hostfs/hostfs.h | 3 +-- fs/hostfs/hostfs_kern.c | 2 +- fs/hostfs/hostfs_user.c | 9 ++------- 3 files changed, 4 insertions(+), 10 deletions(-)
fs/hostfs/hostfs.h +1 -2
@@ -96,7 +96,6 @@ extern int rename_file(char *from, charextern int do_statfs (char *root,long *bsize_out,long long *blocks_out,long long *bfree_out,long long *bavail_out,long long *files_out,long long *ffree_out, -void *fsid_out,int fsid_size,long *namelen_out, -long *spare_out); +void *fsid_out,int fsid_size,long *namelen_out);#endif
fs/hostfs/hostfs_kern.c +1 -1
@@ -217,7 +217,7 @@ int hostfs_statfs(struct dentry *dentry, err =do_statfs (dentry->d_sb->s_fs_info, &sf->f_bsize, &f_blocks, &f_bfree, &f_bavail, &f_files, &f_ffree, &sf->f_fsid,sizeof (sf->f_fsid), - &sf->f_namelen, sf->f_spare); + &sf->f_namelen);if (err)return err; sf->f_blocks = f_blocks;
fs/hostfs/hostfs_user.c +2 -7
@@ -364,8 +364,7 @@ int rename_file(char *from, char *to)int do_statfs (char *root,long *bsize_out,long long *blocks_out,long long *bfree_out,long long *bavail_out,long long *files_out,long long *ffree_out, -void *fsid_out,int fsid_size,long *namelen_out, -long *spare_out) +void *fsid_out,int fsid_size,long *namelen_out) {struct statfs64 buf;int err;
@@ -384,10 +383,6 @@ int do_statfs(char *root, long *bsize_ousizeof (buf.f_fsid) > fsid_size ? fsid_size : sizeof(buf.f_fsid)); *namelen_out = buf.f_namelen; - spare_out[0 ] = buf.f_spare[0 ]; - spare_out[1 ] = buf.f_spare[1 ]; - spare_out[2 ] = buf.f_spare[2 ]; - spare_out[3 ] = buf.f_spare[3 ]; - spare_out[4 ] = buf.f_spare[4 ]; +return 0 ; }
PATCH 105/289 ipmi: proper spinlock initialization
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Dumazet <[email protected]>
commit de5e2ddf9bb3ce7b643223b9b0718062254f302f upstream.
Unloading ipmi module can trigger following error. (if CONFIG_DEBUG_SPINLOCK=y)
[ 9633.779590] BUG: spinlock bad magic on CPU#1, rmmod/7170 [ 9633.779606] lock: f41f5414, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0 [ 9633.779626] Pid: 7170, comm: rmmod Not tainted 2.6.36-rc7-11474-gb71eb1e-dirty #328 [ 9633.779644] Call Trace: [ 9633.779657] [<c13921cc>] ? printk+0x18/0x1c [ 9633.779672] [<c11a1f33>] spin_bug+0xa3/0xf0 [ 9633.779685] [<c11a1ffd>] do_raw_spin_lock+0x7d/0x160 [ 9633.779702] [<c1131537>] ? release_sysfs_dirent+0x47/0xb0 [ 9633.779718] [<c1131b78>] ? sysfs_addrm_finish+0xa8/0xd0 [ 9633.779734] [<c1394bac>] _raw_spin_lock_irqsave+0xc/0x20 [ 9633.779752] [<f99d93da>] cleanup_one_si+0x6a/0x200 [ipmi_si] [ 9633.779768] [<c11305b2>] ? sysfs_hash_and_remove+0x72/0x80 [ 9633.779786] [<f99dcf26>] ipmi_pnp_remove+0xd/0xf [ipmi_si] [ 9633.779802] [<c11f622b>] pnp_device_remove+0x1b/0x40
Fix this by initializing spinlocks in a smi_info_alloc() helper function, right after memory allocation and clearing.
--- drivers/char/ipmi/ipmi_si_intf.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-)
drivers/char/ipmi/ipmi_si_intf.c +19 -11
@@ -1665,6 +1665,17 @@ static int check_hotmod_int_op(const chareturn 0 ; } +static struct smi_info *smi_info_alloc (void ) +{ +struct smi_info *info =kzalloc (sizeof (*info),GFP_KERNEL ); + +if (info) { +spin_lock_init (&info->si_lock); +spin_lock_init (&info->msg_lock); + } +return info; +} +static int hotmod_handler (const char *val,struct kernel_param *kp) {char *str =kstrdup (val,GFP_KERNEL );
@@ -1779,7 +1790,7 @@ static int hotmod_handler(const char *va }if (op ==HM_ADD ) { - info =kzalloc (sizeof (*info),GFP_KERNEL ); + info =smi_info_alloc ();if (!info) { rv = -ENOMEM ; goto out;
@@ -1844,7 +1855,7 @@ static __devinit void hardcode_find_bmc(if (!ports[i] && !addrs[i])continue ; - info =kzalloc (sizeof (*info),GFP_KERNEL ); + info =smi_info_alloc ();if (!info)return ;
@@ -2028,7 +2039,7 @@ static __devinit int try_init_spmi(strucreturn -ENODEV ; } - info =kzalloc (sizeof (*info),GFP_KERNEL ); + info =smi_info_alloc ();if (!info) { printk(KERN_ERR PFX "Could not allocate SI data (3)\n");return -ENOMEM ;
@@ -2138,7 +2149,7 @@ static int __devinit ipmi_pnp_probe(struif (!acpi_dev)return -ENODEV ; - info =kzalloc (sizeof (*info),GFP_KERNEL ); + info =smi_info_alloc ();if (!info)return -ENOMEM ;
@@ -2319,7 +2330,7 @@ static __devinit void try_init_dmi(struc {struct smi_info *info; - info =kzalloc (sizeof (*info),GFP_KERNEL ); + info =smi_info_alloc ();if (!info) { printk(KERN_ERR PFX "Could not allocate SI data\n");return ;
@@ -2426,7 +2437,7 @@ static int __devinit ipmi_pci_probe(struint class_type = pdev->class &PCI_ERMC_CLASSCODE_TYPE_MASK ;struct smi_info *info; - info =kzalloc (sizeof (*info),GFP_KERNEL ); + info =smi_info_alloc ();if (!info)return -ENOMEM ;
@@ -2567,7 +2578,7 @@ static int __devinit ipmi_of_probe(strucreturn -EINVAL ; } - info =kzalloc (sizeof (*info),GFP_KERNEL ); + info =smi_info_alloc ();if (!info) { dev_err(&dev->dev,
@@ -3014,7 +3025,7 @@ static __devinit void default_find_bmc(vif (check_legacy_ioport (ipmi_defaults[i].port))continue ;#endif - info =kzalloc (sizeof (*info),GFP_KERNEL ); + info =smi_info_alloc ();if (!info)return ;
@@ -3139,9 +3150,6 @@ static int try_smi_init(struct smi_info goto out_err; } -spin_lock_init (&(new_smi->si_lock)); -spin_lock_init (&(new_smi->msg_lock)); -/* Do low-level detection first. */ if (new_smi->handlers->detect (new_smi->si_sm)) {if (new_smi->addr_source)
PATCH 106/289 um: remove PAGE_SIZE alignment in linker script causing kernel segfault.
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Richard Weinberger <[email protected]>
commit 6915e04f8847bea16d0890f559694ad8eedd026c upstream.
The linker script cleanup that I did in commit 5d150a97f93 ("um: Clean up linker script using standard macros.") (2.6.32) accidentally introduced an ALIGN(PAGE_SIZE) when converting to use INIT_TEXT_SECTION; Richard Weinberger reported that this causes the kernel to segfault with CONFIG_STATIC_LINK=y.
I'm not certain why this extra alignment is a problem, but it seems likely it is because previously
__init_begin = _stext = _text = _sinittext
and with the extra ALIGN(PAGE_SIZE), _sinittext becomes different from the rest. So there is likely a bug here where something is assuming that _sinittext is the same as one of those other symbols. But reverting the accidental change fixes the regression, so it seems worth committing that now.
Tested by: Antoine Martin <[email protected]>
--- arch/um/kernel/uml.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/kernel/uml.lds.S +1 -1
@@ -22,7 +22,7 @@ SECTIONS _text = .; _stext = .; __init_begin = .; - INIT_TEXT_SECTION(PAGE_SIZE) + INIT_TEXT_SECTION(0) . = ALIGN(PAGE_SIZE); .text :
PATCH 107/289 um: fix global timer issue when using CONFIG_NO_HZ
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Richard Weinberger <[email protected]>
commit 482db6df1746c4fa7d64a2441d4cb2610249c679 upstream.
This fixes a issue which was introduced by fe2cc53e ("uml: track and make up lost ticks").
timeval_to_ns() returns long long and not int. Due to that UML's timer did not work properlt and caused timer freezes.
--- arch/um/os-Linux/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/os-Linux/time.c +1 -1
@@ -60,7 +60,7 @@ static inline long long timeval_to_ns(colong long disable_timer (void ) {struct itimerval time = ((struct itimerval ) { {0 ,0 }, {0 ,0 } }); -int remain, max =UM_NSEC_PER_SEC /UM_HZ ; +long long remain, max =UM_NSEC_PER_SEC /UM_HZ ;if (setitimer (ITIMER_VIRTUAL , &time, &time) <0 ) printk(UM_KERN_ERR "disable_timer - setitimer failed, "
PATCH 108/289 numa: fix slab_node(MPOL_BIND)
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Dumazet <[email protected]>
commit 800416f799e0723635ac2d720ad4449917a1481c upstream.
When a node contains only HighMem memory, slab_node(MPOL_BIND) dereferences a NULL pointer.
[ This code seems to go back all the way to commit 19770b32609b: "mm:
filter based on a nodemask as well as a gfp_mask". Which was back in April 2008, and it got merged into 2.6.26. - Linus ]
--- mm/mempolicy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/mempolicy.c +1 -1
@@ -1588,7 +1588,7 @@ unsigned slab_node(struct mempolicy *pol (void )first_zones_zonelist (zonelist, highest_zoneidx, &policy->v.nodes, &zone); -return zone->node; +return zone ? zone->node :numa_node_id (); }default :
PATCH 109/289 hwmon: (lm85) Fix ADT7468 frequency table
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
commit fa7a5797e57d2ed71f9a6fb44f0ae42c2d7b74b7 upstream.
The ADT7468 uses the same frequency table as the ADT7463.
--- drivers/hwmon/lm85.c | 1 + 1 file changed, 1 insertion(+)
drivers/hwmon/lm85.c +1 -0
@@ -1259,6 +1259,7 @@ static int lm85_probe(struct i2c_clientswitch (data->type) {case adm1027:case adt7463: +case adt7468:case emc6d100:case emc6d102: data->freq_map = adm1027_freq_map;
PATCH 110/289 oprofile: Fix the hang while taking the cpu offline
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Santosh Shilimkar <[email protected]>
commit 4ac3dbec800d93485a5c84e37af676278eea657c upstream.
The kernel build with CONFIG_OPROFILE and CPU_HOTPLUG enabled. The oprofile is initialised using system timer in absence of hardware counters supports. Oprofile isn't started from userland.
In this setup while doing a CPU offline the kernel hangs in infinite for loop inside lock_hrtimer_base() function
This happens because as part of oprofile_cpu_notify(, it tries to stop an hrtimer which was never started. These per-cpu hrtimers are started when the oprfile is started.
echo 1 > /dev/oprofile/enable
This problem also existwhen the cpu is booted with maxcpus parameter set. When bringing the remaining cpus online the timers are started even if oprofile is not yet enabled.
This patch fix this issue by adding a state variable so that these hrtimer start/stop is only attempted when oprofile is started
For stable kernels v2.6.35.y and v2.6.36.y.
--- drivers/oprofile/timer_int.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/oprofile/timer_int.c +13 -0
@@ -21,6 +21,7 @@#include "oprof.h" static DEFINE_PER_CPU(struct hrtimer, oprofile_hrtimer); +static int ctr_running;static enum hrtimer_restart oprofile_hrtimer_notify (struct hrtimer *hrtimer) {
@@ -33,6 +34,9 @@ static void __oprofile_hrtimer_start(voi {struct hrtimer *hrtimer = &__get_cpu_var (oprofile_hrtimer); +if (!ctr_running) +return ; +hrtimer_init (hrtimer,CLOCK_MONOTONIC ,HRTIMER_MODE_REL ); hrtimer->function = oprofile_hrtimer_notify;
@@ -42,7 +46,10 @@ static void __oprofile_hrtimer_start(voistatic int oprofile_hrtimer_start (void ) { +get_online_cpus (); + ctr_running =1 ;on_each_cpu (__oprofile_hrtimer_start,NULL ,1 ); +put_online_cpus ();return 0 ; }
@@ -50,6 +57,9 @@ static void __oprofile_hrtimer_stop(int {struct hrtimer *hrtimer = &per_cpu (oprofile_hrtimer, cpu); +if (!ctr_running) +return ; +hrtimer_cancel (hrtimer); }
@@ -57,8 +67,11 @@ static void oprofile_hrtimer_stop(void) {int cpu; +get_online_cpus ();for_each_online_cpu (cpu)__oprofile_hrtimer_stop (cpu); + ctr_running =0 ; +put_online_cpus (); } static int __cpuinit oprofile_cpu_notify(struct notifier_block *self,
PATCH 111/289 mm: fix return value of scan_lru_pages in memory unplug
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: KAMEZAWA Hiroyuki <[email protected]>
commit f8f72ad5396987e05a42cf7eff826fb2a15ff148 upstream.
scan_lru_pages returns pfn. So, it's type should be "unsigned long" not "int".
Note: I guess this has been work until now because memory hotplug tester's
machine has not very big memory....
physical address < 32bit << PAGE_SHIFT.
--- mm/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory_hotplug.c +1 -1
@@ -659,7 +659,7 @@ static int test_pages_in_a_zone(unsigned* Scanning pfn is much easier than scanning lru list. * Scan pfn from start to end and Find LRU page. */ -int scan_lru_pages (unsigned long start,unsigned long end) +unsigned long scan_lru_pages (unsigned long start,unsigned long end) {unsigned long pfn;struct page *page;
PATCH 112/289 mm, page-allocator: do not check the state of a non-existant buddy during free
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mel Gorman <[email protected]>
commit b7f50cfa3630b6e079929ffccfd442d65064ee1f upstream.
There is a bug in commit 6dda9d55 ("page allocator: reduce fragmentation in buddy allocator by adding buddies that are merging to the tail of the free lists") that means a buddy at order MAX_ORDER is checked for merging.
A page of this order never exists so at times, an effectively random
piece of memory is being checked.
Alan Curry has reported that this is causing memory corruption in userspace data on a PPC32 platform (http://lkml.org/lkml/2010/10/9/32).
It is not clear why this is happening. It could be a cache coherency problem where pages mapped in both user and kernel space are getting different cache lines due to the bad read from kernel space
(http://lkml.org/lkml/2010/10/13/179). It could also be that there are some special registers being io-remapped at the end of the memmap array and that a read has special meaning on them. Compiler bugs have been ruled out because the assembly before and after the patch looks relatively harmless.
This patch fixes the problem by ensuring we are not reading a possibly invalid location of memory. It's not clear why the read causes corruption but one way or the other it is a buggy read.
--- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +1 -1
@@ -530,7 +530,7 @@ static inline void __free_one_page(struc* so it's less likely to be used soon and more likely to be merged * as a higher order page */ -if ((order <MAX_ORDER -1 ) &&pfn_valid_within (page_to_pfn (buddy))) { +if ((order <MAX_ORDER -2 ) &&pfn_valid_within (page_to_pfn (buddy))) {struct page *higher_page, *higher_buddy; combined_idx =__find_combined_index (page_idx, order); higher_page = page + combined_idx - page_idx;
PATCH 113/289 mm: fix is_mem_section_removable() page_order BUG_ON check
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: KAMEZAWA Hiroyuki <[email protected]>
commit 572438f9b52236bd8938b1647cc15e027d27ef55 upstream.
page_order() is called by memory hotplug's user interface to check the section is removable or not. (is_mem_section_removable())
It calls page_order() withoug holding zone->lock.
So, even if the caller does
if (PageBuddy(page)) ret = page_order(page) ...
The caller may hit BUG_ON().
For fixing this, there are 2 choices.
1. add zone->lock.
2. remove BUG_ON().
is_mem_section_removable() is used for some "advice" and doesn't need to be 100% accurate. This is_removable() can be called via user program.. We don't want to take this important lock for long by user's request. So, this patch removes BUG_ON().
--- mm/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/internal.h +1 -1
@@ -62,7 +62,7 @@ extern bool is_free_buddy_page(struct pa*/ static inline unsigned long page_order (struct page *page) { -VM_BUG_ON (!PageBuddy (page)); +/* PageBuddy() must be checked by the caller */ return page_private (page); }
PATCH 114/289 mm/hugetlb.c: add missing spin_lock() to hugetlb_cow()
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dean Nelson <[email protected]>
commit 44e2aa937e698ea95dd86b2a4fabd734ef2c76db upstream.
Add missing spin_lock() of the page_table_lock before an error return in hugetlb_cow(). Callers of hugtelb_cow() expect it to be held upon return.
--- mm/hugetlb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
mm/hugetlb.c +4 -1
@@ -2380,8 +2380,11 @@ retry_avoidcopy:* When the original hugepage is shared one, it does not have * anon_vma prepared. */ -if (unlikely (anon_vma_prepare (vma))) +if (unlikely (anon_vma_prepare (vma))) { +/* Caller expects lock to be held */ +spin_lock (&mm->page_table_lock);return VM_FAULT_OOM ; + }copy_huge_page (new_page, old_page, address, vma);__SetPageUptodate (new_page);
PATCH 115/289 agp/intel: Also add B43.1 to list of supported devices
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Chris Wilson <[email protected]>
commit 3dde04b0152634d42994b34b86bbf3c70fbc6b19 upstream.
This was a missing piece from 41a5142 that dropped recognition of the AGP module for the second B43 variant.
--- drivers/char/agp/intel-agp.c | 1 + 1 file changed, 1 insertion(+)
drivers/char/agp/intel-agp.c +1 -0
@@ -1049,6 +1049,7 @@ static struct pci_device_id agp_intel_pcID (PCI_DEVICE_ID_INTEL_G45_HB ),ID (PCI_DEVICE_ID_INTEL_G41_HB ),ID (PCI_DEVICE_ID_INTEL_B43_HB ), +ID (PCI_DEVICE_ID_INTEL_B43_1_HB ),ID (PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB ),ID (PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB ), ID(PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB),
PATCH 116/289 b43: Fix warning at drivers/mmc/core/core.c:237 in mmc_wait_for_cmd
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Larry Finger <[email protected]>
commit 9f2a0fac625bcef9c579bcf0b0c904ab1a56e7c4 upstream.
On module removal, the sdio version of b43 generates the following warning:
[ 851.560519] ------------[ cut here ]------------ [ 851.560531] WARNING: at drivers/mmc/core/core.c:237 mmc_wait_for_cmd+0x88/0x90() [ 851.560534] Hardware name: 20552PG [ 851.560536] Modules linked in: b43(-) ssb mmc_block binfmt_misc rfcomm sco bnep ppdev l2cap ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp kvm_intel kvm arc4 iwlagn snd_hda_codec_conexant snd_hda_intel snd_hda_codec iwlcore snd_hwdep snd_pcm thinkpad_acpi mac80211 snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq r852 joydev snd_timer sm_common pcmcia nand snd_seq_device cfg80211 sdhci_pci btusb psmouse tpm_tis yenta_socket nand_ids lp snd pcmcia_rsrc nand_ecc bluetooth sdhci tpm pcmcia_core parport mtd snd_page_alloc serio_raw tpm_bios soundcore nvram led_class sha256_generic aes_i586 aes_generic dm_crypt i915 drm_kms_helper drm ahci intel_agp i2c_algo_bit intel_gtt e1000e libahci video agpgart output [ 851.560620] Pid: 2504, comm: rmmod Not tainted 2.6.36-titan0+ #1 [ 851.560622] Call Trace: [ 851.560631] [<c014a102>] warn_slowpath_common+0x72/0xa0 [ 851.560636] [<c04d94c8>] ? mmc_wait_for_cmd+0x88/0x90 [ 851.560641] [<c04d94c8>] ? mmc_wait_for_cmd+0x88/0x90 [ 851.560645] [<c014a152>] warn_slowpath_null+0x22/0x30 [ 851.560649] [<c04d94c8>] mmc_wait_for_cmd+0x88/0x90 [ 851.560655] [<c0401585>] ? device_release+0x25/0x80 [ 851.560660] [<c04df210>] mmc_io_rw_direct_host+0xa0/0x150 [ 851.560665] [<c04df370>] mmc_io_rw_direct+0x30/0x40 [ 851.560669] [<c04e06e7>] sdio_disable_func+0x37/0xa0 [ 851.560683] [<f8dfcb80>] b43_sdio_remove+0x30/0x50 [b43] [ 851.560687] [<c04df8cc>] sdio_bus_remove+0x1c/0x60 [ 851.560692] [<c016d39f>] ? blocking_notifier_call_chain+0x1f/0x30 [ 851.560697] [<c0404991>] __device_release_driver+0x51/0xb0 [ 851.560701] [<c0404a7f>] driver_detach+0x8f/0xa0 [ 851.560705] [<c0403c83>] bus_remove_driver+0x63/0xa0 [ 851.560709] [<c0405039>] driver_unregister+0x49/0x80 [ 851.560713] [<c0405039>] ? driver_unregister+0x49/0x80 [ 851.560718] [<c04dfad7>] sdio_unregister_driver+0x17/0x20 [ 851.560727] [<f8dfcb42>] b43_sdio_exit+0x12/0x20 [b43] [ 851.560734] [<f8dfe76f>] b43_exit+0x17/0x3c [b43] [ 851.560740] [<c017fb8d>] sys_delete_module+0x13d/0x200 [ 851.560747] [<c01fd7d2>] ? do_munmap+0x212/0x300 [ 851.560752] [<c010311f>] sysenter_do_call+0x12/0x28 [ 851.560757] ---[ end trace 31e14488072d2f7d ]--- [ 851.560759] ------------[ cut here ]------------
The warning is caused by b43 not claiming the device before calling sdio_disable_func().
--- drivers/net/wireless/b43/sdio.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/b43/sdio.c +2 -0
@@ -175,7 +175,9 @@ static void b43_sdio_remove(struct sdio_struct b43_sdio *sdio =sdio_get_drvdata (func);ssb_bus_unregister (&sdio->ssb); +sdio_claim_host (func);sdio_disable_func (func); +sdio_release_host (func);kfree (sdio);sdio_set_drvdata (func,NULL ); }
PATCH 117/289 wireless: b43: fix error path in SDIO
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Guennadi Liakhovetski <[email protected]>
commit e476a5a41ad67d0e2b4a652820c49a3923eb936b upstream.
Fix unbalanced call to sdio_release_host() on the error path.
--- drivers/net/wireless/b43/sdio.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/b43/sdio.c +1 -0
@@ -163,6 +163,7 @@ static int b43_sdio_probe(struct sdio_fu err_free_ssb:kfree (sdio); err_disable_func: +sdio_claim_host (func);sdio_disable_func (func); err_release_host:sdio_release_host (func);
PATCH 118/289 ssb: b43-pci-bridge: Add new vendor for BCM4318
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel Klaffenbach <[email protected]>
commit 1d8638d4038eb8709edc80e37a0bbb77253d86e9 upstream.
Add new vendor for Broadcom 4318.
--- drivers/ssb/b43_pci_bridge.c | 1 + include/linux/pci_ids.h | 1 + 2 files changed, 2 insertions(+)
drivers/ssb/b43_pci_bridge.c +1 -0
@@ -24,6 +24,7 @@ static const struct pci_device_id b43_pc { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4312) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4315) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4318) }, + { PCI_DEVICE(PCI_VENDOR_ID_BCM_GVC, 0x4318) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4319) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4320) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4321) },
include/linux/pci_ids.h +1 -0
@@ -2041,6 +2041,7 @@#define PCI_DEVICE_ID_AFAVLAB_P030 0x2182#define PCI_SUBDEVICE_ID_AFAVLAB_P061 0x2150 +#define PCI_VENDOR_ID_BCM_GVC 0x14a4#define PCI_VENDOR_ID_BROADCOM 0x14e4#define PCI_DEVICE_ID_TIGON3_5752 0x1600#define PCI_DEVICE_ID_TIGON3_5752M 0x1601
PATCH 119/289 drivers/misc/ad525x_dpot.c: fix typo in spi write16 and write24 transfer counts
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Michael Hennerich <[email protected]>
commit 1f9fa5216eacf4fdf9d3e4ab57feb8b642f0e78b upstream.
This is a bug fix. Some SPI connected devices using 16/24 bit accesses, previously failed, now work.
This typo slipped in after testing, during some restructuring.
--- drivers/misc/ad525x_dpot-spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/misc/ad525x_dpot-spi.c +2 -2
@@ -53,13 +53,13 @@ static int write8(void *client, u8 val)static int write16 (void *client,u8 reg,u8 val) {u8 data[2 ] = {reg, val}; -return spi_write (client, data,1 ); +return spi_write (client, data,2 ); }static int write24 (void *client,u8 reg,u16 val) {u8 data[3 ] = {reg, val >>8 , val}; -return spi_write (client, data,1 ); +return spi_write (client, data,3 ); }static int read8 (void *client)
PATCH 120/289 sgi-xpc: XPC fails to discover partitions with all nasids above 128
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: [email protected] <[email protected]>
commit c22c7aeff69796f46ae0fcec141538e28f50b24e upstream.
UV hardware defines 256 memory protection regions versus the baseline 64 with increasing size for the SN2 ia64. This was overlooked when XPC was modified to accomodate both UV and SN2.
Without this patch, a user could reconfigure their existing system and suddenly disable cross-partition communications with no indication of what has gone wrong. It also prevents larger configurations from using cross-partition communication.
--- drivers/misc/sgi-xp/xpc_partition.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-)
drivers/misc/sgi-xp/xpc_partition.c +15 -10
@@ -439,18 +439,23 @@ xpc_discovery(void)* nodes that can comprise an access protection grouping. The access * protection is in regards to memory, IOI and IPI. */ - max_regions =64 ; region_size = xp_region_size; -switch (region_size) { -case 128 : - max_regions *=2 ; -case 64 : - max_regions *=2 ; -case 32 : - max_regions *=2 ; - region_size =16 ; -DBUG_ON (!is_shub2 ()); +if (is_uv ()) + max_regions =256 ; +else { + max_regions =64 ; + +switch (region_size) { +case 128 : + max_regions *=2 ; +case 64 : + max_regions *=2 ; +case 32 : + max_regions *=2 ; + region_size =16 ; +DBUG_ON (!is_shub2 ()); + } }for (region =0 ; region < max_regions; region++) {
PATCH 121/289 xen: ensure that all event channels start off bound to VCPU 0
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ian Campbell <[email protected]>
commit b0097adeec27e30223c989561ab0f7aa60d1fe93 upstream.
All event channels startbound to VCPU 0 so ensure that cpu_evtchn_mask is initialised to reflect this. Otherwise there is a race after registering an event channel but before the affinity is explicitly set where the event channel can be delivered. If this happens then the event channel remains pending in the L1 (evtchn_pending) array but is cleared in L2 (evtchn_pending_sel), this means the event channel cannot be reraised until another event channel happens to trigger the same L2 entry on that VCPU.
sizeof(cpu_evtchn_mask(0))==sizeof(unsigned long*) which is not correct, and causes only the first 32 or 64 event channels (depending on architecture) to be initially bound to VCPU0. Use sizeof(struct cpu_evtchn_s) instead.
--- drivers/xen/events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/events.c +1 -1
@@ -261,7 +261,7 @@ static void init_evtchn_cpu_bindings(voi }#endif -memset (cpu_evtchn_mask (0 ), ~0 ,sizeof (cpu_evtchn_mask (0 ))); +memset (cpu_evtchn_mask (0 ), ~0 ,sizeof (struct cpu_evtchn_s )); }static inline void clear_evtchn (int port)
PATCH 122/289 xen: dont bother to stop other cpus on shutdown/reboot
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeremy Fitzhardinge <[email protected]>
commit 31e323cca9d5c8afd372976c35a5d46192f540d1 upstream.
Xen will shoot all the VCPUs when we do a shutdown hypercall, so there's no need to do it manually.
In any case it will fail because all the IPI irqs have been pulled down by this point, so the cross-CPU calls will simply hang forever.
Until change 76fac077db6b34e2c6383a7b4f3f4f7b7d06d8ce the function calls were not synchronously waited for, so this wasn't apparent. However after that change the calls became synchronous leading to a hang on shutdown on multi-VCPU guests.
--- arch/x86/xen/enlighten.c | 4 ---- 1 file changed, 4 deletions(-)
arch/x86/xen/enlighten.c +0 -4
@@ -1017,10 +1017,6 @@ static void xen_reboot(int reason) {struct sched_shutdown r = { .reason = reason }; -#ifdef CONFIG_SMP -stop_other_cpus (); -#endif -if (HYPERVISOR_sched_op (SCHEDOP_shutdown, &r))BUG (); }
PATCH 123/289 ipc: initialize structure memory to zero for compat functions
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Rosenberg <[email protected]>
commit 03145beb455cf5c20a761e8451e30b8a74ba58d9 upstream.
This takes care of leaking uninitialized kernel stack memory to userspace from non-zeroed fields in structs in compat ipc functions.
--- ipc/compat.c | 6 ++++++ ipc/compat_mq.c | 5 +++++ 2 files changed, 11 insertions(+)
ipc/compat.c +6 -0
@@ -241,6 +241,8 @@ long compat_sys_semctl(int first, int sestruct semid64_ds __user *up64;int version =compat_ipc_parse_version (&third); +memset (&s64,0 ,sizeof (s64)); +if (!uptr)return -EINVAL ;if (get_user (pad, (u32 __user *) uptr))
@@ -421,6 +423,8 @@ long compat_sys_msgctl(int first, int seint version =compat_ipc_parse_version (&second);void __user *p; +memset (&m64,0 ,sizeof (m64)); +switch (second & (~IPC_64 )) {case IPC_INFO :case IPC_RMID :
@@ -594,6 +598,8 @@ long compat_sys_shmctl(int first, int seint err, err2;int version =compat_ipc_parse_version (&second); +memset (&s64,0 ,sizeof (s64)); +switch (second & (~IPC_64 )) {case IPC_RMID :case SHM_LOCK :
ipc/compat_mq.c +5 -0
@@ -53,6 +53,9 @@ asmlinkage long compat_sys_mq_open(constvoid __user *p =NULL ;if (u_attr && oflag &O_CREAT ) {struct mq_attr attr; + +memset (&attr,0 ,sizeof (attr)); + p =compat_alloc_user_space (sizeof (attr));if (get_compat_mq_attr (&attr, u_attr) ||copy_to_user (p, &attr,sizeof (attr)))
@@ -127,6 +130,8 @@ asmlinkage long compat_sys_mq_getsetattrstruct mq_attr __user *p =compat_alloc_user_space (2 *sizeof (*p));long ret; +memset (&mqstat,0 ,sizeof (mqstat)); +if (u_mqstat) {if (get_compat_mq_attr (&mqstat, u_mqstat) ||copy_to_user (p, &mqstat,sizeof (mqstat)))
PATCH 124/289 ipc: shm: fix information leak to userland
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vasiliy Kulikov <[email protected]>
commit 3af54c9bd9e6f14f896aac1bb0e8405ae0bc7a44 upstream.
The shmid_ds structure is copied to userland with shm_unused{,2,3} fields unitialized. It leads to leaking of contents of kernel stack memory.
--- ipc/shm.c | 1 + 1 file changed, 1 insertion(+)
ipc/shm.c +1 -0
@@ -473,6 +473,7 @@ static inline unsigned long copy_shmid_t {struct shmid_ds out; +memset (&out,0 ,sizeof (out));ipc64_perm_to_ipc_perm (&in->shm_perm, &out.shm_perm); out.shm_segsz = in->shm_segsz; out.shm_atime = in->shm_atime;
PATCH 125/289 net: NETIF_F_HW_CSUM does not imply FCoE CRC offload
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Hutchings <[email protected]>
commit 66c68bcc489fadd4f5e8839e966e3a366e50d1d5 upstream.
NETIF_F_HW_CSUM indicates the ability to update an TCP/IP-style 16-bit checksum with the checksum of an arbitrary part of the packet data, whereas the FCoE CRC is something entirely different.
--- net/core/dev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/core/dev.c +3 -3
@@ -1648,10 +1648,10 @@ EXPORT_SYMBOL(netif_device_attach);static bool can_checksum_protocol (unsigned long features,__be16 protocol) { -return ((features &NETIF_F_GEN_CSUM ) || - ((features &NETIF_F_IP_CSUM ) && +return ((features &NETIF_F_NO_CSUM ) || + ((features &NETIF_F_V4_CSUM ) && protocol ==htons (ETH_P_IP )) || - ((features &NETIF_F_IPV6_CSUM ) && + ((features &NETIF_F_V6_CSUM ) && protocol ==htons (ETH_P_IPV6 )) || ((features &NETIF_F_FCOE_CRC ) && protocol ==htons (ETH_P_FCOE )));
PATCH 126/289 drivers/char/vt_ioctl.c: fix VT_OPENQRY error value
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Graham Gower <[email protected]>
commit 1e0ad2881d50becaeea70ec696a80afeadf944d2 upstream.
When all VT's are in use, VT_OPENQRY casts -1 to unsigned char before returning it to userspace as an int. VT255 is not the next available console.
--- drivers/char/vt_ioctl.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/char/vt_ioctl.c +6 -5
@@ -503,6 +503,7 @@ int vt_ioctl(struct tty_struct *tty, strstruct kbd_struct * kbd;unsigned int console;unsigned char ucval; +unsigned int uival;void __user *up = (void __user *)arg;int i, perm;int ret =0 ;
@@ -657,7 +658,7 @@ int vt_ioctl(struct tty_struct *tty, strbreak ;case KDGETMODE : - ucval = vc->vc_mode; + uival = vc->vc_mode; goto setint;case KDMAPDISP :
@@ -695,7 +696,7 @@ int vt_ioctl(struct tty_struct *tty, strbreak ;case KDGKBMODE : - ucval = ((kbd->kbdmode ==VC_RAW ) ?K_RAW : + uival = ((kbd->kbdmode ==VC_RAW ) ?K_RAW : (kbd->kbdmode ==VC_MEDIUMRAW ) ?K_MEDIUMRAW : (kbd->kbdmode ==VC_UNICODE ) ?K_UNICODE :K_XLATE );
@@ -717,9 +718,9 @@ int vt_ioctl(struct tty_struct *tty, strbreak ;case KDGKBMETA : - ucval = (vc_kbd_mode (kbd,VC_META ) ?K_ESCPREFIX :K_METABIT ); + uival = (vc_kbd_mode (kbd,VC_META ) ?K_ESCPREFIX :K_METABIT ); setint: - ret =put_user (ucval, (int __user *)arg); + ret =put_user (uival, (int __user *)arg);break ;case KDGETKEYCODE :
@@ -949,7 +950,7 @@ int vt_ioctl(struct tty_struct *tty, strfor (i =0 ; i <MAX_NR_CONSOLES ; ++i)if (!VT_IS_IN_USE (i))break ; - ucval = i <MAX_NR_CONSOLES ? (i+1 ) :-1 ; + uival = i <MAX_NR_CONSOLES ? (i+1 ) :-1 ; goto setint;/*
PATCH 127/289 viafb: use proper register for colour when doing fill ops
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Florian Tobias Schandinat <[email protected]>
commit efd4f6398dc92b5bf392670df862f42a19f34cf2 upstream.
The colour was written to a wrong register for fillrect operations. This sometimes caused empty console space (for example after 'clear') to have a different colour than desired. Fix this by writing to the correct register.
Many thanks to Daniel Drake and Jon Nettleton for pointing out this issue and pointing me in the right direction for the fix.
Fixes http://dev.laptop.org/ticket/9323
--- drivers/video/via/accel.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/video/via/accel.c +4 -3
@@ -283,11 +283,12 @@ static int hw_bitblt_2(void __iomem *engwritel (tmp, engine +0x1C ); } -if (op !=VIA_BITBLT_COLOR ) +if (op ==VIA_BITBLT_FILL ) { +writel (fg_color, engine +0x58 ); + }else if (op ==VIA_BITBLT_MONO ) {writel (fg_color, engine +0x4C ); - -if (op ==VIA_BITBLT_MONO )writel (bg_color, engine +0x50 ); + }if (op ==VIA_BITBLT_FILL ) ge_cmd |= fill_rop <<24 |0x00002000 |0x00000001 ;
PATCH 128/289 sata_via: apply magic FIFO fix to vt6420 too
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
commit b1353e4f40f6179ab26a3bb1b2e1fe29ffe534f5 upstream.
vt6420 has the same FIFO overflow problem as vt6421 when combined with certain devices. This patch applies the magic fix to vt6420 too.
--- drivers/ata/sata_via.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/ata/sata_via.c +5 -4
@@ -538,7 +538,7 @@ static int vt8251_prepare_host(struct pcreturn 0 ; } -static void svia_configure (struct pci_dev *pdev) +static void svia_configure (struct pci_dev *pdev,int board_id) {u8 tmp8;
@@ -577,7 +577,7 @@ static void svia_configure(struct pci_de }/* -* vt6421 has problems talking to some drives. The following +* vt6420/1 has problems talking to some drives. The following * is the fix from Joseph Chan <[email protected]>. * * When host issues HOLD, device may send up to 20DW of data
@@ -596,8 +596,9 @@ static void svia_configure(struct pci_de* * https://bugzilla.kernel.org/show_bug.cgi?id=15173 * http://article.gmane.org/gmane.linux.ide/46352 +* http://thread.gmane.org/gmane.linux.kernel/1062139 */ -if (pdev->device ==0x3249 ) { +if (board_id == vt6420 || board_id == vt6421) {pci_read_config_byte (pdev,0x52 , &tmp8); tmp8 |=1 <<2 ;pci_write_config_byte (pdev,0x52 , tmp8);
@@ -652,7 +653,7 @@ static int svia_init_one(struct pci_devif (rc)return rc; -svia_configure (pdev); +svia_configure (pdev, board_id);pci_set_master (pdev); return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
PATCH 129/289 eCryptfs: Clear LOOKUP_OPEN flag when creating lower file
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tyler Hicks <[email protected]>
commit 2e21b3f124eceb6ab5a07c8a061adce14ac94e14 upstream.
eCryptfs was passing the LOOKUP_OPEN flag through to the lower file system, even though ecryptfs_create() doesn't support the flag. A valid filp for the lower filesystem could be returned in the nameidata if the lower file system's create() function supported LOOKUP_OPEN, possibly resulting in unencrypted writes to the lower file.
However, this is only a potential problem in filesystems (FUSE, NFS, CIFS, CEPH, 9p) that eCryptfs isn't known to support today.
https://bugs.launchpad.net/ecryptfs/+bug/641703
--- fs/ecryptfs/inode.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/ecryptfs/inode.c +4 -0
@@ -70,15 +70,19 @@ ecryptfs_create_underlying_file(struct istruct vfsmount *lower_mnt =ecryptfs_dentry_to_lower_mnt (dentry);struct dentry *dentry_save;struct vfsmount *vfsmount_save; +unsigned int flags_save;int rc; dentry_save = nd->path.dentry; vfsmount_save = nd->path.mnt; + flags_save = nd->flags; nd->path.dentry = lower_dentry; nd->path.mnt = lower_mnt; + nd->flags &= ~LOOKUP_OPEN ; rc =vfs_create (lower_dir_inode, lower_dentry, mode, nd); nd->path.dentry = dentry_save; nd->path.mnt = vfsmount_save; + nd->flags = flags_save;return rc; }
PATCH 130/289 ecryptfs: call vfs_setxattr() in ecryptfs_setxattr()
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Roberto Sassu <[email protected]>
commit 48b512e6857139393cdfce26348c362b87537018 upstream.
Ecryptfs is a stackable filesystem which relies on lower filesystems the ability of setting/getting extended attributes.
If there is a security module enabled on the system it updates the 'security' field of inodes according to the owned extended attribute set with the function vfs_setxattr(). When this function is performed on a ecryptfs filesystem the 'security' field is not updated for the lower filesystem since the call security_inode_post_setxattr() is missing for the lower inode.
Further, the call security_inode_setxattr() is missing for the lower inode, leading to policy violations in the security module because specific checks for this hook are not performed (i. e. filesystem 'associate' permission on SELinux is not checked for the lower filesystem).
This patch replaces the call of the setxattr() method of the lower inode in the function ecryptfs_setxattr() with vfs_setxattr().
--- fs/ecryptfs/inode.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
fs/ecryptfs/inode.c +3 -4
@@ -32,6 +32,7 @@#include <linux/crypto.h> #include <linux/fs_stack.h> #include <linux/slab.h> +#include <linux/xattr.h> #include <asm/unaligned.h> #include "ecryptfs_kernel.h"
@@ -1112,10 +1113,8 @@ ecryptfs_setxattr(struct dentry *dentry, rc = -EOPNOTSUPP ; goto out; } -mutex_lock (&lower_dentry->d_inode->i_mutex); - rc = lower_dentry->d_inode->i_op->setxattr (lower_dentry, name, value, - size, flags); -mutex_unlock (&lower_dentry->d_inode->i_mutex); + + rc =vfs_setxattr (lower_dentry, name, value, size, flags); out:return rc; }
PATCH 131/289 md: Fix regression with raid1 arrays without persistent metadata.
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: NeilBrown <[email protected]>
commit d97a41dc9c44f5829b7af7aa69fda10fd82b6b4e upstream.
A RAID1 which has no persistent metadata, whether internal or external, will hang on the first write.
This is caused by commit 070dc6dd7103b6b3f7e4d46e754354a5c15f366e In that case, MD_CHANGE_PENDING never gets cleared.
So during md_update_sb, is neither persistent or external, clear MD_CHANGE_PENDING.
This is suitable for 2.6.36-stable.
--- drivers/md/md.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/md/md.c +2 -0
@@ -2172,6 +2172,8 @@ repeat:if (!mddev->persistent) {clear_bit (MD_CHANGE_CLEAN , &mddev->flags);clear_bit (MD_CHANGE_DEVS , &mddev->flags); +if (!mddev->external) +clear_bit (MD_CHANGE_PENDING , &mddev->flags);wake_up (&mddev->sb_wait);return ; }
PATCH 132/289 md/raid1: really fix recovery looping when single good device fails.
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: NeilBrown <[email protected]>
commit 8f9e0ee38f75d4740daa9e42c8af628d33d19a02 upstream.
Commit 4044ba58dd15cb01797c4fd034f39ef4a75f7cc3 supposedly fixed a problem where if a raid1 with just one good device gets a read-error during recovery, the recovery would abort and immediately restart in an infinite loop.
However it depended on raid1_remove_disk removing the spare device from the array. But that does not happen in this case. So add a test so that in the 'recovery_disabled' case, the device will be removed.
This suitable for any kernel since 2.6.29 which is when recovery_disabled was introduced.
--- drivers/md/raid1.c | 1 + 1 file changed, 1 insertion(+)
drivers/md/raid1.c +1 -0
@@ -1210,6 +1210,7 @@ static int raid1_remove_disk(mddev_t *md* is not possible. */ if (!test_bit (Faulty, &rdev->flags) && + !mddev->recovery_disabled && mddev->degraded < conf->raid_disks) { err = -EBUSY ; goto abort;
PATCH 133/289 md: fix return value of rdev_size_change()
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Justin Maggard <[email protected]>
commit c26a44ed1e552aaa1d4ceb71842002d235fe98d7 upstream.
When trying to grow an array by enlarging component devices, rdev_size_store() expects the return value of rdev_size_change() to be in sectors, but the actual value is returned in KBs.
This functionality was broken by commit
dd8ac336c13fd8afdb082ebacb1cddd5cf727889
so this patch is suitable for any kernel since 2.6.30.
--- drivers/md/md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/md.c +2 -2
@@ -1329,7 +1329,7 @@ super_90_rdev_size_change(mdk_rdev_t *rdmd_super_write (rdev->mddev, rdev, rdev->sb_start, rdev->sb_size, rdev->sb_page);md_super_wait (rdev->mddev); -return num_sectors /2 ;/* kB for sysfs */ +return num_sectors; }
@@ -1697,7 +1697,7 @@ super_1_rdev_size_change(mdk_rdev_t *rdemd_super_write (rdev->mddev, rdev, rdev->sb_start, rdev->sb_size, rdev->sb_page);md_super_wait (rdev->mddev); -return num_sectors /2 ;/* kB for sysfs */ +return num_sectors; }static struct super_type super_types[] = {
PATCH 134/289 ALSA: hda: Use BIOS auto-parsing instead of existing model quirk for MEDION MD2
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit ac70eb1305d5a81efd1e32327d7e79be15a63a5a upstream.
A 2.6.35 (Ubuntu Maverick) user, burningphantom1, reported a regression in audio: playback was inaudible through both speakers and headphones. In commit 272a527c04 of sound-2.6.git, a new model was added with this machine's PCI SSID. Fortunately, it is now sufficient to use the auto model for BIOS auto-parsing instead of the existing quirk.
Playback, capture, and jack sense were verified working for both 2.6.35 and the alsa-driver snapshot from 2010-11-27 when model=auto is used.
--- sound/pci/hda/patch_realtek.c | 1 - 1 file changed, 1 deletion(-)
sound/pci/hda/patch_realtek.c +0 -1
@@ -9664,7 +9664,6 @@ static struct snd_pci_quirk alc882_cfg_tSND_PCI_QUIRK (0x17aa ,0x3bfc ,"Lenovo NB0763" ,ALC883_LENOVO_NB0763 ),SND_PCI_QUIRK (0x17aa ,0x3bfd ,"Lenovo NB0763" ,ALC883_LENOVO_NB0763 ),SND_PCI_QUIRK (0x17aa ,0x101d ,"Lenovo Sky" ,ALC888_LENOVO_SKY ), -SND_PCI_QUIRK (0x17c0 ,0x4071 ,"MEDION MD2" ,ALC883_MEDION_MD2 ),SND_PCI_QUIRK (0x17c0 ,0x4085 ,"MEDION MD96630" ,ALC888_LENOVO_MS7195_DIG ),SND_PCI_QUIRK (0x17f2 ,0x5000 ,"Albatron KI690-AM2" ,ALC883_6ST_DIG ), SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66),
PATCH 135/289 tty: prevent DOS in the flush_to_ldisc
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Olsa <[email protected]>
commit e045fec48970df84647a47930fcf7a22ff7229c0 upstream.
There's a small window inside the flush_to_ldisc function, where the tty is unlocked and calling ldisc's receive_buf function. If in this window new buffer is added to the tty, the processing might never leave the flush_to_ldisc function.
This scenario will hog the cpu, causing other tty processing starving, and making it impossible to interface the computer via tty.
I was able to exploit this via pty interface by sending only control characters to the master input, causing the flush_to_ldisc to be scheduled, but never actually generate any output.
To reproduce, please run multiple instances of following code.
- SNIP
#define _XOPEN_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char **argv)
{
int i, slave, master = getpt();
char buf[8192];
sprintf(buf, "%s", ptsname(master));
grantpt(master);
unlockpt(master);
slave = open(buf, O_RDWR);
if (slave < 0) {
perror("open slave failed");
return 1;
}
for(i = 0; i < sizeof(buf); i++)
buf[i] = rand() % 32;
while(1) {
write(master, buf, sizeof(buf));
}
return 0;
}- SNIP
The attached patch (based on -next tree) fixes this by checking on the tty buffer tail. Once it's reached, the current work is rescheduled and another could run.
--- drivers/char/tty_buffer.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/char/tty_buffer.c +12 -2
@@ -413,7 +413,8 @@ static void flush_to_ldisc(struct work_sspin_lock_irqsave (&tty->buf.lock, flags);if (!test_and_set_bit (TTY_FLUSHING , &tty->flags)) { -struct tty_buffer *head; +struct tty_buffer *head, *tail = tty->buf.tail; +int seen_tail =0 ;while ((head = tty->buf.head) !=NULL ) {int count;char *char_buf;
@@ -423,6 +424,15 @@ static void flush_to_ldisc(struct work_sif (!count) {if (head->next ==NULL )break ; +/* +There's a possibility tty might get new buffer +added during the unlock window below. We could +end up spinning in here forever hogging the CPU +completely. To avoid this let's have a rest each +time we processed the tail buffer. +*/ +if (tail == head) + seen_tail =1 ; tty->buf.head = head->next;tty_buffer_free (tty, head);continue ;
@@ -432,7 +442,7 @@ static void flush_to_ldisc(struct work_sline discipline as we want to empty the queue */ if (test_bit (TTY_FLUSHPENDING , &tty->flags))break ; -if (!tty->receive_room) { +if (!tty->receive_room || seen_tail) {schedule_delayed_work (&tty->buf.work,1 );break ; }
PATCH 136/289 TTY: restore tty_ldisc_wait_idle
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Slaby <[email protected]>
commit 100eeae2c5ce23b4db93ff320ee330ef1d740151 upstream.
It was removed in 65b770468e98 (tty-ldisc: turn ldisc user count into a proper refcount), but we need to wait for last user to quit the ldisc before we close it in tty_set_ldisc.
Otherwise weird things start to happen. There might be processes waiting in tty_read->n_tty_read on tty->read_wait for input to appear and at that moment, a change of ldisc is fatal. n_tty_close is called, it frees read_buf and the waiting process is still in the middle of reading and goes nuts after it is woken.
Previously we prevented close to happen when others are in ldisc ops by tty_ldisc_wait_idle in tty_set_ldisc. But the commit above removed that. So revoke the change and test whether there is 1 user (=we), and allow the close then.
We can do that without ldisc/tty locks, because nobody else can open the device due to TTY_LDISC_CHANGING bit set, so we in fact wait for everybody to leave.
I don't understand why tty_ldisc_lock would be needed either when the counter is an atomic variable, so this is a lockless tty_ldisc_wait_idle.
On the other hand, if we fail to wait (timeout or signal), we have to reenable the halted ldiscs, so we take ldisc lock and reuse the setup path at the end of tty_set_ldisc.
LKML-Reference: <[email protected]>
LKML-Reference: <[email protected]>
--- drivers/char/tty_ldisc.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
drivers/char/tty_ldisc.c +29 -0
@@ -47,6 +47,7 @@static DEFINE_SPINLOCK (tty_ldisc_lock);static DECLARE_WAIT_QUEUE_HEAD (tty_ldisc_wait); +static DECLARE_WAIT_QUEUE_HEAD (tty_ldisc_idle);/* Line disc dispatch table */ static struct tty_ldisc_ops *tty_ldiscs[NR_LDISCS ];
@@ -83,6 +84,7 @@ static void put_ldisc(struct tty_ldisc *return ; }local_irq_restore (flags); +wake_up (&tty_ldisc_idle); }/**
@@ -531,6 +533,23 @@ static int tty_ldisc_halt(struct tty_str }/** +* tty_ldisc_wait_idle - wait for the ldisc to become idle +* @tty: tty to wait for +* +* Wait for the line discipline to become idle. The discipline must +* have been halted for this to guarantee it remains idle. +*/ +static int tty_ldisc_wait_idle (struct tty_struct *tty) +{ +int ret; + ret =wait_event_interruptible_timeout (tty_ldisc_idle, +atomic_read (&tty->ldisc->users) ==1 ,5 *HZ ); +if (ret <0 ) +return ret; +return ret >0 ?0 : -EBUSY ; +} + +/** * tty_set_ldisc - set line discipline * @tty: the terminal to set * @ldisc: the line discipline
@@ -634,8 +653,17 @@ int tty_set_ldisc(struct tty_struct *ttyflush_scheduled_work (); + retval =tty_ldisc_wait_idle (tty); +tty_lock ();mutex_lock (&tty->ldisc_mutex); + +/* handle wait idle failure locked */ +if (retval) { +tty_ldisc_put (new_ldisc); + goto enable; + } +if (test_bit (TTY_HUPPED , &tty->flags)) {/* We were raced by the hangup method. It will have stomped the ldisc data and closed the ldisc down */
@@ -669,6 +697,7 @@ int tty_set_ldisc(struct tty_struct *ttytty_ldisc_put (o_ldisc); +enable:/* * Allow ldisc referencing to occur again */
PATCH 137/289 tty_ldisc: Fix BUG() on hangup
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: =?UTF-8?q?Philippe=20R=C3=A9tornaz?= <[email protected]>
commit 1c95ba1e1de7edffc0c4e275e147f1a9eb1f81ae upstream.
A kernel BUG when bluetooth rfcomm connection drop while the associated serial port is open is sometime triggered.
It seems that the line discipline can disappear between the tty_ldisc_put and tty_ldisc_get. This patch fall back to the N_TTY line discipline if the previous discipline is not available anymore.
--- drivers/char/tty_ldisc.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
drivers/char/tty_ldisc.c +13 -7
@@ -743,9 +743,12 @@ static void tty_reset_termios(struct tty* state closed */ -static void tty_ldisc_reinit (struct tty_struct *tty,int ldisc) +static int tty_ldisc_reinit (struct tty_struct *tty,int ldisc) { -struct tty_ldisc *ld; +struct tty_ldisc *ld =tty_ldisc_get (ldisc); + +if (IS_ERR (ld)) +return -1 ;tty_ldisc_close (tty, tty->ldisc);tty_ldisc_put (tty->ldisc);
@@ -753,10 +756,10 @@ static void tty_ldisc_reinit(struct tty_/* * Switch the line discipline back */ - ld =tty_ldisc_get (ldisc); -BUG_ON (IS_ERR (ld));tty_ldisc_assign (tty, ld);tty_set_termios_ldisc (tty, ldisc); + +return 0 ; }/**
@@ -831,13 +834,16 @@ void tty_ldisc_hangup(struct tty_structa FIXME */ if (tty->ldisc) {/* Not yet closed */ if (reset ==0 ) { -tty_ldisc_reinit (tty, tty->termios->c_line); - err =tty_ldisc_open (tty, tty->ldisc); + +if (!tty_ldisc_reinit (tty, tty->termios->c_line)) + err =tty_ldisc_open (tty, tty->ldisc); +else + err =1 ; }/* If the re-open fails or we reset then go to N_TTY. The N_TTY open cannot fail */ if (reset || err) { -tty_ldisc_reinit (tty,N_TTY ); +BUG_ON (tty_ldisc_reinit (tty,N_TTY ));WARN_ON (tty_ldisc_open (tty, tty->ldisc)); }tty_ldisc_enable (tty);
PATCH 138/289 TTY: ldisc, fix open flag handling
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Slaby <[email protected]>
commit 7f90cfc505d613f4faf096e0d84ffe99208057d9 upstream.
When a concrete ldisc open fails in tty_ldisc_open, we forget to clear TTY_LDISC_OPEN. This causes a false warning on the next ldisc open:
WARNING: at drivers/char/tty_ldisc.c:445 tty_ldisc_open+0x26/0x38() Hardware name: System Product Name Modules linked in: ... Pid: 5251, comm: a.out Tainted: G W 2.6.32-5-686 #1 Call Trace: [<c1030321>] ? warn_slowpath_common+0x5e/0x8a [<c1030357>] ? warn_slowpath_null+0xa/0xc [<c119311c>] ? tty_ldisc_open+0x26/0x38 [<c11936c5>] ? tty_set_ldisc+0x218/0x304
...
So clear the bit when failing...
Introduced in c65c9bc3efa (tty: rewrite the ldisc locking) back in 2.6.31-rc1.
--- drivers/char/tty_ldisc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/char/tty_ldisc.c +2 -0
@@ -454,6 +454,8 @@ static int tty_ldisc_open(struct tty_str/* BTM here locks versus a hangup event */ WARN_ON (!tty_locked ()); ret = ld->ops->open (tty); +if (ret) +clear_bit (TTY_LDISC_OPEN , &tty->flags);return ret; }return 0 ;
PATCH 139/289 TTY: dont allow reopen when ldisc is changing
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Slaby <[email protected]>
commit e2efafbf139d2bfdfe96f2901f03189fecd172e4 upstream.
There are many WARNINGs like the following reported nowadays:
WARNING: at drivers/tty/tty_io.c:1331 tty_open+0x2a2/0x49a() Hardware name: Latitude E6500 Modules linked in: Pid: 1207, comm: plymouthd Not tainted 2.6.37-rc3-mmotm1123 #3 Call Trace: [<ffffffff8103b189>] warn_slowpath_common+0x80/0x98 [<ffffffff8103b1b6>] warn_slowpath_null+0x15/0x17 [<ffffffff8128a3ab>] tty_open+0x2a2/0x49a [<ffffffff810fd53f>] chrdev_open+0x11d/0x146
...
This means tty_reopen is called without TTY_LDISC set. For further considerations, note tty_lock is held in tty_open. TTY_LDISC is cleared in:
1) __tty_hangup from tty_ldisc_hangup to tty_ldisc_enable. During this section tty_lock is held. However tty_lock is temporarily dropped in the middle of the function by tty_ldisc_hangup.
2) tty_release via tty_ldisc_release till the end of tty existence. If tty->count <= 1, tty_lock is taken, TTY_CLOSING bit set and then tty_ldisc_release called. tty_reopen checks TTY_CLOSING before checking TTY_LDISC.
3) tty_set_ldisc from tty_ldisc_halt to tty_ldisc_enable. We:
* take tty_lock, set TTY_LDISC_CHANGING, put tty_lock
* call tty_ldisc_halt (clear TTY_LDISC), tty_lock is _not_ held
* do some other work
* take tty_lock, call tty_ldisc_enable (set TTY_LDISC), put tty_lock
I cannot see how 2) can be a problem, as there I see no race. OTOH, 1) and 3) can happen without problems. This patch the case 3) by checking TTY_LDISC_CHANGING along with TTY_CLOSING in tty_reopen. 1) will be fixed in the following patch.
Nicely reproducible with two processes:
while (1) {
fd = open("/dev/ttyS1", O_RDWR);
if (fd < 0) {
warn("open");
continue;
}
close(fd);
}
--------
while (1) {
fd = open("/dev/ttyS1", O_RDWR);
ld1 = 0; ld2 = 2;
while (1) {
ioctl(fd, TIOCSETD, &ld1);
ioctl(fd, TIOCSETD, &ld2);
}
close(fd);
}--- drivers/char/tty_io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/char/tty_io.c +2 -1
@@ -1304,7 +1304,8 @@ static int tty_reopen(struct tty_struct {struct tty_driver *driver = tty->driver; -if (test_bit (TTY_CLOSING , &tty->flags)) +if (test_bit (TTY_CLOSING , &tty->flags) || +test_bit (TTY_LDISC_CHANGING , &tty->flags))return -EIO ; if (driver->type == TTY_DRIVER_TYPE_PTY &&
PATCH 140/289 TTY: open/hangup race fixup
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Slaby <[email protected]>
commit acfa747baf73922021a047f2d87a2d866f5dbab5 upstream.
Like in the "TTY: don't allow reopen when ldisc is changing" patch, this one fixes a TTY WARNING as described in the option 1) there:
1) __tty_hangup from tty_ldisc_hangup to tty_ldisc_enable. During this section tty_lock is held. However tty_lock is temporarily dropped in the middle of the function by tty_ldisc_hangup.
The fix is to introduce a new flag which we set during the unlocked window and check it in tty_reopen too. The flag is TTY_HUPPING and is cleared after TTY_HUPPED is set.
While at it, remove duplicate TTY_HUPPED set_bit. The one after calling ops->hangup seems to be more correct. But anyway, we hold tty_lock, so there should be no difference.
Also document the function it does that kind of crap.
Nicely reproducible with two forked children:
static void do_work(const char *tty)
{
if (signal(SIGHUP, SIG_IGN) == SIG_ERR) exit(1);
setsid();
while (1) {
int fd = open(tty, O_RDWR|O_NOCTTY);
if (fd < 0) continue;
if (ioctl(fd, TIOCSCTTY)) continue;
if (vhangup()) continue;
close(fd);
}
exit(0);
}--- drivers/char/tty_io.c | 10 +++++++++- include/linux/tty.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-)
drivers/char/tty_io.c +9 -1
@@ -553,6 +553,9 @@ void __tty_hangup(struct tty_struct *ttytty_lock (); +/* some functions below drop BTM, so we need this bit */ +set_bit (TTY_HUPPING , &tty->flags); +/* inuse_filps is protected by the single tty lock, this really needs to change if we want to flush the workqueue with the lock held */
@@ -572,6 +575,10 @@ void __tty_hangup(struct tty_struct *tty }spin_unlock (&tty_files_lock); +/* +* it drops BTM and thus races with reopen +* we protect the race by TTY_HUPPING +*/ tty_ldisc_hangup (tty);read_lock (&tasklist_lock);
@@ -609,7 +616,6 @@ void __tty_hangup(struct tty_struct *tty tty->session =NULL ; tty->pgrp =NULL ; tty->ctrl_status =0 ; -set_bit (TTY_HUPPED , &tty->flags);spin_unlock_irqrestore (&tty->ctrl_lock, flags);/* Account for the p->signal references we killed */
@@ -635,6 +641,7 @@ void __tty_hangup(struct tty_struct *tty* can't yet guarantee all that. */ set_bit (TTY_HUPPED , &tty->flags); +clear_bit (TTY_HUPPING , &tty->flags);tty_ldisc_enable (tty);tty_unlock ();
@@ -1305,6 +1312,7 @@ static int tty_reopen(struct tty_structstruct tty_driver *driver = tty->driver;if (test_bit (TTY_CLOSING , &tty->flags) || +test_bit (TTY_HUPPING , &tty->flags) ||test_bit (TTY_LDISC_CHANGING , &tty->flags))return -EIO ;
include/linux/tty.h +1 -0
@@ -365,6 +365,7 @@ struct tty_file_private {#define TTY_HUPPED 18/* Post driver->hangup() */ #define TTY_FLUSHING 19/* Flushing to ldisc in progress */ #define TTY_FLUSHPENDING 20/* Queued buffer flush pending */ +#define TTY_HUPPING 21/* ->hangup() in progress */ #define TTY_WRITE_FLUSH (tty) tty_write_flush((tty))
PATCH 141/289 usbnet: fix usb_autopm_get_interface failure(v1)
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ming Lei <[email protected]>
commit b0786b430c982dffbb44d8030e6b6088671ce745 upstream.
Since usbnet already took usb runtime pm, we have to enable runtime pm for usb interface of usbnet, otherwise usb_autopm_get_interface may return failure and cause 'ifconfig usb0 up' failed if USB_SUSPEND(RUNTIME_PM) is enabled.
--- drivers/net/usb/usbnet.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/net/usb/usbnet.c +11 -0
@@ -45,6 +45,7 @@#include <linux/usb/usbnet.h> #include <linux/slab.h> #include <linux/kernel.h> +#include <linux/pm_runtime.h> #define DRIVER_VERSION "22-Aug-2005"
@@ -1273,6 +1274,16 @@ usbnet_probe (struct usb_interface *udevstruct usb_device *xdev;int status;const char *name; +struct usb_driver *driver =to_usb_driver (udev->dev.driver); + +/* usbnet already took usb runtime pm, so have to enable the feature +* for usb interface, otherwise usb_autopm_get_interface may return +* failure if USB_SUSPEND(RUNTIME_PM) is enabled. +*/ +if (!driver->supports_autosuspend) { + driver->supports_autosuspend =1 ; +pm_runtime_enable (&udev->dev); + } name = udev->dev.driver->name; info = (struct driver_info *) prod->driver_info;
PATCH 142/289 HID: Fix for problems with eGalax/DWAV multi-touch-screen
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Philipp Merkel <[email protected]>
commit f51661105c3c8a0afcd69f995a4f4a10e53da153 upstream.
This patch fixes three problems with the eGalax/DWAV multi-touch screen found in the Eee PC T101MT:
1) While there is a dedicated multitouch driver for the screen (hid-egalax.c), the MULTI_INPUT quirk is also applied, preventing the hid-egalax driver from working. This patch removes the quirk so the hid-egalax driver can handle the device correctly.
2) The x and y coordinates sent by the screen in multi-touch mode are shifted by three bits from the events sent in single-touch mode, thus the coordinates are out of range, leading to the pointer being stuck in the bottom-right corner if no additional calibration is applied (e.g. in the X evdev driver). This patch shifts the coordinates back. This does not decrease accuracy as the last three bits of the "wrong" coordinates are always 0.
3) Only multi-touch pressure events are sent, single touch emulation is missing pressure information. This patch adds single-touch ABS_PRESSURE events.
--- drivers/hid/hid-egalax.c | 16 +++++++++++----- drivers/hid/usbhid/hid-quirks.c | 1 - 2 files changed, 11 insertions(+), 6 deletions(-)
drivers/hid/hid-egalax.c +11 -5
@@ -31,7 +31,7 @@ struct egalax_data {bool first;/* is this the first finger in the frame? */ bool valid;/* valid finger data, or just placeholder? */ bool activity;/* at least one active finger previously? */ -__u16 lastx, lasty;/* latest valid (x, y) in the frame */ +__u16 lastx, lasty, lastz;/* latest valid (x, y, z) in the frame */ }; static int egalax_input_mapping(struct hid_device *hdev, struct hid_input *hi,
@@ -79,6 +79,10 @@ static int egalax_input_mapping(struct hcase HID_DG_TIPPRESSURE :hid_map_usage (hi, usage, bit, max,EV_ABS ,ABS_MT_PRESSURE ); +/* touchscreen emulation */ +input_set_abs_params (hi->input,ABS_PRESSURE , + field->logical_minimum, + field->logical_maximum,0 ,0 );return 1 ; }return 0 ;
@@ -109,8 +113,8 @@ static void egalax_filter_event(struct eif (td->valid) {/* emit multitouch events */ input_event (input,EV_ABS ,ABS_MT_TRACKING_ID , td->id); -input_event (input,EV_ABS ,ABS_MT_POSITION_X , td->x); -input_event (input,EV_ABS ,ABS_MT_POSITION_Y , td->y); +input_event (input,EV_ABS ,ABS_MT_POSITION_X , td->x >>3 ); +input_event (input,EV_ABS ,ABS_MT_POSITION_Y , td->y >>3 );input_event (input,EV_ABS ,ABS_MT_PRESSURE , td->z);input_mt_sync (input);
@@ -121,6 +125,7 @@ static void egalax_filter_event(struct e*/ td->lastx = td->x; td->lasty = td->y; + td->lastz = td->z; }/*
@@ -129,8 +134,9 @@ static void egalax_filter_event(struct e* the oldest on the panel, the one we want for single touch */ if (!td->first && td->activity) { -input_event (input,EV_ABS ,ABS_X , td->lastx); -input_event (input,EV_ABS ,ABS_Y , td->lasty); +input_event (input,EV_ABS ,ABS_X , td->lastx >>3 ); +input_event (input,EV_ABS ,ABS_Y , td->lasty >>3 ); +input_event (input,EV_ABS ,ABS_PRESSURE , td->lastz); }if (!td->valid) {
drivers/hid/usbhid/hid-quirks.c +0 -1
@@ -34,7 +34,6 @@ static const struct hid_blacklist { { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, { USB_VENDOR_ID_DWAV, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER, HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET }, - { USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_MOJO, USB_DEVICE_ID_RETRO_ADAPTER, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
PATCH 143/289 gspca - main: Fix a regression with the PS3 Eye webcam
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Moine?= <[email protected]>
commit f43402fa55bf5e7e190c176343015122f694857c upstream.
When audio is present, some alternate settings were skipped. This prevented some webcams to work, especially when bulk transfer was used. This patch permits to use the last or only alternate setting.
--- drivers/media/video/gspca/gspca.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/video/gspca/gspca.c +2 -2
@@ -652,7 +652,7 @@ static struct usb_host_endpoint *get_ep( : USB_ENDPOINT_XFER_ISOC; i = gspca_dev->alt;/* previous alt setting */ if (gspca_dev->cam.reverse_alts) { -if (gspca_dev->audio) +if (gspca_dev->audio && i < gspca_dev->nbalt -2 ) i++;while (++i < gspca_dev->nbalt) { ep =alt_xfer (&intf->altsetting[i], xfer);
@@ -660,7 +660,7 @@ static struct usb_host_endpoint *get_ep(break ; } }else { -if (gspca_dev->audio) +if (gspca_dev->audio && i >1 ) i--;while (--i >=0 ) { ep =alt_xfer (&intf->altsetting[i], xfer);
PATCH 144/289 gspca - sonixj: Fix a regression of sensors hv7131r and mi0360
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Moine?= <[email protected]>
commit 0303a90a744662e934877a5d637a43197229274b upstream.
The bug was introduced by commit 23a98274cc348880ecb6803307c254448084953a applying values of sensor sp80708 to sensors hv7131r and mi0360.
--- drivers/media/video/gspca/sonixj.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/video/gspca/sonixj.c +1 -2
@@ -2474,8 +2474,7 @@ static int sd_start(struct gspca_dev *gs reg1 =0x44 ; reg17 =0xa2 ;break ; -default : -/* case SENSOR_SP80708: */ +case SENSOR_SP80708 : init = sp80708_sensor_param1;if (mode) {/*?? reg1 = 0x04; * 320 clk 48Mhz */
PATCH 145/289 hdpvr: Add missing URB_NO_TRANSFER_DMA_MAP flag
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: James M McLaren <[email protected]>
commit 4f5c933abb34532dc962185c999509b97a97fa1b upstream.
Necessary on arm.
--- drivers/media/video/hdpvr/hdpvr-video.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/video/hdpvr/hdpvr-video.c +1 -0
@@ -157,6 +157,7 @@ int hdpvr_alloc_buffers(struct hdpvr_dev mem, dev->bulk_in_size, hdpvr_read_bulk_callback, buf); + buf->urb->transfer_flags |=URB_NO_TRANSFER_DMA_MAP ; buf->status =BUFSTAT_AVAILABLE ;list_add_tail (&buf->buff_list, &dev->free_buff_list); }
PATCH 146/289 drivers/media/video/cx23885/cx23885-core.c: fix cx23885_dev_checkrevision()
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrew Morton <[email protected]>
commit abe1def46d84aa27d3f84d729204b162e8c64d76 upstream.
It was missing the `break'.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=18672
--- drivers/media/video/cx23885/cx23885-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/video/cx23885/cx23885-core.c +1 -0
@@ -815,6 +815,7 @@ static void cx23885_dev_checkrevision(stcase 0x0e :/* CX23887-15Z */ dev->hwrevision =0xc0 ; +break ;case 0x0f :/* CX23887-14Z */ dev->hwrevision =0xb1 ;
PATCH 147/289 nfs: handle lock context allocation failures in nfs_create_request
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Layton <[email protected]>
commit 015f0212d51d85bd281a831639a769b4a1a3307a upstream.
nfs_get_lock_context can return NULL on an allocation failure. Regression introduced by commit f11ac8db.
--- fs/nfs/pagelist.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
fs/nfs/pagelist.c +7 -1
@@ -65,6 +65,13 @@ nfs_create_request(struct nfs_open_conteif (req ==NULL )return ERR_PTR (-ENOMEM ); +/* get lock context early so we can deal with alloc failures */ + req->wb_lock_context =nfs_get_lock_context (ctx); +if (req->wb_lock_context ==NULL ) { +nfs_page_free (req); +return ERR_PTR (-ENOMEM ); + } +/* Initialize the request struct. Initially, we assume a * long write-back delay. This will be adjusted in * update_nfs_request below if the region is not locked. */
@@ -79,7 +86,6 @@ nfs_create_request(struct nfs_open_conte req->wb_pgbase = offset; req->wb_bytes = count; req->wb_context =get_nfs_open_context (ctx); - req->wb_lock_context =nfs_get_lock_context (ctx);kref_init (&req->wb_kref);return req; }
PATCH 148/289 KVM: Write protect memory after slot swap
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Michael S. Tsirkin <[email protected]>
commit edde99ce05290e50ce0b3495d209e54e6349ab47 upstream.
I have observed the following bug trigger:
1. userspace calls GET_DIRTY_LOG
2. kvm_mmu_slot_remove_write_access is called and makes a page ro
3. page fault happens and makes the page writeable fault is logged in the bitmap appropriately
4. kvm_vm_ioctl_get_dirty_log swaps slot pointers
a lot of time passes
5. guest writes into the page
6. userspace calls GET_DIRTY_LOG
At point (5), bitmap is clean and page is writeable, thus, guest modification of memory is not logged and GET_DIRTY_LOG returns an empty bitmap.
The rule is that all pages are either dirty in the current bitmap, or write-protected, which is violated here.
It seems that just moving kvm_mmu_slot_remove_write_access down to after the slot pointer swap should fix this bug.
--- arch/x86/kvm/x86.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/kvm/x86.c +4 -4
@@ -2912,10 +2912,6 @@ int kvm_vm_ioctl_get_dirty_log(struct kvstruct kvm_memslots *slots, *old_slots;unsigned long *dirty_bitmap; -spin_lock (&kvm->mmu_lock); -kvm_mmu_slot_remove_write_access (kvm, log->slot); -spin_unlock (&kvm->mmu_lock); - r = -ENOMEM ; dirty_bitmap =vmalloc (n);if (!dirty_bitmap)
@@ -2937,6 +2933,10 @@ int kvm_vm_ioctl_get_dirty_log(struct kv dirty_bitmap = old_slots->memslots[log->slot].dirty_bitmap;kfree (old_slots); +spin_lock (&kvm->mmu_lock); +kvm_mmu_slot_remove_write_access (kvm, log->slot); +spin_unlock (&kvm->mmu_lock); + r = -EFAULT ;if (copy_to_user (log->dirty_bitmap, dirty_bitmap, n)) {vfree (dirty_bitmap);
PATCH 149/289 KVM: x86: fix information leak to userland
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Vasiliy Kulikov <[email protected]>
commit 97e69aa62f8b5d338d6cff49be09e37cc1262838 upstream.
Structures kvm_vcpu_events, kvm_debugregs, kvm_pit_state2 and kvm_clock_data are copied to userland with some padding and reserved fields unitialized. It leads to leaking of contents of kernel stack memory. We have to initialize them to zero.
In patch v1 Jan Kiszka suggested to fill reserved fields with zeros instead of memset'ting the whole struct. It makes sense as these fields are explicitly marked as padding. No more fields need zeroing.
--- arch/x86/kvm/x86.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/x86/kvm/x86.c +6 -0
@@ -2305,6 +2305,7 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_ !kvm_exception_is_soft (vcpu->arch.exception.nr); events->exception.nr = vcpu->arch.exception.nr; events->exception.has_error_code = vcpu->arch.exception.has_error_code; + events->exception.pad =0 ; events->exception.error_code = vcpu->arch.exception.error_code; events->interrupt.injected =
@@ -2318,12 +2319,14 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_ events->nmi.injected = vcpu->arch.nmi_injected; events->nmi.pending = vcpu->arch.nmi_pending; events->nmi.masked = kvm_x86_ops->get_nmi_mask (vcpu); + events->nmi.pad =0 ; events->sipi_vector = vcpu->arch.sipi_vector; events->flags = (KVM_VCPUEVENT_VALID_NMI_PENDING |KVM_VCPUEVENT_VALID_SIPI_VECTOR |KVM_VCPUEVENT_VALID_SHADOW ); +memset (&events->reserved,0 ,sizeof (events->reserved)); } static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu,
@@ -2366,6 +2369,7 @@ static void kvm_vcpu_ioctl_x86_get_debug dbgregs->dr6 = vcpu->arch.dr6; dbgregs->dr7 = vcpu->arch.dr7; dbgregs->flags =0 ; +memset (&dbgregs->reserved,0 ,sizeof (dbgregs->reserved)); } static int kvm_vcpu_ioctl_x86_set_debugregs(struct kvm_vcpu *vcpu,
@@ -2849,6 +2853,7 @@ static int kvm_vm_ioctl_get_pit2(struct sizeof(ps->channels)); ps->flags = kvm->arch.vpit->pit_state.flags;mutex_unlock (&kvm->arch.vpit->pit_state.lock); +memset (&ps->reserved,0 ,sizeof (ps->reserved));return r; }
@@ -3229,6 +3234,7 @@ long kvm_arch_vm_ioctl(struct file *filp now_ns =timespec_to_ns (&now); user_ns.clock = kvm->arch.kvmclock_offset + now_ns; user_ns.flags =0 ; +memset (&user_ns.pad,0 ,sizeof (user_ns.pad)); r = -EFAULT ;if (copy_to_user (argp, &user_ns,sizeof (user_ns)))
PATCH 150/289 KVM: Correct ordering of ldt reload wrt fs/gs reload
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Avi Kivity <[email protected]>
commit 0a77fe4c188e25917799f2356d4aa5e6d80c39a2 upstream.
If fs or gs refer to the ldt, they must be reloaded after the ldt. Reorder the code to that effect.
Userspace code that uses the ldt with kvm is nonexistent, so this doesn't fix a user-visible bug.
--- arch/x86/kvm/svm.c | 2 +- arch/x86/kvm/vmx.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/kvm/svm.c +1 -1
@@ -3281,6 +3281,7 @@ static void svm_vcpu_run(struct kvm_vcpu vcpu->arch.regs[VCPU_REGS_RIP ] = svm->vmcb->save.rip;load_host_msrs (vcpu); +kvm_load_ldt (ldt_selector);loadsegment (fs, fs_selector);#ifdef CONFIG_X86_64 load_gs_index (gs_selector);
@@ -3288,7 +3289,6 @@ static void svm_vcpu_run(struct kvm_vcpu#else loadsegment (gs, gs_selector);#endif -kvm_load_ldt (ldt_selector);reload_tss (vcpu);
arch/x86/kvm/vmx.c +2 -2
@@ -846,8 +846,6 @@ static void __vmx_load_host_state(struct ++vmx->vcpu.stat.host_state_reload; vmx->host_state.loaded =0 ; -if (vmx->host_state.fs_reload_needed) -loadsegment (fs, vmx->host_state.fs_sel);if (vmx->host_state.gs_ldt_reload_needed) {kvm_load_ldt (vmx->host_state.ldt_sel);#ifdef CONFIG_X86_64
@@ -857,6 +855,8 @@ static void __vmx_load_host_state(structloadsegment (gs, vmx->host_state.gs_sel);#endif } +if (vmx->host_state.fs_reload_needed) +loadsegment (fs, vmx->host_state.fs_sel);reload_tss ();#ifdef CONFIG_X86_64 if (is_long_mode (&vmx->vcpu)) {
PATCH 151/289 KVM: VMX: Fix host userspace gsbase corruption
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Avi Kivity <[email protected]>
commit c8770e7ba63bb5dd8fe5f9d251275a8fa717fb78 upstream.
We now use load_gs_index() to load gs safely; unfortunately this also changes MSR_KERNEL_GS_BASE, which we managed separately. This resulted in confusion and breakage running 32-bit host userspace on a 64-bit kernel.
Fix by
- saving guest MSR_KERNEL_GS_BASE before we we reload the host's gs
- doing the host save/load unconditionally, instead of only when in guest long mode
Things can be cleaned up further, but this is the minmal fix for now.
--- arch/x86/kvm/vmx.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
arch/x86/kvm/vmx.c +7 -8
@@ -828,10 +828,9 @@ static void vmx_save_host_state(struct k#endif #ifdef CONFIG_X86_64 -if (is_long_mode (&vmx->vcpu)) { -rdmsrl (MSR_KERNEL_GS_BASE , vmx->msr_host_kernel_gs_base); +rdmsrl (MSR_KERNEL_GS_BASE , vmx->msr_host_kernel_gs_base); +if (is_long_mode (&vmx->vcpu))wrmsrl (MSR_KERNEL_GS_BASE , vmx->msr_guest_kernel_gs_base); - }#endif for (i =0 ; i < vmx->save_nmsrs; ++i) kvm_set_shared_msr(vmx->guest_msrs[i].index,
@@ -846,11 +845,14 @@ static void __vmx_load_host_state(struct ++vmx->vcpu.stat.host_state_reload; vmx->host_state.loaded =0 ; +#ifdef CONFIG_X86_64 +if (is_long_mode (&vmx->vcpu)) +rdmsrl (MSR_KERNEL_GS_BASE , vmx->msr_guest_kernel_gs_base); +#endif if (vmx->host_state.gs_ldt_reload_needed) {kvm_load_ldt (vmx->host_state.ldt_sel);#ifdef CONFIG_X86_64 load_gs_index (vmx->host_state.gs_sel); -wrmsrl (MSR_KERNEL_GS_BASE , current->thread.gs);#else loadsegment (gs, vmx->host_state.gs_sel);#endif
@@ -859,10 +861,7 @@ static void __vmx_load_host_state(structloadsegment (fs, vmx->host_state.fs_sel);reload_tss ();#ifdef CONFIG_X86_64 -if (is_long_mode (&vmx->vcpu)) { -rdmsrl (MSR_KERNEL_GS_BASE , vmx->msr_guest_kernel_gs_base); -wrmsrl (MSR_KERNEL_GS_BASE , vmx->msr_host_kernel_gs_base); - } +wrmsrl (MSR_KERNEL_GS_BASE , vmx->msr_host_kernel_gs_base);#endif if (current_thread_info ()->status &TS_USEDFPU )clts ();
PATCH 152/289 ASoC: Remove volatility from WM8900 POWER1 register
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Mark Brown <[email protected]>
commit 6d212d8e86fb4221bd91b9266b7567ee2b83bd01 upstream.
Not all bits can be read back from POWER1 so avoid corruption when using a read/modify/write cycle by marking it non-volatile - the only thing we read back from it is the chip revision which has diagnostic value only. We can re-add later but that's a more invasive change than is suitable for a bugfix.
--- sound/soc/codecs/wm8900.c | 6 ------ 1 file changed, 6 deletions(-)
sound/soc/codecs/wm8900.c +0 -6
@@ -188,7 +188,6 @@ static int wm8900_volatile_register(unsi {switch (reg) {case WM8900_REG_ID : -case WM8900_REG_POWER1 :return 1 ;default :return 0 ;
@@ -1236,11 +1235,6 @@ static __devinit int wm8900_i2c_probe(st goto err; } -/* Read back from the chip */ - reg =snd_soc_read (codec,WM8900_REG_POWER1 ); - reg = (reg >>12 ) &0xf ; -dev_info (&i2c->dev,"WM8900 revision %d\n" , reg); -wm8900_reset (codec);/* Turn the chip on */
PATCH 153/289 ASoC: wm8961 - clear WM8961_DACSLOPE bit for normal mode
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Axel Lin <[email protected]>
commit 08b1a38465cab8c2224a5202c7a3b5e5f5630894 upstream.
DACSLOPE bit of Register 06h ADC and DAC Control 2:
0: Normal mode
1: Sloping stop-band mode
Thus in the case of normal mode, we should clear DACSLOPE bit.
--- sound/soc/codecs/wm8961.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm8961.c +1 -1
@@ -711,7 +711,7 @@ static int wm8961_hw_params(struct snd_pif (fs <=24000 ) reg |=WM8961_DACSLOPE ;else - reg &=WM8961_DACSLOPE ; + reg &= ~WM8961_DACSLOPE ;snd_soc_write (codec,WM8961_ADC_DAC_CONTROL_2 , reg);return 0 ;
PATCH 154/289 ASoC: wm8961 - clear WM8961_MCLKDIV bit for freq <= 16500000
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Axel Lin <[email protected]>
commit 2f7dceeda4708f470fd927adb3861bd8ebbe2310 upstream.
MCLKDIV bit of Register 04h Clocking1:
0 : Divide by 1
1 : Divide by 2
Thus in the case of freq <= 16500000, we should clear MCLKDIV bit.
--- sound/soc/codecs/wm8961.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm8961.c +1 -1
@@ -736,7 +736,7 @@ static int wm8961_set_sysclk(struct snd_ freq /=2 ; }else {dev_dbg (codec->dev,"Using MCLK/1 for %dHz MCLK\n" , freq); - reg &=WM8961_MCLKDIV ; + reg &= ~WM8961_MCLKDIV ; }snd_soc_write (codec,WM8961_CLOCKING1 , reg);
PATCH 155/289 firewire: ohci: fix buffer overflow in AR split packet handling
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Clemens Ladisch <[email protected]>
commit 85f7ffd5d2b320f73912b15fe8cef34bae297daf upstream.
When the controller had to split a received asynchronous packet into two buffers, the driver tries to reassemble it by copying both parts into the first page. However, if size + rest > PAGE_SIZE, i.e., if the yet unhandled packets before the split packet, the split packet itself, and any received packets after the split packet are together larger than one page, then the memory after the first page would get overwritten.
To fix this, do not try to copy the data of all unhandled packets at once, but copy the possibly needed data every time when handling a packet.
This gets rid of most of the infamous crashes and data corruptions when using firewire-net.
--- drivers/firewire/ohci.c | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-)
drivers/firewire/ohci.c +32 -3
@@ -739,7 +739,7 @@ static void ar_context_tasklet(unsigned d = &ab->descriptor;if (d->res_count ==0 ) { -size_t size, rest, offset; +size_t size, size2, rest, pktsize, size3, offset;dma_addr_t start_bus;void *start;
@@ -756,12 +756,41 @@ static void ar_context_tasklet(unsigned ab = ab->next; d = &ab->descriptor; size = buffer +PAGE_SIZE - ctx->pointer; +/* valid buffer data in the next page */ rest =le16_to_cpu (d->req_count) -le16_to_cpu (d->res_count); +/* what actually fits in this page */ + size2 =min (rest, (size_t )PAGE_SIZE - size);memmove (buffer, ctx->pointer, size); -memcpy (buffer + size, ab->data, rest); +memcpy (buffer + size, ab->data, size2); ctx->current_buffer = ab; ctx->pointer = (void *) ab->data + rest; - end = buffer + size + rest; + +while (size >0 ) { +void *next =handle_ar_packet (ctx, buffer); + pktsize = next - buffer; +if (pktsize >= size) { +/* +* We have handled all the data that was +* originally in this page, so we can now +* continue in the next page. +*/ + buffer = next; +break ; + } +/* move the next packet to the start of the buffer */ +memmove (buffer, next, size + size2 - pktsize); + size -= pktsize; +/* fill up this page again */ + size3 =min (rest - size2, + (size_t )PAGE_SIZE - size - size2); +memcpy (buffer + size + size2, + (void *) ab->data + size2, size3); + size2 += size3; + } + +/* handle the packets that are fully in the next page */ + buffer = (void *) ab->data + (buffer - (start + size)); + end = (void *) ab->data + rest;while (buffer < end) buffer =handle_ar_packet (ctx, buffer);
PATCH 156/289 firewire: ohci: fix race in AR split packet handling
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Clemens Ladisch <[email protected]>
commit a1f805e5e73a8fe166b71c6592d3837df0cd5e2e upstream.
When handling an AR buffer that has been completely filled, we assumed that its descriptor will not be read by the controller and can be overwritten. However, when the last received packet happens to end at the end of the buffer, the controller might not yet have moved on to the next buffer and might read the branch address later. If we overwrite and free the page before that, the DMA context will either go dead because of an invalid Z value, or go off into some random memory.
To fix this, ensure that the descriptor does not get overwritten by using only the actual buffer instead of the entire page for reassembling the split packet. Furthermore, to avoid freeing the page too early, move on to the next buffer only when some data in it guarantees that the controller has moved on.
This should eliminate the remaining firewire-net problems.
--- drivers/firewire/ohci.c | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-)
drivers/firewire/ohci.c +23 -16
@@ -750,20 +750,19 @@ static void ar_context_tasklet(unsigned*/ offset = offsetof(struct ar_buffer , data); - start = buffer = ab; + start = ab; start_bus =le32_to_cpu (ab->descriptor.data_address) - offset; + buffer = ab->data; ab = ab->next; d = &ab->descriptor; - size = buffer +PAGE_SIZE - ctx->pointer; + size = start +PAGE_SIZE - ctx->pointer;/* valid buffer data in the next page */ rest =le16_to_cpu (d->req_count) -le16_to_cpu (d->res_count);/* what actually fits in this page */ - size2 =min (rest, (size_t )PAGE_SIZE - size); + size2 =min (rest, (size_t )PAGE_SIZE - offset - size);memmove (buffer, ctx->pointer, size);memcpy (buffer + size, ab->data, size2); - ctx->current_buffer = ab; - ctx->pointer = (void *) ab->data + rest;while (size >0 ) {void *next =handle_ar_packet (ctx, buffer);
@@ -782,22 +781,30 @@ static void ar_context_tasklet(unsigned size -= pktsize;/* fill up this page again */ size3 =min (rest - size2, - (size_t )PAGE_SIZE - size - size2); + (size_t )PAGE_SIZE - offset - size - size2);memcpy (buffer + size + size2, (void *) ab->data + size2, size3); size2 += size3; } -/* handle the packets that are fully in the next page */ - buffer = (void *) ab->data + (buffer - (start + size)); - end = (void *) ab->data + rest; - -while (buffer < end) - buffer =handle_ar_packet (ctx, buffer); - -dma_free_coherent (ohci->card.device,PAGE_SIZE , - start, start_bus); -ar_context_add_page (ctx); +if (rest >0 ) { +/* handle the packets that are fully in the next page */ + buffer = (void *) ab->data + + (buffer - (start + offset + size)); + end = (void *) ab->data + rest; + +while (buffer < end) + buffer =handle_ar_packet (ctx, buffer); + + ctx->current_buffer = ab; + ctx->pointer = end; + +dma_free_coherent (ohci->card.device,PAGE_SIZE , + start, start_bus); +ar_context_add_page (ctx); + }else { + ctx->pointer = start +PAGE_SIZE ; + } }else { buffer = ctx->pointer; ctx->pointer = end =
PATCH 157/289 ALSA: hda - Fixed ALC887-VD initial error
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Kailang Yang <[email protected]>
commit 01e0f1378c47947b825eac05c98697ab1be1c86f upstream.
ALC887-VD is like ALC888-VD. It can not be initialized as ALC882.
--- sound/pci/hda/patch_realtek.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
sound/pci/hda/patch_realtek.c +5 -2
@@ -19038,7 +19038,10 @@ static int patch_alc888(struct hda_codec {if ((alc_read_coef_idx (codec,0 ) &0x00f0 )==0x0030 ){kfree (codec->chip_name); - codec->chip_name =kstrdup ("ALC888-VD" ,GFP_KERNEL ); +if (codec->vendor_id ==0x10ec0887 ) + codec->chip_name =kstrdup ("ALC887-VD" ,GFP_KERNEL ); +else + codec->chip_name =kstrdup ("ALC888-VD" ,GFP_KERNEL );if (!codec->chip_name) {alc_free (codec);return -ENOMEM ;
@@ -19520,7 +19523,7 @@ static struct hda_codec_preset snd_hda_p { .id = 0x10ec0885, .rev = 0x100103, .name = "ALC889A", .patch = patch_alc882 }, { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 }, - { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc882 }, + { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc888 }, { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200", .patch = patch_alc882 }, { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc888 },
PATCH 158/289 ALSA: ac97: Apply quirk for Dell Latitude D610 binding Master and Headphone controls
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 0613a59456980161d0cd468bae6c63d772743102 upstream.
The original reporter states: "The Master mixer does not change the volume from the headphone output (which is affected by the headphone mixer). Instead it only seems to control the on-board speaker volume. This confuses PulseAudio greatly as the Master channel is merged into the volume mix."
Fix this symptom by applying the hp_only quirk for the reporter's SSID. The fix is applicable to all stable kernels.
--- sound/pci/intel8x0.c | 6 ++++++ 1 file changed, 6 insertions(+)
sound/pci/intel8x0.c +6 -0
@@ -1866,6 +1866,12 @@ static struct ac97_quirk ac97_quirks[] _ }, { .subvendor = 0x1028, + .subdevice = 0x0182, + .name = "Dell Latitude D610", /* STAC9750/51 */ + .type =AC97_TUNE_HP_ONLY + }, + { + .subvendor = 0x1028, .subdevice = 0x0186, .name ="Dell Latitude D810" ,/* cf. Malone #41015 */ .type = AC97_TUNE_HP_MUTE_LED
PATCH 159/289 ALSA: HDA: Add fixup pins for Ideapad Y550
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Henningsson <[email protected]>
commit 6cb3b707f95954ac18f19b4b3919af235738371a upstream.
By adding the subwoofer as a speaker pin, it is treated correctly when auto-muting.
--- sound/pci/hda/patch_realtek.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +25 -1
@@ -18934,6 +18934,26 @@ static void alc662_auto_init(struct hda_alc_inithook (codec); } +enum { +ALC662_FIXUP_IDEAPAD , +}; + +static const struct alc_fixup alc662_fixups[] = { + [ALC662_FIXUP_IDEAPAD ] = { + .pins = (const struct alc_pincfg []) { + {0x17 ,0x99130112 },/* subwoofer */ + { } + } + }, +}; + +static struct snd_pci_quirk alc662_fixup_tbl[] = { +SND_PCI_QUIRK (0x17aa ,0x3a0d ,"Lenovo Ideapad Y550" ,ALC662_FIXUP_IDEAPAD ), + {} +}; + + +static int patch_alc662 (struct hda_codec *codec) {struct alc_spec *spec;
@@ -18966,6 +18986,7 @@ static int patch_alc662(struct hda_codec }if (board_config ==ALC662_AUTO ) { +alc_pick_fixup (codec, alc662_fixup_tbl, alc662_fixups,1 );/* automatic parse from the BIOS config */ err =alc662_parse_auto_config (codec);if (err <0 ) {
@@ -19024,8 +19045,11 @@ static int patch_alc662(struct hda_codec spec->vmaster_nid =0x02 ; codec->patch_ops = alc_patch_ops; -if (board_config ==ALC662_AUTO ) +if (board_config ==ALC662_AUTO ) { spec->init_hook = alc662_auto_init; +alc_pick_fixup (codec, alc662_fixup_tbl, alc662_fixups,0 ); + } +#ifdef CONFIG_SND_HDA_POWER_SAVE if (!spec->loopback.amplist) spec->loopback.amplist = alc662_loopbacks;
PATCH 160/289 ALSA: hda - Added fixup for Lenovo Y550P
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Valentine Sinitsyn <[email protected]>
commit d41185882b828896ccecac319c9f65f708baaf0d upstream.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -18948,6 +18948,7 @@ static const struct alc_fixup alc662_fix };static struct snd_pci_quirk alc662_fixup_tbl[] = { +SND_PCI_QUIRK (0x17aa ,0x38af ,"Lenovo Ideapad Y550P" ,ALC662_FIXUP_IDEAPAD ),SND_PCI_QUIRK (0x17aa ,0x3a0d ,"Lenovo Ideapad Y550" ,ALC662_FIXUP_IDEAPAD ), {} };
PATCH 161/289 ALSA: hda: Add speaker pin to automute Acer Aspire 8943G
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 2df03514de41f3bbb5623f2e7f2bf594e49cb2ec upstream.
Add clause for handling Acer Aspire 8943G's subwoofer as additional speaker pin for automuting.
--- sound/pci/hda/patch_realtek.c | 8 ++++++++ 1 file changed, 8 insertions(+)
sound/pci/hda/patch_realtek.c +8 -0
@@ -18935,10 +18935,17 @@ static void alc662_auto_init(struct hda_ }enum { +ALC662_FIXUP_ASPIRE ,ALC662_FIXUP_IDEAPAD , };static const struct alc_fixup alc662_fixups[] = { + [ALC662_FIXUP_ASPIRE ] = { + .pins = (const struct alc_pincfg []) { + {0x15 ,0x99130112 },/* subwoofer */ + { } + } + }, [ALC662_FIXUP_IDEAPAD ] = { .pins = (const struct alc_pincfg []) { {0x17 ,0x99130112 },/* subwoofer */
@@ -18948,6 +18955,7 @@ static const struct alc_fixup alc662_fix };static struct snd_pci_quirk alc662_fixup_tbl[] = { +SND_PCI_QUIRK (0x1025 ,0x038b ,"Acer Aspire 8943G" ,ALC662_FIXUP_ASPIRE ),SND_PCI_QUIRK (0x17aa ,0x38af ,"Lenovo Ideapad Y550P" ,ALC662_FIXUP_IDEAPAD ),SND_PCI_QUIRK (0x17aa ,0x3a0d ,"Lenovo Ideapad Y550" ,ALC662_FIXUP_IDEAPAD ), {}
PATCH 162/289 ALSA: hda: Add Samsung R720 SSID for subwoofer pin fixup
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit a0e90acc657990511c83bc69965bfd3c63386d45 upstream.
The original reporter states that the subwoofer does not mute when inserting headphones. We need an entry for his machine's SSID in the subwoofer pin fixup list, so add it there (verified using hda_analyzer).
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -18956,6 +18956,7 @@ static const struct alc_fixup alc662_fixstatic struct snd_pci_quirk alc662_fixup_tbl[] = {SND_PCI_QUIRK (0x1025 ,0x038b ,"Acer Aspire 8943G" ,ALC662_FIXUP_ASPIRE ), +SND_PCI_QUIRK (0x144d ,0xc051 ,"Samsung R720" ,ALC662_FIXUP_IDEAPAD ),SND_PCI_QUIRK (0x17aa ,0x38af ,"Lenovo Ideapad Y550P" ,ALC662_FIXUP_IDEAPAD ),SND_PCI_QUIRK (0x17aa ,0x3a0d ,"Lenovo Ideapad Y550" ,ALC662_FIXUP_IDEAPAD ), {}
PATCH 163/289 ALSA: hda - Use ALC_INIT_DEFAULT for really default initialization
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <[email protected]>
commit 5a8cfb4e8ae317d283f84122ed20faa069c5e0c4 upstream.
When SKU assid gives no valid bits for 0x38, the driver didn't take any action, so far. This resulted in the missing initialization for external amps, etc, thus the silent output in the end.
Especially users hit this problem on ALC888 newly since 2.6.35, where the driver doesn't force to use ALC_INIT_DEFAULT any more.
This patch sets the default initialization scheme to use ALC_INIT_DEFAULT when no valid bits are set for SKU assid.
Reference:
https://bugzilla.redhat.com/show_bug.cgi?id=657388
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -1438,6 +1438,7 @@ do_sku: spec->init_amp =ALC_INIT_GPIO3 ;break ;case 5 : +default : spec->init_amp =ALC_INIT_DEFAULT ;break ; }
PATCH 164/289 ALSA: hda - Fix ALC660-VD/ALC861-VD capture/playback mixers
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Herton Ronaldo Krzesinski <[email protected]>
commit 7167594a3da7dcc33203b85d62e519594baee390 upstream.
The mixer nids passed to alc_auto_create_input_ctls are wrong: 0x15 is a pin, and 0x09 is the ADC on both ALC660-VD/ALC861-VD. Thus with current code, input playback volume/switches and input source mixer controls are not created, and recording doesn't work. Select correct mixers, 0x0b (input playback mixer) and 0x22 (capture source mixer).
Reference: https://qa.mandriva.com/show_bug.cgi?id=61159
--- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +1 -1
@@ -16557,7 +16557,7 @@ static struct alc_config_preset alc861vdstatic int alc861vd_auto_create_input_ctls (struct hda_codec *codec,const struct auto_pin_cfg *cfg) { -return alc_auto_create_input_ctls (codec, cfg,0x15 ,0x09 ,0 ); +return alc_auto_create_input_ctls (codec, cfg,0x0b ,0x22 ,0 ); }
PATCH 165/289 ALSA: HDA: Add an extra DAC for Realtek ALC887-VD
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Henningsson <[email protected]>
commit cc1c452e509aefc28f7ad2deed75bc69d4f915f7 upstream.
The patch enables ALC887-VD to use the DAC at nid 0x26, which makes it possible to use this DAC for e g Headphone volume.
--- sound/pci/hda/patch_realtek.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +3 -1
@@ -18612,6 +18612,8 @@ static inline hda_nid_t alc662_mix_to_dareturn 0x02 ; else if (nid >= 0x0c && nid <= 0x0e)return nid -0x0c +0x02 ; + else if (nid == 0x26) /* ALC887-VD has this DAC too */ + return 0x25; else return 0; }
@@ -18620,7 +18622,7 @@ static inline hda_nid_t alc662_mix_to_dastatic hda_nid_t alc662_dac_to_mix (struct hda_codec *codec,hda_nid_t pin,hda_nid_t dac) { -hda_nid_t mix[4 ]; +hda_nid_t mix[5 ];int i, num; num =snd_hda_get_connections (codec, pin, mix,ARRAY_SIZE (mix));
PATCH 166/289 ALSA: Fix SNDCTL_DSP_RESET ioctl for OSS emulation
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <[email protected]>
commit 60686aa0086a14f8b15c83a09f3df1eebe3aab3c upstream.
In OSS emulation, SNDCTL_DSP_RESET ioctl needs the reset of the internal buffer state in addition to drop of the running streams. Otherwise the succeeding access becomes inconsistent.
--- sound/core/oss/pcm_oss.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
sound/core/oss/pcm_oss.c +11 -8
@@ -1510,16 +1510,19 @@ static ssize_t snd_pcm_oss_read1(structstatic int snd_pcm_oss_reset (struct snd_pcm_oss_file *pcm_oss_file) {struct snd_pcm_substream *substream; +struct snd_pcm_runtime *runtime; +int i; - substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK ]; -if (substream !=NULL ) { +for (i =0 ; i <2 ; i++) { + substream = pcm_oss_file->streams[i]; +if (!substream) +continue ; + runtime = substream->runtime;snd_pcm_kernel_ioctl (substream,SNDRV_PCM_IOCTL_DROP ,NULL ); - substream->runtime->oss.prepare =1 ; - } - substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE ]; -if (substream !=NULL ) { -snd_pcm_kernel_ioctl (substream,SNDRV_PCM_IOCTL_DROP ,NULL ); - substream->runtime->oss.prepare =1 ; + runtime->oss.prepare =1 ; + runtime->oss.buffer_used =0 ; + runtime->oss.prev_hw_ptr_period =0 ; + runtime->oss.period_ptr =0 ; }return 0 ; }
PATCH 167/289 ALSA: hda: Use "alienware" model quirk for another SSID
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel T Chen <[email protected]>
commit 0defe09ca70daccdc83abd9c3c24cd89ae6a1141 upstream.
The original reporter states that headphone jacks do not appear to work. Upon inspecting his codec dump, and upon further testing, it is confirmed that the "alienware" model quirk is correct.
--- sound/pci/hda/patch_sigmatel.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/patch_sigmatel.c +2 -0
@@ -1619,6 +1619,8 @@ static struct snd_pci_quirk stac92hd73xxstatic struct snd_pci_quirk stac92hd73xx_codec_id_cfg_tbl[] = {SND_PCI_QUIRK (PCI_VENDOR_ID_DELL ,0x02a1 ,"Alienware M17x" ,STAC_ALIENWARE_M17X ), +SND_PCI_QUIRK (PCI_VENDOR_ID_DELL ,0x043a , +"Alienware M17x" ,STAC_ALIENWARE_M17X ), {}/* terminator */ };
PATCH 168/289 netfilter: nf_conntrack: allow nf_ct_alloc_hashtable() to get highmem pages
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Dumazet <[email protected]>
commit 6b1686a71e3158d3c5f125260effce171cc7852b upstream.
commit ea781f197d6a8 (use SLAB_DESTROY_BY_RCU and get rid of call_rcu()) did a mistake in __vmalloc() call in nf_ct_alloc_hashtable().
I forgot to add __GFP_HIGHMEM, so pages were taken from LOWMEM only.
--- net/netfilter/nf_conntrack_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/nf_conntrack_core.c +2 -1
@@ -1260,7 +1260,8 @@ void *nf_ct_alloc_hashtable(unsigned intif (!hash) { *vmalloced =1 ;printk (KERN_WARNING "nf_conntrack: falling back to vmalloc.\n" ); - hash =__vmalloc (sz,GFP_KERNEL | __GFP_ZERO,PAGE_KERNEL ); + hash =__vmalloc (sz,GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, +PAGE_KERNEL ); }if (hash && nulls)
PATCH 169/289 netfilter: NF_HOOK_COND has wrong conditional
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Paris <[email protected]>
commit ac5aa2e3332ec04889074afdbd1479424d0227a5 upstream.
The NF_HOOK_COND returns 0 when it shouldn't due to what I believe to be an error in the code as the order of operations is not what was intended. C will evalutate == before =. Which means ret is getting set to the bool result, rather than the return value of the function call. The code says
if (ret = function() == 1)
when it meant to say:
if ((ret = function()) == 1)
Normally the compiler would warn, but it doesn't notice it because its a actually complex conditional and so the wrong code is wrapped in an explict set of () [exactly what the compiler wants you to do if this was intentional]. Fixing this means that errors when netfilter denies a packet get propagated back up the stack rather than lost.
Problem introduced by commit 2249065f (netfilter: get rid of the grossness in netfilter.h).
--- include/linux/netfilter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/netfilter.h +1 -1
@@ -215,7 +215,7 @@ NF_HOOK_COND(uint8_t pf, unsigned int hoint ret;if (!cond || - (ret =nf_hook_thresh (pf, hook, skb, in, out, okfn,INT_MIN ) ==1 )) + ((ret =nf_hook_thresh (pf, hook, skb, in, out, okfn,INT_MIN )) ==1 )) ret =okfn (skb);return ret; }
PATCH 170/289 radix-tree: fix RCU bug
In reply to Greg KH2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------
From: Nick Piggin <[email protected]>
commit 27d20fddc8af539464fc3ba499d6a830054c3bd6 upstream.
Salman Qazi describes the following radix-tree bug:
In the following case, we get can get a deadlock:
0. The radix tree contains two items, one has the index 0. 1. The reader (in this case find_get_pages) takes the rcu_read_lock. 2. The reader acquires slot(s) for item(s) including the index 0 item. 3. The non-zero index item is deleted, and as a consequence the other item is
moved to the root of the tree. The place where it used to be is queued for deletion after the readers finish.
3b. The zero item is deleted, removing it from the direct slot, it remains in
the rcu-delayed indirect node.
4. The reader looks at the index 0 slot, and finds that the page has 0 ref count
5. The reader looks at it again, hoping that the item will either be freed or the ref count will increase. This never happens, as the slot it is looking at will never be updated. Also, this slot can never be reclaimed because the reader is holding rcu_read_lock and is in an infinite loop.
The fix is to re-use the same "indirect" pointer case that requires a slot lookup retry into a general "retry the lookup" bit.
--- include/linux/radix-tree.h | 36 ++++++++++--------- lib/radix-tree.c | 83 +++++++++++++++++++++++++++++++-------------- mm/filemap.c | 26 +++++--------- 3 files changed, 87 insertions(+), 58 deletions(-)
include/linux/radix-tree.h +19 -17
@@ -36,17 +36,6 @@* RCU. */ #define RADIX_TREE_INDIRECT_PTR 1 -#define RADIX_TREE_RETRY ((void *)-1UL) - -static inline void *radix_tree_ptr_to_indirect (void *ptr) -{ -return (void *)((unsigned long )ptr |RADIX_TREE_INDIRECT_PTR ); -} - -static inline void *radix_tree_indirect_to_ptr (void *ptr) -{ -return (void *)((unsigned long )ptr & ~RADIX_TREE_INDIRECT_PTR ); -}static inline int radix_tree_is_indirect_ptr (void *ptr) {
@@ -138,16 +127,29 @@ do { \* removed. * * For use with radix_tree_lookup_slot(). Caller must hold tree at least read -* locked across slot lookup and dereference. More likely, will be used with -* radix_tree_replace_slot(), as well, so caller will hold tree write locked. +* locked across slot lookup and dereference. Not required if write lock is +* held (ie. items cannot be concurrently inserted). +* +* radix_tree_deref_retry must be used to confirm validity of the pointer if +* only the read lock is held. */ static inline void *radix_tree_deref_slot (void **pslot) { -void *ret =rcu_dereference (*pslot); -if (unlikely (radix_tree_is_indirect_ptr (ret))) - ret =RADIX_TREE_RETRY ; -return ret; +return rcu_dereference (*pslot); } + +/** +* radix_tree_deref_retry - check radix_tree_deref_slot +* @arg: pointer returned by radix_tree_deref_slot +* Returns: 0 if retry is not required, otherwise retry is required +* +* radix_tree_deref_retry must be used with radix_tree_deref_slot. +*/ +static inline int radix_tree_deref_retry (void *arg) +{ +return unlikely ((unsigned long )arg &RADIX_TREE_INDIRECT_PTR ); +} +/** * radix_tree_replace_slot - replace item in a slot * @pslot: pointer to slot, returned by radix_tree_lookup_slot
lib/radix-tree.c +58 -25
215 lines not on this page · raw message
mm/filemap.c +10 -16
@@ -631,7 +631,9 @@ repeat: pagep =radix_tree_lookup_slot (&mapping->page_tree, offset);if (pagep) { page =radix_tree_deref_slot (pagep); -if (unlikely (!page || page ==RADIX_TREE_RETRY )) +if (unlikely (!page)) + goto out; +if (radix_tree_deref_retry (page)) goto repeat;if (!page_cache_get_speculative (page))
@@ -647,6 +649,7 @@ repeat: goto repeat; } } +out:rcu_read_unlock ();return page;
@@ -764,12 +767,11 @@ repeat: page =radix_tree_deref_slot ((void **)pages[i]);if (unlikely (!page))continue ; -/* -* this can only trigger if nr_found == 1, making livelock -* a non issue. -*/ -if (unlikely (page ==RADIX_TREE_RETRY )) +if (radix_tree_deref_retry (page)) { +if (ret) + start = pages[ret-1 ]->index; goto restart; + }if (!page_cache_get_speculative (page)) goto repeat;
@@ -817,11 +819,7 @@ repeat: page =radix_tree_deref_slot ((void **)pages[i]);if (unlikely (!page))continue ; -/* -* this can only trigger if nr_found == 1, making livelock -* a non issue. -*/ -if (unlikely (page ==RADIX_TREE_RETRY )) +if (radix_tree_deref_retry (page)) goto restart;if (page->mapping ==NULL || page->index != index)
@@ -874,11 +872,7 @@ repeat: page =radix_tree_deref_slot ((void **)pages[i]);if (unlikely (!page))continue ; -/* -* this can only trigger if nr_found == 1, making livelock -* a non issue. -*/ -if (unlikely (page ==RADIX_TREE_RETRY )) +if (radix_tree_deref_retry (page)) goto restart;if (!page_cache_get_speculative (page))