From patchwork Thu Jul 11 07:05:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3201 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8C0013F15B for ; Thu, 11 Jul 2024 09:05:35 +0200 (CEST) Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-57d557bfafesf428591a12.0 for ; Thu, 11 Jul 2024 00:05:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720681535; cv=pass; d=google.com; s=arc-20160816; b=xBWM+7HU6Ms2D2MGOqxTaxnkfEb5uQ4v9k5HD14XrNVzihucB+MqGkLxtaQb0w1WLE XAYeNhwuj9Qy1v0AREf8Sin9BeRUQafDfzucrsBfPDhM6Rs4zhCdQ5sdbYqk2B+MPYzQ yS8VWnNXRCabrD/gEVAW1a69Bs7qCC+CbNO6ea0toPMwQUhpqEcRf2H1lrNurL7s6rn6 29c0uZixRJj9Q6RRzwcUjODKBrads56fQnabd0a09kLRIOzKnyR5eIQtjLxsYWVafPch 8gE+s4qtkLvMukay9rc3IonvH1X8PJwibzcPQ8y6igBwaV08zAWq26NExSoM/4+69BMf BTYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=d8M3DIKlw+FAMQR12GsO73tosP8Gjf82AYbVRMIGkRA=; fh=2mCpkxq2LS1766EPaKP9XJ1dTGlHBizcF7VSOyieH0A=; b=TEeJSk+YV3rLNiqeMfvDNmEpaxb9P4y5odTEwJdlj1bDRcoI3okI4b2uTzGT3Ufhcz v6ZUb8d1swFo0CayL91UCqXOvs0FSOJ9HqPweNahco0Id6t2EIKZmGltuYi11YgHMwLZ J3XXe6bv6F0BcptqAlNMv79fwo+QTPZqhPa3GMor9kAsw0ZFnm5+ZGUWkn0Rv3INZVNp TXTLZraDoWTf+AMPVa77lozGN/a31wSorBsLYapmZCn1a8PjB+6MOMhRajg+boMlrW72 DMYqJOa4dPj9y8cHs6MAHOUCoNQMg8XjRDjDjrW0pAEv04Q6qBp9l3KRe6cMv8qpaQ9G xo3g==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=c01HExmk; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1720681535; x=1721286335; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=d8M3DIKlw+FAMQR12GsO73tosP8Gjf82AYbVRMIGkRA=; b=ZTQ1pvZPoiotP8USgruyVO/fuRgiMy6CewmEdEnrLOi4+QLLewOu2z1XfDSTLf2ju7 yv/2/FW0CL9Nv+inTbtPDNvr3E/tkc/PA5H5q+iqreLNYXlS9X1qrTFoFqZsDv6ZRvXB NddpmSj0ef+LIwwxNwo1thlTgdIyXaks8kTaw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720681535; x=1721286335; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=d8M3DIKlw+FAMQR12GsO73tosP8Gjf82AYbVRMIGkRA=; b=LwpJKl0Zd/gjNi55AxkyRF7Siq+AkKwzkXNtvgBx0Z4YIsT+IDqLkJWTc/akAu+K+6 ugjImN6+QeBgT437d4z+g9i5qrMTn7IYiQTsrFGEOFBKHOTwHTCxZ/CmGLmeYjpqtGya qGPVU8vqczkEBI+1zjKLMPH62VXbz++pmJYMgG7sXIFt2QTbROYcmZsDHmdFePQ8CxnY 68vO3UcuzH4k6uU98ZVlG3tWoOnjnkqsnhCWLkntFRIRMqZpLe8pbJr+eV0nq1ueBy8W qmE0GnsZnYS9ehHyYVihJ7gAgfdnk1osDPfDwEYcU4X5DHTcGumw1Y1IZ0QrIF+NQ+tZ A+EA== X-Forwarded-Encrypted: i=2; AJvYcCVxRAO63QpSGb7KH0dW0H3zyfOSpeCE++mxmY9SYxl2q1tQ2lc3Oahpp9DloMG29Mk0r44sNxaj9kbmLGvZkwXCHlcWsjjjwdkvjiZ3UIrm9gqo9aDc9o0oCX5qiA== X-Gm-Message-State: AOJu0YycSEiBu0XJ0UpmWK+mEmyAHbX5Nk0F7RT+mGZ289KXNWTJpEWo Ue4p4AayYQLkv0/B1bt2Ar2bJRdO376XUN8E4eYn/V76YtkzOMU9lXekSP0sbvA1wg== X-Google-Smtp-Source: AGHT+IHQkySk5Vujfan98Xwpqf7EBAnTNN081IFTTRavKHPMADtijiUq4zFfkWa+eFQJijFBPKmKEA== X-Received: by 2002:a05:6402:3188:b0:58b:9363:97e2 with SMTP id 4fb4d7f45d1cf-594bcab134bmr5988398a12.35.1720681535083; Thu, 11 Jul 2024 00:05:35 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:94f:b0:57a:79dd:4491 with SMTP id 4fb4d7f45d1cf-598267132bfls193430a12.2.-pod-prod-08-eu; Thu, 11 Jul 2024 00:05:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWadb+Eku/d8TCWyeaaUTuUvYzUt+I2a2snFMOHmOmwZAz157+K79ZMenUrlLhZrcPdXW4H7GNvR/tBedIKQJgzetpEGe4hj/EjsOrHmf3+PqIJ X-Received: by 2002:a17:906:3793:b0:a72:b34f:e15b with SMTP id a640c23a62f3a-a780b882758mr542246566b.57.1720681533421; Thu, 11 Jul 2024 00:05:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720681533; cv=none; d=google.com; s=arc-20160816; b=qB3LGpTinKGsINOiOnR+qoamgW353ZBf0JS9ige0DhPvpsMNzrA4fxoF/rd7gNmDNi PDhRKNqIvJ7CllydO+VjtuZ2JXNThkoTI76X8llor5gcsiiVpZ9ckn2HoGwfgTQ1IvF5 g65rdJmroF3o+6mwGiYt1FxtnIjYw6OSHH1KmrAmGjGPEb3lfCzg0dDBHsET+V3TWXoO 7rXHATE5QOUHw8Weg7e8o0BJ/NV9CEFpagagpAQyKyumn9UEumidXCKuyiPrYLe71NPX QfyATOrPtWUZCBu/FvAH1fp+979lMfT2//s2dAp98ZiGe2Kuo3Yko0zfIXt/yHAIVdKh tPZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=jjoE62MuSLhozQje7/3W80mmDCsphb4cD/HITdLfMfY=; fh=NHgceenYKQzujCtz2s+cTcPe8l00yDVPUXite8v2oDI=; b=Nn3aEy0/BuHSEDaRpdoX857XWP2p5Olfbz3ivjrF+ZFBHbGie8Gkpy7WeH8ftULWZZ 2ULvxhgggJb4011rWPnbtIq/a7x+qfuWMR0Jm55GSLevpLE77veBj+uvrIq7dyQ1z6JX gq1wMiWs0AvdM2UHDIbOBe9iEo8MR5oEKyJgk458wEhku0MJ6RRpcctOZxZ+wRhnnJYA QwUN7iqML9pm7GOYXauGsRnPSPtkQcAODl8AKxAV2hsV1KZmNpOr0qkQLEQEqeW6ft4Z iVbLOCg8ejH9IfkR/nD6uJVDkwBJA8hWsI9HWw+yXkqseyk9QOU8C97RndqGarJUezR7 6XUA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=c01HExmk; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id a640c23a62f3a-a780a7feaf1sor188844166b.14.2024.07.11.00.05.33 for (Google Transport Security); Thu, 11 Jul 2024 00:05:33 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AJvYcCW4iv1LryWgt+ZrD/a27Zty4sCYb3RybkpE9lXlhdhw6keWzRg/R7Z81qovsV/7Hu9zOaZ/EhfgvODz8Y4oECMDLaH4uaG6K1YUIsMhjaqhavb9 X-Received: by 2002:a17:906:b74a:b0:a72:5715:f7b9 with SMTP id a640c23a62f3a-a780b689247mr517334966b.15.1720681532681; Thu, 11 Jul 2024 00:05:32 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.. ([2.196.40.36]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a780a6bc6cdsm229868166b.23.2024.07.11.00.05.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jul 2024 00:05:32 -0700 (PDT) From: Dario Binacchi To: buildroot@buildroot.org Cc: Giulio Benetti , linux-amarula@amarulasolutions.com, Dario Binacchi Subject: [PATCH 1/1] package/sunxi-mali-utgard-driver: fix patch fuzz Date: Thu, 11 Jul 2024 09:05:25 +0200 Message-ID: <20240711070525.1406612-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=c01HExmk; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Commit 8f88a644ed7d6 ("support/scripts/apply-patches.sh: set the maximum fuzz factor to 0") reduced the fuzz factor. Due to this change, sunxi-mali-utgard-driver fails to build with output: - r6p2: Applying 0018-mali-support-building-against-4.20.patch using series: patching file src/devicedrv/mali/linux/mali_kernel_linux.c Hunk #1 succeeded at 1125 (offset 193 lines). patching file src/devicedrv/mali/linux/mali_kernel_linux.h Hunk #1 FAILED at 16. Hunk #2 succeeded at 33 (offset 5 lines). 1 out of 2 hunks FAILED -- saving rejects to file src/devicedrv/mali/linux/mali_kernel_linux.h.rej -r8p1: Applying r6p2/0013-mali-support-building-against-4.15.patch using series: patching file src/devicedrv/mali/common/mali_control_timer.c patching file src/devicedrv/mali/common/mali_group.c Hunk #2 FAILED at 1768. 1 out of 2 hunks FAILED -- saving rejects to file src/devicedrv/mali/common/mali_group.c.rej patching file src/devicedrv/mali/common/mali_osk_types.h patching file src/devicedrv/mali/linux/mali_memory_os_alloc.c Hunk #1 succeeded at 202 (offset -2 lines). patching file src/devicedrv/mali/linux/mali_osk_timers.c Applying 0020-mali-support-building-against-4.17.patch using series: patching file src/devicedrv/mali/linux/mali_memory.c Hunk #1 FAILED at 57. 1 out of 1 hunk FAILED -- saving rejects to file src/devicedrv/mali/linux/mali_memory.c.rej This commit fixes the driver patches on the current package version. Signed-off-by: Dario Binacchi --- ...he-patches-to-be-applied-with-fuzz-0.patch | 317 ++++++++++++++++++ 1 file changed, 317 insertions(+) create mode 100644 package/sunxi-mali-utgard-driver/0002-Update-the-patches-to-be-applied-with-fuzz-0.patch diff --git a/package/sunxi-mali-utgard-driver/0002-Update-the-patches-to-be-applied-with-fuzz-0.patch b/package/sunxi-mali-utgard-driver/0002-Update-the-patches-to-be-applied-with-fuzz-0.patch new file mode 100644 index 000000000000..00e313a57d9a --- /dev/null +++ b/package/sunxi-mali-utgard-driver/0002-Update-the-patches-to-be-applied-with-fuzz-0.patch @@ -0,0 +1,317 @@ +From 6aed6098e4bdfeef87ae7003bfcff03df7b2e13e Mon Sep 17 00:00:00 2001 +From: Dario Binacchi +Date: Tue, 9 Jul 2024 18:39:08 +0200 +Subject: [PATCH] Update the patches to be applied with fuzz 0 + +This driver, used in Buildroot for versions r6p2 and r8p1, fails to apply +some patches after the commit 8f88a644ed7d6 ("support/scripts/apply-patches.sh: +set the maximum fuzz factor to 0") has been merged. + +This commit fixes those patches so that they can be applied with fuzz +factor 0, without causing regressions for any of the Mali versions, +including those not used in Buildroot. + +Signed-off-by: Dario Binacchi +Upstream: https://github.com/giuliobenetti/sunxi-mali/pull/2 +--- + ...8-mali-support-building-against-4.20.patch | 87 ++++++++++++ + patches/r6p2/series | 2 +- + ...3-mali-support-building-against-4.15.patch | 127 ++++++++++++++++++ + ...0-mali-support-building-against-4.17.patch | 21 +++ + patches/r8p1/series | 6 +- + 5 files changed, 239 insertions(+), 4 deletions(-) + create mode 100644 patches/r6p2/0018-mali-support-building-against-4.20.patch + create mode 100644 patches/r8p1/0013-mali-support-building-against-4.15.patch + create mode 100644 patches/r8p1/0020-mali-support-building-against-4.17.patch + +diff --git a/patches/r6p2/0018-mali-support-building-against-4.20.patch b/patches/r6p2/0018-mali-support-building-against-4.20.patch +new file mode 100644 +index 000000000000..aac891ee1af3 +--- /dev/null ++++ b/patches/r6p2/0018-mali-support-building-against-4.20.patch +@@ -0,0 +1,87 @@ ++From ab90dcd9c5c33d3c26f2553f63dcd1837ce49d79 Mon Sep 17 00:00:00 2001 ++From: Roman Stratiienko ++Date: Wed, 28 Nov 2018 14:23:57 +0200 ++Subject: [PATCH] mali: support building against 4.20 ++ ++From 4.20 kernel vm_insert_pfn was dropped ++This makes wrapper to preserve compatibility ++ ++Also get_monotonic_boottime(...) was removed from 4.20 ++Replace it with ktime_get_boot_ns() ++ ++Signed-off-by: Roman Stratiienko ++--- ++ src/devicedrv/mali/linux/mali_kernel_linux.c | 11 +++++++++++ ++ src/devicedrv/mali/linux/mali_kernel_linux.h | 10 ++++++++++ ++ src/devicedrv/mali/linux/mali_osk_time.c | 4 ++++ ++ 3 files changed, 25 insertions(+) ++ ++diff --git a/src/devicedrv/mali/linux/mali_kernel_linux.c b/src/devicedrv/mali/linux/mali_kernel_linux.c ++index 34cb3d7..6ed89a6 100755 ++--- a/src/devicedrv/mali/linux/mali_kernel_linux.c +++++ b/src/devicedrv/mali/linux/mali_kernel_linux.c ++@@ -1125,6 +1125,17 @@ ++ return err; ++ } ++ +++/* +++ * From 4.20.0 kernel vm_insert_pfn was dropped +++ * Make wrapper to preserve compatibility +++ */ +++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) +++int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, +++ unsigned long pfn) +++{ +++ return vm_fault_to_errno(vmf_insert_pfn(vma, addr, pfn), 0xffff); +++} +++#endif ++ ++ module_init(mali_module_init); ++ module_exit(mali_module_exit); ++diff --git a/src/devicedrv/mali/linux/mali_kernel_linux.h b/src/devicedrv/mali/linux/mali_kernel_linux.h ++index 8548c9f..f858a5c 100755 ++--- a/src/devicedrv/mali/linux/mali_kernel_linux.h +++++ b/src/devicedrv/mali/linux/mali_kernel_linux.h ++@@ -16,6 +16,7 @@ ++ #endif ++ ++ #include /* character device definitions */ +++#include ++ #include ++ #include ++ #include "mali_kernel_license.h" ++@@ -33,6 +34,15 @@ ++ #define __GFP_REPEAT __GFP_RETRY_MAYFAIL ++ #endif ++ +++/* +++ * From 4.20.0 kernel vm_insert_pfn was dropped +++ * Make wrapper to preserve compatibility +++ */ +++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) +++extern int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, +++ unsigned long pfn); +++#endif +++ ++ #ifdef __cplusplus ++ } ++ #endif ++diff --git a/src/devicedrv/mali/linux/mali_osk_time.c b/src/devicedrv/mali/linux/mali_osk_time.c ++index 4deaa10..a14cb7d 100755 ++--- a/src/devicedrv/mali/linux/mali_osk_time.c +++++ b/src/devicedrv/mali/linux/mali_osk_time.c ++@@ -53,7 +53,11 @@ u64 _mali_osk_time_get_ns(void) ++ ++ u64 _mali_osk_boot_time_get_ns(void) ++ { +++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) +++ return ktime_get_boot_ns(); +++#else ++ struct timespec tsval; ++ get_monotonic_boottime(&tsval); ++ return (u64)timespec_to_ns(&tsval); +++#endif ++ } ++-- ++2.17.1 ++ +diff --git a/patches/r6p2/series b/patches/r6p2/series +index 8922fa49e5f6..c1ff18d1b522 100644 +--- a/patches/r6p2/series ++++ b/patches/r6p2/series +@@ -14,7 +14,7 @@ r6p2/0013-mali-support-building-against-4.15.patch + r6p2/0014-mali-Make-devfreq-optional.patch + 0015-Enable-parallel-building-passing-variable-to-Makefile.patch + r6p2/0016-mali-support-building-against-4.16.patch +-0018-mali-support-building-against-4.20.patch ++r6p2/0018-mali-support-building-against-4.20.patch + 0019-mali-support-building-against-5.0.patch + 0020-mali-support-building-against-4.17.patch + 0021-mali-support-building-against-5.3.patch +diff --git a/patches/r8p1/0013-mali-support-building-against-4.15.patch b/patches/r8p1/0013-mali-support-building-against-4.15.patch +new file mode 100644 +index 000000000000..ff6641a74f37 +--- /dev/null ++++ b/patches/r8p1/0013-mali-support-building-against-4.15.patch +@@ -0,0 +1,127 @@ ++From 5bc1f96c6e9b8927e3020fdfe58b2d99fa42bcb3 Mon Sep 17 00:00:00 2001 ++From: John Stultz ++Date: Thu, 16 Nov 2017 13:42:23 -0800 ++Subject: MALI: v4.15-rc build fix ++ ++Signed-off-by: John Stultz ++--- ++ src/devicedrv/mali/common/mali_control_timer.c | 2 +- ++ src/devicedrv/mali/common/mali_group.c | 8 +++++--- ++ src/devicedrv/mali/common/mali_osk_types.h | 8 +++++++- ++ src/devicedrv/mali/linux/mali_memory_os_alloc.c | 2 +- ++ src/devicedrv/mali/linux/mali_osk_timers.c | 16 ++++++++++------ ++ 5 files changed, 24 insertions(+), 12 deletions(-) ++ ++--- a/src/devicedrv/mali/common/mali_control_timer.c +++++ b/src/devicedrv/mali/common/mali_control_timer.c ++@@ -28,7 +28,7 @@ void mali_control_timer_add(u32 timeout) ++ _mali_osk_timer_add(mali_control_timer, _mali_osk_time_mstoticks(timeout)); ++ } ++ ++-static void mali_control_timer_callback(void *arg) +++static void mali_control_timer_callback(struct timer_list *t) ++ { ++ if (mali_utilization_enabled()) { ++ struct mali_gpu_utilization_data *util_data = NULL; ++--- a/src/devicedrv/mali/common/mali_group.c +++++ b/src/devicedrv/mali/common/mali_group.c ++@@ -44,7 +44,7 @@ ++ static void mali_group_bottom_half_mmu(void *data); ++ static void mali_group_bottom_half_gp(void *data); ++ static void mali_group_bottom_half_pp(void *data); ++-static void mali_group_timeout(void *data); +++static void mali_group_timeout(struct timer_list *t); ++ static void mali_group_reset_pp(struct mali_group *group); ++ static void mali_group_reset_mmu(struct mali_group *group); ++ ++@@ -1761,9 +1761,11 @@ ++ 0xFFFFFFFF, 0); ++ } ++ ++-static void mali_group_timeout(void *data) +++static void mali_group_timeout(struct timer_list *t) ++ { ++- struct mali_group *group = (struct mali_group *)data; +++ _mali_osk_timer_t *tim = container_of(t, _mali_osk_timer_t, timer); +++ struct mali_group *group = container_of(&tim, struct mali_group, timeout_timer); +++ ++ MALI_DEBUG_ASSERT_POINTER(group); ++ ++ MALI_DEBUG_PRINT(2, ("Group: timeout handler for %s at %u\n", ++--- a/src/devicedrv/mali/common/mali_osk_types.h +++++ b/src/devicedrv/mali/common/mali_osk_types.h ++@@ -50,6 +50,7 @@ typedef unsigned long long u64; ++ #include ++ #endif ++ +++#include ++ /** @brief Mali Boolean type which uses MALI_TRUE and MALI_FALSE ++ */ ++ typedef unsigned long mali_bool; ++@@ -395,7 +396,12 @@ typedef struct _mali_osk_notification_t_ ++ * by any callers of _mali_osk_timer_del(). Otherwise, a deadlock may occur. ++ * ++ * @param arg Function-specific data */ ++-typedef void (*_mali_osk_timer_callback_t)(void *arg); +++typedef void (*_mali_osk_timer_callback_t)(struct timer_list *t); +++ +++ +++struct _mali_osk_timer_t_struct { +++ struct timer_list timer; +++}; ++ ++ /** @brief Private type for Timer Callback Objects */ ++ typedef struct _mali_osk_timer_t_struct _mali_osk_timer_t; ++--- a/src/devicedrv/mali/linux/mali_memory_os_alloc.c +++++ b/src/devicedrv/mali/linux/mali_memory_os_alloc.c ++@@ -202,7 +202,7 @@ ++ /* Allocate new pages, if needed. */ ++ for (i = 0; i < remaining; i++) { ++ dma_addr_t dma_addr; ++- gfp_t flags = __GFP_ZERO | __GFP_REPEAT | __GFP_NOWARN | __GFP_COLD; +++ gfp_t flags = __GFP_ZERO | __GFP_REPEAT | __GFP_NOWARN; ++ int err; ++ ++ #if defined(CONFIG_ARM) && !defined(CONFIG_ARM_LPAE) ++--- a/src/devicedrv/mali/linux/mali_osk_timers.c +++++ b/src/devicedrv/mali/linux/mali_osk_timers.c ++@@ -18,16 +18,25 @@ ++ #include "mali_osk.h" ++ #include "mali_kernel_common.h" ++ ++-struct _mali_osk_timer_t_struct { ++- struct timer_list timer; ++-}; +++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) +++ +++#define TIMER_DATA_TYPE unsigned long +++#define TIMER_FUNC_TYPE void (*)(TIMER_DATA_TYPE) +++ +++static inline void timer_setup(struct timer_list *timer, +++ void (*callback)(struct timer_list *), +++ unsigned int flags) +++{ +++ __setup_timer(timer, (TIMER_FUNC_TYPE)callback, +++ (TIMER_DATA_TYPE)timer, flags); +++} +++#endif ++ ++ typedef void (*timer_timeout_function_t)(unsigned long); ++ ++ _mali_osk_timer_t *_mali_osk_timer_init(void) ++ { ++ _mali_osk_timer_t *t = (_mali_osk_timer_t *)kmalloc(sizeof(_mali_osk_timer_t), GFP_KERNEL); ++- if (NULL != t) init_timer(&t->timer); ++ return t; ++ } ++ ++@@ -65,8 +74,7 @@ mali_bool _mali_osk_timer_pending(_mali_ ++ void _mali_osk_timer_setcallback(_mali_osk_timer_t *tim, _mali_osk_timer_callback_t callback, void *data) ++ { ++ MALI_DEBUG_ASSERT_POINTER(tim); ++- tim->timer.data = (unsigned long)data; ++- tim->timer.function = (timer_timeout_function_t)callback; +++ timer_setup(&tim->timer, callback, 0); ++ } ++ ++ void _mali_osk_timer_term(_mali_osk_timer_t *tim) +diff --git a/patches/r8p1/0020-mali-support-building-against-4.17.patch b/patches/r8p1/0020-mali-support-building-against-4.17.patch +new file mode 100644 +index 000000000000..3077f080f60d +--- /dev/null ++++ b/patches/r8p1/0020-mali-support-building-against-4.17.patch +@@ -0,0 +1,21 @@ ++mali: support building against 4.17 ++ ++4.17 changed the return code of the fault handler from int to vm_fault_t. ++ ++The return values don't change though, so we only need to update the prototype. ++ ++Signed-off-by: Maxime Ripard ++ ++--- a/src/devicedrv/mali/linux/mali_memory.c +++++ b/src/devicedrv/mali/linux/mali_memory.c ++@@ -70,7 +70,9 @@ ++ } ++ } ++ ++-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) +++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) +++static vm_fault_t mali_mem_vma_fault(struct vm_fault *vmf) +++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++ static int mali_mem_vma_fault(struct vm_fault *vmf) ++ #else ++ static int mali_mem_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf) +diff --git a/patches/r8p1/series b/patches/r8p1/series +index 564bf88a0ba1..15fdd50e7255 100644 +--- a/patches/r8p1/series ++++ b/patches/r8p1/series +@@ -4,14 +4,14 @@ + r6p2/0006-mali-Allow-devfreq-to-run-without-power-models.patch + r8p1/0011-mali-support-building-against-4.13.patch + 0012-mali-support-building-against-4.14.patch +-r6p2/0013-mali-support-building-against-4.15.patch ++r8p1/0013-mali-support-building-against-4.15.patch + r6p2/0014-mali-Make-devfreq-optional.patch + 0015-Enable-parallel-building-passing-variable-to-Makefile.patch + r6p2/0016-mali-support-building-against-4.16.patch + r8p1/0017-mali-support-building-against-4.9-later.patch +-0018-mali-support-building-against-4.20.patch ++r6p2/0018-mali-support-building-against-4.20.patch + 0019-mali-support-building-against-5.0.patch +-0020-mali-support-building-against-4.17.patch ++r8p1/0020-mali-support-building-against-4.17.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 +-- +2.43.0 +