From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 074D536F41D for ; Fri, 6 Mar 2026 19:35:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772825727; cv=none; b=i98hdxKHgfIof3RuAnt+A6dpw5pv+KhaJT5O+PTprqNqVlkuSHz7cPEx3sn/E4HM8YvKDlFgrCph9oMA+g4/WxAaq0CsWrvrMLcfpyKhi6UTy/KGzvU3AQ4bwFadghzZE/kOZkts7YbEiP4ZbsTlmk5ThZk39xbQ2WW9dUHEIUA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772825727; c=relaxed/simple; bh=Wh5Z913UZEh7i6f061EXZd6SLJhL4kwsCncFeqW4SCA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=F65mIauppZZDGWM0WU43WDknPKWbD8PEeUs27Kdf8Rcxmn3J0ktnR7MhQ6HiIE6AbnGwmXy0/jd29C5Xaq9LQDHrdcgN+Cu6seyKhVKVbCc6NNsYBGIjR8wf/De7Bc/9loz0pBdwYmjZr6eJ8471XO/wg/7/n0IaHoc6Zh5y7Cg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=CFK07eG0; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="CFK07eG0" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2ae4b40999bso9985ad.1 for ; Fri, 06 Mar 2026 11:35:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772825725; x=1773430525; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Wh5Z913UZEh7i6f061EXZd6SLJhL4kwsCncFeqW4SCA=; b=CFK07eG0WF2ukRdWMfJ1bk+tVIMO6aCAGhmXdH2I+69FHElggzTK+pbdoc2ywyYDmO mRxNy8Ys+y38L+hw5MKQvwfISeiXrHj4LThbbkKNvuP7YQcPhA/lqlL7V363JnSTE3yj mgbw0k9HEYC+3wnZ0z71WGNGjp/ic89HWYkqYRStsbIr6g5KrsmWPnhVIVm3uweK/v0H IwbqZ307Fj0qZvF10foTeeMt1xs6dQO6AyYVEtoYiQ1jABSn13edG9auy5wK6lfDRulh lGwAZ5wofgJD/mYjFiK8YkfqbrGj3nh79Jzd5MMuKqRg06mtaKgw8FkHudYVKycpHF5C Ibhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772825725; x=1773430525; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wh5Z913UZEh7i6f061EXZd6SLJhL4kwsCncFeqW4SCA=; b=hqllQnwFMrvVu9CZOjgRsuuh10VfXpotjbzymEQNkU05l7izSErmbCoynSjqIp0zW7 tVrl53itgPAUjrFR+DhkuOakcQc1NSVHZF3RXJwShZABVAOYehxKPiQOoF7a7Gnze4oG 2vlg8DaB+gY2XLX5nj8UKnssnL8z+s6d+oHBtQVMKAYctDNFssQHOtyk2Ibfx3Ee6hXx lfIITdrN9UFNY5AdK+nkvO+HsZNlXpPsBDFFtB2lkjAfkZ4rIk4Z1+M9emRQQICRRmVC A5I0neQ89UH0kc8LLLcYggfrYE6I5RFNcOlrqENTS9WI99v8ntzs2GPBVj4zDMjbiSmX XSmw== X-Forwarded-Encrypted: i=1; AJvYcCUjxuYMC1gVE7VRT2T7fsSBGZ0LzwM1rLzWH3rzEUyramiuVqn4qclyQjoEM7YAHZqt2/B1JtPjjwNfz38=@vger.kernel.org X-Gm-Message-State: AOJu0Yz+R97HwhZx5Dr7EaU4lXayZbGnmPjJdVvwEG8HFovVjXOrpA+H 5vHTZ/sj7yVj6TQlzD0A+mCdorlfybZ4d7SU+/XL0EoWfhDtOWwYh4lp2wY7uSTMbA== X-Gm-Gg: ATEYQzwN3GD6iqUGm2qCjBf1wn6sHzyPqaz8OD1KjaaMm3L3Cy0faQ0AuyKIjefcGcR nT93YYcuUppBmoRSYX+vn1RQtcRtLCRkRHGmragxYj8k+4JutTMyMQ7O23DiSBuycSDz5d3/PHb TFGxu+NklYcJHMZ8cH4jBx1tqx/1qKbdQPChz073TChcSc4Jsy9QHReHExCIHKkSIF2GE8SZWlZ DNlr6PFtU8c1pInCLYfrmiVlhl7zx3k2AOZOAupKfbMAoxSexMWCS9HkI8v4u29l1qeB8X4OxuS AXF4FeOdliaUPb7x6eltSRc28o59JOX6eIuUxfi+fE0Bl13fEZJt8zBuIlcm7Z9Uc0Yz4q5OC4G 1P5UrM9E09pwSIPdo9kok3TWLddBOZujK+zDemjAgypFR/wUp2hcrkPwCMpu+rgsnIgZiL0f+qJ NQNeE5ikf/ea+b45EEZ8b3CpypP3IqboyZvOjfdNTV4RroqOUTBxnHdF8Uj1tCgg== X-Received: by 2002:a17:902:f545:b0:2a7:d266:d84a with SMTP id d9443c01a7336-2ae8ae4e111mr191585ad.17.1772825724928; Fri, 06 Mar 2026 11:35:24 -0800 (PST) Received: from google.com (168.136.83.34.bc.googleusercontent.com. [34.83.136.168]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ae83fb3cc3sm27116245ad.73.2026.03.06.11.35.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2026 11:35:24 -0800 (PST) Date: Fri, 6 Mar 2026 19:35:19 +0000 From: Samiullah Khawaja To: Jason Gunthorpe Cc: Baolu Lu , Nicolin Chen , will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, bhelgaas@google.com, rafael@kernel.org, lenb@kernel.org, praan@google.com, kees@kernel.org, smostafa@google.com, Alexander.Grest@microsoft.com, kevin.tian@intel.com, miko.lenczewski@arm.com, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, vsethi@nvidia.com Subject: Re: [PATCH v1 2/2] iommu/arm-smmu-v3: Recover ATC invalidate timeouts Message-ID: References: <20260305153911.GT972761@nvidia.com> <6416b7fe-0190-4c7b-9a62-5da7d5eea794@linux.intel.com> <20260306130006.GF1651202@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20260306130006.GF1651202@nvidia.com> On Fri, Mar 06, 2026 at 09:00:06AM -0400, Jason Gunthorpe wrote: >On Fri, Mar 06, 2026 at 11:22:52AM +0800, Baolu Lu wrote: >> I believe this issue is not unique to the arm-smmu-v3 driver. Device ATC >> invalidation timeout is a generic challenge across all IOMMU >> architectures that support PCI ATS. Would it be feasible to implement a >> common 'fencing and recovery' mechanism in the IOMMU core so that all >> IOMMU drivers could benefit? > >I think yes, for parts, but the driver itself has to do something deep >inside it's invalidation to allow the flush to complete without >exposing the system to memory corruption - meaning it has to block >translated requests before completing the flush Yes and currently the underlying drivers have software timeouts (AMD=100millisecond, arm-smmu-v3=1second) defined which could timeout before the actual ATC invalidation timeout occurs. Do you think maybe the timeout needs to be propagated to the caller (flush callback) so the memory/IOVA is not allocated to something else? Or blocking translated requests for such devices should be enough? > >I don't see how that can be made too generalized since we are running >this flush stuff in irq and reclaim contexts, it has to be very small >and targtted without memory allocation or sleeping locks. > >Jason >