From patchwork Wed Oct 19 08:29:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4811 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp218598wrs; Wed, 19 Oct 2022 02:23:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Kc4W/opU/TDag7iWFjdZ6VMILqUtFzuuVFhl/+WhRG8ofNHGvqasyx181U1xn4BMPQn/c X-Received: by 2002:a05:6402:40d4:b0:45d:1351:3f9d with SMTP id z20-20020a05640240d400b0045d13513f9dmr6470339edb.199.1666171398440; Wed, 19 Oct 2022 02:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666171398; cv=none; d=google.com; s=arc-20160816; b=gDi83bmVt3tNml/vgqHF5wueGaNqtKUkGb6CW/MZbPi4ou+rwlygjcAvqTdMdrjRe2 uo7H8eyfQCjZACZupMg3IklRCqMB7wtmi9PqiCu5kPlRdKnV+5NrcZXITFhwNfKhEGSq wCg/grDt4dZsuxiRpG+9hatA5tZ/I7eoG1vbWTF5X+SfdWCB0X4c+xM5k7yJqyCWEZGB wKNQl7N8TTlSSwlPCT6yW5Ui42Mf2J2RRx547CLPGUvEXZAJqtoua+ta8ZIgynVL0zSk 3hVykHYhr4ZFAIZLi4qo6UPiDr48xcfWnkiJmltUGISeB1Bj2AF28fj3h8yyEiubpMsW INdg== 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=rRPB9opDXdM5rEHFU3lcV98gvwF2oaWTiAfzsXCwd949VK2Qb/2yXYm7ebv89/HQ2J DRv9zFlPSyRL3a9oMYkzuUZwml7p6DPm+QPcreQwxmWgXyZq5/eMA9I6pEE6iWy/T6j/ fnb6ROhGyIxrYJfGQ6aTPTewg1L+URz18D1u0reuUVtfSP8wa2e8qnQsExo9+r2HCdiY K+3dNxqHsdT6kgPAMEriz832jG4GFBc12QKIihewSJoHzmhMIQYbp58wFcOepO7Cwy4P QcxRD62USSRsECtEjzraXYsRxT+8EvRH8/SDMvFtcsNHDzQGqTy3z1mJzmZg9i2cJHA4 OaeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uwIKVdGu; 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 go10-20020a1709070d8a00b0078e11cbb722si16839623ejc.92.2022.10.19.02.22.52; Wed, 19 Oct 2022 02:23:18 -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=uwIKVdGu; 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 S233284AbiJSJSC (ORCPT + 99 others); Wed, 19 Oct 2022 05:18:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233221AbiJSJOO (ORCPT ); Wed, 19 Oct 2022 05:14:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7FD5DFC9; Wed, 19 Oct 2022 02:04:29 -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 0A0F46181D; Wed, 19 Oct 2022 09:00:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F2C6C433D6; Wed, 19 Oct 2022 09:00:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170048; bh=k9UmSSd24VoHD4EdvwgqSONVwGFzHEbaHDORRiPVUfQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uwIKVdGuzLQwhxO9hQgPH/9lrl8YqE0aJ+NE0Pfcckc3qOgT0aTTiiw3VsTX9/dzp BDnLnraPQRqNTc79C7c11VNR/oZeLznitDUxD22PrbH/j+h2lIlE1OIGpipu3ff5EG MOezB958iyT8c2Q1/dAM7n3fcjEGwlycjQX9moko= 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 6.0 507/862] dmaengine: idxd: avoid deadlock in process_misc_interrupts() Date: Wed, 19 Oct 2022 10:29:54 +0200 Message-Id: <20221019083312.384744713@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747107340491794681?= X-GMAIL-MSGID: =?utf-8?q?1747107340491794681?= 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; } }