summaryrefslogtreecommitdiffstats
path: root/sys/dev/mpt
Commit message (Collapse)AuthorAgeFilesLines
* MFC: r285840marius2015-12-272-9/+14
| | | | | | | | | - In mpt_send_handshake_cmd(), use bus_space_write_stream_4(9) for writing raw data to the doorbell offset in order to clarify the intent and for avoiding unnecessarily converting the endianess back and forth. Unfortunately, the same can't be done in mpt_recv_handshake_reply() as 16-bit data needs to be read using 32-bit bus accessors. - In mpt_recv_handshake_reply(), get rid of a redundant variable.
* MFC r274926: Squelch a (bogus) gcc used before init warningian2014-12-271-0/+1
|
* MFC r274819:smh2014-12-213-13/+15
| | | | | | | | | Prevent overflow issues in timeout processing MFC r274852: Fix build with asr driver Sponsored by: Multiplay
* MFC r267690hiren2014-06-271-2/+5
| | | | Hide a harmless "QUEUE FULL EVENT" message behind bootverbose.
* MFC: r260058marius2014-04-254-201/+49
| | | | | | | | | | | - Remove a redundant variable in mpt_pci_attach(). - #if 0 the currently unused paired port linking and unlinking of dual adapters. - Simplify MSI/MSI-X allocation and release. For a single one, we don't need to fiddle with the MSI/MSI-X count and pci_release_msi(9) is smart enough to just do nothing in case of INTx. - Canonicalize actions taken on attach failure and detach. - Remove the remainder of incomplete support for older FreeBSD versions.
* MFC r258779,r258780,r258787,r258822:eadler2014-02-041-2/+2
| | | | | | | | | | | | | Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this shifts into the sign bit. Instead use (1U << 31) which gets the expected result. Similar to the (1 << 31) case it is not defined to do (2 << 30). This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD.
* MFC r256826:mav2014-01-051-2/+1
| | | | | Fix several target mode SIMs to not blindly clear ccb_h.flags field of ATIO CCBs. Not all CCB flags there belong to them.
* Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIscottl2013-08-121-6/+1
| | | | | | | | | | | | | | | | | command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit. This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot. Submitted by: jhb Reviewed by: jfv, marius, achadd, achim MFC after: 1 day
* Flag mpt(4) as supporting unmapped I/O; all necessary conversion actuallymarius2013-06-241-5/+5
| | | | | | already has been done as part of r246713 except for a comment update. MFC after: 3 days
* Explicitly use a pair of parentheses to ensure correct evaluationdelphij2013-05-312-3/+3
| | | | | | | ordering for bitwise operation. Submitted by: swildner (DragonFly) MFC after: 2 weeks
* Move hptmv and mpt drivers shutdown a bit later to the SHUTDOWN_PRI_LASTmav2013-04-241-1/+1
| | | | | | | stage of shutdown_post_sync. That should allow CAM to do final cache flush at the SHUTDOWN_PRI_DEFAULT without using polling magic. MFC after: 3 days
* MFprojects/camlock r248982:mav2013-04-142-4/+4
| | | | | | | | Stop abusing xpt_periph in random plases that really have no periph related to CCB, for example, bus scanning. NULL value is fine in such cases and it is correctly logged in debug messages as "noperiph". If at some point we need some real XPT periphs (alike to pmpX now), quite likely they will be per-bus, and not a single global instance as xpt_periph now.
* Reform the busdma API so that new types may be added without modifyingkib2013-02-121-100/+20
| | | | | | | | | | | | | | | | | | | | | every architecture's busdma_machdep.c. It is done by unifying the bus_dmamap_load_buffer() routines so that they may be called from MI code. The MD busdma is then given a chance to do any final processing in the complete() callback. The cam changes unify the bus_dmamap_load* handling in cam drivers. The arm and mips implementations are updated to track virtual addresses for sync(). Previously this was done in a type specific way. Now it is done in a generic way by recording the list of virtuals in the map. Submitted by: jeff (sponsored by EMC/Isilon) Reviewed by: kan (previous version), scottl, mjacob (isp(4), no objections for target mode changes) Discussed with: ian (arm changes) Tested by: marius (sparc64), mips (jmallet), isci(4) on x86 (jharris), amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>)
* Remove support for using Giant for locking within mpt(4). Finer grainedmarius2012-10-223-117/+0
| | | | | | locking has been working fine for ~5.5 years by now. MFC after: 1 week
* After r241858, remove the remainder of FreeBSD ~4 support from mpt(4).marius2012-10-225-252/+30
| | | | MFC after: 1 week
* Now that device disabling is generic, remove the non-standardeadler2012-10-221-5/+0
| | | | | | | | | implementation from mpt Don't MFC this to retain backwards compatibility. Reviewed by: des, mjacob Approved by: cperciva
* Remove unused code since the 5.x dayseadler2012-10-221-63/+0
| | | | | | Reviewed by: des, scottl Approved by: cperciva MFC after: 1 week
* Fix an issue that caused the kernel to panic inside CTL when tryingken2012-06-261-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to attach to target capable HBAs that implement the old immediate notify (XPT_IMMED_NOTIFY) and notify acknowledge (XPT_NOTIFY_ACK) CCBs. The new API has been in place since SVN change 196008 in 2009. The solution is two-fold: fix CTL to handle the responses from the HBAs, and convert the HBA drivers in question to use the new API. These drivers have not been tested with CTL, so how well they will interoperate with CTL is unknown. scsi_target.c: Update the userland target example code to use the new immediate notify API. scsi_ctl.c: Detect when an immediate notify CCB is returned with CAM_REQ_INVALID or CAM_PROVIDE_FAIL status, and just free it. Fix a duplicate assignment. aic79xx.c, aic79xx_osm.c: Update the aic79xx driver to use the new API. Target mode is not enabled on for this driver, so the changes will have no practical effect. aic7xxx.c, aic7xxx_osm.c: Update the aic7xxx driver to use the new API. sbp_targ.c: Update the firewire target code to work with the new API. mpt_cam.c: Update the mpt(4) driver to work with the new API. Target mode is only enabled for Fibre Channel mpt(4) devices. MFC after: 3 days
* Correct sizeof usagekevlo2012-06-251-1/+1
| | | | Obtained from: DragonFly
* Refine r233827; as it turns out, controllers with a device ID of 0x0059marius2012-04-041-2/+10
| | | | | | | | | | can be upgraded to MegaRAID mode, in which case mfi(4) should attach to these based on the sub-vendor and -device ID instead (not currently done). Therefore, let mpt_pci_probe() return BUS_PROBE_LOW_PRIORITY. While it, let mpt_pci_probe() return BUS_PROBE_DEFAULT instead of 0 in the default case. MFC after: 3 days
* Fix probing of SAS1068E with a device ID of 0x0059 after r232411.marius2012-04-031-0/+6
| | | | | | Reported by: infofarmer MFC after: 3 days
* Consistently update to the MPI header set version 01.05.20 after r224761.marius2012-03-2414-271/+569
| | | | | | Requested by: mjacob MFC after: 1 week
* As it turns out, mpi_cnfg.h already is included by mpt.h.marius2012-03-241-2/+0
|
* - Use the PCI ID macros from mpi_cnfg.h rather than duplicating them here.marius2012-03-242-151/+82
| | | | | | | | | | | | | | | | | | | | Note that this driver additionally probes some device IDs for the most part not know to other MPT drivers, if at all. So rename the macros not present in mpi_cnfg.h to match the naming scheme in the latter and but suffix them with a _FB in order to not cause conflicts. - Like mpt_set_config_regs(), comment out mpt_read_config_regs() as the content of the registers read isn't actually used and both functions aren't exactly up to date regarding the possible layouts of the BARs (these function might be helpful for debugging though, so don't remove them completely). - Use DEVMETHOD_END. - Use NULL rather than 0 for pointers. - Remove an unusual check for the softc being NULL. - Remove redundant zeroing of the softc. - Remove an overly banal and actually partly incorrect as well as partly outdated comment regarding the allocation of the memory resource. MFC after: 3 days
* Fix a problem that was causing the mpt(4) driver to attach to MegaRAIDken2012-03-021-6/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cards that should be handled by the mfi(4) driver. The root of the problem is that the mpt(4) driver was masking off the bottom bit of the PCI device ID when deciding which cards to attach to. It appears that a number of the mpt(4) Fibre Channel cards had a LAN variant whose PCI device ID was just one bit off from the FC card's device ID. The FC cards were even and the LAN cards were odd. The problem was that this pattern wasn't carried over on the SAS and parallel SCSI mpt(4) cards. Luckily the SAS and parallel SCSI PCI device IDs were either even numbers, or they would get masked to a supported adjacent PCI device ID, and everything worked well. Now LSI is using some of the odd-numbered PCI device IDs between the 3Gb SAS device IDs for their new MegaRAID cards. This is causing the mpt(4) driver to attach to the RAID cards instead of the mfi(4) driver. The solution is to stop masking off the bottom bit of the device ID, and explicitly list the PCI device IDs of all supported cards. This change should be a no-op for mpt(4) hardware. The only intended functional change is that for the 929X, the is_fc variable gets set. It wasn't being set previously, but needs to be because the 929X is a Fibre Channel card. Reported by: Kashyap Desai <Kashyap.Desai@lsi.com> MFC After: 3 days
* Change some headers such that lang/gcc* ports no longer patch them.tijl2012-02-141-1/+1
| | | | | | | The lang/gcc* ports patch headers where they think something is non-standard. These patched headers override the system headers which means you have to rebuild these ports whenever you do installworld to make sure they contain the latest changes.
* Flesh out support for SAS1078 and SAS1078DE (which are said to actuallymarius2012-02-115-33/+67
| | | | | | | | | | | | | | | | | be the same chip): - The I/O port resource may not be available with these. However, given that we actually only need this resource for some controllers that require their firmware to be up- and downloaded (which excludes the SAS1078{,DE}) just handle failure to allocate this resource gracefully when possible. While at it, generally put non-fatal resource allocation failures under bootverbose. - SAS1078{,DE} use a different hard reset protocol. - Add workarounds for the 36GB physical address limitation of scatter/ gather elements of these controllers. Tested by: Slawa Olhovchenkov PR: 149220 (remaining part)
* Remove extra newlines from panic messages.marius2012-02-083-20/+19
|
* Increase the IOC port initialization timeouts by ten times to what themarius2011-11-011-1/+1
| | | | | | | | | | | corresponding Linux driver uses. This allows mpt(4) to still recognize all good SATA devices in presence of a defective one, which takes about 45 seconds. In the long term we probably should implement the logic used by mpt2sas(4) allowing IOC port initialization to complete at a later time. Submitted by: Andrew Boyer MFC after: 3 days
* Sync with ahc(4)/ahd(4)/sym(4) etc:marius2011-10-071-0/+1
| | | | | | | Zero any sense not transferred by the device as the SCSI specification mandates that any untransferred data should be assumed to be zero. Reviewed by: ken
* Add descriptor sense support to CAM, and honor sense residuals properly inken2011-10-031-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CAM. Desriptor sense is a new sense data format that originated in SPC-3. Among other things, it allows for an 8-byte info field, which is necessary to pass back block numbers larger than 4 bytes. This change adds a number of new functions to scsi_all.c (and therefore libcam) that abstract out most access to sense data. This includes a bump of CAM_VERSION, because the CCB ABI has changed. Userland programs that use the CAM pass(4) driver will need to be recompiled. camcontrol.c: Change uses of scsi_extract_sense() to use scsi_extract_sense_len(). Use scsi_get_sks() instead of accessing sense key specific data directly. scsi_modes: Update the control mode page to the latest version (SPC-4). scsi_cmds.c, scsi_target.c: Change references to struct scsi_sense_data to struct scsi_sense_data_fixed. This should be changed to allow the user to specify fixed or descriptor sense, and then use scsi_set_sense_data() to build the sense data. ps3cdrom.c: Use scsi_set_sense_data() instead of setting sense data manually. cam_periph.c: Use scsi_extract_sense_len() instead of using scsi_extract_sense() or accessing sense data directly. cam_ccb.h: Bump the CAM_VERSION from 0x15 to 0x16. The change of struct scsi_sense_data from 32 to 252 bytes changes the size of struct ccb_scsiio, but not the size of union ccb. So the version must be bumped to prevent structure mis-matches. scsi_all.h: Lots of updated SCSI sense data and other structures. Add function prototypes for the new sense data functions. Take out the inline implementation of scsi_extract_sense(). It is now too large to put in a header file. Add macros to calculate whether fields are present and filled in fixed and descriptor sense data scsi_all.c: In scsi_op_desc(), allow the user to pass in NULL inquiry data, and we'll assume a direct access device in that case. Changed the SCSI RESERVED sense key name and description to COMPLETED, as it is now defined in the spec. Change the error recovery action for a number of read errors to prevent lots of retries when the drive has said that the block isn't accessible. This speeds up reconstruction of the block by any RAID software running on top of the drive (e.g. ZFS). In scsi_sense_desc(), allow for invalid sense key numbers. This allows calling this routine without checking the input values first. Change scsi_error_action() to use scsi_extract_sense_len(), and handle things when invalid asc/ascq values are encountered. Add a new routine, scsi_desc_iterate(), that will call the supplied function for every descriptor in descriptor format sense data. Add scsi_set_sense_data(), and scsi_set_sense_data_va(), which build descriptor and fixed format sense data. They currently default to fixed format sense data. Add a number of scsi_get_*() functions, which get different types of sense data fields from either fixed or descriptor format sense data, if the data is present. Add a number of scsi_*_sbuf() functions, which print formatted versions of various sense data fields. These functions work for either fixed or descriptor sense. Add a number of scsi_sense_*_sbuf() functions, which have a standard calling interface and print the indicated field. These functions take descriptors only. Add scsi_sense_desc_sbuf(), which will print a formatted version of the given sense descriptor. Pull out a majority of the scsi_sense_sbuf() function and put it into scsi_sense_only_sbuf(). This allows callers that don't use struct ccb_scsiio to easily utilize the printing routines. Revamp that function to handle descriptor sense and use the new sense fetching and printing routines. Move scsi_extract_sense() into scsi_all.c, and implement it in terms of the new function, scsi_extract_sense_len(). The _len() version takes a length (which should be the sense length - residual) and can indicate which fields are present and valid in the sense data. Add a couple of new scsi_get_*() routines to get the sense key, asc, and ascq only. mly.c: Rename struct scsi_sense_data to struct scsi_sense_data_fixed. sbp_targ.c: Use the new sense fetching routines to get sense data instead of accessing it directly. sbp.c: Change the firewire/SCSI sense data transformation code to use struct scsi_sense_data_fixed instead of struct scsi_sense_data. This should be changed later to use scsi_set_sense_data(). ciss.c: Calculate the sense residual properly. Use scsi_get_sense_key() to fetch the sense key. mps_sas.c, mpt_cam.c: Set the sense residual properly. iir.c: Use scsi_set_sense_data() instead of building sense data by hand. iscsi_subr.c: Use scsi_extract_sense_len() instead of grabbing sense data directly. umass.c: Use scsi_set_sense_data() to build sense data. Grab the sense key using scsi_get_sense_key(). Calculate the sense residual properly. isp_freebsd.h: Use scsi_get_*() routines to grab asc, ascq, and sense key values. Calculate and set the sense residual. MFC after: 3 days Sponsored by: Spectra Logic Corporation
* o Improve 224494:marius2011-08-102-3/+34
| | | | | | | | | | | - Ignore some more internal SAS device status change events. - Correct inverted Bus and TargetID arguments in a warning. o Add a warning for MPI_EVENT_SAS_DISCOVERY_ERROR events, which can help identifying broken disks. Submitted by: Andrew Boyer Approved by: re (kib) Committed from: Chaos Communication Camp 2011
* - Send the RELSIM_ADJUST_OPENINGS in response to a MPI_EVENT_QUEUE_FULL usingmarius2011-07-293-2/+86
| | | | | | | | | | | | | | | | | | | | the right SIM in case the HBA is RAID-capable but the target in question is not a hot spare or member of a RAID volume. - Report the loss and addition of SAS and SATA targets detected via PHY link status changes and signalled by MPI_EVENT_SAS_DEVICE_STATUS_CHANGE to cam(4) as lost devices and trigger rescans as appropriate. Without this it can take quite some time until a lost device actually is no longer tried to be used, if it ever stops. [1] - Handle MPI_EVENT_IR2, MPI_EVENT_LOG_ENTRY_ADDED, MPI_EVENT_SAS_DISCOVERY and MPI_EVENT_SAS_PHY_LINK_STATUS silently as these serve no additional purpose beyond adding cryptic entries to logs. Thanks to Hans-Joerg Sirtl for providing one of the HBAs these changes were developed with and RIP to the mainboard that didn't survive testing them. PR: 157534 [1] Approved by: re (kib) MFC after: 2 weeks
* - Staticize functions as appropriate and comment out unused ones.marius2011-07-298-96/+152
| | | | | | | | | - Sprinkle some const where appropriate. - Consistently use target_id_t for the target parameter of mpt_map_physdisk() and mpt_is_raid_volume(). - Fix some whitespace bugs. Approved by: re (kib)
* - For SAS but neither FC nor SPI controllers default to using MSI (stillmarius2011-07-132-22/+20
| | | | | | | | | | | | allowing their use to be disabled via device hints though). This matches what the corresponding Linux driver provided by LSI does. Tested with SAS1064. - There's no need to keep track of the RIDs used. - Don't allocate MSI/MSI-X as RF_SHAREABLE. - Remove a comment which no longer applies since r209599. - Assign NULL rather than 0 to pointers. MFC after: 1 month
* Remove extra empty lines.marius2011-07-131-11/+0
|
* Correct spelling.marius2011-04-225-19/+19
| | | | Submitted by: brucec
* - 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.
OpenPOWER on IntegriCloud