summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/mpi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* No "\n" needed at the end of panic() strings.krw2010-08-071-4/+4
| | | | | | | Bogus chunks pointed out by matthew@ and miod@. No cookies for marco@ and jasper@. ok deraadt@ miod@ matthew@ jasper@ macro@
* if we get an event notification that requires acknowledgement whiledlg2010-07-061-20/+13
| | | | | | | | | | | | | | we're busy, we might not be able to allocate a ccb via scsi_ioh_get if the pool is empty. this means we wont ack the event, which in turn means we wont receive further event notifications. this cuts the event ack code over to using a scsi_iohandler. the eventack iohandler will be called as soon as a ccb becomes available for it to use. this guarantees reliable event handling and acknowledgement, despite how busy the controller might be. this has bugging me ever since i wrote the event handling code. tested by hotplugging sata disks.
* move the last direct users of mpi_{get,put}_ccb over to using the scsidlg2010-07-061-14/+14
| | | | ioh wrappers.
* Change scsibus(4)'s scsi_link array to an SLIST to save memory onmatthew2010-07-011-6/+6
| | | | | | sparsely populated buses. ok dlg@, krw@
* Remove all adapter-specific 'struct scsi_device's. They are never used. Firstkrw2010-06-281-9/+1
| | | | | | | | step in elminating 'struct scsi_device' entirely. Spotted and initial diff from matthew@. ok matthew@ dlg@ deraadt@ marco@ miod@
* rearrange attach so that the SDEV_VIRTUAL flag is set during scsi_probe,dlg2010-06-151-66/+93
| | | | | | | rather than as a scan of all attached devices after scsibus is attached. this will allow the cache enabling on virtual disks to run as part of the disks attach routine.
* dont pass the dev_t from the scsi device drivers into the midlayer fordlg2010-06-151-4/+3
| | | | | | | ioctl requests, and dont pass the proc pointers around for any ioctl requests in scsi land at all. neither were used, so trim the fat. ok krw@ marco@
* the virtual scsi disks that mpi(4) presents dont grok modifications to thedlg2010-05-191-5/+119
| | | | | | mode pages that control the caches. this adds code that talks to the mpi chip directly on behalf of those disks so you can enable write caching on them.
* Use a temporary variable for now to sidestep -Wbounded checking whennicm2010-05-161-3/+4
| | | | | | | copying vendor[8]/product[16]/revision[4] out of struct scsi_inquiry_data together with one memcopy. ok krw
* back out 1.143, it causes data corruption on the mpis in sun v20z boxes,dlg2010-05-091-2/+2
| | | | | | | | but i suspect it is common to all SPI mpi parts. problem found and problem diff verified by landry. ok krw@ landry@ jasper@
* Fix gcc4 warningmarco2010-04-281-2/+2
|
* use BUS_DMA_ZERO on alloc instead of bzeroing after.oga2010-04-221-4/+2
| | | | ok dlg@, marco@
* Fix cut 'n paste typomarco2010-04-221-3/+3
|
* i thought mpi gave each device all the openings on the bus, which was adlg2010-04-191-2/+2
| | | | | | | big motivation to implementing iopools. while looking at another issue i noticed that openings were cut up for each disk. this cranks openings to maxcmds.
* byteswap the number of blocks on physical disks for bioctl correctly.dlg2010-04-161-2/+2
| | | | | | makes output sane on sparc64 and other BE archs. found by jason george
* if there is no raid, do not allocate a 0-sized structure for sensorsderaadt2010-04-161-1/+3
| | | | | and then start attaching it with 0 sensors attached ok dlg
* dont need to call scsi_done with splbio. the midlayer protectsdlg2010-04-121-13/+1
| | | | itself now, its not the adapters responsibility anymore.
* fix double free in an error path. the midlayer gets the ccb for scsi iodlg2010-04-091-2/+1
| | | | now, so it not our job to free it.
* use SLISTs for managing the ccb free list rather than TAILQs.dlg2010-04-061-5/+5
|
* modify mpi to provide an iopool as a way for the midlayer to manage accessdlg2010-04-061-15/+19
| | | | | | | | | | | | | to its free ccbs. this allows the midlayer to schedule access to the bus in a roundrobin fashion for all consumers on the bus, including io from devices and even the internal mpi management commands used to poll the state of raid devices. the result is fairer sharing between disks on the bus and more reliable sensor updates. ok krw@ beck@ marco@ tested by beck@
* dont allocate with M_TEMP and then free with M_DEVBUF. made even worse thatdlg2010-04-031-2/+2
| | | | | | | this was done for every sensor update, which really screwed up the memory stats. noticed by deraadt@
* Change the scsi_cmd function member of scsi_adapter from int tokrw2010-03-231-9/+13
| | | | | | | | | | | | | void. Use XS_NO_CCB error in the scsi command (xs) to report the NO_CCB condition. Eliminates all SUCCESSFULLY_QUEUED and COMPLETE confusion and untangles the midlayer from the adapter a bit more. Eyes and some fixes by miod@ There may be some compile issues on little used (i.e. I don't have any) drivers but the change is mechanical and thus easy to remedy. ok dlg@
* rework the polling code to use the semantic krw@ proposed.dlg2010-01-111-52/+33
| | | | | | | | | | | intercept the ccb_done handling so polled commands set a flag that mpi_poll tests on. when ccb_done sets the variable, the poll loop breaks and mpi_poll runs the original ccb_done handler for the ccb completion. this is a lot simpler than the previous implementation and removes a mutex. ok beck@
* Zap all setting of ITSDONE in drivers that don't look at it. Nobodykrw2010-01-091-5/+1
| | | | | | | else cares so it's just noise. Drivers that actually look at ITSDONE are unchanged. ok marco@ (for his files) dlg@ beck@
* oops, get the order of args right for the header request indlg2010-01-031-3/+3
| | | | mpi_bio_get_pg0_raid. the sensor updates dont poll at all now.
* mpi_bio_get_pg0_raid is only called from a process context. let the cfgdlg2010-01-031-4/+4
| | | | requests sleep rather than poll for completion.
* oops, forgot to set the ccb_cookie in mpi_wait. mpi_wait_done would faultdlg2010-01-031-1/+2
| | | | when it used the uninitialized cookie.
* get rid of the last internal user of splbio. waiting for the completion ofdlg2010-01-031-21/+42
| | | | | a ccb can now be done with mpi_wait. this switches the cfg page handlers over from their own tsleep stuff to mpi_wait.
* rename ccb_xs to ccb_cookie, and switch it from a struct scsi_xfer * to adlg2010-01-031-5/+5
| | | | | void *. this will let me stash things other than scsi xfers in the ccb for ccb_done handlers to use.
* dont leak a ccb if we fail to get a reply in portenabledlg2010-01-031-5/+6
|
* when getting a reply from the hw, only sync the dmamem for that one replydlg2010-01-031-27/+33
| | | | rather than all the replies.
* switch mpi from using splbio to protect itself over to mutexes.dlg2010-01-031-65/+77
| | | | | | | | | mpi only needs two mutexes, one for the list of free ccbs, and another to protect the reply doorbell. the latter is necessary to allow polling for command completion to work in smp systems. tested on sas and fc hbas. this diff was written over 2 years ago now with surprisingly few tweaks to handle changes that have occurred since then.
* remove dead assignment and newly created unused variable.chl2009-12-101-3/+1
| | | | | | Found by LLVM/Clang Static Analyzer. ok dlg@ marco@