Commit graph

1050 commits

Author SHA1 Message Date
Tijl Coosemans
2d97bd0639 linuxkpi: Make arch_io_*_memtype_wc amd64-only
Linux only implements these functions on x86.  They return 0 on other
architectures.  The FreeBSD implementation calls PHYS_TO_DMAP but this
panics on i386 because it does not have a direct map so return 0 on i386
as well for now.  These functions are only used by graphics/drm-*-kmod
to mark the VRAM aperture write-combining but this is also accomplished
by a call to vm_phys_fictitious_reg_range so this change is sufficient
to fix drm-*-kmod on i386 for FreeBSD 14.1.

Reviewed by:	kib
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D45125

(cherry picked from commit 2ae0f5a4d0931067c672be9a791909f0e32d5a0e)
2024-05-11 17:32:51 +02:00
Bjoern A. Zeeb
f4ccd1122a LinuxKPI: utsname.h add missing SPDX-License-Identifier
Reported by:	markj (2023-05-24; sorry took me a while)

(cherry picked from commit 563c72e2137cb8cb9eb0eabf78319e8fe9c8aedd)
2024-04-22 17:00:53 +00:00
Bjoern A. Zeeb
6290fe776c LinuxKPI: add __counted_by() and __nonstring
Add checks for __counted_by(_x) and __nonstring as and depending
on compiler support enable the attribute/feature.

This is needed to make mtk76 and ath1xk drivers compile.

Sposnored by:	The FreeBSD Foundation
Reviewed by:	emaste, dim
Differential Revision: https://reviews.freebsd.org/D44587

(cherry picked from commit 2a8c50592f7fce8bceedf004f674a5a9eae0fd46)
2024-04-22 17:00:48 +00:00
Bjoern A. Zeeb
24293e9f97 LinuxKPI: add devm_kfree()
mt76 calls devm_kfree() directly, so alias it to our
lkpi_devm_kmalloc_release() function.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44589

(cherry picked from commit 170c2e0e2bb1b2d9a7661ba729f8264381c9d9d7)
2024-04-22 17:00:08 +00:00
Bjoern A. Zeeb
25e0847ef7 LinuxKPI: napi_schedule() requires return value, implement napi_is_scheduled()
A newer version of iwlwifi requires a return value from napi_schedule();
unclear if the function always should have been bool. Add the bool to test
based on the napi_schedule_prep() result.

Also add napi_is_scheduled() for rtw89.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	emaste (previous version)
Differential Revision:	https://reviews.freebsd.org/D44591

(cherry picked from commit 21761f2ede4ebad13e78112b9409c1f20f946781)
2024-04-22 17:00:00 +00:00
Bjoern A. Zeeb
6b2686ca9b LinuxKPI: sk_buff: implement skb_queue_splice_tail_init()
Implement skb_queue_splice_tail_init() and SKB_DATA_ALIGN() as
needed by the mt76 wireless driver.

Sponsord by:	The FreeBD Foundation
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D44590

(cherry picked from commit 3d3ec17825a124f0119d76c4d2523d73012fa226)
2024-04-22 16:59:54 +00:00
Bjoern A. Zeeb
8cf307284f LinuxKPI: add dev_alloc_pages()
Add dev_alloc_pages() though it seems a weird KPI, not passing a dev
despite its name.  Used by updated wireless driver.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D44588

(cherry picked from commit 738c02ba24c66391870067602f1c9c030d5c5e5d)
2024-04-22 16:59:45 +00:00
Bjoern A. Zeeb
a939c95440 LinuxKPI: add BITS_TO_BYTES()
Just like BITS_TO_LONG() ... used in rtw89.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D44603

(cherry picked from commit f674f016c03d49e14f1c651ed088a6f2d01a62ee)
2024-04-22 16:59:40 +00:00
Bjoern A. Zeeb
7a52baf280 LinuxKPI: implement memzero_explicit()
Sponsored by:	The FreeBSD Foundation
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D44586

(cherry picked from commit 218b2ccf8cc90698487515c681f3e3453b0dcead)
2024-04-22 16:59:36 +00:00
Bjoern A. Zeeb
0af78fa479 LinuxKPI: add further constants to pci.h
Updated wireless drivers require more knowledge about PCI (BAR) bits.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	jhb
Differential Revision: https://reviews.freebsd.org/D44573

(cherry picked from commit a1cdddcf1596d258ce0b01b156dfd9921bd60e08)
2024-04-22 16:59:30 +00:00
Bjoern A. Zeeb
f44b05ee94 LinuxKPI: add PCI_VENDOR_ID_ITTIM
Add PCI_VENDOR_ID_ITTIM as needed by mt76.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ce707e674f7941c0743e72193c433fcf554a82b5)
2024-04-22 16:59:23 +00:00
Mark Johnston
11f154ca86 linuxkpi: Annotate an unused variable as such
This addresses a -Wunused-but-set-variable warning in the gcc builds.

No functional change intended.

Reported by:	Jenkins

(cherry picked from commit 344a04ad2c5e62b2905bc2f8b6f992ae590403fd)
2024-04-15 11:00:35 -07:00
Zhenlei Huang
d4d5aed66a LinuxKPI: Remove the temporary variable fileid from the macro request_module
The variable fileid stores the result from kern_kldload() but never gets
used. Since the third parameter `*fileid` of kern_kldload() can be NULL,
this unused variable can be safely removed.

No functional change intended.

Reviewed by:	emaste, bz, #linuxkpi
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44583

(cherry picked from commit 317cc829ee227cfdffe7b25125c070112ce0c2f1)
2024-04-12 19:25:17 +08:00
Ed Maste
495bdd698e linuxkpi: remove invalid KASSERT from hash_add_rcu
hash_add_rcu asserted that the node's prev pointer was NULL in an
attempt to detect addition of a node already on a list, but the caller
is not required to provide a zeroed node.

Reported in https://github.com/freebsd/drm-kmod/issues/282

Reviewed by:	bz, manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43645

(cherry picked from commit 7e77089dccd702eb767350a8bd3d20102c4fb591)
2024-03-25 18:31:44 -04:00
Tom Coldrick
95a7c6f18a LinuxKPI: Queue skbuffs at tail in __skb_queue_tail
Correct skb_queue_tail to queue the buffer at the tail of the skbuff.
The skbuff is a circular doubly-linked list, and we call with a pointer
to the head of the list.  Thus queueing before the head gives us a
queueing at the tail.

As a motivating factor, the current behaviour (queueing at the head) was
causing frequent kernel panics from my RTL8822BE wireless card, which
uses the rtw88 driver.  Interrupts can cause buffers to be added to the
rtwdev c2h_queue while the queue is being drained in rtw_c2h_work.
Queueing at the head would leave the nascent entry in the linked list
pointing to the old, now freed, memory for the buffer being processed.
When rtw_c2h_work is next called, we try reading this and so panic.

Reviewed by:	emaste, bz
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D44192

(cherry picked from commit d3befb534b9c8cd80f1b8d75ce6451e3f62b8ba9)
2024-03-22 09:30:33 -04:00
Bjoern A. Zeeb
b70179a932 LinuxKPI: 802.11: correct HT protection fields
It seems during the initial buildup of the file, the defines were
either mixed or not flagged as "FIXME".
Define the values through to the net80211 definitions and also
annotate them by at least some standards reference.

Fixes:		6b4cac814e
Reviewed by:	cc
Differential Revision: https://reviews.freebsd.org/D43658

(cherry picked from commit 53eb2c63c9628f7f19d88d759e1932c10c9f08af)
2024-02-18 18:31:16 +00:00
Bjoern A. Zeeb
3e0a31384c LinuxKPI: 802.11: extend ieee80211_key_seq and WLAN_KEY_LEN_* defines
For iwlwifi(4) d3.c we need another struct in struct ieee80211_key_seq
and related WLAN_KEY_LEN_* defines in.

Reviewed by:	cc, emaste
Differential Revision: https://reviews.freebsd.org/D43646

(cherry picked from commit 2f029bf911e29dc46c32ea142daba4f26a2078f4)
2024-02-18 18:31:15 +00:00
Bjoern A. Zeeb
19a405d238 LinuxKPI: 802.11: bring in some HT code
Fix defines and structures to use proper types.

Bring in basic ni->sta synchronization, some channel width handling,
and overload the net80211 functions so that we can talk to
driver/firmware to setup parameters.  We will likely not need one
or two of those but it is good for tracing currently.

Cover HT and bits of VHT code in LinuxKPI behind apropriate #ifdef
which are currently not enabled (like LKPI_80211_HW_CRYPTO) until
confirmed to work.
Last, IEEE80211_AMPDU_RX_START made some firmware unhappy.

This will allow others to work on it and test as well.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 9fb914634eff85b3b36bcbf39c1faf2967b0aa9e)
2024-02-18 18:31:13 +00:00
Bjoern A. Zeeb
7117d4b22f LinuxKPI: implement memset_after()
memset_after() is needed by iwlwifi d3.c.

Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D43644

(cherry picked from commit 2d9d35837d8ea3ee7d7447d63a8755d45ec2fd96)
2024-02-18 16:41:17 +00:00
Bjoern A. Zeeb
55baa8265a LinuxKPI: sort dev_<loglevel>() functions
Sort the dev_<loglevel> functions by loglevel order, add the dev_alert()
version and an indentation change.

No functional changes.

Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D43719

(cherry picked from commit 70617458676eb0b0076aa19657d21f2a9f3b704a)
2024-02-18 16:41:06 +00:00
Vladimir Kondratyev
6d4b6edcf3 LinuxKPI: Allow kmalloc to be called when FPU protection is enabled
Amdgpu driver does a lot of memory allocations in FPU-protected sections
of code for certain display cores, e.g. for DCN30. This does not work
on FreeBSD as its malloc function can not be run within a critical
section. Check this condition and temporally exit from FPU-protected
context to workaround issue and reduce source code patching.

Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu (previous version)
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42822

(cherry picked from commit c0b8047bdc13040eafb162c4b7b5dba11034ff4b)
2024-02-17 23:58:39 +03:00
Vladimir Kondratyev
1a8c2dc098 LinuxKPI: Constify src parameter of bitmap_copy
in bitmap_from_arr32() to fix build on 32 bit archs.

Sponsored by:	Serenity Cyber Security, LLC
Fixes:	5ae2e6f913fa ("LinuxKPI: Add bitmap_intersects(), bitmap_from_arr32()")
MFC after:	1 week

(cherry picked from commit dbca442414191a43f334435b7910b63cb2777d53)
2024-02-17 23:58:39 +03:00
Vladimir Kondratyev
8aa9315b53 LinuxKPI: Define ioread64() in linux/io.h only on 64 bit archs.
32 bit archs includes nonatomic version from linux/io-64-nonatomic-*.h

Sponsored by:   Serenity Cyber Security, LLC
Fixes:		dcfc983373c3 ("LinuxKPI: Implement ioread64()")
MFC after:      1 week

(cherry picked from commit 73ccd188c43a6cd52a12ac33411896220b2d2e54)
2024-02-17 23:58:39 +03:00
Vladimir Kondratyev
a87884e34e LinuxKPI: Add pcie_capability_clear_and_set_word() function
It does a Read-Modify-Write operation using clear and set bitmasks on
PCI Express Capability Register at pos. As certain PCI Express
Capability Registers are accessed concurrently in RMW fashion, hence
require locking which is handled transparently to the caller.

Sponsored by:	Serenity CyberSecurity, LLC
Reviewed by:	manu, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42821

(cherry picked from commit 808ae4e29b6b9c9acc7eab013c5045370df8182a)
2024-02-17 23:58:39 +03:00
Vladimir Kondratyev
0972bacc7f LinuxKPI: Add linux/apple-gmux.h
Sponsored by:	Serenity Cyber Security, LLC
Obtained from:	OpenBSD
Reviewed by:	manu, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42819

(cherry picked from commit 730387b64e10b617f6f0b6f3a64501dc35dd7861)
2024-02-17 23:58:39 +03:00
Vladimir Kondratyev
a620fdcdb7 LinuxKPI: Rename linux_list_add to __list_add() in linux/list.h
to match Linux

Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42818

(cherry picked from commit c58ddc25462699c0d13bf703adbed661bb102cac)
2024-02-17 23:58:39 +03:00
Vladimir Kondratyev
559999c00b LinuxKPI: Add linux/ioport.h header
Sponsored by:	Serenity Cyber Security, LLC
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42817

(cherry picked from commit 9903d83d67ea5eed7c36fbe8b4afe6c4dd148d0e)
2024-02-17 23:58:38 +03:00
Vladimir Kondratyev
c535e8ae7f LinuxKPI: Add get_random_u64() function
Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42816

(cherry picked from commit 7f88d742e578c4cef4e26ce10b9a936e58237964)
2024-02-17 23:58:38 +03:00
Vladimir Kondratyev
96e464b8d5 LinuxKPI: Add linux/dynamic_debug.h header
Sponsored by:	Serenity Cyber Security, LLC
Obtained from:	OpenBSD
Reviewed by:	manu
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42815

(cherry picked from commit 2b037743a77dcf31095fe1fedd21870b3aa6494b)
2024-02-17 23:58:38 +03:00
Vladimir Kondratyev
edeb8cfad0 LinuxKPI: Add bitmap_intersects(), bitmap_from_arr32()
and bitmap_shift_right() functions to linux/bitmap.h

They perform calculation of two bitmaps intersection,
copying the contents of u32 array of bits to bitmap and
logical right shifting of the bits in a bitmap.

Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42812

(cherry picked from commit 5ae2e6f913fa1df5f3262255558b76af05409a09)
2024-02-17 23:58:38 +03:00
Vladimir Kondratyev
cdceed0413 LinuxKPI: Add cancel_work() function.
Cancel a work not waiting for it to finish.

Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu, kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42811

(cherry picked from commit 1b2f43a7427ebf51561867f6c497833268014512)
2024-02-17 23:58:38 +03:00
Vladimir Kondratyev
ada94bf9e8 LinuxKPI: Add write_seqcount_invalidate() and seqprop_sequence()
functions to linux/seqlock.h

Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42810

(cherry picked from commit 64e30cba3f0432fa684728b67850b6254d3713ea)
2024-02-17 23:58:38 +03:00
Vladimir Kondratyev
4d5091c23c LinuxKPI: Chase for new "name" argument of register_shrinker()
Linux uses it only if SHRINKER_DEBUG config option is enabled. Ignore it.

Sponsored by:	Serenity Cyber Security, LLC
Reviewers:	manu, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42809

(cherry picked from commit a39ed121eab16bd2579422f71df7ef29b55965d1)
2024-02-17 23:58:38 +03:00
Vladimir Kondratyev
fcfc3fe00d LinuxKPI: Add ida_alloc_min()
ida_alloc_min() allocates an unused ID. between min and INT_MAX.

While here allow end parameter of ida_simple_get() be larger than
INT_MAX. Linux caps the value to INT_MAX.

Sponsored by:	Serenity Cyber Security, LLC
Reviewers:	manu, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42806

(cherry picked from commit c7312643b7e5f01adc2a3094c5139f5dcab5f0a4)
2024-02-17 23:58:38 +03:00
Vladimir Kondratyev
67cc189db4 LinuxKPI: Add IOMEM_ERR_PTR() to linux/io.h
The function creates an error pointer.

Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42805

(cherry picked from commit af787b8e8b803dbb2c6bd06629974ba39bd0fb70)
2024-02-17 23:58:37 +03:00
Vladimir Kondratyev
f3ce597171 LinuxKPI: Add ktime_get_raw_fast_ns() to linux/ktime.h
It is implemented like ktime_get_raw_ns() function but uses less
precise getnanouptime() call.

Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42804

(cherry picked from commit e964da141523e1eec2322082936cdb20ba0cf4a7)
2024-02-17 23:58:37 +03:00
Vladimir Kondratyev
06db4f5b62 LinuxKPI: Add xa_(un)lock_irq to linux/xarray.h
On FreeBSD they are equal to non-irq version.

Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42803

(cherry picked from commit 66f9a98335dcc2a3c1eead0d80ccc9fee12bbb31)
2024-02-17 23:58:37 +03:00
Vladimir Kondratyev
460a6c6a9f LinuxKPI: Implement ioread64()
Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42801

(cherry picked from commit dcfc983373c3e3dcd7025e5f65832ab696832261)
2024-02-17 23:58:37 +03:00
Vladimir Kondratyev
11b0824a80 LinuxKPI: Add linux/iosys-map.h header
Sponsored by:	Serenity Cyber Security, LLC
Obtained from:	OpenBSD
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42799

(cherry picked from commit f8ab2f5bae1d4e4e13f95f4738c9bb49fcda6261)
2024-02-17 23:58:37 +03:00
Vladimir Kondratyev
c254bc21dd LinuxKPI: Add some header pollution and dummy headers
required by recent drm-kmod to be succesfully compiled.

Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu, bz
Obtained from:	OpenBSD (partially)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42798

(cherry picked from commit 1bce29bcf121c1e16205fabb100f798d88f757c1)
2024-02-17 23:58:37 +03:00
Vladimir Kondratyev
21d85c41bb LinuxKPI: Split linux/container_of.h off from linux/kernel.h
Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu, bz
MFC after:      1 week
Differential Revision:	https://reviews.freebsd.org/D42796

(cherry picked from commit fa862482fb0a8759984437d71221b17377625491)
2024-02-17 23:58:36 +03:00
Vladimir Kondratyev
c3a10c2332 LinuxKPI: Add static_assert() macro
And move it along BUILD_BUG family in to
linux/build_bug.h to match Linux.

Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42800

(cherry picked from commit 31ef29091b0fbadefb4ccfb21e4b30ca7ddca3ed)
2024-02-17 23:58:36 +03:00
Vladimir Kondratyev
8291858235 LinuxKPI: Implement dev_dbg_once() macro
Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42795

(cherry picked from commit a01259965319897b836019f1d4dcf1b5a5a6ea1a)
2024-02-17 23:58:36 +03:00
Vladimir Kondratyev
1341925217 LinuxKPI: Add str_on_off and other helpers to linux/string_helpers.h
Sponsored by:	Serenity Cyber Security, LLC
Reviewed by:	manu, bz, imp (previous version)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42794

(cherry picked from commit ae1084ff01bf9d9a9a2c56caf6c7095f3e96f579)
2024-02-17 23:58:36 +03:00
Vladimir Kondratyev
914a0c5e1b LinuxKPI: Remove sys/rman.h include from LKPI headers.
sys/rman.h defines `resource` structure which conflicts with the Linux
structure of the same name. To fix that remove reference to sys/rman.h
from linux/pci.h and move resource management code to linux_pci.c.
Update consumers which were depending on linux/pci.h pollution.

No functional changes intended.

Sponsored by:	Serenity Cyber Security, LLC
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42792

(cherry picked from commit 96ab16ebab6319dce9b3041961b0ab6e20a4fecc)
2024-02-17 23:58:36 +03:00
Jean-Sébastien Pédron
356bfb0878 linuxkpi: Include <linux/string_helpers.h> from <linux/seq_file.h>
[Why]
The i915 DRM driver in Linux 5.18 relies on this indirect include.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D43030

(cherry picked from commit d6d1e73e5f66f3b12881fffceff58ca54b506792)
2024-02-17 23:58:36 +03:00
Jean-Sébastien Pédron
daebad715c linuxkpi: Add <linux/string_helpers.h> and str_yes_no()
[Why]
This header and str_yes_no() are now used by the i915 DRM driver in
Linux 5.18.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D43014

(cherry picked from commit 38138beb42d1892dbd8ebb29c01c4471c86d8845)
2024-02-17 23:58:36 +03:00
Jean-Sébastien Pédron
0b3e4b3cc9 linuxkpi: Fix __ATTR_RO() in <linux/sysfs.h>
[Why]
The passed structure may not have a `.store` field. This is the case in
the amdgpu DRM driver starting with Linux 5.18.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D43023

(cherry picked from commit d752a5e82ac92603fadf82e7de75878e1f5d054a)
2024-02-17 23:58:35 +03:00
Jean-Sébastien Pédron
af41c1bee4 linuxkpi: Add sysfs_create_link() in <linux/sysfs.h>
[Why]
The amdgpu DRM driver started to use it in Linux 5.18.

[How]
The function is a no-op as I'm not sure how to implement this with
sysctls yet.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D43022

(cherry picked from commit 509707e8b6b7326c7f4793b6e291f0a8e6939412)
2024-02-17 23:58:35 +03:00
Jean-Sébastien Pédron
0fef6cb729 linuxkpi: Add list_for_each_prev_safe() in <linux/list.h>
[Why]
The amdgpu DRM driver started to use it in Linux 5.18.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D43021

(cherry picked from commit b723bcd05a991d446491e914f2b9f35e66227398)
2024-02-17 23:58:35 +03:00