Commit graph

40578 commits

Author SHA1 Message Date
John Baldwin
23802d41fa Remove unused ahci_devclass. 2022-05-06 15:39:28 -07:00
John Baldwin
22a99a5272 age: Remove unused devclass argument to DRIVER_MODULE. 2022-05-06 15:39:28 -07:00
John Baldwin
27f71c5860 ae: Remove unused devclass argument to DRIVER_MODULE. 2022-05-06 15:39:28 -07:00
John Baldwin
8933f7d600 Remove unused mdio_devclass. 2022-05-06 15:39:28 -07:00
John Baldwin
3e38757d4c Remove unused miibus_devclass and miibus_fdt_devclass. 2022-05-06 15:39:28 -07:00
John Baldwin
916a5d8ad5 acpi: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:39:28 -07:00
John Baldwin
09fd3b43ad Remove isa_devclass from ISA bus drivers. 2022-05-06 15:39:28 -07:00
John Baldwin
43ac2b6d7c Remove isab_devclass from ISA bridge drivers. 2022-05-06 15:39:28 -07:00
John Baldwin
b69ec7a6bc aacraid: Remove unused devclass argument to DRIVER_MODULE. 2022-05-06 15:39:28 -07:00
John Baldwin
5a2ae6d050 aac: Remove unused devclass argument to DRIVER_MODULE. 2022-05-06 15:39:27 -07:00
John Baldwin
d5a7306c75 ata: Remove ata_devclass from DRIVER_MODULE invocations.
Keep the global variable for its uses in ata-pci.c and
chipsets/ata-fsl.c but initialize it in the existing
ata_module_event_handler.  Move the module event handler a bit earlier
to ensure the variable is set before any devices are attached.
2022-05-06 15:36:10 -07:00
John Baldwin
216ca4cee1 nvdimm_e820: Use driver->name in identify method.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D35077
2022-05-06 14:42:02 -07:00
John Baldwin
45dc8e3c2c nvdimm: Use devclass_lookup to find devclasses.
To avoid hardcoding the nvdimm driver name, move nvdimm_find_by_handle
below the definition of nvdimm_driver.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D35062
2022-05-06 14:41:42 -07:00
Mitchell Horne
ff1c8af8c3 vt: use TERMINAL_DECLARE_EARLY() macro
It simplifies the declaration of the driver structures a little. There
are no current consumers of this macro, in fact it looks like it was
added for exactly this purpose.

This decreases the scope of some variables, so rework the initialization
in vt_init_logos() such that it doesn't require them.

No functional change intended.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34820
2022-05-06 14:24:01 -03:00
Ruslan Bukin
0c0bfa0f6f Fix ofw_bus_iommu_map() since there is no limit on amount of maps
described in "iommu-map" DTS property.

Pointed out by:	rpokala
Sponsored by:	UKRI
2022-05-06 18:09:42 +01:00
Ruslan Bukin
0b6bacc787 Add ofw_bus_iommu_map() that maps PCI requester ID to an IOMMU
specifier based on "iommu-map" DTS property.

Sponsored by: UKRI
2022-05-06 16:48:04 +01:00
John Baldwin
51f481235c 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
2022-05-05 16:40:04 -07:00
John Baldwin
4942e8df47 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
2022-05-05 16:39:19 -07:00
John Baldwin
bb81a138c3 pbio: Axe bus_space tag/handle using bus_read/write_1 instead.
Differential Revision:	https://reviews.freebsd.org/D35079
2022-05-05 16:38:51 -07:00
John Baldwin
0db65574bb 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
2022-05-05 16:38:25 -07:00
John Baldwin
e4ec982c75 tdfx: Initialize tdfx_devclass via a module event handler.
Differential Revision:	https://reviews.freebsd.org/D35065
2022-05-05 16:37:38 -07:00
John Baldwin
ac56d90a49 ipmi: Use devclass_find to lookup ipmi devclass in ipmi_unload.
Differential Revision:	https://reviews.freebsd.org/D35061
2022-05-05 16:34:33 -07:00
John Baldwin
58d8316109 bhnd: Use devclass_find to lookup devclass for bhnd.
Differential Revision:	https://reviews.freebsd.org/D35058
2022-05-05 16:34:02 -07:00
John Baldwin
b483b6b256 cxgbe tom: Force unsigned modulus for queue indices.
The final transmit and receive queue indices need to be positive
values.  However, since txq_idx and rxq_idx are signed (to permit
using -1 to as a marker for uninitialized values), using %= with
another integer type (vi->nofld[tr]xq) yielded a sign-extended modulus
value.  This resulted in negative queue indices and a buffer underrun
when arc4random() returned a value with the sign bit set.  Use a
temporary unsigned variable to hold the "raw" queue index to force
unsigned modulus.

This worked previously because the modulus was previously applied
directly to the return value of arc4random() which is unsigned before
the result was assigned to txq_idx and rxq_idx.

Discussed with:	np
Fixes:		db28d4a0cd cxgbe/t4_tom: Support for round-robin selection of offload queues.
Sponsored by:	Chelsio Communications
2022-05-05 16:30:14 -07:00
Trev
601abb300c asmc: Add support for Macmini 5,1 (2011) and 5,3 and 7,1 (2014) models
PR:		262456
MFC after:	2 weeks
2022-05-04 11:31:01 -04:00
Mark Johnston
a31b0c0c47 asmc: Style
MFC after:	2 weeks
2022-05-04 11:31:01 -04:00
Daniel W. Delâtre
79291c9baf asmc: Add support for MacBook Pro 9,1 (mid 2012)
PR:		261981
MFC after:	2 weeks
2022-05-04 11:31:01 -04:00
Mark Johnston
27d4c6f86e asmc: Make the model table const and local to asmc.c
No functional change intended.

MFC after:	2 weeks
2022-05-04 11:31:01 -04:00
Adam S
7d5fef1837 asmc: Add support for MacPro 6,1 (2013)
PR:		260781
MFC after:	2 weeks
2022-05-04 11:31:01 -04:00
Mark Johnston
308340cce2 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>
MFC after:	2 weeks
2022-05-04 11:30:47 -04:00
Hans Petter Selasky
a1c0442b41 xhci(4): Tweak USB port speed checks to allow newer super speed generations.
This allows setting the U1 and U2 port timeout values.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-05-04 09:26:39 +02:00
Hans Petter Selasky
d730333c80 xhci(4): Properly define all basic USB port speeds.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-05-04 09:26:38 +02:00
Hans Petter Selasky
09dd1adfa4 xhci(4): Always add and evaluate the slot context.
Because the maximum number of endpoint contexts is stored there.

Tested by:	ehaupt@
PR:		262882
MFC after:	3 hours
Sponsored by:	NVIDIA Networking
2022-05-03 18:13:53 +02:00
Hans Petter Selasky
e276d28150 xhci(4): Only drop BULK and INTERRUPT endpoints to reset data toggle.
Only drop BULK and INTERRUPT endpoints, to reset the data toggle,
because for other endpoint types this is not critical.

Tested by:	ehaupt@
PR:		262882
MFC after:	3 hours
Sponsored by:	NVIDIA Networking
2022-05-03 18:13:53 +02:00
Hans Petter Selasky
d735d604f0 mlx5en(4): Use hard-coded 4K page size for RQ/SQ/CQ.
The page size specified for RQ, SQ and CQ is always in units of 4KBytes.
Make sure we subtract MLX5_ADAPTER_PAGE_SHIFT, 12, instead of PAGE_SHIFT
which may vary. This fixes support for using the mlx5en driver on systems
having non-4K page size.

Linux commit:
68cdf5d6e91068c98d6091b193dc7a5ab7dcf5eb

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-05-03 13:48:43 +02:00
Hans Petter Selasky
6eb6aeef7e uath(4): Fix incorrect byte-swapping and a buffer length check.
PR:			263638
Reported by:		Jeff Gibbons <jgibbons@protogate.com>
MFC after:		1 week
Sponsored by:		NVIDIA Networking
2022-04-30 11:23:07 +02:00
Warner Losh
ca420b4ef2 mpr/mps: when sending reset on removal, include target in message
It's possible for muliple drives to be departing at the same time (if
the common power rail the share goes dark, for example). To understand
what's going on better, include target and handle in the messages
announcing the reset to allow matching with other corresponding events.

MFC After:		3 days
Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D35092
2022-04-28 16:30:00 -06:00
Warner Losh
c5041b4ee8 mpr/mps: Add comment explaining state transition
When we can't load a request due to a shortage of chains, we complete
the command's cm. However, to avoid an assert in mp?_complete_command,
we transition its state to INQUEUE. This transition is legitimate
because this is the only error path that terminates a cm before it's
enqueued and the only other alternative would be an additional transient
state that would add complexity w/o adding value. Add a comment
explainging all this because otherwise the transition can look a bit
weird.

Sponsored by:		Netflix
2022-04-28 11:19:39 -06:00
Kornel Duleba
0923ff82fb Add USB ID and quirks for Huawei E3372
Set UQ_MSC_NO_INQUIRY and UQ_MSC_NO_GETMAXLUN quirks for mass storage,
which is the initial mode of this dongle.
The modem is shipped with at least two firmware versions: 10.X and 11.X,
without ability to update to the newer one.
The 11.X version works more or less fine, but the 10.X one resets after
receiving either an SCSI INQUIRY, or a get_max_lun command.
Since both of those are used for automatic quirk detection, this leads
to a reset cycle making the device somewhat unusable.

Sponsored by: Stormshield
Obtained from: Semihalf
Reviewed by: hps, wma
Differential Revision: https://reviews.freebsd.org/D35076
2022-04-28 08:42:30 +02:00
Kornel Duleba
3ee943868c usb: Respect NO_INQUIRY quirk during device enumeration
Both usb_iface_is_cdrom and usb_msc_auto_quirk functions use SCSI INQUIRY
command to probe various properties of usb mass storage devices.
The problem here is that some very broken devices don't like this command.
Check if UQ_MSC_NO_INQUIRY quirk is set and skip cdrom and quirk
autodetection in that case.

Sponsored by: Stormshield
Obtained from: Semihalf
Reviewed by: hps, wma
Differential Revision: https://reviews.freebsd.org/D35075
2022-04-28 08:42:26 +02:00
Justin Hibbits
e089492574 gpio/qoriq: Recognize another compatible string entry 2022-04-27 17:00:49 -05:00
Justin Hibbits
de6353ad8f gpiopower: Fix call to ofw_gpiobus_parse_gpios
Failure is denoted by -1, not non-zero.  A positive integer denotes the
number of pins mapped and configured.
2022-04-27 17:00:32 -05:00
John Baldwin
fa160738bd firewire: Initialize firewire_devclass in fw_modevent.
The use of devclass_get_softc() combined with cdev unit numbers is
probably not ideal (probably should be initializing si_drv1 when each
cdev is created instead), but it looks like a bit of a PITA to do, so
just initialize the devclass explicitly instead.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D35060
2022-04-27 12:26:05 -07:00
Henri Hennebert
8290c14420 rtsx: Number of tweaks for RTS5260.
MFC after:	2 weeks
2022-04-26 21:43:17 -04:00
John Baldwin
651a887f4e xen: Use devclass_find to lookup devclasses in identify.
While here, use driver->name instead of hardcoding the xenpv and
xen_et strings both for devclass_find() and BUS_ADD_CHILD().

Reviewed by:	Elliott Mitchell <ehem+freebsd@m5p.com>, imp, royger
Differential Revision:	https://reviews.freebsd.org/D35001
2022-04-25 11:55:30 -07:00
Kevin Lo
5586515ab1 Add a new RDC phy
Reviewed by:	jhb
Obtained from:	NetBSD via Andrius V
Differential Revision:	https://reviews.freebsd.org/D35034
2022-04-25 10:00:58 +08:00
Kevin Lo
8f216d282c Restore original MDC speed control register value after MAC reset, if it
wasn't default

Since vte_reset changes register value to MDCSC_DEFAULT value, which may not
be the original value, thus causing some phy registers read failures.
Restoring VTE_MDCSC value to original after reset solves the link state
flapping issue.

Thanks to jhb ("the code looks ok") for his review.
Reviewed by:	jhb
Obtained from:	NetBSD via Andrius V
Differential Revision:	https://reviews.freebsd.org/D34956
2022-04-25 09:56:20 +08:00
John Baldwin
618aa8cd0a qlxgb/qlxgbe/qlxge: Fix build without INET and/or without INET6.
This is in preparation for adding these drivers to amd64 NOTES.
2022-04-22 15:18:05 -07:00
Mateusz Guzik
f7daf71038 iwm: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-04-22 22:16:25 +00:00
John F. Carr
f010b9c2b9 pci: recognize "non-essential instrumentation" devices
Some AMD EPYC VCPUs generated boot message of the type:

     pci4: <unknown> at device 0.0 (no driver attached)

These are displayed for device class 0x13 devices, e.g.:

none8@pci0:130:0:0:	class=0x130000 rev=0x00 hdr=0x00 vendor=0x1022 \
			device=0x148a subvendor=0x1022 subdevice=0x148a
    vendor     = 'Advanced Micro Devices, Inc. [AMD]'
    device     = 'Starship/Matisse PCIe Dummy Function'
    class      = non-essential instrumentation

Since these devices serve no purpose (no driver attaches) I have
enabled the reporting of suich devices only for verbose boots (a
diversion from the patch provided in the PR).

A verbose boot will now display such devices as:

  pci4: <non-essential instrumentation> at device 0.0 (no driver attached)

PR:		263469
Reported by:	jfc@mit.edu (John F. Carr)
MFC after:	1 week
2022-04-22 16:39:23 +02:00