3.1.2-stable review
Subsystems (32)
cover 3.1.2-stable review
This is the start of the stable review cycle for the 3.1.2 release. There are 26 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let us know. If anyone is a maintainer of the proper subsystem, and wants to add a Signed-off-by: line to the patch, please respond with it.
Responses should be made by Monday, November 21, 2011, 20:00:00 UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.1.2-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Documentation/sound/alsa/HD-Audio-Models.txt | 1 + Makefile | 4 +- arch/arm/mach-at91/at91cap9_devices.c | 2 +- arch/arm/mach-at91/at91sam9g45_devices.c | 2 +- arch/arm/mach-at91/at91sam9rl_devices.c | 2 +- arch/powerpc/include/asm/sections.h | 2 +- arch/powerpc/include/asm/synch.h | 1 + arch/powerpc/kernel/kvm.c | 1 - arch/powerpc/kernel/setup_32.c | 2 + arch/powerpc/kernel/setup_64.c | 1 + arch/powerpc/kvm/book3s_hv.c | 1 + arch/powerpc/lib/feature-fixups.c | 23 ++++ arch/powerpc/platforms/ps3/interrupt.c | 23 ++++- arch/powerpc/platforms/ps3/platform.h | 1 + arch/powerpc/platforms/ps3/smp.c | 2 + arch/sh/include/asm/page.h | 5 + arch/x86/xen/enlighten.c | 3 +- block/blk-map.c | 7 +- drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/nouveau/nouveau_channel.c | 1 + drivers/gpu/drm/nouveau/nouveau_fence.c | 2 - drivers/gpu/drm/radeon/atombios_dp.c | 2 +- drivers/leds/led-class.c | 5 +- drivers/mfd/twl-core.c | 2 +- drivers/net/wireless/b43/main.c | 7 ++ drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 9 ++- drivers/staging/brcm80211/brcmsmac/mac80211_if.h | 6 + drivers/staging/brcm80211/brcmsmac/main.c | 8 ++ drivers/virtio/virtio_pci.c | 11 +- drivers/xen/gntalloc.c | 4 +- fs/hfs/trans.c | 2 + include/drm/drm_pciids.h | 2 + mm/backing-dev.c | 8 ++ security/keys/user_defined.c | 3 +- sound/pci/hda/hda_codec.c | 60 +++++++---- sound/pci/hda/patch_sigmatel.c | 11 ++ sound/soc/codecs/wm8994.c | 2 +- sound/usb/mixer.c | 120 +++++++++++++--------- 38 files changed, 245 insertions(+), 105 deletions(-)
PATCH 1/26 ALSA: hda - fix internal mic on Dell Vostro 3500 laptop
3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julian Wollrath <[email protected]>
commit f7f9bdfadfda07afb904a9767468e38c2d1a6033 upstream.
Fix the not working internal mic on Dell Vostro 3500 laptop by introducing the new model dell-vostro-3500.
--- Documentation/sound/alsa/HD-Audio-Models.txt | 1 + sound/pci/hda/patch_sigmatel.c | 11 +++++++++++ 2 files changed, 12 insertions(+)
Documentation/sound/alsa/HD-Audio-Models.txt +1 -0
@@ -408,6 +408,7 @@ STAC92HD83* ref Reference board mic-ref Reference board with power management for ports dell-s14 Dell laptop + dell-vostro-3500 Dell Vostro 3500 laptop hp HP laptops with (inverted) mute-LED hp-dv7-4000 HP dv-7 4000 auto BIOS setup (default)
sound/pci/hda/patch_sigmatel.c +11 -0
@@ -94,6 +94,7 @@ enum {STAC_92HD83XXX_REF ,STAC_92HD83XXX_PWR_REF ,STAC_DELL_S14 , +STAC_DELL_VOSTRO_3500 ,STAC_92HD83XXX_HP , STAC_92HD83XXX_HP_cNB11_INTQUAD, STAC_HP_DV7_4000,
@@ -1658,6 +1659,12 @@ static const unsigned int dell_s14_pin_c 0x40f000f0, 0x40f000f0, }; +static const unsigned int dell_vostro_3500_pin_configs[10 ] = { +0x02a11020 ,0x0221101f ,0x400000f0 ,0x90170110 , +0x400000f1 ,0x400000f2 ,0x400000f3 ,0x90a60160 , +0x400000f4 ,0x400000f5 , +}; +static const unsigned int hp_dv7_4000_pin_configs[10 ] = {0x03a12050 ,0x0321201f ,0x40f000f0 ,0x90170110 ,0x40f000f0 ,0x40f000f0 ,0x90170110 ,0xd5a30140 ,
@@ -1674,6 +1681,7 @@ static const unsigned int *stac92hd83xxx [STAC_92HD83XXX_REF] = ref92hd83xxx_pin_configs, [STAC_92HD83XXX_PWR_REF] = ref92hd83xxx_pin_configs, [STAC_DELL_S14] = dell_s14_pin_configs, + [STAC_DELL_VOSTRO_3500] = dell_vostro_3500_pin_configs, [STAC_92HD83XXX_HP_cNB11_INTQUAD] = hp_cNB11_intquad_pin_configs, [STAC_HP_DV7_4000] = hp_dv7_4000_pin_configs, };
@@ -1683,6 +1691,7 @@ static const char * const stac92hd83xxx_ [STAC_92HD83XXX_REF] = "ref", [STAC_92HD83XXX_PWR_REF] = "mic-ref", [STAC_DELL_S14] = "dell-s14", + [STAC_DELL_VOSTRO_3500] = "dell-vostro-3500", [STAC_92HD83XXX_HP] = "hp", [STAC_92HD83XXX_HP_cNB11_INTQUAD] = "hp_cNB11_intquad", [STAC_HP_DV7_4000] = "hp-dv7-4000",
@@ -1696,6 +1705,8 @@ static const struct snd_pci_quirk stac92 "DFI LanParty", STAC_92HD83XXX_REF),SND_PCI_QUIRK (PCI_VENDOR_ID_DELL ,0x02ba ,"unknown Dell" ,STAC_DELL_S14 ), +SND_PCI_QUIRK (PCI_VENDOR_ID_DELL ,0x1028 , +"Dell Vostro 3500" ,STAC_DELL_VOSTRO_3500 ),SND_PCI_QUIRK_MASK (PCI_VENDOR_ID_HP ,0xff00 ,0x3600 ,"HP" ,STAC_92HD83XXX_HP ), SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1656,
PATCH 2/26 ALSA: hda - Dont add elements of other codecs to vmaster slave
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit aeb4b88ec0a948efce8e3a23a8f964d3560a7308 upstream.
When a virtual mater control is created, the driver looks for slave elements from the assigned card instance. But this may include the elements of other codecs when multiple codecs are on the same HD-audio bus. This works at the first time, but it'll give Oops when it's once freed and re-created via reconfig sysfs.
This patch changes the element-look-up strategy to limit only to the mixer elements of the same codec.
--- sound/pci/hda/hda_codec.c | 60 +++++++++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 21 deletions(-)
sound/pci/hda/hda_codec.c +39 -21
@@ -2296,6 +2296,39 @@ int snd_hda_codec_reset(struct hda_codecreturn 0 ; } +typedef int (*map_slave_func_t )(void *,struct snd_kcontrol *); + +/* apply the function to all matching slave ctls in the mixer list */ +static int map_slaves (struct hda_codec *codec,const char *const *slaves, +map_slave_func_t func,void *data) +{ +struct hda_nid_item *items; +const char *const *s; +int i, err; + + items = codec->mixers.list; +for (i =0 ; i < codec->mixers.used; i++) { +struct snd_kcontrol *sctl = items[i].kctl; +if (!sctl || !sctl->id.name || + sctl->id.iface !=SNDRV_CTL_ELEM_IFACE_MIXER ) +continue ; +for (s = slaves; *s; s++) { +if (!strcmp (sctl->id.name, *s)) { + err =func (data, sctl); +if (err) +return err; +break ; + } + } + } +return 0 ; +} + +static int check_slave_present (void *data,struct snd_kcontrol *sctl) +{ +return 1 ; +} +/** * snd_hda_add_vmaster - create a virtual master control and add slaves * @codec: HD-audio codec
@@ -2316,12 +2349,10 @@ int snd_hda_add_vmaster(struct hda_codec unsigned int *tlv, const char * const *slaves) { struct snd_kcontrol *kctl; -const char *const *s;int err; -for (s = slaves; *s && !snd_hda_find_mixer_ctl (codec, *s); s++) - ; -if (!*s) { + err =map_slaves (codec, slaves, check_slave_present,NULL ); +if (err !=1 ) {snd_printdd ("No slave found for %s\n" , name);return 0 ; }
@@ -2332,23 +2363,10 @@ int snd_hda_add_vmaster(struct hda_codecif (err <0 )return err; -for (s = slaves; *s; s++) { -struct snd_kcontrol *sctl; -int i =0 ; -for (;;) { - sctl =_snd_hda_find_mixer_ctl (codec, *s, i); -if (!sctl) { -if (!i) -snd_printdd ("Cannot find slave %s, " -"skipped\n" , *s); -break ; - } - err =snd_ctl_add_slave (kctl, sctl); -if (err <0 ) -return err; - i++; - } - } + err =map_slaves (codec, slaves, (map_slave_func_t )snd_ctl_add_slave, + kctl); +if (err <0 ) +return err;return 0 ; }EXPORT_SYMBOL_HDA (snd_hda_add_vmaster);
PATCH 3/26 virtio-pci: fix use after free
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Michael S. Tsirkin" <[email protected]>
commit 72103bd1285211440621f2c46f4fce377584de54 upstream.
Commit 31a3ddda166cda86d2b5111e09ba4bda5239fae6 introduced a use after free in virtio-pci. The main issue is that the release method signals removal of the virtio device, while remove signals removal of the pci device.
For example, on driver removal or hot-unplug, virtio_pci_release_dev is called before virtio_pci_remove. We then might get a crash as virtio_pci_remove tries to use the device freed by virtio_pci_release_dev.
We allocate/free all resources together with the pci device, so we can leave the release method empty.
--- drivers/virtio/virtio_pci.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/virtio/virtio_pci.c +6 -5
@@ -590,11 +590,11 @@ static struct virtio_config_ops virtio_pstatic void virtio_pci_release_dev (struct device *_d) { - struct virtio_device *dev = container_of(_d, struct virtio_device, - dev); -struct virtio_pci_device *vp_dev =to_vp_device (dev); - -kfree (vp_dev); +/* +* No need for a release method as we allocate/free +* all devices together with the pci devices. +* Provide an empty one to avoid getting a warning from core. +*/ }/* the PCI probing function */
@@ -682,6 +682,7 @@ static void __devexit virtio_pci_remove(pci_iounmap (pci_dev, vp_dev->ioaddr);pci_release_regions (pci_dev);pci_disable_device (pci_dev); +kfree (vp_dev); }#ifdef CONFIG_PM
PATCH 4/26 ARM: at91: Fix USBA gadget registration
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jochen Friedrich <[email protected]>
commit dd0b3825495a2e7a8cd6cf0ec077618c008ac7c4 upstream.
Since 193ab2a6070039e7ee2b9b9bebea754a7c52fd1b, various AT91 boards don't register USBA adapters anymore due to depending on a now non-existing symbol. Fix the symbol name.
--- arch/arm/mach-at91/at91cap9_devices.c | 2 +- arch/arm/mach-at91/at91sam9g45_devices.c | 2 +- arch/arm/mach-at91/at91sam9rl_devices.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-at91/at91cap9_devices.c +1 -1
@@ -92,7 +92,7 @@ void __init at91_add_device_usbh(struct* USB HS Device (Gadget) * -------------------------------------------------------------------- */ -#if defined(CONFIG_USB_GADGET_ATMEL_USBA) || defined(CONFIG_USB_GADGET_ATMEL_USBA_MODULE) +#if defined(CONFIG_USB_ATMEL_USBA) || defined(CONFIG_USB_ATMEL_USBA_MODULE) static struct resource usba_udc_resources[] = { [0] = {
arch/arm/mach-at91/at91sam9g45_devices.c +1 -1
@@ -191,7 +191,7 @@ void __init at91_add_device_usbh_ehci(st* USB HS Device (Gadget) * -------------------------------------------------------------------- */ -#if defined(CONFIG_USB_GADGET_ATMEL_USBA) || defined(CONFIG_USB_GADGET_ATMEL_USBA_MODULE) +#if defined(CONFIG_USB_ATMEL_USBA) || defined(CONFIG_USB_ATMEL_USBA_MODULE) static struct resource usba_udc_resources[] = { [0] = { .start = AT91SAM9G45_UDPHS_FIFO,
arch/arm/mach-at91/at91sam9rl_devices.c +1 -1
@@ -75,7 +75,7 @@ void __init at91_add_device_hdmac(void)* USB HS Device (Gadget) * -------------------------------------------------------------------- */ -#if defined(CONFIG_USB_GADGET_ATMEL_USBA) || defined(CONFIG_USB_GADGET_ATMEL_USBA_MODULE) +#if defined(CONFIG_USB_ATMEL_USBA) || defined(CONFIG_USB_ATMEL_USBA_MODULE) static struct resource usba_udc_resources[] = { [0] = {
PATCH 5/26 ASoC: Dont use wm8994->control_data in wm8994_readable_register()
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit 8eeea521d9d0fa6afd62df8c6e6566ee946117fa upstream.
The field is no longer initialised so this will crash if running on wm8958.
--- sound/soc/codecs/wm8994.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm8994.c +1 -1
@@ -56,7 +56,7 @@ static int wm8994_retune_mobile_base[] =static int wm8994_readable (struct snd_soc_codec *codec,unsigned int reg) {struct wm8994_priv *wm8994 =snd_soc_codec_get_drvdata (codec); -struct wm8994 *control = wm8994->control_data; +struct wm8994 *control = codec->control_data;switch (reg) {case WM8994_GPIO_1 :
PATCH 6/26 sh: Fix cached/uncaced address calculation in 29bit mode
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nobuhiro Iwamatsu <[email protected]>
commit dfd3b596fbbfa48b8e7966ef996d587157554b69 upstream.
In the case of 29bit mode, CAC/UNCAC_ADDR does not return a right address. This revises this problem by using P1SEGADDR and P2SEGADDR in 29bit mode.
--- arch/sh/include/asm/page.h | 5 +++++ 1 file changed, 5 insertions(+)
arch/sh/include/asm/page.h +5 -0
@@ -141,8 +141,13 @@ typedef struct page *pgtable_t;#endif /* !__ASSEMBLY__ */ #ifdef CONFIG_UNCACHED_MAPPING +#if defined(CONFIG_29BIT ) +#define UNCAC_ADDR (addr) P2SEGADDR(addr) +#define CAC_ADDR (addr) P1SEGADDR(addr) +#else #define UNCAC_ADDR (addr) ((addr) - PAGE_OFFSET + uncached_start)#define CAC_ADDR (addr) ((addr) - uncached_start + PAGE_OFFSET) +#endif #else #define UNCAC_ADDR (addr) ((addr))#define CAC_ADDR (addr) ((addr))
PATCH 7/26 drm/i915: Fix object refcount leak on mmappable size limit error path.
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Anholt <[email protected]>
commit 14660ccd599dc7bd6ecef17408bd76dc853f9b77 upstream.
I've been seeing memory leaks on my system in the form of large (300-400MB) GEM objects created by now-dead processes laying around clogging up memory. I usually notice when it gets to about 1.2GB of them. Hopefully this clears up the issue, but I just found this bug by inspection.
--- drivers/gpu/drm/i915/i915_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +1 -1
@@ -1475,7 +1475,7 @@ i915_gem_mmap_gtt(struct drm_file *file,if (obj->base.size > dev_priv->mm.gtt_mappable_end) { ret = -E2BIG ; - goto unlock; + goto out; }if (obj->madv !=I915_MADV_WILLNEED ) {
PATCH 8/26 drm/nouveau: initialize chan->fence.lock before use
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcin Slusarz <[email protected]>
commit 5e60ee780e792efe6dce97eceb110b1d30bab850 upstream.
Fence lock needs to be initialized before any call to nouveau_channel_put because it calls nouveau_channel_idle->nouveau_fence_update which uses fence lock.
BUG: spinlock bad magic on CPU#0, test/24134 lock: ffff88019f90dba8, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0 Pid: 24134, comm: test Not tainted 3.0.0-nv+ #800 Call Trace: spin_bug+0x9c/0xa3 do_raw_spin_lock+0x29/0x13c _raw_spin_lock+0x1e/0x22 nouveau_fence_update+0x2d/0xf1 nouveau_channel_idle+0x22/0xa0 nouveau_channel_put_unlocked+0x84/0x1bd nouveau_channel_put+0x20/0x24 nouveau_channel_alloc+0x4ec/0x585 nouveau_ioctl_fifo_alloc+0x50/0x130 drm_ioctl+0x289/0x361 do_vfs_ioctl+0x4dd/0x52c sys_ioctl+0x42/0x65 system_call_fastpath+0x16/0x1b
It's easily triggerable from userspace.
Additionally remove double initialization of chan->fence.pending.
--- drivers/gpu/drm/nouveau/nouveau_channel.c | 1 + drivers/gpu/drm/nouveau/nouveau_fence.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_channel.c +1 -0
@@ -158,6 +158,7 @@ nouveau_channel_alloc(struct drm_deviceINIT_LIST_HEAD (&chan->nvsw.vbl_wait);INIT_LIST_HEAD (&chan->nvsw.flip);INIT_LIST_HEAD (&chan->fence.pending); +spin_lock_init (&chan->fence.lock);/* setup channel's memory and vm */ ret =nouveau_gpuobj_channel_init (chan, vram_handle, gart_handle);
drivers/gpu/drm/nouveau/nouveau_fence.c +0 -2
@@ -539,8 +539,6 @@ nouveau_fence_channel_init(struct nouveareturn ret; } -INIT_LIST_HEAD (&chan->fence.pending); -spin_lock_init (&chan->fence.lock);atomic_set (&chan->fence.last_sequence_irq,0 );return 0 ; }
PATCH 9/26 drm/radeon/kms: make an aux failure debug only
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 091264f0bc12419560ac64fcef4567809d611658 upstream.
Can happen when there is no DP panel attached, confusing users. Make it debug only.
--- drivers/gpu/drm/radeon/atombios_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/atombios_dp.c +1 -1
@@ -283,7 +283,7 @@ int radeon_dp_i2c_aux_ch(struct i2c_adap } } -DRM_ERROR ("aux i2c too many retries, giving up\n" ); +DRM_DEBUG_KMS ("aux i2c too many retries, giving up\n" );return -EREMOTEIO ; }
PATCH 10/26 ALSA: usb-audio - Check the dB-range validity in the later read, too
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 9fcd0ab130579d9742538340edda3225f2b49a3e upstream.
When the initial check of dB-range failed due to the read error, try to check again at the later read, too. When an invalid dB range is found, remove TLV flags and notify the mixer info change.
--- sound/usb/mixer.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
sound/usb/mixer.c +11 -2
@@ -881,8 +881,17 @@ static int mixer_ctl_feature_info(struct uinfo->value.integer.min =0 ; uinfo->value.integer.max =1 ; }else { -if (! cval->initialized) -get_min_max (cval,0 ); +if (!cval->initialized) { +get_min_max (cval,0 ); +if (cval->initialized && cval->dBmin >= cval->dBmax) { + kcontrol->vd[0 ].access &= + ~(SNDRV_CTL_ELEM_ACCESS_TLV_READ | +SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK ); +snd_ctl_notify (cval->mixer->chip->card, +SNDRV_CTL_EVENT_MASK_INFO , + &kcontrol->id); + } + } uinfo->value.integer.min =0 ; uinfo->value.integer.max = (cval->max - cval->min + cval->res -1 ) / cval->res;
PATCH 11/26 ALSA: usb-audio - Fix the missing volume quirks at delayed init
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit dcaaf9f2c16b56f8bb316881fcd3f15c18fc71e7 upstream.
In the recent usb-audio driver, the initialization of volume ranges may be delayed when the device doesn't respond well at the probing time. But the volume quirks for certain devices are applied only in mixer_ctl_feature_info() thus only at the very first probe and will be missing when the volume range is initialized later.
This patch moves the volume quirk code to be always called from the volume-range extraction (get_min_max()), so that the quirks are properly applied in the later init time.
--- sound/usb/mixer.c | 109 +++++++++++++++++++++++++++++------------------------- 1 file changed, 59 insertions(+), 50 deletions(-)
sound/usb/mixer.c +59 -50
@@ -765,10 +765,60 @@ static void usb_mixer_elem_free(struct s* interface to ALSA control for feature/mixer units */ +/* volume control quirks */ +static void volume_control_quirks (struct usb_mixer_elem_info *cval, +struct snd_kcontrol *kctl) +{ +switch (cval->mixer->chip->usb_id) { +case USB_ID (0x0471 ,0x0101 ): +case USB_ID (0x0471 ,0x0104 ): +case USB_ID (0x0471 ,0x0105 ): +case USB_ID (0x0672 ,0x1041 ): +/* quirk for UDA1321/N101. +* note that detection between firmware 2.1.1.7 (N101) +* and later 2.1.1.21 is not very clear from datasheets. +* I hope that the min value is -15360 for newer firmware --jk +*/ +if (!strcmp (kctl->id.name,"PCM Playback Volume" ) && + cval->min ==-15616 ) { +snd_printk (KERN_INFO +"set volume quirk for UDA1321/N101 chip\n" ); + cval->max =-256 ; + } +break ; + +case USB_ID (0x046d ,0x09a4 ): +if (!strcmp (kctl->id.name,"Mic Capture Volume" )) { +snd_printk (KERN_INFO +"set volume quirk for QuickCam E3500\n" ); + cval->min =6080 ; + cval->max =8768 ; + cval->res =192 ; + } +break ; + +case USB_ID (0x046d ,0x0808 ): +case USB_ID (0x046d ,0x0809 ): +case USB_ID (0x046d ,0x0991 ): +/* Most audio usb devices lie about volume resolution. +* Most Logitech webcams have res = 384. +* Proboly there is some logitech magic behind this number --fishor +*/ +if (!strcmp (kctl->id.name,"Mic Capture Volume" )) { +snd_printk (KERN_INFO +"set resolution quirk: cval->res = 384\n" ); + cval->res =384 ; + } +break ; + + } +} +/* * retrieve the minimum and maximum values for the specified control */ -static int get_min_max (struct usb_mixer_elem_info *cval,int default_min) +static int get_min_max_with_quirks (struct usb_mixer_elem_info *cval, +int default_min,struct snd_kcontrol *kctl) {/* for failsafe */ cval->min = default_min;
@@ -844,6 +894,9 @@ static int get_min_max(struct usb_mixer_ cval->initialized =1 ; } +if (kctl) +volume_control_quirks (cval, kctl); +/* USB descriptions contain the dB scale in 1/256 dB unit * while ALSA TLV contains in 1/100 dB unit */
@@ -864,6 +917,7 @@ static int get_min_max(struct usb_mixer_return 0 ; } +#define get_min_max (cval, def) get_min_max_with_quirks(cval, def, NULL)/* get a feature/mixer unit info */ static int mixer_ctl_feature_info (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_info *uinfo)
@@ -882,7 +936,7 @@ static int mixer_ctl_feature_info(struct uinfo->value.integer.max =1 ; }else {if (!cval->initialized) { -get_min_max (cval,0 ); +get_min_max_with_quirks (cval,0 , kcontrol);if (cval->initialized && cval->dBmin >= cval->dBmax) { kcontrol->vd[0].access &= ~(SNDRV_CTL_ELEM_ACCESS_TLV_READ |
@@ -1045,9 +1099,6 @@ static void build_feature_ctl(struct mix cval->ch_readonly = readonly_mask; } -/* get min/max values */ -get_min_max (cval,0 ); -/* if all channels in the mask are marked read-only, make the control * read-only. set_cur_mix_value() will check the mask again and won't * issue write commands to read-only channels. */
@@ -1069,6 +1120,9 @@ static void build_feature_ctl(struct mix len =snd_usb_copy_string_desc (state, nameid, kctl->id.name,sizeof (kctl->id.name)); +/* get min/max values */ +get_min_max_with_quirks (cval,0 , kctl); +switch (control) {case UAC_FU_MUTE :case UAC_FU_VOLUME :
@@ -1118,51 +1172,6 @@ static void build_feature_ctl(struct mixbreak ; } -/* volume control quirks */ -switch (state->chip->usb_id) { -case USB_ID (0x0471 ,0x0101 ): -case USB_ID (0x0471 ,0x0104 ): -case USB_ID (0x0471 ,0x0105 ): -case USB_ID (0x0672 ,0x1041 ): -/* quirk for UDA1321/N101. -* note that detection between firmware 2.1.1.7 (N101) -* and later 2.1.1.21 is not very clear from datasheets. -* I hope that the min value is -15360 for newer firmware --jk -*/ -if (!strcmp (kctl->id.name,"PCM Playback Volume" ) && - cval->min ==-15616 ) { -snd_printk (KERN_INFO -"set volume quirk for UDA1321/N101 chip\n" ); - cval->max =-256 ; - } -break ; - -case USB_ID (0x046d ,0x09a4 ): -if (!strcmp (kctl->id.name,"Mic Capture Volume" )) { -snd_printk (KERN_INFO -"set volume quirk for QuickCam E3500\n" ); - cval->min =6080 ; - cval->max =8768 ; - cval->res =192 ; - } -break ; - -case USB_ID (0x046d ,0x0808 ): -case USB_ID (0x046d ,0x0809 ): -case USB_ID (0x046d ,0x0991 ): -/* Most audio usb devices lie about volume resolution. -* Most Logitech webcams have res = 384. -* Proboly there is some logitech magic behind this number --fishor -*/ -if (!strcmp (kctl->id.name,"Mic Capture Volume" )) { -snd_printk (KERN_INFO -"set resolution quirk: cval->res = 384\n" ); - cval->res =384 ; - } -break ; - - } - range = (cval->max - cval->min) / cval->res;/* Are there devices with volume range more than 255? I use a bit more * to be sure. 384 is a resolution magic number found on Logitech
PATCH 12/26 KEYS: Fix a NULL pointer deref in the user-defined key type
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
commit 9f35a33b8d06263a165efe3541d9aa0cdbd70b3b upstream.
Fix a NULL pointer deref in the user-defined key type whereby updating a negative key into a fully instantiated key will cause an oops to occur when the code attempts to free the non-existent old payload.
This results in an oops that looks something like the following:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 IP: [<ffffffff81085fa1>] __call_rcu+0x11/0x13e PGD 3391d067 PUD 3894a067 PMD 0 Oops: 0002 [#1] SMP CPU 1 Pid: 4354, comm: keyctl Not tainted 3.1.0-fsdevel+ #1140 /DG965RY RIP: 0010:[<ffffffff81085fa1>] [<ffffffff81085fa1>] __call_rcu+0x11/0x13e RSP: 0018:ffff88003d591df8 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 000000000000006e RDX: ffffffff8161d0c0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff88003d591e18 R08: 0000000000000000 R09: ffffffff8152fa6c R10: 0000000000000000 R11: 0000000000000300 R12: ffff88003b8f9538 R13: ffffffff8161d0c0 R14: ffff88003b8f9d50 R15: ffff88003c69f908 FS: 00007f97eb18c720(0000) GS:ffff88003bd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000008 CR3: 000000003d47a000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process keyctl (pid: 4354, threadinfo ffff88003d590000, task ffff88003c78a040) Stack: ffff88003e0ffde0 ffff88003b8f9538 0000000000000001 ffff88003b8f9d50 ffff88003d591e28 ffffffff810860f0 ffff88003d591e68 ffffffff8117bfea ffff88003d591e68 ffffffff00000000 ffff88003e0ffde1 ffff88003e0ffde0 Call Trace: [<ffffffff810860f0>] call_rcu_sched+0x10/0x12 [<ffffffff8117bfea>] user_update+0x8d/0xa2 [<ffffffff8117723a>] key_create_or_update+0x236/0x270 [<ffffffff811789b1>] sys_add_key+0x123/0x17e [<ffffffff813b84bb>] system_call_fastpath+0x16/0x1b
--- security/keys/user_defined.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
security/keys/user_defined.c +2 -1
@@ -102,7 +102,8 @@ int user_update(struct key *key, const v key->expiry =0 ; } -kfree_rcu (zap, rcu); +if (zap) +kfree_rcu (zap, rcu); error:return ret;
PATCH 13/26 hfs: add sanity check for file name length
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit bc5b8a9003132ae44559edd63a1623b7b99dfb68 upstream.
On a corrupted file system the ->len field could be wrong leading to a buffer overflow.
--- fs/hfs/trans.c | 2 ++ 1 file changed, 2 insertions(+)
fs/hfs/trans.c +2 -0
@@ -40,6 +40,8 @@ int hfs_mac2asc(struct super_block *sb, src = in->name; srclen = in->len; +if (srclen >HFS_NAMELEN ) + srclen =HFS_NAMELEN ; dst = out; dstlen =HFS_MAX_NAMELEN ;if (nls_io) {
PATCH 14/26 Revert "leds: save the delay values after a successful call to blink_set()"
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit cb871513f656bdfc48b185b55f37857b5c750c40 upstream.
Revert commit 6123b0e274503a0d3588e84fbe07c9aa01bfaf5d.
The problem this patch intends to solve has alreadqy been fixed by commit 7a5caabd090b ("drivers/leds/ledtrig-timer.c: fix broken sysfs delay handling").
--- drivers/leds/led-class.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/leds/led-class.c +1 -4
@@ -270,11 +270,8 @@ void led_blink_set(struct led_classdev *del_timer_sync (&led_cdev->blink_timer);if (led_cdev->blink_set && - !led_cdev->blink_set (led_cdev, delay_on, delay_off)) { - led_cdev->blink_delay_on = *delay_on; - led_cdev->blink_delay_off = *delay_off; + !led_cdev->blink_set (led_cdev, delay_on, delay_off))return ; - }/* blink with 1 Hz as default if nothing specified */ if (!*delay_on && !*delay_off)
PATCH 15/26 drm/radeon: add some missing FireMV pci ids
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit b872a37437e93df9d112ce674752b3b3a0a17020 upstream.
Noticed by Egbert.
--- include/drm/drm_pciids.h | 2 ++ 1 file changed, 2 insertions(+)
include/drm/drm_pciids.h +2 -0
@@ -4,6 +4,7 @@*/ #define radeon_PCI_IDS \ {0x1002, 0x3150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ + {0x1002, 0x3151, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x3152, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x3154, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ {0x1002, 0x3155, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
@@ -55,6 +56,7 @@ {0x1002, 0x4C64, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \ {0x1002, 0x4C66, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \ {0x1002, 0x4C67, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV250|RADEON_IS_MOBILITY}, \ + {0x1002, 0x4C6E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|RADEON_IS_MOBILITY}, \ {0x1002, 0x4E44, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \ {0x1002, 0x4E45, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \ {0x1002, 0x4E46, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R300}, \
PATCH 16/26 staging: brcm80211: fill in proper rx rate in mac80211 rx status
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arend van Spriel <[email protected]>
commit 5a84d6ad4c9306afb467a600a4c6d7b50da49440 upstream.
The brcmsmac driver supports different rates on 5GHz but this is not taken into account when providing the rate index in the receive status information passed to mac80211.
--- drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 9 +++++++-- drivers/staging/brcm80211/brcmsmac/mac80211_if.h | 6 ++++++ drivers/staging/brcm80211/brcmsmac/main.c | 8 ++++++++ 3 files changed, 21 insertions(+), 2 deletions(-)
drivers/staging/brcm80211/brcmsmac/mac80211_if.c +7 -2
@@ -975,6 +975,10 @@ static struct ieee80211_channel brcms_5g .hw_value = (rate100m / 5), \ } +/* +* The rate table is used for both 2.4G and 5G rates. The +* latter being a subset as it does not support CCK rates. +*/ static struct ieee80211_rate legacy_ratetable[] = {RATE (10 ,0 ),RATE (20 ,IEEE80211_RATE_SHORT_PREAMBLE ),
@@ -1016,8 +1020,9 @@ static struct ieee80211_supported_band b .band = IEEE80211_BAND_5GHZ, .channels = brcms_5ghz_nphy_chantable, .n_channels = ARRAY_SIZE(brcms_5ghz_nphy_chantable), - .bitrates = legacy_ratetable + 4, - .n_bitrates = ARRAY_SIZE(legacy_ratetable) - 4, + .bitrates = legacy_ratetable + BRCMS_LEGACY_5G_RATE_OFFSET, + .n_bitrates =ARRAY_SIZE (legacy_ratetable) - + BRCMS_LEGACY_5G_RATE_OFFSET, .ht_cap = {/* use IEEE80211_HT_CAP_* from include/linux/ieee80211.h */ .cap = IEEE80211_HT_CAP_GRN_FLD | IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_40MHZ_INTOLERANT, /* No 40 mhz yet */
drivers/staging/brcm80211/brcmsmac/mac80211_if.h +6 -0
@@ -20,6 +20,12 @@#include <linux/timer.h> #include <linux/interrupt.h> +/* +* Starting index for 5G rates in the +* legacy rate table. +*/ +#define BRCMS_LEGACY_5G_RATE_OFFSET 4 +/* softmac ioctl definitions */ #define BRCMS_SET_SHORTSLOT_OVERRIDE 146
drivers/staging/brcm80211/brcmsmac/main.c +8 -0
@@ -4608,6 +4608,14 @@ prep_mac80211_status(struct brcms_c_infowiphy_err (wlc->wiphy,"%s: Unknown rate\n" , __func__); } +/* +* For 5GHz, we should decrease the index as it is +* a subset of the 2.4G rates. See bitrates field +* of brcms_band_5GHz_nphy (in mac80211_if.c). +*/ +if (rx_status->band ==IEEE80211_BAND_5GHZ ) + rx_status->rate_idx -=BRCMS_LEGACY_5G_RATE_OFFSET ; +/* Determine short preamble and rate_idx */ preamble =0 ;if (IS_CCK (rspec)) {
PATCH 17/26 b43: refuse to load unsupported firmware
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
[This patch is supposed to be applied in 3.1 (and maybe older) branches only.]
New kernels support newer firmware that users may try to incorrectly use with older kernels. Display error and explain the problem in such a case
--- drivers/net/wireless/b43/main.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/wireless/b43/main.c +7 -0
@@ -2508,6 +2508,13 @@ static int b43_upload_microcode(struct bb43_print_fw_helptext (dev->wl,1 ); err = -EOPNOTSUPP ; goto error; + }else if (fwrev >=598 ) { +b43err (dev->wl,"YOUR FIRMWARE IS TOO NEW. Support for " +"firmware 598 and up requires kernel 3.2 or newer. You " +"have to install older firmware or upgrade kernel.\n" ); +b43_print_fw_helptext (dev->wl,1 ); + err = -EOPNOTSUPP ; + goto error; } dev->fw.rev = fwrev; dev->fw.patch = fwpatch;
Re: [17/26] b43: refuse to load unsupported firmware
Quoted 19 lines · Greg KH
3.1-stable review patch. If anyone has any objections, please let me know.
------------------
[This patch is supposed to be applied in 3.1 (and maybe older) branches only.]
New kernels support newer firmware that users may try to incorrectly use with older kernels. Display error and explain the problem in such a case
Signed-off-by RafaÅ MiÅecki <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/net/wireless/b43/main.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/wireless/b43/main.c static int b43_upload_microcode(struct b · line 2517
Quoted 10 lines
drivers/net/wireless/b43/main.c +7
-0@@ -2508,6 +2508,13 @@ static int b43_upload_microcode(struct bb43_print_fw_helptext (dev->wl,1 ); err = -EOPNOTSUPP ; goto error; + }else if (fwrev >=598 ) { +b43err (dev->wl,"YOUR FIRMWARE IS TOO NEW. Support for " +"firmware 598 and up requires kernel 3.2 or newer. You " +"have to install older firmware or upgrade kernel.\n" ); +b43_print_fw_helptext (dev->wl,1 ); + err = -EOPNOTSUPP ; + goto error;
[...]
Again, I strongly object to this way of handling the incompatibility. The revision check is fine, but the solution must be to assign a different filename for the newer revisions. The changes to 3.0/3.1 should be deferred until this is resolved.
Ben.
Signature · 2 lines
Ben Hutchings The world is coming to an end. Please log off.
Re: [17/26] b43: refuse to load unsupported firmware
Quoted 32 lines · Ben Hutchings
Quoted 29 lines · Greg KH
3.1-stable review patch. If anyone has any objections, please let me know.
------------------
[This patch is supposed to be applied in 3.1 (and maybe older) branches only.]
New kernels support newer firmware that users may try to incorrectly use with older kernels. Display error and explain the problem in such a case
Signed-off-by Rafał Miłecki <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/net/wireless/b43/main.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/net/wireless/b43/main.c +7
-0@@ -2508,6 +2508,13 @@ static int b43_upload_microcode(struct bb43_print_fw_helptext (dev->wl,1 ); err = -EOPNOTSUPP ; goto error; + }else if (fwrev >=598 ) { +b43err (dev->wl,"YOUR FIRMWARE IS TOO NEW. Support for " +"firmware 598 and up requires kernel 3.2 or newer. You " +"have to install older firmware or upgrade kernel.\n" ); +b43_print_fw_helptext (dev->wl,1 ); + err = -EOPNOTSUPP ; + goto error;[...]
Quoted 4 lines
Again, I strongly object to this way of handling the incompatibility. The revision check is fine, but the solution must be to assign a different filename for the newer revisions. The changes to 3.0/3.1 should be deferred until this is resolved.
You can object, however the driver author and maintainer wants it done this way for now, so that's a valid solution that I have to accept. It solves real bugs that people have already hit when running the 3.0 and 3.1 kernels. Propagating a userspace tool change for those systems would be much harder, if not impossible, don't you think? It would also require a much more intrusive change to the driver infrastructure to handle such a proposed change.
thanks,
greg k-h
Re: [17/26] b43: refuse to load unsupported firmware
Quoted 38 lines · Greg KH
Quoted 32 lines · Ben Hutchings
Quoted 29 lines · Greg KH
3.1-stable review patch. If anyone has any objections, please let me know.
------------------
[This patch is supposed to be applied in 3.1 (and maybe older) branches only.]
New kernels support newer firmware that users may try to incorrectly use with older kernels. Display error and explain the problem in such a case
Signed-off-by RafaÅ MiÅecki <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/net/wireless/b43/main.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/net/wireless/b43/main.c +7
-0@@ -2508,6 +2508,13 @@ static int b43_upload_microcode(struct bb43_print_fw_helptext (dev->wl,1 ); err = -EOPNOTSUPP ; goto error; + }else if (fwrev >=598 ) { +b43err (dev->wl,"YOUR FIRMWARE IS TOO NEW. Support for " +"firmware 598 and up requires kernel 3.2 or newer. You " +"have to install older firmware or upgrade kernel.\n" ); +b43_print_fw_helptext (dev->wl,1 ); + err = -EOPNOTSUPP ; + goto error;[...]
Quoted 4 lines
Again, I strongly object to this way of handling the incompatibility. The revision check is fine, but the solution must be to assign a different filename for the newer revisions. The changes to 3.0/3.1 should be deferred until this is resolved.
Quoted 4 lines
You can object, however the driver author and maintainer wants it done this way for now, so that's a valid solution that I have to accept. It solves real bugs that people have already hit when running the 3.0 and 3.1 kernels.
The revision check fixes a bug, yes. What I'm concerned about is the cop-out error message: 'We didn't deal with versioning properly, so you get to solve the problem.' It should be possible to reboot between multiple installed kernel versions without modifying files.
Quoted 4 lines
Propagating a userspace tool change for those systems
would be much harder, if not impossible, don't you think? It would also require a much more intrusive change to the driver infrastructure to handle such a proposed change.
It is the new kernel version and firmware files that should be changed, not the old ones.
There is another option which is to use the /lib/firmware/<kernel-ver> directories to separate incompatible firmware versions. That is not nearly as good as using a API/ABI number in the filename, but it would work and the error message could suggest it.
Ben.
Signature · 2 lines
Ben Hutchings The world is coming to an end. Please log off.
PATCH 18/26 mfd: Fix twl4030 dependencies for audio codec
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Weber <[email protected]>
commit f09ee0451a44a4e913a7c3cec3805508f7de6c54 upstream.
The codec for Devkit8000 (TWL4030) was not detected except when build with CONFIG_SND_SOC_ALL_CODECS.
twl-core.c still uses the CONFIG_TWL4030_CODEC for twl_has_codec().
In commit 57fe7251f5bfc4332f24479376de48a1e8ca6211 the CONFIG_TWL4030_CODEC was renamed
into CONFIG_MFD_TWL4030_AUDIO, thatswhy the codec was not detected.
This patch renames the CONFIG_ TWL4030_CODEC into CONFIG_MFD_TWL4030_AUDIO in twl-core.c.
--- drivers/mfd/twl-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/twl-core.c +1 -1
@@ -109,7 +109,7 @@#define twl_has_watchdog () false#endif -#if defined(CONFIG_TWL4030_CODEC ) || defined(CONFIG_TWL4030_CODEC_MODULE ) ||\ +#if defined(CONFIG_MFD_TWL4030_AUDIO ) || defined(CONFIG_MFD_TWL4030_AUDIO_MODULE ) ||\ defined(CONFIG_TWL6040_CORE ) || defined(CONFIG_TWL6040_CORE_MODULE )#define twl_has_codec () true#else
PATCH 19/26 xen:pvhvm: enable PVHVM VCPU placement when using more than 32 CPUs.
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhenzhong Duan <[email protected]>
commit 90d4f5534d14815bd94c10e8ceccc57287657ecc upstream.
PVHVM running with more than 32 vcpus and pv_irq/pv_time enabled need VCPU placement to work, or else it will softlockup.
--- arch/x86/xen/enlighten.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/xen/enlighten.c +1 -2
@@ -1355,7 +1355,7 @@ static int __cpuinit xen_hvm_cpu_notify(int cpu = (long )hcpu;switch (action) {case CPU_UP_PREPARE : -per_cpu (xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu]; +xen_vcpu_setup (cpu);if (xen_have_vector_callback)xen_init_lock_cpu (cpu);break ;
@@ -1385,7 +1385,6 @@ static void __init xen_hvm_guest_init(voxen_hvm_smp_init ();register_cpu_notifier (&xen_hvm_cpu_notifier);xen_unplug_emulated_devices (); - have_vcpu_info_placement =0 ; x86_init.irqs.intr_init = xen_init_IRQ;xen_hvm_init_time_ops ();xen_hvm_init_mmu_ops ();
PATCH 20/26 xen-gntalloc: integer overflow in gntalloc_ioctl_alloc()
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 21643e69a4c06f7ef155fbc70e3fba13fba4a756 upstream.
On 32 bit systems a high value of op.count could lead to an integer overflow in the kzalloc() and gref_ids would be smaller than expected. If the you triggered another integer overflow in "if (gref_size + op.count > limit)" then you'd probably get memory corruption inside add_grefs().
--- drivers/xen/gntalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/gntalloc.c +1 -1
@@ -280,7 +280,7 @@ static long gntalloc_ioctl_alloc(struct goto out; } - gref_ids =kzalloc (sizeof (gref_ids[0 ]) * op.count,GFP_TEMPORARY ); + gref_ids =kcalloc (op.count,sizeof (gref_ids[0 ]),GFP_TEMPORARY );if (!gref_ids) { rc = -ENOMEM ; goto out;
PATCH 21/26 xen-gntalloc: signedness bug in add_grefs()
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 99cb2ddcc617f43917e94a4147aa3ccdb2bcd77e upstream.
gref->gref_id is unsigned so the error handling didn't work. gnttab_grant_foreign_access() returns an int type, so we can add a cast here, and it doesn't cause any problems. gnttab_grant_foreign_access() can return a variety of errors including -ENOSPC, -ENOSYS and -ENOMEM.
--- drivers/xen/gntalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/gntalloc.c +1 -1
@@ -135,7 +135,7 @@ static int add_grefs(struct ioctl_gntall/* Grant foreign access to the page. */ gref->gref_id =gnttab_grant_foreign_access (op->domid,pfn_to_mfn (page_to_pfn (gref->page)), readonly); -if (gref->gref_id <0 ) { +if ((int )gref->gref_id <0 ) { rc = gref->gref_id; goto undo; }
PATCH 22/26 powerpc/ps3: Fix lost SMP IPIs
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geoff Levand <[email protected]>
commit 72f3bea075287785ed32b777b6dd2636aa7002e8 upstream.
Fixes the PS3 bootup hang introduced in 3.0-rc1 by:
commit 317f394160e9beb97d19a84c39b7e5eb3d7815a
sched: Move the second half of ttwu() to the remote cpu
Move the PS3's LV1 EOI call lv1_end_of_interrupt_ext() from ps3_chip_eoi() to ps3_get_irq() for IPI messages.
If lv1_send_event_locally() is called between a previous call to lv1_send_event_locally() and the coresponding call to lv1_end_of_interrupt_ext() the second event will not be delivered to the target cpu.
The PS3's SMP IPIs are implemented using lv1_send_event_locally(), so if two IPI messages of the same type are sent to the same target in a relatively short period of time the second IPI event can become lost when lv1_end_of_interrupt_ext() is called from ps3_chip_eoi().
--- arch/powerpc/platforms/ps3/interrupt.c | 23 ++++++++++++++++++++++- arch/powerpc/platforms/ps3/platform.h | 1 + arch/powerpc/platforms/ps3/smp.c | 2 ++ 3 files changed, 25 insertions(+), 1 deletion(-)
arch/powerpc/platforms/ps3/interrupt.c +22 -1
@@ -88,6 +88,7 @@ struct ps3_private { struct ps3_bmp bmp __attribute__ ((aligned (PS3_BMP_MINALIGN)));u64 ppe_id;u64 thread_id; +unsigned long ipi_mask; }; static DEFINE_PER_CPU(struct ps3_private, ps3_private);
@@ -144,7 +145,11 @@ static void ps3_chip_unmask(struct irq_dstatic void ps3_chip_eoi (struct irq_data *d) {const struct ps3_private *pd =irq_data_get_irq_chip_data (d); -lv1_end_of_interrupt_ext (pd->ppe_id, pd->thread_id, d->irq); + +/* non-IPIs are EOIed here. */ + +if (!test_bit (63 - d->irq, &pd->ipi_mask)) +lv1_end_of_interrupt_ext (pd->ppe_id, pd->thread_id, d->irq); }/**
@@ -691,6 +696,16 @@ void __init ps3_register_ipi_debug_brk(u cpu, virq, pd->bmp.ipi_debug_brk_mask); } +void __init ps3_register_ipi_irq (unsigned int cpu,unsigned int virq) +{ +struct ps3_private *pd = &per_cpu (ps3_private, cpu); + +set_bit (63 - virq, &pd->ipi_mask); + +DBG ("%s:%d: cpu %u, virq %u, ipi_mask %lxh\n" , __func__, __LINE__, + cpu, virq, pd->ipi_mask); +} +static unsigned int ps3_get_irq (void ) {struct ps3_private *pd = &__get_cpu_var (ps3_private);
@@ -720,6 +735,12 @@ static unsigned int ps3_get_irq(void) BUG(); }#endif + +/* IPIs are EOIed here. */ + +if (test_bit (63 - plug, &pd->ipi_mask)) +lv1_end_of_interrupt_ext (pd->ppe_id, pd->thread_id, plug); +return plug; }
arch/powerpc/platforms/ps3/platform.h +1 -0
@@ -43,6 +43,7 @@ void ps3_mm_shutdown(void);void ps3_init_IRQ (void );void ps3_shutdown_IRQ (int cpu);void __init ps3_register_ipi_debug_brk (unsigned int cpu,unsigned int virq); +void __init ps3_register_ipi_irq (unsigned int cpu,unsigned int virq);/* smp */
arch/powerpc/platforms/ps3/smp.c +2 -0
@@ -94,6 +94,8 @@ static void __init ps3_smp_setup_cpu(intif (result) virqs[i] =NO_IRQ ; +else +ps3_register_ipi_irq (cpu, virqs[i]); }ps3_register_ipi_debug_brk (cpu, virqs[PPC_MSG_DEBUGGER_BREAK ]);
PATCH 23/26 powerpc: Add hvcall.h include to book3s_hv.c
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Neuling <[email protected]>
commit de1d9248eadd27539eba449b4d09428252e80c04 upstream.
If you build with KVM and UP it fails with the following due to a missing include.
/arch/powerpc/kvm/book3s_hv.c: In function 'do_h_register_vpa':arch/powerpc/kvm/book3s_hv.c:156:10: error: 'H_PARAMETER' undeclared (first use in this function) arch/powerpc/kvm/book3s_hv.c:156:10: note: each undeclared identifier is reported only once for each function it appears in arch/powerpc/kvm/book3s_hv.c:192:12: error: 'H_RESOURCE' undeclared (first use in this function) arch/powerpc/kvm/book3s_hv.c:222:9: error: 'H_SUCCESS' undeclared (first use in this function) arch/powerpc/kvm/book3s_hv.c: In function 'kvmppc_pseries_do_hcall':arch/powerpc/kvm/book3s_hv.c:228:30: error: 'H_SUCCESS' undeclared (first use in this function) arch/powerpc/kvm/book3s_hv.c:232:7: error: 'H_CEDE' undeclared (first use in this function) arch/powerpc/kvm/book3s_hv.c:234:7: error: 'H_PROD' undeclared (first use in this function) arch/powerpc/kvm/book3s_hv.c:238:10: error: 'H_PARAMETER' undeclared (first use in this function) arch/powerpc/kvm/book3s_hv.c:250:7: error: 'H_CONFER' undeclared (first use in this function) arch/powerpc/kvm/book3s_hv.c:252:7: error: 'H_REGISTER_VPA' undeclared (first use in this function) make[2]: *** [arch/powerpc/kvm/book3s_hv.o] Error 1
--- arch/powerpc/kvm/book3s_hv.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/kvm/book3s_hv.c +1 -0
@@ -43,6 +43,7 @@#include <asm/processor.h> #include <asm/cputhreads.h> #include <asm/page.h> +#include <asm/hvcall.h> #include <linux/gfp.h> #include <linux/sched.h> #include <linux/vmalloc.h>
PATCH 24/26 powerpc: Copy down exception vectors after feature fixups
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <[email protected]>
commit d715e433b7ad19c02fc4becf0d5e9a59f97925de upstream.
kdump fails because we try to execute an HV only instruction. Feature fixups are being applied after we copy the exception vectors down to 0 so they miss out on any updates.
We have always had this issue but it only became critical in v3.0 when we added CFAR support (breaks POWER5) and v3.1 when we added POWERNV (breaks everyone).
--- arch/powerpc/include/asm/sections.h | 2 +- arch/powerpc/include/asm/synch.h | 1 + arch/powerpc/kernel/kvm.c | 1 - arch/powerpc/kernel/setup_32.c | 2 ++ arch/powerpc/kernel/setup_64.c | 1 + arch/powerpc/lib/feature-fixups.c | 23 +++++++++++++++++++++++ 6 files changed, 28 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/sections.h +1 -1
@@ -8,7 +8,7 @@#ifdef __powerpc64__ -extern char _end[]; +extern char __end_interrupts[];static inline int in_kernel_text (unsigned long addr) {
arch/powerpc/include/asm/synch.h +1 -0
@@ -13,6 +13,7 @@extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup;extern void do_lwsync_fixups (unsigned long value,void *fixup_start,void *fixup_end); +extern void do_final_fixups (void );static inline void eieio (void ) {
arch/powerpc/kernel/kvm.c +0 -1
@@ -131,7 +131,6 @@ static void kvm_patch_ins_b(u32 *inst, i/* On relocatable kernels interrupts handlers and our code can be in different regions, so we don't patch them */ -extern u32 __end_interrupts;if ((ulong )inst < (ulong)&__end_interrupts)return ;#endif
arch/powerpc/kernel/setup_32.c +2 -0
@@ -107,6 +107,8 @@ notrace unsigned long __init early_init(PTRRELOC (&__start___lwsync_fixup), PTRRELOC(&__stop___lwsync_fixup)); +do_final_fixups (); +return KERNELBASE + offset; }
arch/powerpc/kernel/setup_64.c +1 -0
@@ -353,6 +353,7 @@ void __init setup_system(void) &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup);do_lwsync_fixups (cur_cpu_spec->cpu_features, &__start___lwsync_fixup, &__stop___lwsync_fixup); +do_final_fixups ();/* * Unflatten the device-tree passed by prom_init or kexec
arch/powerpc/lib/feature-fixups.c +23 -0
@@ -18,6 +18,8 @@#include <linux/init.h> #include <asm/cputable.h> #include <asm/code-patching.h> +#include <asm/page.h> +#include <asm/sections.h> struct fixup_entry {
@@ -128,6 +130,27 @@ void do_lwsync_fixups(unsigned long valu } } +void do_final_fixups (void ) +{ +#if defined(CONFIG_PPC64 ) && defined(CONFIG_RELOCATABLE ) +int *src, *dest; +unsigned long length; + +if (PHYSICAL_START ==0 ) +return ; + + src = (int *)(KERNELBASE +PHYSICAL_START ); + dest = (int *)KERNELBASE ; + length = (__end_interrupts - _stext) /sizeof (int ); + +while (length--) { +patch_instruction (dest, *src); + src++; + dest++; + } +#endif +} +#ifdef CONFIG_FTR_FIXUP_SELFTEST #define check (x) \
PATCH 25/26 backing-dev: ensure wakeup_timer is deleted
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rabin Vincent <[email protected]>
commit 7a401a972df8e184b3d1a3fc958c0a4ddee8d312 upstream.
bdi_prune_sb() in bdi_unregister() attempts to removes the bdi links from all super_blocks and then del_timer_sync() the writeback timer.
However, this can race with __mark_inode_dirty(), leading to bdi_wakeup_thread_delayed() rearming the writeback timer on the bdi we're unregistering, after we've called del_timer_sync().
This can end up with the bdi being freed with an active timer inside it, as in the case of the following dump after the removal of an SD card.
Fix this by redoing the del_timer_sync() in bdi_destory().
------------[ cut here ]------------ WARNING: at /home/rabin/kernel/arm/lib/debugobjects.c:262 debug_print_object+0x9c/0xc8() ODEBUG: free active (active state 0) object type: timer_list hint: wakeup_timer_fn+0x0/0x180 Modules linked in: Backtrace: [<c00109dc>] (dump_backtrace+0x0/0x110) from [<c0236e4c>] (dump_stack+0x18/0x1c) r6:c02bc638 r5:00000106 r4:c79f5d18 r3:00000000 [<c0236e34>] (dump_stack+0x0/0x1c) from [<c0025e6c>] (warn_slowpath_common+0x54/0x6c) [<c0025e18>] (warn_slowpath_common+0x0/0x6c) from [<c0025f28>] (warn_slowpath_fmt+0x38/0x40) r8:20000013 r7:c780c6f0 r6:c031613c r5:c780c6f0 r4:c02b1b29 r3:00000009 [<c0025ef0>] (warn_slowpath_fmt+0x0/0x40) from [<c015eb4c>] (debug_print_object+0x9c/0xc8) r3:c02b1b29 r2:c02bc662 [<c015eab0>] (debug_print_object+0x0/0xc8) from [<c015f574>] (debug_check_no_obj_freed+0xac/0x1dc) r6:c7964000 r5:00000001 r4:c7964000 [<c015f4c8>] (debug_check_no_obj_freed+0x0/0x1dc) from [<c00a9e38>] (kmem_cache_free+0x88/0x1f8) [<c00a9db0>] (kmem_cache_free+0x0/0x1f8) from [<c014286c>] (blk_release_queue+0x70/0x78) [<c01427fc>] (blk_release_queue+0x0/0x78) from [<c015290c>] (kobject_release+0x70/0x84) r5:c79641f0 r4:c796420c [<c015289c>] (kobject_release+0x0/0x84) from [<c0153ce4>] (kref_put+0x68/0x80) r7:00000083 r6:c74083d0 r5:c015289c r4:c796420c [<c0153c7c>] (kref_put+0x0/0x80) from [<c01527d0>] (kobject_put+0x48/0x5c) r5:c79643b4 r4:c79641f0 [<c0152788>] (kobject_put+0x0/0x5c) from [<c013ddd8>] (blk_cleanup_queue+0x68/0x74) r4:c7964000 [<c013dd70>] (blk_cleanup_queue+0x0/0x74) from [<c01a6370>] (mmc_blk_put+0x78/0xe8) r5:00000000 r4:c794c400 [<c01a62f8>] (mmc_blk_put+0x0/0xe8) from [<c01a64b4>] (mmc_blk_release+0x24/0x38) r5:c794c400 r4:c0322824 [<c01a6490>] (mmc_blk_release+0x0/0x38) from [<c00de11c>] (__blkdev_put+0xe8/0x170) r5:c78d5e00 r4:c74083c0 [<c00de034>] (__blkdev_put+0x0/0x170) from [<c00de2c0>] (blkdev_put+0x11c/0x12c) r8:c79f5f70 r7:00000001 r6:c74083d0 r5:00000083 r4:c74083c0 r3:00000000 [<c00de1a4>] (blkdev_put+0x0/0x12c) from [<c00b0724>] (kill_block_super+0x60/0x6c) r7:c7942300 r6:c79f4000 r5:00000083 r4:c74083c0 [<c00b06c4>] (kill_block_super+0x0/0x6c) from [<c00b0a94>] (deactivate_locked_super+0x44/0x70) r6:c79f4000 r5:c031af64 r4:c794dc00 r3:c00b06c4 [<c00b0a50>] (deactivate_locked_super+0x0/0x70) from [<c00b1358>] (deactivate_super+0x6c/0x70) r5:c794dc00 r4:c794dc00 [<c00b12ec>] (deactivate_super+0x0/0x70) from [<c00c88b0>] (mntput_no_expire+0x188/0x194) r5:c794dc00 r4:c7942300 [<c00c8728>] (mntput_no_expire+0x0/0x194) from [<c00c95e0>] (sys_umount+0x2e4/0x310) r6:c7942300 r5:00000000 r4:00000000 r3:00000000 [<c00c92fc>] (sys_umount+0x0/0x310) from [<c000d940>] (ret_fast_syscall+0x0/0x30) ---[ end trace e5c83c92ada51c76 ]---
--- mm/backing-dev.c | 8 ++++++++ 1 file changed, 8 insertions(+)
mm/backing-dev.c +8 -0
@@ -720,6 +720,14 @@ void bdi_destroy(struct backing_dev_infobdi_unregister (bdi); +/* +* If bdi_unregister() had already been called earlier, the +* wakeup_timer could still be armed because bdi_prune_sb() +* can race with the bdi_wakeup_thread_delayed() calls from +* __mark_inode_dirty(). +*/ +del_timer_sync (&bdi->wb.wakeup_timer); +for (i =0 ; i <NR_BDI_STAT_ITEMS ; i++)percpu_counter_destroy (&bdi->bdi_stat[i]);
PATCH 26/26 block: Always check length of all iov entries in blk_rq_map_user_iov()
In reply to Greg KH3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
commit 6b76106d8ef31111d6fc469564b83b5f5542794f upstream.
Even after commit 5478755616ae2ef1ce144dded589b62b2a50d575 ("block: check for proper length of iov entries earlier ...") we still won't check for zero-length entries after an unaligned entry. Remove the break-statement, so all entries are checked.
--- block/blk-map.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
block/blk-map.c +4 -3
@@ -204,10 +204,11 @@ int blk_rq_map_user_iov(struct request_qif (!iov[i].iov_len)return -EINVAL ; -if (uaddr &queue_dma_alignment (q)) { +/* +* Keep going so we check length of all segments +*/ +if (uaddr &queue_dma_alignment (q)) unaligned =1 ; -break ; - } }if (unaligned || (q->dma_pad_mask & len) || map_data)
Quoted 57 lines · Greg KH
This is the start of the stable review cycle for the 3.1.2 release. There are 26 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let us know. If anyone is a maintainer of the proper subsystem, and wants to add a Signed-off-by: line to the patch, please respond with it.
Responses should be made by Monday, November 21, 2011, 20:00:00 UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.1.2-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
Documentation/sound/alsa/HD-Audio-Models.txt | 1 + Makefile | 4 +- arch/arm/mach-at91/at91cap9_devices.c | 2 +- arch/arm/mach-at91/at91sam9g45_devices.c | 2 +- arch/arm/mach-at91/at91sam9rl_devices.c | 2 +- arch/powerpc/include/asm/sections.h | 2 +- arch/powerpc/include/asm/synch.h | 1 + arch/powerpc/kernel/kvm.c | 1 - arch/powerpc/kernel/setup_32.c | 2 + arch/powerpc/kernel/setup_64.c | 1 + arch/powerpc/kvm/book3s_hv.c | 1 + arch/powerpc/lib/feature-fixups.c | 23 ++++ arch/powerpc/platforms/ps3/interrupt.c | 23 ++++- arch/powerpc/platforms/ps3/platform.h | 1 + arch/powerpc/platforms/ps3/smp.c | 2 + arch/sh/include/asm/page.h | 5 + arch/x86/xen/enlighten.c | 3 +- block/blk-map.c | 7 +- drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/nouveau/nouveau_channel.c | 1 + drivers/gpu/drm/nouveau/nouveau_fence.c | 2 - drivers/gpu/drm/radeon/atombios_dp.c | 2 +- drivers/leds/led-class.c | 5 +- drivers/mfd/twl-core.c | 2 +- drivers/net/wireless/b43/main.c | 7 ++ drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 9 ++- drivers/staging/brcm80211/brcmsmac/mac80211_if.h | 6 + drivers/staging/brcm80211/brcmsmac/main.c | 8 ++ drivers/virtio/virtio_pci.c | 11 +- drivers/xen/gntalloc.c | 4 +- fs/hfs/trans.c | 2 + include/drm/drm_pciids.h | 2 + mm/backing-dev.c | 8 ++ security/keys/user_defined.c | 3 +- sound/pci/hda/hda_codec.c | 60 +++++++---- sound/pci/hda/patch_sigmatel.c | 11 ++ sound/soc/codecs/wm8994.c | 2 +- sound/usb/mixer.c | 120 +++++++++++++--------- 38 files changed, 245 insertions(+), 105 deletions(-)
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Please include also
Takashi Iwai (1):
drm/i915: Fix inconsistent backlight level during disabled
which is fixing a black-screen regression from 3.0 kernel.
Thanks, Woody
Quoted 8 lines · Woody Suwalski
Greg KH wrote:
Please include alsoTakashi Iwai (1):
drm/i915: Fix inconsistent backlight level during disabledwhich is fixing a black-screen regression from 3.0 kernel.
What is the git commit id for this patch? And you do know you can send this information to the [email protected] mailing list some time other than the announcement for the -rc releases :)
thanks,
greg k-h