Commit graph

40024 commits

Author SHA1 Message Date
Gordon Bergling
797143d8fe isp(4): Fix two typos in source code comments
- s/overriden/overridden/

(cherry picked from commit 310d144a83)
2022-09-06 07:40:11 +02:00
Gordon Bergling
fe3660cf1f bce(4): Fix a typo in a source code comment
- s/overriden/overridden/

(cherry picked from commit ddf38e0204)
2022-09-06 07:39:43 +02:00
Gordon Bergling
aceb5fff0a impi(4): Fix two typos in source code comments
- s/overriden/overridden/

(cherry picked from commit 05e1ac3cbf)
2022-09-06 07:39:13 +02:00
Gordon Bergling
f3547e8452 bxe(4): Fix two typos in source code comments
- s/overriden/overridden/

(cherry picked from commit f93ef3ff06)
2022-09-06 07:38:57 +02:00
Gordon Bergling
c09b9ae468 sound(4): Fix a typo in asource code comment
- s/overriden/overridden/

(cherry picked from commit ac34f366cc)
2022-09-06 07:38:41 +02:00
Gordon Bergling
1c11509479 sdhci(4): Fix a typo in asource code comment
- s/overriden/overridden/

(cherry picked from commit cc280cac34)
2022-09-06 07:38:14 +02:00
Gordon Bergling
04f08f25b9 usb: Fix two typos in source code comments
- s/overriden/overridden/

(cherry picked from commit d0ddb5aaca)
2022-09-06 07:37:58 +02:00
Hans Petter Selasky
3a33579959 usb(4): Quirk for non-compliant USB devices.
Some non-compliant USB devices do not implement the
clear endpoint halt feature. Silently ignore such
failures, when they at least responded correctly
passing up a valid STALL PID packet.

Tested by:	Doug Ambrisko <ambrisko@ambrisko.com>
Sponsored by:	NVIDIA Networking

(cherry picked from commit 4e2d8cd3e2)
2022-09-03 12:22:07 +02:00
Hans Petter Selasky
89d98b9b00 u3g(4): Add more USB IDs.
Submitted by:	malavon <benny.goemans@gmail.com>
PR:		263700
Sponsored by:	NVIDIA Networking

(cherry picked from commit 0b01a13b8a)
2022-09-02 11:07:01 +02:00
Kornel Dulęba
108b6eb670 neta: Fix MTU change sequence
The IFF_DRV_RUNNING flag is used to see if the interface needs
to be temporarily brought down during MTU change sequence.
The problem here is that this flag is cleared in mvneta_stop_locked,
resulting in the reinitialization logic never being executed after
MTU has been changed.
Fix that by saving the flag value before the interface is brought down.

Reported by:	Jérôme Tomczyk <jerome.tomczyk@stormshield.eu>
Approved by:	mw(mentor)
Obtained from:	Semihalf
Sponsored by:	Stormshield
MFC after:	2 weeks

(cherry picked from commit 97ecdc00ac)
2022-09-01 09:14:43 +02:00
Konrad Sewiłło-Jopek
91af12081e TPM: do not set device description if probe fails
device_set_desc should be called only if driver probes successfully.

Approved by:	mw(mentor)
Reviewed by:	mw, kd
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35998

(cherry picked from commit 31ee3a33aa)
2022-09-01 09:14:40 +02:00
Gordon Bergling
3cc226cd9c bhnd(4): Correct a typo in a source code comment
- s/in he/in the/

(cherry picked from commit ce99e4fa44)
2022-08-30 14:07:39 +02:00
Hans Petter Selasky
d02aaf5325 uftdi(4): Add new USB ID.
PR:		265514
Sponsored by:	NVIDIA Networking

(cherry picked from commit 9f35dbfdc6)
2022-08-29 14:03:49 +02:00
Ed Maste
ff6ab85fc9 gpio: mark INVARIANTS variables as __diagused
Fixes INVARIANTS build with Clang 15, which previously failed due to
set-but-not-used variable warnings.

Reviewed by:	dim
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36097

(cherry picked from commit 7dc4d5118c)
2022-08-28 21:04:31 -04:00
Ed Maste
9f45a241fc acpi: mark INVARIANTS variables as __diagused
Fixes INVARIANTS build with Clang 15, which previously failed due to
set-but-not-used variable warnings.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36096

(cherry picked from commit 0fd8d3589a)
2022-08-28 21:04:19 -04:00
John Baldwin
9a647d96eb pci: Add helper routines to iterate over a device's BARs.
Reviewed by:	imp, markj, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36237

(cherry picked from commit 16bedf532c)
2022-08-25 09:38:49 -07:00
John Baldwin
39b724b727 cxgbe TOE TLS: Fix handling of unusual record types.
This doesn't matter for real traffic but fixes failures in the KTLS
unit tests that use unusual record types.

Sponsored by:	Chelsio Communications

(cherry picked from commit 782db2881b)
2022-08-25 09:33:04 -07:00
John Baldwin
cb85a1815f cxgbei: Adjust the calculation for the maximum ISO payload.
Round down the maximim ISO payload by the current MSS.  Otherwise the
round up by MSS when calculating the 16-bit maximum payload len passed
along in the FLOWC work request can overflow.

Discussed with:	np
Sponsored by:	Chelsio Communications

(cherry picked from commit 8020c05683)
2022-08-25 09:30:09 -07:00
John Baldwin
84fc080266 cxgbe: Deactivate upper layer drivers (like TOE) during detach.
Reviewed by:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D35237

(cherry picked from commit 12b37f8f9c)
2022-08-25 09:29:22 -07:00
Konstantin Belousov
d4f7acfad7 iommu_gas: add iommu_gas_remove()
(cherry picked from commit c9e4d25052)
2022-08-22 16:37:09 +03:00
Andrew Turner
36e31c79ce Adjust function definition in ofw to avoid clang 15 warning
With clang 15, the following -Werror warning is produced:

    sys/dev/ofw/openfirm.c:826:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    OF_enter()
            ^
             void

This is because OF_enter() and OF_exit are declared with a (void)
argument list, but defined with an empty argument list. Make the
definition match the declaration.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ec666d187d)
2022-08-22 10:11:29 +01:00
Andrew Turner
1570048c52 Adjust function definition in hwpmc to avoid clang 15 warning
With clang 15, the following -Werror warning is produced:

    sys/dev/hwpmc/hwpmc_arm64.c:530:21: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pmc_arm64_initialize()
                        ^
                         void

This is because many of the functions are declared with a (void)
argument list, but defined with an empty argument list. Make the
definition match the declaration.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 05cef74742)
2022-08-22 10:11:29 +01:00
Dimitry Andric
71554ce0cd Adjust function definition in drm_fb_helper.c to avoid clang 15 warning
With clang 15, the following -Werror warning is produced:

    sys/dev/drm2/drm_fb_helper.c:86:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    framebuffer_alloc()
                     ^
                      void

This is because framebuffer_alloc() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after:	3 days

(cherry picked from commit 7a7bbe1021)
2022-08-21 13:10:50 +02:00
Dimitry Andric
39a1b70090 gpio: mark more INVARIANTS variables as __diagused
Mark another set of variables that are only used in INVARIANTS builds,
which otherwise result in set-but-not-used warnings.

Fixes:		7dc4d5118c
MFC after:	3 days

(cherry picked from commit 6e62d9a5a5)
2022-08-21 13:10:49 +02:00
Alexander Motin
bdd4dbb070 nvme: Print CRD, M and DNR status bits on errors.
It may help with some issues debugging.

MFC after:	1 week

(cherry picked from commit a69c096462)
2022-08-15 13:34:48 -04:00
Alexander Motin
2f8b4d7218 acpi_apei: Add sysctl to mute corrected errors.
Setting hw.acpi.apei.log_corrected to 0 will mute corrected errors logging.

MFC after:	1 week

(cherry picked from commit 52a54b96ed)
2022-08-15 13:31:44 -04:00
Mitchell Horne
2571d6f331 ddb: use _FLAGS command macros where appropriate
Some command definitions were forced to use DB_FUNC in order to specify
their required flags, CS_OWN or CS_MORE. Use the new macros to simplify
these.

Reviewed by:	markj, jhb
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D35582

(cherry picked from commit 258958b3c7)
2022-08-11 11:25:53 -03:00
Gordon Bergling
05060d1f3a isci(4): Fix a typo in a source code comment
- s/paramater/parameter/

(cherry picked from commit 0702f4f040)
2022-08-10 14:21:30 +02:00
Gordon Bergling
8b8c7aa786 bce(4): Fix two typos in kernel messages
- s/bufferred/buffered/

(cherry picked from commit 1ffd352bc2)
2022-08-09 08:02:10 +02:00
Mark Johnston
c460b80021 altera/sdcard: Catch up with commit 5a96b88f05
This is a direct commit to stable/13 since the driver is not present in
main.

Fixes:	5a96b88f05 ("kerneldump: remove physical from dump routines")
2022-08-08 14:20:33 -04:00
ed crowe
00a59bf122 asmc: Add support for MacBookPro6,2
Modify asmc_sms_printintr() to be silent when the ambient light sensor
interrupt fires on this model, since the messages can otherwise fill up
the dmesg.

PR:		265005
Reviewed by:	markj

(cherry picked from commit 3416f5cde7)
2022-08-08 09:52:13 -04:00
Alan Cox
fb110e5104 iommu_gas: Eliminate redundant parameters and push down lock acquisition
Since IOMMU map entries store a reference to the domain in which they
reside, there is no need to pass the domain to iommu_gas_free_entry(),
iommu_gas_free_space(), and iommu_gas_free_region().

Push down the acquisition and release of the IOMMU domain lock into
iommu_gas_free_space() and iommu_gas_free_region().

Both of these changes allow for simplifications in the callers of the
functions without really complicating the functions themselves.
Moreover, the latter change eliminates the direct use of the IOMMU
domain lock from the x86-specific DMAR code.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35995

(cherry picked from commit 4670f90846)
2022-08-08 02:07:50 -05:00
Alan Cox
02b3bb3e45 x86/iommu: Reduce DMAR lock contention
Replace the DMAR unit's tlb_flush TAILQ by a custom list implementation
that enables dmar_qi_task() to dequeue entries without holding the DMAR
lock.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35951

(cherry picked from commit 42736dc44d)
2022-08-08 02:07:33 -05:00
Doug Moore
aac66558eb iommu_gas: consolidate find_space helpers
Merge lowermatch and uppermatch into find_space.  Eliminate uppermatch
recursion.  Merge match_insert into match_one and eliminate some
redundant calculation.  Move some initialization out of find_space and
into map (and out from under a lock).

Reviewed by:	kib (previous version), alc
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D35440

(cherry picked from commit e0e8d0c8d6)
2022-08-07 22:54:27 -05:00
Doug Moore
14fa36d1c1 dev/iommu: Include offset in maxaddr check.
If iommu_gas_match_one has to adjust for a boundary crossing, its
check against maxaddr includes 'offset' in its calculation, to ensure
that the allocated memory does not exceed the max address. However, if
there's no boundary crossing adjustment, then the maxaddr check
disregards 'offset'. Fix that.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D34978

(cherry picked from commit 11fced21cc)
2022-08-07 22:39:38 -05:00
Alan Cox
6be8028f44 iommu_gas: Eliminate a possible case of use-after-free
Eliminate a possible case of use-after-free in an error handling path
after a mapping failure.  Specifically, eliminate IOMMU_MAP_ENTRY_QI_NF
and instead perform the IOTLB invalidation synchronously.  Otherwise,
when iommu_domain_unload_entry() is called and told not to free the
IOMMU map entry, the caller could free the entry before dmar_qi_task()
is finished with it.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35878

(cherry picked from commit 8bc3673847)
2022-08-07 22:18:29 -05:00
Alan Cox
f2453156dd iommu: Shrink the iommu map entry structure
Eliminate the unroll_entry field from struct iommu_map_entry, shrinking
the struct by 16 bytes on 64-bit architectures.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35769

(cherry picked from commit db0110a536)
2022-08-07 22:17:58 -05:00
Alan Cox
e9711ea5e2 iommu_gas: Avoid double unmapping on error
In the extremely unlikely case that the iommu_gas_map_region() call in
bus_dma_iommu_load_ident() failed, we would attempt to unmap the failed
entry twice, first in iommu_gas_map_region(), and a second time in the
caller.  Once is enough, and twice is problematic because it leads to a
second RB_REMOVE call on the same tree node.  Like it or not, RB_TREE
does not handle that possibility.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35869

(cherry picked from commit dfabdacb27)
2022-08-07 22:16:49 -05:00
Hans Petter Selasky
2817d3ac2a hidbus(4): Align refcount checks for hidbus_intr_start() and hidbus_intr_stop().
No functional change intended.

Discussed with:	wulf @
Sponsored by:	NVIDIA Networking

(cherry picked from commit c019a1690b)
2022-08-04 15:17:56 +02:00
Gordon Bergling
67a96a760f uefi(8): Fix a typo in a source code comment
- s/intrrupt/interrupt/

(cherry picked from commit 98b610b506)
2022-08-03 06:10:43 +02:00
Gordon Bergling
8a4470dc88 qlnxe(4): Fix a typo in a source code comment
- s/pedning/pending/

(cherry picked from commit 37519e3ff3)
2022-08-03 06:09:24 +02:00
Gordon Bergling
c19cad49f6 cxgb(4): Fix a typo in a source code comment
- s/collissions/collisions/

Obtained from:	NetBSD

(cherry picked from commit 6c73ba1a28)
2022-08-03 06:09:10 +02:00
Neel Chauhan
c18d676d53 vmd: Add 8086:A77F PCI ID for all Intel Raptor Lake SKUs
Summary:
This is based on the Linux kernel commit
922bfd001d1ac02111ebbe0524aaab6ca7925521.

Reviewed by:		mav (src)
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D35996

(cherry picked from commit b07a48d4f3)
2022-08-02 20:49:41 -07:00
Dimitry Andric
609593ae47 Suppress possible unused variable warning for icl_soft.c
With clang 15, the following -Werror warning is produced on i386:

    sys/dev/iscsi//icl_soft.c:1277:6: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
            int i;
                ^

The 'i' variable is used later in the icl_soft_conn_pdu_get_bio()
function, via the PHYS_TO_DMAP() macro. However, on i386 and some other
architectures, this macro is defined to panic immediately, so in those
cases, 'i' is indeed not used. Suppress the warning by marking 'i' as
unused.

MFC after:	3 days

(cherry picked from commit 02a226ac34)
2022-08-01 20:07:27 +02:00
Dimitry Andric
158071c51a Adjust function definitions in xen's control.c to avoid clang 15 warnings
With clang 15, the following -Werror warnings are produced:

    sys/dev/xen/control/control.c:188:15: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    xctrl_poweroff()
                  ^
                   void
    sys/dev/xen/control/control.c:194:13: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    xctrl_reboot()
                ^
                 void
    sys/dev/xen/control/control.c:207:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    xctrl_suspend()
                 ^
                  void
    sys/dev/xen/control/control.c:344:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    xctrl_crash()
               ^
                void

This is because xctrl_poweroff(), xctrl_reboot(), xctrl_suspend(), and
xctrl_crash() are declared with (void) argument lists, but defined with
empty argument lists. Make the definitions match the declarations.

MFC after:	3 days

(cherry picked from commit a6c803048f)
2022-07-29 20:33:06 +02:00
Dimitry Andric
d0917822a2 Fix unused variable warning in xen's blkfront.c
With clang 15, the following -Werror warning is produced:

    sys/dev/xen/blkfront/blkfront.c:602:6: error: variable 'sbp' set but not used [-Werror,-Wunused-but-set-variable]
            int sbp;
                ^

The 'sbp' variable was used in the for loop later in the xb_dump()
function, but refactoring in e4808c4b2d got rid of it. Remove the
variable since it no longer serves any purpose.

MFC after:      3 days

(cherry picked from commit e635220e1a)
2022-07-29 20:32:08 +02:00
Dimitry Andric
105f9406c9 Adjust check_struct_sizes() definition to avoid clang 15 warning
With clang 15, the following -Werror warning is produced:

    sys/dev/smartpqi/smartpqi_helper.c:374:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    check_struct_sizes()
                      ^
                       void

This is because check_struct_sizes() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after:	3 days

(cherry picked from commit fb1c21688c)
2022-07-29 20:31:13 +02:00
Dimitry Andric
9a9aea956b Fix unused variable warning in usb's atp.c
With clang 15, the following -Werror warning is produced:

    sys/dev/usb/input/atp.c:2018:11: error: variable 'n_vertical_scrolls' set but not used [-Werror,-Wunused-but-set-variable]
            u_int8_t n_vertical_scrolls = 0;
                     ^

The 'n_vertical_scrolls' variable is no longer used after 197b9a2ef0,
so remove it.

MFC after:	3 days

(cherry picked from commit b621f3cf2d)
2022-07-29 20:31:06 +02:00
John Baldwin
822f2c1590 atp: Remove unused variable.
(cherry picked from commit 197b9a2ef0)
2022-07-29 20:31:02 +02:00
Dimitry Andric
08329b98ab Fix unused variable warning in sfxge's ef10_tx.c
With clang 15, the following -Werror warning is produced:

    sys/dev/sfxge/common/ef10_tx.c:345:15: error: variable 'eqp' set but not used [-Werror,-Wunused-but-set-variable]
            efx_qword_t *eqp;
                         ^

The 'eqp' variable is passed as an argument to the EFSYS_BAR_WC_WRITEQ()
macro, but currently this macro ignores the argument, similar to its
other _esbp argument. Silence the warning by casting the _eqp argument
to void in the macro.

MFC after:	3 days

(cherry picked from commit a79731b945)
2022-07-29 20:30:00 +02:00