From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796117559; b=V0fIMUw1r+5KjFq6wX39TOafvnbsRGzJQSQVnYlkdeYksa5I1YXEsiglvPWwwudQ0l8I PI33PaFw29L+egEwOGs+tybper8O24l8pCFmKzGxRfZsk0tGTOJP7nWDMo5IGxTlhTGP2 nlHII5HWCm53+0RDjl6c/aPmPX9T0lu9oNw2Y8o348fUkBNgC44EqklEDY+ZN22033NLo fN+vpkiqqq7dlrM+jU1WTw0tjhOXae/Nyf4kNm1rCdBQciIX/b/tVzvQe2QO479DZlR7D Tohw79NmBgPvrm6n/18siyj9htozjUE14QbM8mDGxibC4t+QkC8JDPizC6QE+P1CrZA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796117559; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=9Yjv5IiPuXu/F2F5p+XpqNRYrFciQxehRnN1h2e742I=; b=oZXlJOukd/bdea1thIqXLrjm4ojzR4XGmJ/BZW9Ca/L+zvdxy4jGWQsrvsynri6dDC/j ivxHeH2clun0uWUIwQePEZhgOFfqvDD+CYA/WiDOw4WdK//ue4CWMn5eelavUqLPPTjGR gxlN5VqP8DpANNal/GRIm/PaZbQrLSwaklH/oii5hY8Z91NWE45ehMtjoVeAk8BbsXA6B Rdf/JF89VyJ/5vjBpYvh2hp7xuasZL17zToQa7AXI9mR9JQUIeIQYpwWE97wvMdWaQ0UG x94Wyh1H52i+Mc3cCPN7ewgR2X2X0MeCQNy8prb+vz28qWLU62DUzLOLQfSfVW8LRng== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oRhioqk2; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECE6E606A327; Tue, 1 Dec 2026 09:32:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oRhioqk2 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 402B91F000C1; Tue, 1 Dec 2026 09:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796117558; bh=9Yjv5IiPuXu/F2F5p+XpqNRYrFciQxehRnN1h2e742I=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=oRhioqk2Gk9fr5ENK1FoCkXSWMHFdp75cZ9anzVngfXXFbnu08td3Tga2rJOnZCjI OUADANSylZebl27ZqHZA19aIJKZ0SAyMNMPas15hkOA+/5MfOinxr437sx0sHzN1Rm W3leFdjNBKlpLuBLt1FzfrdVb/58qGP1Gjg0nN858K0SACNKVbTB0FYcsqXHVXB+lj vBGQcPzt7VYJlmaMgHxPKO5QLfBWe073CGMzsLEQLNZFztudIt8nCo3ZC/5HoHc+YB 5/lSshe/m/XEAUBU65yPNgAW3GE2YHVcUkDkcxQNuIUcEB4v3FeyXyqLPL4jpFSbgk MYPeLko77GDLQ== Date: Tue, 1 Dec 2026 09:32:30 +0000 From: Will Deacon To: Daniel Mentz Cc: Pranjal Shrivastava , iommu@lists.linux.dev, Joerg Roedel , Robin Murphy , Jason Gunthorpe , Mostafa Saleh , Nicolin Chen , Ashish Mhetre , linux-arm-kernel@lists.infradead.org, Thomas Gleixner , Radu Rendec , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , rafael@kernel.org, Danilo Krummrich , driver-core@lists.linux.dev Subject: Re: [PATCH v11 11/16] iommu/arm-smmu-v3: Add CMDQ_PROD_STOP_FLAG to gate CMDQ submissions Message-ID: References: <20260929034510.2023173-1-praan@google.com> <20260929034510.2023173-12-praan@google.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Nov 18, 2026 at 12:27:58PM -0800, Daniel Mentz wrote: > On Mon, Oct 19, 2026 at 1:24 AM Pranjal Shrivastava wrote: > > > > On Wed, Oct 07, 2026 at 03:08:01PM +0100, Will Deacon wrote: > > > On Tue, Sep 29, 2026 at 03:45:05AM +0000, Pranjal Shrivastava wrote: > > > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h > > > > index deefb17e31eb..794b258550dd 100644 > > > > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h > > > > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h > > > > @@ -394,6 +394,11 @@ static inline unsigned int arm_smmu_cdtab_l2_idx(unsigned int ssid) > > > > #define CMDQ_ERR_CERROR_ATC_INV_IDX 3 > > > > > > > > #define CMDQ_PROD_OWNED_FLAG Q_OVERFLOW_FLAG > > > > +#define CMDQ_PROD_STOP_FLAG (1U << 30) > > > > > > I'm unsure about this. Bit 30 of the cmdq prod register is RES0, so it's > > > plausible that the architecture allocates that bit for something in future. > > > For example, if the index field was extended, then I think that would > > > cause problems for the driver. > > Let's cross that bridge when we come to it. I think that for the > driver's internal llq.prod, we can deviate from the layout that the > architecture defines for SMMU_CMDQ_PROD, and as Pranjal pointed out, > we are already doing that. If the architecture eventually consumes the > current RES0 bits, we could save them in a separate variable and only > overlay them when writing to SMMU_CMDQ_PROD. If the index field is > extended, we could artificially limit the index width in this driver > or transition to a 64-bit type for llq.prod. Also, it appears unlikely > for the index field to be extended beyond 24 bits, because > SMMU_CMDQ_CONS allocates bits [30:24] for SMMU_CMDQ_CONS.ERR No, I'm not comfortable deferring this until later and than having to deal with an unholy mess trying to support some new arch feature because suspend is getting in the way. We have time to do it properly now. I think we can probably just generalise the existing OWNED flag so that we go and check some other variable when that is set. Will