Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp102239ybp; Thu, 3 Oct 2019 10:47:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwMAej4JP2aTAzgf893/ZSB0dIjjR3taoq7rp/2fvhz51pK0REefGPmnr1JVBVAN1oRmJ7 X-Received: by 2002:a17:906:6805:: with SMTP id k5mr8706501ejr.50.1570124851596; Thu, 03 Oct 2019 10:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570124851; cv=none; d=google.com; s=arc-20160816; b=FZHL0+czefO5Z1DUB5i+vOGP/KTqHper+fBnpaK/nUhQW2l813puC41V/mYbZRPOvl /WK4c9MgLdUaFqZe9OQCGdF0TzNYo1LcEfG4GOki9+VcmcKebNqwwUgEM35NOo2p2pll 5g4f60hlXi+1/yoXZAakbG+UD+E5gu0iEdoBz3iqD15BWnwxFpYiakT00Ez6gf98EGpp gdRjtm4w+eeU3BaVQ6xnrS8LuIrXoosouh+82OIOZIHS/YZ6FGvOqaRS/htoRKS9GY0b OPyXm/8xEQ2IVTZ3lobT2A3CDbtOk8RVFDwDXggMeNXoeE5q+fovfS7QbQUJ5z8FlqHj wj5g== 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:dkim-signature; bh=ON1QYFNb3Rg312/AEfSSxjj/gNE6LIa5E8BmrubpRGY=; b=iZUk2kncomrrOIh5QHM4C4pb3BqO8U8m+kZInoLduLTodvQKE1I8dofTCxTYBb5ORo OTrqQ/9drWvHXXR3G637YHs0AxbGJVyaGYqHa9+fCe5H8aOc3dt3pvH7HZe/monjWZ7O VzBmG7G59Gw0lKLB79OD3xYHV/xuYtCCl2kC3YLplpA6voJF7p/+IDAB/OtFWuwV5a1q tiTL2M6l39UibF39h9yx2Mx33bxkgDxUfwkg+Zr0RauwRdNdgzr5ULKL08pyES20xzng gTO9X99P8reHnLq51eWjvKaPHVOWlxgYOpqGGUc20vo3gZzBbIt6zvU/qYSIFfe3bT+e FiqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xABfw26n; 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 y26si1752261edu.176.2019.10.03.10.47.07; Thu, 03 Oct 2019 10:47:31 -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; dkim=pass header.i=@kernel.org header.s=default header.b=xABfw26n; 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 S1731047AbfJCR0y (ORCPT + 99 others); Thu, 3 Oct 2019 13:26:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:39634 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387847AbfJCQP2 (ORCPT ); Thu, 3 Oct 2019 12:15:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 74B2921848; Thu, 3 Oct 2019 16:15:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119327; bh=8HqNIqXsVS/Tg0e30ZkVdKv142vE/mvJ/mNR13y/AM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xABfw26nEbhDuzIgj3P6crw0GasRfPHPSDGagsv0o7/yq3DLxeA2ajd/ECo6X8esY LUHslFEafQIRPg+dBmP9Vw/I/WdVWHXm7anoB2OHGcIJqgrXbeOxY10r9jsdIho/E3 NxOT/gYDUrAOyzn70cYXkrC725qyARhrQC7/BlVA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Wilson , Takashi Iwai , Sasha Levin Subject: [PATCH 4.19 024/211] ALSA: hda: Flush interrupts on disabling Date: Thu, 3 Oct 2019 17:51:30 +0200 Message-Id: <20191003154452.709507265@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154447.010950442@linuxfoundation.org> References: <20191003154447.010950442@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Chris Wilson [ Upstream commit caa8422d01e983782548648e125fd617cadcec3f ] I was looking at <4> [241.835158] general protection fault: 0000 [#1] PREEMPT SMP PTI <4> [241.835181] CPU: 1 PID: 214 Comm: kworker/1:3 Tainted: G U 5.2.0-CI-CI_DRM_6509+ #1 <4> [241.835199] Hardware name: Dell Inc. OptiPlex 745 /0GW726, BIOS 2.3.1 05/21/2007 <4> [241.835234] Workqueue: events snd_hdac_bus_process_unsol_events [snd_hda_core] <4> [241.835256] RIP: 0010:input_handle_event+0x16d/0x5e0 <4> [241.835270] Code: 48 8b 93 58 01 00 00 8b 52 08 89 50 04 8b 83 f8 06 00 00 48 8b 93 00 07 00 00 8d 70 01 48 8d 04 c2 83 e1 08 89 b3 f8 06 00 00 <66> 89 28 66 44 89 60 02 44 89 68 04 8b 93 f8 06 00 00 0f 84 fd fe <4> [241.835304] RSP: 0018:ffffc9000019fda0 EFLAGS: 00010046 <4> [241.835317] RAX: 6b6b6b6ec6c6c6c3 RBX: ffff8880290fefc8 RCX: 0000000000000000 <4> [241.835332] RDX: 000000006b6b6b6b RSI: 000000006b6b6b6c RDI: 0000000000000046 <4> [241.835347] RBP: 0000000000000005 R08: 0000000000000000 R09: 0000000000000001 <4> [241.835362] R10: ffffc9000019faa0 R11: 0000000000000000 R12: 0000000000000004 <4> [241.835377] R13: 0000000000000000 R14: ffff8880290ff1d0 R15: 0000000000000293 <4> [241.835392] FS: 0000000000000000(0000) GS:ffff88803de80000(0000) knlGS:0000000000000000 <4> [241.835409] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 <4> [241.835422] CR2: 00007ffe9a99e9b7 CR3: 000000002f588000 CR4: 00000000000006e0 <4> [241.835436] Call Trace: <4> [241.835449] input_event+0x45/0x70 <4> [241.835464] snd_jack_report+0xdc/0x100 <4> [241.835490] snd_hda_jack_report_sync+0x83/0xc0 [snd_hda_codec] <4> [241.835512] snd_hdac_bus_process_unsol_events+0x5a/0x70 [snd_hda_core] <4> [241.835530] process_one_work+0x245/0x610 which has the hallmarks of a worker queued from interrupt after it was supposedly cancelled (note the POISON_FREE), and I could not see where the interrupt would be flushed on shutdown so added the likely suspects. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111174 Signed-off-by: Chris Wilson Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/hda/hdac_controller.c | 2 ++ sound/pci/hda/hda_intel.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c index 74244d8e29090..e858b6fa0c3ad 100644 --- a/sound/hda/hdac_controller.c +++ b/sound/hda/hdac_controller.c @@ -443,6 +443,8 @@ static void azx_int_disable(struct hdac_bus *bus) list_for_each_entry(azx_dev, &bus->stream_list, list) snd_hdac_stream_updateb(azx_dev, SD_CTL, SD_INT_MASK, 0); + synchronize_irq(bus->irq); + /* disable SIE for all streams */ snd_hdac_chip_writeb(bus, INTCTL, 0); diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 0b24c5ce2fd6a..bfc45086cf793 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1455,9 +1455,9 @@ static int azx_free(struct azx *chip) } if (bus->chip_init) { + azx_stop_chip(chip); azx_clear_irq_pending(chip); azx_stop_all_streams(chip); - azx_stop_chip(chip); } if (bus->irq >= 0) -- 2.20.1