Commit graph

42517 commits

Author SHA1 Message Date
Keith Reynolds
a9376f5caf qlnxe: Allow MAC address override
The qlnxe driver always sets the NIC's rx mac address to the card's
default MAC, ignoring any MAC address set via ifconfig.

PR:		278085

(cherry picked from commit 792226e53023cb09566cb78b2135b052e9b62e0e)
2024-08-13 12:34:10 -07:00
Gordon Bergling
eac2a1edab axgbe: Fix two typos in source code comments
- s/specfied/specified/

(cherry picked from commit 619c9488a31ce14c6570d2e31f70d416382ed7a6)
2024-08-12 14:51:02 +02:00
Mark Johnston
aa937aa8c5 cxgbe: Flush transmitted packets more regularly in netmap mode
Previously, when transmitting short runs of packets via cxgbe_nm_tx(),
we would wait until a large number of packets were buffered before
scheduling a task to clean transmit buffers.

Obtained from:	np

(cherry picked from commit 6af3d59962449c66688361598163dd174cc5fb2a)
2024-08-08 15:55:48 +00:00
Konstantin Belousov
5b1211bb35 mlx5en: limit reporting eeprom read failure due to unplugged module to verboseboot
(cherry picked from commit 2204a4829083bf2a40304ea873d287a5498973d7)
2024-08-06 05:46:26 +03:00
Christos Margiolis
f2372d936d sound: Fix VCHANs' starting and ending points in feeder chain
sndstat(4) falsely reports "hardware" as the starting point of
recording, and ending point of playback VCHANs. Recording VCHANs get
their input from the primary recording channel, and playback VCHANs send
their input to the primary playback channel.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D46177

(cherry picked from commit b58d9db4d77a6f42ac7cf3cdb2af2443666033e2)
2024-08-04 15:09:35 +03:00
Dimitry Andric
646d5b96b4 Fix enum warning in iavf
This fixes a clang 19 warning:

    sys/dev/iavf/iavf_lib.c:514:39: error: comparison of different enumeration types ('enum virtchnl_vsi_type' and 'enum iavf_vsi_type') [-Werror,-Wenum-compare]
      514 |                 if (sc->vf_res->vsi_res[i].vsi_type == IAVF_VSI_SRIOV)
          |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~

The `vsi_type` field of `struct virtchnl_vsi_resource` is of type `enum
virtchnl_vsi_type`, not `enum iavf_vsi_type`. In this case, we can
seamlessly replace the value with `VIRTCHNL_VSI_SRIOV`, which is
numerically equal to `IAVF_VSI_SRIOV`.

MFC after:	3 days

(cherry picked from commit 67be1e195acfaec99ce4fffeb17111ce085755f7)
2024-08-04 12:21:33 +02:00
Dimitry Andric
4b521ea870 Fix enum warnings in qat
This fixes a number of clang 19 warnings:

    sys/dev/qat/qat_api/common/compression/dc_session.c:154:15: error: comparison of different enumeration types ('enum _CpaBoolean' and 'icp_qat_hw_compression_delayed_match_t') [-Werror,-Wenum-compare]
      154 |         if (CPA_TRUE == pService->comp_device_data.enableDmm) {
          |             ~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sys/dev/qat/qat_api/common/compression/dc_session.c:285:17: error: comparison of different enumeration types ('enum _CpaBoolean' and 'icp_qat_hw_compression_delayed_match_t') [-Werror,-Wenum-compare]
      285 |                     (CPA_TRUE == pService->comp_device_data.enableDmm) ?
          |                      ~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The `enableDmm` field of variable `comp_device_data` is of type
`icp_qat_hw_compression_delayed_match_t`, not `CpaBoolean`. In this
case, we can seamlessly replace the value with
`ICP_QAT_HW_COMPRESSION_DELAYED_MATCH_ENABLED`, which is numerically
equal to `CPA_TRUE`.

MFC after:	3 days

(cherry picked from commit 357378bbdedf24ce2b90e9bd831af4a9db3ec70a)
2024-08-04 12:21:28 +02:00
Dimitry Andric
7ffa2d91fb Fix enum warning in isci
This fixes a clang 19 warning:

    sys/dev/isci/scil/scif_sas_smp_remote_device.c:197:26: error: comparison of different enumeration types ('SCI_IO_STATUS' (aka 'enum _SCI_IO_STATUS') and 'enum _SCI_STATUS') [-Werror,-Wenum-compare]
      197 |    if (completion_status == SCI_FAILURE_RETRY_REQUIRED)
          |        ~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~

The `completion_status` variable is of type `SCI_IO_STATUS`, not
`SCI_STATUS`. In this case, we can seamlessly replace the value with
`SCI_IO_FAILURE_RETRY_REQUIRED`, which is numerically equal to
`SCI_FAILURE_RETRY_REQUIRED`.

MFC after:	3 days

(cherry picked from commit 1bd66fac35ec27fa64d6158f82fdcbdc26098679)
2024-08-04 12:21:16 +02:00
Vladimir Kondratyev
ef2a82120f LinuxKPI: Add min_not_zero() to linux/minmax.h
It returns the minimum that is not zero, except both equals to zero.

Sponsored by:	Serenity Cyber Security, LLC
MFC after:	1 week
Reviewed by:	bz, emaste, ssaxena
Differential Revision:	https://reviews.freebsd.org/D45450
Differential Revision:	https://reviews.freebsd.org/D45451

(cherry picked from commit 07c7c41ca1e31c20c2e2d8fb68c148f521831e4d)
2024-08-02 00:09:39 +03:00
Adam Retter
dbb6f488df hda: add support for Tiger Lake-H
PR:		272682
Reported by:	Miguel Salcedo
Reviewed by:	emaste

(cherry picked from commit fb1028dcd4aedc4d48dbd97314f008c663b2e711)
2024-08-01 13:34:50 -04:00
Ed Maste
35957d27ea iichid: Soften "Interrupt setup failed" message
Users may interpret the message as a possible hardware error, but the
issue is in fact unimplemented functionality.  Reword the message to
avoid implying it is an error.

Reviewed by:	wulf
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46092

(cherry picked from commit 0ac6cc3fd7473a7a8596fa73322a67fc1d78df53)
2024-08-01 12:10:26 -04:00
Emmanuel Vadot
82829e49e6 vt: splash: Use splash screen passed from loader
If loader(8) gives use a splash screen to use using the MODINFOMD_SPLASH
type, use it if RB_MUTE is set to "YES".
By design only argb data will be displayed.

Differential Revision:	https://reviews.freebsd.org/D45931
Reviewed by:		imp, tsoome
Sponsored by:		Beckhoff Automation GmbH & Co. KG

(cherry picked from commit f6e8b0e85081681100bf9cd74423be02233204bc)
2024-07-29 18:37:44 +02:00
Emmanuel Vadot
01215ffec6 vt: Add vd_bitblt_argb
This blit an ARGB image on the dedicated vd.
This also adds vt_fb_bitblt_argb which will works for most of the vt backends

Differential Revision:	https://reviews.freebsd.org/D45929
Reviewed by:		tsoome
Sponsored by:		Beckhoff Automation GmbH & Co. KG

(cherry picked from commit b93028d8cd3aafc883b5f0ecec65a8a2a30af7f3)
2024-07-29 18:37:12 +02:00
Christos Margiolis
a9e27006db sound: Simplify feeder_remove()
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D46100

(cherry picked from commit 00172d20070a544e0514cce9f94475c5525fd15e)
2024-07-29 18:34:55 +03:00
Christos Margiolis
9b5e6dfe18 sound: Remove unused defines from pcm/sound.h
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D45986

(cherry picked from commit f477d412530a8cb9d8e058d00189ce127584f6f6)
2024-07-29 18:34:55 +03:00
Christos Margiolis
a619d8c76c sound: Simplify chn_init()
- Remove unnecessary CHN_[UN]LOCKs.
- Improve device_printf() messages.
- Remove redundant checks.
- Remove 0 assignments, since the channel is allocated with M_ZERO.
- Re-organize sections in a more coherent way.
- Remove "out1" label, just return NULL directly.
- Rename "out2" to "fail" and simplify logic.
- Do not check the return value of dsp_unit2name(), as it is guaranteed
  not to fail (we pass a valid channel type).

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45985

(cherry picked from commit 5b209e153b58515c0315f5902e18ecd7d75ecd2a)
2024-07-29 18:34:55 +03:00
Christos Margiolis
cbbc1f5db1 sound: Remove unused FEEDER_DEBUG
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D45984

(cherry picked from commit c55f995502cbaa2d38b7a7003bc27805b28a6a29)
2024-07-29 18:34:55 +03:00
Christos Margiolis
8f685b1f1f sound: Rename chn_* feeder functions to feeder_*
Avoid layering violation. No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45983

(cherry picked from commit 29ff7b08be363f0d4345794bb951d5c0c8406a0a)
2024-07-29 18:34:55 +03:00
Christos Margiolis
6716cc7e27 sound: Fix memory leak in chn_init()
In case chn_init() fails, we are leaking memory by not freeing the
feeder.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D45979

(cherry picked from commit 16329b7b3276f09dc70bdd1ca8bc605546fe71e0)
2024-07-29 18:34:54 +03:00
Christos Margiolis
1ff260a6e1 sound: Implement dummy driver
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45967

(cherry picked from commit c15c9315b2cb7601cc337f7d5a8e124f4b2d5861)
2024-07-29 18:34:54 +03:00
Christos Margiolis
188d619e45 sound: Add OSS channel capabilities to sndstat nvlist
Assignment taken from dsp_oss_engineinfo().

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46166

(cherry picked from commit bd5bcc848c5764229926ad27a4bd77af4f87d189)
2024-07-29 18:34:54 +03:00
Christos Margiolis
08c1cf0b52 sound: Add *vchanrate and *vchanformat to sndstat nvlist
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46164

(cherry picked from commit a6283717577066b0ff6c62053145470ff4134051)
2024-07-29 18:34:54 +03:00
Christos Margiolis
894edb7cb1 sound: Add device status string to sndstat nvlist
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46163

(cherry picked from commit 810530aa2648812860e84d951d9cf96dfd24e595)
2024-07-29 18:34:53 +03:00
Florian Walpen
12f6e0a4d2 snd_hdspe(4): Recognize newer firmware's PCI vendor id.
At least for HDSPe RayDAT cards, newer firmware comes with RME's own PCI
vendor id instead of the Xilinx one. Other HDSPe cards are probably also
affected. Update snd_hdspe(4) to recognize both the old Xilinx and the
new RME vendor ids.

Differential Revision:	https://reviews.freebsd.org/D44978
MFC after: 1 day

(cherry picked from commit 9718d4ab99386918f5b5c207c58289eaade20623)
2024-07-28 21:23:07 +01:00
Mark Johnston
030cbcc4c2 if_urndis: Organize buffer layouts more naturally
- Group the request header and I/O buffer in one structure, rather than
  assuming that both request structures have the same size.
- Pass a pointer to the whole structure to urndis_ctrl_query() and
  urndis_ctrl_set() rather than just the header.  Otherwise, on CHERI
  platforms, these functions violate subobject bounds since they modify
  the buffer following the header.

While here, there is no apparent reason for the request structure used
in urndis_attach() to be allocated statically.  Change it so that it's
allocated on the stack.

No functional change intended.

Reviewed by:	jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D45866

(cherry picked from commit 5dc4682c32691b9d0a20abdc5479d6ce2b36915e)
2024-07-23 09:01:37 -04:00
John Baldwin
4ba4cfaf9f acpi: Narrow workaround for broken interrupt settings on x86
Commit 9a7bf07ccd from 2016 introduced a workaround for some broken
BIOSes that specified active-lo instead of active-hi polarity for ISA
IRQs for UARTs.  The workaround assumed that edge-sensitive ISA IRQs
on x86 should always be active-hi.  However, some recent AMD systems
actually use active-lo edge-sensitive ISA IRQs (and not just for
UARTs, but also for the keyboard and PS/2 mouse devices) and the
override causes interrupts to be dropped resulting in boot time hangs,
non-working keyboards, etc.

Add a hw.acpi.override_isa_irq_polarity tunable (readable as a sysctl
post-boot) to control this quirk.  It can be set to 1 to force enable
the override and 0 to disable it.  The log of original message
mentions an Intel motherboard as the sample case, so default the
tunable to 1 on systems with an Intel CPU and 0 otherwise.

Special thanks to Matthias Lanter <freebsd@lanter-it.ch> for tracking
down boot time issues on recent AMD systems to mismatched interrupt
polarity.

PR:		270707
Reported by:	aixdroix_OSS@protonmail.com, Michael Dexter
Reported by:	mfw_burn@pm.me, Hannes Hfauswedell <h2+fbsdports@fsfe.org>
Reported by:	Matthias Lanter <freebsd@lanter-it.ch>
Reported by:	William Bulley <web@umich.edu>
Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45554

(cherry picked from commit 0a34d050ae8ea14feddd3d2a62fd2f612613b2c5)
2024-07-22 15:54:14 -04:00
Mark Johnston
f48bfa248f axgbe: Remove a nonsensical use of kernel_sysctlbyname()
No functional change intended.

MFC after:	1 week

(cherry picked from commit d254651de392538fa7f5c0020093dde0ca06c614)
2024-07-21 20:55:28 -04:00
Mark Johnston
239c9c6de1 hptiop: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 1c64b3aba3d0e2910ac52c18e3c240348eb3e36e)
2024-07-21 20:55:27 -04:00
Navdeep Parhar
60bf442ee2 cxgbe(4): Do not report link state change during interface detach.
This fixes a panic when multiple VIs are configured on an interface and
only the non-primary VI is up at the time of driver detach.  The problem
was that the driver would queue a link state change notification for an
interface about to be freed.

To reproduce the panic, add "hw.cxgbe.num_vis=2" to loader.conf and

 # kldload if_cxgbe
 # ifconfig vcc0 up
 # devctl detach t6nex0

  trap 0x9, rip = 0xffffffff8107db70, rsp = 0xfffffe0055263d60, rbp = 0xfffffe0055263dd0
  taskqueue_run_locked() at taskqueue_run_locked+0x2a0/frame 0xfffffe0055263dd0
  taskqueue_run() at taskqueue_run+0x72/frame 0xfffffe0055263df0
  taskqueue_swi_run() at taskqueue_swi_run+0x18/frame 0xfffffe0055263e10
  intr_event_execute_handlers() at intr_event_execute_handlers+0x249/frame 0xfffffe0055263e50
  ithread_execute_handlers() at ithread_execute_handlers+0x9e/frame 0xfffffe0055263e70

Reviewed by:	jhb
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D45864

(cherry picked from commit dc20d49aa939caea365cbdf0341b00de69253be4)
2024-07-16 23:40:13 -07:00
Navdeep Parhar
8d214aa2c1 cxgbe(4): Consolidate all mk_set_tcb_field_ulp in one place.
Sponsored by:   Chelsio Communications

(cherry picked from commit 64a00f877fc23d904d5f4ca00471e09954eb9381)
2024-07-16 23:39:43 -07:00
Navdeep Parhar
307639c1e9 cxgbe(4): sc->port is indexed by port_id and not tx_chan.
Sponsored by:	Chelsio Communications

(cherry picked from commit cca3506dc15464baf9b09b143879ed13fb5684c7)
2024-07-16 23:39:32 -07:00
Navdeep Parhar
29791662e9 cxgbe/tom: Fix the rx channel selection in options2.
This affects TOE operation when multiple rx c-channels are in use for
offload, which is an unusual configuration.

Sponsored by:	Chelsio Communications

(cherry picked from commit c6c6d4aff90da83a292b4c2bbbe1f4d6e01cd82e)
2024-07-16 23:39:13 -07:00
Navdeep Parhar
c0b69999b1 cxgbe(4): Query TPCHMAP once and not once per port.
Sponsored by:	Chelsio Communications

(cherry picked from commit 7f10048f983a31c09587b436e7fb073f7cbb76e4)
2024-07-16 23:38:57 -07:00
Navdeep Parhar
0ca32f02de cxgbe(4): Rename rx_c_chan to rx_chan.
It is the equivalent of tx_chan but for receive so rx_chan is a better
name.  Initialize both using helper functions and make sure both are
displayed in the sysctl MIB.

Sponsored by:	Chelsio Communications

(cherry picked from commit 480ff89c67b25113515018cdcd13179229b4a0d3)
2024-07-16 23:38:40 -07:00
Navdeep Parhar
5af25b6e4d cxgbe(4): Minor tweaks to comments.
No functional change intended.

Sponsored by:	Chelsio Communications

(cherry picked from commit 21aba396551e29808fa56a6d4fab17e871c3524f)
2024-07-16 23:38:18 -07:00
Navdeep Parhar
67faf45be5 cxgbe(4): Initialize mps_bg_map to an invalid value if it's not known.
Sponsored by:	Chelsio Communications

(cherry picked from commit 9de0036b55dcdabc54fa69ea6e583b22d739818c)
2024-07-16 23:38:00 -07:00
Navdeep Parhar
92383a2c84 cxgbe(4): Do not read hardware registers to determine the number of ports.
PORTVEC obtained from the firmware is the authoritative source of this
information, and nports (calculated from PORTVEC) is available by the
time t4_port_init runs.

Sponsored by:	Chelsio Communications

(cherry picked from commit 4d1362cdc7375984a48f5f0048b1fe909524d21d)
2024-07-16 23:37:39 -07:00
Navdeep Parhar
e5efc8cf5d cxgbe(4): Allocate a taskqueue per port instead of per channel.
All the channels are not used on all boards and there's no point
allocating taskqueues that will never be used.

Sponsored by:	Chelsio Communications

(cherry picked from commit 857d74b6340e418396d79a46b264ce0eedd760e4)
2024-07-16 23:37:25 -07:00
Navdeep Parhar
a238d1b045 cxgbe(4): Shared code update to deal with partial failure in query_params.
Obtained from:	Chelsio Communications
Sponsored by:	Chelsio Communications

(cherry picked from commit 2965ae59144177eb3570721295da9cbc447f1105)
2024-07-16 23:37:03 -07:00
Navdeep Parhar
b67afd194c cxgbe(4): Reword the comment explaining the atid/cookie split.
Avoid a magic constant while here.  No functional change intended.

Sponsored by:	Chelsio Communications

(cherry picked from commit 43f6f08488046788b0ad66e9a5119f36e5de71ab)
2024-07-16 23:36:39 -07:00
Navdeep Parhar
d80e7fca01 cxgbe(4): Add missing description for a port type.
Sponsored by:	Chelsio Communications

(cherry picked from commit f0ee6112eb61a5130acedd20d9827627c0975fba)
2024-07-16 23:36:16 -07:00
Navdeep Parhar
6bc34cdd96 cxgbe(4): Retire t4_intr_clear.
The firmware clears the interrupts already and it has a better idea of
exactly what to clear for which generation of the ASIC.  There is no
need for the driver to get involved.

Sponsored by:	Chelsio Communications

(cherry picked from commit 1c7f9c8b4673abf3723be09afed4443261e0d186)
2024-07-16 23:35:55 -07:00
Navdeep Parhar
41309c878d cxgbe(4): Add a helper function to locate MPS/MAC registers.
These register blocks are at different locations in different chips.

Sponsored by:   Chelsio Communications

(cherry picked from commit b59c5d97edf17525405d95b1f5746c4a79a9c7c4)
2024-07-16 23:35:30 -07:00
Navdeep Parhar
1089f5755e cxgbe(4): Remove tx_modq lookup table.
The driver always uses the same modulation queue as the channel and the
table is unnecessary.

Sponsored by:   Chelsio Communications

(cherry picked from commit f76effed14b25bfa0c47b10f6d8a076104c48d94)
2024-07-16 23:27:14 -07:00
Kenneth D. Merry
44ca5d40f3 Add an isp(4) tunable to default to ispfw(4) firmware.
ispfw(4) recently gained firmware for Qlogic 27XX and 28XX
FC controllers, and isp(4) now selects the newer of firmware in
flash or in ispfw(4) to load for those controllers.

This differs from the previous behavior (which remains for older
controllers), which was to always load the ispfw(4) firmware if it
is available.

This adds a loader tunable, hint.isp.N.fwload_force to default to
loading the ispfw(4) firmware, whether or not it is newer than the
firmware in flash.  This allows the user to always use the known
firmware version included with the kernel.

Note that there is an existing fwload_disable tunable that tells
the driver to always load the firmware from flash and ignore
ispfw(4).  If fwload_disable is set, fwload_force will be ignored.
So users with existing fwload_disable tunables will have the same
behavior.

If a user specifies both fwload_force and fwload_disable for the
same controller, the isp(4) driver prints a warning message,
and fwload_disable will be honored.

The user can see which firmware is active through the
dev.isp.N.fw_version* sysctl variables.

share/man/man4/isp.4:
	Document the new loader tunable.

sys/dev/isp/isp.c:
	In isp_load_risc_flash(), changet the decision logic to
	also consider ISP_CFG_FWLOAD_ONLY.  Load the flash firmware
	and get the version, so the user knows what it is, but if
	the user set fwload_force, honor that.  If the user didn't
	set fwload_force, the behavior remains to select the newer
	firmware version.

sys/dev/isp/isp_pci.c:
	Add a new fwload_force tunable.  Print out a warning if the
	user sets both fwload_disable and fwload_force.

sys/dev/isp/ispvar.h:
	Add a new ISP_CFG_FWLOAD_FORCE configuration bit.

Reviewed by:	mav
MFC after:	1 week
Sponsored by:	Spectra Logic
Differential Revision:	<https://reviews.freebsd.org/D45688>

(cherry picked from commit 31354813f3c6e87532189be77c2f10a017c55472)
2024-07-16 16:06:39 -04:00
Kenneth D. Merry
ff9458b30f Fix the isp(4) driver with 9.x firmware.
The isp(4) driver (and ispfw(4) firmware) previously only included
firmware for Qlogic controllers up to 8Gb.  It recently gained
firmware for the 27XX and 28XX series controllers along with
improved firmware loading capabilities.

The 9.x firmware available for the 27XX and 28XX controllers in
ispfw(4) adds login state for NVMe devices in the top nibble of
the login state in the port database (isp_pdb_24xx_t in ispmbox.h).

This breaks the check at the end of isp_getpdb() to make sure the
device is in the right login state.  As a result, it breaks device
discovery for many (perhaps all?) FC devices.  In my testing with
IBM LTO-6 drives attached to a quad port 16Gb Qlogic 2714, they
don't show up when they are directly connected (and in loop mode)
or connected via a switch (and in fabric mode).

So, mask off the top bits of of the login state before checking it.
This shouldn't break anything, because all of the existing login
states defined in ispmbox.h are in the low nibble.

sys/dev/isp/ispmbox.h:
	Add a FCP login state mask define, and a NVMe login state
	shift.

sys/dev/isp/isp.c:
	In isp_getpdb(), make sure we're only looking at the FCP
	login state bits when we try to determine whether a device
	is in the right login state.

MFC after:	1 week
Sponsored by:	Spectra Logic
Reviewed by:	mav
Differential Revision:	<https://reviews.freebsd.org/D45660>

(cherry picked from commit 137b004e2b7ab504abf98c4aad9d52607df47b9a)
2024-07-16 16:04:29 -04:00
Andrew Turner
dfd26e29dd dev/hwpmc: Fix the dmc620 MD4 macro
Add braces to the dmc620 MD4 macro to fix the GCC build.

Reviewed by:	brooks, imp, jhb
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45266

(cherry picked from commit 131c1718c6331e87f139b42b4ad0e57b6a71ea44)
2024-07-15 12:27:45 +00:00
Andrew Turner
0496539fe3 pci: Fix pci_host_generic_acpi with gcc
In pci_host_generic_acpi.c we loop over pci_acpi_quirks to check if
we need to handle any quirks. GCC doesn't like the terminatin as it
sets a fixed width string to 0.

As this the array is only ever used in this file change to use nitems
to find when to stop the loop.

Reviewed by:	brooks, imp, jhb, emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45265

(cherry picked from commit f55e866488ba2d8bb5b79659ee84bec1fe7808fb)
2024-07-15 12:27:37 +00:00
Andrew Turner
ab44e45862 dev/psci: Check all compat strings
When searching for the PSCI FDT node we only check a few compat strings.
Use the existing compat_data array to check all strings the driver may
attach to.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D44913

(cherry picked from commit f91e9401c2098ba56f43093ef9747d0b1f60f8eb)
2024-07-15 12:24:30 +00:00
Gordon Bergling
4779a4dde7 ocs_fc(4): Fix a typo in a kernel message
- s/elasped/elapsed/

(cherry picked from commit 6ea81bcaf8adcf6a8546407e93e97f3d920396d2)
2024-07-13 19:08:38 +02:00