summaryrefslogtreecommitdiff
path: root/sys/dev/pci/mpii.c
AgeCommit message (Collapse)Author
2024-05-24remove unneeded includes; ok miod@Jonathan Gray
2023-11-29Add support for new SAS HBAs (codenamed Aero and Sea, sold as Broadcom HBAJonathan Matthew
9500, Dell HBA350/5, Lenovo ThinkSystem 440 HBA, Supermicro AOC-S3808/16) These apparently have a hardware problem that results in reads of some registers returning all zeros under some transient conditions, which can apparently be worked around by retrying reads that return 0 up to 3 times. ok dlg@
2023-07-06Use mtx_init() to initialize stack-based mutexesVisa Hankala
mtx_init() ensures the mutex' lock_object has static storage duration. This makes it safe to re-enable WITNESS with stack-based mutexes. OK bluhm@ miod@
2023-05-25Disable witness for mutexes created on the stack which allowsKurt Miller
the ddb command 'show witness' to succeed without panicking. Leaving witness enabled on these mutexes saves a pointer to struct lock_type on the stack which gets clobbered resulting in a panic in witness_ddb_display_descendants(). okay miod@
2022-10-18Document and report mpii(4) RAID 1E as suchKlemens Nanni
At least the built-in controller on sparc64 T4-2 machines supports 1E from which OpenBSD boots just fine, but bioctl(8) reports it as RAID 10: mpii0 at pci15 dev 0 function 0 "Symbios Logic SAS2008" rev 0x03: msi mpii0: Solana On-Board, firmware 9.0.0.0 IR, MPI 2.0 scsibus1 at mpii0: 834 targets sd0 at scsibus1 targ 0 lun 0: <LSI, Logical Volume, 3000> naa.600508e0000000006cd1dcd59022a30a sd0: 713824MB, 512 bytes/sector, 1461911552 sectors root on sd0a (efde5b2c6ab7b8ac.a) swap on sd0b dump on sd0b # bioctl mpii0 Volume Status Size Device mpii0 0 Online 748498714112 sd0 RAID10 0 Online 500107861504 0:2.0 noencl <ATA CT500MX500SSD1> 1 Online 500107861504 0:1.0 noencl <ATA CT500MX500SSD1> 2 Online 500107861504 0:0.0 noencl <ATA CT500MX500SSD1> mpii(4) simply munged 1E into 10. Report it as 0x1E just like softraid(4) RAID 1C is 0x1C internally: # ./obj/bioctl mpii0 | grep RAID mpii0 0 Online 748498714112 sd0 RAID1E OK jsing
2022-04-16constify SCSI adapter entry pointsChristian Weisgerber
ok krw@
2022-03-11Constify struct cfattach.Martin Pieuchot
2022-01-09spellingJonathan Gray
feedback and ok tb@ jmc@ ok ratchov@
2020-09-22Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'Kenneth R Westerback
member of 'struct scsi_xfer' has always been pointed at the 'struct scsi_generic cmdstore' member of the same instance. So nuke 'cmdstore' and remove the '*' from cmd. Take the address of cmd as required by the various casts. No intentional functional change. luna88k test by aoyama@, sparc64 test by jmatthew@ Identification of 2009's last *cmd use and ok jmatthew@
2020-08-26Remove needless uses of SDEV_ONLYBIG. It was always set when SDEV_UMASS was set,Kenneth R Westerback
and was always checked in concert with SDEV_ATAPI. Just rely on SDEV_ATAPI and SDEV_UMASS in all but the one place sd(4) where SDEV_ONLYBIG is set independently of SDEV_ATAPI/_UMASS. ok jmatthew@
2020-07-22Nuke unused struct scsi_link members of adapter softc's where theKenneth R Westerback
driver successfully compiles on one or more of amd64, i386, hppa.
2020-07-20Move remaining scsi bus initialization info from "prototype scsi link"Kenneth R Westerback
fields to struct scsibus_attach_args. Nuke the struct scsi_link * (saa_sc_link) in scaibus_attach_args. Explicitly initialize each field in scsibus_attach_args variables.
2020-07-19Move the adapter related items (luns, adapter, adapter_target,Kenneth R Westerback
adapter_buswidth, adapter_softc) from struct scsi_link to struct scsibus_attach_args. Additional compile tests by jmatthew@ (sparc64) and aoyam@ (luna88k).
2020-07-16Access adapter softc via link->bus->sb_adapter_softc.Kenneth R Westerback
In sparc64 autoconf access 'luns' via sb_luns and 'adapter_buswidth' via sb_adapter_buswidth. Removes last post-config uses of the copies of bus related information in scsi_link.
2020-07-13Where we have a pointer (sc) to the relevant adapter_softc, useKenneth R Westerback
&sc->sc_dev to get a device pointer rather than using the void * whence we obtained 'sc'.
2020-07-13Remove some pointless casting of void * when assigning oneKenneth R Westerback
(scsi_link.adapter_softc) to a pointer of a particular softc type.
2020-07-11Expunge some Captain Obvious comments, tweak whitespace a bit, move a debugKenneth R Westerback
statement. All to make upcoming diff(s) smaller and easier to read.
2020-07-09Move sc->sc_link initialization closer to config_found() invocationKenneth R Westerback
like all the cool drivers do.
2020-06-27No need to bzero()/memset() 'struct scsibus_attach_args' variablesKenneth R Westerback
immediately before initializing the only field in the struct.
2020-06-24Use SDEV_NO_ADAPTER_TARGET instead of -1 to indicateKenneth R Westerback
the adapter is not a target on the bus. ok dlg@ as part of a larger diff.
2020-02-05Nuke unnecessary abstraction 'scsi_minphys()' which just callsKenneth R Westerback
'minphys()'. Just use & check for NULL instead, since 'minphys()' is always called on the code path ([cd|sd|st]minphys) that calls physio().
2020-01-23Use a consistant idiom/format when declaring scsi_adapter structuresKenneth R Westerback
in drivers. Terse one liners, NULLs instead of 0's, explicitly specify all members, etc. Nuke #ifdef notyet blocks related to the scsi_adapter in aic. No intentional functional change. ok tedu@
2020-01-13Unifdef WWN quirkkn
I committed the last revision under #ifdef sparc64 to make extra sure not to break platforms/setups I couldn't test. Now that deraadt and kettenis both expressed how this should really be MI and noone came up with a good reason to keep this sparc64 specific, I'm confident enough to remove the #ifdef. OK kettenis
2020-01-03Fix RAID volume WWIDs for LSI controllers on sparc64kn
Some controllers generate 128 bit WWIDs for RAID volumes but only has a 64-bit field to report it to the host, so it only puts the vendor-specified part here (last half of ID string printed when sd* attaches matches sl->port_wwn in reverse). As such IDs are not IEEE NAA compliant, OpenBoot PROM -at least on SPARC- sets the highest nibble to three by convention to mark such volumes as RAID volumes so that the OS (Solaris) may identify it as such. This is the last missing piece to make booting off hardware RAID on sparc64 just work; autoconf(9) is now able to match the port WWN against the bootpath to eventually identify the volume as the root device. Feedback jmatthew deraadt OK jmatthew
2019-12-31Convert infinite sleeps to {m,t}sleep_nsec(9).Martin Pieuchot
ok kn@
2019-12-29Populate logical disk port WWNs with their RAID volume's WWIDkn
On sparc64, booting root devices off hardware RAID volumes requires the port WWN to be set for autoconf(9) to match the disk against the bootpath and therefore identify it as root device. Pointed out by kettenis Input and OK jmatthew
2019-12-28Attach Symbios Logic Flash Accelerator eMLC cardskn
Those can be found in SPARC T4 machines, mine has the F80 800G model. Since other devices with different flash configurations use the same vendor/product ID, use the LSI chip name as product name as pointed out by jmatthew, thanks. OK jmatthew deraadt
2019-09-12SAS3 controllers have a maximum size for sgl chain segments, and theJonathan Matthew
controller faults if you exceed it, so instead use multiple chain segments in the same request frame layout. tested on a SAS3008 (max chain size 8), where MAXPHYS io would occasionally cause faults ok dlg@ krw@
2019-08-30On SAS3 and newer controllers (using the IEEE sgl layout), the chain offsetJonathan Matthew
field is in units of 16 bytes, not 4, fixing some but not all problems reported by Kor son of Rynar. ok dlg@, who points out this is exactly the same fix as r1.10 of mfii
2019-08-20Trailing whitespace.Kenneth R Westerback
2019-07-07tweak config pending handling so it waits for all ports to finish scanningDavid Gwynne
it waited until any port finished scanning before calling config_pending_decr, but if you have disks on other ports then they may race with the rest of the kernel getting to mountroot. this tweaks the config pending dance so it waits for all ports and avoids the race. i just got lucky on my system where root was on the first port. kettenis has been poking a t4 where the disks are all over the place and he lost the race. tested by and ok kettenis@
2019-06-05this can support 64BIT DVA for ioDavid Gwynne
2019-06-04use htolemXX and lemtohXX instead of htoleXX and letohXXDavid Gwynne
this makes the generated code a lot shorter on sparc64, and has no effect on little endian archs. this has been in my tree for well over a year without issue.
2018-08-14return ENOTTY rather than EINVAL to indicate an ioctl hasn't been handledJonathan Matthew
ok dlg@ deraadt@ kettenis@
2018-06-19Add support for SAS3.5 controllers. This involves reorderingJonathan Matthew
initialisation so we get the controller capabilities first, allowing a soft reset instead of hard reset. The new controllers don't work after a hard reset, and older generations seem fine either way. tested by robert@ on a sas3408, by dlg@ on a sas2008 (on sparc64) and by me on a sas3008. ok dlg@ robert@
2017-12-12Remove unused variable defined with an unexisting type.Martin Pieuchot
Found with ctfconv(1). ok jsg@, dlg@
2017-08-10Remove a leftover bit that was dereferencing an uninitialized pointerMike Belopuhov
Coverity CID 1453398; ok deraadt.
2017-04-08A pile of sizes to free(9). In test for a few days in snapshots.Theo de Raadt
Errors will result in nice clean panic messages so we know what's wrong. Reviewed by dhill visa natano jsg.
2017-01-16Let it compile with debugging enabledMike Belopuhov
2017-01-16Clean up SCSI operation status and state definesMike Belopuhov
2016-11-06dont issue sas config page requests against raid targets.David Gwynne
doing requests like that causes lockups on boot. reported by and this fix test by simon mages
2016-10-24augment the scsi_probe handler so it tries to query the sas dev pg 0David Gwynne
sas dev pg0 tells us interesting things, like the devices sas addresses and if it is ATAPI or not.
2016-10-21mitigate against mpii device attachment racing with mountrootDavid Gwynne
mpii devices get attached by processing sas discovery events after threads are running, but if you have a lean (in terms of devices) and fast machine, these events might run after mountroot. this change has mpii use config_pending_incr() before it attaches scsibus, and runs config_pending_decr() after the first scan of the bus is complete. to make sure config_pending_decr() is run after the scsi attach/detach events are processed, the MPII_EVENT_SAS_DISCOVERY events are deferred to the same context that the MPII_EVENT_SAS_TOPOLOGY_CHANGE_LIST events run in. ok jmatthew@
2016-09-14add support for SAS3 devices, which have a different sgl layout to previousJonathan Matthew
generations. tested on a Lenovo N2215 (SAS3008) ok dlg@ deraadt@
2016-08-17Make error handling (esp. DATA_UNDERRUN) clearer and avoid losing residKenneth R Westerback
value. Specs from mikeb@, ok dlg@
2016-08-09Check xs->status for SCSI_CHECK even in underrun situations.Kenneth R Westerback
Lets Bacula find the end of medium on LTO5 drive. Reported & fix tested by Kor son of Rynar. ok mikeb@ deraadt@
2016-03-07Sync no-argument function declaration and definition by adding (void).Christian Weisgerber
ok mpi@ millert@
2015-03-18Prevent sign extension due to pointer arithmeticsMike Belopuhov
This should make mpii(4) work on i386 again, apparently. Problem identified and a slightly different fix proposed by Christiano F. Haesbaert and Pedro Martelletto of Bitrig. Huge thanks for tracking this down, guys!
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2015-03-02Remove the mpsafe flag for mpii(4), it is a suspect in some kernel hangs I'veStuart Henderson
seen on MP kernels when doing bulk io transfers from a multithreaded program (bacula-fd). ok dlg@