From owner-freebsd-bugs@FreeBSD.ORG Thu Mar 29 07:35:52 2012 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9F5B106566C; Thu, 29 Mar 2012 07:35:52 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id B8E5A8FC15; Thu, 29 Mar 2012 07:35:51 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so2195103bkc.13 for ; Thu, 29 Mar 2012 00:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=lXQSvGQCHUJNXZOBaliKgXRrI0FPWsbP4eCUPPUcoFs=; b=z9zecwY3pjvc1mpkP8opkf7bulDobDDOuK6mdkEg1eN5Boyy/UuG0Qv38VRpC0MS4J 4+th1lmJFbCunYDVER9pUZfUQRLHZHfWigWludXQXbIU9HPWZ08o47lvWGGeOPxCnkmm r2r1Sa1bxnPg6pxtZfnNbk6YN4javDU7uQQaP1buKK8WSoiKf0C8zUXPpoe5J78AiSmQ 5uYT3aW72Z4EY4memD4rlGuLDCf4eUAyFZXkJPpAGJ7KMOmg8EBgvFGxHcfDN3/PbqKh aX9+xa3bonjhsNnIUF6vbmESzh3DcpWL8oCVgPp/HvyXinxf0P41VV1OqjLWyBYVeiQY P2+A== Received: by 10.205.126.14 with SMTP id gu14mr8121415bkc.57.1333006545161; Thu, 29 Mar 2012 00:35:45 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id v2sm11552843bki.7.2012.03.29.00.35.43 (version=SSLv3 cipher=OTHER); Thu, 29 Mar 2012 00:35:44 -0700 (PDT) Sender: Alexander Motin Message-ID: <4F7410CD.1000200@FreeBSD.org> Date: Thu, 29 Mar 2012 10:35:41 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.2) Gecko/20120226 Thunderbird/10.0.2 MIME-Version: 1.0 To: Brandon Gooch References: <201203250422.q2P4MsBX047524@freefall.freebsd.org> In-Reply-To: Content-Type: multipart/mixed; boundary="------------090809010902010702030901" Cc: freebsd-bugs@freebsd.org, eadler@freebsd.org Subject: Re: kern/166382: [patch] snd_hda(4) is in a bad state after suspend/resume cycle X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2012 07:35:52 -0000 This is a multi-part message in MIME format. --------------090809010902010702030901 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 03/29/12 03:26, Brandon Gooch wrote: > On Sat, Mar 24, 2012 at 11:22 PM, wrote: >> Synopsis: [patch] snd_hda(4) is in a bad state after suspend/resume cycle >> >> Responsible-Changed-From-To: freebsd-bugs->mav >> Responsible-Changed-By: eadler >> Responsible-Changed-When: Sun Mar 25 04:22:54 UTC 2012 >> Responsible-Changed-Why: >> over to maintainer >> >> http://www.freebsd.org/cgi/query-pr.cgi?pr=166382 > > Hey mav, thanks for taking a look and providing a patch! > Unfortunately, it doesn't fix the suspend/resume issue The headphone > jack sense polling doesn't work after resume unless the callback is > reinitialized. > > Does it hurt to reinit the callback in the case of both polling and > non-polling configuartions? Polling is always bad. It is needed only if CODEC can't send unsolicited responses for jack events. I think I see the real problem: unsolicited responses are not reconfigured on resume. Please try attached patch. -- Alexander Motin --------------090809010902010702030901 Content-Type: text/plain; name="hdaa.c.resume.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="hdaa.c.resume.patch" Index: hdaa.c =================================================================== --- hdaa.c (revision 233600) +++ hdaa.c (working copy) @@ -612,10 +612,11 @@ if (w == NULL || w->enable == 0 || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) continue; - if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap) && - w->unsol < 0) { - w->unsol = HDAC_UNSOL_ALLOC( - device_get_parent(devinfo->dev), devinfo->dev, w->nid); + if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap)) { + if (w->unsol < 0) + w->unsol = HDAC_UNSOL_ALLOC( + device_get_parent(devinfo->dev), + devinfo->dev, w->nid); hda_command(devinfo->dev, HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | w->unsol)); --------------090809010902010702030901--