From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 77453393DD9 for ; Wed, 14 Jan 2026 11:24:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768389887; cv=none; b=GyGDQLJkwAQwi2Py2yKBVyks4xgwIHRVWgx0nl2ydl2neGyOY/Jiv29EklSIxWzwYlCsTwY1vKsfDC3pfiKNdvIQqyycP61qMIUsP1yvLYeXDWJu6fkcVcz/fXs7+4qUl9WPj8ZHIeab6m9ErloqjhUC9VCBiRO2bfYXCMjvw5A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768389887; c=relaxed/simple; bh=Qw/l6DoSfr6g1XpZeKH0CmTm71RBdyYXHfwltv+aSAw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pcLIMTfv13Bd7IRW++bTlj1zrGczzfegHHpSSuR8Kz6iHObTZIidqE81N3x0OHW5PffS18DDQDq2B6+wlG0i/6PmuEBdMgdi4Ty96rholB4e5fgANGrGFCIt8hQuXvp47EtxDj0Pb2Xiit9NNwkzLGucB66tjUeF/qyRbY+6uP4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YKnNBQKp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YKnNBQKp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AB59C4CEF7; Wed, 14 Jan 2026 11:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768389887; bh=Qw/l6DoSfr6g1XpZeKH0CmTm71RBdyYXHfwltv+aSAw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YKnNBQKpGUBwD+H9V2RKTb3lSIFhuRStueYKF3rizzrrQzC3rypLHvzCNoRzsxDQf w9BFN8NYlbgget9mNjxayS8nzHrpiG5b1FmKGxzkRntnezrevs7hJQ4Z6QhwMBhbIN /Vq4iWlTyhYgdxzTcxmf0b9qALdF7LRF0JJrU4tQ= Date: Wed, 14 Jan 2026 12:24:43 +0100 From: Greg KH To: Mike Looijmans Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] uio: Provide UIO_MEM_PHYS_WC for write-combine mappings Message-ID: <2026011415-portal-balsamic-a748@gregkh> References: <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.65d15247-f1fa-4fe2-a8f9-10b1259d8649@emailsignatures365.codetwo.com> <20260114105149.1725098-1-mike.looijmans@topic.nl> 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: <20260114105149.1725098-1-mike.looijmans@topic.nl> On Wed, Jan 14, 2026 at 11:51:49AM +0100, Mike Looijmans wrote: > Introduce UIO_MEM_PHYS_WC which is identical to UIO_MEM_PHYS except > that the mapping will enable write-combining. This allows the system to > coalesce writes and greatly improves performance if the underlying > hardware allows that. Typically used for video buffers, but also very > well suited for filling FPGA (block)RAMs with reference data. > > Signed-off-by: Mike Looijmans > > --- > > drivers/uio/uio.c | 3 +++ > include/linux/uio_driver.h | 1 + > 2 files changed, 4 insertions(+) > > diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c > index fa0d4e6aee16..c33db04d2004 100644 > --- a/drivers/uio/uio.c > +++ b/drivers/uio/uio.c > @@ -757,6 +757,8 @@ static int uio_mmap_physical(struct vm_area_struct *vma) > vma->vm_ops = &uio_physical_vm_ops; > if (idev->info->mem[mi].memtype == UIO_MEM_PHYS) > vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); > + else if (idev->info->mem[mi].memtype == UIO_MEM_PHYS_WC) > + vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); > > /* > * We cannot use the vm_iomap_memory() helper here, > @@ -858,6 +860,7 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma) > switch (idev->info->mem[mi].memtype) { > case UIO_MEM_IOVA: > case UIO_MEM_PHYS: > + case UIO_MEM_PHYS_WC: > ret = uio_mmap_physical(vma); > break; > case UIO_MEM_LOGICAL: > diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h > index 334641e20fb1..b925b8c17214 100644 > --- a/include/linux/uio_driver.h > +++ b/include/linux/uio_driver.h > @@ -171,6 +171,7 @@ extern int __must_check > * Do not use in new drivers. > */ > #define UIO_MEM_DMA_COHERENT 5 > +#define UIO_MEM_PHYS_WC 6 > > /* defines for uio_port->porttype */ > #define UIO_PORT_NONE 0 But you have no in-kernel user for this, so why add it? We really can't take this unless there is such a user, sorry. thanks, greg k-h