From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.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 8007F44E047 for ; Fri, 15 May 2026 13:54:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778853271; cv=none; b=DcU3tpoWIhAhhXvxRVPzT/hOxUuNzMSFgTHdiJb6TJNzSDwhI4gNqKXQbM9moogI7GcMcdKEpQRpBtOKKAbLMBPQlPPBFHwh5eW7c3aOyL8TC4f/CjytG54HUKkGMcapT4M/+GxcHnP8Lff1bk2QLcWKcBtpLK8URb1TK6C0TqQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778853271; c=relaxed/simple; bh=ogaB8c9WpDZ0HQVoAmC1+/X0xgwqdjj3S/BcAjNZTxs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WfoZcAvkRMo2CDhNxIn9gcCKZ0t8AUFH4FifhLQ1tU6r9EjfdN0V/hngr2AUweqlUA9wwSsSSE4QZjl/BZrvHQF85pKCZnfV57Cezc6bNAbEPbJ8oH4EFYsLP+N36DgfSIHj+2CgyYgEynMF1+cXnHoo7FKlkEDJFATF3srqTk8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=GMEr0cas; arc=none smtp.client-ip=209.85.222.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="GMEr0cas" Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-911449d9d03so186072485a.1 for ; Fri, 15 May 2026 06:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1778853269; x=1779458069; 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=d7sJIQD9tWQIe4BdjnAe96u8pxDyEGA325KU5uwZDdI=; b=GMEr0casu3uEqpWkEhneRd0UpJTPG6oXmVObzW0s81XFeOTqBrwqZLmihUDyfhS/iv JcQRMgg4jPiG6BXkWXCUY9pfK9g+SGRATsTnds9fcEMCKogSY5af4PalY60/Vxi0hTuM RNFneahgRSzEKBxF5UW4yjpaFnZyIMTScTmvSnyWdHqldwP9uG8UVjHyBl3xJGoUXicE qqL4MfC/bGkYSvidu7auaiKm5N03js/fXSlIyZQqxIsOvVwPiC/PxQacBvcOwmRxeXGw ejlL+LGKWiDgLrNbCi6oyifW1bGbpiaX9kVs9C1mys+/8p+4K22OcHZMYKEif8K4uyxj WSBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778853269; x=1779458069; 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=d7sJIQD9tWQIe4BdjnAe96u8pxDyEGA325KU5uwZDdI=; b=SpGAKhds6ruhJYVEwtynxPHjJ9wlhMz8B3vUeb/Qat+STSCUFPQRsB5qVATmRhQEjy SOLDkdnHNYur3/pdJ9//Mn5kM+TxeXNy/N0L6cVs+4jag+HpgGwc69ZMdfXbwshNLdD8 2bUBU1tTaV3/IU7YCpVyxPQeVV30J1M/fEO2AWi6q26zD9D9o311GkPsc0dv+b0Tchw+ 7Wx3XQniRvfdoKKiKjS3nXfGkEWzGVw52FABUw6LuI212n2uVP2Gb6GzhNvyPBU2voUf XC2nhvQe4MmSIXyZ566t+eKT3K3bUSFpc7vn4jIb3qCHnp6jfbcYcZwFdaV/7NejVQsL fyaw== X-Forwarded-Encrypted: i=1; AFNElJ9Tfee/1kRqXO9zs35q4OGMGu78jJS9DA9YjJD05iNCO6Dosja5lXqjZF9OJXcB7SdaX0IrsrsKr4Yv3S0=@vger.kernel.org X-Gm-Message-State: AOJu0YyLsfKxJuhNKDrI6xtmKd/Y2z83pzKACuDEYmetMpyCsteGzGYN pqFTuqZBGZwvkIk/yCXKCAYmwkwbmfJ33TBsNuGJjemNI9p/pQlE0YdLvTQ+L8qKaOE= X-Gm-Gg: Acq92OHivWaNLjNgRr/i885qQswghd9ybcC4wGYbA/hGPRfQ9rhMp+5AOvmgwUx/wbj XBWDauj3hn0wO11E4UC7abGcSw5QFftYjKspXo3jc7AtIkJHKox95VDeLvZCjTV7s5ZIFzLFYMZ dtt3XDCxwYm1fIMlFuliG55Grz84AmEhHjLwsGL3TFQ9epjuJrP7Nxgei4SPdr+7ngekY+YBnQm rDWBcS8OG4E5LfDjoc3W/EHUsI4e0BeyX95EhjH/2yG6096IWqfZ/XApUaX4ozM/L7zA8+5urpv lzeYMZZeJX/qFjXVZ7c4qJ8CWHWAOUH1H1XyA75mbw5eky7eQGKHc53A+FcV9viHJ9/w36YF4iO FGLOxNz3ywIvKjJHD/iebpAZaj0wePWjHbtmiPxDjMMwAZ1QPj3vVetl2vs8hJXUeFtJUMKg0BI SPYLhjF0AX1KDuuPjik+R14wZP5tG2oEEKsmXrmibX/HunlQFZY5MFvFd5GKp6pI3XdM5mo3GdQ rhBB/WhdOwF3KIgmqCh2kYWhhQ= X-Received: by 2002:a05:620a:7116:b0:8db:7315:706c with SMTP id af79cd13be357-911d0f4a568mr660861285a.59.1778853269479; Fri, 15 May 2026 06:54:29 -0700 (PDT) Received: from ziepe.ca (crbknf0213w-47-54-130-67.pppoe-dynamic.high-speed.nl.bellaliant.net. [47.54.130.67]) by smtp.gmail.com with ESMTPSA id af79cd13be357-910bae24879sm589818085a.18.2026.05.15.06.54.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 06:54:28 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wNszk-00000007TGH-1wJJ; Fri, 15 May 2026 10:54:28 -0300 Date: Fri, 15 May 2026 10:54:28 -0300 From: Jason Gunthorpe To: Mostafa Saleh Cc: iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, robin.murphy@arm.com, will@kernel.org, joro@8bytes.org Subject: Re: [PATCH 2/3] iommu/io-pgtable-arm: Rework to use the iommu-pages API Message-ID: <20260515135428.GG7702@ziepe.ca> References: <20260513215203.3852661-1-smostafa@google.com> <20260513215203.3852661-3-smostafa@google.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 Content-Disposition: inline In-Reply-To: <20260513215203.3852661-3-smostafa@google.com> On Wed, May 13, 2026 at 09:52:02PM +0000, Mostafa Saleh wrote: > Update the io-pgtable-arm allocator to use the iommu-pages API. > > Replace the DMA API usage from __arm_lpae_alloc_pages() with > iommu_pages_start_incoherent() and from __arm_lpae_free_pages() with > iommu_pages_free_incoherent(). > > Since the iommu-pages API relies on metadata stored in the struct page > during iommu_alloc_pages_node_sz(), it cannot be used safely with memory > allocated via the custom cfg->alloc (which may not be backed by pages). > So, isolate that logic and keep it as it. > > Suggested-by: Jason Gunthorpe > Signed-off-by: Mostafa Saleh > --- > drivers/iommu/io-pgtable-arm.c | 79 ++++++++++++++++++++++++---------- > 1 file changed, 56 insertions(+), 23 deletions(-) Reviewed-by: Jason Gunthorpe I feel the setup for incoherent walk for panthor is kind of sketchy, if you select incoherent walk and pass in a random GPU driver struct device there are alot of assumptions suddenly to know the dma API is doing the right thing.. Jason