summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/mpi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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@
* Stop spamming dmesg when raid isn't available.marco2009-12-091-2/+3
|
* put the midlayer changes back in.dlg2009-12-011-3/+1
| | | | | | | | | | | the two issues affecting it last time are gone. the first, mishandling of TRY_AGAIN_LATER is not relevant now that krw got rid of TRY_AGAIN_LATER. the second, the misbehaving IBM disk was found to be a problem with siop using ordered tags on most ops combined with the speed of the new code. putting this in so we can move forward. ok krw@ "commit please" marco@
* revert midlayer back to it was before i put my big rewrite in. this isdlg2009-11-121-1/+3
| | | | | | | causing a weird problems on an alpha and also appears responsible for isp(4) weirdness i havent had a chance to examine yet. sigh, this makes me sad.
* backout the backout marco did of my code because of the NO_CCB breakage.dlg2009-11-101-3/+1
| | | | | | | the fix for the NO_CCB breakage will follow shortly. tested by krw@ marco@ johan@ ok krw@ marco@
* bump copyrightsmarco2009-11-051-3/+3
|
* The big diff dlg committed to the midlayer breaks NO_CCB andmarco2009-11-051-1/+3
| | | | | | | | | | TRY_AGAIN_LATER. NO_CCB is a timer based mechanism that can trivially be made to fail by running IO to two or more disks simultaneously. The TRY_AGAIN_LATER thing is more subtle because it now is a permanent failure instead of transient however this is much harder to hit because something must have gone wrong before it hits. ok deraadt krw miod
* Don't write bogus values to reply_fifo_host_signalling_addr. This registermarco2009-11-021-16/+15
| | | | | | | | should remain untouched because it is only for interruptless drivers. Honor reply queue depth per the spec instead of clipping it at 32. ok dlg
* enable event handling on sas hbas and ignore unhandled events. this turnsdlg2009-10-231-8/+8
| | | | | on sas hotplug. you can add and remove drives and the kernel will handle it now.
* if you're attempting to detach multiple devices (eg, many targets,dlg2009-10-231-28/+20
| | | | | | | | | | | | | | | | | many luns, or the entire bus), dont report ENXIO as an error to the caller. this broke autoconf when it tried to forcefully remove a bus such as umass and it thought there was a failure. this introduces a way for scsi hbas to call activate/deactivate on a device based on its target/lun address via a call to scsi_activate(). they can then schedule the actual detach/attach in a thread later via scsi_req_probe/detach. the mpi changes tweak the sas event handling code to use these apis to properly handle attaches and detaches of disks. event handling is still disabled till i can make it less chatty. umass breakage reported by form@
* disable interrupt coalescing (aka mitigation) if the chip comes up with itdlg2009-10-151-1/+48
| | | | | | turned on. mitigation on io only slows us down. developed on hardware donated by fox-it.
* let page requests sleep instead of polling for completion. not used justdlg2009-10-111-21/+49
| | | | yet...
* always mark an xs complete if we're about to return COMPLETE to thedlg2009-08-121-2/+9
| | | | midlayer. always call scsi_done on the xs too.
* if the port is fc, populate the adapters scsi_link structure with the wwpndlg2009-08-081-2/+33
| | | | | | and wwnn so scsibus can use it. requested by and ok deraadt@
* Bring NO_CCB to mpi.krw2009-03-061-8/+4
| | | | ok marco@
* Extend the scsi_adapter minphys() callback to take a struct scsi_link *miod2009-02-161-3/+3
| | | | | | as additional argument. This will allow intermediate layers between scsi devices such as sd and scsi host adapters to take appropriate action if necessary.
* missing braces; ok marcosthen2009-02-131-2/+3
|
* enable biomarco2008-11-231-3/+1
| | | | ok dlg