summaryrefslogtreecommitdiffstats
path: root/sys/dev/mpt
Commit message (Collapse)AuthorAgeFilesLines
* - Allocate the DMA memory shared between the host and the controller asmarius2011-03-063-31/+41
| | | | | | | | | | | | coherent. - Add some missing bus_dmamap_sync() calls. This includes putting such calls before calling reply handlers instead of calling bus_dmamap_sync() for the request queue from individual reply handlers as these handlers generally read back updates by the controller. Tested on amd64 and sparc64. MFC after: 2 weeks
* sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.mdf2011-01-122-3/+3
| | | | Commit the rest of the devices.
* Remove a redundant variable assignment found with the clang static analyzer.marius2011-01-051-1/+1
| | | | MFC after: 1 week
* Use bus_alloc_resource_any().jhb2010-12-281-4/+4
| | | | MFC after: 2 weeks
* Use the correct variable for determining the verbosity level in mpt_lprtc().marius2010-11-141-4/+4
| | | | | | | | While at it, fix the whitespace of that macro. PR: 149502 Submitted by: Andrew Boyer MFC after: 1 week
* Take mpt_req_on_{free,pending}_list() out from under INVARIANTS as thesemarius2010-09-241-7/+7
| | | | are generally useful and not just for debugging.
* Improve r56796; the reply handler actually may remove the request frommarius2010-09-241-1/+2
| | | | | | | the chain in which case it shouldn't be removed twice. Reported by: Staale Kristoffersen MFC after: 1 week
* Figure which is the IO and MEM bars- do not assume that they are inmjacob2010-08-061-4/+17
| | | | | | | | a fixed order. PR: 149220 Obtained from: John Baldwin MFC after: 1 month
* Correct inverted parent DMA tag parameters.marius2010-07-121-2/+2
| | | | | Reviewed by: ken MFC after: 3 days
* - Make the maxsize parameter of the data buffer DMA tag match maxio, whichmarius2010-07-122-4/+5
| | | | | | | | | | was missed in r209599. Reported and tested by: Michael Moll - Declare mpt_dma_buf_alloc() static just like mpt_dma_buf_free(), both are used in mpt.c only. Reviewed by: ken MFC after: r209599
* Change the mpt driver to allow larger I/O sizes.ken2010-06-295-113/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mpt driver previously didn't report a 'maxio' size to CAM, and so the da(4) driver limited I/O sizes to DFLTPHYS (64K) by default. The number of scatter gather segments allowed, as reported to busdma, was (128K / PAGE_SIZE) + 1, or 33 on architectures with 4K pages. Change things around so that we wait until we've determined how many segments the adapter can support before creating the busdma tag used for buffers, so we can potentially support more S/G segments and therefore larger I/O sizes. Also, fix some things that were broken about the module unload path. It still gets hung up inside CAM, though. mpt.c: Move some busdma initialization calls in here, and call them just after we've gotten the IOCFacts, and know how many S/G segments this adapter can support. mpt.h: Get rid of MPT_MAXPHYS, it is no longer used. Add max_cam_seg_cnt, which is used to report our maximum I/O size up to CAM. mpt_cam.c: Use max_cam_seg_cnt to report our maximum I/O size to CAM. Fix the locking in mpt_cam_detach(). mpt_pci.c: Pull some busdma initialization and teardown out and put it in mpt.c. We now delay it until we know many scatter gather segments the adapter can support, and therefore how to setup our busdma tags. mpt_raid.c: Make sure we wake up the right wait channel to get the raid thread to wake up when we're trying to shut it down. Reviewed by: gibbs, mjacob MFC after: 2 weeks
* Print IR_RESYNC updates informatively.mjacob2010-05-021-0/+4
| | | | | Obtained from: pluknet MFC after: 1 week
* On sparc64 obtain the initiator ID to be used for SPI HBAs from themarius2010-04-273-1/+16
| | | | | | | | Open Firmware device tree in order to match what the PROM built-in driver uses. This is especially important when netbooting Fujitsu Siemens PRIMEPOWER250 as in that case the built-in driver isn't used and the port facts PortSCSIID defaults to 0, conflicting with the disk at the same address.
* Replace a magic value with the appropriate macro.marius2010-04-271-2/+3
|
* nit: xpt_bus_deregister has to be called with the sim lock held.mjacob2010-03-301-0/+4
| | | | MFC after: 1 month
* Store path for rescan to the right place. This should fix panic on boot,mav2010-02-261-2/+1
| | | | introduced by r203108.
* Do not release device, when changing number of openings.mav2010-02-042-0/+2
|
* MFp4: Large set of CAM inprovements.mav2010-01-282-17/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Unify bus reset/probe sequence. Whenever bus attached at boot or later, CAM will automatically reset and scan it. It allows to remove duplicate code from many drivers. - Any bus, attached before CAM completed it's boot-time initialization, will equally join to the process, delaying boot if needed. - New kern.cam.boot_delay loader tunable should help controllers that are still unable to register their buses in time (such as slow USB/ PCCard/ CardBus devices), by adding one more event to wait on boot. - To allow synchronization between different CAM levels, concept of requests priorities was extended. Priorities now split between several "run levels". Device can be freezed at specified level, allowing higher priority requests to pass. For example, no payload requests allowed, until PMP driver enable port. ATA XPT negotiate transfer parameters, periph driver configure caching and so on. - Frozen requests are no more counted by request allocation scheduler. It fixes deadlocks, when frozen low priority payload requests occupying slots, required by higher levels to manage theit execution. - Two last changes were holding proper ATA reinitialization and error recovery implementation. Now it is done: SATA controllers and Port Multipliers now implement automatic hot-plug and should correctly recover from timeouts and bus resets. - Improve SCSI error recovery for devices on buses without automatic sense reporting, such as ATAPI or USB. For example, it allows CAM to wait, while CD drive loads disk, instead of immediately return error status. - Decapitalize diagnostic messages and make them more readable and sensible. - Teach PMP driver to limit maximum speed on fan-out ports. - Make boot wait for PMP scan completes, and make rescan more reliable. - Fix pass driver, to return CCB to user level in case of error. - Increase number of retries in cd driver, as device may return several UAs.
* Use a constant instead of a magic number for the flag that enables decodingjhb2009-12-301-1/+1
| | | | of a device ROM.
* Use callout_init_mtx on FreeBSD versions recent enough. This closeskan2009-10-204-21/+40
| | | | | | | | | | | the race where interrupt thread can complete the request for which timeout has fired and while mpt_timeout has blocked on mpt_lock. Do a best effort to keep 4.x ang Giant-locked configurartions compiling still. Reported by: ups Reviewed by: scottl
* Revert previous commit and add myself to the list of people who shouldphk2009-09-081-1/+0
| | | | know better than to commit with a cat in the area.
* Add necessary include.phk2009-09-081-0/+1
|
* Separate the parallel scsi knowledge out of the core of the XPT, andscottl2009-07-102-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | modularize it so that new transports can be created. Add a transport for SATA Add a periph+protocol layer for ATA Add a driver for AHCI-compliant hardware. Add a maxio field to CAM so that drivers can advertise their max I/O capability. Modify various drivers so that they are insulated from the value of MAXPHYS. The new ATA/SATA code supports AHCI-compliant hardware, and will override the classic ATA driver if it is loaded as a module at boot time or compiled into the kernel. The stack now support NCQ (tagged queueing) for increased performance on modern SATA drives. It also supports port multipliers. ATA drives are accessed via 'ada' device nodes. ATAPI drives are accessed via 'cd' device nodes. They can all be enumerated and manipulated via camcontrol, just like SCSI drives. SCSI commands are not translated to their ATA equivalents; ATA native commands are used throughout the entire stack, including camcontrol. See the camcontrol manpage for further details. Testing this code may require that you update your fstab, and possibly modify your BIOS to enable AHCI functionality, if available. This code is very experimental at the moment. The userland ABI/API has changed, so applications will need to be recompiled. It may change further in the near future. The 'ada' device name may also change as more infrastructure is completed in this project. The goal is to eventually put all CAM busses and devices until newbus, allowing for interesting topology and management options. Few functional changes will be seen with existing SCSI/SAS/FC drivers, though the userland ABI has still changed. In the future, transports specific modules for SAS and FC may appear in order to better support the topologies and capabilities of these technologies. The modularization of CAM and the addition of the ATA/SATA modules is meant to break CAM out of the mold of being specific to SCSI, letting it grow to be a framework for arbitrary transports and protocols. It also allows drivers to be written to support discrete hardware without jeopardizing the stability of non-related hardware. While only an AHCI driver is provided now, a Silicon Image driver is also in the works. Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware is possible and encouraged. Help with new transports is also encouraged. Submitted by: scottl, mav Approved by: re
* Use MPT_MAX_LUNS as maximium number of LUNs, not 7, for SAS and FC cases.delphij2009-07-021-1/+4
| | | | | | | | This matches Linux driver behavior. Discussed with: scottl Approved by: re (kensmith) MFC after: 1 month
* Change explicit maximium numbers to the defined macro MPT_MAX_LUNS.delphij2009-07-021-4/+4
| | | | Approved by: re (kensmith)
* - Remove unused variables. [1]marius2009-06-241-25/+3
| | | | | | | | | | - Remove redundant zeroing of tmf_req which Coverity Prevent(tm) complains about. [2] Submitted by: Christoph Mallon [1] Found with: Coverity Prevent(tm) [2] CID: 2496 [2] MFC after: 2 weeks
* Largely revert the earlier change to use a single CCB for the RAID recoveryjhb2009-05-211-3/+8
| | | | | | | | | | thread. Multiple RAID events in quick succession can cause an additional bus rescan to be scheduled before an earlier scan has completed. In this case the driver was attempting to use the same CCB storage for two requests. PR: kern/130330 Reviewed by: Riccardo Torrini riccardo.torrini | esaote com MFC after: 1 week
* We no longer need to use d_thread_t, migrate to struct thread *.imp2009-05-201-3/+3
|
* Make the whole initiator mode part of mpt(4) endian-clean,marius2009-01-075-37/+223
| | | | | | | | | | | | | | | | | | | specifically SPI controllers now also work in big-endian machines and some conversions relevant for FC and SAS controllers as well as support for ILP32 machines which all were omitted in previous attempts are now also implemented. The IOCTL-interface is intentionally left (and where needed actually changed) to be completely little-endian as otherwise we would have to add conversion code for every possible configuration page to mpt(4), which didn't seem the right thing to do, neither did converting only half of the user- interface to the native byte order. This change was tested on amd64 (SAS+SPI), i386 (SAS) and sparc64 (SAS+SPI). Due to lack of the necessary hardware the target mode code is still left to be made endian-clean. Reviewed by: scottl MFC after: 1 month
* Allocate a single CCB at the start of the main loop of the RAID monitoringjhb2008-07-211-4/+4
| | | | | | | | | | kthread of the mpt(4) driver that hangs around for the entire lifetime of the thread. Previously the driver would allocate a new CCB using M_WAITOK with a lock held each time it updated its state. While here, use the CAM API for allocating a CCB rather than raw malloc(9). Reviewed by: scottl MFC after: 1 week
* Rework how the mpt_user personality handles buffers for config pages.jhb2008-07-011-67/+105
| | | | | | | | | | | | | | Previously we reused the space in the request buffer after the request header to hold config pages during a transaction. This does not work when reading large pages however. Also, we were already malloc'ing a buffer to do a copyin/copyout w/o holding locks that was then copied into/out of the request buffer. Instead, go ahead and use bus dma to alloc a buffer for each config page request (and RAID actions that have an associated ActionSGE). This results in fewer data copies and allows for larger sized requests. For now the maximum size of a request is arbitrarily limited to 16 MB. MFC after: 2 weeks
* During shutdown, deregister the shutdown hook from the correct eventjhb2008-07-011-1/+1
| | | | | | handler. MFC after: 2 weeks
* Add support for LSI 1078DE (ServeRAID-AR10is SAS/SATAdelphij2008-05-101-0/+6
| | | | | | Controller) MFC after: 2 weeks
* Add a new personality to mpt(4) devices to allow userland applications tojhb2008-05-062-0/+758
| | | | | | | | | perform various operations on a controller. Specifically, for each mpt(4) device, create a character device in devfs which accepts ioctl requests for reading and writing configuration pages and performing RAID actions. MFC after: 1 week Reviewed by: scottl
* Restore multi-release tradition of the driver.jkim2008-05-023-7/+20
| | | | Reviewed by: mjacob
* Don't force a reset at driver attach time. It doesn't work on somescottl2008-04-031-1/+1
| | | | adapters, apparently.
* The MPT driver treats the "core" module with the same importance andscottl2008-03-311-4/+7
| | | | | | | | | | | | | | | | abstraction as the RAID and CAM modules, making it nearly impossible for enough initialization to be done in time for the RAID module to know whether to attach. On top of this, no reset was being done on the controller on attach, in violation of the spec. Additionally, the port enable step was being deferred to the end of the attach process, long after it should have been done to ensure reliable operation from the controller. Fix all of these with a few hacks to force the "attach" and "enable" steps of the core module early on, and ensure that a reset and port enable also happens early on. In the future, the driver needs to be refactored to eliminate the core module abstraction, clean up withe reset/enable steps, and defer event messages until all of the modules are available to recieve them.
* Ever since the module registration system was introduced to this driver,scottl2007-11-031-1/+2
| | | | | | it's been printing out scary messages about "Unhanded Event Notify Frame" that are needlessly worrisome to users. Change this warning to only print out at an elevated debugging level.
* fix up some code for older systems changed by accident in the last commitjulian2007-10-211-1/+6
| | | | | this whole support for systems earlier than 5.0 should probably be removed but I'll at least FIX it before removing it, so that CVS has it right.
* Rename the kthread_xxx (e.g. kthread_create()) callsjulian2007-10-203-4/+4
| | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
* For some blasted reason the SATA WC change frees a structure right in thescottl2007-10-121-1/+0
| | | | middle of using it.
* Spelling fix for interupt -> interruptkevlo2007-10-121-3/+3
|
* Fix an incorrect PCI device id. The current value conflicts withambrisko2007-09-181-1/+1
| | | | | | | | | | the mfi(4) LSI MegaSAS RAID card. Looking at the Linux driver for the mpt(4) it should be 0x0062 and not 0x0060. Tested with an mfi card of this device id. Approved by: re (bmah) Reviewed by: scottl MFC after: 3 days
* Move callout initialization to the proper spot. This prevents panics duringscottl2007-08-143-8/+1
| | | | | | | error recovery. Approved by: re Found by: kan
* Fix some debugging code that crept in accidentally.scottl2007-06-181-3/+3
|
* Prepare for future integration between CAM and newbus. xpt_bus_registerscottl2007-06-171-5/+5
| | | | | | | 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.
* Track an update in the MPI headers that was missed earlier.scottl2007-06-041-1/+1
|
* Free the portinfo object on unload.scottl2007-06-041-0/+4
|
* mpt.c:scottl2007-06-033-32/+514
| | | | | | | | | | | | | | | | | | | | | | | | | mpt.h: Add support for reading extended configuration pages. mpt_cam.c: Do a top level topology scan on the SAS controller. If any SATA device are discovered in this scan, send a passthrough FIS to set the write cache. This is controllable through the following tunable at boot: hw.mpt.enable_sata_wc: -1 = Do not configure, use the controller default 0 = Disable the write cache 1 = Enable the write cache The default is -1. This tunable is just a hack and may be deprecated in the future. Turning on the write cache alleviates the write performance problems with SATA that many people have observed. It is not recommend for those who value data reliability! I cannot stress this strongly enough. However, it is useful in certain circumstances, and it brings the performence in line with what a generic SATA controller running under the FreeBSD ATA driver provides (and the ATA driver has had the WC enabled by default for years).
* Update to MPI 1.5.16scottl2007-06-039-456/+589
|
OpenPOWER on IntegriCloud