From: Greg Kroah-Hartman Date: Wed, 10 Mar 2010 00:09:47 +0000 (-0800) Subject: .33 patches X-Git-Tag: v2.6.32.10~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6e1d394d9d141b93a3ca71c3e786866c2c523eaf;p=thirdparty%2Fkernel%2Fstable-queue.git .33 patches --- diff --git a/queue-2.6.33/alsa-hda-intel-add-position_fix-quirk-for-asus-m2v-mx-se.patch b/queue-2.6.33/alsa-hda-intel-add-position_fix-quirk-for-asus-m2v-mx-se.patch new file mode 100644 index 00000000000..5e41d47ecdc --- /dev/null +++ b/queue-2.6.33/alsa-hda-intel-add-position_fix-quirk-for-asus-m2v-mx-se.patch @@ -0,0 +1,46 @@ +From 0708cc582f0fe2578eaab722841caf2b4f8cfe37 Mon Sep 17 00:00:00 2001 +From: Paul Menzel +Date: Mon, 8 Feb 2010 20:42:46 +0100 +Subject: ALSA: hda-intel: Add position_fix quirk for ASUS M2V-MX SE. + +From: Paul Menzel + +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- SERR- + Kernel driver in use: HDA Intel + +[1] http://sourceforge.net/mailarchive/forum.php?thread_name=1265550675.4642.24.camel%40mattotaupa&forum_name=alsa-user + +Signed-off-by: Paul Menzel +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/hda_intel.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -2263,6 +2263,7 @@ static struct snd_pci_quirk position_fix + 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(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), diff --git a/queue-2.6.33/alsa-hda-use-3stack-quirk-for-toshiba-satellite-l40-10q.patch b/queue-2.6.33/alsa-hda-use-3stack-quirk-for-toshiba-satellite-l40-10q.patch new file mode 100644 index 00000000000..fbf4f26b9b3 --- /dev/null +++ b/queue-2.6.33/alsa-hda-use-3stack-quirk-for-toshiba-satellite-l40-10q.patch @@ -0,0 +1,36 @@ +From ba579eb7b30791751f556ee01905636cda50c864 Mon Sep 17 00:00:00 2001 +From: Daniel T Chen +Date: Sat, 20 Feb 2010 11:16:30 -0500 +Subject: ALSA: hda: Use 3stack quirk for Toshiba Satellite L40-10Q + +From: Daniel T Chen + +commit ba579eb7b30791751f556ee01905636cda50c864 upstream. + +BugLink: https://bugs.launchpad.net/bugs/524948 + +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. + +Reported-by: Lasse Havelund +Signed-off-by: Daniel T Chen +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_analog.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/pci/hda/patch_analog.c ++++ b/sound/pci/hda/patch_analog.c +@@ -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), diff --git a/queue-2.6.33/alsa-hda-use-lpib-for-a-biostar-microtech-board.patch b/queue-2.6.33/alsa-hda-use-lpib-for-a-biostar-microtech-board.patch new file mode 100644 index 00000000000..1f35cc8bbfa --- /dev/null +++ b/queue-2.6.33/alsa-hda-use-lpib-for-a-biostar-microtech-board.patch @@ -0,0 +1,33 @@ +From 0321b69569eadbc13242922925a4316754c5f744 Mon Sep 17 00:00:00 2001 +From: Daniel T Chen +Date: Fri, 5 Mar 2010 09:04:49 -0500 +Subject: ALSA: hda: Use LPIB for a Biostar Microtech board + +From: Daniel T Chen + +commit 0321b69569eadbc13242922925a4316754c5f744 upstream. + +BugLink: https://launchpad.net/bugs/523953 + +The OR has verified that position_fix=1 is necessary to work around +errors on his machine. + +Reported-by: MMarking +Signed-off-by: Daniel T Chen +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/hda_intel.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -2265,6 +2265,7 @@ static struct snd_pci_quirk position_fix + 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), ++ SND_PCI_QUIRK(0x1565, 0x820f, "Biostar Microtech", POS_FIX_LPIB), + {} + }; + diff --git a/queue-2.6.33/alsa-hda-use-lpib-for-dell-latitude-131l.patch b/queue-2.6.33/alsa-hda-use-lpib-for-dell-latitude-131l.patch new file mode 100644 index 00000000000..26b62433375 --- /dev/null +++ b/queue-2.6.33/alsa-hda-use-lpib-for-dell-latitude-131l.patch @@ -0,0 +1,33 @@ +From 9919c7619c52d01e89103bca405cc3d4a2b1ac31 Mon Sep 17 00:00:00 2001 +From: Daniel T Chen +Date: Wed, 3 Mar 2010 18:24:26 -0500 +Subject: ALSA: hda: Use LPIB for Dell Latitude 131L + +From: Daniel T Chen + +commit 9919c7619c52d01e89103bca405cc3d4a2b1ac31 upstream. + +BugLink: https://launchpad.net/bugs/530346 + +The OR has verified that position_fix=1 is necessary to work around +errors on his machine. + +Reported-by: Tom Louwrier +Signed-off-by: Daniel T Chen +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/hda_intel.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -2261,6 +2261,7 @@ static int azx_dev_free(struct snd_devic + static 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), diff --git a/queue-2.6.33/alsa-pcm-core-fix-fifo_size-channels-interval-check.patch b/queue-2.6.33/alsa-pcm-core-fix-fifo_size-channels-interval-check.patch new file mode 100644 index 00000000000..e47b72b2026 --- /dev/null +++ b/queue-2.6.33/alsa-pcm-core-fix-fifo_size-channels-interval-check.patch @@ -0,0 +1,33 @@ +From 3be522a9514f58e0596db34898a514df206cadc5 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 16 Feb 2010 11:55:43 +0100 +Subject: ALSA: pcm core - fix fifo_size channels interval check + +From: Jaroslav Kysela + +commit 3be522a9514f58e0596db34898a514df206cadc5 upstream. + +Signed-off-by: Jaroslav Kysela +Signed-off-by: Greg Kroah-Hartman + +--- + sound/core/pcm_native.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/sound/core/pcm_native.c ++++ b/sound/core/pcm_native.c +@@ -315,10 +315,10 @@ int snd_pcm_hw_refine(struct snd_pcm_sub + if (!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) diff --git a/queue-2.6.33/alsa-usb-audio-reduce-midi-packet-size-to-work-around-broken-firmware.patch b/queue-2.6.33/alsa-usb-audio-reduce-midi-packet-size-to-work-around-broken-firmware.patch new file mode 100644 index 00000000000..d64181ad8e0 --- /dev/null +++ b/queue-2.6.33/alsa-usb-audio-reduce-midi-packet-size-to-work-around-broken-firmware.patch @@ -0,0 +1,50 @@ +From f167e1d073278fe231bbdd5d6c24fb9d091aa544 Mon Sep 17 00:00:00 2001 +From: Clemens Ladisch +Date: Mon, 15 Feb 2010 08:55:28 +0100 +Subject: ALSA: usb-audio: reduce MIDI packet size to work around broken firmware + +From: Clemens Ladisch + +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 + +Signed-off-by: Clemens Ladisch +Signed-off-by: Jaroslav Kysela +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/usbmidi.c | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +--- a/sound/usb/usbmidi.c ++++ b/sound/usb/usbmidi.c +@@ -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, diff --git a/queue-2.6.33/alsa-usb-midi-support-for-access-music-virusti.patch b/queue-2.6.33/alsa-usb-midi-support-for-access-music-virusti.patch new file mode 100644 index 00000000000..fd4a7db2b9e --- /dev/null +++ b/queue-2.6.33/alsa-usb-midi-support-for-access-music-virusti.patch @@ -0,0 +1,133 @@ +From d39e82db73eb876c60d00f00219d767b3be30307 Mon Sep 17 00:00:00 2001 +From: Sebastien Alaiwan +Date: Tue, 16 Feb 2010 08:55:08 +0100 +Subject: ALSA: USB MIDI support for Access Music VirusTI + +From: Sebastien Alaiwan + +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. + +Signed-off-by: Sebastien Alaiwan +Signed-off-by: Clemens Ladisch (cosmetics, list terminator) +Signed-off-by: Jaroslav Kysela +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/usbaudio.c | 32 ++++++++++++++++++++++++++++++++ + sound/usb/usbmidi.c | 6 ++++++ + sound/usb/usbquirks.h | 27 +++++++++++++++++++++++++++ + 3 files changed, 65 insertions(+) + +--- a/sound/usb/usbaudio.c ++++ b/sound/usb/usbaudio.c +@@ -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 + */ +--- a/sound/usb/usbmidi.c ++++ b/sound/usb/usbmidi.c +@@ -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) +--- a/sound/usb/usbquirks.h ++++ b/sound/usb/usbquirks.h +@@ -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 */ diff --git a/queue-2.6.33/alsa-via82xx-add-quirk-for-d1289-motherboard.patch b/queue-2.6.33/alsa-via82xx-add-quirk-for-d1289-motherboard.patch new file mode 100644 index 00000000000..270e8a74d0b --- /dev/null +++ b/queue-2.6.33/alsa-via82xx-add-quirk-for-d1289-motherboard.patch @@ -0,0 +1,35 @@ +From bf30a4309d4294d3eca248ea8a20c1c3570f5e74 Mon Sep 17 00:00:00 2001 +From: Clemens Ladisch +Date: Mon, 22 Feb 2010 10:33:13 +0100 +Subject: ALSA: via82xx: add quirk for D1289 motherboard + +From: Clemens Ladisch + +commit bf30a4309d4294d3eca248ea8a20c1c3570f5e74 upstream. + +Add a headphones-only quirk for the Fujitsu Siemens D1289. + +Signed-off-by: Clemens Ladisch +Reported-and-tested-by: Marc Haber +Signed-off-by: Jaroslav Kysela +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/via82xx.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/sound/pci/via82xx.c ++++ b/sound/pci/via82xx.c +@@ -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", diff --git a/queue-2.6.33/asoc-fix-ak4104-register-array-access.patch b/queue-2.6.33/asoc-fix-ak4104-register-array-access.patch new file mode 100644 index 00000000000..6e9dbd2e9fe --- /dev/null +++ b/queue-2.6.33/asoc-fix-ak4104-register-array-access.patch @@ -0,0 +1,40 @@ +From e555317c083fda01f516d2153589e82514e20e70 Mon Sep 17 00:00:00 2001 +From: Daniel Mack +Date: Fri, 26 Feb 2010 14:36:54 +0800 +Subject: ASoC: fix ak4104 register array access + +From: Daniel Mack + +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. + +Signed-off-by: Daniel Mack +Acked-by: Liam Girdwood +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/ak4104.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/sound/soc/codecs/ak4104.c ++++ b/sound/soc/codecs/ak4104.c +@@ -90,12 +90,10 @@ static int ak4104_spi_write(struct snd_s + if (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; diff --git a/queue-2.6.33/driver-core-devtmpfs-reset-inode-permissions-before-unlinking.patch b/queue-2.6.33/driver-core-devtmpfs-reset-inode-permissions-before-unlinking.patch new file mode 100644 index 00000000000..3da03a9a14a --- /dev/null +++ b/queue-2.6.33/driver-core-devtmpfs-reset-inode-permissions-before-unlinking.patch @@ -0,0 +1,43 @@ +From 5e31d76f2817bd50258a092a7c5b15b3006fd61c Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 13 Jan 2010 14:16:36 +0100 +Subject: Driver-Core: devtmpfs - reset inode permissions before unlinking + +From: Kay Sievers + +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. + +Signed-off-by: Kay Sievers +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/devtmpfs.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +--- a/drivers/base/devtmpfs.c ++++ b/drivers/base/devtmpfs.c +@@ -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) diff --git a/queue-2.6.33/driver-core-fix-race-condition-in-get_device_parent.patch b/queue-2.6.33/driver-core-fix-race-condition-in-get_device_parent.patch new file mode 100644 index 00000000000..cf5cbc0591c --- /dev/null +++ b/queue-2.6.33/driver-core-fix-race-condition-in-get_device_parent.patch @@ -0,0 +1,117 @@ +From 77d3d7c1d561f49f755d7390f0764dff90765974 Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Fri, 5 Feb 2010 17:57:02 +0900 +Subject: driver-core: fix race condition in get_device_parent() + +From: Tejun Heo + +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: [] 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:[] [] 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: + [] create_dir+0x67/0xe0 + [] sysfs_create_dir+0x58/0xb0 + [] ? kobject_add_internal+0xcc/0x220 + [] ? vsnprintf+0x3c1/0xb90 + [] kobject_add_internal+0x107/0x220 + [] kobject_add_varg+0x47/0x80 + [] kobject_add+0x53/0x90 + [] device_add+0xd4/0x690 + [] ? dev_set_name+0x4b/0x70 + [] 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(). + +Signed-off-by: Tejun Heo +Reported-by: Colin Guthrie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/core.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +--- a/drivers/base/core.c ++++ b/drivers/base/core.c +@@ -607,6 +607,7 @@ static struct kobject *get_device_parent + int 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_parent + else + 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_parent + break; + } + 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; + } + diff --git a/queue-2.6.33/p54pci-handle-dma-mapping-errors.patch b/queue-2.6.33/p54pci-handle-dma-mapping-errors.patch new file mode 100644 index 00000000000..c0506760754 --- /dev/null +++ b/queue-2.6.33/p54pci-handle-dma-mapping-errors.patch @@ -0,0 +1,59 @@ +From 288c8ce8047695fd8872dd5db3ef21a9679c402f Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sun, 17 Jan 2010 23:17:29 +0100 +Subject: p54pci: handle dma mapping errors + +From: Christian Lamparter + +commit 288c8ce8047695fd8872dd5db3ef21a9679c402f upstream. + +This patch adds error-paths to handle pci_dma_mapping errors. + +Signed-off-by: Christian Lamparter +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/p54/p54pci.c | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/p54/p54pci.c ++++ b/drivers/net/wireless/p54/p54pci.c +@@ -157,6 +157,14 @@ static void p54p_refill_rx_ring(struct i + skb_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_hw + u32 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; diff --git a/queue-2.6.33/p54usb-add-the-usb-id-for-belkin-accton-fd7050e-ver-1010ec.patch b/queue-2.6.33/p54usb-add-the-usb-id-for-belkin-accton-fd7050e-ver-1010ec.patch new file mode 100644 index 00000000000..5020150141b --- /dev/null +++ b/queue-2.6.33/p54usb-add-the-usb-id-for-belkin-accton-fd7050e-ver-1010ec.patch @@ -0,0 +1,33 @@ +From 5b9a919a97ac8bdda8020c9b366491b5b91b196e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Moine?= +Date: Wed, 17 Feb 2010 10:59:31 -0600 +Subject: p54usb: Add the USB ID for Belkin (Accton) FD7050E ver 1010ec +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Moine?= + +commit 5b9a919a97ac8bdda8020c9b366491b5b91b196e upstream. + +Yet another USB ID. + +Signed-off-by: Jean-François Moine +Signed-off-by: Larry Finger +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/p54/p54usb.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/wireless/p54/p54usb.c ++++ b/drivers/net/wireless/p54/p54usb.c +@@ -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 */ diff --git a/queue-2.6.33/serial-imx-fix-null-dereference-oops-when-pdata-null.patch b/queue-2.6.33/serial-imx-fix-null-dereference-oops-when-pdata-null.patch new file mode 100644 index 00000000000..4f74e62b80f --- /dev/null +++ b/queue-2.6.33/serial-imx-fix-null-dereference-oops-when-pdata-null.patch @@ -0,0 +1,63 @@ +From bbcd18d1b37413d25eaf4580682b1b8e4a09ff5e Mon Sep 17 00:00:00 2001 +From: Baruch Siach +Date: Mon, 21 Dec 2009 16:26:46 -0800 +Subject: serial: imx: fix NULL dereference Oops when pdata == NULL +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Baruch Siach + +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. + +Signed-off-by: Baruch Siach +Cc: Baruch Siach +Cc: Alan Cox +Cc: Sascha Hauer +Cc: Oskar Schirmer +Cc: Fabian Godehardt +Cc: Daniel Glöckner +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/serial/imx.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/serial/imx.c ++++ b/drivers/serial/imx.c +@@ -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 platf + + return 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 plat + + clk_disable(sport->clk); + +- if (pdata->exit) ++ if (pdata && pdata->exit) + pdata->exit(pdev); + + iounmap(sport->port.membase); diff --git a/queue-2.6.33/series b/queue-2.6.33/series index 93158806ae4..48376e9aff4 100644 --- a/queue-2.6.33/series +++ b/queue-2.6.33/series @@ -39,3 +39,22 @@ oprofile-x86-use-kzalloc-instead-of-kmalloc.patch oprofile-x86-fix-msr-access-to-reserved-counters.patch perf-reimplement-frequency-driven-sampling.patch tracing-fix-ftrace_event_call-alignment-for-use-with-gcc-4.5.patch +alsa-hda-use-3stack-quirk-for-toshiba-satellite-l40-10q.patch +alsa-via82xx-add-quirk-for-d1289-motherboard.patch +alsa-pcm-core-fix-fifo_size-channels-interval-check.patch +alsa-usb-audio-reduce-midi-packet-size-to-work-around-broken-firmware.patch +alsa-usb-midi-support-for-access-music-virusti.patch +thinkpad-acpi-fix-alsa-callback-return-status.patch +alsa-hda-use-lpib-for-dell-latitude-131l.patch +alsa-hda-use-lpib-for-a-biostar-microtech-board.patch +alsa-hda-intel-add-position_fix-quirk-for-asus-m2v-mx-se.patch +asoc-fix-ak4104-register-array-access.patch +driver-core-fix-race-condition-in-get_device_parent.patch +driver-core-devtmpfs-reset-inode-permissions-before-unlinking.patch +sysfs-cache-the-last-sysfs_dirent-to-improve-readdir-scalability-v2.patch +tty-fix-the-ldisc-hangup-race.patch +serial-imx-fix-null-dereference-oops-when-pdata-null.patch +usb-serial-sierra-driver-indat_callback-fix.patch +usb-fix-i2c-api-usage-in-ohci-pnx4008.patch +p54usb-add-the-usb-id-for-belkin-accton-fd7050e-ver-1010ec.patch +p54pci-handle-dma-mapping-errors.patch diff --git a/queue-2.6.33/sysfs-cache-the-last-sysfs_dirent-to-improve-readdir-scalability-v2.patch b/queue-2.6.33/sysfs-cache-the-last-sysfs_dirent-to-improve-readdir-scalability-v2.patch new file mode 100644 index 00000000000..0e0f30f637e --- /dev/null +++ b/queue-2.6.33/sysfs-cache-the-last-sysfs_dirent-to-improve-readdir-scalability-v2.patch @@ -0,0 +1,143 @@ +From 1e5289c97bba2d8ee7239a416bc3f28743362cd9 Mon Sep 17 00:00:00 2001 +From: Eric W. Biederman +Date: Fri, 1 Jan 2010 14:43:53 -0800 +Subject: sysfs: Cache the last sysfs_dirent to improve readdir scalability v2 + +From: Eric W. Biederman + +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 + +Signed-off-by: Eric W. Biederman +Cc: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/sysfs/dir.c | 82 +++++++++++++++++++++++++++++++++++++++++---------------- + 1 file changed, 60 insertions(+), 22 deletions(-) + +--- a/fs/sysfs/dir.c ++++ b/fs/sysfs/dir.c +@@ -837,11 +837,46 @@ static inline unsigned char dt_type(stru + return (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 * f + if (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 * f + const struct file_operations sysfs_dir_operations = { + .read = generic_read_dir, + .readdir = sysfs_readdir, ++ .release = sysfs_dir_release, + .llseek = generic_file_llseek, + }; diff --git a/queue-2.6.33/thinkpad-acpi-fix-alsa-callback-return-status.patch b/queue-2.6.33/thinkpad-acpi-fix-alsa-callback-return-status.patch new file mode 100644 index 00000000000..3f991043e4c --- /dev/null +++ b/queue-2.6.33/thinkpad-acpi-fix-alsa-callback-return-status.patch @@ -0,0 +1,125 @@ +From 88cc83772a3c7756b9f2b4ba835545ad90a08409 Mon Sep 17 00:00:00 2001 +From: Henrique de Moraes Holschuh +Date: Sat, 27 Feb 2010 18:45:29 -0300 +Subject: thinkpad-acpi: fix ALSA callback return status + +From: Henrique de Moraes Holschuh + +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 . + +This fix is also needed on 2.6.33. + +Reported-by: Clemens Ladisch +Signed-off-by: Henrique de Moraes Holschuh +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/platform/x86/thinkpad_acpi.c | 39 ++++++++++++++++++++++++++--------- + 1 file changed, 29 insertions(+), 10 deletions(-) + +--- a/drivers/platform/x86/thinkpad_acpi.c ++++ b/drivers/platform/x86/thinkpad_acpi.c +@@ -6522,7 +6522,8 @@ static int volume_set_status(const u8 st + return 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 sn + static 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 s + static 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 = { diff --git a/queue-2.6.33/tty-fix-the-ldisc-hangup-race.patch b/queue-2.6.33/tty-fix-the-ldisc-hangup-race.patch new file mode 100644 index 00000000000..cc7b40c8d74 --- /dev/null +++ b/queue-2.6.33/tty-fix-the-ldisc-hangup-race.patch @@ -0,0 +1,121 @@ +From 638b9648ab51c9c549ff5735d3de519ef6199df3 Mon Sep 17 00:00:00 2001 +From: Alan Cox +Date: Mon, 8 Feb 2010 10:09:26 +0000 +Subject: tty: Fix the ldisc hangup race + +From: Alan Cox + +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. + +Signed-off-by: Alan Cox +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/char/tty_ldisc.c | 50 ++++++++++++++++++++++++++++------------------- + 1 file changed, 30 insertions(+), 20 deletions(-) + +--- a/drivers/char/tty_ldisc.c ++++ b/drivers/char/tty_ldisc.c +@@ -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_struct + wake_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); + } + + /** diff --git a/queue-2.6.33/usb-fix-i2c-api-usage-in-ohci-pnx4008.patch b/queue-2.6.33/usb-fix-i2c-api-usage-in-ohci-pnx4008.patch new file mode 100644 index 00000000000..e1ea33a0a01 --- /dev/null +++ b/queue-2.6.33/usb-fix-i2c-api-usage-in-ohci-pnx4008.patch @@ -0,0 +1,49 @@ +From 8740cc7d0c532e098cc428251c08befd14f087d8 Mon Sep 17 00:00:00 2001 +From: Luotao Fu +Date: Fri, 19 Feb 2010 15:42:00 +0100 +Subject: USB: fix I2C API usage in ohci-pnx4008. + +From: Luotao Fu + +commit 8740cc7d0c532e098cc428251c08befd14f087d8 upstream. + +i2c_board_info doesn't contain a member called name. i2c_register_client +call does not exist. + +Signed-off-by: Luotao Fu +Acked-by: Jean Delvare +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/ohci-pnx4008.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/usb/host/ohci-pnx4008.c ++++ b/drivers/usb/host/ohci-pnx4008.c +@@ -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(struct + pnx4008_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); + diff --git a/queue-2.6.33/usb-serial-sierra-driver-indat_callback-fix.patch b/queue-2.6.33/usb-serial-sierra-driver-indat_callback-fix.patch new file mode 100644 index 00000000000..d6e94d111cd --- /dev/null +++ b/queue-2.6.33/usb-serial-sierra-driver-indat_callback-fix.patch @@ -0,0 +1,55 @@ +From b87c6e86dac1bb5222279cc8ff7e09529e1c4ed9 Mon Sep 17 00:00:00 2001 +From: Elina Pasheva +Date: Mon, 15 Feb 2010 14:50:14 -0800 +Subject: USB: serial: sierra driver indat_callback fix + +From: Elina Pasheva + +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 + +Signed-off-by: Elina Pasheva +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/sierra.c | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +--- a/drivers/usb/serial/sierra.c ++++ b/drivers/usb/serial/sierra.c +@@ -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__);