summaryrefslogtreecommitdiff
path: root/sys/dev/pci/mpii.c
AgeCommit message (Collapse)Author
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@
2015-01-27remove the second void * argument on tasks.David Gwynne
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@
2014-09-16mark the mpii interrupt handler as mpsafe, and drop the kernel lockDavid Gwynne
in the scsi_cmd path and iopool backend. modelled on mfi and mpi.
2014-07-13Some reallocarray() use; review Jean-Philippe Ouellet, patrick keshishianTheo de Raadt
ok tedu
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-05-04change type of handle var to u_int16_tStefan Fritsch
This fixes a format string warning. No change to the format string is necessary. suggested by kettenis@
2014-04-25don't access a pointer till after the null checkJonathan Gray
ok mikeb@
2014-04-10marking the isr as MPSAFE snuck in with r1.76.David Gwynne
while it might be ok (and hasnt actually blown up since i committed that) id rather review the code and enable it explicitely.
2014-04-09remove an abstraction that just wraps a straight malloc on attach forDavid Gwynne
the sc_devs array.
2014-04-09some mild knfDavid Gwynne
2014-03-27last of the htolem32 bitsDavid Gwynne
2014-03-27tweak mpii_start.David Gwynne
on 64bit archs you can post the descriptor in one go, which is easy. on 32bit you have to post it in halves in the right order, which is not atomic and requires barriers for ordering.
2014-03-27tweak the looping of the postqDavid Gwynne
2014-03-27you want the ring to wrap when it gets to the size of the ring, not oneDavid Gwynne
after it. jmatthew@ figured out i am bad at c.
2014-03-27optimise mpii_push_reply.David Gwynne
int types are easier to work with than shorts. use a compare to handle ring wraparound rather than a mod operation.
2014-03-27updating the reply queue indexes on the chip dont have any dependentDavid Gwynne
register ops, so dont need barriers around them.
2014-03-27remove unused macrosDavid Gwynne
2014-03-27forgot a htolem32David Gwynne
2014-03-27apply more htolemXX and lemtohXX.David Gwynne
2014-03-24shrink the iopath a bit by using htolemXX and lemtohXX.David Gwynne
2014-03-24make mpii_sge look like mpi_sge, and provide a wrapper for setting theDavid Gwynne
address in it like the one in mpi too. shrinks load_xs a bit
2014-03-24bcopy to memcpyDavid Gwynne
2014-03-24replace bzero with memsetDavid Gwynne
2014-03-24rework mpii to use tasks instead of scsi_tasks for sas event handling.David Gwynne
scsi_tasks are still backed by workq, and i dont like having to allocate storage to defer work. sas events that cause hotplug events are queued in the softc to be handled by a single task that loops on the queue for work. think levelled interrupts. this has a side effect that interrupts are necessary to enumerate devices for attachment. i wrote this toward the end of last year, but thought it best to wait for 5.5 unlock.
2014-03-06Cleanup dead code.Gerhard Roth
ok mikeb@
2014-01-22fixup a few debug printfs; pointed out by jsg@Mike Belopuhov
2013-12-04kill a debug printf; noticed by sthenMike Belopuhov
2013-11-06pull the event ack handling out of mpii_event_process into mpii_event_doneDavid Gwynne
so we can use it in multiple places.
2013-11-06dont leak ccbs in mpii_sas_remove_device. detaching lots (like, 1000) ofDavid Gwynne
things could run you out of command slots without this.
2013-10-25fix an off by one when calculating the length of an sgl segmentMike Belopuhov
that our chain scatter-gather element is pointing to. the bug was observed by pedro martelletto with some particular firmware doing raid 0. the fix wouldn't have been possible without extensive debugging and spec conformance verification done by pedro. tested by pedro, dlg and myself, ok dlg
2013-01-25the event type is a 16bit value, not 32bit. use htole16 instead of htole32.David Gwynne
mpii(4) works on sparc64 with this.
2012-09-28update my copyrightMike Belopuhov
2012-09-10autoconf is not the right place to sleep; noticed by haesbaertMike Belopuhov
2012-09-07Fixup a memory access fault on an invalid reply. Quoting the spec:Mike Belopuhov
The host driver must ensure that there is at least one unused entry in the Reply Free Queue. One way to ensure that this requirement is met is to never allocate a number of reply frames that is a multiple of 16. So bring back the old logic of calculating the RFQ depth and add a comment explaining why is it done. Duh!
2012-08-28oops. a bit of debugging code has sneaked inMike Belopuhov
2012-08-28Get rid of several ill-defined concepts and use more informationMike Belopuhov
provided by the IOC. Cleanup scatter-gather code and add more comments. Tested by a "make build" and bonnie++ torturing on a SAS2004 with an IR firmware.
2012-08-25some endian fixes.David Gwynne
2012-08-23cleanup calculations in iocfacts a bit: number of reply frames doesn'tMike Belopuhov
have to be not multiple of 16, recalculate request credit and number of replies if their sum exceeds MaxReplyDescriptorPostQueueDepth. tested on SAS2004 with bonnie++.
2012-08-23use BUS_DMA_ZEROMike Belopuhov
2012-08-22cleanup mpii_alloc_queues, use caddr_t for kva plus a bit of cleanupMike Belopuhov
2012-08-22remove last remnants of mpii_[e]cfg_header and mpii_[e]cfg_pageMike Belopuhov