Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4534634imm; Mon, 17 Sep 2018 16:02:37 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaMxjcKyNDNjUIRlRAfDgS6lZP0KZULcrZx4t7/dLliN5PdRiE6MqjEkCtvB7HuNDT0Fmss X-Received: by 2002:a17:902:4503:: with SMTP id m3-v6mr26499897pld.168.1537225357179; Mon, 17 Sep 2018 16:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537225357; cv=none; d=google.com; s=arc-20160816; b=ZZ/CvdAjrlkWWz7RTJUkX2PKlWSzz7XrEPE0fw0SL6qqp0x9W+M/dZnV/V0FFA2z/V JKXna/oPo8uQCvI+OTw7AO0JXuaupku2DuTq3wDH7/Qas2OIJu+tUvFU0z/XNgTweyUs 9845i7qUlFk6Njd+UuAPyWyslDe5RqZjxjHkbV3Yvc10nHP5uC/XjSCwuRTyfgqII9ZM 2FrKvl4g7cP6mVXPh8OiRdHDVvVuYD9/7WzODuONabMVIzhfkKOwDaJAn5KasIrt4cYR Oa5It9CF0qlLkOZxmVEibPBWtKLu8N46tVFjXlsT1qcTqTIKARE61ARJ3AVMTwHcLwI6 57Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=/qaXIkAOY5OCSl7rAZ5/xVYgxEARwjKMev6M9FAjRsE=; b=Q0jS8cE5OU0LsMr704E+YNGwzlDxD0ItwxXyaePRIfwxJ+xqne+f3x0HIvJ2v0/7LT SoMQVhFeOnREPwYQr+O3gn/3/sW2d3W5exjlSth85+SOZoRBSTCmRFHwAg9o5Pzuuci5 XcimYDPfNfUDXZWDBEBecWhoOroMy6VRlqouBn3IikEH0bS06Sv0d4v8Ysj8D/IIcpem wZNu5dmjSSd7If5nuAgct4c6yizfr2vwBT+/NWa9AGIveZd0pgbqvnmQsrJYmqEiltSD z7fq13JMbqHxgdN4BxXRUMaJlnkNz33wgnD5lrTa9UoYoW0ii3jEm+3zrg892WcFxRyv UPqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m184-v6si16484683pgm.265.2018.09.17.16.02.22; Mon, 17 Sep 2018 16:02:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730331AbeIREbc (ORCPT + 99 others); Tue, 18 Sep 2018 00:31:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48378 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727088AbeIREbc (ORCPT ); Tue, 18 Sep 2018 00:31:32 -0400 Received: from localhost (li1825-44.members.linode.com [172.104.248.44]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D1035C03; Mon, 17 Sep 2018 23:02:03 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lukas Wunner , Takashi Iwai Subject: [PATCH 4.14 013/126] ALSA: hda - Fix cancel_work_sync() stall from jackpoll work Date: Tue, 18 Sep 2018 00:41:01 +0200 Message-Id: <20180917211705.488642958@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180917211703.481236999@linuxfoundation.org> References: <20180917211703.481236999@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Iwai commit 16037643969e095509cd8446a3f8e406a6dc3a2c upstream. On AMD/ATI controllers, the HD-audio controller driver allows a bus reset upon the error recovery, and its procedure includes the cancellation of pending jack polling work as found in snd_hda_bus_codec_reset(). This works usually fine, but it becomes a problem when the reset happens from the jack poll work itself; then calling cancel_work_sync() from the work being processed tries to wait the finish endlessly. As a workaround, this patch adds the check of current_work() and applies the cancel_work_sync() only when it's not from the jackpoll_work. This doesn't fix the root cause of the reported error below, but at least, it eases the unexpected stall of the whole system. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200937 Cc: Cc: Lukas Wunner Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/hda_codec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -3923,7 +3923,8 @@ void snd_hda_bus_reset_codecs(struct hda list_for_each_codec(codec, bus) { /* FIXME: maybe a better way needed for forced reset */ - cancel_delayed_work_sync(&codec->jackpoll_work); + if (current_work() != &codec->jackpoll_work.work) + cancel_delayed_work_sync(&codec->jackpoll_work); #ifdef CONFIG_PM if (hda_codec_is_power_on(codec)) { hda_call_codec_suspend(codec);