Skip to contentSkip to conversation

uio: allow use on nommu systems

RFC PATCH In review Rich Felker 2 participants 4 messages Jul 15, 2016 Userspace I/O (UIO)

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 uio: allow use on nommu systems

mmap of uio devices does not seem to work without further nommu-specific support, but interrupt handling already works, and userspace drivers for nommu systems can simply use physical mmio addresses from userspace directly anyway without mmap.

---

I don't particularly expect this to be accepted upstream as-is, but since we're actually trying to use the UIO subsystem on nommu (J2), I'd like to start a discussion of what an acceptable patch would entail.

The uio_pdrv_genirq driver was tested on J2 with this patch and interrupt handling works as expected.

 drivers/uio/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/uio/Kconfig +0 -1
index 52c98ce..387b2bb 100644
@@ -1,6 +1,5 @@
 menuconfig UIO
 	tristate "Userspace I/O drivers"
-	depends on MMU
 	help
 	  Enable this to allow the userspace driver core code to be
 	  built.  This code allows userspace programs easy access to
Signature · 1 line
2.8.1
#1 lore raw
Quoted 24 lines · Rich Felker

mmap of uio devices does not seem to work without further nommu-specific support, but interrupt handling already works, and userspace drivers for nommu systems can simply use physical mmio addresses from userspace directly anyway without mmap.

---

I don't particularly expect this to be accepted upstream as-is, but since we're actually trying to use the UIO subsystem on nommu (J2), I'd like to start a discussion of what an acceptable patch would entail.

The uio_pdrv_genirq driver was tested on J2 with this patch and interrupt handling works as expected.

 drivers/uio/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/uio/Kconfig +0 -0
index 52c98ce..387b2bb 100644

drivers/uio/Kconfig line 3

Quoted 3 lines
drivers/uio/Kconfig +0 -1
@@ -1,6 +1,5 @@
 menuconfig UIO
 	tristate "Userspace I/O drivers"
-	depends on MMU

This doesn't seem to do much, don't you need to modify uio-specific drivers? Or given that the core uio code doesn't rely on mmu, is this safe?

thanks,

greg k-h

#2 lore raw
Quoted 20 lines · Greg Kroah-Hartman
Quoted 19 lines · Rich Felker

mmap of uio devices does not seem to work without further nommu-specific support, but interrupt handling already works, and userspace drivers for nommu systems can simply use physical mmio addresses from userspace directly anyway without mmap.

---

I don't particularly expect this to be accepted upstream as-is, but since we're actually trying to use the UIO subsystem on nommu (J2), I'd like to start a discussion of what an acceptable patch would entail.

The uio_pdrv_genirq driver was tested on J2 with this patch and interrupt handling works as expected.

 drivers/uio/Kconfig | 1 -
 1 file changed, 1 deletion(-)
Quoted 12 lines

drivers/uio/Kconfig line 3

Quoted 8 lines
drivers/uio/Kconfig +0 -1
index 52c98ce..387b2bb 100644
@@ -1,6 +1,5 @@
 menuconfig UIO
 	tristate "Userspace I/O drivers"
-	depends on MMU

This doesn't seem to do much, don't you need to modify uio-specific drivers? Or given that the core uio code doesn't rely on mmu, is this safe?

As noted above, mmap of the device does not work (returns error); I don't understand why. But select/read/write for interrupt handling works fine, and the uio system is fully usable if you just do mmio via the raw addresses from userspace (this is nommu after all). I tested it with uio_pdrv_genirq bound to a fake DT node for the J2 IPI interrupt, disabling SMP and generating IPI interrupts manually to check that it worked.

Rich

#3 lore raw
Quoted 34 lines · Rich Felker
Quoted 20 lines · Greg Kroah-Hartman
Quoted 19 lines · Rich Felker

mmap of uio devices does not seem to work without further nommu-specific support, but interrupt handling already works, and userspace drivers for nommu systems can simply use physical mmio addresses from userspace directly anyway without mmap.

---

I don't particularly expect this to be accepted upstream as-is, but since we're actually trying to use the UIO subsystem on nommu (J2), I'd like to start a discussion of what an acceptable patch would entail.

The uio_pdrv_genirq driver was tested on J2 with this patch and interrupt handling works as expected.

 drivers/uio/Kconfig | 1 -
 1 file changed, 1 deletion(-)
Quoted 12 lines

drivers/uio/Kconfig line 3

Quoted 8 lines
drivers/uio/Kconfig +0 -1
index 52c98ce..387b2bb 100644
@@ -1,6 +1,5 @@
 menuconfig UIO
 	tristate "Userspace I/O drivers"
-	depends on MMU

This doesn't seem to do much, don't you need to modify uio-specific drivers? Or given that the core uio code doesn't rely on mmu, is this safe?

Quoted 2 lines

As noted above, mmap of the device does not work (returns error); I don't understand why.

Try working that out and then we can talk :)

thanks,

greg k-h