<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/isp/isp.c, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>http://cgit.freebsd.org/src/atom?h=main</id>
<link rel='self' href='http://cgit.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<updated>2024-06-25T14:56:12Z</updated>
<entry>
<title>isp: fix ISPCTL_ABORT_CMD switch case</title>
<updated>2024-06-25T14:56:12Z</updated>
<author>
<name>Mariusz Zaborski</name>
<email>oshogbo@FreeBSD.org</email>
</author>
<published>2024-06-25T14:50:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8aa9192ce98aec07b24f8279c709237dd2c4421b'/>
<id>urn:sha1:8aa9192ce98aec07b24f8279c709237dd2c4421b</id>
<content type='text'>
Prevent kernel panic by not running ISPCTL_FCLINK_TEST after a
failed ISPCTL_ABORT_CMD.

Reviewed by:	mav
Tested by:	Arne Steinkamm &lt;arne@steinkamm.com&gt;
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D45718
</content>
</entry>
<entry>
<title>Add an isp(4) tunable to default to ispfw(4) firmware.</title>
<updated>2024-06-24T20:47:55Z</updated>
<author>
<name>Kenneth D. Merry</name>
<email>ken@FreeBSD.org</email>
</author>
<published>2024-06-24T19:42:41Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=31354813f3c6e87532189be77c2f10a017c55472'/>
<id>urn:sha1:31354813f3c6e87532189be77c2f10a017c55472</id>
<content type='text'>
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:	&lt;https://reviews.freebsd.org/D45688&gt;
</content>
</entry>
<entry>
<title>Fix the isp(4) driver with 9.x firmware.</title>
<updated>2024-06-24T20:47:55Z</updated>
<author>
<name>Kenneth D. Merry</name>
<email>ken@FreeBSD.org</email>
</author>
<published>2024-06-21T19:30:59Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=137b004e2b7ab504abf98c4aad9d52607df47b9a'/>
<id>urn:sha1:137b004e2b7ab504abf98c4aad9d52607df47b9a</id>
<content type='text'>
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:	&lt;https://reviews.freebsd.org/D45660&gt;
</content>
</entry>
<entry>
<title>isp: Fix endianness conversion in isp_read_flash_data()</title>
<updated>2023-12-31T23:59:06Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2023-12-31T23:52:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=91d2a093dfaccdf288db663b6e9d47539ea1c1bf'/>
<id>urn:sha1:91d2a093dfaccdf288db663b6e9d47539ea1c1bf</id>
<content type='text'>
Reported by:	Jenkins
Fixes:	10ed63fc06cb ("isp(4): Rework firmware handling/loading")
</content>
</entry>
<entry>
<title>isp(4): Rework firmware handling/loading</title>
<updated>2023-12-28T18:33:07Z</updated>
<author>
<name>Joerg Pulz</name>
<email>Joerg.Pulz@frm2.tum.de</email>
</author>
<published>2023-10-27T15:27:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=10ed63fc06cb9902cc783ce8d0086c9aa97ed1e1'/>
<id>urn:sha1:10ed63fc06cb9902cc783ce8d0086c9aa97ed1e1</id>
<content type='text'>
Correctly identify the active firmware in flash on adapters with
primary and secondary firmware region in flash.
Correctly identify the active NVRAM on adapters with primary
and secondary NVRAM region in flash.

Loading ispfw(4) moved from isp_pci_attach() to isp_reset().
Drop the reference to ispfw(4) after using it so one can kldunload(8) it.
New isp_load_ram() function to load either ispfw(4) or flash firmware
into RISC's RAM.
New functions to read data from flash. The old ones will be removed later.
A bunch of new helper functions to identify and validate active flash
regions for firmware, auxiliary and NVRAM.
Overhaul ISP_FW_* macros and make use of it when comparing firmware
versions. We can handle firmware versions up to 255.255.255.

Firmware load priority slightly changed:
For 27xx and newer adapters:
- load ispfw(4) firmware
- request (active) flash firmware information
- compare version numbers of ispfw(4) and flash firmware
- load firmware with highest version into RISC's RAM
- if loading ispfw(4) is disabled or failed - load firmware from flash
- if everything else fails use MBOX_LOAD_FLASH_FIRMWARE as fallback

For 26xx and older adapters nothing changed:
- load ispfw(4) firmware and load it into RISC's RAM
- if loading ispfw(4) is disabled or failed use MBOX_EXEC_FIRMWARE
- for 26xx a preceding MBOX_LOAD_FLASH_FIRMWARE is used

New read only sysctl(8)'s:
 dev.isp.N.fw_version_run: the firmware version actually running
 dev.isp.N.fw_version_ispfw: the firmware version provided by ispfw(4)
 dev.isp.N.fw_version_flash: the (active) firmware version in flash

While here:
  - firmware attribute handling/parsing reworked
    + renamed defines from ISP2400_FW_ATTR_* to ISP_FW_ATTR_*
    + changed values to match new handling/parsing
    + added some more attributes
  - enable FLT support on 26xx based adapters
  - log level adjustments
  - new function return status codes (some for now, some for later use)
  - some minor style changes

Tested and approved to work on real hardware with:
  - Qlogic ISP 2532 (QLogic QLE2560 8Gb FC Adapter)
  - Qlogic ISP 2031 (QLogic QLE2662 16Gbit 2Port FC Adapter)
  - Qlogic ISP 2722 (QLogic QLE2690 16Gb FC Adapter)
  - Qlogic ISP 2812 (QLogic QLE2772 32Gbit 2Port FC Adapter)

PR:		273263
Reviewed by:	mav
Pull Request:	https://github.com/freebsd/freebsd-src/pull/877
MFC after:	1 month
Sponsored by:	Technical University of Munich
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-16T17:54:36Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:36Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=685dc743dc3b5645e34836464128e1c0558b404b'/>
<id>urn:sha1:685dc743dc3b5645e34836464128e1c0558b404b</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</content>
</entry>
<entry>
<title>isp(4): Style changes</title>
<updated>2023-07-07T21:45:30Z</updated>
<author>
<name>Joerg Pulz</name>
<email>Joerg.Pulz@frm2.tum.de</email>
</author>
<published>2023-07-07T21:43:35Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=348ec8dc036bf4ba1f607bb8acb25a0358436cc7'/>
<id>urn:sha1:348ec8dc036bf4ba1f607bb8acb25a0358436cc7</id>
<content type='text'>
Please tools/build/checkstyle9.pl as mentioned by imp@

PR: 271062
Reviewed by: imp, mav
Sponsored by: Technical University of Munich
Pull Request: https://github.com/freebsd/freebsd-src/pull/726
</content>
</entry>
<entry>
<title>isp(4): Remove redundant functions for reading data from FLT and flash</title>
<updated>2023-07-07T21:45:30Z</updated>
<author>
<name>Joerg Pulz</name>
<email>Joerg.Pulz@frm2.tum.de</email>
</author>
<published>2023-07-07T21:43:34Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=295fd9c1caeb42a4c93005080320d011bf01e4c0'/>
<id>urn:sha1:295fd9c1caeb42a4c93005080320d011bf01e4c0</id>
<content type='text'>
Rename isp_rd_2400_nvram to isp_rd_2xxx_flash.
Cleanup some leftovers.
Hide all output regarding FLT parsing behind ISP_LOGDEBUG0.

Thanks to imp@ and mav@ for reviewing and commenting.

PR: 271062
Reviewed by: imp, mav
Sponsored by: Technical University of Munich
Pull Request: https://github.com/freebsd/freebsd-src/pull/726
</content>
</entry>
<entry>
<title>isp(4): Use the FLT on all supported controllers</title>
<updated>2023-07-07T21:45:30Z</updated>
<author>
<name>Joerg Pulz</name>
<email>Joerg.Pulz@frm2.tum.de</email>
</author>
<published>2023-07-07T21:43:34Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=707e4d1b20aa3983f7cd2f444d6ce41eebc02698'/>
<id>urn:sha1:707e4d1b20aa3983f7cd2f444d6ce41eebc02698</id>
<content type='text'>
The ISP26xx based HBAs are left as is for now with static NVRAM addressing.
Those HBAs are known as 83xx (2031 and 8031 for real) and need special handling.
This is left for further investigation for now.

Cosmetics:
  - rename functions and defines as they are no longer specific to 28xx
  - set reasonable log levels
  - sort FLT and NVRAM functions (in the order they are used)

Tested and approved to work on real hardware with:
  - Qlogic ISP 2532 (QLogic QLE2562 8Gb 2Port FC Adapter)
  - Qlogic ISP 2722 (QLogic QLE2690 16Gb FC Adapter)
  - Qlogic ISP 2812 (QLogic QLE2772 32Gbit 2Port FC Adapter)

PR: 271062
Reviewed by: imp, mav
Sponsored by: Technical University of Munich
Pull Request: https://github.com/freebsd/freebsd-src/pull/726
</content>
</entry>
<entry>
<title>isp(4): Add support to read contents of the FLT (flash layout table)</title>
<updated>2023-07-07T21:45:30Z</updated>
<author>
<name>Joerg Pulz</name>
<email>Joerg.Pulz@frm2.tum.de</email>
</author>
<published>2023-07-07T21:43:34Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=27b4a1b7e5b871c248dc501aa359c93f7263b074'/>
<id>urn:sha1:27b4a1b7e5b871c248dc501aa359c93f7263b074</id>
<content type='text'>
The FLT is like a TOC for the flash area and contains entries for every flash
region with start/end address, size and flags.
Start using NVRAM addresses from FLT instead of hardcoded ones for ISP28xx
based HBAs.

The FLT should be available on earlier HBAs too, probably since ISP24xx based.
This needs further investigation and testing.

PR: 271062
Reviewed by: imp, mav
Sponsored by: Technical University of Munich
Pull Request: https://github.com/freebsd/freebsd-src/pull/726
</content>
</entry>
</feed>
