summaryrefslogtreecommitdiffstats
path: root/sys/dev/amr
Commit message (Collapse)AuthorAgeFilesLines
* Rewrite the DMA code paths from being an impenitrable maze of special casesscottl2007-12-124-436/+260
| | | | | to a much saner and simplier unified code path. Along the way, fix various CAM nits and bugs so that the passthrough works correctly for all cases.
* Provide unqiue malloc types instead of using M_DEVBUF.scottl2007-12-022-26/+29
|
* Refactor completion handlers so that they can be combined into a singlescottl2007-12-021-76/+29
| | | | function. Add missing locking.
* Make a pass at style.9 compliancescottl2007-12-021-440/+477
|
* Fix a typo that was hidden by AMR_DEBUG.scottl2007-12-021-1/+1
|
* Fix printf format bugs that where hidden by AMR_DEBUG.scottl2007-12-021-3/+3
|
* Turn the CAM passthroug interface to AMR back ON. Adjust thescottl2007-11-282-80/+68
| | | | | | | | | T_DIRECT filtering so that disk drives can be attached via the pass driver. Add CAM locking. Don't mark CAM commands as SG64 since the hardware isn't designed to deal with 64-bit passthru commands. Hopefully the bounce buffer changes that were done for the management/ioctl interface are robust enough to handle this deficiency for CAM as well.
* Prepare for future integration between CAM and newbus. xpt_bus_registerscottl2007-06-171-1/+1
| | | | | | | now takes a device_t to be the parent of the bus that is being created. Most SIMs have been updated with a reasonable argument, but a few exceptions just pass NULL for now. This argument isn't used yet and the newbus integration likely won't be ready until after 7.0-RELEASE.
* Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM willscottl2007-04-151-0/+1
| | | | | | | | | | | use to synchornize and protect all data objects that are used for that SIM. Drivers that are not yet MPSAFE register Giant and operate as usual. RIght now, no drivers are MPSAFE, though a few will be changed in the coming week as this work settles down. The driver API has changed, so all CAM drivers will need to be recompiled. The userland API has not changed, so tools like camcontrol do not need to be recompiled.
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-1/+1
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed.mjacob2006-12-111-0/+2
| | | | | PR: 106543 MFC after: 3 days
* 2nd and final commit that moves us to CAM_NEW_TRAN_CODEmjacob2006-11-021-20/+0
| | | | | | as the default. Reviewed by multitudes.
* Implement BIO_FLUSH handling for da(4), amr(4), ata(4) and ataraid(4).pjd2006-10-312-11/+22
| | | | Sponsored by: home.pl
* The first of 3 major steps to move the CAM layer forward to usingmjacob2006-10-311-2/+32
| | | | | | | | | | | | | | | | | | | | | the CAM_NEW_TRAN_CODE that has been in the tree for some years now. This first step consists solely of adding to or correcting CAM_NEW_TRAN_CODE pieces in the kernel source tree such that a both a GENERIC (at least on i386) and a LINT build with CAM_NEW_TRAN_CODE as an option will compile correctly and run (at least with some the h/w I have). After a short settle time, the other pieces (making CAM_NEW_TRAN_CODE the default and updating libcam and camcontrol) will be brought in. This will be an incompatible change in that the size of structures related to XPT_PATH_INQ and XPT_{GET,SET}_TRAN_SETTINGS change in both size and content. However, basic system operation and basic system utilities work well enough with this change. Reviewed by: freebsd-scsi and specific stakeholders
* Chain the bus_dmamap_load() calls when mapping a command with a data CCBjhb2006-07-171-24/+42
| | | | | | | | | | | | instead of doing the first load with the BUS_DMA_NOWAIT flag. On 4.x with PAE and > 4gb of RAM this proved disastrous if there weren't enough bounce pages as amr_mapcmd() would return failure but the callback would later fire once enough bounce pages were available and would then overwrite another command's S/G list. MFC after: 3 days Submitted by: scottl (4.x version) Reviewed by: scottl (port from 4.x to HEAD)
* Make amr_linux work as a module by avoiding calling amr_linux_ioctl_intambrisko2006-05-033-127/+41
| | | | | | | | from the amr_linux. This simplifies the amr_linux shim and puts the smarts into amr.c. I tested this with 2 amr controllers in one box. It seems to work okay with them.
* Reduce the Linux ioctl range to what is needed. I didn't know whatambrisko2006-04-141-2/+2
| | | | I was doing when I first set the range up.
* After further review and discussion, partially revert the previous commit.scottl2006-04-083-20/+13
| | | | | | | | | | The real problem was that ioctl handlers needed to call amr_wait_command() with the list lock held. This not only solves the completion race, it also prevents bounce buffer corruption that could arise from amr_start() being called without the proper locks held. Discussed with: ps MFC After: 3 days
* Close a pesky race where after checking the BUSY flag in amr_wait_command,ps2006-04-083-6/+21
| | | | | | | | the completion of the command can occur before tsleep is called and the command ends up blocking forever since the wakeup has already been called. Submitted by: ups
* Check the return value of copyin() and return an error if it fails.jhb2006-02-231-2/+4
| | | | | | | Coverity ID: 839 Found by: Coverity Prevent MFC after: 1 week Reviewed by: ps, scottl
* Use void * for pointer rather than u_int8_t *, since it doesn'timp2006-02-041-5/+4
| | | | matter. Well it does for type punning warnings.
* Enable 64bit SGL's on PERC 4/DCps2006-02-021-1/+1
|
* - Move the command setup from amr_start1 into the card specific submitps2006-02-022-61/+60
| | | | | | | routines. - Add or replace cpu_spinwait() with DELAY(1) to a few of the busy loops when reading from the controller to work around firmware bugs which can crash the controller.
* When the RAID firmware returns a failure, don't hard error the result.ambrisko2006-01-261-9/+4
| | | | | | | | | | | This is important with MegaLib, when issuing a GET_REBUILD_PROG since it returns an error if the drive is not in rebuild state. This will be MFC'ed shortly. Submitted by: ps Reviewed by: scottl Found by: ambrisko
* Add in the Linux IOCTL shim and create the megadev0 device soambrisko2006-01-241-0/+191
| | | | | | | | | | | | | | | | Linux LSI MegaRaid tools can run on FreeBSD until Linux emulation. Add in the Linux IOCTL shim and create the megadev0 device so Linux LSI MegaRaid tools can run on FreeBSD until Linux emulation. Add glue to build the modules but don't tie it into the build yet until I test it from the CVS repo. via the mirror on an amd64 machine. Tie this into the Linux32 emulation on amd64 so the tools can run on amd64 kernel. Cleaned up by: ps (amr_linux.c)
* Check the return value of copyin.scottl2006-01-141-1/+2
| | | | Found by: Coverity Prevent (tm)
* - Correct amr_enquiry3 structure[1].jkim2006-01-131-5/+5
| | | | | | | - Remove redundant AMR_CONFIG_ENQ3_SOLICITED_NOTIFY from the previous commit while I am here. PR: kern/29727 [1]
* Don't free the ap object if it was never created.scottl2006-01-101-1/+2
| | | | Submitted by: jkim
* Mega update to the LSI MegaRAID driver:scottl2005-12-147-286/+950
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Implement a large set of ioctl shims so that the Linux management apps from LSI will work. This includes infrastructure to support adding, deleting and rescanning arrays at runtime. This is based on work from Doug Ambrosko, heavily augmented by LSI and Yahoo. 2. Implement full 64-bit DMA support. Systems with more than 4GB of RAM can now operate without the cost of bounce buffers. Cards that cannot do 64-bit DMA will automatically revert to using bounce buffers. This option can be forced off by setting the 'hw.amr.force_sg32" tunable in the loader. It should only be turned off for debugging purposes. This work was sponsored by Yahoo. 3. Streamline the command delivery and interrupt handler paths after much discussion with Dell and LSI. The logic now closely matches the intended design, making it both more robust and much faster. Certain i/o failures under heavy load should be fixed with this. 4. Optimize the locking. In the interrupt handler, the card can be checked for completed commands without any locks held, due to the handler being implicitely serialized and there being no need to look at any shared data. Only grab the lock to return the command structure to the free pool. A small optimization can still be made to collect all of the completions together and then free them together under a single lock. Items 3 and 4 significantly increase the performance of the driver. On an LSI 320-2X card, transactions per second went from 13,000 to 31,000 in my testing with these changes. However, these changes are still fairly experimental and shouldn't be merged to 6.x until there is more testing. Thanks to Doug Ambrosko, LSI, Dell, and Yahoo for contributing towards this.
* The CAM interface is broken and seems to be causing lockups on boot. Itscottl2005-11-261-0/+13
| | | | | | | doesn't appear to have worked in a long time, so just disable it completely for now. MFC After: 3 days
* Remove spl markers from AMR.scottl2005-11-064-54/+6
| | | | MFC After: 3 days
* Complete the removal of __FreeBSD_version checks from the amr driver. Thescottl2005-08-085-114/+6
| | | | | driver had advanced enough over the years that direct sharing of code with FreeBSD 4.x was in no way possible anymore.
* Remove a stale __FreeBSD_version check.scottl2005-08-071-5/+3
|
* The presence of a on __FreeBSD_version flagged some code that hasn't been inscottl2005-08-071-23/+4
| | | | the right spot since the FreeBSD 3.x days, if not earlier.
* Print the actual disk device we failed to complete i/o on.ps2005-07-291-2/+2
|
* Don't allow ioctl commands to be interrupted by the user.ps2005-07-291-6/+4
|
* polled commands can read or write, so bus_dmamap_sync properlyps2005-06-231-2/+16
| | | | | | according to the type of request. Approved by: re
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-292-4/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
* handle potential null ptrsam2005-03-311-1/+3
| | | | Noticed by: Coverity Prevent analysis tool
* Fix a null pointer de-ref when passthrough ioctls are issued. Thisscottl2005-03-131-8/+11
| | | | | | involves some code shuffle to avoid locking problems. MFC After: 3 days
* Use BUS_PROBE_DEFAULT for pci probe return valueimp2005-03-051-1/+1
|
* Fix the ioctl path by ensuring that amr_start1() gets called for commandsscottl2005-03-041-18/+22
| | | | | | | | with no associated data. Also revert previous changes that allocate off of the stack instead of using malloc, as it's not needed. Many thanks to LSI for investigating and fixing these problems. Submitted by: rajeshpr @ lsil . com
* Remove some unused variables.scottl2005-02-091-2/+0
|
* Remove the messy locking dance around xpt_done()scottl2005-02-091-8/+0
|
* Add support for the LSI 320-2E PCI-Express controller. Fix a couple of bugsscottl2005-01-234-8/+17
| | | | | | in the ioctl handler. Update the LSI copyrights for these. Obtained from: LSI, Corp
* Add my copyright for the locking and busdma work.scottl2005-01-231-0/+1
|
* Lock the AMR driver:scottl2005-01-165-106/+120
| | | | | | | | | | - Introduce the amr_io_lock to control access to command queues, bio queues, and the hardware. - Eliminate the taskqueue and do all completion processing in the ithread. - Assign a static slot number to each command instead of doing a linear search for free slots each time a command is needed. - Modify the interrupt handler to more closely match what Linux does, for safety.
* Free the shared devq last since CAM expects it to be there ifdwhite2005-01-102-5/+11
| | | | | | | xpt_alloc_device() gets called, which can happen during detach in certain situations. Fixes module unload. MFC after: 3 days
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-064-4/+4
|
* Fix a number of bugs and significantly alter the command execution path toscottl2004-12-054-59/+168
| | | | | | | | | | properly support bounce buffers and resource shortages. This allows the driver to work properly and reliably with more than 4GB of RAM. Of the three data paths that exist in the driver, (block, CAM, ioctl), the ioctl path has not been well tested with these changes due to difficulty with finding an application that uses it that actually works. Sponsored by: The FreeBSD Foundation and FreeBSD Systems, Inc.
OpenPOWER on IntegriCloud