[arch-commits] CVS update of arch/build/kernels/kernel26 (3 files)

Tobias Powalowski tpowa at archlinux.org
Thu May 3 19:38:03 UTC 2007


    Date: Thursday, May 3, 2007 @ 15:38:03
  Author: tpowa
    Path: /home/cvs-arch/arch/build/kernels/kernel26

   Added: patch_realtek.patch (1.1) sis900.patch (1.1)
Modified: PKGBUILD (1.221 -> 1.222)

'upgpkg: added sis network and alsa lenovo fix'


---------------------+
 PKGBUILD            |   11 +-
 patch_realtek.patch |  226 ++++++++++++++++++++++++++++++++++++++++++++++++++
 sis900.patch        |   53 +++++++++++
 3 files changed, 288 insertions(+), 2 deletions(-)


Index: arch/build/kernels/kernel26/PKGBUILD
diff -u arch/build/kernels/kernel26/PKGBUILD:1.221 arch/build/kernels/kernel26/PKGBUILD:1.222
--- arch/build/kernels/kernel26/PKGBUILD:1.221	Mon Apr 30 15:58:19 2007
+++ arch/build/kernels/kernel26/PKGBUILD	Thu May  3 15:38:02 2007
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD,v 1.221 2007/04/30 19:58:19 andyrtr Exp $
+# $Id: PKGBUILD,v 1.222 2007/05/03 19:38:02 tpowa Exp $
 # Maintainer: judd <jvinet at zeroflux.org>
 pkgname=kernel26
 _basekernel=2.6.21
 pkgver=2.6.21.1
-pkgrel=5
+pkgrel=6
 pkgdesc="The Linux Kernel and modules"
 arch=(i686 x86_64)
 url="http://www.kernel.org"
@@ -35,6 +35,8 @@
 	atkbd.patch
 	alsa.patch.bz2
 	alsa-include.patch.bz2
+	patch_realtek.patch
+	sis900.patch
 	http://heanet.dl.sourceforge.net/sourceforge/squashfs/squashfs3.2-r2.tar.gz
 	ftp://ftp.fsl.cs.sunysb.edu/pub/unionfs/unionfs-2.x/linux-2.6.21-u2.diff.gz)
 md5sums=('1b515f588078dfa7f4bab2634bd17e80' 'c4c368f173af267a564948065ffc1689'\
@@ -46,6 +48,7 @@
          '3ed791c3af3099489faf0d22cbcc55a8' 'a64a44d781e6b134a2758cc433248029'\
          '197453581bf03bd8f6cb50a4cbcc8685' '3f72c692c7c9cf596680bc3ce0cb84ec'\
          'e15b5400b4de044442b7f80494e96018' '5e00933ee60f7e1af44225e785de6820'\
+         '00bc768e40b48bbbcea4466289af29fc' 'f0c3200fde468a1ed37b363f0fb60c9c'\
          'bf360b92eba9e6d5610196ce2e02fcd1' '4964894a3f406d600226b62de570605b')
 
 build() {
@@ -75,6 +78,10 @@
   # status is 070428!
   patch -Np1 -i ../alsa.patch || return 1
   patch -Np0 -i ../alsa-include.patch || return 1
+  # fix patch_realtek for new asus and lenovo
+  patch -Np1 -i ../patch_realtek.patch || return 1
+  # fix sis900 oops
+  patch -Np1 -i ../sis900.patch || return 1
   # add sqashfs
   patch -Np1 -i ../squashfs3.2-r2/kernel-patches/linux-2.6.20/squashfs3.2-patch || return 1
   # add unionfs
Index: arch/build/kernels/kernel26/patch_realtek.patch
diff -u /dev/null arch/build/kernels/kernel26/patch_realtek.patch:1.1
--- /dev/null	Thu May  3 15:38:03 2007
+++ arch/build/kernels/kernel26/patch_realtek.patch	Thu May  3 15:38:03 2007
@@ -0,0 +1,226 @@
+--- a/sound/pci/hda/patch_realtek.c.old	2007-04-29 12:15:17.000000000 +0200
++++ a/sound/pci/hda/patch_realtek.c	2007-04-25 16:48:02.000000000 +0200
+@@ -117,6 +117,7 @@
+ 	ALC861VD_3ST,
+ 	ALC861VD_3ST_DIG,
+ 	ALC861VD_6ST_DIG,
++	ALC861VD_LENOVO, 
+ 	ALC861VD_AUTO,
+ 	ALC861VD_MODEL_LAST,
+ };
+@@ -137,6 +138,7 @@
+ 	ALC882_3ST_DIG,
+ 	ALC882_6ST_DIG,
+ 	ALC882_ARIMA,
++	ALC882_W2JC,
+ 	ALC882_AUTO,
+ 	ALC885_MACPRO,
+ 	ALC882_MODEL_LAST,
+@@ -635,6 +635,13 @@
+ 	{ }
+ };
+ 
++static struct hda_verb alc_gpio3_init_verbs[] = {
++	{0x01, AC_VERB_SET_GPIO_MASK, 0x03},
++	{0x01, AC_VERB_SET_GPIO_DIRECTION, 0x03},
++	{0x01, AC_VERB_SET_GPIO_DATA, 0x03},
++	{ }
++};
++
+ /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
+  *	31 ~ 16 :	Manufacture ID
+  *	15 ~ 8	:	SKU ID
+@@ -660,6 +667,9 @@
+ 	case 3:
+ 		snd_hda_sequence_write(codec, alc_gpio2_init_verbs);
+ 		break;
++	case 7:
++		snd_hda_sequence_write(codec, alc_gpio3_init_verbs);
++		break;
+ 	case 5:
+ 	case 6:
+ 		if (ass & 4) {	/* bit 2 : 0 = Desktop, 1 = Laptop */
+@@ -4764,6 +4655,21 @@
+ 	{ } /* end */
+ };
+ 
++static struct snd_kcontrol_new alc882_w2jc_mixer[] = {
++	HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
++	HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
++	HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
++	HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
++	HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
++	HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
++	HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
++	HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
++	HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
++	HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT),
++	HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT),
++	{ } /* end */
++};
++
+ static struct snd_kcontrol_new alc882_chmode_mixer[] = {
+ 	{
+ 		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+@@ -5083,6 +4988,7 @@
+ 	[ALC882_3ST_DIG]	= "3stack-dig",
+ 	[ALC882_6ST_DIG]	= "6stack-dig",
+ 	[ALC882_ARIMA]		= "arima",
++	[ALC882_W2JC]		= "w2jc",
+ 	[ALC885_MACPRO]		= "macpro",
+ 	[ALC882_AUTO]		= "auto",
+ };
+@@ -5093,6 +4999,7 @@
+ 	SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG),
+ 	SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA),
+ 	SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG),
++	SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC),
+ 	{}
+ };
+ 
+@@ -5129,6 +5036,17 @@
+ 		.channel_mode = alc882_sixstack_modes,
+ 		.input_mux = &alc882_capture_source,
+ 	},
++	[ALC882_W2JC] = {
++		.mixers = { alc882_w2jc_mixer, alc882_chmode_mixer },
++		.init_verbs = { alc882_init_verbs, alc882_eapd_verbs, alc880_gpio1_init_verbs },
++		.num_dacs = ARRAY_SIZE(alc882_dac_nids),
++		.dac_nids = alc882_dac_nids,
++		.num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
++		.channel_mode = alc880_threestack_modes,
++		.need_dac_fix = 1,
++		.input_mux = &alc882_capture_source,
++		.dig_out_nid = ALC882_DIGOUT_NID,
++	},
+ 	[ALC885_MACPRO] = {
+ 		.mixers = { alc882_macpro_mixer },
+ 		.init_verbs = { alc882_macpro_init_verbs },
+@@ -8687,6 +8510,27 @@
+ 	{ } /* end */
+ };
+ 
++static struct snd_kcontrol_new alc861vd_lenovo_mixer[] = {
++	HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT),
++//	HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
++	HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT),
++
++	HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
++
++	HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
++	HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
++	HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
++
++	HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
++	HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
++	HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
++
++	HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
++	HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
++
++	{ } /* end */
++};
++
+ /*
+  * generic initialization of ADC, input mixers and output mixers
+  */
+@@ -8708,6 +8552,9 @@
+ 	{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)},
+ 
+ 	/* Capture mixer: unmute Mic, F-Mic, Line, CD inputs */
++	{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
++	{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
++	{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
+ 	{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)},
+ 	{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)},
+ 	{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(6)},
+@@ -8812,6 +8656,50 @@
+ 	{ }
+ };
+ 
++static struct hda_verb alc861vd_eapd_verbs[] = {
++	{0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
++
++	{ }
++};
++
++static struct hda_verb alc861vd_lenovo_unsol_verbs[] = {
++	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
++	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
++	{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)},
++
++	{0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
++	{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},	
++	{}
++};
++
++/* toggle speaker-output according to the hp-jack state */
++static void alc861vd_lenovo_automute(struct hda_codec *codec)
++{
++	unsigned int present;
++
++	present = snd_hda_codec_read(codec, 0x1b, 0,
++				     AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
++	snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0,
++				 0x80, present ? 0x80 : 0);
++	snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0,
++				 0x80, present ? 0x80 : 0);
++
++	present = snd_hda_codec_read(codec, 0x18, 0,
++				     AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
++	snd_hda_codec_write(codec, 0x0b, 0, AC_VERB_SET_AMP_GAIN_MUTE,
++			    0x7000 | (0x01 << 8) | (present ? 0x80 : 0));
++}
++
++static void alc861vd_lenovo_unsol_event(struct hda_codec *codec, unsigned int res)
++{
++	/* Looks like the unsol event is incompatible with the standard
++	 * definition.  4bit tag is placed at 28 bit!
++	 */
++	if (((res >> 26) == 0x01) || ((res >> 26) == ALC880_HP_EVENT)
++		|| ((res >> 26) == ALC880_MIC_EVENT))
++		alc861vd_lenovo_automute(codec);
++}
++
+ /* pcm configuration: identiacal with ALC880 */
+ #define alc861vd_pcm_analog_playback	alc880_pcm_analog_playback
+ #define alc861vd_pcm_analog_capture	alc880_pcm_analog_capture
+@@ -8826,6 +8714,7 @@
+ 	[ALC861VD_3ST]		= "3stack",
+ 	[ALC861VD_3ST_DIG]	= "3stack-digout",
+ 	[ALC861VD_6ST_DIG]	= "6stack-digout",
++	[ALC861VD_LENOVO]	= "lenovo",
+ 	[ALC861VD_AUTO]		= "auto",
+ };
+ 
+@@ -8835,7 +8724,8 @@
+ 	SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST),
+ 	SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST),
+ 
+-	SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo 3000 C200", ALC861VD_3ST),
++	SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo 3000 C200", ALC861VD_LENOVO),
++	SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo", ALC861VD_LENOVO),
+ 	{}
+ };
+ 
+@@ -8884,6 +8774,20 @@
+ 		.channel_mode = alc861vd_6stack_modes,
+ 		.input_mux = &alc861vd_capture_source,
+ 	},
++	[ALC861VD_LENOVO] = {
++		.mixers = { alc861vd_lenovo_mixer },
++		.init_verbs = { alc861vd_volume_init_verbs,
++				 alc861vd_3stack_init_verbs, alc861vd_eapd_verbs, alc861vd_lenovo_unsol_verbs },
++		.num_dacs = ARRAY_SIZE(alc660vd_dac_nids),
++		.dac_nids = alc660vd_dac_nids,
++		.num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids),
++		.adc_nids = alc861vd_adc_nids,
++		.num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes),
++		.channel_mode = alc861vd_3stack_2ch_modes,
++		.input_mux = &alc861vd_capture_source,
++		.unsol_event = alc861vd_lenovo_unsol_event,
++		.init_hook = alc861vd_lenovo_automute,
++	},
+ };
+ 
+ /*
Index: arch/build/kernels/kernel26/sis900.patch
diff -u /dev/null arch/build/kernels/kernel26/sis900.patch:1.1
--- /dev/null	Thu May  3 15:38:03 2007
+++ arch/build/kernels/kernel26/sis900.patch	Thu May  3 15:38:03 2007
@@ -0,0 +1,53 @@
+From: Neil Horman <nhorman at tuxdriver.com>
+Date: Thu, 26 Apr 2007 17:47:36 +0000 (-0400)
+Subject: sis900: Allocate rx replacement buffer before rx operation
+X-Git-Url: http://git2.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=dc5a144991ba803bc8afded105c9db1dea0e57ab
+
+sis900: Allocate rx replacement buffer before rx operation
+
+Just found a hole in my last patch.  It was reported to me that shortly after we
+integrated this patch.  The report was of an oops that took place inside of
+netif_rx when using the sis900 driver.  Looking at my origional patch I noted
+that there was a spot between the new skb_alloc and the refill_rx_ring label
+where skb got reassigned to the pointer currently held in the rx_ring for the
+purposes of receiveing the frame.  The result of this is however that the buffer
+that gets passed to netif_rx (if it is called), then gets placed right back into
+the rx_ring.  So if you receive frames fast enough the skb being processed by
+the network stack can get corrupted.  The reporter is testing out the fix I've
+written for this below (I'm not near my hardware at the moment to test myself),
+but I wanted to post it for review ASAP.  I'll post test results when I hear
+them, but I think this is a pretty straightforward fix.  It just uses a separate
+pointer to do the rx operation, so that we don't improperly reassign the pointer
+that we use to refill the rx ring.
+
+Signed-off-by: Neil Horman <nhorman at tuxdriver.com>
+Signed-off-by: Jeff Garzik <jeff at garzik.org>
+---
+
+diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
+index dea0126..2cb2e15 100644
+--- a/drivers/net/sis900.c
++++ b/drivers/net/sis900.c
+@@ -1753,6 +1753,7 @@ static int sis900_rx(struct net_device *net_dev)
+ 			sis_priv->rx_ring[entry].cmdsts = RX_BUF_SIZE;
+ 		} else {
+ 			struct sk_buff * skb;
++			struct sk_buff * rx_skb;
+ 
+ 			pci_unmap_single(sis_priv->pci_dev,
+ 				sis_priv->rx_ring[entry].bufptr, RX_BUF_SIZE,
+@@ -1786,10 +1787,10 @@ static int sis900_rx(struct net_device *net_dev)
+ 			}
+ 
+ 			/* give the socket buffer to upper layers */
+-			skb = sis_priv->rx_skbuff[entry];
+-			skb_put(skb, rx_size);
+-			skb->protocol = eth_type_trans(skb, net_dev);
+-			netif_rx(skb);
++			rx_skb = sis_priv->rx_skbuff[entry];
++			skb_put(rx_skb, rx_size);
++			rx_skb->protocol = eth_type_trans(rx_skb, net_dev);
++			netif_rx(rx_skb);
+ 
+ 			/* some network statistics */
+ 			if ((rx_status & BCAST) == MCAST)




More information about the arch-commits mailing list