From patchwork Wed Feb 14 04:06:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhijeet Kumar X-Patchwork-Id: 10218019 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B52DA605BA for ; Wed, 14 Feb 2018 03:58:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB43D289E1 for ; Wed, 14 Feb 2018 03:58:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A02B1289F9; Wed, 14 Feb 2018 03:58:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6B49228A08 for ; Wed, 14 Feb 2018 03:58:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC8126E354; Wed, 14 Feb 2018 03:58:27 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2AF2489FED for ; Wed, 14 Feb 2018 03:58:26 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2018 19:58:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,510,1511856000"; d="scan'208";a="19841210" Received: from intel-h97m-d3h.iind.intel.com ([10.66.247.169]) by fmsmga002.fm.intel.com with ESMTP; 13 Feb 2018 19:58:25 -0800 From: abhijeet.kumar@intel.com To: intel-gfx@lists.freedesktop.org, chris@chris-wilson.co.uk, abhijeet.kumar@intel.com Date: Wed, 14 Feb 2018 09:36:31 +0530 Message-Id: <1518581192-26400-2-git-send-email-abhijeet.kumar@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1518581192-26400-1-git-send-email-abhijeet.kumar@intel.com> References: <20180213192918.26331-2-chris@chris-wilson.co.uk> <1518581192-26400-1-git-send-email-abhijeet.kumar@intel.com> Subject: [Intel-gfx] [PATCH 2/3] redo X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Abhijeet Kumar --- sound/pci/hda/hda_codec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index e018ecbf78a8..8c1b07e300a8 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -2711,12 +2711,15 @@ static unsigned int hda_sync_power_state(struct hda_codec *codec, { unsigned long end_time = jiffies + msecs_to_jiffies(500); unsigned int state, actual_state; + int count; - for (;;) { + for (count = 0;count < 500; count++) { state = snd_hda_codec_read(codec, fg, 0, AC_VERB_GET_POWER_STATE, 0); - if (state & AC_PWRST_ERROR) + if (state & AC_PWRST_ERROR){ + msleep(20); break; + } actual_state = (state >> 4) & 0x0f; if (actual_state == power_state) break;