From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 3B15B3C5DAF for ; Tue, 10 Mar 2026 20:04:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773173063; cv=none; b=oNkCOdN5Yyum1P2YKcbhFgWrsK00Pt2NP0//HG4lgQrw68LBg+PsUUaSpSey8YxG9qimjVWD52gs2gQHOG7ksiEJbSu4LTF17ZkNpMuyzN02U1ZMxvLfTATLTJNf1qkvxzXQL91INLJSN7/YedSMdm09Uo9NC6DiYsxIeUrn7C4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773173063; c=relaxed/simple; bh=GCUo1Xk02JN/TcsFOEXfGC7rEnRqBWxkbpmyl49gUY0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pXg6lq7L36SMsxYyliFRpimS48TTlWxKJc2/7Mf5NaP7ANV1VVGbeSS6wT8bIg9W4D25ePctekVP5AdEiQw/WyYfckT5iMrBl9w4NHFWWiJ8QI4gP34MWMwDQmGm8xLymxrDeaOaQBZEPusLJcsnvIgQ2bJ6FMW4n/U2X2gbpJk= 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=BgTzP507; arc=none smtp.client-ip=209.85.214.179 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="BgTzP507" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2ae49120e97so24185ad.0 for ; Tue, 10 Mar 2026 13:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1773173062; x=1773777862; darn=lists.linux.dev; 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=pouRMyraIJfJRyRFv87tQoZjJ+P4d5SAB0a9EGBIRqk=; b=BgTzP507UmVW0CQcf0qiLsqKnI0MXsppWd5/Fy4cXEguVzDIDBayTfqcAT0f2u4nEJ q351z0iAZzCTzgTZR1gQJSwzaSwaL6X2G8LIY4u9c3+j05jXz0dKurMzhDVvcCT3xN21 ydiJ6Z9AJ+1Zxus0WoXnYLlpsFDmy5yr2rbQl4KpeoKNLUuKIDJCeTo+NP8JkgLE6wk/ Y3y6WYPCUIpM873linP86WL5YgAg9i+wFlwYE1/nZNyeUCB0NefIRk9q8RDDha0dTizr WYQpQzXpEc9nRFuzoshXA0rcLAAeeVNyN8+9MJvmtEUKa9B0woMIKG5jbGfC9z8p+p/X 5jkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773173062; x=1773777862; 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=pouRMyraIJfJRyRFv87tQoZjJ+P4d5SAB0a9EGBIRqk=; b=nqBEeLeKgThZSQIenx7lVFIn/eN7B22nOMdLamyrYne9EAPKKdj85sR56hWLoTQWs8 Af2rCxu6LsAzrYyWkipfH+hZMHtzrtGo7i1FXDKmh+kgfOlU+tdp1HOFt8EevkTozY/v LydaOOyjBqT7jzqEC7/0mvkDT+nPxGFlbG9joASvTESIhdkyCY9IoRabTeyzN5PqndR+ Wk2wM25AQU4bT6+p1IgMVE9tAXNZ4S0MtzXPIe3/ZYeY3tXHeolQLOMAyu1qMhD3761+ YZrVfWyQDtFl62cMyFLkfeYsbbrkeCmcEgEo14kGDYja6enisHzTCzw0NBUCUnlwnn/B eSOg== X-Forwarded-Encrypted: i=1; AJvYcCWz3rH5uKx495B8gceID0k3wb7XaRMv1PJTthTbCShIqgR7d8DxKoDT9a6dKz5Oqv/KAs+Ndg==@lists.linux.dev X-Gm-Message-State: AOJu0Yyp5hZwQT3omcZgFMNezThnnmtWg34KBiV9DkTuhvOBCKGf3Zwn pvH0lF2b2rn2jTWzRevs6a8HH8NeTHcrrZ1vcAVBFxC+Bc+/x+3lYg1aEOiPnti5Gw== X-Gm-Gg: ATEYQzz2nVnVGBCI8Xky0ovvn5gqjxQU/8RMqyfV/vewB3sS/dWMvPZL80Vy92aMQdU 4Wh9E7zuRaRe2gDuWO4nJJbvyDNE994MsK5I9J3fE2CH2HKE8vJG4P6PsmAs9vC0OpsAd5lG2f4 HPcIJorkFS8oA4ETYKOO192WCimrbl08FUGcJqkjd1/wj0KGatGvDRA/WJCNFFKigi/PaXRzjb2 dBXLwjWW+n9r0oVG7zKEjbl4fSnR0AhG3G2sCDLZXaPTKOp53GFgMevDxcgfkG0c678n8W3RBo+ Iu2QT3IGVC4Jwx37O+YeWhYchuVj5ig8/VKPl7FuxzD9e2VyTrQ1VDbFstTnggU6YEYD3Z8HUE1 /BwLhzSmb6voyIoQTZA4U14ZQKJtY1SFT8W8UKsJ+8vqckJEDLTF9UoegoPYHqMjmC1L0dBf/1Q iANPrBSqcMzsh3btblF6rPHauRQhNtMgEcLGtF0ijOmBa5i31ye5iTvpseuw== X-Received: by 2002:a17:902:cf12:b0:2a7:4151:2c74 with SMTP id d9443c01a7336-2aead3dfdfemr722415ad.16.1773173060930; Tue, 10 Mar 2026 13:04:20 -0700 (PDT) Received: from google.com (10.129.124.34.bc.googleusercontent.com. [34.124.129.10]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-359ffdae223sm100059a91.0.2026.03.10.13.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2026 13:04:19 -0700 (PDT) Date: Tue, 10 Mar 2026 20:04:14 +0000 From: Pranjal Shrivastava To: Nicolin Chen Cc: Jason Gunthorpe , will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, bhelgaas@google.com, rafael@kernel.org, lenb@kernel.org, kees@kernel.org, baolu.lu@linux.intel.com, 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> <20260305234158.GB1651202@nvidia.com> <20260306013347.GD1651202@nvidia.com> <20260306130202.GG1651202@nvidia.com> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Mar 10, 2026 at 12:57:30PM -0700, Nicolin Chen wrote: > On Tue, Mar 10, 2026 at 07:40:56PM +0000, Pranjal Shrivastava wrote: > > On Fri, Mar 06, 2026 at 09:02:02AM -0400, Jason Gunthorpe wrote: > > > On Thu, Mar 05, 2026 at 09:06:17PM -0800, Nicolin Chen wrote: > > > > On Thu, Mar 05, 2026 at 09:33:47PM -0400, Jason Gunthorpe wrote: > > > > > On Thu, Mar 05, 2026 at 05:29:22PM -0800, Nicolin Chen wrote: > > > > > > > > > > > But arm_smmu_cmdq_issue_cmdlist() doesn't know when to push another > > > > > > CMD. In my case where ATC_INV irq occurs, the return value from the > > > > > > arm_smmu_cmdq_poll_until_sync() in the Step 5 is 0, and prods/cons > > > > > > are also matched. Actually, at this point that NOP ISR has already > > > > > > finished. > > > > > > > > > > Yes, you'd need a sneaky way to convay the error from the ISR to the > > > > > cmdlist code that didn't harm performance. Maybe we could come up with > > > > > something, but if it works replacing the NOP with flush sounds fairly > > > > > appealing - though can you do a single WORD edit to the STE that will > > > > > block translated requests? Zero EATS? > > > > > > > > Yea. I can give that a try. > > > > > > This also really needs to go after the invalidation changes because it > > > is feasible to also edit the lockless RCU invalidation list from the > > > ISR and disable the ATC for the failed device too. > > > > > > > > Also, will the SMMU start spamming with blocked translation events or > > > > > something that will need suppression too? > > > > > > > > CD.R=0 can suppress fault records, but we would need to override > > > > that in every CD of the device. > > > > > > That's too much to do from ISR, but maybe we can do it from a WQ.. > > > > > > > (Skimming through these, apologies if I'm losing context), shouldn't we > > do all that (marking it as an inv STE / abort STE, suppressing the > > faults) in the worker instead of trying to reset/recover the device? > > EATS should be unset asap to avoid memory corruption. It's best > to do in the unmap() context where the page isn't reclaimed yet > by the kernel. > Makes sense. > Worker thread will be a bit late, but it is good enough for any > further step. > Ack. Praan