Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3894148rwa; Tue, 23 Aug 2022 12:03:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR4P/CP9qsPDnGrCaWh5LIqgXZz66EN+cxZmWXCCsU69UIIXsbdQkFL8dSRTNBjGy3ded9aS X-Received: by 2002:a05:6a00:148c:b0:52e:a630:afc7 with SMTP id v12-20020a056a00148c00b0052ea630afc7mr26764364pfu.0.1661281390060; Tue, 23 Aug 2022 12:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661281390; cv=none; d=google.com; s=arc-20160816; b=L0WM/J6yhs4rGI3uKzrxhLPKDyJoMOmfnIMLg4GLgeUbHVsnrXJJJO1zBN2DqmTFuO urttfSBEkM+uwvvtz60/xoujffqy+AZXnY5/gjkFbEMm+kYPgS+Aw8bd0gC77JrNWdMg IZVTuh7twPj0jRBo2xiLKYUjvixwaeCitN6UG8sUbrUU/+P3Ox45pQ+zvzYtz4y4XIgm QeTHUQGlY+O8tuvyo1UrGcNk1oYwBOZEsQq55P1OM3tKHQLIHmwKrs8Ub0xqv16g66BE LU2O9NZODbiIolXKXpWC6/TzWHNzpe/eb5BujsvUdqfyLUdm6Sj2pFlL2ArTv62unyVW zMkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=dCjgBKmdu/hFsdpoHh8xDWxTTORKyFyxVNqLSbgWw14=; b=JqXy/Gdt/LLM4jrXsqld0VnvlRA5lxB4oWKlrIiEvDMOSBgRwIGgoX6G9gJkqqhaSM SNhtkuIVQLTgoznLE+jEPhNhw1woTUPI80knFyZHyGZLlScr5iAtDh9MHpBudvgvMsgi 9FxFbcvVYitxtbAWTknZYm0S3kk0fV2U83hTLBEMSrhfMUt/lJWkUT7vgQuIFlOkTYEK GMAH+oF8LwdAh0K5Z8mj+DOz3ZtDJcWgWteNxG03zwpsWD1focGElnX2tMmRn6iDFZPK uVw+qbL7qCyCM+ygnXsfqiazVmr24d0NwCLbSb2Irx+U7hQAnV/M/P35NtoEpfSL3m0+ DYOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Cr8FcDMN; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h62-20020a638341000000b0041e04d16642si4147777pge.604.2022.08.23.12.02.56; Tue, 23 Aug 2022 12:03:10 -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=@intel.com header.s=Intel header.b=Cr8FcDMN; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231229AbiHWS1Z (ORCPT + 99 others); Tue, 23 Aug 2022 14:27:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229773AbiHWS1E (ORCPT ); Tue, 23 Aug 2022 14:27:04 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D018D3C8D5; Tue, 23 Aug 2022 09:46:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661273180; x=1692809180; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=dUi+7JqD+p5hV/9OPEqX43GBsNQ+YwFNKuWsnUPogWE=; b=Cr8FcDMNZf0ZTbPp8fkFZC3IGufFEvOPJ5mU9by7AZzuRGZzZ27cL3O+ 6HOIXGCelNZyG12bwIBOMW7ooezynAFZVRJ1spOGXk7WCnvFe4XjIakyu e39LVu2CvfwDZoimrZjCy1FfvHxuCERTUeRvKzcO0+QAsb3V+ZtN5nYq3 xbXiVnDN1tg9UK8wPm1CPUI6PeBR4sj5Vq6L44S4pUhjmlY/8E4nGdDOh Ln9kEGtle3Eve/ZbAEWWZZJI7+/gr+qskmNZotEzYbo4nEiSkRrP/29HV u9ym5wZS1aIgahbrO+yD8RhwFhAMq1V9Q8UdSkTVTGudjZO7AoWk2KLY8 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10448"; a="280712546" X-IronPort-AV: E=Sophos;i="5.93,258,1654585200"; d="scan'208";a="280712546" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Aug 2022 09:46:20 -0700 X-IronPort-AV: E=Sophos;i="5.93,258,1654585200"; d="scan'208";a="612470634" Received: from tdrohan-mobl1.amr.corp.intel.com (HELO [10.212.86.80]) ([10.212.86.80]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Aug 2022 09:46:19 -0700 Message-ID: <905d3feb-f75b-e91c-f3de-b69718aa5c69@intel.com> Date: Tue, 23 Aug 2022 09:46:19 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.12.0 Subject: Re: [PATCH v2] dmaengine: idxd: avoid deadlock in process_misc_interrupts() Content-Language: en-US To: Jerry Snitselaar , linux-kernel@vger.kernel.org Cc: Fenghua Yu , Vinod Koul , dmaengine@vger.kernel.org References: <20220823162435.2099389-1-jsnitsel@redhat.com> <20220823163709.2102468-1-jsnitsel@redhat.com> From: Dave Jiang In-Reply-To: <20220823163709.2102468-1-jsnitsel@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On 8/23/2022 9:37 AM, Jerry Snitselaar wrote: > 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 Thanks Jerry! Reviewed-by: Dave Jiang > --- > v2: add Fixes tag, and add subsystem to summary > > 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; > } > }