Skip to contentSkip to conversation

Further changes for 5.15 support

PATCH New Jan Kiszka 1 participant 7 messages Jan 7, 2022

Subsystems (2)
lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

cover Further changes for 5.15 support

This resolves remaining driver-related issues when building against 5.15 and enables this in CI.

NOTE: This only addresses compilation issues. We still have a bug, likely in dovetail, see
https://xenomai.org/pipermail/xenomai/2022-January/047048.html.

Jan

Jan Kiszka (6):
drivers/net: Remove dead smc91111 driver
drivers/net: Account for changes to of_get_mac_address in 5.13 drivers/net: fec: Account for changes of get/set_coalesce ethtool
callbacks in 5.15
drivers/serial: rt_imx_uart: Make it DT-only
ci: Add 5.15 kernel
ci: Drop some I-pipe left-overs

 .gitlab-ci.yml                                |   29 +-
 kernel/drivers/net/drivers/Kconfig            |    5 -
 kernel/drivers/net/drivers/Makefile           |    4 -
 kernel/drivers/net/drivers/at91_ether.c       |    7 +
 .../drivers/net/drivers/freescale/fec_main.c  |   22 +
 kernel/drivers/net/drivers/macb.c             |    7 +
 kernel/drivers/net/drivers/rt_smc91111.h      |  566 ---
 kernel/drivers/net/drivers/smc91111.c         | 3531 -----------------
 kernel/drivers/serial/rt_imx_uart.c           |   32 +-
 9 files changed, 64 insertions(+), 4139 deletions(-)
 delete mode 100644 kernel/drivers/net/drivers/rt_smc91111.h
 delete mode 100644 kernel/drivers/net/drivers/smc91111.c
Signature · 1 line
2.31.1
author
#1 lore raw

PATCH 1/6 drivers/net: Remove dead smc91111 driver

From: Jan Kiszka <[email protected]>

This was once (2004) added to cater a special x86 platform with ISA interface. That one is long dead, and now the driver stops building on 5.15, reminding of its old Frankenstein logic. Time to bury it.

---
 .gitlab-ci.yml                           |    1 -
 kernel/drivers/net/drivers/Kconfig       |    5 -
 kernel/drivers/net/drivers/Makefile      |    4 -
 kernel/drivers/net/drivers/rt_smc91111.h |  566 ----
 kernel/drivers/net/drivers/smc91111.c    | 3531 ----------------------
 5 files changed, 4107 deletions(-)
 delete mode 100644 kernel/drivers/net/drivers/rt_smc91111.h
 delete mode 100644 kernel/drivers/net/drivers/smc91111.c
.gitlab-ci.yml +0 -1
index e4f35f2c45..859a12b89b 100644
@@ -130,7 +130,6 @@ variables:
     - ./scripts/config -m XENO_DRIVERS_NET_DRV_VIA_RHINE
     - ./scripts/config -m XENO_DRIVERS_NET_DRV_IGB
     - ./scripts/config -m XENO_DRIVERS_NET_DRV_R8169
-    - ./scripts/config -m XENO_DRIVERS_NET_DRV_SMC91111
     - ./scripts/config -e XENO_DRIVERS_NET_EXP_DRIVERS
     - ./scripts/config -m XENO_DRIVERS_NET_DRV_3C59X
     - ./scripts/config -m XENO_DRIVERS_NET_DRV_E1000_NEW
kernel/drivers/net/drivers/Kconfig +0 -5
index 7a9d27e386..3a90dd8abe 100644
@@ -84,11 +84,6 @@ config XENO_DRIVERS_NET_DRV_LOOPBACK
     tristate "Loopback"
     default y
 
-
-config XENO_DRIVERS_NET_DRV_SMC91111
-    depends on XENO_DRIVERS_NET
-    tristate "SMSC LAN91C111"
-
 if ARM
 
 config XENO_DRIVERS_NET_DRV_AT91_ETHER
kernel/drivers/net/drivers/Makefile +0 -4
index 6c715abc00..97cf0c3b12 100644
@@ -36,10 +36,6 @@ obj-$(CONFIG_XENO_DRIVERS_NET_DRV_PCNET32) += rt_pcnet32.o
 
 rt_pcnet32-y := pcnet32.o
 
-obj-$(CONFIG_XENO_DRIVERS_NET_DRV_SMC91111) += rt_smc91111.o
-
-rt_smc91111-y := smc91111.o
-
 obj-$(CONFIG_XENO_DRIVERS_NET_DRV_MACB) += rt_macb.o
 
 rt_macb-y := macb.o
kernel/drivers/net/drivers/rt_smc91111.h deleted +0 -566

566 lines not on this page · raw message

kernel/drivers/net/drivers/smc91111.c deleted +0 -3531

2,406 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.31.1

Part of the diff is not shown here. View the raw message.

author
#2 lore raw

PATCH 2/6 drivers/net: Account for changes to of_get_mac_address in 5.13

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

---
 kernel/drivers/net/drivers/at91_ether.c         | 7 +++++++
 kernel/drivers/net/drivers/freescale/fec_main.c | 6 ++++++
 kernel/drivers/net/drivers/macb.c               | 7 +++++++
 3 files changed, 20 insertions(+)
kernel/drivers/net/drivers/at91_ether.c +7 -0
index 7a2436c273..f8223b0bc5 100644
@@ -303,7 +303,9 @@ static int __init at91ether_probe(struct platform_device *pdev)
 	struct macb *lp;
 	int res;
 	u32 reg;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0)
 	const char *mac;
+#endif
 
 	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!regs)
@@ -356,10 +358,15 @@ static int __init at91ether_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, dev);
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0))
+	res = of_get_mac_address(pdev->dev.of_node, lp->dev->dev_addr);
+	if (res)
+#else
 	mac = of_get_mac_address(pdev->dev.of_node);
 	if (mac)
 		memcpy(lp->dev->dev_addr, mac, ETH_ALEN);
 	else
+#endif
 		rtmacb_get_hwaddr(lp);
 
 	res = of_get_phy_mode(pdev->dev.of_node);
kernel/drivers/net/drivers/freescale/fec_main.c +6 -0
index 38396a08e1..0192a09970 100644
@@ -1267,9 +1267,15 @@ static void fec_get_mac(struct net_device *ndev)
 	if (!is_valid_ether_addr(iap)) {
 		struct device_node *np = fep->pdev->dev.of_node;
 		if (np) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0)
+			int err = of_get_mac_address(np, tmpaddr);
+			if (!err)
+				iap = tmpaddr;
+#else
 			const char *mac = of_get_mac_address(np);
 			if (!IS_ERR(mac))
 				iap = (unsigned char *) mac;
+#endif
 		}
 	}
 
kernel/drivers/net/drivers/macb.c +7 -0
index ccda6aecda..77957d9062 100644
@@ -1570,7 +1570,9 @@ static int __init macb_probe(struct platform_device *pdev)
 	u32 config;
 	int err = -ENXIO;
 	struct pinctrl *pinctrl;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0)
 	const char *mac;
+#endif
 
 	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!regs) {
@@ -1688,10 +1690,15 @@ static int __init macb_probe(struct platform_device *pdev)
 	config |= macb_dbw(bp);
 	macb_writel(bp, NCFGR, config);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0)
+	err = of_get_mac_address(pdev->dev.of_node, bp->dev->dev_addr);
+	if (err)
+#else
 	mac = of_get_mac_address(pdev->dev.of_node);
 	if (mac)
 		memcpy(bp->dev->dev_addr, mac, ETH_ALEN);
 	else
+#endif
 		rtmacb_get_hwaddr(bp);
 
 	err = of_get_phy_mode(pdev->dev.of_node);
Signature · 1 line
2.31.1
author
#3 lore raw

PATCH 3/6 drivers/net: fec: Account for changes of get/set_coalesce ethtool callbacks in 5.15

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

---
 kernel/drivers/net/drivers/freescale/fec_main.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
kernel/drivers/net/drivers/freescale/fec_main.c +16 -0
index 0192a09970..be0ed0c51e 100644
@@ -2171,7 +2171,13 @@ static void fec_enet_itr_coal_set(struct net_device *ndev)
 }
 
 static int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
+fec_enet_get_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec,
+		      struct kernel_ethtool_coalesce *kernel_coal,
+		      struct netlink_ext_ack *extack)
+#else
 fec_enet_get_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec)
+#endif
 {
 	struct fec_enet_private *fep = netdev_priv(ndev);
 
@@ -2188,7 +2194,13 @@ fec_enet_get_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec)
 }
 
 static int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
+fec_enet_set_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec,
+		      struct kernel_ethtool_coalesce *kernel_coal,
+		      struct netlink_ext_ack *extack)
+#else
 fec_enet_set_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec)
+#endif
 {
 	struct fec_enet_private *fep = netdev_priv(ndev);
 	struct device *dev = &fep->pdev->dev;
@@ -2240,7 +2252,11 @@ static void fec_enet_itr_coal_init(struct net_device *ndev)
 	ec.tx_coalesce_usecs = FEC_ITR_ICTT_DEFAULT;
 	ec.tx_max_coalesced_frames = FEC_ITR_ICFT_DEFAULT;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
+	fec_enet_set_coalesce(ndev, &ec, NULL, NULL);
+#else
 	fec_enet_set_coalesce(ndev, &ec);
+#endif
 }
 
 static int fec_enet_get_tunable(struct net_device *netdev,
Signature · 1 line
2.31.1
author
#4 lore raw

PATCH 4/6 drivers/serial: rt_imx_uart: Make it DT-only

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

Aligns us with upstream and allows to compile against 5.11+.

---
 kernel/drivers/serial/rt_imx_uart.c | 32 +++--------------------------
 1 file changed, 3 insertions(+), 29 deletions(-)
kernel/drivers/serial/rt_imx_uart.c +3 -29
index 94efe873a6..00fdd5f363 100644
@@ -36,7 +36,6 @@
 #include <asm/irq.h>
 #include <asm/dma.h>
 #include <asm/div64.h>
-#include <linux/platform_data/serial-imx.h>
 #include <linux/slab.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -1497,11 +1496,9 @@ static struct rtdm_driver imx_uart_driver = {
 };
 
 
-#ifdef CONFIG_OF
-
 /*
- * This function returns 1 iff pdev isn't a device instatiated by dt, 0 iff it
- * could successfully get all information from dt or a negative errno.
+ * This function returns 0 iff it could successfully get all information
+ * from dt or a negative errno.
  */
 static int rt_imx_uart_probe_dt(struct rt_imx_uart_port *port,
 				struct platform_device *pdev)
@@ -1536,27 +1533,6 @@ static int rt_imx_uart_probe_dt(struct rt_imx_uart_port *port,
 
 	return 0;
 }
-#else
-static inline int rt_imx_uart_probe_dt(struct rt_imx_uart_port *port,
-				       struct platform_device *pdev)
-{
-	return 1;
-}
-#endif
-
-static void rt_imx_uart_probe_pdata(struct rt_imx_uart_port *port,
-				    struct platform_device *pdev)
-{
-	struct imxuart_platform_data *pdata = dev_get_platdata(&pdev->dev);
-
-	port->devdata = (struct imx_uart_data  *) pdev->id_entry->driver_data;
-
-	if (!pdata)
-		return;
-
-	if (pdata->flags & IMXUART_HAVE_RTSCTS)
-		port->have_rtscts = 1;
-}
 
 static int rt_imx_uart_probe(struct platform_device *pdev)
 {
@@ -1570,9 +1546,7 @@ static int rt_imx_uart_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	ret = rt_imx_uart_probe_dt(port, pdev);
-	if (ret > 0)
-		rt_imx_uart_probe_pdata(port, pdev);
-	else if (ret < 0)
+	if (ret < 0)
 		return ret;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
Signature · 1 line
2.31.1
author
#5 lore raw

PATCH 5/6 ci: Add 5.15 kernel

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

---
 .gitlab-ci.yml | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
.gitlab-ci.yml +24 -0
index 859a12b89b..8a9a631d41 100644
@@ -178,6 +178,14 @@ variables:
     paths:
       - .ccache
 
+arm-5.15-head:
+  extends: .build
+  variables:
+    ARCH: arm
+    PIPELINE_REV: v5.15.y-dovetail-rebase
+    PIPELINE_KERNEL: ${DOVETAIL_URL}
+    KERNEL_DEFCONFIG: multi_v7_defconfig
+
 arm-5.10-head:
   extends: .build
   variables:
@@ -186,6 +194,14 @@ arm-5.10-head:
     PIPELINE_KERNEL: ${DOVETAIL_URL}
     KERNEL_DEFCONFIG: multi_v7_defconfig
 
+arm64-5.15-head:
+  extends: .build
+  variables:
+    ARCH: arm64
+    PIPELINE_REV: v5.15.y-dovetail-rebase
+    PIPELINE_KERNEL: ${DOVETAIL_URL}
+    KERNEL_DEFCONFIG: defconfig
+
 arm64-5.10-head:
   extends: .build
   variables:
@@ -194,6 +210,14 @@ arm64-5.10-head:
     PIPELINE_KERNEL: ${DOVETAIL_URL}
     KERNEL_DEFCONFIG: defconfig
 
+x86-5.15-head:
+  extends: .build
+  variables:
+    ARCH: x86
+    PIPELINE_REV: v5.15.y-dovetail-rebase
+    PIPELINE_KERNEL: ${DOVETAIL_URL}
+    KERNEL_DEFCONFIG: x86_64_defconfig
+
 x86-5.10-head:
   extends: .build
   variables:
Signature · 1 line
2.31.1
author
#6 lore raw

PATCH 6/6 ci: Drop some I-pipe left-overs

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

---
 .gitlab-ci.yml | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
.gitlab-ci.yml +1 -3
index 8a9a631d41..ca3c086200 100644
@@ -1,7 +1,7 @@
 #
 # Xenomai Real-Time System
 #
-# Copyright (c) Siemens AG, 2020-2021
+# Copyright (c) Siemens AG, 2020-2022
 #
 # Authors:
 #  Quirin Gylstorff <[email protected]>
@@ -20,7 +20,6 @@ variables:
   KDIR: "/tmp/kernel"
   USE_CCACHE: "1"
   CCACHE_MAXSIZE: "1G"
-  IPIPE_URL: "https://source.denx.de/Xenomai"
   DOVETAIL_URL: "https://source.denx.de/Xenomai/linux-dovetail.git"
   GCC_VERSION: "10"
   PACKAGES: "u-boot-tools git make bc bison libelf-dev autotools-dev \
@@ -74,7 +73,6 @@ variables:
     # Generic settings
     - ./scripts/config -d DEBUG_INFO
     # I-pipe and Xenomai settings
-    - ./scripts/config -e IPIPE
     - ./scripts/config -e DOVETAIL
     - ./scripts/config -e XENOMAI
     - ./scripts/config -e XENO_OPT_SCHED_CLASSES
Signature · 1 line
2.31.1