Commit graph

39860 commits

Author SHA1 Message Date
Doug Moore
c253ae9fe4 iommu_gas: restrict tree search to promising paths
In iommu_gas_lowermatch and iommu_gas_uppermatch, a subtree search is
quickly terminated if the largest available free space in the subtree
is below a limit, where that limit is related to the size of the
allocation request. However, that limit is too small; it does not
account for both of the guard pages that will surround the allocated
space, but only for one of them. Consequently, it permits the search
to proceed through nodes that cannot produce a successful allocation
for all the requested space. Fix that limit to improve search
performance.

Reviewed by:	alc, kib
Submitted by:	Weixi Zhu (wxzhu@rice.edu)
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D35414

(cherry picked from commit b831865fe3)
2022-06-27 00:36:42 -05:00
Doug Moore
4d517feaea busdma_iommu: simplify split logic
iommu_bus_dmamap_load_something1 includes code for handling the
possibility of splitting a buffer that is needlessly complex.
Simplify it.

Reviewed by:	alc, kib
MFC after:	3 weeks
Tested by: pho (previous revisions)
Differential Revision:	https://reviews.freebsd.org/D35232

(cherry picked from commit 04e86ae357)
2022-06-27 00:34:59 -05:00
Mitchell Horne
70bb14b902 ddb: namespacing of struct command
'command' is too generic for something specific to the kernel debugger;
change this so it is less likely to collide with local variable names.
Also rename struct command_table to struct db_command_table.

Reviewed by:	markj
MFC after:	1 week
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D35367

(cherry picked from commit 4ef7db5a7e)
2022-06-23 19:19:48 -03:00
Mitchell Horne
0db22efc94 Use KERNEL_PANICKED() in more places
This is slightly more optimized than checking panicstr directly. For
most of these instances performance doesn't matter, but let's make
KERNEL_PANICKED() the common idiom.

Reviewed by:	mjg
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D35373

(cherry picked from commit 35eb9b10c2)
2022-06-23 19:19:26 -03:00
Warner Losh
db761c6a64 Create wrapper for Giant taken for newbus
Create a wrapper for newbus to take giant and for busses to take it too.
bus_topo_lock() should be called before interacting with newbus routines
and unlocked with bus_topo_unlock(). If you need the topology lock for
some reason, bus_topo_mtx() will provide that.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D31831

(cherry picked from commit c6df6f5322)
2022-06-21 17:13:20 +02:00
Hans Petter Selasky
492f5e6494 mlx5ib: Fix memory leak in clean_mr() error path
In the clean_mr() error path the 'mr' should be freed.

Linux commit:
5942d8ae411775b76e5e1ab0cce57b0666516f2d

PR:		264653
Sponsored by:	NVIDIA Networking

(cherry picked from commit e4d178d093)
2022-06-20 13:08:39 +02:00
Hans Petter Selasky
0b5f08439d uchcom(4): Add new USB ID.
PR:		260783
PR:		264634
Sponsored by:	NVIDIA Networking

(cherry picked from commit f25a0a0f21)
2022-06-20 13:08:39 +02:00
Hans Petter Selasky
026e19496c urtw(4): Adjust all pause calls to use milliseconds instead of ticks.
Sponsored by:	NVIDIA Networking

(cherry picked from commit c6c22ebb38)
2022-06-16 04:55:52 +02:00
Hans Petter Selasky
1c5c1e4486 upgt(4): Adjust all pause calls to use milliseconds instead of ticks.
Sponsored by:	NVIDIA Networking

(cherry picked from commit bc2e447338)
2022-06-16 04:55:52 +02:00
Hans Petter Selasky
be3f667388 mlx4core: Use-after-free causes a resource leak in flow-steering detach
mlx4_QP_FLOW_STEERING_DETACH_wrapper first removes the steering
rule (which results in freeing the rule structure), and then
references a field in this struct (the qp number) when releasing the
busy-status on the rule's qp.

Since this memory was freed, it could reallocated and changed.
Therefore, the qp number in the struct may be incorrect,
so that we are releasing the incorrect qp. This leaves the rule's qp
in the busy state (and could possibly release an incorrect qp as well).

Fix this by saving the qp number in a local variable, for use after
removing the steering rule.

Linux commit:
3b01fe7f91c8e4f9afc4fae3c5af72c14958d2d8

PR:	     	264469
Sponsored by:	NVIDIA Networking

(cherry picked from commit dd2a8c8f72)
2022-06-14 11:39:23 +02:00
Gordon Bergling
ca753c6495 al_eth: Fix a typo in a source code comment
- s/enought/enough/

(cherry picked from commit 45b143d2ea)
2022-06-10 14:33:13 +02:00
Gordon Bergling
836ade5e8f amdsbwd(4): Fix a typo in a source code comment
- s/accross/across/

(cherry picked from commit 68c0bd3e3f)
2022-06-10 14:32:22 +02:00
Gordon Bergling
a270ec979f nvmw(4): Fix a typo in a source code comment
- s/inaccessable/inaccessible/

(cherry picked from commit 6e8ab6715d)
2022-06-10 14:31:11 +02:00
Gordon Bergling
aa5c134817 aic7xxx: Fix a few typos in comments and an error message
- s/directrive/directive/
- s/specifiled/specified/
- s/Decend/Descend/
- s/tranversal/transversal/

Obtained from:	NetBSD

(cherry picked from commit d35e1c29a9)
2022-06-10 14:29:50 +02:00
Gordon Bergling
466a3ed5c3 ena(4): Fix a typo in a source code comment
- s/entred/entered/

(cherry picked from commit eb3f25b413)
2022-06-10 14:29:20 +02:00
Gordon Bergling
a9d1abf00e sound(4): Fix a typo in a source code comment
- s/alltogether/altogether/

(cherry picked from commit 70311ccffc)
2022-06-10 14:28:55 +02:00
Gordon Bergling
80bc6e0126 hptmv(4): Fix a typo in a source code comment
- s/continous/continuous/

(cherry picked from commit bbb0ca45f8)
2022-06-10 14:28:42 +02:00
Gordon Bergling
abcfcce068 le(4): Fix a typo in a source code comment
- s/brodcast/broadcast/

(cherry picked from commit b008ab622c)
2022-06-10 14:28:14 +02:00
Gordon Bergling
e59da6ed98 if_sis(4): Fix a typo in a source code comment
- s/emperical/empirical/

(cherry picked from commit 3c2ea3ca28)
2022-06-10 14:26:53 +02:00
Gordon Bergling
1dceda2ccd aic79xx: Fix a typo in a source code comment
- s/Disble/Disable/

Obtained from:	NetBSD

(cherry picked from commit 2cada72c65)
2022-06-10 14:26:12 +02:00
Gordon Bergling
59a480875d qlnxe(4): Fix a typo in a source code comment
- s/indepent/independent/

(cherry picked from commit a87f167c41)
2022-06-10 14:25:08 +02:00
Gordon Bergling
0fa1bbeebc twe(4): Fix a common typo in a source code comment
- s/independant/independent/

(cherry picked from commit 508a46c745)
2022-06-10 14:24:54 +02:00
Gordon Bergling
8b5309ab25 qlxgbe(4): Fix a common typo in a source code comment
- s/independant/independent/

(cherry picked from commit f129473702)
2022-06-10 14:24:40 +02:00
Gordon Bergling
3d5aa46fc6 ffec: Fix a common typo in a source code comment
- s/independant/independent/

(cherry picked from commit d3e0919b56)
2022-06-10 14:24:11 +02:00
Gordon Bergling
c7aa67863c if_age(4): Fix a typo in a source code comment
- s/indepent/independent/

(cherry picked from commit f207bdd2cc)
2022-06-10 14:23:57 +02:00
Gordon Bergling
402a483124 mlx(4): Fix a common typo in a source code comment
- s/independant/independent/

(cherry picked from commit 9ae6b386ab)
2022-06-10 14:23:42 +02:00
Gordon Bergling
cc57e03523 ixgbe(4): Fix common typos in source code comments
- s/filer/filter/

Obtained from:	NetBSD

(cherry picked from commit cd7e11f78d)
2022-06-10 14:22:46 +02:00
Hans Petter Selasky
d264494e98 mlx4core: Fix a memory leak when deleting slave's resources
mlx4_delete_all_resources_for_slave() in the resource tracker should free
all memory allocated for a slave. While releasing memory of fs_rule,
it misses releasing memory of fs_rule->mirr_mbox.

Linux commit:
461d5f1b59490ce0096dfda45e10038c122a7892

PR:		264249
Sponsored by:	NVIDIA Networking

(cherry picked from commit f29c9901a4)
2022-06-07 08:44:29 +02:00
Hans Petter Selasky
267e6442d0 mlx4: Fix a memory leak bug.
In function mlx4_opreq_action(), pointer "mailbox" is not released,
when mlx4_cmd_box() return and error, causing a memory leak bug.
Fix this issue by going to "out" label, mlx4_free_cmd_mailbox() can
free this pointer.

Linux commit:
febfd9d3c7f74063e8e630b15413ca91b567f963

PR:		264056
Sponsored by:	NVIDIA Networking

(cherry picked from commit 527762b2f7)
2022-06-07 08:44:28 +02:00
Emmanuel Vadot
b203d3de6b backlight: Update cached value when getting the brightness
External events can cause the backlight level to change (AC adapter
plug/unplug for example) so cache the value there too.

PR:		257796
Sponsored by:	Beckhoff Automation GmbH & Co. KG
MFC after:	1 week

(cherry picked from commit e26ef41f79)
2022-06-01 09:12:18 +02:00
Kevin Bowling
0cfe15ba9f igc: Increase rx_buffer_size local variable to 32b
Apply 6987c47569 to igc. This is not
expected to have any benefit on current parts with current observed PBA
sizes but will avoid surprises if they are increased in future chips.

Approved by:	grehan
Differential Revision:	https://reviews.freebsd.org/D35217

(cherry picked from commit 9b88ecd674)
2022-05-20 09:36:54 -07:00
John Baldwin
6967516a27 qlxgb/qlxgbe/qlxge: Fix build without INET and/or without INET6.
This is in preparation for adding these drivers to amd64 NOTES.

(cherry picked from commit 618aa8cd0a)
2022-05-19 17:22:07 -07:00
John Baldwin
e6464fce46 nvdimm_e820: Use driver->name in identify method.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D35077

(cherry picked from commit 216ca4cee1)
2022-05-19 15:01:50 -07:00
John Baldwin
80893ea32b pbio: Add locking and remove D_NEEDGIANT.
Use a sx lock to permit uiomove directly into/out of the the per-port
buffers.  In addition, the sx lock provides a stronger guarantee that
I think this driver wants which is to single-thread read and write
calls even while paused.  Finally, replace tsleep with dummy wait
channels with calls to pause_sig to more clearly communicate the
intent.

Differential Revision:	https://reviews.freebsd.org/D35081

(cherry picked from commit 51f481235c)
2022-05-19 15:01:50 -07:00
John Baldwin
bde0080b3d pbio: Return BUS_PROBE_DEFAULT from probe instead of 0.
0 should only be returned from probe in legacy drivers that need to
preserve softc state between probe and attach.

Differential Revision:	https://reviews.freebsd.org/D35080

(cherry picked from commit 4942e8df47)
2022-05-19 15:01:50 -07:00
John Baldwin
c6960a6881 pbio: Axe bus_space tag/handle using bus_read/write_1 instead.
Differential Revision:	https://reviews.freebsd.org/D35079

(cherry picked from commit bb81a138c3)
2022-05-19 15:01:50 -07:00
John Baldwin
f02bf967fc pbio: Store softc in si_drv1 for character devices.
The port number is still stored in the unit (si_drv0) but is the
entire unit value now.

While here, removed checks for NULL softc since those can never happen
from cdevsw routines.  This also resulted in the close method becoming
a no-op, so it has been removed.

Differential Revision:	https://reviews.freebsd.org/D35078

(cherry picked from commit 0db65574bb)
2022-05-19 15:01:50 -07:00
John Baldwin
7fe4c7b59e acpi_toshiba: Use device_get_softc in attach.
Rather than a detour via the devclass and hardcoding unit 0.

While here, remove a check for sc being NULL.  It will never be NULL
when attach is called.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D35010

(cherry picked from commit 1ac10fa429)
2022-05-19 14:33:09 -07:00
John Baldwin
d2ebb215b8 arcmsr: Remove never-true NULL check from cdev callbacks.
si_drv1 will always hold a non-NULL pointer.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D35005

(cherry picked from commit 108adb2ff5)
2022-05-19 14:33:02 -07:00
John Baldwin
aee33ff467 pcm: Remove dead code from sound_modevent.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D34997

(cherry picked from commit 8109ec9d89)
2022-05-19 14:32:56 -07:00
John Baldwin
da567228b6 arcmsr: Store softc pointer in si_drv1 of cdev.
Rather than fetching the softc using the controller's unit number as
an index into the devclass.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D35004

(cherry picked from commit a9e5e04e64)
2022-05-19 14:32:50 -07:00
John Baldwin
b4600b1378 hptiop: Store softc pointer in si_drv1 of cdev.
Rather than fetching the softc using the controller's unit number as
an index into the devclass.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D34993

(cherry picked from commit 517a8a715a)
2022-05-19 14:31:53 -07:00
Adam S
d7417aa55e asmc: Update Mac Pro 6 sensor definitions
- Make descriptions a bit more human-friendly.
- Don't attempt to probe fan safe speeds, this model does not provide
  one.

PR:		260781

(cherry picked from commit dc484aed0a)
2022-05-18 17:16:01 -04:00
Trev
d6fe8a8eab asmc: Add support for Macmini 5,1 (2011) and 5,3 and 7,1 (2014) models
PR:		262456

(cherry picked from commit 601abb300c)
2022-05-18 17:15:58 -04:00
Mark Johnston
180ab9d85b asmc: Style
(cherry picked from commit a31b0c0c47)
2022-05-18 17:15:56 -04:00
Daniel W. Delâtre
4bb64770b3 asmc: Add support for MacBook Pro 9,1 (mid 2012)
PR:		261981

(cherry picked from commit 79291c9baf)
2022-05-18 17:15:53 -04:00
Mark Johnston
cd613d7cd9 asmc: Make the model table const and local to asmc.c
No functional change intended.

(cherry picked from commit 27d4c6f86e)
2022-05-18 17:15:51 -04:00
Adam S
1610a56a56 asmc: Add support for MacPro 6,1 (2013)
PR:		260781

(cherry picked from commit 7d5fef1837)
2022-05-18 17:15:47 -04:00
Mark Johnston
85f0cdff6f asmc: Add support for MacBook Air 4,1 and 4,2 (2011)
PR:		218574
Submitted by:	NapoleonWils0n <t43InvisibleMan@gmail.com>
Submitted by:	John Hay <john@sanren.ac.za>

(cherry picked from commit 308340cce2)
2022-05-18 17:15:43 -04:00
Kevin Bowling
49d682cb1a igc: Update PCI IDs
bf0aa72f:
igc: Update PCI IDs
I226-K PCI ID got clarified by intel. Add a new I226 ID while here.

Approved by:	grehan
Differential Revision:	https://reviews.freebsd.org/D35218

48a1a6be:
igc: Fix typo in PCI ID define usage

Reported by:	jenkins
Fixes:	bf0aa72f1f igc: Update PCI IDs

(cherry picked from commit bf0aa72f1f)
(cherry picked from commit 48a1a6be19)
2022-05-17 17:30:36 -07:00