2.6.33.1-stable review
Subsystems (70)
PATCH 90/123 x86, xen: Disable highmem PTE allocation even when CONFIG_HIGHPTE=y
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Ian Campbell <[email protected]>
commit 817a824b75b1475f1b067c8cee318c7b4d66fcde upstream.
There's a path in the pagefault code where the kernel deliberately breaks its own locking rules by kmapping a high pte page without holding the pagetable lock (in at least page_check_address). This breaks Xen's ability to track the pinned/unpinned state of the page. There does not appear to be a viable workaround for this behaviour so simply disable HIGHPTE for all Xen guests.
LKML-Reference: <[email protected]>
--- arch/x86/xen/enlighten.c | 7 +++++++ arch/x86/xen/mmu.c | 11 ++++++----- 2 files changed, 13 insertions(+), 5 deletions(-)
arch/x86/xen/enlighten.c +7 -0
@@ -50,6 +50,7 @@#include <asm/traps.h> #include <asm/setup.h> #include <asm/desc.h> +#include <asm/pgalloc.h> #include <asm/pgtable.h> #include <asm/tlbflush.h> #include <asm/reboot.h>
@@ -1094,6 +1095,12 @@ asmlinkage void __init xen_start_kernel( __supported_pte_mask |= _PAGE_IOMAP; +/* +* Prevent page tables from being allocated in highmem, even +* if CONFIG_HIGHPTE is enabled. +*/ + __userpte_alloc_gfp &= ~__GFP_HIGHMEM; +/* Work out if we support NX */ x86_configure_nx ();
arch/x86/xen/mmu.c +6 -5
@@ -1432,14 +1432,15 @@ static void *xen_kmap_atomic_pte(struct {pgprot_t prot =PAGE_KERNEL ; +/* +* We disable highmem allocations for page tables so we should never +* see any calls to kmap_atomic_pte on a highmem page. +*/ +BUG_ON (PageHighMem (page)); +if (PagePinned (page)) prot =PAGE_KERNEL_RO ; -if (0 &&PageHighMem (page)) -printk ("mapping highpte %lx type %d prot %s\n" , -page_to_pfn (page), type, - (unsigned long )pgprot_val (prot) & _PAGE_RW ?"WRITE" :"READ" ); -return kmap_atomic_prot (page, type, prot); }#endif
PATCH 108/123 s3cmci: s3cmci_card_present: Use no_detect to decide whether there is a card detect pin
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Lars-Peter Clausen <[email protected]>
commit dc2ed552804f3a2ae41c0ffe4bc09879ec8f7396 upstream.
--- drivers/mmc/host/s3cmci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/s3cmci.c +1 -1
@@ -1179,7 +1179,7 @@ static int s3cmci_card_present(struct mmstruct s3c24xx_mci_pdata *pdata = host->pdata;int ret; -if (pdata->gpio_detect ==0 ) +if (pdata->no_detect)return -ENOSYS ; ret =gpio_get_value (pdata->gpio_detect) ?0 :1 ;
PATCH 109/123 s3cmci: initialize default platform data no_wprotect and no_detect with 1
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Lars-Peter Clausen <[email protected]>
commit c212808a1ba6bfba489006399b8152a047305acf upstream.
If no platform_data was givin to the device it's going to use it's default platform data struct which has all fields initialized to zero. As a result the driver is going to try to request gpio0 both as write protect and card detect pin. Which of course will fail and makes the driver unusable
Previously to the introduction of no_wprotect and no_detect the behavior was to assume that if no platform data was given there is no write protect or card detect pin. This patch restores that behavior.
--- drivers/mmc/host/s3cmci.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mmc/host/s3cmci.c +2 -0
@@ -1360,6 +1360,8 @@ static struct mmc_host_ops s3cmci_ops =static struct s3c24xx_mci_pdata s3cmci_def_pdata = {/* This is currently here to avoid a number of if (host->pdata) * checks. Any zero fields to ensure reasonable defaults are picked. */ + .no_wprotect =1 , + .no_detect =1 , };#ifdef CONFIG_CPU_FREQ
cover 2.6.33.1-stable review
This is the start of the stable review cycle for the 2.6.31.1 release. There are 123 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.
Note, I still have a number of outstanding patches that have been submitted for this release. But due to the size, I figured it was best to get this release out as soon as possible and then catch up next week with the next batch of patches. So don't worry if you don't see a patch you have asked to be included that is not in here.
Responses should be made by Monday, March 15, 00:00:00 UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.33.1-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Documentation/kernel-parameters.txt | 7 + Documentation/laptops/thinkpad-acpi.txt | 4 + Makefile | 2 +- arch/Kconfig | 2 - arch/x86/ia32/ia32_aout.c | 1 - arch/x86/include/asm/io_apic.h | 1 + arch/x86/include/asm/pgalloc.h | 5 + arch/x86/include/asm/uv/uv_hub.h | 3 +- arch/x86/include/asm/vmx.h | 1 + arch/x86/kernel/acpi/boot.c | 9 +- arch/x86/kernel/apic/io_apic.c | 68 ++- arch/x86/kernel/reboot.c | 8 + arch/x86/kvm/emulate.c | 55 ++- arch/x86/kvm/vmx.c | 10 + arch/x86/mm/pgtable.c | 31 +- arch/x86/oprofile/nmi_int.c | 17 +- arch/x86/oprofile/op_model_amd.c | 42 +-- arch/x86/oprofile/op_model_p4.c | 6 - arch/x86/oprofile/op_model_ppro.c | 6 +- arch/x86/pci/mmconfig-shared.c | 17 +- arch/x86/xen/enlighten.c | 7 + arch/x86/xen/mmu.c | 11 +- drivers/ata/ahci.c | 12 +- drivers/ata/pata_hpt3x2n.c | 20 +- drivers/base/core.c | 13 +- drivers/base/devtmpfs.c | 13 + drivers/char/tty_ldisc.c | 50 +- drivers/clocksource/sh_cmt.c | 32 +- drivers/clocksource/sh_mtu2.c | 6 +- drivers/clocksource/sh_tmu.c | 6 +- drivers/gpio/cs5535-gpio.c | 4 +- drivers/gpio/wm831x-gpio.c | 22 +- drivers/gpu/drm/i915/intel_lvds.c | 7 + drivers/gpu/drm/i915/intel_sdvo.c | 23 +- drivers/gpu/drm/radeon/atom.c | 4 - drivers/gpu/drm/ttm/ttm_tt.c | 18 +- drivers/hid/hid-core.c | 2 - drivers/hid/hid-ids.h | 4 - drivers/hid/usbhid/hid-core.c | 28 +- drivers/hid/usbhid/usbhid.h | 2 + drivers/hwmon/ams/ams-core.c | 11 +- drivers/hwmon/ams/ams-i2c.c | 2 + drivers/hwmon/ams/ams-pmu.c | 2 + drivers/hwmon/ams/ams.h | 1 + drivers/hwmon/fschmd.c | 15 +- drivers/hwmon/tmp401.c | 7 +- drivers/hwmon/tmp421.c | 24 +- drivers/macintosh/therm_adt746x.c | 34 +- drivers/md/dm-ioctl.c | 9 +- drivers/md/dm.c | 4 +- drivers/media/dvb/dvb-core/dvb_net.c | 1 + drivers/media/video/gspca/mr97310a.c | 6 + drivers/media/video/soc_mediabus.c | 3 +- drivers/mmc/host/s3cmci.c | 4 +- drivers/net/wireless/airo.c | 34 +- drivers/net/wireless/ath/ath5k/ath5k.h | 1 - drivers/net/wireless/ath/ath5k/base.c | 26 +- drivers/net/wireless/ath/ath9k/beacon.c | 9 +- drivers/net/wireless/ath/ath9k/hw.c | 10 + drivers/net/wireless/ath/ath9k/main.c | 6 +- drivers/net/wireless/ath/ath9k/phy.h | 3 + drivers/net/wireless/ath/ath9k/rc.c | 15 +- drivers/net/wireless/b43/main.c | 3 +- drivers/net/wireless/b43legacy/main.c | 2 + drivers/net/wireless/p54/p54pci.c | 18 +- drivers/net/wireless/p54/p54usb.c | 1 + drivers/pci/hotplug/ibmphp_ebda.c | 13 +- drivers/platform/x86/Kconfig | 10 +- drivers/platform/x86/eeepc-laptop.c | 3 +- drivers/platform/x86/thinkpad_acpi.c | 116 +++-- drivers/rtc/class.c | 1 + drivers/rtc/rtc-coh901331.c | 5 +- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 17 + drivers/scsi/qla1280.c | 4 + drivers/serial/imx.c | 6 +- drivers/staging/Kconfig | 2 - drivers/staging/Makefile | 1 - drivers/staging/hv/vmbus_drv.c | 30 + drivers/staging/mimio/Kconfig | 10 - drivers/staging/mimio/Makefile | 1 - drivers/staging/mimio/mimio.c | 914 ------------------------------- drivers/staging/pohmelfs/inode.c | 20 +- drivers/staging/pohmelfs/netfs.h | 3 + drivers/staging/wlan-ng/Kconfig | 1 + drivers/usb/core/driver.c | 4 +- drivers/usb/core/hcd.c | 2 +- drivers/usb/core/hcd.h | 2 +- drivers/usb/core/hub.c | 12 + drivers/usb/core/usb.c | 3 - drivers/usb/gadget/f_mass_storage.c | 1 - drivers/usb/host/ohci-pnx4008.c | 6 +- drivers/usb/host/uhci-hcd.c | 1 + drivers/usb/host/xhci-ext-caps.h | 7 +- drivers/usb/serial/cp210x.c | 3 +- drivers/usb/serial/ftdi_sio.c | 5 + drivers/usb/serial/ftdi_sio_ids.h | 15 + drivers/usb/serial/sierra.c | 19 +- drivers/usb/storage/unusual_devs.h | 88 +++- drivers/video/sunxvr500.c | 1 + fs/file_table.c | 2 + fs/nfs/dns_resolve.c | 18 +- fs/nfsd/nfs4state.c | 2 + fs/ocfs2/aops.c | 5 +- fs/sysfs/dir.c | 82 ++- include/linux/fs.h | 3 + include/linux/irq.h | 2 + include/linux/netdevice.h | 2 +- include/linux/perf_event.h | 5 +- include/linux/sched.h | 5 +- include/linux/skbuff.h | 13 +- include/linux/syscalls.h | 6 +- include/trace/ftrace.h | 3 +- kernel/irq/chip.c | 52 ++- kernel/perf_event.c | 134 ++++-- kernel/power/snapshot.c | 2 +- kernel/sched.c | 21 +- kernel/trace/trace.h | 3 +- mm/fadvise.c | 10 +- mm/readahead.c | 6 + mm/slab.c | 6 +- net/core/scm.c | 2 + net/mac80211/agg-tx.c | 3 +- net/mac80211/rx.c | 8 + net/mac80211/tx.c | 5 +- net/netfilter/xt_recent.c | 4 +- net/sunrpc/svc_xprt.c | 5 +- net/sunrpc/xprtsock.c | 5 + scripts/get_maintainer.pl | 4 +- security/integrity/ima/ima_iint.c | 3 +- security/selinux/ss/ebitmap.c | 2 +- sound/core/pcm_native.c | 8 +- sound/pci/hda/hda_intel.c | 3 + sound/pci/hda/patch_analog.c | 2 +- sound/pci/via82xx.c | 6 + sound/soc/codecs/ak4104.c | 6 +- sound/usb/usbaudio.c | 32 ++ sound/usb/usbmidi.c | 24 +- sound/usb/usbquirks.h | 27 + tools/perf/util/symbol.c | 2 +- 139 files changed, 1281 insertions(+), 1408 deletions(-)
PATCH 2/123 netlabel: fix export of SELinux categories > 127
2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Joshua Roys <[email protected]>
commit c36f74e67fa12202dbcb4ad92c5ac844f9d36b98 upstream.
This fixes corrupted CIPSO packets when SELinux categories greater than 127 are used. The bug occured on the second (and later) loops through the while; the inner for loop through the ebitmap->maps array used the same index as the NetLabel catmap->bitmap array, even though the NetLabel bitmap is twice as long as the SELinux bitmap.
--- security/selinux/ss/ebitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/ss/ebitmap.c +1 -1
@@ -128,7 +128,7 @@ int ebitmap_netlbl_export(struct ebitmap cmap_idx = delta /NETLBL_CATMAP_MAPSIZE ; cmap_sft = delta %NETLBL_CATMAP_MAPSIZE ; c_iter->bitmap[cmap_idx] - |= e_iter->maps[cmap_idx] << cmap_sft; + |= e_iter->maps[i] << cmap_sft; } e_iter = e_iter->next; }
PATCH 1/123 ahci: disable FPDMA auto-activate optimization on NVIDIA AHCI
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Robert Hancock <[email protected]>
commit 453d3131ec7aab82eaaa8401a50522a337092aa8 upstream.
Mike Cui reported that his system with an NVIDIA MCP79 (aka MCP7A) chipset stopped working with 2.6.32. The problem appears to be that 2.6.32 now enables the FPDMA auto-activate optimization in the ahci driver. The drive works fine with this enabled on an Intel AHCI so this appears to be a chipset bug. Since MCP79 is a fairly recent NVIDIA chipset and we don't have any info on whether any other NVIDIA chipsets have this issue, disable FPDMA AA optimization on all NVIDIA AHCI controllers for now.
Should address http://bugzilla.kernel.org/show_bug.cgi?id=14922
While-we-investigate-issue-this-patch-looks-good-to-me-by:
Prajakta Gudadhe <[email protected]>
--- drivers/ata/ahci.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/ata/ahci.c +10 -2
@@ -3082,8 +3082,16 @@ static int ahci_init_one(struct pci_devahci_save_initial_config (pdev, hpriv);/* prepare host */ -if (hpriv->cap &HOST_CAP_NCQ ) - pi.flags |=ATA_FLAG_NCQ |ATA_FLAG_FPDMA_AA ; +if (hpriv->cap &HOST_CAP_NCQ ) { + pi.flags |=ATA_FLAG_NCQ ; +/* Auto-activate optimization is supposed to be supported on +all AHCI controllers indicating NCQ support, but it seems +to be broken at least on some NVIDIA MCP79 chipsets. +Until we get info on which NVIDIA chipsets don't have this +issue, if any, disable AA on all NVIDIA AHCIs. */ +if (pdev->vendor !=PCI_VENDOR_ID_NVIDIA ) + pi.flags |=ATA_FLAG_FPDMA_AA ; + }if (hpriv->cap &HOST_CAP_PMP ) pi.flags |=ATA_FLAG_PMP ;
PATCH 3/123 PCI hotplug: ibmphp: read the length of ebda and map entire ebda region
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Chandru <[email protected]>
commit b0fc889c4311835ae7d02f433154bc20cad9ee11 upstream.
ibmphp driver currently maps only 1KB of ebda memory area into kernel address space during driver initialization. This causes kernel oops when the driver is modprobe'd and it accesses memory beyond 1KB within ebda segment. The first byte of ebda segment actually stores the length of the ebda region in Kilobytes. Hence make use of the length parameter and map the entire ebda region.
--- drivers/pci/hotplug/ibmphp_ebda.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/pci/hotplug/ibmphp_ebda.c +9 -2
@@ -245,7 +245,7 @@ static void __init print_ebda_hpc (void)int __init ibmphp_access_ebda (void ) { -u8 format, num_ctlrs, rio_complete, hs_complete; +u8 format, num_ctlrs, rio_complete, hs_complete, ebda_sz;u16 ebda_seg, num_entries, next_offset, offset, blk_id, sub_addr, re, rc_id, re_id, base;int rc =0 ;
@@ -260,7 +260,14 @@ int __init ibmphp_access_ebda (void)iounmap (io_mem);debug ("returned ebda segment: %x\n" , ebda_seg); - io_mem =ioremap (ebda_seg<<4 ,1024 ); + io_mem =ioremap (ebda_seg<<4 ,1 ); + ebda_sz =readb (io_mem); +iounmap (io_mem); +debug ("ebda size: %d(KiB)\n" , ebda_sz); +if (ebda_sz ==0 ) +return -ENOMEM ; + + io_mem =ioremap (ebda_seg<<4 , (ebda_sz *1024 ));if (!io_mem )return -ENOMEM ; next_offset =0x180 ;
PATCH 4/123 PCI hotplug: check ioremap() return value in ibmphp_ebda.c
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Andrew Morton <[email protected]>
commit ba02b242bbf8e4e1bc63d62e8ccec33b4e5ea132 upstream.
check ioremap() return value.
--- drivers/pci/hotplug/ibmphp_ebda.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pci/hotplug/ibmphp_ebda.c +2 -0
@@ -261,6 +261,8 @@ int __init ibmphp_access_ebda (void)debug ("returned ebda segment: %x\n" , ebda_seg); io_mem =ioremap (ebda_seg<<4 ,1 ); +if (!io_mem) +return -ENOMEM ; ebda_sz =readb (io_mem);iounmap (io_mem);debug ("ebda size: %d(KiB)\n" , ebda_sz);
PATCH 14/123 V4L/DVB (13991): gspca_mr973010a: Fix cif type 1 cameras not streaming on UHCI controllers
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Theodore Kilgore <[email protected]>
commit 70136081fc67ea77d849f86fa323e5773c8e40ea upstream.
If you read the mail to Oliver Neukum on the linux-usb list, then you know that I found a cure for the mysterious problem that the MR97310a CIF "type 1" cameras have been freezing up and refusing to stream if hooked up to a machine with a UHCI controller.
Namely, the cure is that if the camera is an mr97310a CIF type 1 camera, you have to send it 0xa0, 0x00. Somehow, this is a timing reset command, or such. It un-blocks whatever was previously stopping the CIF type 1 cameras from working on the UHCI-based machines.
--- drivers/media/video/gspca/mr97310a.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/media/video/gspca/mr97310a.c +6 -0
@@ -697,6 +697,12 @@ static int start_cif_cam(struct gspca_de {0x13, 0x00, {0x01}, 1}, {0, 0, {0}, 0} }; +/* Without this command the cam won't work with USB-UHCI */ + gspca_dev->usb_buf[0 ] =0x0a ; + gspca_dev->usb_buf[1 ] =0x00 ; + err_code =mr_write (gspca_dev,2 ); +if (err_code <0 ) +return err_code; err_code =sensor_write_regs (gspca_dev, cif_sensor1_init_data,ARRAY_SIZE (cif_sensor1_init_data)); }
PATCH 15/123 vfs: take f_lock on modifying f_mode after open time
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Wu Fengguang <[email protected]>
commit 42e49608683ab25fbbbf9c40edb944601e543882 upstream.
We'll introduce FMODE_RANDOM which will be runtime modified. So protect all runtime modification to f_mode with f_lock to avoid races.
--- fs/file_table.c | 2 ++ fs/nfsd/nfs4state.c | 2 ++ 2 files changed, 4 insertions(+)
fs/file_table.c +2 -0
@@ -393,7 +393,9 @@ retry:continue ;if (!(f->f_mode &FMODE_WRITE ))continue ; +spin_lock (&f->f_lock); f->f_mode &= ~FMODE_WRITE ; +spin_unlock (&f->f_lock);if (file_check_writeable (f) !=0 )continue ;file_release_write (f);
fs/nfsd/nfs4state.c +2 -0
@@ -1998,7 +1998,9 @@ nfs4_file_downgrade(struct file *filp, u {if (share_access &NFS4_SHARE_ACCESS_WRITE ) {drop_file_write_access (filp); +spin_lock (&filp->f_lock); filp->f_mode = (filp->f_mode |FMODE_READ ) & ~FMODE_WRITE ; +spin_unlock (&filp->f_lock); } }
PATCH 18/123 ath9k: fix keycache leak in split tkip case
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Ming Lei <[email protected]>
commit 733da37dab72de6b3f8b0c56b5cdea322f18a684 upstream.
If split tkip key is used, ath_delete_key should delete rx key and rx mic key. This patch fixes the leak of hw keycache in the case.
--- drivers/net/wireless/ath/ath9k/main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath9k/main.c +1 -0
@@ -928,6 +928,7 @@ static void ath_key_delete(struct ath_coclear_bit (key->hw_key_idx +64 , common->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); }
PATCH 20/123 x86/PCI: Prevent mmconfig memory corruption
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Thomas Gleixner <[email protected]>
commit bb8d41330ce27edb91adb6922d3f8e1a8923f727 upstream.
commit ff097ddd4 (x86/PCI: MMCONFIG: manage pci_mmcfg_region as a list, not a table) introduced a nasty memory corruption when pci_mmcfg_list is empty.
pci_mmcfg_check_end_bus_number() dereferences pci_mmcfg_list.prev even when the list is empty. The following write hits some variable near to pci_mmcfg_list.
Further down a similar problem exists, where cfg->list.next is dereferenced unconditionally and a comparison with some variable near to pci_mmcfg_list happens.
Add a check for the last element into the for_each_entry() loop and remove all the other crappy logic which is just a leftover of the old array based code which was replaced by the list conversion.
--- arch/x86/pci/mmconfig-shared.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)
arch/x86/pci/mmconfig-shared.c +6 -11
@@ -303,22 +303,17 @@ static void __init pci_mmcfg_check_end_b {struct pci_mmcfg_region *cfg, *cfgx; -/* last one*/ - cfg =list_entry (pci_mmcfg_list.prev,typeof (*cfg), list); -if (cfg) -if (cfg->end_bus < cfg->start_bus) - cfg->end_bus =255 ; - -if (list_is_singular (&pci_mmcfg_list)) -return ; - -/* don't overlap please */ +/* Fixup overlaps */ list_for_each_entry (cfg, &pci_mmcfg_list, list) {if (cfg->end_bus < cfg->start_bus) cfg->end_bus =255 ; +/* Don't access the list head ! */ +if (cfg->list.next == &pci_mmcfg_list) +break ; + cfgx =list_entry (cfg->list.next,typeof (*cfg), list); -if (cfg != cfgx && cfg->end_bus >= cfgx->start_bus) +if (cfg->end_bus >= cfgx->start_bus) cfg->end_bus = cfgx->start_bus -1 ; } }
PATCH 26/123 Staging: wlan-ng: Add select WEXT_PRIV to Kconfig to prevent build failure
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Peter Huewe <[email protected]>
commit 8a8e29752dfdba014b866d3c587d3409e57263dd upstream.
Without WEXT_PRIV set the p80211wext.c fails to build due to unknown fields in the iw_handler_def struct.
Those fields are enclosed in WEXT_PRIV conditionals in the prototype of iw_handler_def in include/net/iw_handler.h
--- drivers/staging/wlan-ng/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/staging/wlan-ng/Kconfig +1 -0
@@ -1,6 +1,7 @@ config PRISM2_USB tristate "Prism2.5/3 USB driver" depends on WLAN && USB && WIRELESS_EXT + select WEXT_PRIV default n ---help--- This is the wlan-ng prism 2.5/3 USB driver for a wide range of
PATCH 29/123 V4L/DVB: v4l: soc_camera: fix bound checking of mbus_fmt[] index
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Baruch Siach <[email protected]>
commit 84f3751d6a6f766780dee509433bf7b3dfcdf465 upstream.
When code <= V4L2_MBUS_FMT_FIXED soc_mbus_get_fmtdesc returns a pointer to mbus_fmt[x], where x < 0. Fix this.
--- drivers/media/video/soc_mediabus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/video/soc_mediabus.c +2 -1
@@ -134,7 +134,8 @@ EXPORT_SYMBOL(soc_mbus_bytes_per_line);const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc (enum v4l2_mbus_pixelcode code) { -if ((unsigned int )(code -V4L2_MBUS_FMT_FIXED ) >ARRAY_SIZE (mbus_fmt)) +if (code -V4L2_MBUS_FMT_FIXED >ARRAY_SIZE (mbus_fmt) || + code <=V4L2_MBUS_FMT_FIXED )return NULL ;return mbus_fmt + code -V4L2_MBUS_FMT_FIXED -1 ; }
PATCH 37/123 oprofile/x86: remove node check in AMD IBS initialization
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Robert Richter <[email protected]>
commit 89baaaa98a10cad5cc8516c7208b02d9fc711890 upstream.
Standard AMD systems have the same number of nodes as there are northbridge devices. However, there may kernel configurations (especially for 32 bit) or system setups exist, where the node number is different or it can not be detected properly. Thus the check is not reliable and may fail though IBS setup was fine. For this reason it is better to remove the check.
--- arch/x86/oprofile/op_model_amd.c | 10 ---------- 1 file changed, 10 deletions(-)
arch/x86/oprofile/op_model_amd.c +0 -10
@@ -386,16 +386,6 @@ static int init_ibs_nmi(void)return 1 ; } -#ifdef CONFIG_NUMA -/* Sanity check */ -/* Works only for 64bit with proper numa implementation. */ -if (nodes !=num_possible_nodes ()) { -printk (KERN_DEBUG "Failed to setup CPU node(s) for IBS, " -"found: %d, expected %d" , - nodes,num_possible_nodes ()); -return 1 ; - } -#endif return 0 ; }
PATCH 40/123 perf: Reimplement frequency driven sampling
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Peter Zijlstra <[email protected]>
commit abd50713944c8ea9e0af5b7bffa0aacae21cc91a upstream.
There was a bug in the old period code that caused intel_pmu_enable_all() or native_write_msr_safe() to show up quite high in the profiles.
In staring at that code it made my head hurt, so I rewrote it in a hopefully simpler fashion. Its now fully symetric between tick and overflow driven adjustments and uses less data to boot.
The only complication is that it basically wants to do a u128 division. The code approximates that in a rather simple truncate until it fits fashion, taking care to balance the terms while truncating.
This version does not generate that sampling artefact.
--- include/linux/perf_event.h | 5 - kernel/perf_event.c | 132 +++++++++++++++++++++++++++++++-------------- 2 files changed, 94 insertions(+), 43 deletions(-)
include/linux/perf_event.h +2 -3
@@ -496,9 +496,8 @@ struct hw_perf_event {atomic64_t period_left;u64 interrupts; -u64 freq_count; -u64 freq_interrupts; -u64 freq_stamp; +u64 freq_time_stamp; +u64 freq_count_stamp;#endif };
kernel/perf_event.c +92 -40
175 lines not on this page · raw message
PATCH 43/123 ALSA: via82xx: add quirk for D1289 motherboard
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Clemens Ladisch <[email protected]>
commit bf30a4309d4294d3eca248ea8a20c1c3570f5e74 upstream.
Add a headphones-only quirk for the Fujitsu Siemens D1289.
--- sound/pci/via82xx.c | 6 ++++++ 1 file changed, 6 insertions(+)
sound/pci/via82xx.c +6 -0
@@ -1791,6 +1791,12 @@ static struct ac97_quirk ac97_quirks[] = .type = AC97_TUNE_HP_ONLY }, { + .subvendor = 0x110a, + .subdevice = 0x0079, + .name = "Fujitsu Siemens D1289", + .type =AC97_TUNE_HP_ONLY + }, + { .subvendor = 0x1019, .subdevice = 0x0a81, .name = "ECS K7VTA3",
PATCH 54/123 sysfs: Cache the last sysfs_dirent to improve readdir scalability v2
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Eric W. Biederman <[email protected]>
commit 1e5289c97bba2d8ee7239a416bc3f28743362cd9 upstream.
When sysfs_readdir stops short we now cache the next sysfs_dirent to return to user space in filp->private_data. There is no impact on the rest of sysfs by doing this and in the common case it allows us to pick up exactly where we left off with no seeking.
Additionally I drop and regrab the sysfs_mutex around filldir to avoid a page fault abritrarily increasing the hold time on the sysfs_mutex.
v2: Returned to using INT_MAX as the EOF condition.
seekdir is ambiguous unless all directory entries have a unique f_pos value.
Fixes http://bugzilla.kernel.org/show_bug.cgi?id=14949
--- fs/sysfs/dir.c | 82 +++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 60 insertions(+), 22 deletions(-)
fs/sysfs/dir.c +60 -22
@@ -837,11 +837,46 @@ static inline unsigned char dt_type(strureturn (sd->s_mode >>12 ) &15 ; } +static int sysfs_dir_release (struct inode *inode,struct file *filp) +{ +sysfs_put (filp->private_data); +return 0 ; +} + +static struct sysfs_dirent *sysfs_dir_pos (struct sysfs_dirent *parent_sd, +ino_t ino,struct sysfs_dirent *pos) +{ +if (pos) { +int valid = !(pos->s_flags &SYSFS_FLAG_REMOVED ) && + pos->s_parent == parent_sd && + ino == pos->s_ino; +sysfs_put (pos); +if (valid) +return pos; + } + pos =NULL ; +if ((ino >1 ) && (ino <INT_MAX )) { + pos = parent_sd->s_dir.children; +while (pos && (ino > pos->s_ino)) + pos = pos->s_sibling; + } +return pos; +} + +static struct sysfs_dirent *sysfs_dir_next_pos (struct sysfs_dirent *parent_sd, +ino_t ino,struct sysfs_dirent *pos) +{ + pos =sysfs_dir_pos (parent_sd, ino, pos); +if (pos) + pos = pos->s_sibling; +return pos; +} +static int sysfs_readdir (struct file * filp,void * dirent,filldir_t filldir) {struct dentry *dentry = filp->f_path.dentry;struct sysfs_dirent * parent_sd = dentry->d_fsdata; -struct sysfs_dirent *pos; +struct sysfs_dirent *pos = filp->private_data;ino_t ino;if (filp->f_pos ==0 ) {
@@ -857,29 +892,31 @@ static int sysfs_readdir(struct file * fif (filldir (dirent,".." ,2 , filp->f_pos, ino,DT_DIR ) ==0 ) filp->f_pos++; } -if ((filp->f_pos >1 ) && (filp->f_pos <INT_MAX )) { -mutex_lock (&sysfs_mutex); +mutex_lock (&sysfs_mutex); +for (pos =sysfs_dir_pos (parent_sd, filp->f_pos, pos); + pos; + pos =sysfs_dir_next_pos (parent_sd, filp->f_pos, pos)) { +const char * name; +unsigned int type; +int len, ret; + + name = pos->s_name; + len =strlen (name); + ino = pos->s_ino; + type =dt_type (pos); + filp->f_pos = ino; + filp->private_data =sysfs_get (pos); -/* Skip the dentries we have already reported */ - pos = parent_sd->s_dir.children; -while (pos && (filp->f_pos > pos->s_ino)) - pos = pos->s_sibling; - -for ( ; pos; pos = pos->s_sibling) { -const char * name; -int len; - - name = pos->s_name; - len =strlen (name); - filp->f_pos = ino = pos->s_ino; - -if (filldir (dirent, name, len, filp->f_pos, ino, -dt_type (pos)) <0 ) -break ; - } -if (!pos) - filp->f_pos =INT_MAX ;mutex_unlock (&sysfs_mutex); + ret =filldir (dirent, name, len, filp->f_pos, ino, type); +mutex_lock (&sysfs_mutex); +if (ret <0 ) +break ; + } +mutex_unlock (&sysfs_mutex); +if ((filp->f_pos >1 ) && !pos) {/* EOF */ + filp->f_pos =INT_MAX ; + filp->private_data =NULL ; }return 0 ; }
@@ -888,5 +925,6 @@ static int sysfs_readdir(struct file * fconst struct file_operations sysfs_dir_operations = { .read = generic_read_dir, .readdir = sysfs_readdir, + .release = sysfs_dir_release, .llseek = generic_file_llseek, };
PATCH 68/123 skbuff: align sk_buff::cb to 64 bit and close some potential holes
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Felix Fietkau <[email protected]>
commit da3f5cf1f8ebb0fab5c5fd09adb189166594ad6c upstream.
The alignment requirement for 64-bit load/store instructions on ARM is implementation defined. Some CPUs (such as Marvell Feroceon) do not generate an exception, if such an instruction is executed with an address that is not 64 bit aligned. In such a case, the Feroceon corrupts adjacent memory, which showed up in my tests as a crash in the rx path of ath9k that only occured with CONFIG_XFRM set.
This crash happened, because the first field of the mac80211 rx status info in the cb is an u64, and changing it corrupted the skb->sp field.
This patch also closes some potential pre-existing holes in the sk_buff struct surrounding the cb[] area.
--- include/linux/skbuff.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
include/linux/skbuff.h +7 -6
@@ -315,22 +315,23 @@ struct sk_buff {struct sk_buff *next;struct sk_buff *prev; -struct sock *sk;ktime_t tstamp; + +struct sock *sk;struct net_device *dev; -unsigned long _skb_dst; -#ifdef CONFIG_XFRM -struct sec_path *sp; -#endif /* * This is the control buffer. It is free to use for every * layer. Please put your private variables there. If you * want to keep them across layers you have to do a skb_clone() * first. This is owned by whoever has the skb queued ATM. */ -char cb[48 ]; +char cb[48 ]__aligned(8) ; +unsigned long _skb_dst; +#ifdef CONFIG_XFRM +struct sec_path *sp; +#endif unsigned int len, data_len; __u16 mac_len,
PATCH 71/123 ath9k: fix beacon timer restart after a card reset
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Felix Fietkau <[email protected]>
commit d8728ee919282c7b01b65cd479ec1e2a9c5d3ba8 upstream.
In AP mode, ath_beacon_config_ap only restarts the timer if a TSF restart is requested. Apparently this was added, because this function unconditionally sets the flag for TSF reset.
The problem with this is, that ath9k_hw_reset() clobbers the timer registers (specified in the initvals), thus effectively disabling the SWBA interrupt whenever a card reset without TSF reset is issued (happens in a few places in the code).
This patch fixes ath_beacon_config_ap to only issue the TSF reset flag when necessary, but reinitialize the timer unconditionally. Tests show, that this is enough to keep the SWBA interrupt going after a call to ath_reset()
--- drivers/net/wireless/ath/ath9k/beacon.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath9k/beacon.c +3 -6
@@ -525,16 +525,13 @@ static void ath_beacon_config_ap(struct {u32 nexttbtt, intval; -/* Configure the timers only when the TSF has to be reset */ - -if (!(sc->sc_flags &SC_OP_TSF_RESET )) -return ; -/* NB: the beacon interval is kept internally in TU's */ intval = conf->beacon_interval &ATH9K_BEACON_PERIOD ; intval /=ATH_BCBUF ;/* for staggered beacons */ nexttbtt = intval; - intval |=ATH9K_BEACON_RESET_TSF ; + +if (sc->sc_flags &SC_OP_TSF_RESET ) + intval |=ATH9K_BEACON_RESET_TSF ;/* * In AP mode we enable the beacon timers and SWBA interrupts to
PATCH 85/123 thinkpad-acpi: fix bluetooth/wwan resume
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Henrique de Moraes Holschuh <[email protected]>
commit 08fedfc903c78e380b0baa7b57c52d367794d0a5 upstream.
Studying the DSDTs of various thinkpads, it looks like bit 3 of the argument to SBDC and SWAN is not "set radio to last state on resume". Rather, it seems to be "if this bit is set, enable radio on resume, otherwise disable it on resume".
So, the proper way to prepare the radios for S3 suspend is: disable radio and clear bit 3 on the SBDC/SWAN call to to resume with radio disabled, and enable radio and set bit 3 on the SBDC/SWAN call to resume with the radio enabled.
Also, for persistent devices, the rfkill core does not restore state, so we really need to get the firmware to do the right thing.
We don't sync the radio state on suspend, instead we trust the BIOS to not do anything weird if we never touched the radio state since boot. Time will tell if that's a wise way of doing things...
--- drivers/platform/x86/thinkpad_acpi.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +10 -8
@@ -3878,7 +3878,7 @@ enum {TP_ACPI_BLUETOOTH_HWPRESENT =0x01 ,/* Bluetooth hw available */ TP_ACPI_BLUETOOTH_RADIOSSW =0x02 ,/* Bluetooth radio enabled */ TP_ACPI_BLUETOOTH_RESUMECTRL = 0x04, /* Bluetooth state at resume: - off / last state */ + 0 = disable, 1 = enable */ }; enum {
@@ -3924,10 +3924,11 @@ static int bluetooth_set_status(enum tpa }#endif -/* We make sure to keep TP_ACPI_BLUETOOTH_RESUMECTRL off */ - status =TP_ACPI_BLUETOOTH_RESUMECTRL ;if (state ==TPACPI_RFK_RADIO_ON ) - status |=TP_ACPI_BLUETOOTH_RADIOSSW ; + status =TP_ACPI_BLUETOOTH_RADIOSSW + |TP_ACPI_BLUETOOTH_RESUMECTRL ; +else + status =0 ;if (!acpi_evalf (hkey_handle,NULL ,"SBDC" ,"vd" , status))return -EIO ;
@@ -4078,7 +4079,7 @@ enum {TP_ACPI_WANCARD_HWPRESENT =0x01 ,/* Wan hw available */ TP_ACPI_WANCARD_RADIOSSW =0x02 ,/* Wan radio enabled */ TP_ACPI_WANCARD_RESUMECTRL = 0x04, /* Wan state at resume: - off / last state */ + 0 = disable, 1 = enable */ };#define TPACPI_RFK_WWAN_SW_NAME "tpacpi_wwan_sw"
@@ -4115,10 +4116,11 @@ static int wan_set_status(enum tpacpi_rf }#endif -/* We make sure to set TP_ACPI_WANCARD_RESUMECTRL */ - status =TP_ACPI_WANCARD_RESUMECTRL ;if (state ==TPACPI_RFK_RADIO_ON ) - status |=TP_ACPI_WANCARD_RADIOSSW ; + status =TP_ACPI_WANCARD_RADIOSSW + |TP_ACPI_WANCARD_RESUMECTRL ; +else + status =0 ;if (!acpi_evalf (hkey_handle,NULL ,"SWAN" ,"vd" , status))return -EIO ;
PATCH 88/123 x86, ia32_aout: do not kill argument mapping
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Jiri Slaby <[email protected]>
commit 318f6b228ba88a394ef560efc1bfe028ad5ae6b6 upstream.
Do not set current->mm->mmap to NULL in 32-bit emulation on 64-bit load_aout_binary after flush_old_exec as it would destroy already set brpm mapping with arguments.
Introduced by b6a2fea39318e43fee84fa7b0b90d68bed92d2ba
mm: variable length argument support
where the argument mapping in bprm was added.
[ hpa: this is a regression from 2.6.22... time to kill a.out? ]
LKML-Reference: <[email protected]>
--- arch/x86/ia32/ia32_aout.c | 1 - 1 file changed, 1 deletion(-)
arch/x86/ia32/ia32_aout.c +0 -1
@@ -327,7 +327,6 @@ static int load_aout_binary(struct linux current->mm->free_area_cache =TASK_UNMAPPED_BASE ; current->mm->cached_hole_size =0 ; - current->mm->mmap =NULL ;install_exec_creds (bprm); current->flags &= ~PF_FORKNOEXEC ;
PATCH 92/123 x86: Fix SCI on IOAPIC != 0
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Yinghai Lu <[email protected]>
commit 18dce6ba5c8c6bd0f3ab4efa4cbdd698dab5c40a upstream.
Thomas Renninger <[email protected]> reported on IBM x3330
booting a latest kernel on this machine results in:
PCI: PCI BIOS revision 2.10 entry at 0xfd61c, last bus=1
PCI: Using configuration type 1 for base access bio: create slab <bio-0> at 0
ACPI: SCI (IRQ30) allocation failed
ACPI Exception: AE_NOT_ACQUIRED, Unable to install System Control Interrupt handler (20090903/evevent-161)
ACPI: Unable to start the ACPI Interpreter
Later all kind of devices fail...
and bisect it down to this commit:
commit b9c61b70075c87a8612624736faf4a2de5b1ed30
x86/pci: update pirq_enable_irq() to setup io apic routing
it turns out we need to set irq routing for the sci on ioapic1 early.
-v2: make it work without sparseirq too.
-v3: fix checkpatch.pl warning, and cc to stable
LKML-Reference: <[email protected]>
--- arch/x86/include/asm/io_apic.h | 1 arch/x86/kernel/acpi/boot.c | 9 ++++++- arch/x86/kernel/apic/io_apic.c | 50 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-)
arch/x86/include/asm/io_apic.h +1 -0
@@ -160,6 +160,7 @@ extern int io_apic_get_redir_entries(intstruct io_apic_irq_attr ;extern int io_apic_set_pci_routing (struct device *dev,int irq,struct io_apic_irq_attr *irq_attr); +void setup_IO_APIC_irq_extra (u32 gsi);extern int (*ioapic_renumber_irq)(int ioapic,int irq);extern void ioapic_init_mappings (void );extern void ioapic_insert_resources (void );
arch/x86/kernel/acpi/boot.c +8 -1
@@ -446,6 +446,12 @@ void __init acpi_pic_sci_set_trigger(unsint acpi_gsi_to_irq (u32 gsi,unsigned int *irq) { *irq = gsi; + +#ifdef CONFIG_X86_IO_APIC +if (acpi_irq_model ==ACPI_IRQ_MODEL_IOAPIC ) +setup_IO_APIC_irq_extra (gsi); +#endif +return 0 ; }
@@ -473,7 +479,8 @@ int acpi_register_gsi(struct device *dev plat_gsi = mp_register_gsi(dev, gsi, trigger, polarity); }#endif -acpi_gsi_to_irq (plat_gsi, &irq); + irq = plat_gsi; +return irq; }
arch/x86/kernel/apic/io_apic.c +50 -0
56 lines not on this page · raw message
PATCH 93/123 USB: xhci: Fix finding extended capabilities registers
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Edward Shao <[email protected]>
commit 05197921ff3dad52d99fd1647974c57d9c28d40e upstream.
According "5.3.6 Capability Parameters (HCCPARAMS)" of xHCI rev0.96 spec, value of xECP register indicates a relative offset, in 32-bit words, from Base to the beginning of the first extended capability. The wrong calculation will cause BIOS handoff fail (not handoff from BIOS) in some platform with BIOS USB legacy sup support.
--- drivers/usb/host/xhci-ext-caps.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/usb/host/xhci-ext-caps.h +5 -2
@@ -101,12 +101,15 @@ static inline int xhci_find_next_cap_off next =readl (base + ext_offset); -if (ext_offset ==XHCI_HCC_PARAMS_OFFSET ) +if (ext_offset ==XHCI_HCC_PARAMS_OFFSET ) {/* Find the first extended capability */ next =XHCI_HCC_EXT_CAPS (next); -else + ext_offset =0 ; + }else {/* Find the next extended capability */ next =XHCI_EXT_CAPS_NEXT (next); + } +if (!next)return 0 ;/*
PATCH 98/123 USB: f_mass_storage: fix crash on bind() error
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Peter Korsgaard <[email protected]>
commit 8e7e61dfbf1ec6418bf89505980b158a8d00d877 upstream.
init_completion() hasn't been called yet and the thread isn't created if we end up here, so don't call complete() on thread_notifier.
--- drivers/usb/gadget/f_mass_storage.c | 1 - 1 file changed, 1 deletion(-)
drivers/usb/gadget/f_mass_storage.c +0 -1
@@ -2852,7 +2852,6 @@ error_release:/* Call fsg_common_release() directly, ref might be not * initialised */ fsg_common_release (&common->ref); -complete (&common->thread_notifier);return ERR_PTR (rc); }
PATCH 99/123 USB: add new ftdi_sio device ids
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Mitchell Solomon <[email protected]>
commit 9714080d20f2ec4b671a06ce69367d91fa9e227e upstream.
PID patch for my products
--- drivers/usb/serial/ftdi_sio.c | 4 ++++ drivers/usb/serial/ftdi_sio_ids.h | 8 ++++++++ 2 files changed, 12 insertions(+)
drivers/usb/serial/ftdi_sio.c +4 -0
@@ -737,6 +737,10 @@ static struct usb_device_id id_table_com .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, { USB_DEVICE(FTDI_VID, HAMEG_HO820_PID) }, { USB_DEVICE(FTDI_VID, HAMEG_HO870_PID) }, + { USB_DEVICE(FTDI_VID, MJSG_GENERIC_PID) }, + { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) }, + { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) }, + { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) }, { }, /* Optional parameter entry */ { } /* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +8 -0
@@ -1002,3 +1002,11 @@#define EVO_8U232AM_PID 0x02FF/* Evolution robotics RCM2 (FT232AM)*/ #define EVO_HYBRID_PID 0x0302/* Evolution robotics RCM4 PID (FT232BM)*/ #define EVO_RCM4_PID 0x0303/* Evolution robotics RCM4 PID */ + +/* +* MJS Gadgets HD Radio / XM Radio / Sirius Radio interfaces (using VID 0x0403) +*/ +#define MJSG_GENERIC_PID 0x9378 +#define MJSG_SR_RADIO_PID 0x9379 +#define MJSG_XM_RADIO_PID 0x937A +#define MJSG_HD_RADIO_PID 0x937C
PATCH 104/123 drm/ttm: handle OOM in ttm_tt_swapout
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Maarten Maathuis <[email protected]>
commit 290e55056ec3d25c72088628245d8cae037b30db upstream.
- Without this change I get a general protection fault.
- Also use PTR_ERR where applicable.
--- drivers/gpu/drm/ttm/ttm_tt.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/gpu/drm/ttm/ttm_tt.c +11 -7
@@ -480,7 +480,7 @@ static int ttm_tt_swapin(struct ttm_tt *void *from_virtual;void *to_virtual;int i; -int ret; +int ret = -ENOMEM ;if (ttm->page_flags &TTM_PAGE_FLAG_USER ) { ret = ttm_tt_set_user(ttm, ttm->tsk, ttm->start,
@@ -499,8 +499,10 @@ static int ttm_tt_swapin(struct ttm_tt *for (i =0 ; i < ttm->num_pages; ++i) { from_page =read_mapping_page (swap_space, i,NULL ); -if (IS_ERR (from_page)) +if (IS_ERR (from_page)) { + ret =PTR_ERR (from_page); goto out_err; + } to_page =__ttm_tt_get_page (ttm, i);if (unlikely (to_page ==NULL )) goto out_err;
@@ -523,7 +525,7 @@ static int ttm_tt_swapin(struct ttm_tt *return 0 ; out_err:ttm_tt_free_alloced_pages (ttm); -return -ENOMEM ; +return ret; }int ttm_tt_swapout (struct ttm_tt *ttm,struct file *persistant_swap_storage)
@@ -535,6 +537,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, svoid *from_virtual;void *to_virtual;int i; +int ret = -ENOMEM ;BUG_ON (ttm->state != tt_unbound && ttm->state != tt_unpopulated);BUG_ON (ttm->caching_state != tt_cached);
@@ -557,7 +560,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, s 0);if (unlikely (IS_ERR (swap_storage))) {printk (KERN_ERR "Failed allocating swap storage.\n" ); -return -ENOMEM ; +return PTR_ERR (swap_storage); } }else swap_storage = persistant_swap_storage;
@@ -569,9 +572,10 @@ int ttm_tt_swapout(struct ttm_tt *ttm, sif (unlikely (from_page ==NULL ))continue ; to_page =read_mapping_page (swap_space, i,NULL ); -if (unlikely (to_page ==NULL )) +if (unlikely (IS_ERR (to_page))) { + ret =PTR_ERR (to_page); goto out_err; - + }preempt_disable (); from_virtual =kmap_atomic (from_page,KM_USER0 ); to_virtual =kmap_atomic (to_page,KM_USER1 );
@@ -595,5 +599,5 @@ out_err:if (!persistant_swap_storage)fput (swap_storage); -return -ENOMEM ; +return ret; }
PATCH 116/123 KVM: x86 emulator: Add group8 instruction decoding
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Gleb Natapov <[email protected]>
commit 2db2c2eb6226e30f8059b82512a1364db98da8e3 upstream.
Use groups mechanism to decode 0F BA instructions.
--- arch/x86/kvm/emulate.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/x86/kvm/emulate.c +6 -1
@@ -88,6 +88,7 @@enum { Group1_80, Group1_81, Group1_82, Group1_83, Group1A, Group3_Byte, Group3, Group4, Group5, Group7, + Group8, };static u32 opcode_table[256 ] = {
@@ -267,7 +268,7 @@ static u32 twobyte_table[256] = {0 ,0 , ByteOp | DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem16 | ModRM | Mov,/* 0xB8 - 0xBF */ -0 ,0 , DstMem | SrcImmByte | ModRM, DstMem | SrcReg | ModRM | BitOp, +0 ,0 , Group | Group8, DstMem | SrcReg | ModRM | BitOp,0 ,0 , ByteOp | DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem16 | ModRM | Mov, /* 0xC0 - 0xCF */
@@ -323,6 +324,10 @@ static u32 group_table[] = {0 ,0 , ModRM | SrcMem, ModRM | SrcMem, SrcNone | ModRM | DstMem | Mov,0 , SrcMem16 | ModRM | Mov, SrcMem | ModRM | ByteOp, + [Group8*8 ] = +0 ,0 ,0 ,0 , + DstMem | SrcImmByte | ModRM, DstMem | SrcImmByte | ModRM, + DstMem | SrcImmByte | ModRM, DstMem | SrcImmByte | ModRM, }; static u32 group2_table[] = {
PATCH 123/123 x86, mm: Allow highmem user page tables to be disabled at boot time
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Ian Campbell <[email protected]>
commit 14315592009c17035cac81f4954d5a1f4d71e489 upstream.
Distros generally (I looked at Debian, RHEL5 and SLES11) seem to enable CONFIG_HIGHPTE for any x86 configuration which has highmem enabled. This means that the overhead applies even to machines which have a fairly modest amount of high memory and which therefore do not really benefit from allocating PTEs in high memory but still pay the price of the additional mapping operations.
Running kernbench on a 4G box I found that with CONFIG_HIGHPTE=y but no actual highptes being allocated there was a reduction in system time used from 59.737s to 55.9s.
With CONFIG_HIGHPTE=y and highmem PTEs being allocated:
Average Optimal load -j 4 Run (std deviation):
Elapsed Time 175.396 (0.238914)
User Time 515.983 (5.85019)
System Time 59.737 (1.26727)
Percent CPU 263.8 (71.6796)
Context Switches 39989.7 (4672.64)
Sleeps 42617.7 (246.307)
With CONFIG_HIGHPTE=y but with no highmem PTEs being allocated:
Average Optimal load -j 4 Run (std deviation):
Elapsed Time 174.278 (0.831968)
User Time 515.659 (6.07012)
System Time 55.9 (1.07799)
Percent CPU 263.8 (71.266)
Context Switches 39929.6 (4485.13)
Sleeps 42583.7 (373.039)
This patch allows the user to control the allocation of PTEs in highmem from the command line ("userpte=nohigh") but retains the status-quo as the default.
It is possible that some simple heuristic could be developed which allows auto-tuning of this option however I don't have a sufficiently large machine available to me to perform any particularly meaningful experiments. We could probably handwave up an argument for a threshold at 16G of total RAM.
Assuming 768M of lowmem we have 196608 potential lowmem PTE pages. Each page can map 2M of RAM in a PAE-enabled configuration, meaning a maximum of 384G of RAM could potentially be mapped using lowmem PTEs.
Even allowing generous factor of 10 to account for other required lowmem allocations, generous slop to account for page sharing (which reduces the total amount of RAM mappable by a given number of PT pages) and other innacuracies in the estimations it would seem that even a 32G machine would not have a particularly pressing need for highmem PTEs. I think 32G could be considered to be at the upper bound of what might be sensible on a 32 bit machine (although I think in practice 64G is still supported).
It's seems questionable if HIGHPTE is even a win for any amount of RAM you would sensibly run a 32 bit kernel on rather than going 64 bit.
LKML-Reference: <[email protected]>
--- Documentation/kernel-parameters.txt | 7 +++++++ arch/x86/include/asm/pgalloc.h | 5 +++++ arch/x86/mm/pgtable.c | 31 ++++++++++++++++++++++++++----- 3 files changed, 38 insertions(+), 5 deletions(-)
Documentation/kernel-parameters.txt +7 -0
@@ -2703,6 +2703,13 @@ and is between 256 and 4096 characters. medium is write-protected). Example: quirks=0419:aaf5:rl,0421:0433:rc + userpte= + [X86] Flags controlling user PTE allocations. + + nohigh = do not allocate PTE pages in + HIGHMEM regardless of setting + of CONFIG_HIGHPTE. + vdso= [X86,SH] vdso=2: enable compat VDSO (default with COMPAT_VDSO) vdso=1: enable VDSO (default)
arch/x86/include/asm/pgalloc.h +5 -0
@@ -23,6 +23,11 @@ static inline void paravirt_release_pud(#endif /* +* Flags to use when allocating a user page table page. +*/ +extern gfp_t __userpte_alloc_gfp; + +/* * Allocate and free page tables. */ extern pgd_t *pgd_alloc (struct mm_struct *);
arch/x86/mm/pgtable.c +26 -5
@@ -6,6 +6,14 @@#define PGALLOC_GFP GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO +#ifdef CONFIG_HIGHPTE +#define PGALLOC_USER_GFP __GFP_HIGHMEM +#else +#define PGALLOC_USER_GFP 0 +#endif + +gfp_t __userpte_alloc_gfp =PGALLOC_GFP |PGALLOC_USER_GFP ; +pte_t *pte_alloc_one_kernel (struct mm_struct *mm,unsigned long address) {return (pte_t *)__get_free_page (PGALLOC_GFP );
@@ -15,16 +23,29 @@ pgtable_t pte_alloc_one(struct mm_struct {struct page *pte; -#ifdef CONFIG_HIGHPTE - pte =alloc_pages (PGALLOC_GFP | __GFP_HIGHMEM,0 ); -#else - pte =alloc_pages (PGALLOC_GFP ,0 ); -#endif + pte =alloc_pages (__userpte_alloc_gfp,0 );if (pte)pgtable_page_ctor (pte);return pte; } +static int __init setup_userpte (char *arg) +{ +if (!arg) +return -EINVAL ; + +/* +* "userpte=nohigh" disables allocation of user pagetables in +* high memory. +*/ +if (strcmp (arg,"nohigh" ) ==0 ) + __userpte_alloc_gfp &= ~__GFP_HIGHMEM; +else +return -EINVAL ; +return 0 ; +} +early_param ("userpte" , setup_userpte); +void ___pte_free_tlb (struct mmu_gather *tlb,struct page *pte) {pgtable_page_dtor (pte);
PATCH 122/123 sched: Dont use possibly stale sched_class
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Thomas Gleixner <[email protected]>
commit 83ab0aa0d5623d823444db82c3b3c34d7ec364ae upstream.
setscheduler() saves task->sched_class outside of the rq->lock held region for a check after the setscheduler changes have become effective. That might result in checking a stale value.
rtmutex_setprio() has the same problem, though it is protected by p->pi_lock against setscheduler(), but for correctness sake (and to avoid bad examples) it needs to be fixed as well.
Retrieve task->sched_class inside of the rq->lock held region.
--- kernel/sched.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/sched.c +4 -2
@@ -6065,7 +6065,7 @@ void rt_mutex_setprio(struct task_structunsigned long flags;int oldprio, on_rq, running;struct rq *rq; -const struct sched_class *prev_class = p->sched_class; +const struct sched_class *prev_class;BUG_ON (prio <0 || prio >MAX_PRIO );
@@ -6073,6 +6073,7 @@ void rt_mutex_setprio(struct task_structupdate_rq_clock (rq); oldprio = p->prio; + prev_class = p->sched_class; on_rq = p->se.on_rq; running =task_current (rq, p);if (on_rq)
@@ -6292,7 +6293,7 @@ static int __sched_setscheduler(struct t {int retval, oldprio, oldpolicy =-1 , on_rq, running;unsigned long flags; -const struct sched_class *prev_class = p->sched_class; +const struct sched_class *prev_class;struct rq *rq;int reset_on_fork;
@@ -6406,6 +6407,7 @@ recheck: p->sched_reset_on_fork = reset_on_fork; oldprio = p->prio; + prev_class = p->sched_class;__setscheduler (rq, p, policy, param->sched_priority);if (running)
PATCH 121/123 sched: Fix SMT scheduler regression in find_busiest_queue()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Suresh Siddha <[email protected]>
commit 9000f05c6d1607f79c0deacf42b09693be673f4c upstream.
Fix a SMT scheduler performance regression that is leading to a scenario where SMT threads in one core are completely idle while both the SMT threads in another core (on the same socket) are busy.
This is caused by this commit (with the problematic code highlighted)
commit bdb94aa5dbd8b55e75f5a50b61312fe589e2c2d1
Author: Peter Zijlstra <[email protected]>
Date: Tue Sep 1 10:34:38 2009 +0200
sched: Try to deal with low capacity
@@ -4203,15 +4223,18 @@ find_busiest_queue()
...
for_each_cpu(i, sched_group_cpus(group)) { + unsigned long power = power_of(i);
...
- wl = weighted_cpuload(i); + wl = weighted_cpuload(i) * SCHED_LOAD_SCALE; + wl /= power;
- if (rq->nr_running == 1 && wl > imbalance)
+ if (capacity && rq->nr_running == 1 && wl > imbalance)
continue;
On a SMT system, power of the HT logical cpu will be 589 and the scheduler load imbalance (for scenarios like the one mentioned above) can be approximately 1024 (SCHED_LOAD_SCALE). The above change of scaling the weighted load with the power will result in "wl > imbalance" and ultimately resulting in find_busiest_queue() return NULL, causing load_balance() to think that the load is well balanced. But infact one of the tasks can be moved to the idle core for optimal performance.
We don't need to use the weighted load (wl) scaled by the cpu power to compare with imabalance. In that condition, we already know there is only a single task "rq->nr_running == 1" and the comparison between imbalance, wl is to make sure that we select the correct priority thread which matches imbalance. So we really need to compare the imabalnce with the original weighted load of the cpu and not the scaled load.
But in other conditions where we want the most hammered(busiest) cpu, we can use scaled load to ensure that we consider the cpu power in addition to the actual load on that cpu, so that we can move the load away from the guy that is getting most hammered with respect to the actual capacity, as compared with the rest of the cpu's in that busiest group.
Fix it.
LKML-Reference: <[email protected]>
--- kernel/sched.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
kernel/sched.c +13 -2
@@ -4119,12 +4119,23 @@ find_busiest_queue(struct sched_group *gcontinue ; rq =cpu_rq (i); - wl =weighted_cpuload (i) *SCHED_LOAD_SCALE ; - wl /= power; + wl =weighted_cpuload (i); +/* +* When comparing with imbalance, use weighted_cpuload() +* which is not scaled with the cpu power. +*/ if (capacity && rq->nr_running ==1 && wl > imbalance)continue ; +/* +* For the load comparisons with the other cpu's, consider +* the weighted_cpuload() scaled with the cpu power, so that +* the load can be moved away from the cpu that is potentially +* running at a lower capacity. +*/ + wl = (wl *SCHED_LOAD_SCALE ) / power; +if (wl > max_load) { max_load = wl; busiest = rq;
PATCH 120/123 sched: Fix sched_mv_power_savings for !SMT
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Vaidyanathan Srinivasan <[email protected]>
commit 28f5318167adf23b16c844b9c2253f355cb21796 upstream.
Fix for sched_mc_powersavigs for pre-Nehalem platforms. Child sched domain should clear SD_PREFER_SIBLING if parent will have SD_POWERSAVINGS_BALANCE because they are contradicting.
Sets the flags correctly based on sched_mc_power_savings.
LKML-Reference: <[email protected]>
--- include/linux/sched.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
include/linux/sched.h +4 -1
@@ -878,7 +878,10 @@ static inline int sd_balance_for_mc_poweif (sched_smt_power_savings)return SD_POWERSAVINGS_BALANCE ; -return SD_PREFER_SIBLING ; +if (!sched_mc_power_savings) +return SD_PREFER_SIBLING ; + +return 0 ; }static inline int sd_balance_for_package_power (void )
PATCH 119/123 KVM: x86 emulator: Check CPL level during privilege instruction emulation
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Gleb Natapov <[email protected]>
commit e92805ac1228626c59c865f2f4e9059b9fb8c97b upstream.
Add CPL checking in case emulator is tricked into emulating privilege instruction from userspace.
--- arch/x86/kvm/emulate.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-)
arch/x86/kvm/emulate.c +20 -15
@@ -76,6 +76,7 @@#define GroupDual (1<<15)/* Alternate decoding of mod == 3 */ #define GroupMask 0xff/* Group number stored in bits 0:7 */ /* Misc flags */ +#define Priv (1<<27)/* instruction generates #GP if current CPL != 0 */ #define No64 (1<<28)/* Source 2 operand type */ #define Src2None (0<<29)
@@ -211,7 +212,7 @@ static u32 opcode_table[256] = { SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps,/* 0xF0 - 0xF7 */ 0 ,0 ,0 ,0 , - ImplicitOps, ImplicitOps, Group | Group3_Byte, Group | Group3, + ImplicitOps | Priv, ImplicitOps, Group | Group3_Byte, Group | Group3,/* 0xF8 - 0xFF */ ImplicitOps,0 , ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps, Group | Group4, Group | Group5,
@@ -219,16 +220,20 @@ static u32 opcode_table[256] = {static u32 twobyte_table[256 ] = {/* 0x00 - 0x0F */ -0 , Group | GroupDual | Group7,0 ,0 ,0 , ImplicitOps, ImplicitOps,0 , - ImplicitOps, ImplicitOps,0 ,0 ,0 , ImplicitOps | ModRM,0 ,0 , +0 , Group | GroupDual | Group7,0 ,0 , +0 , ImplicitOps, ImplicitOps | Priv,0 , + ImplicitOps | Priv, ImplicitOps | Priv,0 ,0 , +0 , ImplicitOps | ModRM,0 ,0 ,/* 0x10 - 0x1F */ 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , ImplicitOps | ModRM,0 ,0 ,0 ,0 ,0 ,0 ,0 ,/* 0x20 - 0x2F */ - ModRM | ImplicitOps, ModRM, ModRM | ImplicitOps, ModRM,0 ,0 ,0 ,0 , + ModRM | ImplicitOps | Priv, ModRM | Priv, + ModRM | ImplicitOps | Priv, ModRM | Priv, +0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,/* 0x30 - 0x3F */ - ImplicitOps,0 , ImplicitOps,0 , - ImplicitOps, ImplicitOps,0 ,0 , + ImplicitOps | Priv,0 , ImplicitOps | Priv,0 , + ImplicitOps, ImplicitOps | Priv,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,/* 0x40 - 0x47 */ DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov,
@@ -322,9 +327,9 @@ static u32 group_table[] = { SrcMem | ModRM | Stack,0 , SrcMem | ModRM | Stack, 0, SrcMem | ModRM | Stack, 0, [Group7*8 ] = -0 ,0 , ModRM | SrcMem, ModRM | SrcMem, +0 ,0 , ModRM | SrcMem | Priv, ModRM | SrcMem | Priv, SrcNone | ModRM | DstMem | Mov,0 , - SrcMem16 | ModRM | Mov, SrcMem | ModRM | ByteOp, + SrcMem16 | ModRM | Mov | Priv, SrcMem | ModRM | ByteOp | Priv, [Group8*8 ] =0 ,0 ,0 ,0 , DstMem | SrcImmByte | ModRM, DstMem | SrcImmByte | ModRM,
@@ -335,7 +340,7 @@ static u32 group_table[] = {static u32 group2_table[] = { [Group7*8 ] = - SrcNone | ModRM,0 ,0 , SrcNone | ModRM, + SrcNone | ModRM | Priv,0 ,0 , SrcNone | ModRM, SrcNone | ModRM | DstMem | Mov,0 , SrcMem16 | ModRM | Mov,0 , [Group9*8] =
@@ -1650,12 +1655,6 @@ emulate_sysexit(struct x86_emulate_ctxtreturn -1 ; } -/* sysexit must be called from CPL 0 */ -if (kvm_x86_ops->get_cpl (ctxt->vcpu) !=0 ) { -kvm_inject_gp (ctxt->vcpu,0 ); -return -1 ; - } -setup_syscalls_segments (ctxt, &cs, &ss);if ((c->rex_prefix &0x8 ) !=0x0 )
@@ -1719,6 +1718,12 @@ x86_emulate_insn(struct x86_emulate_ctxtmemcpy (c->regs, ctxt->vcpu->arch.regs,sizeof c->regs); saved_eip = c->eip; +/* Privileged instruction can be executed only in CPL=0 */ +if ((c->d & Priv) && kvm_x86_ops->get_cpl (ctxt->vcpu)) { +kvm_inject_gp (ctxt->vcpu,0 ); + goto done; + } +if (((c->d & ModRM) && (c->modrm_mod !=3 )) || (c->d & MemAbs)) memop = c->modrm_ea;
PATCH 118/123 KVM: x86 emulator: Add group9 instruction decoding
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Gleb Natapov <[email protected]>
commit 60a29d4ea4e7b6b95d9391ebc8625b0426f3a363 upstream.
Use groups mechanism to decode 0F C7 instructions.
--- arch/x86/kvm/emulate.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
arch/x86/kvm/emulate.c +7 -2
@@ -88,7 +88,7 @@enum { Group1_80, Group1_81, Group1_82, Group1_83, Group1A, Group3_Byte, Group3, Group4, Group5, Group7, - Group8, + Group8, Group9, };static u32 opcode_table[256 ] = {
@@ -272,7 +272,8 @@ static u32 twobyte_table[256] = {0 ,0 , ByteOp | DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem16 | ModRM | Mov,/* 0xC0 - 0xCF */ -0 ,0 ,0 , DstMem | SrcReg | ModRM | Mov,0 ,0 ,0 , ImplicitOps | ModRM, +0 ,0 ,0 , DstMem | SrcReg | ModRM | Mov, +0 ,0 ,0 , Group | GroupDual | Group9,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,/* 0xD0 - 0xDF */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -328,6 +329,8 @@ static u32 group_table[] = {0 ,0 ,0 ,0 , DstMem | SrcImmByte | ModRM, DstMem | SrcImmByte | ModRM, DstMem | SrcImmByte | ModRM, DstMem | SrcImmByte | ModRM, + [Group9*8 ] = + 0, ImplicitOps | ModRM, 0, 0, 0, 0, 0, 0, }; static u32 group2_table[] = {
@@ -335,6 +338,8 @@ static u32 group2_table[] = { SrcNone | ModRM,0 ,0 , SrcNone | ModRM, SrcNone | ModRM | DstMem | Mov,0 , SrcMem16 | ModRM | Mov, 0, + [Group9*8 ] = + 0, 0, 0, 0, 0, 0, 0, 0, };/* EFLAGS bit definitions. */
PATCH 117/123 KVM: x86 emulator: Forbid modifying CS segment register by mov instruction
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Gleb Natapov <[email protected]>
commit 8b9f44140bc4afd2698413cd9960c3912168ee91 upstream.
Inject #UD if guest attempts to do so. This is in accordance to Intel SDM.
--- arch/x86/kvm/emulate.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/x86/kvm/emulate.c +6 -0
@@ -1987,6 +1987,12 @@ special_insn:int err; sel = c->src.val; + +if (c->modrm_reg ==VCPU_SREG_CS ) { +kvm_queue_exception (ctxt->vcpu,UD_VECTOR ); + goto done; + } +if (c->modrm_reg ==VCPU_SREG_SS )toggle_interruptibility (ctxt,X86_SHADOW_INT_MOV_SS );
PATCH 115/123 KVM: VMX: Trap and invalid MWAIT/MONITOR instruction
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Sheng Yang <[email protected]>
commit 59708670b639bff00f92e519df1ae14da240e919 upstream.
We don't support these instructions, but guest can execute them even if the feature('monitor') haven't been exposed in CPUID. So we would trap and inject a #UD if guest try this way.
--- arch/x86/include/asm/vmx.h | 1 + arch/x86/kvm/vmx.c | 10 ++++++++++ 2 files changed, 11 insertions(+)
arch/x86/include/asm/vmx.h +1 -0
@@ -251,6 +251,7 @@ enum vmcs_field {#define EXIT_REASON_MSR_READ 31#define EXIT_REASON_MSR_WRITE 32#define EXIT_REASON_MWAIT_INSTRUCTION 36 +#define EXIT_REASON_MONITOR_INSTRUCTION 39#define EXIT_REASON_PAUSE_INSTRUCTION 40#define EXIT_REASON_MCE_DURING_VMENTRY 41#define EXIT_REASON_TPR_BELOW_THRESHOLD 43
arch/x86/kvm/vmx.c +10 -0
@@ -1224,6 +1224,8 @@ static __init int setup_vmcs_config(struCPU_BASED_USE_IO_BITMAPS |CPU_BASED_MOV_DR_EXITING |CPU_BASED_USE_TSC_OFFSETING | +CPU_BASED_MWAIT_EXITING | +CPU_BASED_MONITOR_EXITING |CPU_BASED_INVLPG_EXITING ; opt =CPU_BASED_TPR_SHADOW | CPU_BASED_USE_MSR_BITMAPS |
@@ -3416,6 +3418,12 @@ static int handle_pause(struct kvm_vcpureturn 1 ; } +static int handle_invalid_op (struct kvm_vcpu *vcpu) +{ +kvm_queue_exception (vcpu,UD_VECTOR ); +return 1 ; +} +/* * The exit handlers return 1 if the exit was handled fully and guest execution * may resume. Otherwise they set the kvm_run parameter to indicate what needs
@@ -3453,6 +3461,8 @@ static int (*kvm_vmx_exit_handlers[])(st [EXIT_REASON_EPT_VIOLATION] = handle_ept_violation, [EXIT_REASON_EPT_MISCONFIG] = handle_ept_misconfig, [EXIT_REASON_PAUSE_INSTRUCTION] = handle_pause, + [EXIT_REASON_MWAIT_INSTRUCTION] = handle_invalid_op, + [EXIT_REASON_MONITOR_INSTRUCTION] = handle_invalid_op, }; static const int kvm_vmx_max_exit_handlers =
PATCH 114/123 dm ioctl: only issue uevent on resume if state changed
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Mike Snitzer <[email protected]>
commit 0f3649a9e305ea22eb196a84a2d7520afcaa6060 upstream.
Only issue a uevent on a resume if the state of the device changed, i.e. if it was suspended and/or its table was replaced.
--- drivers/md/dm-ioctl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/md/dm-ioctl.c +5 -4
@@ -897,16 +897,17 @@ static int do_resume(struct dm_ioctl *paset_disk_ro (dm_disk (md),1 ); } -if (dm_suspended_md (md)) +if (dm_suspended_md (md)) { r =dm_resume (md); +if (!r) +dm_kobject_uevent (md,KOBJ_CHANGE , param->event_nr); + }if (old_map)dm_table_destroy (old_map); -if (!r) { -dm_kobject_uevent (md,KOBJ_CHANGE , param->event_nr); +if (!r) r =__dev_status (md, param); - }dm_put (md);return r;
PATCH 113/123 dm: free dm_io before bio_endio not after
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Mikulas Patocka <[email protected]>
commit a97f925a32aad2a37971d7bfb657006acf04e42d upstream.
Free the dm_io structure before calling bio_endio() instead of after it, to ensure that the io_pool containing it is not referenced after it is freed.
This partially fixes a problem described here
https://www.redhat.com/archives/dm-devel/2010-February/msg00109.html
thread 1:bio_endio(bio, io_error);
/* scheduling happens */
thread 2:
close the device remove the device
thread 1:free_io(md, io);
Thread 2, when removing the device, sees non-empty md->io_pool (because the io hasn't been freed by thread 1 yet) and may crash with BUG in mempool_free. Thread 1 may also crash, when freeing into a nonexisting mempool.
To fix this we must make sure that bio_endio() is the last call and the md structure is not accessed afterwards.
There is another bio_endio in process_barrier, but it is called from the thread and the thread is destroyed prior to freeing the mempools, so this call is not affected by the bug.
A similar bug exists with module unloads - the module may be unloaded immediately after bio_endio - but that is more difficult to fix.
--- drivers/md/dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/dm.c +2 -2
@@ -635,8 +635,10 @@ static void dec_pending(struct dm_io *ioif (!md->barrier_error && io_error != -EOPNOTSUPP ) md->barrier_error = io_error;end_io_acct (io); +free_io (md, io); }else {end_io_acct (io); +free_io (md, io);if (io_error !=DM_ENDIO_REQUEUE ) {trace_block_bio_complete (md->queue, bio);
@@ -644,8 +646,6 @@ static void dec_pending(struct dm_io *iobio_endio (bio, io_error); } } - -free_io (md, io); } }
PATCH 112/123 NFS: Fix an allocation-under-spinlock bug
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Trond Myklebust <[email protected]>
commit ebed9203b68a4f333ce5d17e874b26c3afcfeff1 upstream.
sunrpc_cache_update() will always call detail->update() from inside the detail->hash_lock, so it cannot allocate memory.
--- fs/nfs/dns_resolve.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
fs/nfs/dns_resolve.c +15 -3
@@ -36,6 +36,19 @@ struct nfs_dns_ent { }; +static void nfs_dns_ent_update (struct cache_head *cnew, +struct cache_head *ckey) +{ +struct nfs_dns_ent *new; +struct nfs_dns_ent *key; + + new = container_of(cnew, struct nfs_dns_ent, h); + key = container_of(ckey, struct nfs_dns_ent, h); + +memcpy (&new->addr, &key->addr, key->addrlen); + new->addrlen = key->addrlen; +} +static void nfs_dns_ent_init (struct cache_head *cnew,struct cache_head *ckey) {
@@ -49,8 +62,7 @@ static void nfs_dns_ent_init(struct cach new->hostname =kstrndup (key->hostname, key->namelen,GFP_KERNEL );if (new->hostname) { new->namelen = key->namelen; -memcpy (&new->addr, &key->addr, key->addrlen); - new->addrlen = key->addrlen; +nfs_dns_ent_update (cnew, ckey); }else { new->namelen =0 ; new->addrlen =0 ;
@@ -234,7 +246,7 @@ static struct cache_detail nfs_dns_resol .cache_show = nfs_dns_show, .match = nfs_dns_match, .init = nfs_dns_ent_init, - .update = nfs_dns_ent_init, + .update = nfs_dns_ent_update, .alloc = nfs_dns_ent_alloc, };
PATCH 111/123 rtc-coh901331: fix braces in resume code
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: James Hogan <[email protected]>
commit 5a98c04d78c896d52baef20ffc11f6d1ba6eb786 upstream.
The else part of the if statement is indented but does not have braces around it. It clearly should since it uses clk_enable and clk_disable which are supposed to balance.
--- drivers/rtc/rtc-coh901331.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/rtc/rtc-coh901331.c +3 -2
@@ -271,12 +271,13 @@ static int coh901331_resume(struct platf {struct coh901331_port *rtap =dev_get_drvdata (&pdev->dev); -if (device_may_wakeup (&pdev->dev)) +if (device_may_wakeup (&pdev->dev)) {disable_irq_wake (rtap->irq); -else + }else {clk_enable (rtap->clk);writel (rtap->irqmaskstore, rtap->virtbase +COH901331_IRQ_MASK );clk_disable (rtap->clk); + }return 0 ; }#else
PATCH 110/123 scripts/get_maintainer.pl: fix possible infinite loop
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Joe Perches <[email protected]>
commit 3c840c18bcd8efb37f1a565e83a9509e1ea5d105 upstream.
If MAINTAINERS section entries are misformatted, it was possible to have an infinite loop.
Correct the defect by always moving the index to the end of section + 1
Also, exit check for exclude as soon as possible.
--- scripts/get_maintainer.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/get_maintainer.pl +2 -2
@@ -314,6 +314,7 @@ foreach my $file (@files) { if ($type eq 'X') { if (file_match_pattern($file, $value)) { $exclude = 1; + last; } } }
@@ -340,8 +341,7 @@ foreach my $file (@files) { } } - $tvi += ($end - $start); - + $tvi = $end + 1; } foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
PATCH 107/123 SUNRPC: Handle EINVAL error returns from the TCP connect operation
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Trond Myklebust <[email protected]>
commit 9fcfe0c83c3b04a759cde6b8c5f961237f17808b upstream.
This can, for instance, happen if the user specifies a link local IPv6 address.
--- net/sunrpc/xprtsock.c | 5 +++++ 1 file changed, 5 insertions(+)
net/sunrpc/xprtsock.c +5 -0
@@ -1912,6 +1912,11 @@ static void xs_tcp_setup_socket(struct rcase -EALREADY :xprt_clear_connecting (xprt);return ; +case -EINVAL : +/* Happens, for instance, if the user specified a link +* local IPv6 address without a scope-id. +*/ + goto out; } out_eagain: status = -EAGAIN ;
PATCH 105/123 drm/radeon/kms/atom: fix shr/shl ops
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Alex Deucher <[email protected]>
commit 6a8a2d702b33c6ed5c789f21b4e89fdf221f01ca upstream.
The whole attribute table is valid for
shr/shl ops.
Fixes fdo bug 26668
--- drivers/gpu/drm/radeon/atom.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/gpu/drm/radeon/atom.c +0 -4
@@ -881,8 +881,6 @@ static void atom_op_shl(atom_exec_contexuint8_t attr =U8 ((*ptr)++), shift;uint32_t saved, dst;int dptr = *ptr; - attr &=0x38 ; - attr |= atom_def_dst[attr >>3 ] <<6 ;SDEBUG (" dst: " ); dst =atom_get_dst (ctx, arg, attr, ptr, &saved,1 ); shift =atom_get_src (ctx, attr, ptr);
@@ -897,8 +895,6 @@ static void atom_op_shr(atom_exec_contexuint8_t attr =U8 ((*ptr)++), shift;uint32_t saved, dst;int dptr = *ptr; - attr &=0x38 ; - attr |= atom_def_dst[attr >>3 ] <<6 ;SDEBUG (" dst: " ); dst =atom_get_dst (ctx, arg, attr, ptr, &saved,1 ); shift =atom_get_src (ctx, attr, ptr);
PATCH 106/123 sunrpc: remove unnecessary svc_xprt_put
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Neil Brown <[email protected]>
commit ab1b18f70a007ea6caeb007d269abb75b131a410 upstream.
The 'struct svc_deferred_req's on the xpt_deferred queue do not own a reference to the owning xprt. This is seen in svc_revisit which is where things are added to this queue. dr->xprt is set to NULL and the reference to the xprt it put.
So when this list is cleaned up in svc_delete_xprt, we mustn't put the reference.
Also, replace the 'for' with a 'while' which is arguably simpler and more likely to compile efficiently.
--- net/sunrpc/svc_xprt.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
net/sunrpc/svc_xprt.c +1 -4
@@ -889,11 +889,8 @@ void svc_delete_xprt(struct svc_xprt *xpif (test_bit (XPT_TEMP , &xprt->xpt_flags)) serv->sv_tmpcnt--; -for (dr =svc_deferred_dequeue (xprt); dr; - dr =svc_deferred_dequeue (xprt)) { -svc_xprt_put (xprt); +while ((dr =svc_deferred_dequeue (xprt)) !=NULL )kfree (dr); - }svc_xprt_put (xprt);spin_unlock_bh (&serv->sv_lock);
PATCH 103/123 drm/i915: Use a dmi quirk to skip a broken SDVO TV output.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Zhao Yakui <[email protected]>
commit 6070a4a928f8c92b9fae7d6717ebbb05f425d6b2 upstream.
This IBM system has a multi-function SDVO card that reports both VGA and TV, but the system has no TV connector. The TV connector always reported as connected, which would lead to poor modesetting choices.
https://bugs.freedesktop.org/show_bug.cgi?id=25787
--- drivers/gpu/drm/i915/intel_sdvo.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_sdvo.c +22 -1
@@ -35,6 +35,7 @@#include "i915_drm.h" #include "i915_drv.h" #include "intel_sdvo_regs.h" +#include <linux/dmi.h> static char *tv_format_names[] = {"NTSC_M" ,"NTSC_J" ,"NTSC_443" ,
@@ -2283,6 +2284,25 @@ intel_sdvo_get_slave_addr(struct drm_devreturn 0x72 ; } +static int intel_sdvo_bad_tv_callback (const struct dmi_system_id *id) +{ +DRM_DEBUG_KMS ("Ignoring bad SDVO TV connector for %s\n" , id->ident); +return 1 ; +} + +static struct dmi_system_id intel_sdvo_bad_tv[] = { + { + .callback = intel_sdvo_bad_tv_callback, + .ident ="IntelG45/ICH10R/DME1737" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"IBM CORPORATION" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"4800784" ), + }, + }, + + { }/* terminating entry */ +}; +static bool intel_sdvo_output_setup (struct intel_output *intel_output,uint16_t flags) {
@@ -2323,7 +2343,8 @@ intel_sdvo_output_setup(struct intel_out (1 <<INTEL_SDVO_NON_TV_CLONE_BIT ) | (1 <<INTEL_ANALOG_CLONE_BIT ); } - }else if (flags &SDVO_OUTPUT_SVID0 ) { + }else if ((flags &SDVO_OUTPUT_SVID0 ) && + !dmi_check_system (intel_sdvo_bad_tv)) { sdvo_priv->controlled_output =SDVO_OUTPUT_SVID0 ; encoder->encoder_type =DRM_MODE_ENCODER_TVDAC ;
PATCH 102/123 USB: unusual_devs: Add support for multiple Option 3G sticks
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Jan Dumon <[email protected]>
commit 46216e4fbe8c62059b5440dec0b236f386248a41 upstream.
Enable the SD-Card interface on multiple Option 3G sticks.
The unusual_devs.h entry is necessary because the device descriptor is vendor-specific. That prevents usb-storage from binding to it as an interface driver.
--- drivers/usb/storage/unusual_devs.h | 88 ++++++++++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 2 deletions(-)
drivers/usb/storage/unusual_devs.h +86 -2
@@ -1147,8 +1147,8 @@ UNUSUAL_DEV( 0x0af0, 0x7401, 0x0000, 0x0 0 ),/* Reported by Jan Dumon <[email protected]> -* This device (wrongly) has a vendor-specific device descriptor. -* The entry is needed so usb-storage can bind to it's mass-storage +* These devices (wrongly) have a vendor-specific device descriptor. +* These entries are needed so usb-storage can bind to their mass-storage * interface as an interface driver */ UNUSUAL_DEV( 0x0af0, 0x7501, 0x0000, 0x0000, "Option",
@@ -1156,6 +1156,90 @@ UNUSUAL_DEV( 0x0af0, 0x7501, 0x0000, 0x0 US_SC_DEVICE, US_PR_DEVICE, NULL, 0 ), +UNUSUAL_DEV (0x0af0 ,0x7701 ,0x0000 ,0x0000 , +"Option" , +"GI 0451 SD-Card" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +0 ), + +UNUSUAL_DEV (0x0af0 ,0x7706 ,0x0000 ,0x0000 , +"Option" , +"GI 0451 SD-Card" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +0 ), + +UNUSUAL_DEV (0x0af0 ,0x7901 ,0x0000 ,0x0000 , +"Option" , +"GI 0452 SD-Card" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +0 ), + +UNUSUAL_DEV (0x0af0 ,0x7A01 ,0x0000 ,0x0000 , +"Option" , +"GI 0461 SD-Card" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +0 ), + +UNUSUAL_DEV (0x0af0 ,0x7A05 ,0x0000 ,0x0000 , +"Option" , +"GI 0461 SD-Card" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +0 ), + +UNUSUAL_DEV (0x0af0 ,0x8300 ,0x0000 ,0x0000 , +"Option" , +"GI 033x SD-Card" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +0 ), + +UNUSUAL_DEV (0x0af0 ,0x8302 ,0x0000 ,0x0000 , +"Option" , +"GI 033x SD-Card" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +0 ), + +UNUSUAL_DEV (0x0af0 ,0x8304 ,0x0000 ,0x0000 , +"Option" , +"GI 033x SD-Card" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +0 ), + +UNUSUAL_DEV (0x0af0 ,0xc100 ,0x0000 ,0x0000 , +"Option" , +"GI 070x SD-Card" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +0 ), + +UNUSUAL_DEV (0x0af0 ,0xd057 ,0x0000 ,0x0000 , +"Option" , +"GI 1505 SD-Card" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +0 ), + +UNUSUAL_DEV (0x0af0 ,0xd058 ,0x0000 ,0x0000 , +"Option" , +"GI 1509 SD-Card" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +0 ), + +UNUSUAL_DEV (0x0af0 ,0xd157 ,0x0000 ,0x0000 , +"Option" , +"GI 1515 SD-Card" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +0 ), + +UNUSUAL_DEV (0x0af0 ,0xd257 ,0x0000 ,0x0000 , +"Option" , +"GI 1215 SD-Card" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +0 ), + +UNUSUAL_DEV (0x0af0 ,0xd357 ,0x0000 ,0x0000 , +"Option" , +"GI 1505 SD-Card" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +0 ), +/* Reported by Ben Efros <[email protected]> */ UNUSUAL_DEV( 0x0bc2, 0x3010, 0x0000, 0x0000, "Seagate",
PATCH 101/123 USB: cp210x: Add 81E8 (Zephyr Bioharness)
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Alan Cox <[email protected]>
commit bd07c551aae5d2200c7b195142e5ba63f26424da upstream.
As reported in
http://bugzilla.kernel.org/show_bug.cgi?id=10980
--- drivers/usb/serial/cp210x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/serial/cp210x.c +2 -1
@@ -91,11 +91,12 @@ static struct usb_device_id id_table [] { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */ { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */ { USB_DEVICE(0x10C4, 0x81E7) }, /* Aerocomm Radio */ + { USB_DEVICE(0x10C4, 0x81E8) }, /* Zephyr Bioharness */ { USB_DEVICE(0x10C4, 0x81F2) }, /* C1007 HF band RFID controller */ { USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */ { USB_DEVICE(0x10C4, 0x822B) }, /* Modem EDGE(GSM) Comander 2 */ { USB_DEVICE(0x10C4, 0x826B) }, /* Cygnal Integrated Products, Inc., Fasttrax GPS demostration module */ - { USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */ + { USB_DEVICE(0x10C4, 0x8293) }, /* Telegesys ETRX2USB */ { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */ { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ { USB_DEVICE(0x10C4, 0x8382) }, /* Cygnal Integrated Products, Inc. */
PATCH 100/123 USB: serial: ftdi: add CONTEC vendor and product id
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Daniel Sangorrin <[email protected]>
commit 46b72d78cb022714c89a9ebc00b9581b550cfca7 upstream.
This is a patch to ftdi_sio_ids.h and ftdi_sio.c that adds identifiers for CONTEC USB serial converter. I tested it with the device COM-1(USB)H
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 7 +++++++ 2 files changed, 8 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -614,6 +614,7 @@ static struct usb_device_id id_table_com { USB_DEVICE(FTDI_VID, FTDI_OCEANIC_PID) }, { USB_DEVICE(TTI_VID, TTI_QL355P_PID) }, { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, + { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, { USB_DEVICE(BANDB_VID, BANDB_USO9ML2_PID) },
drivers/usb/serial/ftdi_sio_ids.h +7 -0
@@ -494,6 +494,13 @@#define RATOC_PRODUCT_ID_USB60F 0xb020/* +* Contec products (http://www.contec.com) +* Submitted by Daniel Sangorrin +*/ +#define CONTEC_VID 0x06CE/* Vendor ID */ +#define CONTEC_COM1USBH_PID 0x8311/* COM-1(USB)H */ + +/* * Definitions for B&B Electronics products. */ #define BANDB_VID 0x0856/* B&B Electronics Vendor ID */
PATCH 97/123 USB: Move hcd free_dev call into usb_disconnect to fix oops
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Herbert Xu <[email protected]>
commit f7410ced7f931bb1ad79d1336412cf7b7a33cb14 upstream.
USB: Move hcd free_dev call into usb_disconnect
I found a way to oops the kernel:
1. Open a USB device through devio.
2. Remove the hcd module in the host kernel.
3. Close the devio file descriptor.
The problem is that closing the file descriptor does usb_release_dev as it is the last reference. usb_release_dev then tries to invoke the hcd free_dev function (or rather dereferencing the hcd driver struct). This causes an oops as the hcd driver has already been unloaded so the struct is gone.
This patch tries to fix this by bringing the free_dev call earlier and into usb_disconnect. I have verified that repeating the above steps no longer crashes with this patch applied.
--- drivers/usb/core/hcd.h | 2 +- drivers/usb/core/hub.c | 12 ++++++++++++ drivers/usb/core/usb.c | 3 --- 3 files changed, 13 insertions(+), 4 deletions(-)
drivers/usb/core/hcd.h +1 -1
@@ -248,7 +248,7 @@ struct hc_driver {/* xHCI specific functions */ /* Called by usb_alloc_dev to alloc HC device structures */ int (*alloc_dev)(struct usb_hcd *,struct usb_device *); -/* Called by usb_release_dev to free HC device structures */ +/* Called by usb_disconnect to free HC device structures */ void (*free_dev)(struct usb_hcd *,struct usb_device *);/* Bandwidth computation functions */
drivers/usb/core/hub.c +12 -0
@@ -1554,6 +1554,15 @@ static inline void usb_stop_pm(struct us#endif +static void hub_free_dev (struct usb_device *udev) +{ +struct usb_hcd *hcd =bus_to_hcd (udev->bus); + +/* Root hubs aren't real devices, so don't free HCD resources */ +if (hcd->driver->free_dev && udev->parent) + hcd->driver->free_dev (hcd, udev); +} +/** * usb_disconnect - disconnect a device (usbcore-internal) * @pdev: pointer to device being disconnected
@@ -1624,6 +1633,8 @@ void usb_disconnect(struct usb_device **usb_stop_pm (udev); +hub_free_dev (udev); +put_device (&udev->dev); }
@@ -3191,6 +3202,7 @@ loop_disable: loop:usb_ep0_reinit (udev);release_address (udev); +hub_free_dev (udev);usb_put_dev (udev);if ((status == -ENOTCONN ) || (status == -ENOTSUPP ))break ;
drivers/usb/core/usb.c +0 -3
@@ -228,9 +228,6 @@ static void usb_release_dev(struct devic hcd =bus_to_hcd (udev->bus);usb_destroy_configuration (udev); -/* Root hubs aren't real devices, so don't free HCD resources */ -if (hcd->driver->free_dev && udev->parent) - hcd->driver->free_dev (hcd, udev);usb_put_hcd (hcd);kfree (udev->product);kfree (udev->manufacturer);
PATCH 96/123 USB: remove debugging message for uevent constructions
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Alan Stern <[email protected]>
commit cceffe9348f93188d7811bda95924d4bd3040d0f upstream.
This patch (as1332) removes an unneeded and annoying debugging message announcing all USB uevent constructions.
--- drivers/usb/core/driver.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/usb/core/driver.c +1 -3
@@ -691,9 +691,6 @@ static int usb_uevent(struct device *dev {struct usb_device *usb_dev; -/* driver is often null here; dev_dbg() would oops */ -pr_debug ("usb %s: uevent\n" ,dev_name (dev)); -if (is_usb_device (dev)) { usb_dev =to_usb_device (dev); }else if (is_usb_interface (dev)) {
@@ -705,6 +702,7 @@ static int usb_uevent(struct device *dev }if (usb_dev->devnum <0 ) { +/* driver is often null here; dev_dbg() would oops */ pr_debug ("usb %s: already deleted?\n" ,dev_name (dev));return -ENODEV ; }
PATCH 95/123 USB: fix crash in uhci_scan_schedule
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Pete Zaitcev <[email protected]>
commit d23356da714595b888686d22cd19061323c09190 upstream.
When hardware is removed on a Stratus, the system may crash like this:
ACPI: PCI interrupt for device 0000:7c:00.1 disabled
Trying to free nonexistent resource <00000000a8000000-00000000afffffff> Trying to free nonexistent resource <00000000a4800000-00000000a480ffff> uhci_hcd 0000:7e:1d.0: remove, state 1
usb usb2: USB disconnect, address 1
usb 2-1: USB disconnect, address 2
Unable to handle kernel paging request at 0000000000100100 RIP: [<ffffffff88021950>] :uhci_hcd:uhci_scan_schedule+0xa2/0x89c
#4 [ffff81011de17e50] uhci_scan_schedule at ffffffff88021918 #5 [ffff81011de17ed0] uhci_irq at ffffffff88023cb8 #6 [ffff81011de17f10] usb_hcd_irq at ffffffff801f1c1f #7 [ffff81011de17f20] handle_IRQ_event at ffffffff8001123b #8 [ffff81011de17f50] __do_IRQ at ffffffff800ba749
This occurs because an interrupt scans uhci->skelqh, which is being freed. We do the right thing: disable the interrupts in the device, and do not do any processing if the interrupt is shared with other source, but it's possible that another CPU gets delayed somewhere (e.g. loops) until we started freeing.
The agreed-upon solution is to wait for interrupts to play out before proceeding. No other bareers are neceesary.
A backport of this patch was tested on a 2.6.18 based kernel. Testing of 2.6.32-based kernels is under way, but it takes us forever (months) to turn this around. So I think it's a good patch and we should keep it.
Tracked in RH bz#516851
--- drivers/usb/host/uhci-hcd.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/uhci-hcd.c +1 -0
@@ -735,6 +735,7 @@ static void uhci_stop(struct usb_hcd *hcuhci_hc_died (uhci);uhci_scan_schedule (uhci);spin_unlock_irq (&uhci->lock); +synchronize_irq (hcd->irq);del_timer_sync (&uhci->fsbr_timer);release_uhci (uhci);
PATCH 94/123 USB: fix the idProduct value for USB-3.0 root hubs
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Alan Stern <[email protected]>
commit cd780694920fbf869b23c8afb0bd083e7b0448c7 upstream.
This patch (as1346) changes the idProduct value for USB-3.0 root hubs from 0x0002 (which we already use for USB-2.0 root hubs) to 0x0003.
--- drivers/usb/core/hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/core/hcd.c +1 -1
@@ -141,7 +141,7 @@ static const u8 usb3_rh_dev_descriptor[10x09 ,/* __u8 bMaxPacketSize0; 2^9 = 512 Bytes */ 0x6b ,0x1d ,/* __le16 idVendor; Linux Foundation */ -0x02 ,0x00 ,/* __le16 idProduct; device 0x0002 */ +0x03 ,0x00 ,/* __le16 idProduct; device 0x0003 */ KERNEL_VER ,KERNEL_REL ,/* __le16 bcdDevice */ 0x03, /* __u8 iManufacturer; */
PATCH 91/123 x86: Avoid race condition in pci_enable_msix()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Brandon Phiilps <[email protected]>
commit ced5b697a76d325e7a7ac7d382dbbb632c765093 upstream.
Keep chip_data in create_irq_nr and destroy_irq.
When two drivers are setting up MSI-X at the same time via pci_enable_msix() there is a race. See this dmesg excerpt:
[ 85.170610] ixgbe 0000:02:00.1: irq 97 for MSI/MSI-X [ 85.170611] alloc irq_desc for 99 on node -1 [ 85.170613] igb 0000:08:00.1: irq 98 for MSI/MSI-X [ 85.170614] alloc kstat_irqs on node -1 [ 85.170616] alloc irq_2_iommu on node -1 [ 85.170617] alloc irq_desc for 100 on node -1 [ 85.170619] alloc kstat_irqs on node -1 [ 85.170621] alloc irq_2_iommu on node -1 [ 85.170625] ixgbe 0000:02:00.1: irq 99 for MSI/MSI-X [ 85.170626] alloc irq_desc for 101 on node -1 [ 85.170628] igb 0000:08:00.1: irq 100 for MSI/MSI-X [ 85.170630] alloc kstat_irqs on node -1 [ 85.170631] alloc irq_2_iommu on node -1 [ 85.170635] alloc irq_desc for 102 on node -1 [ 85.170636] alloc kstat_irqs on node -1 [ 85.170639] alloc irq_2_iommu on node -1 [ 85.170646] BUG: unable to handle kernel NULL pointer dereference
at 0000000000000088
As you can see igb and ixgbe are both alternating on create_irq_nr() via pci_enable_msix() in their probe function.
ixgbe: While looping through irq_desc_ptrs[] via create_irq_nr() ixgbe choses irq_desc_ptrs[102] and exits the loop, drops vector_lock and calls dynamic_irq_init. Then it sets irq_desc_ptrs[102]->chip_data = NULL via dynamic_irq_init().
igb: Grabs the vector_lock now and starts looping over irq_desc_ptrs[] via create_irq_nr(). It gets to irq_desc_ptrs[102] and does this:
cfg_new = irq_desc_ptrs[102]->chip_data; if (cfg_new->vector != 0) continue;
This hits the NULL deref.
Another possible race exists via pci_disable_msix() in a driver or in the number of error paths that call free_msi_irqs():
destroy_irq()dynamic_irq_cleanup() which sets desc->chip_data = NULL ...race window...desc->chip_data = cfg;
Remove the save and restore code for cfg in create_irq_nr() and destroy_irq() and take the desc->lock when checking the irq_cfg.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/apic/io_apic.c | 18 +++----------- include/linux/irq.h | 2 + kernel/irq/chip.c | 52 +++++++++++++++++++++++++++++++++-------- 3 files changed, 50 insertions(+), 22 deletions(-)
arch/x86/kernel/apic/io_apic.c +5 -13
@@ -3228,12 +3228,9 @@ unsigned int create_irq_nr(unsigned int }spin_unlock_irqrestore (&vector_lock, flags); -if (irq >0 ) { -dynamic_irq_init (irq); -/* restore it, in case dynamic_irq_init clear it */ -if (desc_new) - desc_new->chip_data = cfg_new; - } +if (irq >0 ) +dynamic_irq_init_keep_chip_data (irq); +return irq; }
@@ -3256,17 +3253,12 @@ void destroy_irq(unsigned int irq) {unsigned long flags;struct irq_cfg *cfg; -struct irq_desc *desc; -/* store it, in case dynamic_irq_cleanup clear it */ - desc =irq_to_desc (irq); - cfg = desc->chip_data; -dynamic_irq_cleanup (irq); -/* connect back irq_cfg */ - desc->chip_data = cfg; +dynamic_irq_cleanup_keep_chip_data (irq);free_irte (irq);spin_lock_irqsave (&vector_lock, flags); + cfg =irq_to_desc (irq)->chip_data;__clear_irq_vector (irq, cfg);spin_unlock_irqrestore (&vector_lock, flags); }
include/linux/irq.h +2 -0
@@ -400,7 +400,9 @@ static inline int irq_has_action(unsigne/* Dynamic irq helper functions */ extern void dynamic_irq_init (unsigned int irq); +void dynamic_irq_init_keep_chip_data (unsigned int irq);extern void dynamic_irq_cleanup (unsigned int irq); +void dynamic_irq_cleanup_keep_chip_data (unsigned int irq);/* Set/get chip/data for an IRQ: */ extern int set_irq_chip (unsigned int irq,struct irq_chip *chip);
kernel/irq/chip.c +43 -9
84 lines not on this page · raw message
PATCH 89/123 x86: Add iMac9,1 to pci_reboot_dmi_table
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Justin P. Mattock <[email protected]>
commit 0a832320f1bae6a4169bf683e201378f2437cfc1 upstream.
On the iMac9,1 /sbin/reboot results in a black mangled screen. Adding this DMI entry gets the machine to reboot cleanly as it should.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/reboot.c | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/x86/kernel/reboot.c +8 -0
@@ -461,6 +461,14 @@ static struct dmi_system_id __initdata p DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"), }, }, + { /* Handle problems with rebooting on the iMac9,1. */ + .callback = set_pci_reboot, + .ident = "Apple iMac9,1", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"), + }, + }, { } };
PATCH 87/123 ocfs2: Only bug out in direct io write for reflinked extent.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Tao Ma <[email protected]>
commit cbaee472f274ea9a98aabe47025f6e5551acadcb upstream.
In ocfs2_direct_IO_get_blocks, we only need to bug out in case of we are going to write a recounted extent rec.
What a silly bug introduced by me!
--- fs/ocfs2/aops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/ocfs2/aops.c +3 -2
@@ -577,8 +577,9 @@ static int ocfs2_direct_IO_get_blocks(st goto bail; } -/* We should already CoW the refcounted extent. */ -BUG_ON (ext_flags &OCFS2_EXT_REFCOUNTED ); +/* We should already CoW the refcounted extent in case of create. */ +BUG_ON (create && (ext_flags &OCFS2_EXT_REFCOUNTED )); +/* * get_more_blocks() expects us to describe a hole by clearing * the mapped bit on bh_result().
PATCH 86/123 thinkpad-acpi: lock down video output state access
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Henrique de Moraes Holschuh <[email protected]>
commit b525c06cdbd8a3963f0173ccd23f9147d4c384b5 upstream.
Given the right combination of ThinkPad and X.org, just reading the video output control state is enough to hard-crash X.org.
Until the day I somehow find out a model or BIOS cut date to not provide this feature to ThinkPads that can do video switching through X RandR, change permissions so that only processes with CAP_SYS_ADMIN can access any sort of video output control state.
This bug could be considered a local DoS I suppose, as it allows any non-privledged local user to cause some versions of X.org to hard-crash some ThinkPads.
--- Documentation/laptops/thinkpad-acpi.txt | 4 ++++ drivers/platform/x86/Kconfig | 10 ++++++++-- drivers/platform/x86/thinkpad_acpi.c | 15 +++++++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-)
Documentation/laptops/thinkpad-acpi.txt +4 -0
@@ -650,6 +650,10 @@ LCD, CRT or DVI (if available). The foll echo expand_toggle > /proc/acpi/ibm/video echo video_switch > /proc/acpi/ibm/video +NOTE: Access to this feature is restricted to processes owning the +CAP_SYS_ADMIN capability for safety reasons, as it can interact badly +enough with some versions of X.org to crash it. + Each video output device can be enabled or disabled individually. Reading /proc/acpi/ibm/video shows the status of each device.
drivers/platform/x86/Kconfig +8 -2
@@ -319,9 +319,15 @@ config THINKPAD_ACPI_VIDEO server running, phase of the moon, and the current mood of Schroedinger's cat. If you can use X.org's RandR to control your ThinkPad's video output ports instead of this feature, - don't think twice: do it and say N here to save some memory. + don't think twice: do it and say N here to save memory and avoid + bad interactions with X.org. - If you are not sure, say Y here. + NOTE: access to this feature is limited to processes with the + CAP_SYS_ADMIN capability, to avoid local DoS issues in platforms + where it interacts badly with X.org. + + If you are not sure, say Y here but do try to check if you could + be using X.org RandR instead. config THINKPAD_ACPI_HOTKEY_POLL bool "Support NVRAM polling for hot keys"
drivers/platform/x86/thinkpad_acpi.c +13 -2
@@ -286,6 +286,7 @@ struct ibm_init_struct {char param[32 ];int (*init) (struct ibm_init_struct *); +mode_t base_procfs_mode;struct ibm_struct *data; };
@@ -4629,6 +4630,10 @@ static int video_read(struct seq_file *mreturn 0 ; } +/* Even reads can crash X.org, so... */ +if (!capable (CAP_SYS_ADMIN )) +return -EPERM ; + status =video_outputsw_get ();if (status <0 )return status;
@@ -4662,6 +4667,10 @@ static int video_write(char *buf)if (video_supported ==TPACPI_VIDEO_NONE )return -ENODEV ; +/* Even reads can crash X.org, let alone writes... */ +if (!capable (CAP_SYS_ADMIN )) +return -EPERM ; + enable =0 ; disable =0 ;
@@ -8506,9 +8515,10 @@ static int __init ibm_init(struct ibm_in "%s installed\n", ibm->name);if (ibm->read) { -mode_t mode; +mode_t mode = iibm->base_procfs_mode; - mode =S_IRUGO ; +if (!mode) + mode =S_IRUGO ;if (ibm->write) mode |=S_IWUSR ; entry = proc_create_data(ibm->name, mode, proc_dir,
@@ -8699,6 +8709,7 @@ static struct ibm_init_struct ibms_init[#ifdef CONFIG_THINKPAD_ACPI_VIDEO { .init = video_init, + .base_procfs_mode = S_IRUSR, .data = &video_driver_data, },#endif
PATCH 84/123 thinkpad-acpi: make driver events work in NVRAM poll mode
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Henrique de Moraes Holschuh <[email protected]>
commit 7f0cf712a74fcc3ad21f0bde95bd32c2f2cc3888 upstream.
Thadeu Lima de Souza Cascardo reports this:
Brightness notification does not work until the user writes to hotkey_mask attribute. That's because the polling thread will only run if hotkey_user_mask is set and someone is reading the input device or if hotkey_driver_mask is set. In this second case, this condition is not tested after the mask is changed, because the brightness and volume drivers are started after the hotkey drivers.
Fix tpacpi_hotkey_driver_mask_set() to call hotkey_poll_setup(), so that the poller kthread will be started when needed.
--- drivers/platform/x86/thinkpad_acpi.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +10 -3
@@ -2082,6 +2082,7 @@ static struct attribute_set *hotkey_dev_static void tpacpi_driver_event (const unsigned int hkey_event);static void hotkey_driver_event (const unsigned int scancode); +static void hotkey_poll_setup (const bool may_warn);/* HKEY.MHKG() return bits */ #define TP_HOTKEY_TABLET_MASK (1 << 3)
@@ -2264,6 +2265,8 @@ static int tpacpi_hotkey_driver_mask_set rc =hotkey_mask_set ((hotkey_acpi_mask | hotkey_driver_mask) & ~hotkey_source_mask); +hotkey_poll_setup (true); +mutex_unlock (&hotkey_mutex);return rc;
@@ -2548,7 +2551,7 @@ static void hotkey_poll_stop_sync(void) }/* call with hotkey_mutex held */ -static void hotkey_poll_setup (bool may_warn) +static void hotkey_poll_setup (const bool may_warn) {const u32 poll_driver_mask = hotkey_driver_mask & hotkey_source_mask;const u32 poll_user_mask = hotkey_user_mask & hotkey_source_mask;
@@ -2579,7 +2582,7 @@ static void hotkey_poll_setup(bool may_w } } -static void hotkey_poll_setup_safe (bool may_warn) +static void hotkey_poll_setup_safe (const bool may_warn) {mutex_lock (&hotkey_mutex);hotkey_poll_setup (may_warn);
@@ -2597,7 +2600,11 @@ static void hotkey_poll_set_freq(unsigne#else /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */ -static void hotkey_poll_setup_safe (bool __unused) +static void hotkey_poll_setup (const bool __unused) +{ +} + +static void hotkey_poll_setup_safe (const bool __unused) { }
PATCH 83/123 thinkpad-acpi: document HKEY event 3006
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Henrique de Moraes Holschuh <[email protected]>
commit bf8b29c8f7f8269e99eca8b19048ed5b34b51810 upstream.
Event 0x3006 is used to help power management of the ODD in the UltraBay. The EC generates this event when the ODD eject button is pressed (even if the bay is powered down).
Normally, Linux doesn't need this as we keep the SATA link powered up (which wastes power). The EC powers up the bay by itself when the ODD eject button is pressed, and the SATA PHY reports the hotplug.
However, we could also power that SATA link down (and for that matter, also power down the Ultrabay) if the ODD is left idle for a while with no disk inside, and use event 0x3006 to know when we need that SATA link powered back up.
For now, just stop asking for more information when event 0x3006 is seen, there is no point in pestering users about it anymore.
--- drivers/platform/x86/thinkpad_acpi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +8 -2
@@ -3650,13 +3650,19 @@ static void hotkey_notify(struct ibm_strbreak ;case 3 :/* 0x3000-0x3FFF: bay-related wakeups */ -if (hkey ==TP_HKEY_EV_BAYEJ_ACK ) { +switch (hkey) { +case TP_HKEY_EV_BAYEJ_ACK : hotkey_autosleep_ack =1 ;printk (TPACPI_INFO "bay ejected\n" );hotkey_wakeup_hotunplug_complete_notify_change (); known_ev = true; - }else { +break ; +case TP_HKEY_EV_OPTDRV_EJ : +/* FIXME: kick libata if SATA link offline */ + known_ev = true; +break ; +default : known_ev = false; }break ;
PATCH 82/123 thinkpad-acpi: R52 brightness_mode has been confirmed
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Henrique de Moraes Holschuh <[email protected]>
commit 7d1894d8d1c411d2dad95abfe0f65bacf68c4afa upstream.
We can stop pestering users for confirmation of the brightness_mode default for firmware TP-76.
While at it, add a few missing comments in that quirk table.
--- drivers/platform/x86/thinkpad_acpi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +3 -3
@@ -6128,13 +6128,13 @@ static const struct tpacpi_quirk brightnTPACPI_Q_IBM ('1' ,'Y' ,TPACPI_BRGHT_Q_EC ),/* T43/p ATI */ /* Models with ATI GPUs that can use ECNVRAM */ -TPACPI_Q_IBM ('1' ,'R' ,TPACPI_BRGHT_Q_EC ), +TPACPI_Q_IBM ('1' ,'R' ,TPACPI_BRGHT_Q_EC ),/* R50,51 T40-42 */ TPACPI_Q_IBM ('1' ,'Q' ,TPACPI_BRGHT_Q_ASK |TPACPI_BRGHT_Q_EC ), -TPACPI_Q_IBM ('7' ,'6' ,TPACPI_BRGHT_Q_ASK |TPACPI_BRGHT_Q_EC ), +TPACPI_Q_IBM ('7' ,'6' ,TPACPI_BRGHT_Q_EC ),/* R52 */ TPACPI_Q_IBM ('7' ,'8' ,TPACPI_BRGHT_Q_ASK |TPACPI_BRGHT_Q_EC ),/* Models with Intel Extreme Graphics 2 */ -TPACPI_Q_IBM ('1' ,'U' ,TPACPI_BRGHT_Q_NOEC ), +TPACPI_Q_IBM ('1' ,'U' ,TPACPI_BRGHT_Q_NOEC ),/* X40 */ TPACPI_Q_IBM ('1' ,'V' ,TPACPI_BRGHT_Q_ASK |TPACPI_BRGHT_Q_EC ), TPACPI_Q_IBM('1', 'W', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
PATCH 81/123 thinkpad-acpi: fix poll thread auto-start
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Henrique de Moraes Holschuh <[email protected]>
commit b589ea4c44170d3f7a845684e2d1b3b9571663af upstream.
The driver was not starting the NVRAM polling thread if the input device was bound immediately after registration.
This fixes:
http://bugzilla.kernel.org/show_bug.cgi?id=15118
--- drivers/platform/x86/thinkpad_acpi.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +6 -9
@@ -2607,16 +2607,11 @@ static int hotkey_inputdev_open(struct i {switch (tpacpi_lifecycle) {case TPACPI_LIFE_INIT : -/* -* hotkey_init will call hotkey_poll_setup_safe -* at the appropriate moment -*/ -return 0 ; -case TPACPI_LIFE_EXITING : -return -EBUSY ;case TPACPI_LIFE_RUNNING :hotkey_poll_setup_safe (false);return 0 ; +case TPACPI_LIFE_EXITING : +return -EBUSY ; }/* Should only happen if tpacpi_lifecycle is corrupt */
@@ -2627,7 +2622,7 @@ static int hotkey_inputdev_open(struct istatic void hotkey_inputdev_close (struct input_dev *dev) {/* disable hotkey polling when possible */ -if (tpacpi_lifecycle ==TPACPI_LIFE_RUNNING && +if (tpacpi_lifecycle !=TPACPI_LIFE_EXITING && !(hotkey_source_mask & hotkey_driver_mask))hotkey_poll_setup_safe (false); }
@@ -9051,6 +9046,9 @@ static int __init thinkpad_acpi_module_ireturn ret; } } + + tpacpi_lifecycle =TPACPI_LIFE_RUNNING ; + ret =input_register_device (tpacpi_inputdev);if (ret <0 ) {printk (TPACPI_ERR "unable to register input device\n" );
@@ -9060,7 +9058,6 @@ static int __init thinkpad_acpi_module_i tp_features.input_device_registered =1 ; } - tpacpi_lifecycle =TPACPI_LIFE_RUNNING ;return 0 ; }
PATCH 80/123 eeepc-laptop: disable wireless hotplug for 1005PE
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Alan Jenkins <[email protected]>
commit ced69c59811f05b2f8378467cbb82ac6ed3c6a5a upstream.
The wireless hotplug code is not needed on this model, and it disables the wired ethernet card. (Like on the 1005HA and 1201N).
--- drivers/platform/x86/eeepc-laptop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/eeepc-laptop.c +2 -1
@@ -1277,7 +1277,8 @@ static void eeepc_dmi_check(struct eeepc* hotplug code. In fact, current hotplug code seems to unplug another * device... */ -if (strcmp (model,"1005HA" ) ==0 ||strcmp (model,"1201N" ) ==0 ) { +if (strcmp (model,"1005HA" ) ==0 ||strcmp (model,"1201N" ) ==0 || +strcmp (model,"1005PE" ) ==0 ) { eeepc->hotplug_disabled = true;pr_info ("wlan hotplug disabled\n" ); }
PATCH 79/123 mac80211: do not transmit frames on unconfigured 4-addr vlan interfaces
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Felix Fietkau <[email protected]>
commit 3f0e0b220f80075ce15483b20458192c0ac27426 upstream.
If frames are transmitted on 4-addr ap vlan interfaces with no station, they end up being transmitted unencrypted, even if the ap interface uses WPA. This patch add some sanity checking to make sure that this does not happen.
--- net/mac80211/tx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/mac80211/tx.c +4 -1
@@ -1052,8 +1052,11 @@ ieee80211_tx_prepare(struct ieee80211_su hdr = (struct ieee80211_hdr *) skb->data; -if (sdata->vif.type ==NL80211_IFTYPE_AP_VLAN ) +if (sdata->vif.type ==NL80211_IFTYPE_AP_VLAN ) { tx->sta =rcu_dereference (sdata->u.vlan.sta); +if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr) +return TX_DROP ; + }if (!tx->sta) tx->sta =sta_info_get (local, hdr->addr1);
PATCH 78/123 sunxvr500: Additional PCI id for sunxvr500 driver
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Ben Hutchings <[email protected]>
commit 275143e9b237dd7e0b6d01660fd9b8acd9922fa7 upstream.
Intergraph bought 3D Labs and some XVR-500 chips have Intergraph's vendor id.
--- drivers/video/sunxvr500.c | 1 + 1 file changed, 1 insertion(+)
drivers/video/sunxvr500.c +1 -0
@@ -400,6 +400,7 @@ static void __devexit e3d_pci_unregisterstatic struct pci_device_id e3d_pci_table[] = { {PCI_DEVICE (PCI_VENDOR_ID_3DLABS ,0x7a0 ), }, + {PCI_DEVICE (0x1091 ,0x7a0 ), }, {PCI_DEVICE (PCI_VENDOR_ID_3DLABS ,0x7a2 ), }, { .vendor =PCI_VENDOR_ID_3DLABS , .device =PCI_ANY_ID ,
PATCH 77/123 netfilter: xt_recent: fix false match
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Tim Gardner <[email protected]>
commit 8ccb92ad41cb311e52ad1b1fe77992c7f47a3b63 upstream.
A rule with a zero hit_count will always match.
--- net/netfilter/xt_recent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/xt_recent.c +1 -1
@@ -260,7 +260,7 @@ recent_mt(const struct sk_buff *skb, confor (i =0 ; i < e->nstamps; i++) {if (info->seconds &&time_after (time, e->stamps[i]))continue ; -if (++hits >= info->hit_count) { +if (info->hit_count && ++hits >= info->hit_count) { ret = !ret;break ; }
PATCH 76/123 netfilter: xt_recent: fix buffer overflow
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Tim Gardner <[email protected]>
commit 2c08522e5d2f0af2d6f05be558946dcbf8173683 upstream.
e->index overflows e->stamps[] every ip_pkt_list_tot packets.
Consider the case when ip_pkt_list_tot==1; the first packet received is stored in e->stamps[0] and e->index is initialized to 1. The next received packet timestamp is then stored at e->stamps[1] in recent_entry_update(), a buffer overflow because the maximum e->stamps[] index is 0.
--- net/netfilter/xt_recent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/xt_recent.c +1 -1
@@ -173,10 +173,10 @@ recent_entry_init(struct recent_table *tstatic void recent_entry_update (struct recent_table *t,struct recent_entry *e) { + e->index %= ip_pkt_list_tot; e->stamps[e->index++] = jiffies;if (e->index > e->nstamps) e->nstamps = e->index; - e->index %= ip_pkt_list_tot;list_move_tail (&e->lru_list, &t->lru_list); }
PATCH 75/123 b43/b43legacy: Wake queues in wireless_core_start
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Larry Finger <[email protected]>
commit 0866b03c7d7dee8a34ffa527ecda426c0f405518 upstream.
If b43 or b43legacy are deauthenticated or disconnected, there is a possibility that a reconnection is tried with the queues stopped in mac80211. To prevent this, start the queues before setting STAT_INITIALIZED.
In b43, a similar change has been in place (twice) in the wireless_core_init() routine. Remove the duplicate and add similar code to b43legacy.
--- drivers/net/wireless/b43/main.c | 3 +-- drivers/net/wireless/b43legacy/main.c | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/b43/main.c +1 -2
@@ -3970,6 +3970,7 @@ static int b43_wireless_core_start(struc }/* We are ready to run. */ +ieee80211_wake_queues (dev->wl->hw);b43_set_status (dev,B43_STAT_STARTED );/* Start data flow (TX/RX). */
@@ -4379,8 +4380,6 @@ static int b43_wireless_core_init(structieee80211_wake_queues (dev->wl->hw); -ieee80211_wake_queues (dev->wl->hw); -b43_set_status (dev,B43_STAT_INITIALIZED ); out:
drivers/net/wireless/b43legacy/main.c +2 -0
@@ -2921,6 +2921,7 @@ static int b43legacy_wireless_core_start goto out; }/* We are ready to run. */ +ieee80211_wake_queues (dev->wl->hw);b43legacy_set_status (dev, B43legacy_STAT_STARTED);/* Start data flow (TX/RX) */
@@ -3341,6 +3342,7 @@ static int b43legacy_wireless_core_init(b43legacy_security_init (dev);b43legacy_rng_init (wl); +ieee80211_wake_queues (dev->wl->hw);b43legacy_set_status (dev, B43legacy_STAT_INITIALIZED);b43legacy_leds_init (dev);
PATCH 74/123 ath5k: use correct packet type when transmitting
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Bob Copeland <[email protected]>
commit 2ac2927a953a01c83df255118922cce1523d1a18 upstream.
The hardware needs to know what type of frames are being sent in order to fill in various fields, for example the timestamp in probe responses (before this patch, it was always 0). Set it correctly when initializing the TX descriptor.
--- drivers/net/wireless/ath/ath5k/ath5k.h | 1 - drivers/net/wireless/ath/ath5k/base.c | 26 +++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath5k/ath5k.h +0 -1
@@ -541,7 +541,6 @@ struct ath5k_txq_info {/* * Transmit packet types. * used on tx control descriptor -* TODO: Use them inside base.c corectly */ enum ath5k_pkt_type {AR5K_PKT_TYPE_NORMAL =0 ,
drivers/net/wireless/ath/ath5k/base.c +25 -1
@@ -1246,6 +1246,29 @@ ath5k_rxbuf_setup(struct ath5k_softc *screturn 0 ; } +static enum ath5k_pkt_type get_hw_packet_type (struct sk_buff *skb) +{ +struct ieee80211_hdr *hdr; +enum ath5k_pkt_type htype; +__le16 fc; + + hdr = (struct ieee80211_hdr *)skb->data; + fc = hdr->frame_control; + +if (ieee80211_is_beacon (fc)) + htype =AR5K_PKT_TYPE_BEACON ; +else if (ieee80211_is_probe_resp (fc)) + htype =AR5K_PKT_TYPE_PROBE_RESP ; +else if (ieee80211_is_atim (fc)) + htype =AR5K_PKT_TYPE_ATIM ; +else if (ieee80211_is_pspoll (fc)) + htype =AR5K_PKT_TYPE_PSPOLL ; +else + htype =AR5K_PKT_TYPE_NORMAL ; + +return htype; +} +static int ath5k_txbuf_setup (struct ath5k_softc *sc,struct ath5k_buf *bf,struct ath5k_txq *txq)
@@ -1300,7 +1323,8 @@ ath5k_txbuf_setup(struct ath5k_softc *sc sc->vif, pktlen, info)); } ret = ah->ah_setup_tx_desc(ah, ds, pktlen, - ieee80211_get_hdrlen_from_skb(skb), AR5K_PKT_TYPE_NORMAL, + ieee80211_get_hdrlen_from_skb(skb), + get_hw_packet_type(skb), (sc->power_level * 2), hw_rate, info->control.rates[0].count, keyidx, ah->ah_tx_ant, flags,
PATCH 73/123 ath9k: disable RIFS search for AR91xx based chips
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Felix Fietkau <[email protected]>
commit 7bfbae10dc10a5c94a780d117a57e875d77e8e5a upstream.
While ath9k does not support RIFS yet, the ability to receive RIFS frames is currently enabled for most chipsets in the initvals. This is causing baseband related issues on AR9160 and AR9130 based chipsets, which can lock up under certain conditions.
This patch fixes these issues by overriding the initvals, effectively disabling RIFS for all affected chipsets.
--- drivers/net/wireless/ath/ath9k/hw.c | 10 ++++++++++ drivers/net/wireless/ath/ath9k/phy.h | 3 +++ 2 files changed, 13 insertions(+)
drivers/net/wireless/ath/ath9k/hw.c +10 -0
@@ -1345,6 +1345,16 @@ static void ath9k_hw_override_ini(struct* Necessary to avoid issues on AR5416 2.0 */ REG_WRITE (ah,0x9800 + (651 <<2 ),0x11 ); + +/* +* Disable RIFS search on some chips to avoid baseband +* hang issues. +*/ +if (AR_SREV_9100 (ah) ||AR_SREV_9160 (ah)) { + val =REG_READ (ah,AR_PHY_HEAVY_CLIP_FACTOR_RIFS ); + val &= ~AR_PHY_RIFS_INIT_DELAY ; +REG_WRITE (ah,AR_PHY_HEAVY_CLIP_FACTOR_RIFS , val); + } } static u32 ath9k_hw_def_ini_fixup(struct ath_hw *ah,
drivers/net/wireless/ath/ath9k/phy.h +3 -0
@@ -384,6 +384,9 @@ bool ath9k_hw_set_rf_regs(struct ath_hw#define AR_PHY_HEAVY_CLIP_ENABLE 0x99E0 +#define AR_PHY_HEAVY_CLIP_FACTOR_RIFS 0x99EC +#define AR_PHY_RIFS_INIT_DELAY 0x03ff0000 +#define AR_PHY_M_SLEEP 0x99f0#define AR_PHY_REFCLKDLY 0x99f4#define AR_PHY_REFCLKPD 0x99f8
PATCH 72/123 ath9k: fix rate control fallback rate selection
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Felix Fietkau <[email protected]>
commit 5c0ba62fd4b2dce08055a89600f1d834f9f0fe9e upstream.
When selecting the tx fallback rate, rc.c used a separate variable 'nrix' for storing the next rate index, however it did not use that as reference for further rate index lowering. Because of that, it ended up reusing the same rate for multiple multi-rate retry stages, thus decreasing delivery probability under changing link conditions.
This patch removes the separate (unnecessary) variable and fixes fallback the way it was intended to work.
This should result in increased throughput and better link stability.
--- drivers/net/wireless/ath/ath9k/rc.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/net/wireless/ath/ath9k/rc.c +7 -8
@@ -668,7 +668,7 @@ static void ath_get_rate(void *priv, strstruct ieee80211_tx_rate *rates = tx_info->control.rates;struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;__le16 fc = hdr->frame_control; -u8 try_per_rate, i =0 , rix, nrix; +u8 try_per_rate, i =0 , rix;int is_probe =0 ;if (rate_control_send_low (sta, priv_sta, txrc))
@@ -688,26 +688,25 @@ static void ath_get_rate(void *priv, str rate_table = sc->cur_rate_table; rix =ath_rc_get_highest_rix (sc, ath_rc_priv, rate_table, &is_probe); - nrix = rix;if (is_probe) {/* set one try for probe rates. For the * probes don't enable rts */ ath_rc_rate_set_series (rate_table, &rates[i++], txrc, -1 , nrix,0 ); +1 , rix,0 );/* Get the next tried/allowed rate. No RTS for the next series * after the probe rate */ -ath_rc_get_lower_rix (rate_table, ath_rc_priv, rix, &nrix); +ath_rc_get_lower_rix (rate_table, ath_rc_priv, rix, &rix);ath_rc_rate_set_series (rate_table, &rates[i++], txrc, - try_per_rate, nrix,0 ); + try_per_rate, rix,0 ); tx_info->flags |=IEEE80211_TX_CTL_RATE_CTRL_PROBE ; }else {/* Set the choosen rate. No RTS for first series entry. */ ath_rc_rate_set_series (rate_table, &rates[i++], txrc, - try_per_rate, nrix,0 ); + try_per_rate, rix,0 ); }/* Fill in the other rates for multirate retry */
@@ -716,10 +715,10 @@ static void ath_get_rate(void *priv, strif (i +1 ==4 ) try_per_rate =4 ; -ath_rc_get_lower_rix (rate_table, ath_rc_priv, rix, &nrix); +ath_rc_get_lower_rix (rate_table, ath_rc_priv, rix, &rix);/* All other rates in the series have RTS enabled */ ath_rc_rate_set_series (rate_table, &rates[i], txrc, - try_per_rate, nrix,1 ); + try_per_rate, rix,1 ); }/*
PATCH 70/123 ath9k: re-enable ps by default for new single chip families
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Luis R. Rodriguez <[email protected]>
commit 14acdde6e527950f66c084dbf19bad6fbfcaeedc upstream.
The newer single chip hardware family of chipsets have not been experiencing issues with power saving set by default with recent fixes merged (even into stable). The remaining issues are only reported with AR5416 and since enabling PS by default can increase power savings considerably best to take advantage of that feature as this has been tested properly.
For more details on this issue see the bug report:
http://bugzilla.kernel.org/show_bug.cgi?id=14267
We leave AR5416 with PS disabled by default, that seems to require some more work.
--- drivers/net/wireless/ath/ath9k/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/main.c +4 -1
@@ -1849,6 +1849,8 @@ bad_free_hw:void ath_set_hw_capab (struct ath_softc *sc,struct ieee80211_hw *hw) { +struct ath_hw *ah = sc->sc_ah; + hw->flags =IEEE80211_HW_RX_INCLUDES_FCS |IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | IEEE80211_HW_SIGNAL_DBM |
@@ -1866,7 +1868,8 @@ void ath_set_hw_capab(struct ath_softc *BIT (NL80211_IFTYPE_ADHOC ) |BIT (NL80211_IFTYPE_MESH_POINT ); - hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT ; +if (AR_SREV_5416 (ah)) + hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT ; hw->queues =4 ; hw->max_rates =4 ;
PATCH 69/123 netdevice.h: check for CONFIG_WLAN instead of CONFIG_WLAN_80211
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: John W. Linville <[email protected]>
commit caf66e581172dc5032bb84841a91bc7b77ad9876 upstream.
In "wireless: remove WLAN_80211 and WLAN_PRE80211 from Kconfig" I inadvertantly missed a line in include/linux/netdevice.h. I thereby effectively reverted "net: Set LL_MAX_HEADER properly for wireless." by accident. :-( Now we should check there for CONFIG_WLAN instead.
--- include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/netdevice.h +1 -1
@@ -136,7 +136,7 @@ static inline bool dev_xmit_complete(int* used. */ -#if defined(CONFIG_WLAN_80211 ) || defined(CONFIG_AX25 ) || defined(CONFIG_AX25_MODULE ) +#if defined(CONFIG_WLAN ) || defined(CONFIG_AX25 ) || defined(CONFIG_AX25_MODULE )# if defined(CONFIG_MAC80211_MESH )# define LL_MAX_HEADER 128# else
PATCH 66/123 pata_hpt3x2n: always stretch UltraDMA timing
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Sergei Shtylyov <[email protected]>
commit 60661933995bc7a09686c901439e17c2a4ea7d5d upstream.
The UltraDMA Tss timing must be stretched with ATA clock of 66 MHz, but the driver only does this when PCI clock is 66 MHz, whereas it always programs DPLL clock (which is used as the ATA clock) to 66 MHz.
--- drivers/ata/pata_hpt3x2n.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/ata/pata_hpt3x2n.c +10 -10
@@ -25,7 +25,7 @@#include <linux/libata.h> #define DRV_NAME "pata_hpt3x2n" -#define DRV_VERSION "0.3.8" +#define DRV_VERSION "0.3.9"enum {HPT_PCI_FAST = (1 <<31 ),
@@ -544,16 +544,16 @@ static int hpt3x2n_init_one(struct pci_d pci_mhz);/* Set our private data up. We only need a few flags so we use it directly */ -if (pci_mhz >60 ) { +if (pci_mhz >60 ) hpriv = (void *)(PCI66 |USE_DPLL ); -/* -* On HPT371N, if ATA clock is 66 MHz we must set bit 2 in -* the MISC. register to stretch the UltraDMA Tss timing. -* NOTE: This register is only writeable via I/O space. -*/ -if (dev->device ==PCI_DEVICE_ID_TTI_HPT371 ) -outb (inb (iobase +0x9c ) |0x04 , iobase +0x9c ); - } + +/* +* On HPT371N, if ATA clock is 66 MHz we must set bit 2 in +* the MISC. register to stretch the UltraDMA Tss timing. +* NOTE: This register is only writeable via I/O space. +*/ +if (dev->device ==PCI_DEVICE_ID_TTI_HPT371 ) +outb (inb (iobase +0x9c ) |0x04 , iobase +0x9c );/* Now kick off ATA set up */ return ata_pci_sff_init_one (dev, ppi, &hpt3x2n_sht, hpriv);
PATCH 67/123 scm: Only support SCM_RIGHTS on unix domain sockets.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Eric W. Biederman <[email protected]>
commit 76dadd76c265a0cdb5a76aa4eef03fcc9639b388 upstream.
We use scm_send and scm_recv on both unix domain and netlink sockets, but only unix domain sockets support everything required for file descriptor passing, so error if someone attempts to pass file descriptors over netlink sockets.
--- net/core/scm.c | 2 ++ 1 file changed, 2 insertions(+)
net/core/scm.c +2 -0
@@ -156,6 +156,8 @@ int __scm_send(struct socket *sock, struswitch (cmsg->cmsg_type) {case SCM_RIGHTS : +if (!sock->ops || sock->ops->family !=PF_UNIX ) + goto error; err=scm_fp_copy (cmsg, &p->fp);if (err<0 ) goto error;
PATCH 65/123 hwmon: Fix off-by-one kind values
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Jean Delvare <[email protected]>
commit dc71afe5ac7e8d049bb991330518e4c898a7d92e upstream.
Recent changes on the I2C front have left off-by-one array indexes in 3 hwmon drivers. Fix them.
Faulty commit:e5e9f44c2 i2c: Drop I2C_CLIENT_INSMOD_2 to 8
--- drivers/hwmon/fschmd.c | 15 ++++++--------- drivers/hwmon/tmp401.c | 7 +++---- drivers/hwmon/tmp421.c | 4 ++-- 3 files changed, 11 insertions(+), 15 deletions(-)
drivers/hwmon/fschmd.c +6 -9
@@ -267,7 +267,7 @@ struct fschmd_data {struct list_head list;/* member of the watchdog_data_list */ struct kref kref;struct miscdevice watchdog_miscdev; -int kind; +enum chips kind;unsigned long watchdog_is_open;char watchdog_expect_close;char watchdog_name[10 ];/* must be unique to avoid sysfs conflict */
@@ -325,8 +325,7 @@ static ssize_t show_in_value(struct deviint index =to_sensor_dev_attr (devattr)->index;struct fschmd_data *data =fschmd_update_device (dev); -/* fscher / fschrc - 1 as data->kind is an array index, not a chips */ -if (data->kind == (fscher -1 ) || data->kind >= (fschrc -1 )) +if (data->kind == fscher || data->kind >= fschrc)return sprintf (buf,"%d\n" , (data->volt[index] * dmi_vref * dmi_mult[index]) /255 + dmi_offset[index]);else
@@ -492,7 +491,7 @@ static ssize_t show_pwm_auto_point1_pwm(int val = data->fan_min[index];/* 0 = allow turning off (except on the syl), 1-255 = 50-100% */ -if (val || data->kind == fscsyl -1 ) +if (val || data->kind == fscsyl) val = val /2 +128 ;return sprintf (buf,"%d\n" , val);
@@ -506,7 +505,7 @@ static ssize_t store_pwm_auto_point1_pwmunsigned long v =simple_strtoul (buf,NULL ,10 );/* reg: 0 = allow turning off (except on the syl), 1-255 = 50-100% */ -if (v || data->kind == fscsyl -1 ) { +if (v || data->kind == fscsyl) { v =SENSORS_LIMIT (v,128 ,255 ); v = (v -128 ) *2 +1 ; }
@@ -1037,7 +1036,7 @@ static int fschmd_detect(struct i2c_clieelse return -ENODEV ; -strlcpy (info->type, fschmd_id[kind -1 ].name,I2C_NAME_SIZE ); +strlcpy (info->type, fschmd_id[kind].name,I2C_NAME_SIZE );return 0 ; }
@@ -1065,6 +1064,7 @@ static int fschmd_probe(struct i2c_clien(where the client is found through a data ptr instead of the otherway around) */ data->client = client; + data->kind = kind;if (kind == fscpos) {/* The Poseidon has hardwired temp limits, fill these
@@ -1085,9 +1085,6 @@ static int fschmd_probe(struct i2c_clien } } -/* i2c kind goes from 1-6, we want from 0-5 to address arrays */ - data->kind = kind -1 ; -/* Read in some never changing registers */ data->revision =i2c_smbus_read_byte_data (client,FSCHMD_REG_REVISION ); data->global_control = i2c_smbus_read_byte_data(client,
drivers/hwmon/tmp401.c +3 -4
@@ -134,7 +134,7 @@ struct tmp401_data {struct mutex update_lock;char valid;/* zero until following fields are valid */ unsigned long last_updated;/* in jiffies */ -int kind; +enum chips kind;/* register values */ u8 status;
@@ -524,7 +524,7 @@ static int tmp401_detect(struct i2c_clieif (reg >15 )return -ENODEV ; -strlcpy (info->type, tmp401_id[kind -1 ].name,I2C_NAME_SIZE ); +strlcpy (info->type, tmp401_id[kind].name,I2C_NAME_SIZE );return 0 ; }
@@ -572,8 +572,7 @@ static int tmp401_probe(struct i2c_clien goto exit_remove; } -dev_info (&client->dev,"Detected TI %s chip\n" , - names[data->kind -1 ]); +dev_info (&client->dev,"Detected TI %s chip\n" , names[data->kind]);return 0 ;
drivers/hwmon/tmp421.c +2 -2
@@ -254,9 +254,9 @@ static int tmp421_detect(struct i2c_cliereturn -ENODEV ; } -strlcpy (info->type, tmp421_id[kind -1 ].name,I2C_NAME_SIZE ); +strlcpy (info->type, tmp421_id[kind].name,I2C_NAME_SIZE );dev_info (&adapter->dev,"Detected TI %s chip at 0x%02x\n" , - names[kind -1 ], client->addr); + names[kind], client->addr);return 0 ; }
PATCH 64/123 hwmon: (tmp421) Restore missing inputs
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Jean Delvare <[email protected]>
commit 8d59582a867470a3e0c3eced4a01625ae8dc546b upstream.
An off-by-one error caused some inputs to not be created by the driver when they should. TMP421 gets only one input instead of two, TMP422 gets two instead of three, etc. Fix the bug by listing explicitly the number of inputs each device has.
--- drivers/hwmon/tmp421.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/hwmon/tmp421.c +7 -7
@@ -61,9 +61,9 @@ static const u8 TMP421_TEMP_LSB[4] = {#define TMP423_DEVICE_ID 0x23static const struct i2c_device_id tmp421_id[] = { - {"tmp421" , tmp421 }, - {"tmp422" , tmp422 }, - {"tmp423" , tmp423 }, + {"tmp421" ,2 }, + {"tmp422" ,3 }, + {"tmp423" ,4 }, { } };MODULE_DEVICE_TABLE (i2c, tmp421_id);
@@ -73,7 +73,7 @@ struct tmp421_data {struct mutex update_lock;char valid;unsigned long last_updated; -int kind; +int channels;u8 config;s16 temp[4 ]; };
@@ -109,7 +109,7 @@ static struct tmp421_data *tmp421_update data->config =i2c_smbus_read_byte_data (client,TMP421_CONFIG_REG_1 ); -for (i =0 ; i <= data->kind; i++) { +for (i =0 ; i < data->channels; i++) { data->temp[i] =i2c_smbus_read_byte_data (client,TMP421_TEMP_MSB [i]) <<8 ; data->temp[i] |= i2c_smbus_read_byte_data(client,
@@ -168,7 +168,7 @@ static mode_t tmp421_is_visible(struct k devattr = container_of(a, struct device_attribute, attr); index =to_sensor_dev_attr (devattr)->index; -if (data->kind > index) +if (index < data->channels)return a->mode;return 0 ;
@@ -273,7 +273,7 @@ static int tmp421_probe(struct i2c_clieni2c_set_clientdata (client, data);mutex_init (&data->update_lock); - data->kind = id->driver_data; + data->channels = id->driver_data; err =tmp421_init_client (client);if (err)
PATCH 63/123 hwmon: (tmp421) Fix temperature conversions
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Jean Delvare <[email protected]>
commit a44908d742a577fb5ccb9a8c082326d4cea234c2 upstream.
The low bits of temperature registers are status bits, they must be masked out before converting the register values to temperatures.
--- drivers/hwmon/tmp421.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hwmon/tmp421.c +4 -2
@@ -80,14 +80,16 @@ struct tmp421_data {static int temp_from_s16 (s16 reg) { -int temp = reg; +/* Mask out status bits */ +int temp = reg & ~0xf ;return (temp *1000 +128 ) /256 ; }static int temp_from_u16 (u16 reg) { -int temp = reg; +/* Mask out status bits */ +int temp = reg & ~0xf ;/* Add offset for extended temperature range. */ temp -=64 *256 ;
PATCH 62/123 gpio: cs5535-gpio: fix input direction
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Ben Gardner <[email protected]>
commit a8a5164c297c16c2f4be776714ca47dba252cc3d upstream.
The cs5535-gpio driver's get() function was returning the output value. This means that the GPIO pins would never work as an input, even if configured as an input.
The driver should return the READ_BACK value, which is the sensed line value. To make that work when the direction is 'output', INPUT_ENABLE needs to be set.
In addition, the driver was not disabling OUTPUT_ENABLE when the direction is set to 'input'. That would cause the GPIO to continue to drive the pin if the direction was ever set to output.
This issue was noticed when attempting to use the gpiolib driver to read an external input. I had previously been using the char/cs5535-gpio driver.
--- drivers/gpio/cs5535-gpio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpio/cs5535-gpio.c +3 -1
@@ -154,7 +154,7 @@ static int chip_gpio_request(struct gpiostatic int chip_gpio_get (struct gpio_chip *chip,unsigned offset) { -return cs5535_gpio_isset (offset,GPIO_OUTPUT_VAL ); +return cs5535_gpio_isset (offset,GPIO_READ_BACK ); }static void chip_gpio_set (struct gpio_chip *chip,unsigned offset,int val)
@@ -172,6 +172,7 @@ static int chip_direction_input(struct gspin_lock_irqsave (&chip->lock, flags);__cs5535_gpio_set (chip, offset,GPIO_INPUT_ENABLE ); +__cs5535_gpio_clear (chip, offset,GPIO_OUTPUT_ENABLE );spin_unlock_irqrestore (&chip->lock, flags);return 0 ;
@@ -184,6 +185,7 @@ static int chip_direction_output(structspin_lock_irqsave (&chip->lock, flags); +__cs5535_gpio_set (chip, offset,GPIO_INPUT_ENABLE );__cs5535_gpio_set (chip, offset,GPIO_OUTPUT_ENABLE );if (val)__cs5535_gpio_set (chip, offset,GPIO_OUTPUT_VAL );
PATCH 61/123 gpiolib: Actually set output state in wm831x_gpio_direction_output()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Mark Brown <[email protected]>
commit 3383d23d86791503559cb87837491af37469d9e5 upstream.
wm831x_gpio_direction_output() ignored the state passed into it.
--- drivers/gpio/wm831x-gpio.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-)
drivers/gpio/wm831x-gpio.c +15 -7
@@ -60,23 +60,31 @@ static int wm831x_gpio_get(struct gpio_creturn 0 ; } -static int wm831x_gpio_direction_out (struct gpio_chip *chip, -unsigned offset,int value) +static void wm831x_gpio_set (struct gpio_chip *chip,unsigned offset,int value) {struct wm831x_gpio *wm831x_gpio =to_wm831x_gpio (chip);struct wm831x *wm831x = wm831x_gpio->wm831x; -return wm831x_set_bits (wm831x,WM831X_GPIO1_CONTROL + offset, -WM831X_GPN_DIR |WM831X_GPN_TRI ,0 ); +wm831x_set_bits (wm831x,WM831X_GPIO_LEVEL ,1 << offset, + value << offset); } -static void wm831x_gpio_set (struct gpio_chip *chip,unsigned offset,int value) +static int wm831x_gpio_direction_out (struct gpio_chip *chip, +unsigned offset,int value) {struct wm831x_gpio *wm831x_gpio =to_wm831x_gpio (chip);struct wm831x *wm831x = wm831x_gpio->wm831x; +int ret; -wm831x_set_bits (wm831x,WM831X_GPIO_LEVEL ,1 << offset, - value << offset); + ret =wm831x_set_bits (wm831x,WM831X_GPIO1_CONTROL + offset, +WM831X_GPN_DIR |WM831X_GPN_TRI ,0 ); +if (ret <0 ) +return ret; + +/* Can only set GPIO state once it's in output mode */ +wm831x_gpio_set (chip, offset, value); + +return 0 ; }static int wm831x_gpio_to_irq (struct gpio_chip *chip,unsigned offset)
PATCH 59/123 p54usb: Add the USB ID for Belkin (Accton) FD7050E ver 1010ec
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Moine?= <[email protected]>
commit 5b9a919a97ac8bdda8020c9b366491b5b91b196e upstream.
Yet another USB ID.
--- drivers/net/wireless/p54/p54usb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/p54/p54usb.c +1 -0
@@ -60,6 +60,7 @@ static struct usb_device_id p54u_table[] {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ + {USB_DEVICE(0x083a, 0xf503)}, /* Accton FD7050E ver 1010ec */ {USB_DEVICE(0x0846, 0x4240)}, /* Netgear WG111 (v2) */ {USB_DEVICE(0x0915, 0x2000)}, /* Cohiba Proto board */ {USB_DEVICE(0x0915, 0x2002)}, /* Cohiba Proto board */
PATCH 60/123 p54pci: handle dma mapping errors
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Christian Lamparter <[email protected]>
commit 288c8ce8047695fd8872dd5db3ef21a9679c402f upstream.
This patch adds error-paths to handle pci_dma_mapping errors.
--- drivers/net/wireless/p54/p54pci.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
drivers/net/wireless/p54/p54pci.c +16 -2
@@ -157,6 +157,14 @@ static void p54p_refill_rx_ring(struct iskb_tail_pointer (skb), priv->common.rx_mtu +32 , PCI_DMA_FROMDEVICE); + +if (pci_dma_mapping_error (priv->pdev, mapping)) { +dev_kfree_skb_any (skb); +dev_err (&priv->pdev->dev, +"RX DMA Mapping error\n" ); +break ; + } + desc->host_addr =cpu_to_le32 (mapping); desc->device_addr =0 ;// FIXME: necessary? desc->len =cpu_to_le16 (priv->common.rx_mtu +32 );
@@ -325,14 +333,20 @@ static void p54p_tx(struct ieee80211_hwu32 device_idx, idx, i;spin_lock_irqsave (&priv->lock, flags); - device_idx =le32_to_cpu (ring_control->device_idx[1 ]); idx =le32_to_cpu (ring_control->host_idx[1 ]); i = idx %ARRAY_SIZE (ring_control->tx_data); - priv->tx_buf_data[i] = skb; mapping =pci_map_single (priv->pdev, skb->data, skb->len,PCI_DMA_TODEVICE ); +if (pci_dma_mapping_error (priv->pdev, mapping)) { +spin_unlock_irqrestore (&priv->lock, flags); +p54_free_skb (dev, skb); +dev_err (&priv->pdev->dev,"TX DMA mapping error\n" ); +return ; + } + priv->tx_buf_data[i] = skb; + desc = &ring_control->tx_data[i]; desc->host_addr =cpu_to_le32 (mapping); desc->device_addr = ((struct p54_hdr *)skb->data)->req_id;
PATCH 57/123 USB: serial: sierra driver indat_callback fix
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Elina Pasheva <[email protected]>
commit b87c6e86dac1bb5222279cc8ff7e09529e1c4ed9 upstream.
A crash has been reported with sierra driver on disconnect with Ubuntu/Lucid distribution based on kernel-2.6.32.
The cause of the crash was determined as "NULL tty pointer was being referenced" and the NULL pointer was passed by sierra_indat_callback().
This patch modifies sierra_indat_callback() function to check for NULL tty structure pointer. This modification prevents a crash from happening when the device is disconnected.
This patch fixes the bug reported in Launchpad:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/511157
--- drivers/usb/serial/sierra.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/usb/serial/sierra.c +10 -7
@@ -604,14 +604,17 @@ static void sierra_indat_callback(struct }else {if (urb->actual_length) { tty =tty_port_tty_get (&port->port); +if (tty) { +tty_buffer_request_room (tty, + urb->actual_length); +tty_insert_flip_string (tty, data, + urb->actual_length); +tty_flip_buffer_push (tty); -tty_buffer_request_room (tty, urb->actual_length); -tty_insert_flip_string (tty, data, urb->actual_length); -tty_flip_buffer_push (tty); - -tty_kref_put (tty); -usb_serial_debug_data (debug, &port->dev, __func__, - urb->actual_length, data); +tty_kref_put (tty); +usb_serial_debug_data (debug, &port->dev, + __func__, urb->actual_length, data); + } }else {dev_dbg (&port->dev,"%s: empty read urb" " received\n" , __func__);
PATCH 58/123 USB: fix I2C API usage in ohci-pnx4008.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Luotao Fu <[email protected]>
commit 8740cc7d0c532e098cc428251c08befd14f087d8 upstream.
i2c_board_info doesn't contain a member called name. i2c_register_client call does not exist.
--- drivers/usb/host/ohci-pnx4008.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/host/ohci-pnx4008.c +3 -3
@@ -327,7 +327,7 @@ static int __devinit usb_hcd_pnx4008_pro } i2c_adap =i2c_get_adapter (2 );memset (&i2c_info,0 ,sizeof (struct i2c_board_info )); -strlcpy (i2c_info.name,"isp1301_pnx" ,I2C_NAME_SIZE ); +strlcpy (i2c_info.type,"isp1301_pnx" ,I2C_NAME_SIZE ); isp1301_i2c_client =i2c_new_probed_device (i2c_adap, &i2c_info, normal_i2c);i2c_put_adapter (i2c_adap);
@@ -411,7 +411,7 @@ out3: out2:clk_put (usb_clk); out1: -i2c_unregister_client (isp1301_i2c_client); +i2c_unregister_device (isp1301_i2c_client); isp1301_i2c_client =NULL ; out_i2c_driver:i2c_del_driver (&isp1301_driver);
@@ -430,7 +430,7 @@ static int usb_hcd_pnx4008_remove(structpnx4008_unset_usb_bits ();clk_disable (usb_clk);clk_put (usb_clk); -i2c_unregister_client (isp1301_i2c_client); +i2c_unregister_device (isp1301_i2c_client); isp1301_i2c_client =NULL ;i2c_del_driver (&isp1301_driver);
PATCH 56/123 serial: imx: fix NULL dereference Oops when pdata == NULL
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Baruch Siach <[email protected]>
commit bbcd18d1b37413d25eaf4580682b1b8e4a09ff5e upstream.
The platform code doesn't have to provide platform data to get sensible default behaviour from the imx serial driver.
This patch does not handle NULL dereference in the IrDA case, which still requires a valid platform data pointer (in imx_startup()/imx_shutdown()), since I don't know whether there is a sensible default behaviour, or should the operation just fail cleanly.
--- drivers/serial/imx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/serial/imx.c +3 -3
@@ -1279,7 +1279,7 @@ static int serial_imx_probe(struct platf sport->use_irda =1 ;#endif -if (pdata->init) { +if (pdata && pdata->init) { ret = pdata->init (pdev);if (ret) goto clkput;
@@ -1292,7 +1292,7 @@ static int serial_imx_probe(struct platfreturn 0 ; deinit: -if (pdata->exit) +if (pdata && pdata->exit) pdata->exit (pdev); clkput:clk_put (sport->clk);
@@ -1321,7 +1321,7 @@ static int serial_imx_remove(struct platclk_disable (sport->clk); -if (pdata->exit) +if (pdata && pdata->exit) pdata->exit (pdev);iounmap (sport->port.membase);
PATCH 55/123 tty: Fix the ldisc hangup race
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Alan Cox <[email protected]>
commit 638b9648ab51c9c549ff5735d3de519ef6199df3 upstream.
This was noticed by Matthias Urlichs and he proposed a fix. This patch does the fixing a different way to avoid introducing several new race conditions into the code.
The problem case is TTY_DRIVER_RESET_TERMIOS = 0. In that case while we abort the ldisc change, the hangup processing has not cleaned up and restarted the ldisc either.
We can't restart the ldisc stuff in the set_ldisc as we don't know what the hangup did and may touch stuff we shouldn't as we are no longer supposed to influence the tty at that point in case it has been re-opened before we get rescheduled.
Instead do it the simple way. Always re-init the ldisc on the hangup, but use TTY_DRIVER_RESET_TERMIOS to indicate that we should force N_TTY.
--- drivers/char/tty_ldisc.c | 50 ++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 20 deletions(-)
drivers/char/tty_ldisc.c +30 -20
@@ -706,12 +706,13 @@ static void tty_reset_termios(struct tty/** * tty_ldisc_reinit - reinitialise the tty ldisc * @tty: tty to reinit +* @ldisc: line discipline to reinitialize * -* Switch the tty back to N_TTY line discipline and leave the -* ldisc state closed +* Switch the tty to a line discipline and leave the ldisc +* state closed */ -static void tty_ldisc_reinit (struct tty_struct *tty) +static void tty_ldisc_reinit (struct tty_struct *tty,int ldisc) {struct tty_ldisc *ld;
@@ -721,10 +722,10 @@ static void tty_ldisc_reinit(struct tty_/* * Switch the line discipline back */ - ld =tty_ldisc_get (N_TTY ); + ld =tty_ldisc_get (ldisc);BUG_ON (IS_ERR (ld));tty_ldisc_assign (tty, ld); -tty_set_termios_ldisc (tty,N_TTY ); +tty_set_termios_ldisc (tty, ldisc); }/**
@@ -745,6 +746,8 @@ static void tty_ldisc_reinit(struct tty_void tty_ldisc_hangup (struct tty_struct *tty) {struct tty_ldisc *ld; +int reset = tty->driver->flags &TTY_DRIVER_RESET_TERMIOS ; +int err =0 ;/* * FIXME! What are the locking issues here? This may me overdoing
@@ -772,25 +775,32 @@ void tty_ldisc_hangup(struct tty_structwake_up_interruptible_poll (&tty->read_wait,POLLIN );/* * Shutdown the current line discipline, and reset it to -* N_TTY. +* N_TTY if need be. +* +* Avoid racing set_ldisc or tty_ldisc_release */ -if (tty->driver->flags &TTY_DRIVER_RESET_TERMIOS ) { -/* Avoid racing set_ldisc or tty_ldisc_release */ -mutex_lock (&tty->ldisc_mutex); -tty_ldisc_halt (tty); -if (tty->ldisc) {/* Not yet closed */ -/* Switch back to N_TTY */ -tty_ldisc_reinit (tty); -/* At this point we have a closed ldisc and we want to -reopen it. We could defer this to the next open but -it means auditing a lot of other paths so this is -a FIXME */ +mutex_lock (&tty->ldisc_mutex); +tty_ldisc_halt (tty); +/* At this point we have a closed ldisc and we want to +reopen it. We could defer this to the next open but +it means auditing a lot of other paths so this is +a 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 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 );WARN_ON (tty_ldisc_open (tty, tty->ldisc)); -tty_ldisc_enable (tty); } -mutex_unlock (&tty->ldisc_mutex); -tty_reset_termios (tty); +tty_ldisc_enable (tty); } +mutex_unlock (&tty->ldisc_mutex); +if (reset) +tty_reset_termios (tty); }/**
PATCH 52/123 driver-core: fix race condition in get_device_parent()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Tejun Heo <[email protected]>
commit 77d3d7c1d561f49f755d7390f0764dff90765974 upstream.
sysfs is creating several devices in cuse class concurrently and with CONFIG_SYSFS_DEPRECATED turned off, it triggers the following oops.
BUG: unable to handle kernel NULL pointer dereference at 0000000000000038 IP: [<ffffffff81158b0a>] sysfs_addrm_start+0x4a/0xf0 PGD 75bb067 PUD 75be067 PMD 0 Oops: 0000 [#1] PREEMPT SMP last sysfs file: /sys/devices/system/cpu/cpu7/topology/core_siblings CPU 1 Modules linked in: cuse fuse Pid: 4737, comm: osspd Not tainted 2.6.31-work #77 RIP: 0010:[<ffffffff81158b0a>] [<ffffffff81158b0a>] sysfs_addrm_start+0x4a/0xf0 RSP: 0018:ffff88000042f8f8 EFLAGS: 00010296 RAX: ffff88000042ffd8 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffff880007eef660 RDI: 0000000000000001 RBP: ffff88000042f918 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: ffffffff81158b0a R12: ffff88000042f928 R13: 00000000fffffff4 R14: 0000000000000000 R15: ffff88000042f9a0 FS: 00007fe93905a950(0000) GS:ffff880008600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000038 CR3: 00000000077c9000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process osspd (pid: 4737, threadinfo ffff88000042e000, task ffff880007eef040) Stack: ffff880005da10e8 0000000011cc8d6e ffff88000042f928 ffff880003d28a28 <0> ffff88000042f988 ffffffff811592d7 0000000000000000 0000000000000000 <0> 0000000000000000 0000000000000000 ffff88000042f958 0000000011cc8d6e Call Trace: [<ffffffff811592d7>] create_dir+0x67/0xe0 [<ffffffff811593a8>] sysfs_create_dir+0x58/0xb0 [<ffffffff8128ca7c>] ? kobject_add_internal+0xcc/0x220 [<ffffffff812942e1>] ? vsnprintf+0x3c1/0xb90 [<ffffffff8128cab7>] kobject_add_internal+0x107/0x220 [<ffffffff8128cd37>] kobject_add_varg+0x47/0x80 [<ffffffff8128ce53>] kobject_add+0x53/0x90 [<ffffffff81357d84>] device_add+0xd4/0x690 [<ffffffff81356c2b>] ? dev_set_name+0x4b/0x70 [<ffffffffa001a884>] cuse_process_init_reply+0x2b4/0x420 [cuse] ...
The problem is that kobject_add_internal() first adds a kobject to the kset and then try to create sysfs directory for it. If the creation fails, it remove the kobject from the kset. get_device_parent() accesses class_dirs kset while only holding class_dirs.list_lock to see whether the cuse class dir exists. But when it exists, it may not have finished initialization yet or may fail and get removed soon. In the above case, the former happened so the second one ends up trying to create subdirectory under NULL sysfs_dirent.
Fix it by grabbing a mutex in get_device_parent().
--- drivers/base/core.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/base/core.c +11 -2
@@ -607,6 +607,7 @@ static struct kobject *get_device_parentint retval;if (dev->class) { +static DEFINE_MUTEX (gdp_mutex);struct kobject *kobj =NULL ;struct kobject *parent_kobj;struct kobject *k;
@@ -623,6 +624,8 @@ static struct kobject *get_device_parentelse parent_kobj = &parent->kobj; +mutex_lock (&gdp_mutex); +/* find our class-directory at the parent and reference it */ spin_lock (&dev->class->p->class_dirs.list_lock);list_for_each_entry (k, &dev->class->p->class_dirs.list, entry)
@@ -631,20 +634,26 @@ static struct kobject *get_device_parentbreak ; }spin_unlock (&dev->class->p->class_dirs.list_lock); -if (kobj) +if (kobj) { +mutex_unlock (&gdp_mutex);return kobj; + }/* or create a new class-directory at the parent device */ k =kobject_create (); -if (!k) +if (!k) { +mutex_unlock (&gdp_mutex);return NULL ; + } k->kset = &dev->class->p->class_dirs; retval =kobject_add (k, parent_kobj,"%s" , dev->class->name);if (retval <0 ) { +mutex_unlock (&gdp_mutex);kobject_put (k);return NULL ; }/* do not emit an uevent for this simple "glue" directory */ +mutex_unlock (&gdp_mutex);return k; }
PATCH 53/123 Driver-Core: devtmpfs - reset inode permissions before unlinking
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Kay Sievers <[email protected]>
commit 5e31d76f2817bd50258a092a7c5b15b3006fd61c upstream.
Before unlinking the inode, reset the current permissions of possible references like hardlinks, so granted permissions can not be retained across the device lifetime by creating hardlinks, in the unusual case that there is a user-writable directory on the same filesystem.
--- drivers/base/devtmpfs.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/base/devtmpfs.c +13 -0
@@ -301,6 +301,19 @@ int devtmpfs_delete_node(struct device *if (dentry->d_inode) { err =vfs_getattr (nd.path.mnt, dentry, &stat);if (!err &&dev_mynode (dev, dentry->d_inode, &stat)) { +struct iattr newattrs; +/* +* before unlinking this node, reset permissions +* of possible references like hardlinks +*/ + newattrs.ia_uid =0 ; + newattrs.ia_gid =0 ; + newattrs.ia_mode = stat.mode & ~0777 ; + newattrs.ia_valid = +ATTR_UID |ATTR_GID |ATTR_MODE ; +mutex_lock (&dentry->d_inode->i_mutex); +notify_change (dentry, &newattrs); +mutex_unlock (&dentry->d_inode->i_mutex); err =vfs_unlink (nd.path.dentry->d_inode, dentry);if (!err || err == -ENOENT )
PATCH 51/123 ASoC: fix ak4104 register array access
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Daniel Mack <[email protected]>
commit e555317c083fda01f516d2153589e82514e20e70 upstream.
Don't touch the variable 'reg' to construct the value for the actual SPI transport. This variable is again used to access the driver's register cache, and so random memory is overwritten.
Compute the value in-place instead.
--- sound/soc/codecs/ak4104.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
sound/soc/codecs/ak4104.c +2 -4
@@ -90,12 +90,10 @@ static int ak4104_spi_write(struct snd_sif (reg >= codec->reg_cache_size)return -EINVAL ; - reg &=AK4104_REG_MASK ; - reg |=AK4104_WRITE ; -/* only write to the hardware if value has changed */ if (cache[reg] != value) { -u8 tmp[2 ] = { reg, value }; +u8 tmp[2 ] = { (reg &AK4104_REG_MASK ) |AK4104_WRITE , value }; +if (spi_write (spi, tmp,sizeof (tmp))) {dev_err (&spi->dev,"SPI write failed\n" );return -EIO ;
PATCH 50/123 ALSA: hda-intel: Add position_fix quirk for ASUS M2V-MX SE.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Paul Menzel <[email protected]>
commit 0708cc582f0fe2578eaab722841caf2b4f8cfe37 upstream.
With PulseAudio and an application accessing an input device like gnome-volume-manager both have high CPU load as reported in [1].
Loading snd-hda-intel with position_fix=1 fixes this issue. Therefore add a quirk for ASUS M2V-MX SE.
The only downside is, when now exiting for example MPlayer when it is playing an audio file a high pitched sound is outputted by the speaker.
$ lspci -vvnn | grep -A10 Audio 20:01.0 Audio device [0403]: VIA Technologies, Inc. VT1708/A [Azalia HDAC] (VIA High Definition Audio Controller) [1106:3288] (rev 10) Subsystem: ASUSTeK Computer Inc. Device [1043:8290] Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 0, Cache Line Size: 64 bytes Interrupt: pin A routed to IRQ 17 Region 0: Memory at fbffc000 (64-bit, non-prefetchable) [size=16K] Capabilities: <access denied> Kernel driver in use: HDA Intel
--- sound/pci/hda/hda_intel.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/hda_intel.c +1 -0
@@ -2263,6 +2263,7 @@ static struct snd_pci_quirk position_fixSND_PCI_QUIRK (0x1028 ,0x01de ,"Dell Precision 390" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1028 ,0x01f6 ,"Dell Latitude 131L" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x103c ,0x306d ,"HP dv3" ,POS_FIX_LPIB ), +SND_PCI_QUIRK (0x1106 ,0x3288 ,"ASUS M2V-MX SE" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1043 ,0x813d ,"ASUS P5AD2" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1462 ,0x1002 ,"MSI Wind U115" ,POS_FIX_LPIB ), SND_PCI_QUIRK(0x1565, 0x820f, "Biostar Microtech", POS_FIX_LPIB),
PATCH 49/123 ALSA: hda: Use LPIB for a Biostar Microtech board
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Daniel T Chen <[email protected]>
commit 0321b69569eadbc13242922925a4316754c5f744 upstream.
The OR has verified that position_fix=1 is necessary to work around errors on his machine.
--- sound/pci/hda/hda_intel.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/hda_intel.c +1 -0
@@ -2265,6 +2265,7 @@ static struct snd_pci_quirk position_fixSND_PCI_QUIRK (0x103c ,0x306d ,"HP dv3" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1043 ,0x813d ,"ASUS P5AD2" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1462 ,0x1002 ,"MSI Wind U115" ,POS_FIX_LPIB ), + SND_PCI_QUIRK(0x1565, 0x820f, "Biostar Microtech", POS_FIX_LPIB), {} };
PATCH 47/123 thinkpad-acpi: fix ALSA callback return status
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Henrique de Moraes Holschuh <[email protected]>
commit 88cc83772a3c7756b9f2b4ba835545ad90a08409 upstream.
Clemens Ladisch reports that thinkpad-acpi improperly implements the ALSA API, and always returns 0 for success for the "put" callbacks while the API requires it to return "1" when the control value has been changed in the hardware/firmware.
Rework the volume subdriver to be able to properly implement the ALSA API. Based on a patch by Clemens Ladisch <[email protected]>.
This fix is also needed on 2.6.33.
--- drivers/platform/x86/thinkpad_acpi.c | 39 ++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 10 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +29 -10
@@ -6522,7 +6522,8 @@ static int volume_set_status(const u8 streturn volume_set_status_ec (status); } -static int volume_set_mute_ec (const bool mute) +/* returns < 0 on error, 0 on no change, 1 on change */ +static int __volume_set_mute_ec (const bool mute) {int rc;u8 s, n;
@@ -6537,22 +6538,37 @@ static int volume_set_mute_ec(const bool n = (mute) ? s |TP_EC_AUDIO_MUTESW_MSK : s & ~TP_EC_AUDIO_MUTESW_MSK ; -if (n != s) +if (n != s) { rc =volume_set_status_ec (n); +if (!rc) + rc =1 ; + } unlock:mutex_unlock (&volume_mutex);return rc; } +static int volume_alsa_set_mute (const bool mute) +{ +dbg_printk (TPACPI_DBG_MIXER ,"ALSA: trying to %smute\n" , + (mute) ?"" :"un" ); +return __volume_set_mute_ec (mute); +} +static int volume_set_mute (const bool mute) { +int rc; +dbg_printk (TPACPI_DBG_MIXER ,"trying to %smute\n" , (mute) ?"" :"un" ); -return volume_set_mute_ec (mute); + + rc =__volume_set_mute_ec (mute); +return (rc <0 ) ? rc :0 ; } -static int volume_set_volume_ec (const u8 vol) +/* returns < 0 on error, 0 on no change, 1 on change */ +static int __volume_set_volume_ec (const u8 vol) {int rc;u8 s, n;
@@ -6569,19 +6585,22 @@ static int volume_set_volume_ec(const u8 n = (s & ~TP_EC_AUDIO_LVL_MSK ) | vol; -if (n != s) +if (n != s) { rc =volume_set_status_ec (n); +if (!rc) + rc =1 ; + } unlock:mutex_unlock (&volume_mutex);return rc; } -static int volume_set_volume (const u8 vol) +static int volume_alsa_set_volume (const u8 vol) {dbg_printk (TPACPI_DBG_MIXER , -"trying to set volume level to %hu\n" , vol); -return volume_set_volume_ec (vol); +"ALSA: trying to set volume level to %hu\n" , vol); +return __volume_set_volume_ec (vol); }static void volume_alsa_notify_change (void )
@@ -6628,7 +6647,7 @@ static int volume_alsa_vol_get(struct snstatic int volume_alsa_vol_put (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_value *ucontrol) { -return volume_set_volume (ucontrol->value.integer.value[0 ]); +return volume_alsa_set_volume (ucontrol->value.integer.value[0 ]); }#define volume_alsa_mute_info snd_ctl_boolean_mono_info
@@ -6651,7 +6670,7 @@ static int volume_alsa_mute_get(struct sstatic int volume_alsa_mute_put (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_value *ucontrol) { -return volume_set_mute (!ucontrol->value.integer.value[0 ]); +return volume_alsa_set_mute (!ucontrol->value.integer.value[0 ]); }static struct snd_kcontrol_new volume_alsa_control_vol__devinitdata = {
PATCH 48/123 ALSA: hda: Use LPIB for Dell Latitude 131L
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Daniel T Chen <[email protected]>
commit 9919c7619c52d01e89103bca405cc3d4a2b1ac31 upstream.
The OR has verified that position_fix=1 is necessary to work around errors on his machine.
--- sound/pci/hda/hda_intel.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/hda_intel.c +1 -0
@@ -2261,6 +2261,7 @@ static int azx_dev_free(struct snd_devicstatic struct snd_pci_quirk position_fix_list[]__devinitdata = {SND_PCI_QUIRK (0x1028 ,0x01cc ,"Dell D820" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1028 ,0x01de ,"Dell Precision 390" ,POS_FIX_LPIB ), +SND_PCI_QUIRK (0x1028 ,0x01f6 ,"Dell Latitude 131L" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x103c ,0x306d ,"HP dv3" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1043 ,0x813d ,"ASUS P5AD2" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1462 ,0x1002 ,"MSI Wind U115" ,POS_FIX_LPIB ),
PATCH 46/123 ALSA: USB MIDI support for Access Music VirusTI
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Sebastien Alaiwan <[email protected]>
commit d39e82db73eb876c60d00f00219d767b3be30307 upstream.
Here's a patch that adds MIDI support through USB for one of the Access Music synths, the VirusTI.
The synth uses standard USBMIDI protocol on its USB interface 3, although it does signal "vendor specific" class. A magic string has to be sent on interface 3 to enable the sending of MIDI from the synth (this string was found by sniffing usb communication of the Windows driver). This is all my patch does, and it works on my computer.
Please note that the synth can also do standard usb audio I/O on its interfaces 2&3, which already works with the current snd-usb-audio driver, except for the audio input from the synth. I'm going to work on it when I have some time.
--- sound/usb/usbaudio.c | 32 ++++++++++++++++++++++++++++++++ sound/usb/usbmidi.c | 6 ++++++ sound/usb/usbquirks.h | 27 +++++++++++++++++++++++++++ 3 files changed, 65 insertions(+)
sound/usb/usbaudio.c +32 -0
@@ -3327,6 +3327,32 @@ static int snd_usb_cm6206_boot_quirk(str }/* +* This call will put the synth in "USB send" mode, i.e it will send MIDI +* messages through USB (this is disabled at startup). The synth will +* acknowledge by sending a sysex on endpoint 0x85 and by displaying a USB +* sign on its LCD. Values here are chosen based on sniffing USB traffic +* under Windows. +*/ +static int snd_usb_accessmusic_boot_quirk (struct usb_device *dev) +{ +int err, actual_length; + +/* "midi send" enable */ +static const u8 seq[] = {0x4e ,0x73 ,0x52 ,0x01 }; + +void *buf =kmemdup (seq,ARRAY_SIZE (seq),GFP_KERNEL ); +if (!buf) +return -ENOMEM ; + err =usb_interrupt_msg (dev,usb_sndintpipe (dev,0x05 ), buf, +ARRAY_SIZE (seq), &actual_length,1000 ); +kfree (buf); +if (err <0 ) +return err; + +return 0 ; +} + +/* * Setup quirks */ #define AUDIOPHILE_SET 0x01/* if set, parse device_setup */
@@ -3624,6 +3650,12 @@ static void *snd_usb_audio_probe(struct goto __err_val; } +/* Access Music VirusTI Desktop */ +if (id ==USB_ID (0x133e ,0x0815 )) { +if (snd_usb_accessmusic_boot_quirk (dev) <0 ) + goto __err_val; + } +/* * found a config. now register to ALSA */
sound/usb/usbmidi.c +6 -0
@@ -1419,6 +1419,12 @@ static struct port_info {EXTERNAL_PORT (0x086a ,0x0001 ,8 ,"%s Broadcast" ),EXTERNAL_PORT (0x086a ,0x0002 ,8 ,"%s Broadcast" ),EXTERNAL_PORT (0x086a ,0x0003 ,4 ,"%s Broadcast" ), +/* Access Music Virus TI */ +EXTERNAL_PORT (0x133e ,0x0815 ,0 ,"%s MIDI" ), +PORT_INFO (0x133e ,0x0815 ,1 ,"%s Synth" ,0 , +SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC | +SNDRV_SEQ_PORT_TYPE_HARDWARE | + SNDRV_SEQ_PORT_TYPE_SYNTHESIZER), };static struct port_info *find_port_info (struct snd_usb_midi * umidi,int number)
sound/usb/usbquirks.h +27 -0
@@ -2073,6 +2073,33 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, +/* Access Music devices */ +{ +/* VirusTI Desktop */ + USB_DEVICE_VENDOR_SPEC(0x133e, 0x0815), + .driver_info = (unsigned long ) &(const struct snd_usb_audio_quirk ) { + .ifnum =QUIRK_ANY_INTERFACE , + .type =QUIRK_COMPOSITE , + .data = &(const struct snd_usb_audio_quirk []) { + { + .ifnum =3 , + .type =QUIRK_MIDI_FIXED_ENDPOINT , + .data = &(const struct snd_usb_midi_endpoint_info ) { + .out_cables =0x0003 , + .in_cables =0x0003 + } + }, + { + .ifnum =4 , + .type =QUIRK_IGNORE_INTERFACE + }, + { + .ifnum =-1 + } + } + } +}, + /* */ {/* aka. Serato Scratch Live DJ Box */
PATCH 45/123 ALSA: usb-audio: reduce MIDI packet size to work around broken firmware
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Clemens Ladisch <[email protected]>
commit f167e1d073278fe231bbdd5d6c24fb9d091aa544 upstream.
Extend the list of devices whose firmware does not expect more than one USB MIDI packet in one USB packet.
bug report: https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3752
--- sound/usb/usbmidi.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
sound/usb/usbmidi.c +15 -3
@@ -1162,10 +1162,22 @@ static int snd_usbmidi_out_endpoint_crea pipe =usb_sndintpipe (umidi->dev, ep_info->out_ep); else pipe =usb_sndbulkpipe (umidi->dev, ep_info->out_ep); -if (umidi->usb_id ==USB_ID (0x0a92 ,0x1020 ))/* ESI M4U */ - ep->max_transfer =4 ; -else +switch (umidi->usb_id) { +default : ep->max_transfer =usb_maxpacket (umidi->dev, pipe,1 ); +break ; +/* +* Various chips declare a packet size larger than 4 bytes, but +* do not actually work with larger packets: +*/ +case USB_ID (0x0a92 ,0x1020 ):/* ESI M4U */ +case USB_ID (0x1430 ,0x474b ):/* RedOctane GH MIDI INTERFACE */ +case USB_ID (0x15ca ,0x0101 ):/* Textech USB Midi Cable */ +case USB_ID (0x15ca ,0x1806 ):/* Textech USB Midi Cable */ +case USB_ID (0x1a86 ,0x752d ):/* QinHeng CH345 "USB2.0-MIDI" */ + ep->max_transfer =4 ; +break ; + }for (i =0 ; i <OUTPUT_URBS ; ++i) { buffer = usb_buffer_alloc(umidi->dev, ep->max_transfer, GFP_KERNEL,
PATCH 44/123 ALSA: pcm core - fix fifo_size channels interval check
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Jaroslav Kysela <[email protected]>
commit 3be522a9514f58e0596db34898a514df206cadc5 upstream.
--- sound/core/pcm_native.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/core/pcm_native.c +4 -4
@@ -315,10 +315,10 @@ int snd_pcm_hw_refine(struct snd_pcm_subif (!params->info) params->info = hw->info & ~SNDRV_PCM_INFO_FIFO_IN_FRAMES ;if (!params->fifo_size) { -if (snd_mask_min (¶ms->masks[SNDRV_PCM_HW_PARAM_FORMAT ]) == -snd_mask_max (¶ms->masks[SNDRV_PCM_HW_PARAM_FORMAT ]) && -snd_mask_min (¶ms->masks[SNDRV_PCM_HW_PARAM_CHANNELS ]) == -snd_mask_max (¶ms->masks[SNDRV_PCM_HW_PARAM_CHANNELS ])) { + m =hw_param_mask (params,SNDRV_PCM_HW_PARAM_FORMAT ); + i =hw_param_interval (params,SNDRV_PCM_HW_PARAM_CHANNELS ); +if (snd_mask_min (m) ==snd_mask_max (m) && +snd_interval_min (i) ==snd_interval_max (i)) { changed = substream->ops->ioctl (substream,SNDRV_PCM_IOCTL1_FIFO_SIZE , params);if (changed <0 )
PATCH 41/123 tracing: Fix ftrace_event_call alignment for use with gcc 4.5
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Jeff Mahoney <[email protected]>
commit 86c38a31aa7f2dd6e74a262710bf8ebf7455acc5 upstream.
GCC 4.5 introduces behavior that forces the alignment of structures to
use the largest possible value. The default value is 32 bytes, so if some structures are defined with a 4-byte alignment and others aren't declared with an alignment constraint at all - it will align at 32-bytes.
For things like the ftrace events, this results in a non-standard array. When initializing the ftrace subsystem, we traverse the _ftrace_events section and call the initialization callback for each event. When the structures are misaligned, we could be treating another part of the structure (or the zeroed out space between them) as a function pointer.
This patch forces the alignment for all the ftrace_event_call structures to 4 bytes.
Without this patch, the kernel fails to boot very early when built with gcc 4.5.
It's trivial to check the alignment of the members of the array, so it might be worthwhile to add something to the build system to do that automatically. Unfortunately, that only covers this case. I've asked one of the gcc developers about adding a warning when this condition is seen.
LKML-Reference: <[email protected]>
--- include/linux/syscalls.h | 6 ++++-- include/trace/ftrace.h | 3 ++- kernel/trace/trace.h | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-)
include/linux/syscalls.h +4 -2
@@ -132,7 +132,8 @@ struct perf_event_attr;#define SYSCALL_TRACE_ENTER_EVENT (sname) \ static const struct syscall_metadata __syscall_meta_##sname; \ - static struct ftrace_event_call event_enter_##sname; \ + static struct ftrace_event_call \ + __attribute__((__aligned__(4))) event_enter_##sname; \ static struct trace_event enter_syscall_print_##sname = { \ .trace = print_syscall_enter, \ }; \
@@ -154,7 +155,8 @@ struct perf_event_attr;#define SYSCALL_TRACE_EXIT_EVENT (sname) \ static const struct syscall_metadata __syscall_meta_##sname; \ - static struct ftrace_event_call event_exit_##sname; \ + static struct ftrace_event_call \ + __attribute__((__aligned__(4))) event_exit_##sname; \ static struct trace_event exit_syscall_print_##sname = { \ .trace = print_syscall_exit, \ }; \
include/trace/ftrace.h +2 -1
@@ -65,7 +65,8 @@ };#undef DEFINE_EVENT#define DEFINE_EVENT (template, name, proto, args) \ - static struct ftrace_event_call event_##name + static struct ftrace_event_call \ + __attribute__((__aligned__(4))) event_##name#undef DEFINE_EVENT_PRINT#define DEFINE_EVENT_PRINT (template, name, proto, args, print) \
kernel/trace/trace.h +2 -1
@@ -791,7 +791,8 @@ extern const char *__stop___trace_bprint#undef FTRACE_ENTRY#define FTRACE_ENTRY (call, struct_name, id, tstruct, print) \ - extern struct ftrace_event_call event_##call; + extern struct ftrace_event_call \ + __attribute__((__aligned__(4))) event_##call;#undef FTRACE_ENTRY_DUP#define FTRACE_ENTRY_DUP (call, struct_name, id, tstruct, print) \ FTRACE_ENTRY(call, struct_name, id, PARAMS(tstruct), PARAMS(print))
PATCH 42/123 ALSA: hda: Use 3stack quirk for Toshiba Satellite L40-10Q
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Daniel T Chen <[email protected]>
commit ba579eb7b30791751f556ee01905636cda50c864 upstream.
The OR has verified that the existing model=laptop-eapd quirk does not function correctly but instead needs model=3stack. Make this change so that manual corrections to module-init-tools file(s) are not required.
--- sound/pci/hda/patch_analog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_analog.c +1 -1
@@ -1008,7 +1008,7 @@ static struct snd_pci_quirk ad1986a_cfg_SND_PCI_QUIRK (0x1043 ,0x81cb ,"ASUS M2N" ,AD1986A_3STACK ),SND_PCI_QUIRK (0x1043 ,0x8234 ,"ASUS M2N" ,AD1986A_3STACK ),SND_PCI_QUIRK (0x10de ,0xcb84 ,"ASUS A8N-VM" ,AD1986A_3STACK ), -SND_PCI_QUIRK (0x1179 ,0xff40 ,"Toshiba" ,AD1986A_LAPTOP_EAPD ), +SND_PCI_QUIRK (0x1179 ,0xff40 ,"Toshiba Satellite L40-10Q" ,AD1986A_3STACK ),SND_PCI_QUIRK (0x144d ,0xb03c ,"Samsung R55" ,AD1986A_3STACK ),SND_PCI_QUIRK (0x144d ,0xc01e ,"FSC V2060" ,AD1986A_LAPTOP ), SND_PCI_QUIRK(0x144d, 0xc024, "Samsung P50", AD1986A_SAMSUNG_P50),
PATCH 39/123 oprofile/x86: fix msr access to reserved counters
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Robert Richter <[email protected]>
commit cfc9c0b450176a077205ef39092f0dc1a04e020a upstream.
During switching virtual counters there is access to perfctr msrs. If the counter is not available this fails due to an invalid address. This patch fixes this.
--- arch/x86/oprofile/op_model_amd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
arch/x86/oprofile/op_model_amd.c +4 -5
@@ -85,7 +85,7 @@ static void op_mux_switch_ctrl(struct op/* enable active counters */ for (i =0 ; i <NUM_COUNTERS ; ++i) {int virt =op_x86_phys_to_virt (i); -if (!counter_config[virt].enabled) +if (!reset_value[virt])continue ;rdmsrl (msrs->controls[i].addr, val); val &= model->reserved;
@@ -121,7 +121,8 @@ static void op_amd_setup_ctrs(struct op_/* setup reset_value */ for (i =0 ; i <NUM_VIRT_COUNTERS ; ++i) { -if (counter_config[i].enabled) +if (counter_config[i].enabled + && msrs->counters[op_x86_virt_to_phys (i)].addr) reset_value[i] = counter_config[i].count;else reset_value[i] =0 ;
@@ -146,9 +147,7 @@ static void op_amd_setup_ctrs(struct op_/* enable active counters */ for (i =0 ; i <NUM_COUNTERS ; ++i) {int virt =op_x86_phys_to_virt (i); -if (!counter_config[virt].enabled) -continue ; -if (!msrs->counters[i].addr) +if (!reset_value[virt])continue ;/* setup counter registers */
PATCH 38/123 oprofile/x86: use kzalloc() instead of kmalloc()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Robert Richter <[email protected]>
commit c17c8fbf349482e89b57d1b800e83e9f4cf40c47 upstream.
--- arch/x86/oprofile/nmi_int.c | 6 +++--- arch/x86/oprofile/op_model_amd.c | 4 ---- arch/x86/oprofile/op_model_p4.c | 6 ------ arch/x86/oprofile/op_model_ppro.c | 6 +----- 4 files changed, 4 insertions(+), 18 deletions(-)
arch/x86/oprofile/nmi_int.c +3 -3
@@ -159,7 +159,7 @@ static int nmi_setup_mux(void)for_each_possible_cpu (i) {per_cpu (cpu_msrs, i).multiplex = -kmalloc (multiplex_size,GFP_KERNEL ); +kzalloc (multiplex_size,GFP_KERNEL );if (!per_cpu (cpu_msrs, i).multiplex)return 0 ; }
@@ -304,11 +304,11 @@ static int allocate_msrs(void)int i;for_each_possible_cpu (i) { -per_cpu (cpu_msrs, i).counters =kmalloc (counters_size, +per_cpu (cpu_msrs, i).counters =kzalloc (counters_size,GFP_KERNEL );if (!per_cpu (cpu_msrs, i).counters)return 0 ; -per_cpu (cpu_msrs, i).controls =kmalloc (controls_size, +per_cpu (cpu_msrs, i).controls =kzalloc (controls_size,GFP_KERNEL );if (!per_cpu (cpu_msrs, i).controls)return 0 ;
arch/x86/oprofile/op_model_amd.c +0 -4
@@ -105,15 +105,11 @@ static void op_amd_fill_in_addresses(strfor (i =0 ; i <NUM_COUNTERS ; i++) {if (reserve_perfctr_nmi (MSR_K7_PERFCTR0 + i)) msrs->counters[i].addr =MSR_K7_PERFCTR0 + i; -else - msrs->counters[i].addr =0 ; }for (i =0 ; i <NUM_CONTROLS ; i++) {if (reserve_evntsel_nmi (MSR_K7_EVNTSEL0 + i)) msrs->controls[i].addr =MSR_K7_EVNTSEL0 + i; -else - msrs->controls[i].addr =0 ; } }
arch/x86/oprofile/op_model_p4.c +0 -6
@@ -394,12 +394,6 @@ static void p4_fill_in_addresses(structsetup_num_counters (); stag =get_stagger (); -/* initialize some registers */ -for (i =0 ; i < num_counters; ++i) - msrs->counters[i].addr =0 ; -for (i =0 ; i < num_controls; ++i) - msrs->controls[i].addr =0 ; -/* the counter & cccr registers we pay attention to */ for (i =0 ; i < num_counters; ++i) { addr = p4_counters[VIRT_CTR (stag, i)].counter_address;
arch/x86/oprofile/op_model_ppro.c +1 -5
@@ -37,15 +37,11 @@ static void ppro_fill_in_addresses(strucfor (i =0 ; i < num_counters; i++) {if (reserve_perfctr_nmi (MSR_P6_PERFCTR0 + i)) msrs->counters[i].addr =MSR_P6_PERFCTR0 + i; -else - msrs->counters[i].addr =0 ; }for (i =0 ; i < num_counters; i++) {if (reserve_evntsel_nmi (MSR_P6_EVNTSEL0 + i)) msrs->controls[i].addr =MSR_P6_EVNTSEL0 + i; -else - msrs->controls[i].addr =0 ; } }
@@ -57,7 +53,7 @@ static void ppro_setup_ctrs(struct op_x8int i;if (!reset_value) { - reset_value =kmalloc (sizeof (reset_value[0 ]) * num_counters, + reset_value =kzalloc (sizeof (reset_value[0 ]) * num_counters,GFP_ATOMIC );if (!reset_value)return ;
PATCH 36/123 oprofile: remove tracing build dependency
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Robert Richter <[email protected]>
commit 18b4a4d59e97e7ff13ee84b5bec79f3fc70a9f0a upstream.
The commit
1155de4 ring-buffer: Make it generally available
already made ring-buffer available without the TRACING option enabled. This patch removes the TRACING dependency from oprofile.
Fixes also oprofile configuration on ia64.
The patch also applies to the 2.6.32-stable kernel.
--- arch/Kconfig | 2 -- 1 file changed, 2 deletions(-)
arch/Kconfig +0 -2
@@ -6,8 +6,6 @@ config OPROFILE tristate "OProfile system profiling (EXPERIMENTAL)" depends on PROFILING depends on HAVE_OPROFILE - depends on TRACING_SUPPORT - select TRACING select RING_BUFFER select RING_BUFFER_ALLOW_SWAP help
PATCH 35/123 perf_event: Fix preempt warning in perf_clock()
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Peter Zijlstra <[email protected]>
commit 24691ea964cc0123e386b661e03a86a481c6ee79 upstream.
A recent commit introduced a preemption warning for perf_clock(), use raw_smp_processor_id() to avoid this, it really doesn't matter which cpu we use here.
LKML-Reference: <1267198583.22519.684.camel@laptop>
--- kernel/perf_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/perf_event.c +1 -1
@@ -248,7 +248,7 @@ static void perf_unpin_context(struct pestatic inline u64 perf_clock (void ) { -return cpu_clock (smp_processor_id ()); +return cpu_clock (raw_smp_processor_id ()); }/*
PATCH 34/123 perf symbols: Check the right return variable
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Zhang, Yanmin <[email protected]>
commit 37fe5fcb7a5b5235c8b71bf5469ce4c7246e3fab upstream.
In function dso__split_kallsyms(), curr_map saves the return value of map__new2. So check it instead of var map after the call returns.
LKML-Reference: <1267066851.1726.9.camel@localhost>
--- tools/perf/util/symbol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/symbol.c +1 -1
@@ -503,7 +503,7 @@ static int dso__split_kallsyms(struct dsreturn -1 ; curr_map =map__new2 (pos->start, dso, map->type); -if (map ==NULL ) { +if (curr_map ==NULL ) {dso__delete (dso);return -1 ; }
PATCH 33/123 oprofile/x86: fix perfctr nmi reservation for mulitplexing
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Robert Richter <[email protected]>
commit 68dc819ce829f7e7977a56524e710473bdb55115 upstream.
Multiple virtual counters share one physical counter. The reservation of virtual counters fails due to duplicate allocation of the same counter. The counters are already reserved. Thus, virtual counter reservation may removed at all. This also makes the code easier.
--- arch/x86/oprofile/nmi_int.c | 11 ++++++----- arch/x86/oprofile/op_model_amd.c | 19 ------------------- 2 files changed, 6 insertions(+), 24 deletions(-)
arch/x86/oprofile/nmi_int.c +6 -5
@@ -179,7 +179,6 @@ static void nmi_cpu_setup_mux(int cpu, sif (counter_config[i].enabled) { multiplex[i].saved = -(u64 )counter_config[i].count; }else { - multiplex[i].addr =0 ; multiplex[i].saved =0 ; } }
@@ -189,25 +188,27 @@ static void nmi_cpu_setup_mux(int cpu, sstatic void nmi_cpu_save_mpx_registers (struct op_msrs *msrs) { +struct op_msr *counters = msrs->counters;struct op_msr *multiplex = msrs->multiplex;int i;for (i =0 ; i < model->num_counters; ++i) {int virt =op_x86_phys_to_virt (i); -if (multiplex[virt].addr) -rdmsrl (multiplex[virt].addr, multiplex[virt].saved); +if (counters[i].addr) +rdmsrl (counters[i].addr, multiplex[virt].saved); } }static void nmi_cpu_restore_mpx_registers (struct op_msrs *msrs) { +struct op_msr *counters = msrs->counters;struct op_msr *multiplex = msrs->multiplex;int i;for (i =0 ; i < model->num_counters; ++i) {int virt =op_x86_phys_to_virt (i); -if (multiplex[virt].addr) -wrmsrl (multiplex[virt].addr, multiplex[virt].saved); +if (counters[i].addr) +wrmsrl (counters[i].addr, multiplex[virt].saved); } }
arch/x86/oprofile/op_model_amd.c +0 -19
@@ -76,19 +76,6 @@ static struct op_ibs_config ibs_config;#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX -static void op_mux_fill_in_addresses (struct op_msrs *const msrs) -{ -int i; - -for (i =0 ; i <NUM_VIRT_COUNTERS ; i++) { -int hw_counter =op_x86_virt_to_phys (i); -if (reserve_perfctr_nmi (MSR_K7_PERFCTR0 + i)) - msrs->multiplex[i].addr =MSR_K7_PERFCTR0 + hw_counter; -else - msrs->multiplex[i].addr =0 ; - } -} -static void op_mux_switch_ctrl (struct op_x86_model_spec const *model,struct op_msrs const *const msrs) {
@@ -107,10 +94,6 @@ static void op_mux_switch_ctrl(struct op } } -#else - -static inline void op_mux_fill_in_addresses (struct op_msrs *const msrs) { } -#endif /* functions for op_amd_spec */
@@ -132,8 +115,6 @@ static void op_amd_fill_in_addresses(strelse msrs->controls[i].addr =0 ; } - -op_mux_fill_in_addresses (msrs); } static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
PATCH 32/123 macintosh/hwmon/ams: Fix device removal sequence
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Jean Delvare <[email protected]>
commit 98ceb75c7c14eada76b0aa9f03a635a735cee3cb upstream.
Some code that is in ams_exit() (the module exit code) should instead be called when the device (not module) is removed. It probably doesn't make much of a difference in the PMU case, but in the I2C case it does matter.
I make no guarantee that my fix isn't racy, I'm not familiar enough with the ams driver code to tell for sure.
--- drivers/hwmon/ams/ams-core.c | 11 +++++++---- drivers/hwmon/ams/ams-i2c.c | 2 ++ drivers/hwmon/ams/ams-pmu.c | 2 ++ drivers/hwmon/ams/ams.h | 1 + 4 files changed, 12 insertions(+), 4 deletions(-)
drivers/hwmon/ams/ams-core.c +7 -4
@@ -213,7 +213,7 @@ int __init ams_init(void)return -ENODEV ; } -void ams_exit (void ) +void ams_sensor_detach (void ) {/* Remove input device */ ams_input_exit ();
@@ -221,9 +221,6 @@ void ams_exit(void)/* Remove attributes */ device_remove_file (&ams_info.of_dev->dev, &dev_attr_current); -/* Shut down implementation */ - ams_info.exit (); -/* Flush interrupt worker * * We do this after ams_info.exit(), because an interrupt might
@@ -239,6 +236,12 @@ void ams_exit(void)pmf_unregister_irq_client (&ams_freefall_client); } +static void __exit ams_exit(void) +{ +/* Shut down implementation */ + ams_info.exit (); +} +MODULE_AUTHOR ("Stelian Pop, Michael Hanselmann" );MODULE_DESCRIPTION ("Apple Motion Sensor driver" );MODULE_LICENSE ("GPL" );
drivers/hwmon/ams/ams-i2c.c +2 -0
@@ -238,6 +238,8 @@ static int ams_i2c_probe(struct i2c_cliestatic int ams_i2c_remove (struct i2c_client *client) {if (ams_info.has_device) { +ams_sensor_detach (); +/* Disable interrupts */ ams_i2c_set_irq (AMS_IRQ_ALL ,0 );
drivers/hwmon/ams/ams-pmu.c +2 -0
@@ -133,6 +133,8 @@ static void ams_pmu_get_xyz(s8 *x, s8 *ystatic void ams_pmu_exit (void ) { +ams_sensor_detach (); +/* Disable interrupts */ ams_pmu_set_irq (AMS_IRQ_ALL ,0 );
drivers/hwmon/ams/ams.h +1 -0
@@ -61,6 +61,7 @@ extern struct ams ams_info;extern void ams_sensors (s8 *x,s8 *y,s8 *z);extern int ams_sensor_attach (void ); +extern void ams_sensor_detach (void );extern int ams_pmu_init (struct device_node *np);extern int ams_i2c_init (struct device_node *np);
PATCH 31/123 macintosh/therm_adt746x: Fix sysfs attributes lifetime
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Jean Delvare <[email protected]>
commit 33a470f6d5e1879c26f16f6b34dc09f82d44f6e9 upstream.
Looking at drivers/macintosh/therm_adt746x.c, the sysfs files are created in thermostat_init() and removed in thermostat_exit(), which are the driver's init and exit functions. These files are backed-up by a per-device structure, so it looks like the wrong thing to do: the sysfs files have a lifetime longer than the data structure that is backing it up.
I think that sysfs files creation should be moved to the end of probe_thermostat() and sysfs files removal should be moved to the beginning of remove_thermostat().
--- drivers/macintosh/therm_adt746x.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-)
drivers/macintosh/therm_adt746x.c +24 -10
@@ -90,6 +90,8 @@ static struct task_struct *thread_thermstatic void write_both_fan_speed (struct thermostat *th,int speed);static void write_fan_speed (struct thermostat *th,int speed,int fan); +static void thermostat_create_files (void ); +static void thermostat_remove_files (void );static int write_reg (struct thermostat * th,int reg,u8 data)
@@ -161,6 +163,8 @@ remove_thermostat(struct i2c_client *clistruct thermostat *th =i2c_get_clientdata (client);int i; +thermostat_remove_files (); +if (thread_therm !=NULL ) {kthread_stop (thread_therm); }
@@ -449,6 +453,8 @@ static int probe_thermostat(struct i2c_creturn -ENOMEM ; } +thermostat_create_files (); +return 0 ; }
@@ -566,7 +572,6 @@ thermostat_init(void)struct device_node * np;const u32 *prop;int i =0 , offset =0 ; -int err; np =of_find_node_by_name (NULL ,"fan" );if (!np)
@@ -633,6 +638,17 @@ thermostat_init(void)return -ENODEV ; } +#ifndef CONFIG_I2C_POWERMAC +request_module ("i2c-powermac" ); +#endif + +return i2c_add_driver (&thermostat_driver); +} + +static void thermostat_create_files (void ) +{ +int err; + err =device_create_file (&of_dev->dev, &dev_attr_sensor1_temperature); err |=device_create_file (&of_dev->dev, &dev_attr_sensor2_temperature); err |=device_create_file (&of_dev->dev, &dev_attr_sensor1_limit);
@@ -647,16 +663,9 @@ thermostat_init(void)if (err)printk (KERN_WARNING "Failed to create tempertaure attribute file(s).\n" ); - -#ifndef CONFIG_I2C_POWERMAC -request_module ("i2c-powermac" ); -#endif - -return i2c_add_driver (&thermostat_driver); } -static void __exit -thermostat_exit (void ) +static void thermostat_remove_files (void ) {if (of_dev) {device_remove_file (&of_dev->dev, &dev_attr_sensor1_temperature);
@@ -673,9 +682,14 @@ thermostat_exit(void)device_remove_file (&of_dev->dev, &dev_attr_sensor2_fan_speed); -of_device_unregister (of_dev); } +} + +static void __exit +thermostat_exit (void ) +{i2c_del_driver (&thermostat_driver); +of_device_unregister (of_dev); }module_init (thermostat_init);
PATCH 30/123 PM / Hibernate: Fix preallocating of memory
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Rafael J. Wysocki <[email protected]>
commit a9c9b4429df437982d2fbfab1f4b46b01329e9ed upstream.
The hibernate memory preallocation code allocates memory to push some user space data out of physical RAM, so that the hibernation image is not too large. It allocates more memory than necessary for creating the image, so it has to release some pages to make room for allocations made while suspending devices and disabling nonboot CPUs, or the system will hang due to the lack of free pages to allocate from. Unfortunately, the function used for freeing these pages, free_unnecessary_pages(), contains a bug that prevents it from doing the job on all systems without highmem.
Fix this problem, which is a regression from the 2.6.30 kernel, by using the right condition for the termination of the loop in free_unnecessary_pages().
--- kernel/power/snapshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/power/snapshot.c +1 -1
@@ -1181,7 +1181,7 @@ static void free_unnecessary_pages(void)memory_bm_position_reset (©_bm); -while (to_free_normal >0 && to_free_highmem >0 ) { +while (to_free_normal >0 || to_free_highmem >0 ) {unsigned long pfn =memory_bm_next_pfn (©_bm);struct page *page =pfn_to_page (pfn);
PATCH 28/123 dvb-core: Fix DoS bug in ULE decapsulation code that can be triggered by an invalid Payload Pointer
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Ang Way Chuang <[email protected]>
commit 29e1fa3565a7951cc415c634eb2b78dbdbee151d upstream.
ULE (Unidirectional Lightweight Encapsulation RFC 4326) decapsulation has a bug that causes endless loop when Payload Pointer of MPEG2-TS frame is 182 or 183. Anyone who sends malicious MPEG2-TS frame will cause the receiver of ULE SNDU to go into endless loop.
This patch was generated and tested against linux-2.6.32.9 and should apply cleanly to linux-2.6.33 as well because there was only one typo fix to dvb_net.c since v2.6.32.
This bug was brought to you by modern day Santa Claus who decided to shower the satellite dish at Keio University with heavy snow causing huge burst of errors. We, receiver end, received Santa Claus's gift in the form of kernel bug.
Care has been taken not to introduce more bug by fixing this bug, but please scrutinize the code for I always produces buggy code.
--- drivers/media/dvb/dvb-core/dvb_net.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/dvb/dvb-core/dvb_net.c +1 -0
@@ -504,6 +504,7 @@ static void dvb_net_ule( struct net_devi "bytes left in TS. Resyncing.\n", ts_remain); priv->ule_sndu_len =0 ; priv->need_pusi =1 ; + ts +=TS_SZ ;continue ; }
PATCH 27/123 Staging: mimio: remove the mimio driver
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Greg Kroah-Hartman <[email protected]>
commit e37bcc0de040127281de13a84a608570355c20eb upstream.
It turns out that Mimio has a userspace solution for this product using libusb, and the in-kernel driver is just getting in the way now and causing problems. So they have asked that the in-kernel driver be removed. As the staging driver wasn't quite working anyway, and Mimio supports their libusb solution for all distros, I am removing the in-kernel driver.
The libusb solution can be downloaded from:
http://www.mimio.com/downloads/mimio_studio_software/linux.asp
--- drivers/staging/Kconfig | 2 drivers/staging/Makefile | 1 drivers/staging/mimio/Kconfig | 10 drivers/staging/mimio/Makefile | 1 drivers/staging/mimio/mimio.c | 914 ----------------------------------------- 5 files changed, 928 deletions(-)
drivers/staging/Kconfig +0 -2
@@ -81,8 +81,6 @@ source "drivers/staging/rtl8192u/Kconfig source "drivers/staging/rtl8192e/Kconfig" -source "drivers/staging/mimio/Kconfig" - source "drivers/staging/frontier/Kconfig" source "drivers/staging/dream/Kconfig"
drivers/staging/Makefile +0 -1
@@ -23,7 +23,6 @@ obj-$(CONFIG_R8187SE) += rtl8187se/ obj-$(CONFIG_RTL8192SU) += rtl8192su/ obj-$(CONFIG_RTL8192U) += rtl8192u/ obj-$(CONFIG_RTL8192E) += rtl8192e/ -obj-$(CONFIG_INPUT_MIMIO) += mimio/ obj-$(CONFIG_TRANZPORT) += frontier/ obj-$(CONFIG_DREAM) += dream/ obj-$(CONFIG_POHMELFS) += pohmelfs/
drivers/staging/mimio/Kconfig deleted +0 -10
@@ -1,10 +0,0 @@ -config INPUT_MIMIO - tristate "Mimio Xi interactive whiteboard support" - depends on USB && INPUT - default N - help - Say Y here if you want to use a Mimio Xi interactive - whiteboard device. - - To compile this driver as a module, choose M here: the - module will be called mimio.
drivers/staging/mimio/Makefile deleted +0 -1
@@ -1 +0,0 @@ -obj-$(CONFIG_INPUT_MIMIO) += mimio.o
drivers/staging/mimio/mimio.c deleted +0 -914
914 lines not on this page · raw message
PATCH 25/123 Staging: Fixed pohmelfs regression because of per-bdi writeback.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Jens Axboe <[email protected]>
commit 182374a0bddeef46769d2f8ab56fcccc433b96f3 upstream.
Since pohmelfs isn't tied to a single block device, it needs to setup a backing dev like nfs/btrfs/etc do.
--- drivers/staging/pohmelfs/inode.c | 20 ++++++++++++++++++-- drivers/staging/pohmelfs/netfs.h | 3 +++ 2 files changed, 21 insertions(+), 2 deletions(-)
drivers/staging/pohmelfs/inode.c +18 -2
@@ -36,6 +36,7 @@#define POHMELFS_MAGIC_NUM 0x504f482estatic struct kmem_cache *pohmelfs_inode_cache; +static atomic_t psb_bdi_num =ATOMIC_INIT (0 );/* * Removes inode from all trees, drops local name cache and removes all queued
@@ -1331,6 +1332,8 @@ static void pohmelfs_put_super(struct supohmelfs_crypto_exit (psb);pohmelfs_state_exit (psb); +bdi_destroy (&psb->bdi); +kfree (psb); sb->s_fs_info =NULL ; }
@@ -1815,11 +1818,22 @@ static int pohmelfs_fill_super(struct suif (!psb) goto err_out_exit; + err =bdi_init (&psb->bdi); +if (err) + goto err_out_free_sb; + + err =bdi_register (&psb->bdi,NULL ,"pfs-%d" ,atomic_inc_return (&psb_bdi_num)); +if (err) { +bdi_destroy (&psb->bdi); + goto err_out_free_sb; + } + sb->s_fs_info = psb; sb->s_op = &pohmelfs_sb_ops; sb->s_magic =POHMELFS_MAGIC_NUM ; sb->s_maxbytes =MAX_LFS_FILESIZE ; sb->s_blocksize =PAGE_SIZE ; + sb->s_bdi = &psb->bdi; psb->sb = sb;
@@ -1863,11 +1877,11 @@ static int pohmelfs_fill_super(struct su err =pohmelfs_parse_options ((char *) data, psb,0 );if (err) - goto err_out_free_sb; + goto err_out_free_bdi; err =pohmelfs_copy_crypto (psb);if (err) - goto err_out_free_sb; + goto err_out_free_bdi; err =pohmelfs_state_init (psb);if (err)
@@ -1916,6 +1930,8 @@ err_out_state_exit: err_out_free_strings:kfree (psb->cipher_string);kfree (psb->hash_string); +err_out_free_bdi: +bdi_destroy (&psb->bdi); err_out_free_sb:kfree (psb); err_out_exit:
drivers/staging/pohmelfs/netfs.h +3 -0
@@ -18,6 +18,7 @@#include <linux/types.h> #include <linux/connector.h> +#include <linux/backing-dev.h> #define POHMELFS_CN_IDX 5#define POHMELFS_CN_VAL 0
@@ -624,6 +625,8 @@ struct pohmelfs_sb {struct super_block *sb; +struct backing_dev_info bdi; +/* * Algorithm strings. */
PATCH 24/123 Staging: hv: match on DMI values to know if we should run.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Greg Kroah-Hartman <[email protected]>
commit c22090facd354749cfe99a46e903449c7ac07788 upstream.
The HV core mucks around with specific irqs and other low-level stuff and takes forever to determine that it really shouldn't be running on a machine. So instead, trigger off of the DMI system information and error out much sooner. This also allows the module loading tools to recognize that this code should be loaded on this type of system.
--- drivers/staging/hv/vmbus_drv.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
drivers/staging/hv/vmbus_drv.c +17 -4
@@ -25,6 +25,7 @@#include <linux/interrupt.h> #include <linux/sysctl.h> #include <linux/pci.h> +#include <linux/dmi.h> #include "osd.h" #include "logging.h" #include "vmbus.h"
@@ -947,6 +948,19 @@ static irqreturn_t vmbus_isr(int irq, vo } } +static struct dmi_system_id __initdata microsoft_hv_dmi_table[] = { + { + .ident ="Hyper-V" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Microsoft Corporation" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Virtual Machine" ), +DMI_MATCH (DMI_BOARD_NAME ,"Virtual Machine" ), + }, + }, + { }, +}; +MODULE_DEVICE_TABLE (dmi, microsoft_hv_dmi_table); +static int __init vmbus_init (void ) {int ret =0 ;
@@ -958,6 +972,9 @@ static int __init vmbus_init(void) vmbus_loglevel, HIWORD(vmbus_loglevel), LOWORD(vmbus_loglevel));/* Todo: it is used for loglevel, to be ported to new kernel. */ +if (!dmi_check_system (microsoft_hv_dmi_table)) +return -ENODEV ; + ret =vmbus_bus_init (VmbusInitialize);DPRINT_EXIT (VMBUS_DRV );
@@ -979,10 +996,6 @@ static void __exit vmbus_exit(void)* needed by distro tools to determine if the hyperv drivers should be * installed and/or configured. We don't do anything else with the table, but * it needs to be present. -* -* We might consider triggering off of DMI table info as well, as that does -* decribe the virtual machine being run on, but not all configuration tools -* seem to be able to handle DMI device ids properly. */ const static struct pci_device_id microsoft_hv_pci_table[] = { {PCI_DEVICE (0x1414 ,0x5353 ) },/* VGA compatible controller */
PATCH 23/123 Staging: hv: add a pci device table
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Greg Kroah-Hartman <[email protected]>
commit 9a775dbd4e8c87b7d35549183145321c7205404e upstream.
This allows the HV core to be properly found and autoloaded by the system tools.
It uses the Microsoft virtual VGA device to trigger this.
--- drivers/staging/hv/vmbus_drv.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/staging/hv/vmbus_drv.c +17 -0
@@ -24,6 +24,7 @@#include <linux/irq.h> #include <linux/interrupt.h> #include <linux/sysctl.h> +#include <linux/pci.h> #include "osd.h" #include "logging.h" #include "vmbus.h"
@@ -973,6 +974,22 @@ static void __exit vmbus_exit(void)return ; } +/* +* We use a PCI table to determine if we should autoload this driver This is +* needed by distro tools to determine if the hyperv drivers should be +* installed and/or configured. We don't do anything else with the table, but +* it needs to be present. +* +* We might consider triggering off of DMI table info as well, as that does +* decribe the virtual machine being run on, but not all configuration tools +* seem to be able to handle DMI device ids properly. +*/ +const static struct pci_device_id microsoft_hv_pci_table[] = { + {PCI_DEVICE (0x1414 ,0x5353 ) },/* VGA compatible controller */ + {0 } +}; +MODULE_DEVICE_TABLE (pci, microsoft_hv_pci_table); +MODULE_LICENSE ("GPL" );module_param (vmbus_irq, int,S_IRUGO );module_param (vmbus_loglevel, int,S_IRUGO );
PATCH 22/123 SCSI: qla1280: Drop host_lock while requesting firmware
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Ben Hutchings <[email protected]>
commit 2cec802980727f1daa46d8c31b411e083d49d7a2 upstream.
request_firmware() may sleep and it appears to be safe to release the spinlock here.
--- drivers/scsi/qla1280.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/scsi/qla1280.c +4 -0
@@ -1640,8 +1640,10 @@ qla1280_load_firmware_pio(struct scsi_qluint16_t mb[MAILBOX_REGISTER_COUNT ], i;int err; +spin_unlock_irq (ha->host->host_lock); err =request_firmware (&fw, ql1280_board_tbl[ha->devnum].fwname, &ha->pdev->dev); +spin_lock_irq (ha->host->host_lock);if (err) {printk (KERN_ERR "Failed to load image \"%s\" err %d\n" , ql1280_board_tbl[ha->devnum].fwname, err);
@@ -1699,8 +1701,10 @@ qla1280_load_firmware_dma(struct scsi_qlreturn -ENOMEM ;#endif +spin_unlock_irq (ha->host->host_lock); err =request_firmware (&fw, ql1280_board_tbl[ha->devnum].fwname, &ha->pdev->dev); +spin_lock_irq (ha->host->host_lock);if (err) {printk (KERN_ERR "Failed to load image \"%s\" err %d\n" , ql1280_board_tbl[ha->devnum].fwname, err);
PATCH 21/123 clocksource: Fix up a registration/IRQ race in the sh drivers.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Paul Mundt <[email protected]>
commit da64c2a8dee66ca03f4f3e15d84be7bedf73db3d upstream.
All of the SH clocksource drivers follow the scheme that the IRQ is setup prior to registering the clockevent. The interrupt handler in the clockevent cases looks to the event handler function pointer being filled in by the registration code, permitting us to get in to situations where asserted IRQs step in to the handler before registration has had a chance to complete and hitting a NULL pointer deref.
In practice this is not an issue for most platforms, but some of them with fairly special loaders (or that are chain-loading from another kernel) may enter in to this situation. This fixes up the oops reported by Rafael on hp6xx.
--- drivers/clocksource/sh_cmt.c | 32 +++++++++++++++++++------------- drivers/clocksource/sh_mtu2.c | 6 +++--- drivers/clocksource/sh_tmu.c | 6 +++--- 3 files changed, 25 insertions(+), 19 deletions(-)
drivers/clocksource/sh_cmt.c +19 -13
@@ -603,18 +603,13 @@ static int sh_cmt_setup(struct sh_cmt_pr p->irqaction.handler = sh_cmt_interrupt; p->irqaction.dev_id = p; p->irqaction.flags =IRQF_DISABLED |IRQF_TIMER |IRQF_IRQPOLL ; - ret =setup_irq (irq, &p->irqaction); -if (ret) { -pr_err ("sh_cmt: failed to request irq %d\n" , irq); - goto err1; - }/* get hold of clock */ p->clk =clk_get (&p->pdev->dev, cfg->clk);if (IS_ERR (p->clk)) {pr_err ("sh_cmt: cannot get clock \"%s\"\n" , cfg->clk); ret =PTR_ERR (p->clk); - goto err2; + goto err1; }if (resource_size (res) ==6 ) {
@@ -627,14 +622,25 @@ static int sh_cmt_setup(struct sh_cmt_pr p->clear_bits = ~0xc000 ; } -return sh_cmt_register (p, cfg->name, - cfg->clockevent_rating, - cfg->clocksource_rating); - err2: -remove_irq (irq, &p->irqaction); - err1: + ret =sh_cmt_register (p, cfg->name, + cfg->clockevent_rating, + cfg->clocksource_rating); +if (ret) { +pr_err ("sh_cmt: registration failed\n" ); + goto err1; + } + + ret =setup_irq (irq, &p->irqaction); +if (ret) { +pr_err ("sh_cmt: failed to request irq %d\n" , irq); + goto err1; + } + +return 0 ; + +err1:iounmap (p->mapbase); - err0: +err0:return ret; }
drivers/clocksource/sh_mtu2.c +3 -3
@@ -221,15 +221,15 @@ static void sh_mtu2_register_clockevent( ced->cpumask =cpumask_of (0 ); ced->set_mode = sh_mtu2_clock_event_mode; +pr_info ("sh_mtu2: %s used for clock events\n" , ced->name); +clockevents_register_device (ced); + ret =setup_irq (p->irqaction.irq, &p->irqaction);if (ret) {pr_err ("sh_mtu2: failed to request irq %d\n" , p->irqaction.irq);return ; } - -pr_info ("sh_mtu2: %s used for clock events\n" , ced->name); -clockevents_register_device (ced); } static int sh_mtu2_register(struct sh_mtu2_priv *p, char *name,
drivers/clocksource/sh_tmu.c +3 -3
@@ -323,15 +323,15 @@ static void sh_tmu_register_clockevent(s ced->set_next_event = sh_tmu_clock_event_next; ced->set_mode = sh_tmu_clock_event_mode; +pr_info ("sh_tmu: %s used for clock events\n" , ced->name); +clockevents_register_device (ced); + ret =setup_irq (p->irqaction.irq, &p->irqaction);if (ret) {pr_err ("sh_tmu: failed to request irq %d\n" , p->irqaction.irq);return ; } - -pr_info ("sh_tmu: %s used for clock events\n" , ced->name); -clockevents_register_device (ced); } static int sh_tmu_register(struct sh_tmu_priv *p, char *name,
PATCH 19/123 rtc-core: fix memory leak
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Aaro Koskinen <[email protected]>
commit 2a7a06a0cdd86d572e91657603180da5992be6d3 upstream.
The idr should be destroyed when the module is unloaded. Found with kmemleak.
--- drivers/rtc/class.c | 1 + 1 file changed, 1 insertion(+)
drivers/rtc/class.c +1 -0
@@ -226,6 +226,7 @@ static void __exit rtc_exit(void) {rtc_dev_exit ();class_destroy (rtc_class); +idr_destroy (&rtc_idr); }subsys_initcall (rtc_init);
PATCH 17/123 drm/i915: give up on 8xx lid status
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Jesse Barnes <[email protected]>
commit 7b9c5abee98c54f85bcc04bd4d7ec8d5094c73f4 upstream.
These old machines more often than not lie about their lid state. So don't use it to detect LVDS presence, but leave the event handler to deal with lid open/close, when we might need to reset the mode.
Fixes kernel bug #15248
--- drivers/gpu/drm/i915/intel_lvds.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/intel_lvds.c +7 -0
@@ -655,8 +655,15 @@ static const struct dmi_system_id bad_li*/ static enum drm_connector_status intel_lvds_detect (struct drm_connector *connector) { +struct drm_device *dev = connector->dev;enum drm_connector_status status = connector_status_connected; +/* ACPI lid methods were generally unreliable in this generation, so +* don't even bother. +*/ +if (IS_I8XX (dev)) +return connector_status_connected; +if (!dmi_check_system (bad_lid_status) && !acpi_lid_open ()) status = connector_status_disconnected;
PATCH 16/123 x86, uv: uv_global_gru_mmr_address() macro fix
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Jack Steiner <[email protected]>
commit e1e0138d7d10fd447c71cc70f367eac514bd3ce4 upstream.
Fix bug in uv_global_gru_mmr_address macro. Macro failed to cast an int value to a long prior to a left shift > 32.
LKML-Reference: <[email protected]>
--- arch/x86/include/asm/uv/uv_hub.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/include/asm/uv/uv_hub.h +2 -1
@@ -329,7 +329,8 @@ static inline unsigned long uv_read_glob*/ static inline unsigned long uv_global_gru_mmr_address (int pnode,unsigned long offset) { -return UV_GLOBAL_GRU_MMR_BASE | offset | (pnode << uv_hub_info->m_val); +return UV_GLOBAL_GRU_MMR_BASE | offset | + ((unsigned long )pnode << uv_hub_info->m_val); }static inline void uv_write_global_mmr8 (int pnode,unsigned long offset,unsigned char val)
PATCH 13/123 slab: initialize unused alien cache entry as NULL at alloc_alien_cache().
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Haicheng Li <[email protected]>
commit f3186a9c51eabe75b2780153ed7f07778d78b16e upstream.
Comparing with existing code, it's a simpler way to use kzalloc_node() to ensure that each unused alien cache entry is NULL.
--- mm/slab.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
mm/slab.c +2 -4
@@ -983,13 +983,11 @@ static struct array_cache **alloc_alien_if (limit >1 ) limit =12 ; - ac_ptr =kmalloc_node (memsize, gfp, node); + ac_ptr =kzalloc_node (memsize, gfp, node);if (ac_ptr) {for_each_node (i) { -if (i == node || !node_online (i)) { - ac_ptr[i] =NULL ; +if (i == node || !node_online (i))continue ; - } ac_ptr[i] =alloc_arraycache (node, limit,0xbaadf00d , gfp);if (!ac_ptr[i]) {for (i--; i >=0 ; i--)
PATCH 12/123 readahead: introduce FMODE_RANDOM for POSIX_FADV_RANDOM
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Wu Fengguang <[email protected]>
commit 0141450f66c3c12a3aaa869748caa64241885cdf upstream.
This fixes inefficient page-by-page reads on POSIX_FADV_RANDOM.
POSIX_FADV_RANDOM used to set ra_pages=0, which leads to poor performance:
a 16K read will be carried out in 4 _sync_ 1-page reads.
In other places, ra_pages==0 means
- it's ramfs/tmpfs/hugetlbfs/sysfs/configfs
- some IO error happened
where multi-page read IO won't help or should be avoided.
POSIX_FADV_RANDOM actually want a different semantics: to disable the *heuristic* readahead algorithm, and to use a dumb one which faithfully submit read IO for whatever application requests.
So introduce a flag FMODE_RANDOM for POSIX_FADV_RANDOM.
Note that the random hint is not likely to help random reads performance noticeably. And it may be too permissive on huge request size (its IO size is not limited by read_ahead_kb).
In Quentin's report (http://lkml.org/lkml/2009/12/24/145), the overall (NFS read) performance of the application increased by 313%!
--- include/linux/fs.h | 3 +++ mm/fadvise.c | 10 +++++++++- mm/readahead.c | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-)
include/linux/fs.h +3 -0
@@ -87,6 +87,9 @@ struct inodes_stat_t {*/ #define FMODE_NOCMTIME ((__force fmode_t)2048) +/* Expect random access pattern */ +#define FMODE_RANDOM ((__force fmode_t)4096) +/* * The below are the various read and write types that we support. Some of * them include behavioral modifiers that send information down to the
mm/fadvise.c +9 -1
@@ -77,12 +77,20 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, lofswitch (advice) {case POSIX_FADV_NORMAL : file->f_ra.ra_pages = bdi->ra_pages; +spin_lock (&file->f_lock); + file->f_mode &= ~FMODE_RANDOM ; +spin_unlock (&file->f_lock);break ;case POSIX_FADV_RANDOM : - file->f_ra.ra_pages =0 ; +spin_lock (&file->f_lock); + file->f_mode |=FMODE_RANDOM ; +spin_unlock (&file->f_lock);break ;case POSIX_FADV_SEQUENTIAL : file->f_ra.ra_pages = bdi->ra_pages *2 ; +spin_lock (&file->f_lock); + file->f_mode &= ~FMODE_RANDOM ; +spin_unlock (&file->f_lock);break ;case POSIX_FADV_WILLNEED :if (!mapping->a_ops->readpage) {
mm/readahead.c +6 -0
@@ -501,6 +501,12 @@ void page_cache_sync_readahead(struct adif (!ra->ra_pages)return ; +/* be dumb */ +if (filp->f_mode &FMODE_RANDOM ) { +force_page_cache_readahead (mapping, filp, offset, req_size); +return ; + } +/* do read-ahead */ ondemand_readahead (mapping, ra, filp, false, offset, req_size); }
PATCH 11/123 mpt2sas: Delete volume before HBA detach.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Kashyap, Desai <[email protected]>
commit d7384b28afb2bf2b7be835ddc8c852bdc5e0ce1c upstream.
The driver hangs when doing rmmod mpt2sas if there are any IR volumes present.The hang is due the scsi midlayer trying to access the IR volumes after the driver releases controller resources. Perhaps when scsi_remove_host is called,the scsi mid layer is sending some request. This doesn't occur for bare drives becuase the driver is already reporting those drives deleted prior to calling mpt2sas_base_detach.
To solve this issue, we need to delete the volumes as well.
--- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/scsi/mpt2sas/mpt2sas_scsih.c +17 -0
@@ -5998,6 +5998,8 @@ _scsih_remove(struct pci_dev *pdev)struct _sas_port *mpt2sas_port;struct _sas_device *sas_device;struct _sas_node *expander_sibling; +struct _raid_device *raid_device, *next; +struct MPT2SAS_TARGET *sas_target_priv_data;struct workqueue_struct *wq;unsigned long flags;
@@ -6011,6 +6013,21 @@ _scsih_remove(struct pci_dev *pdev)if (wq)destroy_workqueue (wq); +/* release all the volumes */ +list_for_each_entry_safe (raid_device, next, &ioc->raid_device_list, + list) { +if (raid_device->starget) { + sas_target_priv_data = + raid_device->starget->hostdata; + sas_target_priv_data->deleted =1 ; +scsi_remove_target (&raid_device->starget->dev); + } +printk (MPT2SAS_INFO_FMT "removing handle(0x%04x), wwid" +"(0x%016llx)\n" , ioc->name, raid_device->handle, + (unsigned long long ) raid_device->wwid); +_scsih_raid_device_remove (ioc, raid_device); + } +/* free ports attached to the sas_host */ retry_again: list_for_each_entry(mpt2sas_port,
PATCH 10/123 mac80211: Reset dynamic ps timer in Rx path.
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Vivek Natarajan <[email protected]>
commit e15276a4b220c54db665cf46a92bd9ceb9aeb052 upstream.
The current mac80211 implementation enables power save if there is no Tx traffic for a specific timeout. Hence, PS is triggered even if there is a continuous Rx only traffic(like UDP) going on. This makes the drivers to wait on the tim bit in the next beacon to awake which leads to redundant sleep-wake cycles. Fix this by restarting the dynamic ps timer on receiving every data packet.
--- net/mac80211/rx.c | 8 ++++++++ 1 file changed, 8 insertions(+)
net/mac80211/rx.c +8 -0
@@ -1788,6 +1788,7 @@ static ieee80211_rx_result debug_noinlin ieee80211_rx_h_data(struct ieee80211_rx_data *rx) {struct ieee80211_sub_if_data *sdata = rx->sdata; +struct ieee80211_local *local = rx->local;struct net_device *dev = sdata->dev;struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;__le16 fc = hdr->frame_control;
@@ -1819,6 +1820,13 @@ ieee80211_rx_h_data(struct ieee80211_rx_ dev->stats.rx_packets++; dev->stats.rx_bytes += rx->skb->len; +if (ieee80211_is_data (hdr->frame_control) && + !is_multicast_ether_addr (hdr->addr1) && + local->hw.conf.dynamic_ps_timeout >0 && local->ps_sdata) { +mod_timer (&local->dynamic_ps_timer, jiffies + +msecs_to_jiffies (local->hw.conf.dynamic_ps_timeout)); + } +ieee80211_deliver_skb (rx);return RX_QUEUED ;
PATCH 9/123 mac80211: quit addba_resp_timer if Tx BA session is torn down
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Zhu Yi <[email protected]>
commit 3dc1de0bf23816ed557ac8addf680cd5ee57e805 upstream.
Make addba_resp_timer aware the HT_AGG_STATE_REQ_STOP_BA_MSK mask so that when ___ieee80211_stop_tx_ba_session() is issued the timer will quit. Otherwise when suspend happens before the timer expired, the timer handler will be called immediately after resume and messes up driver status.
--- net/mac80211/agg-tx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/mac80211/agg-tx.c +2 -1
@@ -179,7 +179,8 @@ static void sta_addba_resp_timer_expired/* check if the TID waits for addBA response */ spin_lock_bh (&sta->lock); -if ((*state & (HT_ADDBA_REQUESTED_MSK |HT_ADDBA_RECEIVED_MSK )) != +if ((*state & (HT_ADDBA_REQUESTED_MSK |HT_ADDBA_RECEIVED_MSK | +HT_AGG_STATE_REQ_STOP_BA_MSK )) !=HT_ADDBA_REQUESTED_MSK ) {spin_unlock_bh (&sta->lock); *state =HT_AGG_STATE_IDLE ;
PATCH 8/123 HID: usbhid: introduce timeout for stuck ctrl/out URBs
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Oliver Neukum <[email protected]>
commit 858155fbcc0cd713f6382c527bb1c3abc0ed6d00 upstream.
Some devices do not react to a control request (seen on APC UPS's) resulting in a slow stream of messages, "generic-usb ... control queue full". Therefore request needs a timeout.
--- drivers/hid/usbhid/hid-core.c | 28 ++++++++++++++++++++++++++-- drivers/hid/usbhid/usbhid.h | 2 ++ 2 files changed, 28 insertions(+), 2 deletions(-)
drivers/hid/usbhid/hid-core.c +26 -2
@@ -316,6 +316,7 @@ static int hid_submit_out(struct hid_deverr_hid ("usb_submit_urb(out) failed" );return -1 ; } + usbhid->last_out = jiffies; }else {/* * queue work to wake up the device.
@@ -377,6 +378,7 @@ static int hid_submit_ctrl(struct hid_deerr_hid ("usb_submit_urb(ctrl) failed" );return -1 ; } + usbhid->last_ctrl = jiffies; }else {/* * queue work to wake up the device.
@@ -512,9 +514,20 @@ static void __usbhid_submit_report(struc usbhid->out[usbhid->outhead].report = report; usbhid->outhead = head; -if (!test_and_set_bit (HID_OUT_RUNNING , &usbhid->iofl)) +if (!test_and_set_bit (HID_OUT_RUNNING , &usbhid->iofl)) {if (hid_submit_out (hid))clear_bit (HID_OUT_RUNNING , &usbhid->iofl); + }else { +/* +* the queue is known to run +* but an earlier request may be stuck +* we may need to time out +* no race because this is called under +* spinlock +*/ +if (time_after (jiffies, usbhid->last_out +HZ *5 )) +usb_unlink_urb (usbhid->urbout); + }return ; }
@@ -535,9 +548,20 @@ static void __usbhid_submit_report(struc usbhid->ctrl[usbhid->ctrlhead].dir = dir; usbhid->ctrlhead = head; -if (!test_and_set_bit (HID_CTRL_RUNNING , &usbhid->iofl)) +if (!test_and_set_bit (HID_CTRL_RUNNING , &usbhid->iofl)) {if (hid_submit_ctrl (hid))clear_bit (HID_CTRL_RUNNING , &usbhid->iofl); + }else { +/* +* the queue is known to run +* but an earlier request may be stuck +* we may need to time out +* no race because this is called under +* spinlock +*/ +if (time_after (jiffies, usbhid->last_ctrl +HZ *5 )) +usb_unlink_urb (usbhid->urbctrl); + } }void usbhid_submit_report (struct hid_device *hid,struct hid_report *report,unsigned char dir)
drivers/hid/usbhid/usbhid.h +2 -0
@@ -80,12 +80,14 @@ struct usbhid_device {unsigned char ctrlhead, ctrltail;/* Control fifo head & tail */ char *ctrlbuf;/* Control buffer */ dma_addr_t ctrlbuf_dma;/* Control buffer dma */ +unsigned long last_ctrl;/* record of last output for timeouts */ struct urb *urbout;/* Output URB */ struct hid_output_fifo out[HID_CONTROL_FIFO_SIZE ];/* Output pipe fifo */ unsigned char outhead, outtail;/* Output pipe fifo head & tail */ char *outbuf;/* Output buffer */ dma_addr_t outbuf_dma;/* Output buffer dma */ +unsigned long last_out;/* record of last output for timeouts */ spinlock_t lock;/* fifo spinlock */ unsigned long iofl;/* I/O flags (CTRL_RUNNING, OUT_RUNNING) */
PATCH 7/123 HID: remove TENX iBuddy from blacklist
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Jiri Kosina <[email protected]>
commit 4bb9508bbbb06f10bc3e249dd34375b4a4d6bfc0 upstream.
There were multiple reports which indicate that vendor messed up horribly and the same VID/PID combination is used for completely different devices, some of them requiring the blacklist entry and other not.
Remove the blacklist entry for this combination of VID/PID completely, and let the user decide and unbind the driver via sysfs eventually, if needed. Proper fix would be fixing the vendor.
http://lkml.org/lkml/2009/2/10/434
http://bugzilla.kernel.org/show_bug.cgi?id=13411
--- drivers/hid/hid-core.c | 2 -- drivers/hid/hid-ids.h | 4 ---- 2 files changed, 6 deletions(-)
drivers/hid/hid-core.c +0 -2
@@ -1661,8 +1661,6 @@ static const struct hid_device_id hid_ig { HID_USB_DEVICE(USB_VENDOR_ID_PANJIT, 0x0004) }, { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS, USB_DEVICE_ID_PHILIPS_IEEE802154_DONGLE) }, { HID_USB_DEVICE(USB_VENDOR_ID_POWERCOM, USB_DEVICE_ID_POWERCOM_UPS) }, - { HID_USB_DEVICE(USB_VENDOR_ID_TENX, USB_DEVICE_ID_TENX_IBUDDY1) }, - { HID_USB_DEVICE(USB_VENDOR_ID_TENX, USB_DEVICE_ID_TENX_IBUDDY2) }, { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO) }, { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP) }, { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP) },
drivers/hid/hid-ids.h +0 -4
@@ -402,10 +402,6 @@#define USB_VENDOR_ID_SUNPLUS 0x04fc#define USB_DEVICE_ID_SUNPLUS_WDESKTOP 0x05d8 -#define USB_VENDOR_ID_TENX 0x1130 -#define USB_DEVICE_ID_TENX_IBUDDY1 0x0001 -#define USB_DEVICE_ID_TENX_IBUDDY2 0x0002 -#define USB_VENDOR_ID_THRUSTMASTER 0x044f#define USB_VENDOR_ID_TOPMAX 0x0663
PATCH 6/123 airo: fix setting zero length WEP key
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Stanislaw Gruszka <[email protected]>
commit f09c256375c7cf1e112b8ef6306cdd313490d7c0 upstream.
Patch prevents call set_wep_key() with zero key length. That fix long standing regression since commit c0380693520b1a1e4f756799a0edc379378b462a "airo: clean up WEP key operations". Additionally print call trace when someone will try to use improper parameters, and remove key.len = 0 assignment, because it is in not possible code path.
--- drivers/net/wireless/airo.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-)
drivers/net/wireless/airo.c +18 -16
@@ -5254,11 +5254,7 @@ static int set_wep_key(struct airo_infoWepKeyRid wkr;int rc; -if (keylen ==0 ) { -airo_print_err (ai->dev->name,"%s: key length to set was zero" , - __func__); -return -1 ; - } +WARN_ON (keylen ==0 );memset (&wkr,0 ,sizeof (wkr)); wkr.len =cpu_to_le16 (sizeof (wkr));
@@ -6405,11 +6401,7 @@ static int airo_set_encode(struct net_deif (dwrq->length >MIN_KEY_SIZE ) key.len =MAX_KEY_SIZE ;else -if (dwrq->length >0 ) - key.len =MIN_KEY_SIZE ; -else -/* Disable the key */ - key.len =0 ; + key.len =MIN_KEY_SIZE ;/* Check if the key is not marked as invalid */ if (!(dwrq->flags &IW_ENCODE_NOKEY )) {/* Cleanup */
@@ -6590,12 +6582,22 @@ static int airo_set_encodeext(struct netdefault :return -EINVAL ; } -/* Send the key to the card */ - rc =set_wep_key (local, idx, key.key, key.len, perm,1 ); -if (rc <0 ) { -airo_print_err (local->dev->name,"failed to set WEP key" -" at index %d: %d." , idx, rc); -return rc; +if (key.len ==0 ) { + rc =set_wep_tx_idx (local, idx, perm,1 ); +if (rc <0 ) { +airo_print_err (local->dev->name, +"failed to set WEP transmit index to %d: %d." , + idx, rc); +return rc; + } + }else { + rc =set_wep_key (local, idx, key.key, key.len, perm,1 ); +if (rc <0 ) { +airo_print_err (local->dev->name, +"failed to set WEP key at index %d: %d." , + idx, rc); +return rc; + } } }
PATCH 5/123 security: fix error return path in ima_inode_alloc
In reply to Greg KH2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Xiaotian Feng <[email protected]>
commit baac35c4155a8aa826c70acee6553368ca5243a2 upstream.
If radix_tree_preload is failed in ima_inode_alloc, we don't need radix_tree_preload_end because kernel is alread preempt enabled
--- security/integrity/ima/ima_iint.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
security/integrity/ima/ima_iint.c +1 -2
@@ -63,12 +63,11 @@ int ima_inode_alloc(struct inode *inode)spin_lock (&ima_iint_lock); rc =radix_tree_insert (&ima_iint_store, (unsigned long )inode, iint);spin_unlock (&ima_iint_lock); +radix_tree_preload_end (); out:if (rc <0 )kmem_cache_free (iint_cache, iint); -radix_tree_preload_end (); -return rc; }
Quoted 12 lines · you
This is the start of the stable review cycle for the 2.6.31.1 release. There are 123 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.
Note, I still have a number of outstanding patches that have been submitted for this release. But due to the size, I figured it was best to get this release out as soon as possible and then catch up next week with the next batch of patches. So don't worry if you don't see a patch you have asked to be included that is not in here.
Quoted 6 lines
Responses should be made by Monday, March 15, 00:00:00 UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.33.1-rc1.gzand the diffstat can be found below.
Hi Greg,
Boots okay here :)
Grant.
Signature · 1 line
http://bugs.id.au/
Quoted 17 lines · Grant Coady
Quoted 15 lines · you
This is the start of the stable review cycle for the 2.6.31.1 release. There are 123 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.
Note, I still have a number of outstanding patches that have been submitted for this release. But due to the size, I figured it was best to get this release out as soon as possible and then catch up next week with the next batch of patches. So don't worry if you don't see a patch you have asked to be included that is not in here.
Responses should be made by Monday, March 15, 00:00:00 UTC. Anything received after that time might be too late.
Quoted 7 lines
Quoted 3 lines
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.33.1-rc1.gzand the diffstat can be found below.
Hi Greg,
Boots okay here :)
Wonderful, thanks for testing.
greg k-h
Re: [patch 120/123] sched: Fix sched_mv_power_savings for !SMT
In reply to Greg KHQuoted 1 line · Greg KH
2.6.33-stable review patch. If anyone has any objections, please let me know.
Hi Greg,
Thanks to pulling this into .32 and .33-stable. Please correct the subject and commit message to sched_mc_power_savings when you apply. The term sched_mv_power_savings is a typo.
"sched: Fix sched_mc_power_savings for !SMT"
Thanks,
Vaidy
Ref: http://lkml.org/lkml/2010/2/16/230
Quoted 38 lines
-----------------
From: Vaidyanathan Srinivasan <[email protected]>
commit
28f5318167adf23b16c844b9c2253f355cb21796upstream.Fix for
sched_mc_powersavigsfor pre-Nehalem platforms. Child sched domain should clearSD_PREFER_SIBLINGif parent will haveSD_POWERSAVINGS_BALANCEbecause they are contradicting.Sets the flags correctly based on
sched_mc_power_savings.Signed-off-by Vaidyanathan Srinivasan <[email protected]>Signed-off-by Peter Zijlstra <[email protected]>LKML-Reference: <[email protected]>
Signed-off-by Thomas Gleixner <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- include/linux/sched.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)include/linux/sched.h +4
-1@@ -878,7 +878,10 @@ static inline int sd_balance_for_mc_poweif (sched_smt_power_savings)return SD_POWERSAVINGS_BALANCE ; -return SD_PREFER_SIBLING ; +if (!sched_mc_power_savings) +return SD_PREFER_SIBLING ; + +return 0 ; }static inline int sd_balance_for_package_power (void )
Re: [patch 120/123] sched: Fix sched_mv_power_savings for !SMT
Quoted 11 lines · Vaidyanathan Srinivasan
Quoted 1 line · Greg KH
2.6.33-stable review patch. If anyone has any objections, please let me know.
Hi Greg,
Thanks to pulling this into .32 and .33-stable. Please correct the subject and commit message to
sched_mc_power_savingswhen you apply. The termsched_mv_power_savingsis a typo."sched: Fix
sched_mc_power_savingsfor !SMT"
I'd prefer to leave it as-is as that is what the subject is in Linus's tree.
thanks,
greg k-h
Re: [Stable-review] [patch 109/123] s3cmci: initialize default platform data no_wprotect and no_detect with 1
In reply to Greg KHThis patch does not seem to be applied to 2.6.32.y while the one
[patch 108/123] s3cmci: s3cmci_card_present: Use no_detect to decide whether there is a card detect pin
is. I checked and the only problem that makes it fail is the uncorrected comment above (revised patch attached)
Stefan
Quoted 1 line
From
e1dcbab5755d0ffa32f8f6cbeb562c769872bd7cMon Sep 17 00:00:00 2001
From: Lars-Peter Clausen <[email protected]>
Date: Fri, 5 Mar 2010 13:43:35 -0800
Subject: [PATCH] s3cmci: initialize default platform data no_wprotect and no_detect with 1
commit c212808a1ba6bfba489006399b8152a047305acf upstream.
If no platform_data was givin to the device it's going to use it's default platform data struct which has all fields initialized to zero. As a result the driver is going to try to request gpio0 both as write protect and card detect pin. Which of course will fail and makes the driver unusable
Previously to the introduction of no_wprotect and no_detect the behavior was to assume that if no platform data was given there is no write protect or card detect pin. This patch restores that behavior.
--- drivers/mmc/host/s3cmci.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/mmc/host/s3cmci.c +2 -0
@@ -1361,6 +1361,8 @@ static struct mmc_host_ops s3cmci_ops = {static struct s3c24xx_mci_pdata s3cmci_def_pdata = {/* This is currently here to avoid a number of if (host->pdata) * checks. Any zero fields to ensure reaonable defaults are picked. */ + .no_wprotect =1 , + .no_detect =1 , };#ifdef CONFIG_CPU_FREQ
Signature · 1 line
1.6.3.3
Re: [Stable-review] [patch 070/123] ath9k: re-enable ps by default for new single chip families
In reply to Greg KHQuoted 1 line · Greg KH
2.6.33-stable review patch. If anyone has any objections, please let me know.
This was intended for 2.6.32 as well. Thanks
Luis
Quoted 59 lines
-----------------
From: Luis R. Rodriguez <[email protected]>
commit
14acdde6e527950f66c084dbf19bad6fbfcaeedcupstream.The newer single chip hardware family of chipsets have not been experiencing issues with power saving set by default with recent fixes merged (even into stable). The remaining issues are only reported with AR5416 and since enabling PS by default can increase power savings considerably best to take advantage of that feature as this has been tested properly.
For more details on this issue see the bug report:
http://bugzilla.kernel.org/show_bug.cgi?id=14267
We leave AR5416 with PS disabled by default, that seems to require some more work.
Cc Peter Stuge <[email protected]>Cc Justin P. Mattock <[email protected]>Cc Kristoffer Ericson <[email protected]>Signed-off-by Luis R. Rodriguez <[email protected]>Signed-off-by John W. Linville <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>---
drivers/net/wireless/ath/ath9k/main.c | 5 ++++-1 file changed, 4 insertions(+), 1 deletion(-)drivers/net/wireless/ath/ath9k/main.c +2
-0@@ -1849,6 +1849,8 @@ bad_free_hw: void ath_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) { + struct ath_hw *ah = sc->sc_ah; +hw->flags =
IEEE80211_HW_RX_INCLUDES_FCS|IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING|IEEE80211_HW_SIGNAL_DBM|drivers/net/wireless/ath/ath9k/main.c +0
-0@@ -1866,7 +1868,8 @@ void ath_set_hw_capab(struct ath_softc *BIT(NL80211_IFTYPE_ADHOC) |
BIT(NL80211_IFTYPE_MESH_POINT);-
hw->wiphy->flags&= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
+ if (AR_SREV_5416(ah))
+hw->wiphy->flags&= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;hw->queues = 4;
hw->max_rates = 4;_______________________________________________
Stable-review mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable-review
Re: [stable] [Stable-review] [patch 070/123] ath9k: re-enable ps by default for new single chip families
Quoted 4 lines · Luis R. Rodriguez
Quoted 1 line · Greg KH
2.6.33-stable review patch. If anyone has any objections, please let me know.
This was intended for 2.6.32 as well. Thanks
Great, but it didn't apply there, so I didn't try to force it :)
Care to provide a backport?
thanks,
greg k-h
Re: [patch 114/123] dm ioctl: only issue uevent on resume if state changed
In reply to Greg KHQuoted 36 lines · Greg KH
2.6.33-stable review patch. If anyone has any objections, please let me know.
-----------------
From: Mike Snitzer <[email protected]>
commit
0f3649a9e305ea22eb196a84a2d7520afcaa6060upstream.Only issue a uevent on a resume if the state of the device changed, i.e. if it was suspended and/or its table was replaced.
Signed-off-by Dave Wysochanski <[email protected]>Signed-off-by Mike Snitzer <[email protected]>Signed-off-by Alasdair G Kergon <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/md/dm-ioctl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)drivers/md/dm-ioctl.c +4
-1@@ -897,16 +897,17 @@ static int do_resume(struct dm_ioctl *paset_disk_ro (dm_disk (md),1 ); } -if (dm_suspended_md (md)) +if (dm_suspended_md (md)) { r =dm_resume (md); +if (!r) +dm_kobject_uevent (md,KOBJ_CHANGE , param->event_nr); + }if (old_map)
drivers/md/dm-ioctl.c static int do_resume(struct dm_ioctl *pa · line 913
Quoted 10 lines
drivers/md/dm-ioctl.c +1
-3dm_table_destroy (old_map); -if (!r) { -dm_kobject_uevent (md,KOBJ_CHANGE , param->event_nr); +if (!r) r =__dev_status (md, param); - }dm_put (md);return r;
Hi Greg,
The following upstream dm-ioctl patch also needs to go to stable now that the above patch was included in 2.6.33.y.
Regards,
Mike
---
commit 3abf85b5b5851b5f28d3d8a920ebb844edd08352
Author: Peter Rajnoha <[email protected]> Date: Sat Mar 6 02:32:31 2010 +0000
dm ioctl: introduce flag indicating uevent was generated
Set a new DM_UEVENT_GENERATED_FLAG when returning from ioctls to indicate that a uevent was actually generated. This tells the userspace caller that it may need to wait for the event to be processed.
drivers/md/dm-ioctl.c +12 -7
@@ -285,7 +285,8 @@ retry:up_write (&_hash_lock); } -static int dm_hash_rename (uint32_t cookie,const char *old,const char *new) +static int dm_hash_rename (uint32_t cookie,uint32_t *flags,const char *old, +const char *new) {char *new_name, *old_name;struct hash_cell *hc;
@@ -344,7 +345,8 @@ static int dm_hash_rename(uint32_t cookie, const char *old, const char *new)dm_table_put (table); } -dm_kobject_uevent (hc->md,KOBJ_CHANGE , cookie); +if (!dm_kobject_uevent (hc->md,KOBJ_CHANGE , cookie)) + *flags |=DM_UEVENT_GENERATED_FLAG ;dm_put (hc->md);up_write (&_hash_lock);
@@ -736,10 +738,10 @@ static int dev_remove(struct dm_ioctl *param, size_t param_size)__hash_remove (hc);up_write (&_hash_lock); -dm_kobject_uevent (md,KOBJ_REMOVE , param->event_nr); +if (!dm_kobject_uevent (md,KOBJ_REMOVE , param->event_nr)) + param->flags |=DM_UEVENT_GENERATED_FLAG ;dm_put (md); - param->data_size =0 ;return 0 ; }
@@ -773,7 +775,9 @@ static int dev_rename(struct dm_ioctl *param, size_t param_size)return r; param->data_size =0 ; -return dm_hash_rename (param->event_nr, param->name, new_name); + +return dm_hash_rename (param->event_nr, ¶m->flags, param->name, + new_name); }static int dev_set_geometry (struct dm_ioctl *param,size_t param_size)
@@ -899,8 +903,8 @@ static int do_resume(struct dm_ioctl *param)if (dm_suspended_md (md)) { r =dm_resume (md); -if (!r) -dm_kobject_uevent (md,KOBJ_CHANGE , param->event_nr); +if (!r && !dm_kobject_uevent (md,KOBJ_CHANGE , param->event_nr)) + param->flags |=DM_UEVENT_GENERATED_FLAG ; }if (old_map)
@@ -1477,6 +1481,7 @@ static int validate_params(uint cmd, struct dm_ioctl *param) {/* Always clear this flag */ param->flags &= ~DM_BUFFER_FULL_FLAG ; + param->flags &= ~DM_UEVENT_GENERATED_FLAG ;/* Ignores parameters */ if (cmd == DM_REMOVE_ALL_CMD ||
drivers/md/dm.c +4 -3
@@ -2618,18 +2618,19 @@ out:/*----------------------------------------------------------------- * Event notification. *---------------------------------------------------------------*/ -void dm_kobject_uevent (struct mapped_device *md,enum kobject_action action, +int dm_kobject_uevent (struct mapped_device *md,enum kobject_action action,unsigned cookie) {char udev_cookie[DM_COOKIE_LENGTH ];char *envp[] = { udev_cookie,NULL };if (!cookie) -kobject_uevent (&disk_to_dev (md->disk)->kobj, action); +return kobject_uevent (&disk_to_dev (md->disk)->kobj, action);else {snprintf (udev_cookie,DM_COOKIE_LENGTH ,"%s=%u" ,DM_COOKIE_ENV_VAR_NAME , cookie); -kobject_uevent_env (&disk_to_dev (md->disk)->kobj, action, envp); +return kobject_uevent_env (&disk_to_dev (md->disk)->kobj, + action, envp); } }
drivers/md/dm.h +2 -2
@@ -125,8 +125,8 @@ void dm_stripe_exit(void);int dm_open_count (struct mapped_device *md);int dm_lock_for_deletion (struct mapped_device *md); -void dm_kobject_uevent (struct mapped_device *md,enum kobject_action action, -unsigned cookie); +int dm_kobject_uevent (struct mapped_device *md,enum kobject_action action, +unsigned cookie);int dm_io_init (void );void dm_io_exit (void );
include/linux/dm-ioctl.h +7 -2
@@ -266,9 +266,9 @@ enum {#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)#define DM_VERSION_MAJOR 4 -#define DM_VERSION_MINOR 16 +#define DM_VERSION_MINOR 17#define DM_VERSION_PATCHLEVEL 0 -#define DM_VERSION_EXTRA "-ioctl (2009-11-05)" +#define DM_VERSION_EXTRA "-ioctl (2010-03-05)"/* Status bits */ #define DM_READONLY_FLAG (1 << 0)/* In/Out */
@@ -316,4 +316,9 @@ enum {*/ #define DM_QUERY_INACTIVE_TABLE_FLAG (1 << 12)/* In */ +/* +* If set, a uevent was generated for which the caller may need to wait. +*/ +#define DM_UEVENT_GENERATED_FLAG (1 << 13)/* Out */ +#endif /* _LINUX_DM_IOCTL_H */
Alasdair G Kergon
maintainerRe: [patch 114/123] dm ioctl: only issue uevent on resume if state changed
Quoted 1 line · Mike Snitzer
The following upstream dm-ioctl patch also needs to go to stable now
Ack.
This is for the benefit of systems that have switched over to using udev rules to manage dm devices (instead of dm/lvm2 code). The userspace code that issued the ioctl needs to be told whether or not a uevent was issued so that it knows whether or not there is udev processing to wait for.
Alasdair
Re: [Stable-review] [stable] [patch 070/123] ath9k: re-enable ps by default for new single chip families
In reply to Greg KHQuoted 9 lines · Greg KH
Quoted 4 lines · Luis R. Rodriguez
Quoted 1 line · Greg KH
2.6.33-stable review patch. If anyone has any objections, please let me know.
This was intended for 2.6.32 as well. Thanks
Great, but it didn't apply there, so I didn't try to force it :)
Care to provide a backport?
Senthil, if you get a chance, can you send this backport? Sorry I haven't had a chance yet.
Luis
Re: [Stable-review] [patch 109/123] s3cmci: initialize default platform data no_wprotect and no_detect with 1
In reply to Stefan BaderQuoted 7 lines · Stefan Bader
This patch does not seem to be applied to 2.6.32.y while the one
[patch 108/123] s3cmci:
s3cmci_card_present: Useno_detectto decide whether there is a card detect pinis. I checked and the only problem that makes it fail is the uncorrected comment above (revised patch attached)
Thanks, now applied.
greg k-h
Re: [stable] [Stable-review] [patch 070/123] ath9k: re-enable ps by default for new single chip families
In reply to Greg KHQuoted 9 lines · Greg KH
Quoted 4 lines · Luis R. Rodriguez
Quoted 1 line · Greg KH
2.6.33-stable review patch. If anyone has any objections, please let me know.
This was intended for 2.6.32 as well. Thanks
Great, but it didn't apply there, so I didn't try to force it :)
Care to provide a backport?
Sorry, been, busy, I've put together a page to keep track of these sort of things:
http://wireless.kernel.org/en/developers/stable-pending
Luis
Re: [stable] [patch 114/123] dm ioctl: only issue uevent on resume if state changed
In reply to Alasdair G KergonQuoted 10 lines · Alasdair G Kergon
Quoted 1 line · Mike Snitzer
The following upstream dm-ioctl patch also needs to go to stable now
Ack.
This is for the benefit of systems that have switched over to using udev rules to manage dm devices (instead of dm/lvm2 code). The userspace code that issued the ioctl needs to be told whether or not a uevent was issued so that it knows whether or not there is udev processing to wait for.
Ok, it's now queued up, thanks for letting me know.
greg k-h