Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1431624lqz; Mon, 1 Apr 2024 06:24:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtMKPfL2tezCx4MspSoCrAOmpUZhgtJ+jh3unfRrjeHPm87JbMXRMjwYs0QJkNdFPgrlOvaSt55ii8blKrG6tG/XRTKpnj4nFVyAs5cQ== X-Google-Smtp-Source: AGHT+IHGYm6V3erAnXlB5RQC4ZQkkWZrY/lCJQUVP7NxvcDSXtrPepUJJVy2FoEyQRlEFYPeHZor X-Received: by 2002:a17:90a:4962:b0:29d:e2dc:bf5d with SMTP id c89-20020a17090a496200b0029de2dcbf5dmr18134638pjh.16.1711977854907; Mon, 01 Apr 2024 06:24:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711977854; cv=pass; d=google.com; s=arc-20160816; b=BQ2uApadA4ayX9v3LyVMT6KYDc+QoL5Pstk/DH8YT/p9K48A+mouWofOk+PhTmgEKo 7dPsYsjbZCvsnHvYcjRgjXK+WB3byU0/g+1hVleub2DlViA0BFUjp4FCi/XpkXccOWBf S6wmRDBaNlxZUTjtri6h+Xd/j0d2J8pSXRC2YgB10APDf9fJKQYMO8WKsBoon+Srj+aU jnLqDag72UkqvIq0lFbaDspApLwUQe4RzXCYUMJW2ArqvCbqr1SmUdObGv92SCpLBX5g CxzQo9XsldyJjqLXm0SMJX8W1pJ0FkgIgWY9V6T0xZXbUX1aS7FNscIDPKry3waZzR8G FHKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:subject :dkim-signature; bh=/q5RUYrVO7lETbxfGo97Atx61q36lvWj5/xhBcLh7fk=; fh=YkW7el/lxGmSbcFhbXHZN4YMWGpnZwkNQ7WhD3g4ZIs=; b=z3eY4PgMo/OiKVXcJt1tCnUf9ksFY5wrca/8niwabFmfPtaoWXwaYePIXvzDpiV7pW G0VIluvWb4TRB3IwaNi8e2qXs3iRyBUev98/TQ3hgHNuBiKi7jh2/4Ve9M50ZueSTzXs ndi4RJYn64BL64mDdz2pdP3s2f0fHiIfgkIse8wUjOzBhdACzTwAcgAnClELHESqBVci tijmaJDiFHXoy9TBDlahnLry4niPAOLdJiDSLR7/obICd9gxXQL4JH6dn3SJLD242C9K 9uYOl3Paujt2yIlNI+rkkYqNWqMuORe93xX3piZJWgUM9MxlL85pQ/5puKhFOvFBLRy2 5A2A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=aOo7XpIN; arc=pass (i=1 spf=pass spfdomain=amazon.com dkim=pass dkdomain=amazon.com dmarc=pass fromdomain=amazon.com); spf=pass (google.com: domain of linux-kernel+bounces-126681-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126681-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id f8-20020a17090ac28800b0029bb3b8942esi9451714pjt.109.2024.04.01.06.24.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 06:24:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-126681-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=aOo7XpIN; arc=pass (i=1 spf=pass spfdomain=amazon.com dkim=pass dkdomain=amazon.com dmarc=pass fromdomain=amazon.com); spf=pass (google.com: domain of linux-kernel+bounces-126681-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126681-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 95328281EC0 for ; Mon, 1 Apr 2024 13:24:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 88D113F9C8; Mon, 1 Apr 2024 13:24:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="aOo7XpIN" Received: from smtp-fw-9105.amazon.com (smtp-fw-9105.amazon.com [207.171.188.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AAE821A0A; Mon, 1 Apr 2024 13:24:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=207.171.188.204 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711977847; cv=none; b=HSkr4aoYswWDSuEaDE3ElmT1VraUo2hNVC4Ycx2AanVg1NgE2zO4eP3UvovPV1hc5ysWlfE+kRMuwh54jNujx1LuwdNlx3NIWX7YtYVpWPnZP0dz/AELUSX4iSidbyyCZmncWHw6ItPClkeui2CmwcKhfYmV5HatP/nelJWP3uc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711977847; c=relaxed/simple; bh=9EaMVV3elotIvVru5tyAQ4Ib+d3jzMQzcTbDbh/1SCs=; h=Subject:Message-ID:Date:MIME-Version:To:CC:References:From: In-Reply-To:Content-Type; b=d0Ui9QVanPToQkBVK829snNq10aOixUPRBe+O6N+7Y9o6YjuwXWrO1P7CwabW/qPqBYoI+sHuEBD51Q/OF3A0f813jdRKy7QNsmQ5haLcpPpol4kpeg89QppSkTOyHfiZSp/AqMDhkSfTuwu+dnu+cg9OZp4rtavMOXrNjhOgDE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.com; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b=aOo7XpIN; arc=none smtp.client-ip=207.171.188.204 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1711977846; x=1743513846; h=message-id:date:mime-version:to:cc:references:from: in-reply-to:content-transfer-encoding:subject; bh=/q5RUYrVO7lETbxfGo97Atx61q36lvWj5/xhBcLh7fk=; b=aOo7XpINo08y4LChadQE9loNUa2Uc9kozy6hJfW74p8UvQ3xxNzJDESz UJDa6cwQqUFm5Uo/tvD1pex+aGYAlkcp/5w9q79IB/lRbMQS+yH32tbhU FscZSF6JKDvWVVuv690zzY9R4R2u5NBtu6CpGePMgv3SAdIyMyhgSNoBC Y=; X-IronPort-AV: E=Sophos;i="6.07,172,1708387200"; d="scan'208";a="715783487" Subject: Re: Implementing .shutdown method for efa module Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO smtpout.prod.us-east-1.prod.farcaster.email.amazon.dev) ([10.25.36.210]) by smtp-border-fw-9105.sea19.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2024 13:23:44 +0000 Received: from EX19MTAEUB002.ant.amazon.com [10.0.17.79:63400] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.31.112:2525] with esmtp (Farcaster) id de5bc671-77f5-45f8-a682-175bf7ec8cfe; Mon, 1 Apr 2024 13:23:43 +0000 (UTC) X-Farcaster-Flow-ID: de5bc671-77f5-45f8-a682-175bf7ec8cfe Received: from EX19D031EUB003.ant.amazon.com (10.252.61.88) by EX19MTAEUB002.ant.amazon.com (10.252.51.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Mon, 1 Apr 2024 13:23:41 +0000 Received: from [192.168.82.210] (10.85.143.172) by EX19D031EUB003.ant.amazon.com (10.252.61.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Mon, 1 Apr 2024 13:23:37 +0000 Message-ID: <0e7dddff-d7f3-4617-83e6-f255449a282b@amazon.com> Date: Mon, 1 Apr 2024 16:23:32 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Jason Gunthorpe CC: Tao Liu , Gal Pressman , , , , , References: <5d81d6d0-5afc-4d0e-8d2b-445d48921511@linux.dev> <20240326153223.GF8419@ziepe.ca> From: "Margolin, Michael" In-Reply-To: <20240326153223.GF8419@ziepe.ca> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: EX19D043UWA002.ant.amazon.com (10.13.139.53) To EX19D031EUB003.ant.amazon.com (10.252.61.88) Jason Thanks for your response, efa_remove() is performing reset to the device which should stop all DMA from the device. Except skipping cleanups that are unnecessary for shutdown flow are there any other reasons to prefer a separate function for shutdown? Michael On 3/26/2024 5:32 PM, Jason Gunthorpe wrote: > CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. > > > > On Tue, Mar 26, 2024 at 02:34:45PM +0200, Margolin, Michael wrote: >> Hi Tao, >> >> Thanks for bringing this up. >> >> I've unsuccessfully tried to reproduce this kernel panic using production >> Red Hat 9.3 AMI (5.14.0-362.18.1.el9_3.aarch64). >> >> Are there any related changes in the kernel you are testing? >> >> Anyways we do need to handle shutdown properly, please let know if calling >> to efa_remove solves your issue. > efa_remove should not be used for shutdown.. > > If you have an iommu in your system (smmuv3 for this ARM64 case) then > drivers must implement a shutdown handler or you will risk data > corruption on ARM64 sytems during crash. > > The shutdown handler must stop all DMA from the device. > > If you don't have an iommu then the shutdown handler shouldn't be > critical. > > Jason