From patchwork Wed Jan 6 21:29:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 1423072 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=benettiengineering.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aruba.it header.i=@aruba.it header.a=rsa-sha256 header.s=a1 header.b=IQMqrG66; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DB2Z75X4gz9sS8 for ; Thu, 7 Jan 2021 08:29:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B932127A60; Wed, 6 Jan 2021 21:29:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0wruUNzRxnVo; Wed, 6 Jan 2021 21:29:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id DBB5E20486; Wed, 6 Jan 2021 21:29:26 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 609FD1BF5A0 for ; Wed, 6 Jan 2021 21:29:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 46330873C3 for ; Wed, 6 Jan 2021 21:29:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OZLUkcfFc0+5 for ; Wed, 6 Jan 2021 21:29:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtpcmd03117.aruba.it (smtpcmd03117.aruba.it [62.149.158.117]) by hemlock.osuosl.org (Postfix) with ESMTP id 633FA873AE for ; Wed, 6 Jan 2021 21:29:22 +0000 (UTC) Received: from ubuntu.localdomain ([146.241.198.163]) by Aruba Outgoing Smtp with ESMTPSA id xGMqkHxHtv20VxGMqk1Pzl; Wed, 06 Jan 2021 22:29:20 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruba.it; s=a1; t=1609968560; bh=nN2VgsWutqdlO8YochOUtWvZZ2qySlpb5Cd15a+JQwA=; h=From:To:Subject:Date:MIME-Version; b=IQMqrG66FC7T8R8P/B8f9seYbXMVFPIlZ9mOPRdFW88Axs+aBajl1MAs0u0ypUnf1 2P+OqTKYuW6s+/cLyxAmXctVhO5PgmxxC+N+AXmywuT7FsRNjhzikMqPjPKuG8ssjn HOMDefMtCytMRwxcIWSv/Rlhpjv8jMmqSPF7BBlKKDc8m6YfEnUSfO1k0CRyp7KD/J Mko9Jb1uCaMimkVatQQCu3HSSqy5uO2NQCx/iLKctdb6ijKiWUYNQKwBPdvi7LrxzQ xExd15D9Nle604bUsRpgZ6hgcuUTnp+fMAyrxBidD/76S72rj8qDDVRwbyxQMwR9dQ vNEFg3W5gCdPQ== From: Giulio Benetti To: buildroot@buildroot.org Date: Wed, 6 Jan 2021 22:29:19 +0100 Message-Id: <20210106212919.540837-1-giulio.benetti@benettiengineering.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CMAE-Envelope: MS4wfGyLOQODnP7wziv/LScwCJ3z5mIJh7fIWIA8ImVq5XudqnfRWcC0QTwYsQWZvX72ETC4OIC2aUHqSUYm9cEto5utsqIq6Ej8ADjyMr8vR/iOLDvAb/ZK 16ytP9XZEpUkkSm2dnm5M8H+XTtXQyxW8vBpkqPUwNIzNYXBJx3A1h4QbXIo6ZGjHiu8iEb0kZfR64bIQKbEdhp2QxhUY2bjyVyj3tdAXPKZN3bPJWD8Qgfa 5yspv8W2XAMxJimKCCw7mLZstIMO2CBNQtQyGkpv8k4= Subject: [Buildroot] [PATCH] package/sunxi-mali-mainline-driver: fix build failure with Linux 5.9 and 5.10 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Giulio Benetti Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add 2 patches pending[1] upstream to fix build failure with both Linux 5.9 and Linux 5.10 due to uaccess.h file moved after version >= 5.9 and and due to moved code from dma-contiguous.h to dma-mapping. [1]: https://github.com/mripard/sunxi-mali/pull/89 Signed-off-by: Giulio Benetti --- ...01-mali-support-building-against-5.9.patch | 269 ++++++++++++++++++ ...2-mali-support-building-against-5.10.patch | 98 +++++++ 2 files changed, 367 insertions(+) create mode 100644 package/sunxi-mali-mainline-driver/0001-mali-support-building-against-5.9.patch create mode 100644 package/sunxi-mali-mainline-driver/0002-mali-support-building-against-5.10.patch diff --git a/package/sunxi-mali-mainline-driver/0001-mali-support-building-against-5.9.patch b/package/sunxi-mali-mainline-driver/0001-mali-support-building-against-5.9.patch new file mode 100644 index 0000000000..e1c5f76572 --- /dev/null +++ b/package/sunxi-mali-mainline-driver/0001-mali-support-building-against-5.9.patch @@ -0,0 +1,269 @@ +From 66731b7ec7d36e86d772aee84a84b648f37dbf5d Mon Sep 17 00:00:00 2001 +From: Giulio Benetti +Date: Thu, 17 Dec 2020 01:32:21 +0100 +Subject: [PATCH 1/2] mali: support building against 5.9 + +Add patches to fix build failure with Linux version 5.9 due to +asm/uaccess.h changes and HAVE_UNLOCKED_IOCTL macro missing in version +r6p0 and r6p2. While for r8p1 and r9p0 patch is the same and is located +in patches/ root and fix HAVE_UNLOCKED_IOCTL issue only. + +Signed-off-by: Giulio Benetti +--- + ...24-mali-support-building-against-5.9.patch | 36 +++++++++ + ...24-mali-support-building-against-5.9.patch | 76 +++++++++++++++++++ + patches/r6p0/series | 1 + + ...24-mali-support-building-against-5.9.patch | 76 +++++++++++++++++++ + patches/r6p2/series | 1 + + patches/r8p1/series | 1 + + patches/r9p0/series | 1 + + 7 files changed, 192 insertions(+) + create mode 100644 patches/0024-mali-support-building-against-5.9.patch + create mode 100644 patches/r6p0/0024-mali-support-building-against-5.9.patch + create mode 100644 patches/r6p2/0024-mali-support-building-against-5.9.patch + +diff --git a/patches/0024-mali-support-building-against-5.9.patch b/patches/0024-mali-support-building-against-5.9.patch +new file mode 100644 +index 0000000..c54dfef +--- /dev/null ++++ b/patches/0024-mali-support-building-against-5.9.patch +@@ -0,0 +1,36 @@ ++From f760b79bc15557a13d9bb68a9a3fb9c8e08dfbae Mon Sep 17 00:00:00 2001 ++From: Giulio Benetti ++Date: Thu, 17 Dec 2020 16:41:49 +0100 ++Subject: [PATCH] mali: support building against 5.9 ++ ++Starting from Linux version 5.9.0 HAVE_UNLOCKED_IOCTL macro has been ++removed making actual code to use .ioctl struct member resulting in a ++build failure, so let's declare locally such macro if Linux ++version >= 5.9.0. ++ ++Signed-off-by: Giulio Benetti ++--- ++ src/devicedrv/mali/linux/mali_kernel_linux.c | 7 +++++++ ++ 1 file changed, 7 insertions(+) ++ ++diff --git a/src/devicedrv/mali/linux/mali_kernel_linux.c b/src/devicedrv/mali/linux/mali_kernel_linux.c ++index d7893a3..9005466 100644 ++--- a/src/devicedrv/mali/linux/mali_kernel_linux.c +++++ b/src/devicedrv/mali/linux/mali_kernel_linux.c ++@@ -65,6 +65,13 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(mali_hw_counter); ++ EXPORT_TRACEPOINT_SYMBOL_GPL(mali_sw_counters); ++ #endif /* CONFIG_TRACEPOINTS */ ++ +++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) +++/* From Linux version 5.9.0 HAVE_UNLOCKED_IOCTL has been removed +++ * so let's reintroduce it here. +++ */ +++#define HAVE_UNLOCKED_IOCTL +++#endif +++ ++ #ifdef CONFIG_MALI_DEVFREQ ++ #include "mali_devfreq.h" ++ #include "mali_osk_mali.h" ++-- ++2.25.1 ++ +diff --git a/patches/r6p0/0024-mali-support-building-against-5.9.patch b/patches/r6p0/0024-mali-support-building-against-5.9.patch +new file mode 100644 +index 0000000..54b773b +--- /dev/null ++++ b/patches/r6p0/0024-mali-support-building-against-5.9.patch +@@ -0,0 +1,76 @@ ++From 44dbb7d2036ba41d5db46fadb86e0461fce0948f Mon Sep 17 00:00:00 2001 ++From: Giulio Benetti ++Date: Thu, 17 Dec 2020 02:26:49 +0100 ++Subject: [PATCH] mali: support building against 5.9 ++ ++Starting from Linux version 5.9.0 HAVE_UNLOCKED_IOCTL macro has been ++removed making actual code to use .ioctl struct member resulting in a ++build failure, so let's declare locally such macro if Linux ++version >= 5.9.0. ++ ++Starting from Linux version 5.9.0 also part of has been ++moved to so let's include if Linux ++version >= 5.9.0. ++ ++Signed-off-by: Giulio Benetti ++--- ++ src/devicedrv/mali/linux/mali_kernel_linux.c | 7 +++++++ ++ src/devicedrv/mali/linux/mali_osk_mali.c | 5 +++++ ++ src/devicedrv/mali/linux/mali_osk_misc.c | 5 +++++ ++ 3 files changed, 17 insertions(+) ++ ++diff --git a/src/devicedrv/mali/linux/mali_kernel_linux.c b/src/devicedrv/mali/linux/mali_kernel_linux.c ++index 34cb3d7..c098c77 100755 ++--- a/src/devicedrv/mali/linux/mali_kernel_linux.c +++++ b/src/devicedrv/mali/linux/mali_kernel_linux.c ++@@ -63,6 +63,13 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(mali_hw_counter); ++ EXPORT_TRACEPOINT_SYMBOL_GPL(mali_sw_counters); ++ #endif /* CONFIG_TRACEPOINTS */ ++ +++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) +++/* From Linux version 5.9.0 HAVE_UNLOCKED_IOCTL has been removed +++ * so let's reintroduce it here. +++ */ +++#define HAVE_UNLOCKED_IOCTL +++#endif +++ ++ /* from the __malidrv_build_info.c file that is generated during build */ ++ extern const char *__malidrv_build_info(void); ++ ++diff --git a/src/devicedrv/mali/linux/mali_osk_mali.c b/src/devicedrv/mali/linux/mali_osk_mali.c ++index ee82b6e..1491d10 100755 ++--- a/src/devicedrv/mali/linux/mali_osk_mali.c +++++ b/src/devicedrv/mali/linux/mali_osk_mali.c ++@@ -13,7 +13,12 @@ ++ * Implementation of the OS abstraction layer which is specific for the Mali kernel device driver ++ */ ++ #include +++#include +++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) +++#include +++#else ++ #include +++#endif ++ #include ++ #include ++ #include ++diff --git a/src/devicedrv/mali/linux/mali_osk_misc.c b/src/devicedrv/mali/linux/mali_osk_misc.c ++index 0a619e3..87ff192 100755 ++--- a/src/devicedrv/mali/linux/mali_osk_misc.c +++++ b/src/devicedrv/mali/linux/mali_osk_misc.c ++@@ -13,7 +13,12 @@ ++ * Implementation of the OS abstraction layer for the kernel device driver ++ */ ++ #include +++#include +++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) +++#include +++#else ++ #include +++#endif ++ #include ++ #include ++ #include ++-- ++2.25.1 ++ +diff --git a/patches/r6p0/series b/patches/r6p0/series +index 50e54d6..4074177 100644 +--- a/patches/r6p0/series ++++ b/patches/r6p0/series +@@ -17,3 +17,4 @@ r6p0/0013-mali-support-building-against-4.15.patch + 0021-mali-support-building-against-5.3.patch + r6p0/0022-mali-support-building-against-5.6.patch + 0023-mali-support-building-against-5.7.patch ++r6p0/0024-mali-support-building-against-5.9.patch +diff --git a/patches/r6p2/0024-mali-support-building-against-5.9.patch b/patches/r6p2/0024-mali-support-building-against-5.9.patch +new file mode 100644 +index 0000000..0f9ca40 +--- /dev/null ++++ b/patches/r6p2/0024-mali-support-building-against-5.9.patch +@@ -0,0 +1,76 @@ ++From ebcecb62301c49e0dd67032e7db14c20be2df48b Mon Sep 17 00:00:00 2001 ++From: Giulio Benetti ++Date: Thu, 17 Dec 2020 00:49:45 +0100 ++Subject: [PATCH] mali: support building against 5.9 ++ ++Starting from Linux version 5.9.0 HAVE_UNLOCKED_IOCTL macro has been ++removed making actual code to use .ioctl struct member resulting in a ++build failure, so let's declare locally such macro if Linux ++version >= 5.9.0. ++ ++Starting from Linux version 5.9.0 also part of has been ++moved to so let's include if Linux ++version >= 5.9.0. ++ ++Signed-off-by: Giulio Benetti ++--- ++ src/devicedrv/mali/linux/mali_kernel_linux.c | 7 +++++++ ++ src/devicedrv/mali/linux/mali_osk_mali.c | 5 +++++ ++ src/devicedrv/mali/linux/mali_osk_misc.c | 5 +++++ ++ 3 files changed, 17 insertions(+) ++ ++diff --git a/src/devicedrv/mali/linux/mali_kernel_linux.c b/src/devicedrv/mali/linux/mali_kernel_linux.c ++index 9bfa2bd..51e5012 100755 ++--- a/src/devicedrv/mali/linux/mali_kernel_linux.c +++++ b/src/devicedrv/mali/linux/mali_kernel_linux.c ++@@ -69,6 +69,13 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(mali_sw_counters); ++ #include "mali_devfreq.h" ++ #include "mali_osk_mali.h" ++ +++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) +++/* From Linux version 5.9.0 HAVE_UNLOCKED_IOCTL has been removed +++ * so let's reintroduce it here. +++ */ +++#define HAVE_UNLOCKED_IOCTL +++#endif +++ ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) ++ #include ++ #else ++diff --git a/src/devicedrv/mali/linux/mali_osk_mali.c b/src/devicedrv/mali/linux/mali_osk_mali.c ++index 272d196..fdb8952 100755 ++--- a/src/devicedrv/mali/linux/mali_osk_mali.c +++++ b/src/devicedrv/mali/linux/mali_osk_mali.c ++@@ -13,7 +13,12 @@ ++ * Implementation of the OS abstraction layer which is specific for the Mali kernel device driver ++ */ ++ #include +++#include +++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) +++#include +++#else ++ #include +++#endif ++ #include ++ #include ++ #include ++diff --git a/src/devicedrv/mali/linux/mali_osk_misc.c b/src/devicedrv/mali/linux/mali_osk_misc.c ++index 7dda283..58c6a4c 100755 ++--- a/src/devicedrv/mali/linux/mali_osk_misc.c +++++ b/src/devicedrv/mali/linux/mali_osk_misc.c ++@@ -13,7 +13,12 @@ ++ * Implementation of the OS abstraction layer for the kernel device driver ++ */ ++ #include +++#include +++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) +++#include +++#else ++ #include +++#endif ++ #include ++ #include ++ #include ++-- ++2.25.1 ++ +diff --git a/patches/r6p2/series b/patches/r6p2/series +index 4c68a77..775bc6f 100644 +--- a/patches/r6p2/series ++++ b/patches/r6p2/series +@@ -20,3 +20,4 @@ r6p2/0016-mali-support-building-against-4.16.patch + 0021-mali-support-building-against-5.3.patch + r6p2/0022-mali-support-building-against-5.6.patch + 0023-mali-support-building-against-5.7.patch ++r6p2/0024-mali-support-building-against-5.9.patch +diff --git a/patches/r8p1/series b/patches/r8p1/series +index a49a59b..0f15e40 100644 +--- a/patches/r8p1/series ++++ b/patches/r8p1/series +@@ -15,3 +15,4 @@ r8p1/0017-mali-support-building-against-4.9-later.patch + 0021-mali-support-building-against-5.3.patch + r6p2/0022-mali-support-building-against-5.6.patch + 0023-mali-support-building-against-5.7.patch ++0024-mali-support-building-against-5.9.patch +diff --git a/patches/r9p0/series b/patches/r9p0/series +index 301177c..866e869 100644 +--- a/patches/r9p0/series ++++ b/patches/r9p0/series +@@ -12,3 +12,4 @@ r6p2/0016-mali-support-building-against-4.16.patch + 0021-mali-support-building-against-5.3.patch + r6p2/0022-mali-support-building-against-5.6.patch + 0023-mali-support-building-against-5.7.patch ++0024-mali-support-building-against-5.9.patch +-- +2.25.1 + diff --git a/package/sunxi-mali-mainline-driver/0002-mali-support-building-against-5.10.patch b/package/sunxi-mali-mainline-driver/0002-mali-support-building-against-5.10.patch new file mode 100644 index 0000000000..2bbd3be574 --- /dev/null +++ b/package/sunxi-mali-mainline-driver/0002-mali-support-building-against-5.10.patch @@ -0,0 +1,98 @@ +From 8ea1fb65dd5db556b386a1ed726f7315d3511c2b Mon Sep 17 00:00:00 2001 +From: Giulio Benetti +Date: Thu, 17 Dec 2020 01:54:52 +0100 +Subject: [PATCH 2/2] mali: support building against 5.10 + +Add patch to fix build failure with Linux version 5.10 due to missing +linux/dma-contiguous.h which content has been moved to +linux/dma-mapping.h + +Signed-off-by: Giulio Benetti +--- + ...5-mali-support-building-against-5.10.patch | 34 +++++++++++++++++++ + patches/r6p0/series | 1 + + patches/r6p2/series | 1 + + patches/r8p1/series | 1 + + patches/r9p0/series | 1 + + 5 files changed, 38 insertions(+) + create mode 100644 patches/0025-mali-support-building-against-5.10.patch + +diff --git a/patches/0025-mali-support-building-against-5.10.patch b/patches/0025-mali-support-building-against-5.10.patch +new file mode 100644 +index 0000000..e9070e7 +--- /dev/null ++++ b/patches/0025-mali-support-building-against-5.10.patch +@@ -0,0 +1,34 @@ ++From 9a6b4558bb7f470152ab00692010f07fd0bfa8f8 Mon Sep 17 00:00:00 2001 ++From: Giulio Benetti ++Date: Thu, 17 Dec 2020 01:19:33 +0100 ++Subject: [PATCH] mali: support building against 5.10 ++ ++Starting from Linux version 5.10.0 has been ++removed and its content moved to and this leads ++to build failure with Linux 5.10. So let's include ++ only if we're building with Linux ++version < 5.10.0. ++ ++Signed-off-by: Giulio Benetti ++--- ++ src/devicedrv/mali/platform/sunxi/sunxi.c | 3 +++ ++ 1 file changed, 3 insertions(+) ++ ++diff --git a/src/devicedrv/mali/platform/sunxi/sunxi.c b/src/devicedrv/mali/platform/sunxi/sunxi.c ++index 74ebe0b..a8df0d9 100644 ++--- a/src/devicedrv/mali/platform/sunxi/sunxi.c +++++ b/src/devicedrv/mali/platform/sunxi/sunxi.c ++@@ -3,7 +3,10 @@ ++ #include ++ #include ++ #include +++#include +++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0) ++ #include +++#endif ++ #include ++ #include ++ #include ++-- ++2.25.1 ++ +diff --git a/patches/r6p0/series b/patches/r6p0/series +index 4074177..5d4883f 100644 +--- a/patches/r6p0/series ++++ b/patches/r6p0/series +@@ -18,3 +18,4 @@ r6p0/0013-mali-support-building-against-4.15.patch + r6p0/0022-mali-support-building-against-5.6.patch + 0023-mali-support-building-against-5.7.patch + r6p0/0024-mali-support-building-against-5.9.patch ++0025-mali-support-building-against-5.10.patch +diff --git a/patches/r6p2/series b/patches/r6p2/series +index 775bc6f..e19cf11 100644 +--- a/patches/r6p2/series ++++ b/patches/r6p2/series +@@ -21,3 +21,4 @@ r6p2/0016-mali-support-building-against-4.16.patch + r6p2/0022-mali-support-building-against-5.6.patch + 0023-mali-support-building-against-5.7.patch + r6p2/0024-mali-support-building-against-5.9.patch ++0025-mali-support-building-against-5.10.patch +diff --git a/patches/r8p1/series b/patches/r8p1/series +index 0f15e40..4ad43c1 100644 +--- a/patches/r8p1/series ++++ b/patches/r8p1/series +@@ -16,3 +16,4 @@ r8p1/0017-mali-support-building-against-4.9-later.patch + r6p2/0022-mali-support-building-against-5.6.patch + 0023-mali-support-building-against-5.7.patch + 0024-mali-support-building-against-5.9.patch ++0025-mali-support-building-against-5.10.patch +diff --git a/patches/r9p0/series b/patches/r9p0/series +index 866e869..dca4e02 100644 +--- a/patches/r9p0/series ++++ b/patches/r9p0/series +@@ -13,3 +13,4 @@ r6p2/0016-mali-support-building-against-4.16.patch + r6p2/0022-mali-support-building-against-5.6.patch + 0023-mali-support-building-against-5.7.patch + 0024-mali-support-building-against-5.9.patch ++0025-mali-support-building-against-5.10.patch +-- +2.25.1 +