Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp329668qtb; Wed, 19 Oct 2022 03:08:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7OBLReRJ8S0WI5qMikoofspb8nsikS5lqafTh5Wm7Kz3NF9LaYPs+q6zxC6wprXd56k/IK X-Received: by 2002:a17:907:86a8:b0:78d:b89f:937 with SMTP id qa40-20020a17090786a800b0078db89f0937mr5930099ejc.419.1666174089937; Wed, 19 Oct 2022 03:08:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666174089; cv=none; d=google.com; s=arc-20160816; b=l90cIcsPpW7mlN8S6FjpJpq75aJlKGVNt3Kmzl8A5C11DU/1HcLkaV1omwynkO+vpB 9VPBK05cJBww22P8pTt8LBRRylYjnVPZAtTA4AR5mtTGPBfqQ1uqMfRQlc5Cr7Zrzzku rN7oKroSoxP1vk9yM6WjGvPhGBWJPMS0q4jJfhWeazb9+HuXRSCPrHPkwRSqMLg6PoTU YSOemlfL3qonMW2nDy8neo3X503RtWzeFXoRT00Fx9iV8iZLvc2QafnKcqmPHI21K0Ve BwJQNqoq6kpmg1d6OYWR5iRkWM6klE2awlLAo048/rurFj068NmexXh8VXxIDNsZ7akB ovBw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y11-20020a056402358b00b0045d22bc81a0si13911137edc.231.2022.10.19.03.07.43; Wed, 19 Oct 2022 03:08:09 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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; } } -- 2.35.1