From patchwork Sat Oct 22 07:24:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7463 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1098830wrr; Sat, 22 Oct 2022 01:11:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4QjgEc8BmrxBhnPKV/eAtJdzkHjNpVm4L977z+p2oKcMFKJKJs0UxFTGpI8NhzPAPJ2e8J X-Received: by 2002:a17:902:cecf:b0:185:475a:4073 with SMTP id d15-20020a170902cecf00b00185475a4073mr23572883plg.60.1666426314378; Sat, 22 Oct 2022 01:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666426314; cv=none; d=google.com; s=arc-20160816; b=en0D2ZyrdaLzw0bWAxsUYZDc7tqhy+vR4rxkpOApaDtqZJd8f5dfFvSsZaByS4meLX J9mS12R+h9fRCN+SfpBG6K77kVITSwa+f1qNlcEeHjm33purkUvVOmg5uhFReMyghYAX MwHf6J03rMU1I/T6LcUW5vF0rTzVVy6rZcwMoyqECgv9ah56GMQpjFdcqgAinSKp4/rX 0gd3HCLkj+KYfvxvXynpnfbfLOEdbvGNJ15ffqARZIdSAfdD76+egBsDXDfsHDMQaFpq ODCsHUN+nmLFUQbX1CMXONHMC0MKi8yxG6eg4yE1F2GDMJJzokFbtj2MNoyf9tWZ2Db9 gRhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=F0ZW0k//9OnPv/YFGK1/u1Uwtm1TX/Jr7ByLNI0XqQo=; b=LWx62JCzfogN8Ql3i/7Js5nDbrynpJkGbm7uJm9jzy90ieUzeUhkTWwwmtJ34ARwaz cfGLm92ws2vLiCsX/07A2u06yu+fVPKPrpkBuqh/ikahDcNQ8Q5uAPqf8kG0YwOenr4u 5ZJvJg7wJZjxDH7/CYfi3jpNBhScNquyZLPGOTBS6D1Tj5/D35wWRV5lzxlRJal4LrPA pI8I/fjD64/6CgV/2KaxsmKamK5F0pubMoUuW4fuZ0EgEeix+k9gZtdr0jO2vHmPtPJV OQcUk34L7D4R6iq8WM69fanDg2jdyRFligPsmvTfFqnT7rDFebg6Qw7LXPUHDEUP03L1 Z2kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=naz7o3c0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a170902849400b001748ede4e05si26571419plo.119.2022.10.22.01.11.41; Sat, 22 Oct 2022 01:11:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=naz7o3c0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233257AbiJVILG (ORCPT + 99 others); Sat, 22 Oct 2022 04:11:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233074AbiJVII2 (ORCPT ); Sat, 22 Oct 2022 04:08:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98AEA2CB8BA; Sat, 22 Oct 2022 00:53:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8789860B83; Sat, 22 Oct 2022 07:52:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8531FC43470; Sat, 22 Oct 2022 07:52:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425167; bh=k9UmSSd24VoHD4EdvwgqSONVwGFzHEbaHDORRiPVUfQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=naz7o3c014gL0BG8ejmgL+BXYtjb6VfmbAl6bnX1uycoTAvNsFtgzY3bxlfnQ14OO fLlVbyh/okQGAHZBXEdNmOXumvkprRxaz4Khl3DgIuzc7tAWzA+d9OCTXNgxjpMKK0 cWpmizbahHcHoPPvTPVQtTDD/3g1pZnJ7pe+lYxQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fenghua Yu , Dave Jiang , Vinod Koul , dmaengine@vger.kernel.org, Jerry Snitselaar , Sasha Levin Subject: [PATCH 5.19 412/717] dmaengine: idxd: avoid deadlock in process_misc_interrupts() Date: Sat, 22 Oct 2022 09:24:51 +0200 Message-Id: <20221022072516.329391173@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747374638898013343?= X-GMAIL-MSGID: =?utf-8?q?1747374638898013343?= From: Jerry Snitselaar [ Upstream commit 407171717a4f4d2d80825584643374a2dfdb0540 ] 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 Fixes: cf4ac3fef338 ("dmaengine: idxd: fix lockdep warning on device driver removal") Signed-off-by: Jerry Snitselaar Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20220823163709.2102468-1-jsnitsel@redhat.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- 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 = 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 == IDXD_DEVICE_RESET_FLR ? "FLR" : "system reset"); - spin_unlock(&idxd->dev_lock); return -ENXIO; } }