From nobody Wed Apr 8 04:25:13 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CB20C32789 for ; Tue, 23 Aug 2022 18:13:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233674AbiHWSND (ORCPT ); Tue, 23 Aug 2022 14:13:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233600AbiHWSMh (ORCPT ); Tue, 23 Aug 2022 14:12:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9819F9BB56 for ; Tue, 23 Aug 2022 09:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661271879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ZInkH65kXXJrl1np4vOxGvfc6E02VGBPw4illArQKwk=; b=T6Us9JUsZUdABf1LKsliQmem7POLI3kepXdyS1mynfK4sr2YNN4ba1hZvKfA1PiImlNw7f Z+dB5LybRbaj36neI0x0mxBwvndG41WRG265DGz/ROg6Zb2ovmHFGZ/MO50dYMPCOdUwQQ xBnI57QPUY2fuwT0g0Cq22IdZxhZG7w= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-382-b1M910_7MUWejWr76gIR-Q-1; Tue, 23 Aug 2022 12:24:38 -0400 X-MC-Unique: b1M910_7MUWejWr76gIR-Q-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4C7A3C0E20F; Tue, 23 Aug 2022 16:24:37 +0000 (UTC) Received: from cantor.redhat.com (unknown [10.2.16.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DC964010D2A; Tue, 23 Aug 2022 16:24:37 +0000 (UTC) From: Jerry Snitselaar To: linux-kernel@vger.kernel.org Cc: Fenghua Yu , Dave Jiang , Vinod Koul , dmaengine@vger.kernel.org Subject: [PATCH] idxd: avoid deadlock in process_misc_interrupts() Date: Tue, 23 Aug 2022 09:24:35 -0700 Message-Id: <20220823162435.2099389-1-jsnitsel@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" idxd_device_clear_state() now grabs the idxd->dev_lock itself, so don't grab the lock prior to calling it. This was seen in testing after dmar fault occurred on system, resulting in lockup stack traces. Cc: Fenghua Yu Cc: Dave Jiang Cc: Vinod Koul Cc: dmaengine@vger.kernel.org Signed-off-by: Jerry Snitselaar --- drivers/dma/idxd/irq.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/dma/idxd/irq.c b/drivers/dma/idxd/irq.c index 743ead5ebc57..5b9921475be6 100644 --- a/drivers/dma/idxd/irq.c +++ b/drivers/dma/idxd/irq.c @@ -324,13 +324,11 @@ static int process_misc_interrupts(struct idxd_device= *idxd, u32 cause) idxd->state =3D IDXD_DEV_HALTED; idxd_wqs_quiesce(idxd); idxd_wqs_unmap_portal(idxd); - spin_lock(&idxd->dev_lock); idxd_device_clear_state(idxd); dev_err(&idxd->pdev->dev, "idxd halted, need %s.\n", gensts.reset_type =3D=3D IDXD_DEVICE_RESET_FLR ? "FLR" : "system reset"); - spin_unlock(&idxd->dev_lock); return -ENXIO; } } --=20 2.37.2