Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3975rwe; Wed, 24 Aug 2022 14:53:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR6pttDfg36e0sYopUXT1ErVwDfUi2f2ixhlciCxUFOTozMLCO/sO+Nb2gjyAlgqENPaPi1e X-Received: by 2002:a17:907:608b:b0:731:8a9d:5a2d with SMTP id ht11-20020a170907608b00b007318a9d5a2dmr559651ejc.443.1661378010360; Wed, 24 Aug 2022 14:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661378010; cv=none; d=google.com; s=arc-20160816; b=qn/DBplwINeOMt8A74UTDNVdSkRKQHCPXL5UCxAh6aXPFGsI28X71GAWgZ384DGL42 W08rwQZ5NN5EWY/i8uxjOkvg/TGGTOlAFe2wjmokyY6OmUp+Gko1OtjiWovoQUwRN3xB O+34tmM58dcDS/++bDwZ/4V3N1E0TVD9ZCi8pgbS62EZ161GSTeNWLVycus19fqGvBJi tq8KVJxooHBv4s63nhbE1Knrrjcf50nlzl1hV/0lSBf1/+i8BH7G+I4Vn5+20KkJ03KG BEZD8Odz+KnJC45hVsB4GwoslN4bshtllngEsG1aUx11Qj3Yywo3aWklq17KNUFgGycT myeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=2cnZB4/kxG5SzSCN2CWQT4rDr7KWqDzVyVVIFcXfgQM=; b=FYXswOc/8nPq9czep02fGmdyUA5hXcV7yTcKUL+nKY4B+Kr5t1N30xMF/lm+aAHSmU EFs9V1USsky4eqwJbET6DIDNInrz7za1E3/e5w1jmvXT01JQmjHtdXhbDu1VNiJIR8Qx UXsCCF30R+5A5xmDY2f2rnK0+EBpP/ZQlPJaEM5mhrscomztgVax2yw/EmMEOCfxKhIn yYPvOuvv+LO0PNngxVZ+54QpGM4LYGF4Id7kqdcnPJH/R9SEvWpoooUrD67J+y/TFSbC UyN3Lh7WcA293T4KbhqaNkwTxLmvBFvXoo8CgaKrHV6xYsrQMyVuu6Ve6ogyRd30LC/l xwoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bTTVmU3k; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ib10-20020a1709072c6a00b0073d21e8125dsi2396042ejc.850.2022.08.24.14.53.03; Wed, 24 Aug 2022 14:53:30 -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=@redhat.com header.s=mimecast20190719 header.b=bTTVmU3k; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238932AbiHXVeL (ORCPT + 99 others); Wed, 24 Aug 2022 17:34:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240133AbiHXVeH (ORCPT ); Wed, 24 Aug 2022 17:34:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A41C25FF58 for ; Wed, 24 Aug 2022 14:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661376844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2cnZB4/kxG5SzSCN2CWQT4rDr7KWqDzVyVVIFcXfgQM=; b=bTTVmU3kWUL7LBdJxTQHczpEHBc7qZnbK9S4/lnlzkldm+y6MWq2vMboA2krGV0txPSnf5 QWXdkmxMwcu6ylEtnKEhNUBb4veCyGFsDruaKUyVSIizm6U9Ha2RmUsKPE9IIKVS6wcQUk fPxl59R0Vr9zBSgMl3e5OyzLjlWIzU0= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-119-twTP8OvkOECN9_gUSWB76w-1; Wed, 24 Aug 2022 17:34:03 -0400 X-MC-Unique: twTP8OvkOECN9_gUSWB76w-1 Received: by mail-qk1-f197.google.com with SMTP id w22-20020a05620a445600b006bb7f43d1cfso15778439qkp.16 for ; Wed, 24 Aug 2022 14:34:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc; bh=2cnZB4/kxG5SzSCN2CWQT4rDr7KWqDzVyVVIFcXfgQM=; b=r2RwT2+YWmDXPBri824khdaWa2nVpTuMCDAiyQXMZxAe5pvBkPtm/xBQmoNPczL0t2 cI6bLKypwM/q9W7Fok4PGnpwGv5AEOXLkXPpToDfyIAi6GTzpIxSVEzAgc8HV87CI84j /Yhg9LY4gywnd8MhQf3cuAoZ9nby4e0tWNRiPXz9LlRWQiVFWZrKsfVER/UawjAwKzc4 Dwv+y3YakmClygSZmehwLZ7V1vI5VnAMzRKAysJSluYaN5uIAqSdQdk5pJGqrkb24zSX 3ZFdRAhMMegZ5vfh7UUEySCeqvCpgunIIrgW96twONLlsLkGUVsJsocFkZ8hRwMM0XDd yNGw== X-Gm-Message-State: ACgBeo2xjMrzYAfqh82QlB+x7q6NBc9nrRS0HPbdvqQNbF0au7SvDHku KRj6mRMBfPHSgtd7v5yilbxvSCMNEZbqpXpKxfHph0H7Rrs4JQtlJIWyzfJ4k70KYh93kJ2Iw0n AFUR2wuylsvcSDj/nQQI65Njg X-Received: by 2002:a0c:8ec4:0:b0:47a:aa82:58b6 with SMTP id y4-20020a0c8ec4000000b0047aaa8258b6mr1101008qvb.46.1661376842602; Wed, 24 Aug 2022 14:34:02 -0700 (PDT) X-Received: by 2002:a0c:8ec4:0:b0:47a:aa82:58b6 with SMTP id y4-20020a0c8ec4000000b0047aaa8258b6mr1100986qvb.46.1661376842404; Wed, 24 Aug 2022 14:34:02 -0700 (PDT) Received: from [192.168.1.52] (ip98-179-76-75.ph.ph.cox.net. [98.179.76.75]) by smtp.gmail.com with ESMTPSA id b17-20020ac84f11000000b0031e9ab4e4cesm13337901qte.26.2022.08.24.14.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 14:34:01 -0700 (PDT) Message-ID: <33a546ea17fe62ca9fc763041fe340ad5e4945fe.camel@redhat.com> Subject: Re: [PATCH v2] dmaengine: idxd: avoid deadlock in process_misc_interrupts() From: Jerry Snitselaar To: "Yu, Fenghua" , "Jiang, Dave" , "Zhu, Tony" Cc: "linux-kernel@vger.kernel.org" , Vinod Koul , "dmaengine@vger.kernel.org" Date: Wed, 24 Aug 2022 14:34:00 -0700 In-Reply-To: References: <20220823162435.2099389-1-jsnitsel@redhat.com> <20220823163709.2102468-1-jsnitsel@redhat.com> <905d3feb-f75b-e91c-f3de-b69718aa5c69@intel.com> <20220824005435.jyexxvjxj3z7tc2f@cantor> <223e5a43-95a5-da54-0ff7-c2e088a072e3@intel.com> <38e416b47bb30fa161e52f24ecbcf95015480fed.camel@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Wed, 2022-08-24 at 21:11 +0000, Yu, Fenghua wrote: > Hi, Jerry, >=20 > > I see another potential issue. If a software reset is attempted > > idxd_device_reinit() > > will be called which walks the wqs, and if a wq has the state > > IDXD_WQ_ENABLED it calls idxd_wq_enable(), but the first thing > > idxd_wq_enable() does is see that the state is IDXD_WQ_ENABLED and > > returns 0. > > Without the wq enable command being sent, it will not be re- > > enabled, yes? >=20 > Could you please describe how to reproduce the issues and test case? Nothing special, just running dsa_user_test_runner.sh from idxd-config (3.4.6.3) with intel_iommu=3Don,sm_on (default is lazy dma domain) on an Intel supplied SPR system. During the run there is a dmar fault, halts the device with it needing an flr reset. That is where the deadlock was noticed. Then after the dsa_user_runner.sh fails, if you do modprobe -r idxd, you hit the warning in devm_iounmap(). The idxd_device_reinit() case I haven't reproduced, I'm just looking at the code. I should note that I've only run into an issue with that model of system. The other models of SPR systems don't hit an issue. This is with a 6.0-rc1 kernel, and our kernel. I'm guessing there is an issue with that model of system/fw. I've seen both fault reasons 0x50 and 0x58 when it faults. Regards, Jerry >=20 > Thanks. >=20 > -Fenghua