Home | History | Annotate | Download | only in pci
History log of /src/sys/dev/pci/mfii.c
RevisionDateAuthorComments
 1.32  13-Feb-2024  msaitoh mfii(4): Apply two changes from OpenBSD to fix an unknown firmware state.

My own MegaRAID 946N-8i 2G", firmware 50.5.0-2594 failed to attach.

mfii0: unknown firmware state 1879048192

1879048192 equals to 0x70000000(== MFI_STATE_FW_INIT_2).
Apply following two OpenBSD commits to resolve this problem.
 1.31  05-Oct-2023  christos provide a separate pointer that points to the drive sensors (Edgar Fuss)
 1.30  23-Sep-2023  christos When attaching and detaching disks, use the proper index, skipping the
first 4, which are used for the controller itself (Edgar Fuss)
 1.29  22-Sep-2023  christos update present variable when disks are added or removed (Edgar Fuss)
 1.28  29-Sep-2022  bouyer Convert from pci_intr_map() to pci_intr_alloc(); makes the driver use
MSI/MSI-x when available. Tested by Edgar Fu�.
 1.27  14-Sep-2022  msaitoh mfii: Don't panic on detach.

Call sysmon_envsys_destroy() and clear sc->sc_sme to NULL if
sysmon_envsys_register failed.
 1.26  16-Jul-2022  msaitoh Enable Aero.
 1.25  16-Jul-2022  msaitoh It seems that a logical volume number and the target ID is different
on newer systems. It's observed on an Aero. Add sc->sc_ld[X].ld_target_id
to keep the target ID and use it for scsipi layer. Now sdX is attached
on Aero system. Tested by Mark Davies.
 1.24  16-Jul-2022  msaitoh Add max 256 VD support.
 1.23  09-Jul-2022  msaitoh Add preliminary support for Aero.

- Aero supports 32bit descriptor.
- Even if the Aero card supports 32bit descriptor, 64bit descriptor
access is required for MFI_CMD_INIT.
- Add quirk for Aero to retry register read.
- The PCI ID table for Aero is disabled. Even if it's enabled, any logical
volumes are not found. Perhaps the reason is that our mfii driver is
currently not supports more than 64 logical volumes and MR_DCMD_LD_GET_LIST
returns incorrect value. Tested by Mark Daies' H750.
 1.22  09-Jul-2022  msaitoh Use bus_space_write_8() if available.
 1.21  09-Jul-2022  msaitoh Modify strange bus_space_barrier().
 1.20  29-Jun-2022  msaitoh Add CVPM02 BBU support.
 1.19  27-Jun-2022  msaitoh KNF a little. No functional change.
 1.18  27-Jun-2022  msaitoh Add some MegaRAID devices (except Aero series). Not tested.
 1.17  27-Jun-2022  msaitoh Add comment. Sort entries. No functional change.
 1.16  22-Jun-2022  msaitoh Fix wrong access in mfii_start(). I hope this fixes kern/55192 and kern/56669.
 1.15  13-May-2022  msaitoh Fix compile error when MFII_DEBUG is set. Whitespace fix.
 1.14  12-May-2022  msaitoh Use IBBU's data structure for iBBU-09.
 1.13  11-May-2022  msaitoh Add support for iBBU-09 to show BBU voltage, current and temp correctly.
 1.12  11-May-2022  msaitoh mfii(4): Set stripe size correctly for BIOCVOL. Same as mfi.c rev. 1.75.
 1.11  07-May-2022  msaitoh Use mlp_bgi for MFI_LD_PROG_BGI. Same as OpenBSD.
 1.10  05-May-2022  msaitoh Whitespace.
 1.9  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.8  24-Apr-2021  thorpej branches: 1.8.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.7  14-May-2020  msaitoh branches: 1.7.4;
Remove extra semicolon.
 1.6  27-Nov-2019  maxv localify
 1.5  10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.4  24-Apr-2019  bouyer branches: 1.4.2; 1.4.4;
Clean up timeout logic. Now the system survives to a ccb timeout; before
the filesystem would stall because one I/O did never completes.
 1.3  03-Dec-2018  bouyer branches: 1.3.2;
Update the mpii(4) driver to the latest OpenBSD version.
This adds support for the SAS3xxx LSI controllers, and this also makes the
driver MP-safe.
adjust mfii.c for changes in mpiireg.h

Tested with a
mpii0: SMC2008-IR, firmware 9.0.0.0 IR, MPI 2.0
 1.2  24-Nov-2018  bouyer branches: 1.2.2;
Add my name in copyright list
 1.1  24-Nov-2018  bouyer Add mpii(4), a driver for LSI Megaraid Fusion controllers.
Ported from OpenBSD. This driver is MP-safe.
Note that the earlier fusion controllers (Megaraid 2208, codenamed Thunderbold)
are also supported by mfi(4). mpii will take precedence if both drivers
are enabled.
Tested on a
mfii0 at pci6 dev 0 function 0: "PERC H740P Adapter ", firmware 50.3.0-1512, 819
2MB cache
mfii0: interrupting at ioapic2 pin 2
scsibus0 at mfii0: 64 targets, 8 luns per target
scsibus0: waiting 2 seconds for devices to settle...
sd0 at scsibus0 target 0 lun 0: <DELL, PERC H740P Adp, 5.03> disk fixed
sd0: fabricating a geometry
sd0: 99 GB, 102399 cyl, 64 head, 32 sec, 512 bytes/sect x 209714688 sectors
sd0: tagged queueing
sd1 at scsibus0 target 1 lun 0: <DELL, PERC H740P Adp, 5.03> disk fixed
sd1: fabricating a geometry
sd1: 22254 GB, 22788608 cyl, 64 head, 32 sec, 512 bytes/sect x 46671069696 sectors
sd1: fabricating a geometry

It supports bioctl(8) ioctls, as well as sensors for the BBU and logical
drives.

Sponsored by LIP6.
 1.2.2.3  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.2.2.2  26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.2.2.1  24-Nov-2018  pgoyette file mfii.c was added on branch pgoyette-compat on 2018-11-26 01:52:32 +0000
 1.3.2.7  29-Sep-2022  snj Pull up following revision(s) (requested by bouyer in ticket #1768):
sys/dev/pci/mfii.c: 1.28
Convert from pci_intr_map() to pci_intr_alloc(); makes the driver use
MSI/MSI-x when available. Tested by Edgar Fu?.
 1.3.2.6  16-Sep-2022  martin Pull up the following, requested by msaitoh in ticket #1764:

sys/dev/ic/mfireg.h 1.22
sys/dev/pci/mfii.c 1.16-1.22,1.27 via patch
share/man/man4/mfii.4 1.3 via patch

- Fix wrong access in mfii_start().
- Add SAS3216,SAS3224,SAS3316 and SAS3324 support.
- Add CVPM02 BBU support.
- Use bus_space_write_8() if available.
- Don't panic on detach if no any sensor device.
- Add comment. Sort entries. KNF.
 1.3.2.5  17-May-2022  bouyer Pull up following revision(s) via patch (requested by msaitoh in ticket #1454):
sys/dev/ic/mfi.c: revisions 1.63, 1.66-77
sys/dev/ic/mfireg.h: revisions 1.11-1.20 via patch
sys/dev/pci/mfi_pci.c: revision 1.21
sys/dev/pci/mfii.c: revisions 1.6-1.7, 1.10-1.15
share/man/man4/mfi.4: revision 1.13

Improve mfi(4) and mfii(4):
- Set 'ld_sync' to NULL as part of 'again', to prevent use-after-free.
- Add some code for the SKINNY variant to make Dell PERC H310 work.
- Print the percentage correctly when the background initialization is
running.
- Clear mailbox to not to pass garbage data.
- Use union mbox instead of unit8_t xxx[] to avoid unaligned access.
- Set stripe size for BIOCVOL to show the size correctly in bioctl.
- Add support for iBBU-09 to show BBU voltage, current and temperature
correctly.
- Fix typos in comments.
- Sprinkle static.
- Improve debug printf()s.
- KNF. Remove extra semicolon. Whitespace fixes.
 1.3.2.4  26-Apr-2019  martin Pull up following revision(s) (requested by bouyer in ticket #1247):

sys/dev/pci/mfii.c: revision 1.4

Clean up timeout logic. Now the system survives to a ccb timeout; before
the filesystem would stall because one I/O did never completes.
 1.3.2.3  08-Dec-2018  martin Pull up following revision(s) (requested by bouyer in ticket #1131):

sys/dev/pci/mpiireg.h: revision 1.2
sys/dev/pci/mfii.c: revision 1.3
share/man/man4/mpii.4: revision 1.3
share/man/man4/mpii.4: revision 1.4
sys/dev/pci/mpii.c: revision 1.15
sys/dev/pci/mpii.c: revision 1.16
sys/dev/pci/mpii.c: revision 1.17
sys/dev/pci/mpii.c: revision 1.18

Update the mpii(4) driver to the latest OpenBSD version.

This adds support for the SAS3xxx LSI controllers, and this also makes the
driver MP-safe.

adjust mfii.c for changes in mpiireg.h

Tested with a
mpii0: SMC2008-IR, firmware 9.0.0.0 IR, MPI 2.0
Update for the new mpii(4) driver, mostly from OpenBSD.

Also tell the scsi layer that we are MPSAFE

Remove trailing whitespace

NULL-terminate mpii_devices[], this is the end condition of the loop
in mpii_match(). Noticed by Mike Pumford

There's no sensors for physical disks so don't try to detach them.
 1.3.2.2  07-Dec-2018  martin Pull up following revision(s) (requested by bouyer in ticket #1129):

sys/arch/amd64/conf/XEN3_DOM0: revision 1.159
sys/arch/amd64/conf/GENERIC: revision 1.508
sys/arch/i386/conf/ALL: revision 1.458
sys/dev/ic/mfi.c: revision 1.60
sys/dev/pci/mpiireg.h: revision 1.1
distrib/sets/lists/man/mi: revision 1.1628
sys/dev/pci/mfii.c: revision 1.1,1.2 (adapted)
sys/arch/i386/conf/GENERIC: revision 1.1194
sys/dev/pci/mpii.c: revision 1.13
sys/dev/ic/mfireg.h: revision 1.9
share/man/man4/mfii.4: revision 1.1
share/man/man4/Makefile: revision 1.673 (patch)
sys/dev/pci/files.pci: revision 1.410
share/man/man4/mfii.4: revision 1.2
sys/arch/amd64/conf/ALL: revision 1.108
sys/arch/i386/conf/XEN3PAE_DOM0: revision 1.8 (patch, in XEN3_DOM0)

Add some definitions from OpenBSD, needed by the upcoming mfii driver.
No functionnal change.

-

Move registers definitions to a separate file, needed for the upcomning mpii
driver. No functionnal change.

-

Add mpii(4), a driver for LSI Megaraid Fusion controllers.
Ported from OpenBSD. This driver is MP-safe.

Note that the earlier fusion controllers (Megaraid 2208, codenamed Thunderbold)
are also supported by mfi(4). mpii will take precedence if both drivers
are enabled.

Tested on a
mfii0 at pci6 dev 0 function 0: "PERC H740P Adapter ", firmware 50.3.0-1512, 819
2MB cache
mfii0: interrupting at ioapic2 pin 2
scsibus0 at mfii0: 64 targets, 8 luns per target
scsibus0: waiting 2 seconds for devices to settle...
sd0 at scsibus0 target 0 lun 0: <DELL, PERC H740P Adp, 5.03> disk fixed
sd0: fabricating a geometry
sd0: 99 GB, 102399 cyl, 64 head, 32 sec, 512 bytes/sect x 209714688 sectors
sd0: tagged queueing
sd1 at scsibus0 target 1 lun 0: <DELL, PERC H740P Adp, 5.03> disk fixed
sd1: fabricating a geometry
sd1: 22254 GB, 22788608 cyl, 64 head, 32 sec, 512 bytes/sect x 46671069696 sectors
sd1: fabricating a geometry

It supports bioctl(8) ioctls, as well as sensors for the BBU and logical
drives.

Sponsored by LIP6.

-

Add my name in copyright list

-

add a man page for the new mpii, mostly from OpenBSD.

-

Sort SEE ALSO. Fix date. Whitespace fixes.
 1.3.2.1  03-Dec-2018  martin file mfii.c was added on branch netbsd-8 on 2018-12-07 17:11:37 +0000
 1.4.4.3  29-Sep-2022  martin Pull up following revision(s) (requested by bouyer in ticket #1534):

sys/dev/pci/mfii.c: revision 1.28

Convert from pci_intr_map() to pci_intr_alloc(); makes the driver use
MSI/MSI-x when available. Tested by Edgar Fu?.
 1.4.4.2  16-Sep-2022  martin Pull up the following, requested by msaitoh in ticket #1524:

sys/dev/ic/mfireg.h 1.22
sys/dev/pci/mfii.c 1.16-1.22,1.27 via patch
share/man/man4/mfii.4 1.3 via patch

- Fix wrong access in mfii_start().
- Add SAS3216,SAS3224,SAS3316 and SAS3324 support.
- Add CVPM02 BBU support.
- Use bus_space_write_8() if available.
- Don't panic on detach if no any sensor device.
- Add comment. Sort entries. KNF.
 1.4.4.1  17-May-2022  bouyer Pull up following revision(s) via patch (requested by msaitoh in ticket #1454):
sys/dev/ic/mfi.c: revisions 1.63, 1.66-77
sys/dev/ic/mfireg.h: revisions 1.11-1.20 via patch
sys/dev/pci/mfi_pci.c: revision 1.21
sys/dev/pci/mfii.c: revisions 1.6-1.7, 1.10-1.15
share/man/man4/mfi.4: revision 1.13

Improve mfi(4) and mfii(4):
- Set 'ld_sync' to NULL as part of 'again', to prevent use-after-free.
- Add some code for the SKINNY variant to make Dell PERC H310 work.
- Print the percentage correctly when the background initialization is
running.
- Clear mailbox to not to pass garbage data.
- Use union mbox instead of unit8_t xxx[] to avoid unaligned access.
- Set stripe size for BIOCVOL to show the size correctly in bioctl.
- Add support for iBBU-09 to show BBU voltage, current and temperature
correctly.
- Fix typos in comments.
- Sprinkle static.
- Improve debug printf()s.
- KNF. Remove extra semicolon. Whitespace fixes.
 1.4.2.4  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.4.2.3  08-Apr-2020  martin Merge changes from current as of 20200406
 1.4.2.2  10-Jun-2019  christos Sync with HEAD
 1.4.2.1  24-Apr-2019  christos file mfii.c was added on branch phil-wifi on 2019-06-10 22:07:17 +0000
 1.7.4.3  28-Mar-2021  thorpej No need to pass interface attribute or locators to config_found().
 1.7.4.2  22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.7.4.1  22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.8.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed