From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759973AbXKMH2N (ORCPT ); Tue, 13 Nov 2007 02:28:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752102AbXKMH17 (ORCPT ); Tue, 13 Nov 2007 02:27:59 -0500 Received: from mx1.suse.de ([195.135.220.2]:58074 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752044AbXKMH16 (ORCPT ); Tue, 13 Nov 2007 02:27:58 -0500 Date: Tue, 13 Nov 2007 04:43:05 +0100 Message-ID: From: Takashi Iwai To: Roland Dreier Cc: linux-kernel@vger.kernel.org Subject: Re: snd_hda_intel 2.6.24-rc2 bug: interrupts don't always work on Lenovo X60s In-Reply-To: References: User-Agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta28) (fuki) (+CVS-20070806) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org At Mon, 12 Nov 2007 10:46:40 -0800, Roland Dreier wrote: > > > > [ 2311.759856] ACPI: PCI Interrupt 0000:00:1b.0[B] -> GSI 17 (level, low) -> IRQ 21 > > > [ 2311.759866] hda_intel: probe_mask set to 0x1 for device 17aa:2010 > > > [ 2311.759886] PCI: Setting latency timer of device 0000:00:1b.0 to 64 > > > [ 2312.911309] hda_intel: azx_get_response timeout, switching to polling mode: last cmd=0x003f000c > > > > Hm, strange, NID 0x03 shouldn't be accessed via AD1981 codec, at > > least, thinkpad model. Did you enable CONFIG_SND_HDA_CODEC_ANALOG? > > Otherwise it won't work. > > Yes, I have > > CONFIG_SND_HDA_CODEC_ANALOG=y > > in my .config. > > By the way, the "polling mode" seems to work OK: I still get normal > playback of music etc. Yes, the polling mode should work in most cases, too. Anyway, could you try the patch below? As far as I see, it's the only part that may access PINCAP verb for that NID. thanks, Takashi --- diff -r cd6cede1eca4 sound/pci/hda/hda_codec.c --- a/sound/pci/hda/hda_codec.c Mon Nov 12 14:55:19 2007 +0000 +++ b/sound/pci/hda/hda_codec.c Tue Nov 13 08:28:48 2007 +0100 @@ -1626,19 +1626,26 @@ static void hda_set_power_state(struct h nid = codec->start_nid; for (i = 0; i < codec->num_nodes; i++, nid++) { - if (get_wcaps(codec, nid) & AC_WCAP_POWER) { - unsigned int pincap; - /* - * don't power down the widget if it controls eapd - * and EAPD_BTLENABLE is set. - */ - pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); - if (pincap & AC_PINCAP_EAPD) { - int eapd = snd_hda_codec_read(codec, nid, - 0, AC_VERB_GET_EAPD_BTLENABLE, 0); - eapd &= 0x02; - if (power_state == AC_PWRST_D3 && eapd) - continue; + unsigned int wcaps = get_wcaps(codec, nid); + if (wcaps & AC_WCAP_POWER) { + unsigned int wid_type = (wcaps & AC_WCAP_TYPE) >> + AC_WCAP_TYPE_SHIFT; + if (wid_type == AC_WID_PIN) { + unsigned int pincap; + /* + * don't power down the widget if it controls + * eapd and EAPD_BTLENABLE is set. + */ + pincap = snd_hda_param_read(codec, nid, + AC_PAR_PIN_CAP); + if (pincap & AC_PINCAP_EAPD) { + int eapd = snd_hda_codec_read(codec, + nid, 0, + AC_VERB_GET_EAPD_BTLENABLE, 0); + eapd &= 0x02; + if (power_state == AC_PWRST_D3 && eapd) + continue; + } } snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_POWER_STATE,