summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/mpi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* return ENOTTY rather than EINVAL to indicate an ioctl hasn't been handledjmatthew2018-08-141-2/+2
| | | | ok dlg@ deraadt@ kettenis@
* Make error handling (esp. DATA_UNDERRUN) clearer and avoid losing residkrw2016-08-171-7/+8
| | | | | | value. Specs from mikeb@, ok dlg@
* change some types in bio from u_quad_t to uint64_t, and fix casts indlg2016-08-141-3/+3
| | | | | | drivers that fill that field in too. quad types are going away.
* replace pointer arithmetic and casts with offsetofjsg2015-10-231-5/+5
| | | | ok dlg@ krw@
* sizes for free(); ok sthenderaadt2015-09-091-11/+12
|
* Fix some misuse of the | operator. In particular | has higherjsg2015-05-041-2/+2
| | | | | precedence than ?: ok guenther@ krw@ miod@
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* remove the second void * argument on tasks.dlg2015-01-271-4/+4
| | | | | | | | | | | | | | | | | | | | | when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
* be less confusing to the compiler when setting up the sge.dlg2014-09-171-2/+3
|
* mark the interrupt handler mpsafe, and drop the kernel lock in the scs_cmddlg2014-09-151-15/+26
| | | | | | paths. take it again when going back to other parts of the kernel. tested by and ok kettenis@
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* tasks dont need a mutex and a semaphore to protect against multiple usesdlg2014-09-031-27/+3
| | | | | | of the task structure like workq tasks did. tested on an fc929
* move mpi(4) from workq to taskqblambert2014-09-011-3/+5
| | | | ok dlg@
* Some reallocarray() use; review Jean-Philippe Ouellet, patrick keshishianderaadt2014-07-131-6/+6
| | | | ok tedu
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-14/+14
| | | | after discussions with beck deraadt kettenis.
* print the board name and firmware revision like we do on mpii anddlg2014-04-161-1/+48
| | | | nvme and other stuff.
* use lemtohXX and htolemXX as much as possibledlg2014-03-251-41/+39
|
* when reading from the chip you use letoh32, not htole32.dlg2014-03-251-2/+2
| | | | jmatthew@ agrees with me
* use htolemXX and lemtohXX in the scsi_cmd paths.dlg2014-03-241-6/+6
| | | | | | apart from the flags handling in sgls, this shrinks the io hot path on sparc64 and powerpc a lot. its pretty much the same on i386/amd64/alpha.
* mpi scatter gather lists are 24 bytes long and next to each other indlg2014-03-241-27/+20
| | | | | | | | | | | | | | memory. that means you cant do 8 byte loads and stores on the sg_addr member cos it wont be 8 byte aligned half the time which makes strict alignment archs (ie, the fun ones ones) upset. annotate the sge as being 4 byte aligned. replace the sg_addr member with sg_addr_lo and sg_addr_hi. replace htole64 assignment of the sg addr with a wrapper that does the right thing with a couple of htolem32 calls. generated code shrinks again.
* factor out the setting of the request context field so mpi_start does itdlg2014-03-241-16/+7
| | | | | | | | on behalf of all its callers. use htolem32 and lemtoh32 to handle the message context. both save bytes.
* bzero to memsetdlg2014-01-201-13/+13
|
* bcopy to memcpydlg2014-01-201-6/+8
|
* data transfers suit STREAMING dma maps.dlg2013-01-181-2/+2
|
* mikeb pointed at that the interrupt status register read in mpi_intr wasdlg2013-01-171-2/+6
| | | | important, as per r1.167.
* we dont need to read the interrupt status register to know if we havedlg2013-01-171-7/+7
| | | | | | | | | | | any work to do in the interrupt handler, or to clear it. the relevant bits indicate whether there's work on the doorbell and clear when there isnt. we need to read the doorbell if there is work to do, so lets just go that straight away anyway. get rid of bus_space_barriers in the io path. barriers are for enforcing ordering. the doorbell reads and writes dont depend on any other register values so ordering isnt applicable here.
* treat DVAs as 64bits all the time so we can avoid ugly casts and shifts indlg2013-01-171-2/+2
| | | | the code.
* several tweaks to make mpi(4) work for vmware emulated sas adapters.dlg2012-09-181-12/+14
| | | | | | | | | | | | | | 1. vmware advertises more scsi targets than command slots, so the maths we did for openings gave each target 0 openings. always advertise at least 16 openings. 2. if we cant configure the ATA queue depth, dont fail to attach the controller whole. finally, improve the error reporting during attach so its more obvious where things fail. mostly figured out by jmatthew@
* Use sg_addr instead of sg_lo_addr, leftovers from last commit.haesbaert2012-09-121-13/+9
| | | | ok dlg
* Make sure we don't sleep on autoconf.haesbaert2012-09-121-2/+2
| | | | ok mikeb
* htole64 works as good as htole32 twice for dma virtual addresses.dlg2012-08-261-20/+7
|
* mpi_get_ccb and mpi_put_ccb are only called via iopools now, so changedlg2012-01-161-9/+11
| | | | | their types to fit the iopools api rather than doing awful typecasts to shove them into iopool_init.
* Backout a bunch of my SCSI commits from c2k11. At least one of thesematthew2011-07-171-2/+2
| | | | | | is causing problems when trying to boot sparc64 from an isp(4). Verified to fix the sparc64/isp(4) regression by krw@; ok deraadt@
* First batch of converting SCSI HBAs from setting saa_targets andmatthew2011-07-081-2/+2
| | | | | | saa_luns instead of adapter_buswidth and luns in the prototype link. ok dlg@, miod@
* M_WAITOK cleanup of two cases:mk2011-06-171-2/+2
| | | | | | | | | | | | | | | | 1) Allocating with M_WAITOK, checking for NULL, and calling panic() is pointless (malloc() will panic if it can't allocate) so remove the check and the call. 2) Allocating with M_WAITOK, checking for NULL, and then gracefully handling failure to allocate is pointless. Instead also pass M_CANFAIL so malloc() doesn't panic so we can actually handle it gracefully. 1) was done using Coccinelle. Input from oga. ok miod.
* if getting the RAID header fails, dont stop the midlayer from trying todlg2011-04-271-2/+2
| | | | | | | issues scsi commands against that target. it might be a normal device and the firmware is just being picky about which headers you can fetch. tested by and ok deraadt@
* configure fc controllers to fail io as fast as possible when cables aredlg2011-04-271-16/+37
| | | | | | | yanked. we want to reschedule them down active paths rather than wait for a minute while mpi decides that a path isnt coming back. discussed with and tested by deraadt@
* return XS_RESET to the midlayer if the command was killed for some reasondlg2011-04-271-1/+6
| | | | | rather than the default of XS_DRIVER_STUFFUP. mpath(4) likes this better when you unplug paths.
* rework the scanning of fibre channel ports to match how linux does it.dlg2011-04-271-9/+20
| | | | | | | | | some fc parts dont like the header requests against missing devices with bus addressing, so now we do the magic iteration over active ports. the original problem was reported by deraadt@ lots of testing and debugging by deraadt@ tested on fc929 and fc949 adapters
* Peek at the interrupt status register before poking with the reply postmikeb2011-03-041-1/+4
| | | | | | | | queue. In some situations this prevents us from reading a garbled reply. If this commit breaks your mpi, please report ASAP. The issue was reported and the fix was verified by Emeric Boit. Thanks! Ok dlg, kettenis, marco (who warned us and wanted to test more)
* back out r1.162, the one that bumps openings up on sas and fcdlg2011-03-011-5/+2
| | | | | | | | | | | | | | | | devices. my theory is that some devices report queue full conditions in ways the firmware doesnt understand, or some firmwares default to NOT doing the queue full handling internally. either way it reports queue full conditions as faulted io which gets passed up to the block layer as errors. this makes us conservative again and safe. this fixes panics from ajacout ok sthen@ deraadt@
* vol_list in mpi_get_raid is never used.dlg2010-09-241-3/+1
|
* tweak the sas io unit to use 32 openings when talking to sata disks if thedlg2010-09-211-1/+42
| | | | firmware has it configured lower.
* Use SSD_ERRCODE_CURRENT instead of magic 0x70.krw2010-09-201-2/+2
| | | | ok dlg@ matthew@
* allow devices on fc and sas adapters to use all the openings the chip candlg2010-09-141-2/+5
| | | | | | provide. spi parts are still limited. ok krw@
* if a busy sas device is unplugged, the pending io on that device willdlg2010-09-131-13/+100
| | | | | | | | | | | | | never complete. when we get a detach event from the firmware, we currently deactivate the device and then request the scsi midlayer attempt to detach the device. this diff now deactivates the device and then resets the target, forcing the ioc to complete the pending operations. once the reset has completed we then request a detach of the kernel device. this lets me hotplug busy sas disks without leaking scsi_xfers or bufs or anything.
* dont reuse the event notifications ccbs id for the acknowledgement.dlg2010-09-131-2/+2
|
* im not convinced we only have one outstanding event to ack at a time. thisdlg2010-09-131-12/+38
| | | | | | | steals^Wleverages the code used in mpii for handling a list of events to acknowlede. tested by hotplugging sas disks.
* implement handling of rescan events on fc controllers. allows "hotplug" ofdlg2010-09-101-4/+76
| | | | fc devices.
* get some format strings and variables right in debug outputdlg2010-08-271-3/+3
|