summaryrefslogtreecommitdiff
path: root/sys/dev/ic/mpi.c
AgeCommit message (Collapse)Author
2012-01-16mpi_get_ccb and mpi_put_ccb are only called via iopools now, so changeDavid Gwynne
their types to fit the iopools api rather than doing awful typecasts to shove them into iopool_init.
2011-07-17Backout a bunch of my SCSI commits from c2k11. At least one of theseMatthew Dempsky
is causing problems when trying to boot sparc64 from an isp(4). Verified to fix the sparc64/isp(4) regression by krw@; ok deraadt@
2011-07-08First batch of converting SCSI HBAs from setting saa_targets andMatthew Dempsky
saa_luns instead of adapter_buswidth and luns in the prototype link. ok dlg@, miod@
2011-06-17M_WAITOK cleanup of two cases:Michael Knudsen
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.
2011-04-27if getting the RAID header fails, dont stop the midlayer from trying toDavid Gwynne
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@
2011-04-27configure fc controllers to fail io as fast as possible when cables areDavid Gwynne
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@
2011-04-27return XS_RESET to the midlayer if the command was killed for some reasonDavid Gwynne
rather than the default of XS_DRIVER_STUFFUP. mpath(4) likes this better when you unplug paths.
2011-04-27rework the scanning of fibre channel ports to match how linux does it.David Gwynne
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
2011-03-04Peek at the interrupt status register before poking with the reply postMike Belopuhov
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)
2011-03-01back out r1.162, the one that bumps openings up on sas and fcDavid Gwynne
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@
2010-09-24vol_list in mpi_get_raid is never used.David Gwynne
2010-09-21tweak the sas io unit to use 32 openings when talking to sata disks if theDavid Gwynne
firmware has it configured lower.
2010-09-20Use SSD_ERRCODE_CURRENT instead of magic 0x70.Kenneth R Westerback
ok dlg@ matthew@
2010-09-14allow devices on fc and sas adapters to use all the openings the chip canDavid Gwynne
provide. spi parts are still limited. ok krw@
2010-09-13if a busy sas device is unplugged, the pending io on that device willDavid Gwynne
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.
2010-09-13dont reuse the event notifications ccbs id for the acknowledgement.David Gwynne
2010-09-13im not convinced we only have one outstanding event to ack at a time. thisDavid Gwynne
steals^Wleverages the code used in mpii for handling a list of events to acknowlede. tested by hotplugging sas disks.
2010-09-10implement handling of rescan events on fc controllers. allows "hotplug" ofDavid Gwynne
fc devices.
2010-08-27get some format strings and variables right in debug outputDavid Gwynne
2010-08-07No "\n" needed at the end of panic() strings.Kenneth R Westerback
Bogus chunks pointed out by matthew@ and miod@. No cookies for marco@ and jasper@. ok deraadt@ miod@ matthew@ jasper@ macro@
2010-07-06if we get an event notification that requires acknowledgement whileDavid Gwynne
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.
2010-07-06move the last direct users of mpi_{get,put}_ccb over to using the scsiDavid Gwynne
ioh wrappers.
2010-07-01Change scsibus(4)'s scsi_link array to an SLIST to save memory onMatthew Dempsky
sparsely populated buses. ok dlg@, krw@
2010-06-28Remove all adapter-specific 'struct scsi_device's. They are never used. FirstKenneth R Westerback
step in elminating 'struct scsi_device' entirely. Spotted and initial diff from matthew@. ok matthew@ dlg@ deraadt@ marco@ miod@
2010-06-15rearrange attach so that the SDEV_VIRTUAL flag is set during scsi_probe,David Gwynne
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.
2010-06-15dont pass the dev_t from the scsi device drivers into the midlayer forDavid Gwynne
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@
2010-05-19the virtual scsi disks that mpi(4) presents dont grok modifications to theDavid Gwynne
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.
2010-05-16Use a temporary variable for now to sidestep -Wbounded checking whenNicholas Marriott
copying vendor[8]/product[16]/revision[4] out of struct scsi_inquiry_data together with one memcopy. ok krw
2010-05-09back out 1.143, it causes data corruption on the mpis in sun v20z boxes,David Gwynne
but i suspect it is common to all SPI mpi parts. problem found and problem diff verified by landry. ok krw@ landry@ jasper@
2010-04-28Fix gcc4 warningMarco Peereboom
2010-04-22use BUS_DMA_ZERO on alloc instead of bzeroing after.Owain Ainsworth
ok dlg@, marco@
2010-04-22Fix cut 'n paste typoMarco Peereboom
2010-04-19i thought mpi gave each device all the openings on the bus, which was aDavid Gwynne
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.
2010-04-16byteswap the number of blocks on physical disks for bioctl correctly.David Gwynne
makes output sane on sparc64 and other BE archs. found by jason george
2010-04-16if there is no raid, do not allocate a 0-sized structure for sensorsTheo de Raadt
and then start attaching it with 0 sensors attached ok dlg
2010-04-12dont need to call scsi_done with splbio. the midlayer protectsDavid Gwynne
itself now, its not the adapters responsibility anymore.
2010-04-09fix double free in an error path. the midlayer gets the ccb for scsi ioDavid Gwynne
now, so it not our job to free it.
2010-04-06use SLISTs for managing the ccb free list rather than TAILQs.David Gwynne
2010-04-06modify mpi to provide an iopool as a way for the midlayer to manage accessDavid Gwynne
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@
2010-04-03dont allocate with M_TEMP and then free with M_DEVBUF. made even worse thatDavid Gwynne
this was done for every sensor update, which really screwed up the memory stats. noticed by deraadt@
2010-03-23Change the scsi_cmd function member of scsi_adapter from int toKenneth R Westerback
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@
2010-01-11rework the polling code to use the semantic krw@ proposed.David Gwynne
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@
2010-01-09Zap all setting of ITSDONE in drivers that don't look at it. NobodyKenneth R Westerback
else cares so it's just noise. Drivers that actually look at ITSDONE are unchanged. ok marco@ (for his files) dlg@ beck@
2010-01-03oops, get the order of args right for the header request inDavid Gwynne
mpi_bio_get_pg0_raid. the sensor updates dont poll at all now.
2010-01-03mpi_bio_get_pg0_raid is only called from a process context. let the cfgDavid Gwynne
requests sleep rather than poll for completion.
2010-01-03oops, forgot to set the ccb_cookie in mpi_wait. mpi_wait_done would faultDavid Gwynne
when it used the uninitialized cookie.
2010-01-03get rid of the last internal user of splbio. waiting for the completion ofDavid Gwynne
a ccb can now be done with mpi_wait. this switches the cfg page handlers over from their own tsleep stuff to mpi_wait.
2010-01-03rename ccb_xs to ccb_cookie, and switch it from a struct scsi_xfer * to aDavid Gwynne
void *. this will let me stash things other than scsi xfers in the ccb for ccb_done handlers to use.
2010-01-03dont leak a ccb if we fail to get a reply in portenableDavid Gwynne
2010-01-03when getting a reply from the hw, only sync the dmamem for that one replyDavid Gwynne
rather than all the replies.