History log of /freebsd-13.1/sys/compat/linuxkpi/common/include/linux/cdev.h (Results 1 – 16 of 16)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/12.4.0, release/13.1.0
# 88543510 05-Apr-2022 Warner Losh <[email protected]>

linuxkpi: Move cdev_alloc into .c file

Move cdev_alloc into linux_compat.c since it encodes the size of struct
linux_cdev into the client modules otherwise.

Approved by: re@ (gjb)
Sponsored by: N

linuxkpi: Move cdev_alloc into .c file

Move cdev_alloc into linux_compat.c since it encodes the size of struct
linux_cdev into the client modules otherwise.

Approved by: re@ (gjb)
Sponsored by: Netflix
Reviewed by: hselasky, emaste
Differential Revision: https://reviews.freebsd.org/D34771

(cherry picked from commit aca0bcbca344b39f2a448e8c1c0d80bac8c0d6de)
(cherry picked from commit d1f93d6721a6c51c0cb49078ad5c5d535a383964)

show more ...


# 2d0694b9 19-Dec-2021 Vladimir Kondratyev <[email protected]>

LinuxKPI: Constantly use _LINUXKPI_ prefix in include guards

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

(cherry picked from

LinuxKPI: Constantly use _LINUXKPI_ prefix in include guards

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

(cherry picked from commit 307f78f3ed90a4145eeb2c8cc79bc95b2666f57a)

show more ...


Revision tags: release/12.3.0
# fba2292d 11-May-2021 Hans Petter Selasky <[email protected]>

Implement cdev_device_add() and cdev_device_del() in the LinuxKPI.

Sponsored by: Mellanox Technologies // NVIDIA Networking

(cherry picked from commit b8f113cab91f288e5d5e29d21184d1601b87cfdd)


# 303bef2a 11-May-2021 Hans Petter Selasky <[email protected]>

cdev_del() should only put it's kernel object in the LinuxKPI.

The destructor takes care of the rest.

Sponsored by: Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 67807f5066

cdev_del() should only put it's kernel object in the LinuxKPI.

The destructor takes care of the rest.

Sponsored by: Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 67807f5066a012254da9a4535c0f225377afb66d)

show more ...


Revision tags: release/13.0.0, release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0
# 85f2a00b 01-Jan-2019 Conrad Meyer <[email protected]>

linuxkpi: Remove extraneous NULL check on M_WAITOK allocation

The check was not introduced in r342628, but the subsequent unchecked access to
refs was added then, prompting a Coverity warning about

linuxkpi: Remove extraneous NULL check on M_WAITOK allocation

The check was not introduced in r342628, but the subsequent unchecked access to
refs was added then, prompting a Coverity warning about "Null pointer
dereferences (FORWARD_NULL)." The warning is bogus due to M_WAITOK, but so is
the NULL check that hints it, so just remove it.

CID: 1398588
Reported by: Coverity

show more ...


# f823a36e 30-Dec-2018 Konstantin Belousov <[email protected]>

Fix linux_destroy_dev() behaviour when there are still files open from
the destroying cdev.

Currently linux_destroy_dev() waits for the reference count on the
linux cdev to drain, and each open file

Fix linux_destroy_dev() behaviour when there are still files open from
the destroying cdev.

Currently linux_destroy_dev() waits for the reference count on the
linux cdev to drain, and each open file hold the reference.
Practically it means that linux_destroy_dev() is blocked until all
userspace processes that have the cdev open, exit. FreeBSD devfs does
not have such problem, because device refcount only prevents freeing
of the cdev memory, and separate 'active methods' counter blocks
destroy_dev() until all threads leave the cdevsw methods. After that,
attempts to enter cdevsw methods are refused with an error.

Implement somewhat similar mechanism for LinuxKPI cdevs. Demote cdev
refcount to only mean a hold on the linux cdev memory. Add sirefs
count to track both number of threads inside the cdev methods, and for
single-bit indicator that cdev is being destroyed. In the later case,
the call is redirected to the dummy cdev.

Reviewed by: markj
Discussed with: hselasky
Tested by: zeising
MFC after: 1 week
Sponsored by: Mellanox Technologies
Differential revision: https://reviews.freebsd.org/D18606

show more ...


Revision tags: release/12.0.0
# 9c7b53cc 05-Dec-2018 Slava Shwartsman <[email protected]>

linuxkpi: Fix for use-after-free when tearing down character devices.

Make sure we hold a reference on the character device for every opened file
to prevent the character device to be freed prematur

linuxkpi: Fix for use-after-free when tearing down character devices.

Make sure we hold a reference on the character device for every opened file
to prevent the character device to be freed prematurely.

Submitted by: hselasky@
Approved by: hselasky (mentor)
MFC after: 1 week
Sponsored by: Mellanox Technologies

show more ...


Revision tags: release/11.2.0
# 83630517 23-Mar-2018 Ed Maste <[email protected]>

linuxkpi whitespace cleanup

Reviewed by: hselasky, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14807


Revision tags: release/10.4.0
# 2b79a966 02-Aug-2017 Hans Petter Selasky <[email protected]>

Fix LinuxKPI regression after r321920. The mda_unit and si_drv0 fields are not
wide enough to hold the full 64-bit dev_t. Instead use the "dev" field in
the "linux_cdev" structure to store and lookup

Fix LinuxKPI regression after r321920. The mda_unit and si_drv0 fields are not
wide enough to hold the full 64-bit dev_t. Instead use the "dev" field in
the "linux_cdev" structure to store and lookup this value.

While at it remove superfluous use of parenthesis inside the
MAJOR(), MINOR() and MKDEV() macros in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

show more ...


Revision tags: release/11.1.0
# 1125dbc0 26-Dec-2016 Hans Petter Selasky <[email protected]>

Implement register and unregister chrdev in the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies


Revision tags: release/11.0.1, release/11.0.0
# 5a6748b2 24-May-2016 Hans Petter Selasky <[email protected]>

Use make_dev_s() instead of make_dev() to avoid race setting
"si_drv1". Convert panic() into regular error while at it.

Suggested by: jhb @
MFC after: 1 week
Sponsored by: Mellanox Technologies


# ed5f7812 23-May-2016 Hans Petter Selasky <[email protected]>

Add support for "cdev_add_ext()" to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies


Revision tags: release/10.3.0
# 06204f8e 31-Dec-2015 Hans Petter Selasky <[email protected]>

Minor LinuxKPI code cleanup:
- Declare some static functions in linux_compat.c instead if inside
various header files.
- Prefix FreeBSD local functions in the LinuxKPI with "linux_" to
avoid symb

Minor LinuxKPI code cleanup:
- Declare some static functions in linux_compat.c instead if inside
various header files.
- Prefix FreeBSD local functions in the LinuxKPI with "linux_" to
avoid symbol name conflicts in the future and to make debugging
easier.
- Make the "struct kobj_ktype" declaractions constant to shave off a
few bytes from the data segment.

MFC after: 1 week
Sponsored by: Mellanox Technologies

show more ...


# 337cb9f0 31-Dec-2015 Hans Petter Selasky <[email protected]>

Make the kobject refcounting compliant with Linux. Refcounting on the
parent kobject cannot be factored out and must be done by the kobject
consumers.

MFC after: 1 week
Sponsored by: Mellanox Techno

Make the kobject refcounting compliant with Linux. Refcounting on the
parent kobject cannot be factored out and must be done by the kobject
consumers.

MFC after: 1 week
Sponsored by: Mellanox Technologies

show more ...


# 8e7baabc 03-Nov-2015 Hans Petter Selasky <[email protected]>

Make all the LinuxKPI include files compile standalone.

Sponsored by: Mellanox Technologies


# 8d59ecb2 29-Oct-2015 Hans Petter Selasky <[email protected]>

Finish process of moving the LinuxKPI module into the default kernel build.

- Move all files related to the LinuxKPI into sys/compat/linuxkpi and
its subfolders.
- Update sys/conf/files and some M

Finish process of moving the LinuxKPI module into the default kernel build.

- Move all files related to the LinuxKPI into sys/compat/linuxkpi and
its subfolders.
- Update sys/conf/files and some Makefiles to use new file locations.
- Added description of COMPAT_LINUXKPI to sys/conf/NOTES which in turn
adds the LinuxKPI to all LINT builds.
- The LinuxKPI can be added to the kernel by setting the
COMPAT_LINUXKPI option. The OFED kernel option no longer builds the
LinuxKPI into the kernel. This was done to keep the build rules for
the LinuxKPI in sys/conf/files simple.
- Extend the LinuxKPI module to include support for USB by moving the
Linux USB compat from usb.ko to linuxkpi.ko.
- Bump the FreeBSD_version.
- A universe kernel build has been done.

Reviewed by: np @ (cxgb and cxgbe related changes only)
Sponsored by: Mellanox Technologies

show more ...