| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A few issues found by code inspection while hunting for bugzilla PR
286512:
- The "expires" field in struct delayed_work should be unsigned.
- In linux_timer_jiffies_until(), clamp the return value to INT_MAX:
this return value is used as a ticks count, not a jiffies count, so we
should avoid returning too large a value, lest it get truncated. It's
unlikely we are dealing with values that large, but we should be
careful anyway.
- In linux_add_to_sleepqueue(), truncate the timeout to INT_MAX, as this
value is passed to sleepq_set_timeout() as a ticks value. Typically
it's multiplied by ticks_sbt to get an sbintime, and we should make
sure the multiplication doesn't overflow. In drm-kmod, there is at
least one call mod_delayed_work(... MAX_SCHEDULE_TIMEOUT).
Fixes: 325aa4dbd10d ("linuxkpi: Introduce a properly typed jiffies")
Reviewed by: olce, bz, dumbbell, kib
Tested by: dumbbell, bz
Differential Revision: https://reviews.freebsd.org/D50192
|
| |
|
|
|
|
|
|
|
| |
ktime_get_boottime_seconds() is needed by an updated iwlwifi driver.
Sposored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D50005
|
| |
|
|
|
|
|
|
|
|
|
|
| |
It may be that once we implement freeing of chained tables
_devcd_free_sgtable() will become our _lkpi_dev_coredumpsg_free()
but further investigations need to happen. For now make an
updated iwlwifi driver happy which should not need more.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D50006
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Needed by mediatek/mt76 wireless driver.
While here adjust the way is_multicast_ether_addr() is implemented
to not look weird. [1]
Sponsored by: The FreeBSD Foundation
Suggested by: emaste [1]
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D50152
|
| |
|
|
|
|
|
| |
Add more structs, fields, flags, defines.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
| |
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
38fec10eb60d687e30c8c6b5420d86e8149f7557 ( tag: v6.14 ).
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
| |
Add a new flag needed by mt76.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
| |
The dev field in wiphy is a pointer already; no need for &.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Fixes: ac1d519c01ca8
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that we have a long-sized tick counter, we can migrate to using
properly typed timeout parameters in various bits of the LinuxKPI. This
fixes a subtle incompatibility that is otherwise difficult to paper over
and leads to bugs when ticks values are sign-extended.
- Introduce a "jiffies" symbol in subr_ticks.S, declared only in the
LinuxKPI as an unsigned long.
- Remove all references to "ticks" from the LinuxKPI.
- Convert interfaces to match Linux's type signatures where it makes
sense.
Reviewed by: manu
Tested by: bz
Differential Revision: https://reviews.freebsd.org/D48523
|
| |
|
|
|
|
|
|
|
|
| |
Define time64_t to int64_t for all supported architectures
unconditionally.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: imp, markj, emaste
Differential Revision: https://reviews.freebsd.org/D50004
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Move some structs into the appropriate header to be visible.
Add new fields to structs and enums.
Remove arguments from two functions (one function currently unused
by drivers in the tree, for the other the argument was unused).
Adjust the iwlwifi accordingly. This is in preparation for new
driver versions to allow a smooth transition.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
| |
Driver updates introduce a new field "mlo" to the sta.
Add the field to the struct and initialize it in the 802.11 compat
code along with a IMPROVE so once we get to 11be we can deal with it.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
| |
Add pci_info() needed for a driver update. While here prefix
__VA_ARGS__ with ## for pci_err and pci_info in case we are only
passed a string without format arguments.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D50009
|
| |
|
|
|
|
|
|
|
|
| |
Use a macro to automatically gather the length of the array while
we can.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D50007
|
| |
|
|
|
|
|
|
|
| |
Implement container_of_const() needed for wireless driver updates.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D49999
|
| |
|
|
|
|
|
|
|
|
|
| |
An updated rtw88 driver requires minimal changes to leds.h. On
the positive side we can now remove the __DUMMY from the enum as we
actually have a valid field name.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D50002
|
| |
|
|
|
|
|
|
|
|
| |
Some code relies on header pollution (or self-sustainability).
Add cleanup.h to mutex.h as that is one case it seems to be used with.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D50001
|
| |
|
|
|
|
|
|
|
| |
This is needed for rtw89 updates.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste, zarychtam_plan-b.pwste.edu.pl
Differential Revision: https://reviews.freebsd.org/D50000
|
| |
|
|
|
|
|
|
|
|
|
| |
TKIP has a special key buffer. While keylen only identifies the
key length, the two MIC are appended. The LinuxKPI offsets for
these were unfortunately never set correct which lead to constant
Micheal counter measures as the MIC never was correct when calculations
were offloaded to firmware. This is the first half of the fix.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
| |
Add IEEE80211_KEY_FLAG_BITS to be used with %b for debugging
ieee802111_key_flag bit flags. Names are a lot easier to deal
with than just numbers.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
| |
In addition to CCMP add TKIP and GCMP support. The others are still
TODO() until we do suport them natively.
Also refine checks for tid and narrow them down (also don't assert but
gratiously fail).
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
| |
No functional changes.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
| |
Fix the types of a few remaining fields.
Shuffle the fields around so the important ones align to 64byte on a
64bit platform.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
| |
Initially we saved the exact allocation length for contigfree(9).
contigfree can now be replaced by free(9) so there is no need to
remember that value anymore. Removing it also simplifies the
linuxkpi_kfree_skb() code.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
| |
Seems this is the correct type for the csum field in an sk_buff.
Add it as uint32_t __bitwise__.
Sponsored by; The FreeBSD Foundation
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D49831
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the case of DRM drivers, the passed device is a child of `vgapci`. We
want to start the lookup from `vgapci`, so the parent of the passed
`drmn`. We use the `isdrm` flag to determine if we are in this
situation.
This fixes an infinite loop with the amdgpu DRM driver that started to
use this function in Linux 6.8: `pci_upstream_bridge()` was returning
itself and the code in amdgpu was calling it again, hoping to get a
device with a vendor that is not "ATI".
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49388
|
| |
|
|
|
|
|
|
| |
The i915 DRM driver started to use it in Linux 6.8.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49384
|
| |
|
|
|
|
|
|
| |
This function is used by the i915 DRM driver starting with Linux 6.8.
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49067
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move kfree() into slab.c as an implementation and hide the private
function linux_kfree_async() entirely.
Remove a ; at the end of a define and sort some defines into place.
Remove extern from function declarations and move the closer to where
they belong.
Sort the functions into "base allocator/free" functions--these have
an implementation in slab.c and are ensuring contiguous physical
memory allocations.
Followed by inline functions using these base allocators to implement
their functionality; vmalloc/kvalloc, and misc functions.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D49572
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Implement krealloc_array() using krealloc(). Implement krealloc()
doing the various size checks ourselves and use realloc() or kmalloc()
depending on old and new allocation sizes.
This way we can ensure that allocated memory stays physically contiguous.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Suggested by: jhb (see D46657)
Reviewed by: jhb, markj
Differential Revision: https://reviews.freebsd.org/D49571
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With mallocarray() we cannot guarantee that any size larger than
PAGE_SIZE will be contiguous. Switch kmalloc_array() and
kmalloc_array_node() to use __kmalloc()/lkpi___kmalloc_node() as their
underlying implementation which now does provide that guarantee.
Likewise adjust kcalloc_node() to use kmalloc_array_node().
This means we only have two (plain + _node) underlying allocation
routines for the entire category of functions.
Also adjust kvmalloc() and kvmalloc_array() to be a "mirrored"
implementation to their non-v counterparts. These may return
non-contiguous memory so can use malloc().
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: jhb
Extra thanks to: jhb for helping sorting this out
Differential Revision: https://reviews.freebsd.org/D46657
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the implementation of print_hex_dump() into linux_compat.c as
lkpi_hex_dump() taking an extra function pointer and argument.
Add two internal wrappers for printf and sbuf_printf to get a common
function definition (sbuf_printf takes the extra argument).
Use these to implement print_hex_dump() and the newly added
seq_hex_dump().
This allows us to re-use the same implementation of print_hex_dump()
for both functions without duplicating the code.
Initial implementation: D49381 by dumbbell
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D49637
|
| |
|
|
|
|
|
|
|
|
|
| |
This currently implements the empty stubs when `CONFIG_REF_TRACKER` is
not defined.
This is used by the i915 DRM driver starting with Linux 6.8.
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49376
|
| |
|
|
|
|
|
|
|
|
|
|
| |
csa_active, color_change_active, mu_mimo_owner also moved from
vif to bss_conf; we already have the fields in bss_conf (adjust type
for one) so all we have to do is remove the old relics in vif.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Tested by: Oleksandr Kryvulia (shuriku shurik.kiev.ua)
Tested by: Oleg Nauman (oleg.nauman gmail.com) [rtw88]
Differential Revision: https://reviews.freebsd.org/D49734
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In preparations for MLD support chanctx_conf was moved from vif to
the bss_conf as it will be per-link later. Follow accordingly.
Sponsored by: The FreeBSD Foundation
PR: 280546
MFC after: 3 days
Tested by: Oleksandr Kryvulia (shuriku shurik.kiev.ua)
Tested by: Oleg Nauman (oleg.nauman gmail.com) [rtw88]
Differential Revision: https://reviews.freebsd.org/D49734
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We have the same code three times, so factor it out into its own
function to make it easier to maintain.
Sponsored by: The FreeBSD Foundation
PR: 280546
MFC after: 3 days
Tested by: Oleksandr Kryvulia (shuriku shurik.kiev.ua)
Tested by: Oleg Nauman (oleg.nauman gmail.com) [rtw88]
Differential Revision: https://reviews.freebsd.org/D49734
|
| |
|
|
|
|
|
|
|
| |
iwlwifi was the only driver we care about which "used" cipher_scheme
and it was removed from there too. Remove given it is no longer
used anywhere.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
| |
This header implements several stub functions that, on Linux, are used
when `CONFIG_AMD_WBRF` is not set at build time.
The amdgpu DRM driver started to use it in Linux 6.8.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49382
|
| |
|
|
|
|
|
|
|
|
| |
These are no-ops.
The i915 DRM driver started to use it in Linux 6.8.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49380
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
They are helpers to declare static `struct bin_attribute`.
The amdgpu DRM driver started to use them for some time but the code was
commented out (and this is still the case as of this commit). In Linux
6.8, it declared a new BIN_ATTR. This new code is not commented out.
While here, change the first argument of the `read` and `write`
callbacks to be a `struct linux_file *` instead of a `struct file *`.
This ensures the right structure is being referenced at compile time.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49378
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This a variant of `queue_work()` that takes a NUMA node as its first
argument.
The NUMA node is ignored and `queue_work()` is called.
The i915 DRM driver started to use this starting from Linux 6.8.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49377
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We never call this field but it allows to compile drivers without
modifications.
This is used by the DRM drivers for some time, but another change part
of the update to Linux 6.8 led to compile them with `CONFIG_PROC_FS`.
This connected code that uses this struct field.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49069
|
| |
|
|
|
|
|
|
|
|
|
| |
They are used by the i915 DRM driver for quite some time, but that code
was commented out. It was moved around in Linux 6.8, so instead of
figuring out what should be commented out now, let's add an
implementation of these functions.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49068
|
| |
|
|
|
|
|
|
|
| |
The TTM component of the DRM drivers started to use the latter in Linux
6.8.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49387
|
| |
|
|
|
|
|
|
| |
The i915 DRM driver started to use it in Linux 6.8.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49386
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is to fix slowdowns with drm-kmod that get worse over time as
physical memory become more fragmented (and probably also depending on
other factors).
Based on information posted in this bug report:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277476
By default, linux_alloc_pages() retries failed allocations by calling
vm_page_reclaim_contig() to attempt to free contiguous physical memory
pages. vm_page_reclaim_contig() does not always succeed and calling it
can be very slow even when it fails. When physical memory is very
fragmented, vm_page_reclaim_contig() can end up being called (and
failing) after every allocation attempt. This could cause very
noticeable graphical desktop hangs (which could last seconds).
The drm-kmod code in question attempts to allocate multiple contiguous
pages at once but does not actually require them to be contiguous. It
can fallback to doing multiple smaller allocations when larger
allocations fail. It passes alloc_pages() the __GFP_NORETRY flag in this
case.
This patch makes linux_alloc_pages() fail early (without retrying) when
this flag is passed.
[olce: The problem this patch fixes is longer and longer GUI freezes as
a machine's memory gets filled and becomes fragmented, when using amdgpu
from DRM kmod 5.15 and DRM kmod 6.1 (DRM kmod 5.10 is unaffected; newer
Linux kernel introduced an "optimization" by which a pool of pages is
filled preferentially with contiguous pages, which triggered the problem
for us). The original commit message above evokes freezes lasting
seconds, but I occasionally witnessed some lasting tens of minutes,
rendering a machine completely useless.
The patch has been reviewed for its potential impacts to other LinuxKPI
parts and our existing DRM kmods' code. In particular, there is no
other user of __GFP_NORETRY/GFP_NORETRY with Linux's alloc_pages*()
functions in our tree or DRM kmod ports.
It has also been tested extensively, by me for months against 14-STABLE
and sporadically on -CURRENT on a RX580, and by several others as
reported below and as is visible in more details in the quoted bugzilla
PR and in the initial drm-kmod issue at
https://github.com/freebsd/drm-kmod/issues/302, on a variety of other
AMD GPUs (several RX580, RX570, Radeon Pro WX5100, Green Sardine 5600G,
Ryzen 9 4900H with embedded Renoir).]
PR: 277476
Reported by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: olce
Tested by: many (olce, Pierre Pronchery, Evgenii Khramtsov, chaplina, rk)
MFC after: 2 weeks
Relnotes: yes
Sponsored by: The FreeBSD Foundation (review and part of testing)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
<linux/cpufeature.h> on Linux includes <linux/init.h>. We don't have the
latter on FreeBSD yet, so let's comment this include for now. It is
still referenced because sometimes, consumers of headers rely
voluntarily or not on the namespace pollution.
Reported by: jrtc27
Approved by: jrtc27
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49448
|
| |
|
|
|
|
| |
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49385
|
| |
|
|
|
|
|
|
| |
The amdgpu DRM driver started to use it in Linux 6.8.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49383
|
| |
|
|
|
|
|
|
| |
They are synonymous to existing FreeBSD constants.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49379
|