Skip to contentSkip to conversation

uio-module-drv: Build fix for linux kernel 5.10

PATCH In review praneeth 2 participants 2 messages Apr 22, 2021

lore
Share & tools
lore

praneeth

author
#0 lore raw

PATCH v2 1/1 uio-module-drv: Build fix for linux kernel 5.10

From: Praneeth Bajjuri <[email protected]>

This update contains build fix for linux kernel 5.10
* uio-module-drv: Replace ioremap_nocache with ioremap

---
 ...Replace-ioremap_nocache-with-ioremap.patch | 35 +++++++++++++++++++
 .../uio-module-drv/uio-module-drv_git.bb      |  4 +++
 2 files changed, 39 insertions(+)
 create mode 100644 recipes-bsp/uio-module-drv/uio-module-drv/0001-uio-module-drv-Replace-ioremap_nocache-with-ioremap.patch
recipes-bsp/uio-module-drv/uio-module-drv/0001-uio-module-drv-Replace-ioremap_nocache-with-ioremap.patch new file +35 -0
new file mode 100644
index 00000000..955ef558
@@ -0,0 +1,35 @@
+From b5c4036dac06817bffd0be21c5fa1b7f75f74e4b Mon Sep 17 00:00:00 2001
+From: Suman Anna <[email protected]>
+Date: Mon, 19 Apr 2021 13:15:51 -0500
+Subject: [PATCH] uio-module-drv: Replace ioremap_nocache with ioremap
+
+The ioremap_nocache is the same as the regular ioremap and its
+definition has been dropped from the Linux kernel v5.6 onwards in
+commit 4bdc0d676a64 ("remove ioremap_nocache and devm_ioremap_nocache")
+[1]. The uio-module-drv module fails to build against these newer
+kernels, so fix it by simply replacing ioremap_nocache with ioremap.
+
+[1]
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4bdc0d676a643140bdf17dbf7eafedee3d496a3c
+
+Signed-off-by: Suman Anna <[email protected]>
+---
+ uio_module_drv.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/uio_module_drv.c b/uio_module_drv.c
+index 5a67dd199e21..7cc6005d1f05 100644
+--- a/uio_module_drv.c
++++ b/uio_module_drv.c
+@@ -240,7 +240,7 @@ static ssize_t  uio_module_drv_transfer(struct file *file, char __user *buf,
+ 		return -EINVAL;
+ 	}
+ 
+-	virt_addr_p = ioremap_nocache(phys_addr, count);
++	virt_addr_p = ioremap(phys_addr, count);
+ 	if (!virt_addr_p) {
+ 		dev_err(uio_module_drv->dev, "Mapping of virtual memory failed\n");
+ 		return(-ENOMEM);
+-- 
+2.30.1
+
recipes-bsp/uio-module-drv/uio-module-drv_git.bb +4 -0
index 6ac91875..cb61305f 100644
@@ -2,6 +2,10 @@ DESCRIPTION = "User space IO (UIO) driver for on-chip modules"
 
 include uio-module-drv.inc
 
+FILESEXTRAPATHS_prepend:= "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-uio-module-drv-Replace-ioremap_nocache-with-ioremap.patch"
+
 # This package builds a kernel module, use kernel PR as base and append a local
 MACHINE_KERNEL_PR_append = "d"
 PR = "${MACHINE_KERNEL_PR}"
Signature · 1 line
2.17.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 13 lines

-----Original Message-----
From: Bajjuri, Praneeth
Sent: Thursday, April 22, 2021 1:37 AM
To: Bajjuri, Praneeth <[email protected]>
Cc: Denys Dmytriyenko <[email protected]>; Vutla, Lokesh <[email protected]>; Tammana, Gowtham <[email protected]>; Anna, Suman <s- [email protected]>; Siraswar, Yogesh <[email protected]>; meta- [email protected]
Subject: [dunfell/master PATCH v2] uio-module-drv: Build fix for linux kernel 5.10

Quoted 6 lines

From: Praneeth Bajjuri <[email protected]>

This update contains build fix for linux kernel 5.10
* uio-module-drv: Replace ioremap_nocache with ioremap

Quoted 76 lines

---
...Replace-ioremap_nocache-with-ioremap.patch | 35 +++++++++++++++++++
.../uio-module-drv/uio-module-drv_git.bb | 4 +++

2 files changed, 39 insertions(+)

create mode 100644 recipes-bsp/uio-module-drv/uio-module-drv/0001-uio- module-drv-Replace-ioremap_nocache-with-ioremap.patch

(quoted diff) +0 -0

drv-Replace-ioremap_nocache-with-ioremap.patch b/recipes-bsp/uio-module- drv/uio-module-drv/0001-uio-module-drv-Replace-ioremap_nocache-with- ioremap.patch
new file mode 100644
index 00000000..955ef558

recipes-bsp/uio-module-drv/uio-module-drv/0001-uio-module-drv- new file +0 -0

Replace-ioremap_nocache-with-ioremap.patch

recipes-bsp/uio-module-drv/uio-module-drv/0001-uio-module-drv- new file +13 -0
@@ -0,0 +1,35 @@
+From b5c4036dac06817bffd0be21c5fa1b7f75f74e4b Mon Sep 17 00:00:00 2001
+From: Suman Anna <[email protected]>
+Date: Mon, 19 Apr 2021 13:15:51 -0500
+Subject: [PATCH] uio-module-drv: Replace ioremap_nocache with ioremap
+
+The ioremap_nocache is the same as the regular ioremap and its
+definition has been dropped from the Linux kernel v5.6 onwards in
+commit 4bdc0d676a64 ("remove ioremap_nocache and devm_ioremap_nocache")
+[1]. The uio-module-drv module fails to build against these newer
+kernels, so fix it by simply replacing ioremap_nocache with ioremap.
+
+[1]
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit

/?id=4bdc0d676a643140bdf17dbf7eafedee3d496a3c

recipes-bsp/uio-module-drv/uio-module-drv/0001-uio-module-drv- new file +11 -0
+
+Signed-off-by: Suman Anna <[email protected]>
+---
+ uio_module_drv.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/uio_module_drv.c b/uio_module_drv.c
+index 5a67dd199e21..7cc6005d1f05 100644
+--- a/uio_module_drv.c
++++ b/uio_module_drv.c
+@@ -240,7 +240,7 @@ static ssize_t  uio_module_drv_transfer(struct file

*file, char __user *buf,

recipes-bsp/uio-module-drv/uio-module-drv/0001-uio-module-drv- new file +7 -0
+ 		return -EINVAL;
+ 	}
+
+-	virt_addr_p = ioremap_nocache(phys_addr, count);
++	virt_addr_p = ioremap(phys_addr, count);
+ 	if (!virt_addr_p) {
+ 		dev_err(uio_module_drv->dev, "Mapping of virtual memory

failed\n");

recipes-bsp/uio-module-drv/uio-module-drv/0001-uio-module-drv- new file +4 -0
+ 		return(-ENOMEM);
+--
+2.30.1
+
recipes- renamed from recipes-bsp/uio-module-drv/uio-module-drv_git.bb +0 -0

bsp/uio-module-drv/uio-module-drv_git.bb index 6ac91875..cb61305f 100644

recipes-bsp/uio-module-drv/uio-module-drv_git.bb +0 -0
@@ -2,6 +2,10 @@ DESCRIPTION = "User space IO (UIO) driver for on-chip

modules"

include uio-module-drv.inc

recipes-bsp/uio-module-drv/uio-module-drv_git.bb +3 -0
+FILESEXTRAPATHS_prepend:= "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-uio-module-drv-Replace-ioremap_nocache-with-

ioremap.patch"
+
# This package builds a kernel module, use kernel PR as base and append a local
MACHINE_KERNEL_PR_append = "d"
PR = "${MACHINE_KERNEL_PR}"
--
2.17.1