360451 |
28-Apr-2020 |
brooks |
MFC r359937:
Centralize compatability translation macros.
Copy the CP, PTRIN, etc macros from freebsd32.h into a sys/abi_compat.h and replace existing definitation with includes where required. This eliminates duplicate code and allows Linux and FreeBSD compatability headers to be included in the same files.
Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24275 |
331722 |
29-Mar-2018 |
eadler |
Revert r330897:
This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code.
Revert with prejudice.
This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes.
Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes.
Requested by: gjb (re) |
330897 |
14-Mar-2018 |
eadler |
Partial merge of the SPDX changes
These changes are incomplete but are making it difficult to determine what other changes can/should be merged.
No objections from: pfg |
315827 |
23-Mar-2017 |
mav |
MFC r315067: Partially fix target task management requests handling.
- XPT_NOTIFY_ACKNOWLEDGE was not handled, causing stuck requests. - XPT_ABORT was not even trying to abort active ATIOs/INOTs. - Initiator's tag was not stored and not used where needed. - List of TM request types needed update. - mpt_scsi_tgt_status() missed some useful debugging.
After this change global TM requests, such as reset, should work properly. ABORT TASK (ABTS) requests are still not passes to CTL, that is not good and should be fixed. |
315825 |
23-Mar-2017 |
mav |
MFC r315004: Add PIM_EXTLUNS support to mpt(4).
Target mode is still limited to 256 LUNs due to the way driver is written, but initiator can now use full 8 byte LUN space. |
315823 |
23-Mar-2017 |
mav |
MFC r315002: Improve residuals reporting in target mode. |
315822 |
23-Mar-2017 |
mav |
MFC r315001: Fix panic on wildcard target LUN disable. |
315820 |
23-Mar-2017 |
mav |
MFC r314998: Fix FC target mode in mpt(4), broken in multiple ways.
- Not set BufferLength caused receive of empty ATIOs. - CDB length guessing was broken at least for RC16. - mpt_req_untimeout() was called with wrong req parameter. - Sense data reporting was broken in several ways.
With this change my LSI7204EP-LC can pass at least basic tests as target. The code is still far from perfect, but finally I found second hw/driver after isp(4) that really can work in CAM target mode. |
315818 |
23-Mar-2017 |
mav |
MFC r314967: Add support for XPT_GET_SIM_KNOB in FC mode. |
315816 |
23-Mar-2017 |
mav |
MFC r314968: Report some more data in XPT_PATH_INQ.
I am not sure they are used anywhere, but why not. |
315814 |
23-Mar-2017 |
mav |
MFC r314966: Report FC link speed. |
315812 |
23-Mar-2017 |
mav |
MFC r311305 (by asomers): Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)
The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are fixed-length strings. AFAICT the only place they're read is in sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated. However, the kernel doesn't null-terminate them. A bunch of copy-pasted code uses strncpy to write them, and doesn't guarantee null-termination. For at least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually overflows. You can see the result by doing "camcontrol negotiate da0 -v".
This change null-terminates those fields everywhere they're set in the kernel. It also shortens a few strings to ensure they'll fit within the 16-character field.
PR: 215474 Reported by: Coverity CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005 CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000 CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014 CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021 CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027 CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187 CID: 1010035 1010036 1010042 1010041 1010040 1010039 |
315810 |
23-Mar-2017 |
mav |
MFC r308423 (by scottl): Fix the fallout from r308268 (mpt driver causes endless witness warnings in VMWare and elsewhere) with the precision of a dull, rusty butter knife. |
315808 |
23-Mar-2017 |
mav |
MFC r303874 (by trasz): Remove NULL check after M_WAITOK allocation from mpt(4). |
302408 |
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
298955 |
03-May-2016 |
pfg |
sys/dev: minor spelling fixes.
Most affect comments, very few have user-visible effects.
|
297862 |
12-Apr-2016 |
pfg |
Replace 0 with NULL for pointers in misc. device drivers.
Found with devel/coccinelle.
|
285840 |
24-Jul-2015 |
marius |
- 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 after: 1 fortnight
|
274926 |
23-Nov-2014 |
ian |
Squelch a (bogus) used before init warning when building with gcc.
|
274819 |
21-Nov-2014 |
smh |
Prevent overflow issues in timeout processing
Previously, any timeout value for which (timeout * hz) will overflow the signed integer, will give weird results, since callout(9) routines will convert negative values of ticks to '1'. For unsigned integer overflow we will get sufficiently smaller timeout values than expected.
Switch from callout_reset, which requires conversion to int based ticks to callout_reset_sbt to avoid this.
Also correct isci to correctly resolve ccb timeout.
This was based on the original work done by Eygene Ryabinkin <rea@freebsd.org> back in 5 Aug 2011 which used a macro to help avoid the overlow.
Differential Revision: https://reviews.freebsd.org/D1157 Reviewed by: mav, davide MFC after: 1 month Sponsored by: Multiplay
|
267690 |
20-Jun-2014 |
hiren |
Hide a harmless "QUEUE FULL EVENT" message behind bootverbose.
Requested by: A bunch of users on mailing-lists Suggested by: scottl MFC after: 1 week Sponsored by: Yahoo! inc.
|
260058 |
29-Dec-2013 |
marius |
- 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 after: 1 week
|
258780 |
30-Nov-2013 |
eadler |
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.
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.
Discussed with: -arch, rdivacky Reviewed by: cperciva
|
257381 |
30-Oct-2013 |
nwhitehorn |
Adjust various SCSI drivers to handle either a 32-bit or 64-bit lun_id_t, mostly by adjustments to debugging printf() format specifiers. For high numbered LUNs, also switch to printing them in hex as per SAM-5.
MFC after: 2 weeks
|
256826 |
21-Oct-2013 |
mav |
Partial MFproject/camlock r256671: Fix several target mode SIMs to not blindly clear ccb_h.flags field of ATIO CCBs. Not all CCB flags there belong to them.
|
254263 |
12-Aug-2013 |
scottl |
Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI 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
|
252180 |
24-Jun-2013 |
marius |
Flag mpt(4) as supporting unmapped I/O; all necessary conversion actually already has been done as part of r246713 except for a comment update.
MFC after: 3 days
|
251187 |
31-May-2013 |
delphij |
Explicitly use a pair of parentheses to ensure correct evaluation ordering for bitwise operation.
Submitted by: swildner (DragonFly) MFC after: 2 weeks
|
249849 |
24-Apr-2013 |
mav |
Move hptmv and mpt drivers shutdown a bit later to the SHUTDOWN_PRI_LAST 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
|
249468 |
14-Apr-2013 |
mav |
MFprojects/camlock r248982: 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.
|
246713 |
12-Feb-2013 |
kib |
Reform the busdma API so that new types may be added without modifying 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>)
|
241875 |
22-Oct-2012 |
marius |
Remove support for using Giant for locking within mpt(4). Finer grained locking has been working fine for ~5.5 years by now.
MFC after: 1 week
|
241874 |
22-Oct-2012 |
marius |
After r241858, remove the remainder of FreeBSD ~4 support from mpt(4).
MFC after: 1 week
|
241863 |
22-Oct-2012 |
eadler |
Now that device disabling is generic, remove the non-standard implementation from mpt
Don't MFC this to retain backwards compatibility.
Reviewed by: des, mjacob Approved by: cperciva
|
241858 |
22-Oct-2012 |
eadler |
Remove unused code since the 5.x days
Reviewed by: des, scottl Approved by: cperciva MFC after: 1 week
|
237601 |
26-Jun-2012 |
ken |
Fix an issue that caused the kernel to panic inside CTL when trying 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
|
237546 |
25-Jun-2012 |
kevlo |
Correct sizeof usage
Obtained from: DragonFly
|
233886 |
04-Apr-2012 |
marius |
Refine r233827; as it turns out, controllers with a device ID of 0x0059 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
|
233827 |
03-Apr-2012 |
marius |
Fix probing of SAS1068E with a device ID of 0x0059 after r232411. Reported by: infofarmer
MFC after: 3 days
|
233425 |
24-Mar-2012 |
marius |
Consistently update to the MPI header set version 01.05.20 after r224761. Requested by: mjacob
MFC after: 1 week
|
233404 |
24-Mar-2012 |
marius |
As it turns out, mpi_cnfg.h already is included by mpt.h.
|
233403 |
24-Mar-2012 |
marius |
- Use the PCI ID macros from mpi_cnfg.h rather than duplicating them here. 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
|
232411 |
02-Mar-2012 |
ken |
Fix a problem that was causing the mpt(4) driver to attach to MegaRAID 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
|
231678 |
14-Feb-2012 |
tijl |
Change some headers such that lang/gcc* ports no longer patch them.
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.
|
231518 |
11-Feb-2012 |
marius |
Flesh out support for SAS1078 and SAS1078DE (which are said to actually 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)
|
231228 |
08-Feb-2012 |
marius |
Remove extra newlines from panic messages.
|
227001 |
01-Nov-2011 |
marius |
Increase the IOC port initialization timeouts by ten times to what the 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
|
226118 |
07-Oct-2011 |
marius |
Sync with ahc(4)/ahd(4)/sym(4) etc: 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
|
225950 |
03-Oct-2011 |
ken |
Add descriptor sense support to CAM, and honor sense residuals properly in 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
|
224761 |
10-Aug-2011 |
marius |
o Improve 224494: - 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
|
224494 |
29-Jul-2011 |
marius |
- Send the RELSIM_ADJUST_OPENINGS in response to a MPI_EVENT_QUEUE_FULL using 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
|
224493 |
29-Jul-2011 |
marius |
- Staticize functions as appropriate and comment out unused ones. - 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)
|
223985 |
13-Jul-2011 |
marius |
- For SAS but neither FC nor SPI controllers default to using MSI (still 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
|
223981 |
13-Jul-2011 |
marius |
Remove extra empty lines.
|
220945 |
22-Apr-2011 |
marius |
Correct spelling.
Submitted by: brucec
|
219335 |
06-Mar-2011 |
marius |
- Allocate the DMA memory shared between the host and the controller as 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
|
217323 |
12-Jan-2011 |
mdf |
sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.
Commit the rest of the devices.
|
217009 |
05-Jan-2011 |
marius |
Remove a redundant variable assignment found with the clang static analyzer.
MFC after: 1 week
|
216764 |
28-Dec-2010 |
jhb |
Use bus_alloc_resource_any().
MFC after: 2 weeks
|
215325 |
14-Nov-2010 |
marius |
Use the correct variable for determining the verbosity level in mpt_lprtc(). While at it, fix the whitespace of that macro.
PR: 149502 Submitted by: Andrew Boyer MFC after: 1 week
|
213147 |
25-Sep-2010 |
marius |
Take mpt_req_on_{free,pending}_list() out from under INVARIANTS as these are generally useful and not just for debugging.
|
213105 |
24-Sep-2010 |
marius |
Improve r56796; the reply handler actually may remove the request from the chain in which case it shouldn't be removed twice. Reported by: Staale Kristoffersen
MFC after: 1 week
|
210943 |
06-Aug-2010 |
mjacob |
Figure which is the IO and MEM bars- do not assume that they are in a fixed order.
PR: 149220 Obtained from: John Baldwin MFC after: 1 month
|
209961 |
12-Jul-2010 |
marius |
Correct inverted parent DMA tag parameters.
Reviewed by: ken MFC after: 3 days
|
209960 |
12-Jul-2010 |
marius |
- Make the maxsize parameter of the data buffer DMA tag match maxio, which 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
|
209599 |
29-Jun-2010 |
ken |
Change the mpt driver to allow larger I/O sizes.
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
|
207543 |
02-May-2010 |
mjacob |
Print IR_RESYNC updates informatively.
Obtained from: pluknet MFC after: 1 week
|
207287 |
27-Apr-2010 |
marius |
On sparc64 obtain the initiator ID to be used for SPI HBAs from the 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.
|
207286 |
27-Apr-2010 |
marius |
Replace a magic value with the appropriate macro.
|
205932 |
30-Mar-2010 |
mjacob |
nit: xpt_bus_deregister has to be called with the sim lock held.
MFC after: 1 month
|
204356 |
26-Feb-2010 |
mav |
Store path for rescan to the right place. This should fix panic on boot, introduced by r203108.
|
203484 |
04-Feb-2010 |
mav |
Do not release device, when changing number of openings.
|
203108 |
28-Jan-2010 |
mav |
MFp4: Large set of CAM inprovements.
- 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.
|
201275 |
30-Dec-2009 |
jhb |
Use a constant instead of a magic number for the flag that enables decoding of a device ROM.
|
198262 |
20-Oct-2009 |
kan |
Use callout_init_mtx on FreeBSD versions recent enough. This closes 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
|
196970 |
08-Sep-2009 |
phk |
Revert previous commit and add myself to the list of people who should know better than to commit with a cat in the area.
|
196969 |
08-Sep-2009 |
phk |
Add necessary include.
|
195534 |
10-Jul-2009 |
scottl |
Separate the parallel scsi knowledge out of the core of the XPT, and 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
|
195275 |
02-Jul-2009 |
delphij |
Use MPT_MAX_LUNS as maximium number of LUNs, not 7, for SAS and FC cases. This matches Linux driver behavior.
Discussed with: scottl Approved by: re (kensmith) MFC after: 1 month
|
195274 |
02-Jul-2009 |
delphij |
Change explicit maximium numbers to the defined macro MPT_MAX_LUNS.
Approved by: re (kensmith)
|
194903 |
24-Jun-2009 |
marius |
- Remove unused variables. [1] - 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
|
192534 |
21-May-2009 |
jhb |
Largely revert the earlier change to use a single CCB for the RAID recovery 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
|
192450 |
20-May-2009 |
imp |
We no longer need to use d_thread_t, migrate to struct thread *.
|
186878 |
07-Jan-2009 |
marius |
Make the whole initiator mode part of mpt(4) endian-clean, 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
|
180668 |
21-Jul-2008 |
jhb |
Allocate a single CCB at the start of the main loop of the RAID monitoring 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
|
180153 |
01-Jul-2008 |
jhb |
Rework how the mpt_user personality handles buffers for config pages. 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
|
180152 |
01-Jul-2008 |
jhb |
During shutdown, deregister the shutdown hook from the correct event handler.
MFC after: 2 weeks
|
178896 |
10-May-2008 |
delphij |
Add support for LSI 1078DE (ServeRAID-AR10is SAS/SATA Controller)
MFC after: 2 weeks
|
178814 |
06-May-2008 |
jhb |
Add a new personality to mpt(4) devices to allow userland applications to 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
|
178725 |
02-May-2008 |
jkim |
Restore multi-release tradition of the driver.
Reviewed by: mjacob
|
177881 |
03-Apr-2008 |
scottl |
Don't force a reset at driver attach time. It doesn't work on some adapters, apparently.
|
177808 |
31-Mar-2008 |
scottl |
The MPT driver treats the "core" module with the same importance and 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.
|
173303 |
03-Nov-2007 |
scottl |
Ever since the module registration system was introduced to this driver, 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.
|
172842 |
21-Oct-2007 |
julian |
fix up some code for older systems changed by accident in the last commit 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.
|
172836 |
20-Oct-2007 |
julian |
Rename the kthread_xxx (e.g. kthread_create()) calls 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.
|
172589 |
12-Oct-2007 |
scottl |
For some blasted reason the SATA WC change frees a structure right in the middle of using it.
|
172568 |
12-Oct-2007 |
kevlo |
Spelling fix for interupt -> interrupt
|
172219 |
18-Sep-2007 |
ambrisko |
Fix an incorrect PCI device id. The current value conflicts with 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
|
171842 |
14-Aug-2007 |
scottl |
Move callout initialization to the proper spot. This prevents panics during error recovery.
Approved by: re Found by: kan
|
170924 |
18-Jun-2007 |
scottl |
Fix some debugging code that crept in accidentally.
|
170872 |
17-Jun-2007 |
scottl |
Prepare for future integration between CAM and newbus. xpt_bus_register 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.
|
170276 |
04-Jun-2007 |
scottl |
Track an update in the MPI headers that was missed earlier.
|
170271 |
04-Jun-2007 |
scottl |
Free the portinfo object on unload.
|
170252 |
03-Jun-2007 |
scottl |
mpt.c: 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).
|
170251 |
03-Jun-2007 |
scottl |
Update to MPI 1.5.16
|
169293 |
05-May-2007 |
mjacob |
Make this driver MP safe and still be a multi-release driver.
Obtained from: 99% of the work done by Scott Long. MFC after: 3 days
|
168831 |
18-Apr-2007 |
scottl |
Revert a driver API change to xpt_alloc_ccb that isn't necessary. Fix a couple of associated error checks.
|
168752 |
15-Apr-2007 |
scottl |
Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM will 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.
|
168470 |
07-Apr-2007 |
mjacob |
Hide bus reset announcements within bootverbose.
MFC after: 3 days
|
167426 |
11-Mar-2007 |
mjacob |
feedback from RELENG_5 port
|
166935 |
23-Feb-2007 |
mjacob |
Redo previous newbus related change to be kinder to multi-release support.
|
166901 |
23-Feb-2007 |
piso |
o break newbus api: add a new argument of type driver_filter_t to 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@
|
166897 |
23-Feb-2007 |
mjacob |
Use the new xpt_rescan function to truly now have dynamic attachment of new devices that arrive (and we notice them via async Fibre Channel events). We've always had the right thing (of sorts) happen when devices go away- this is the corollary function that makes multipath failover actually work.
MFC after: 2 weeks
|
166721 |
14-Feb-2007 |
jhb |
Catch up to MSI-X API changes. Tested with both MSI and MSI-X.
|
166227 |
25-Jan-2007 |
mjacob |
Whoops- #ifdef problem caused uninitialized transport. Not horribly a problem, but caused annoying messages.
|
165814 |
05-Jan-2007 |
mjacob |
(commented out) multipath fault injection code.
Some code to make diffs with RELENG_6 easier.
|
165808 |
05-Jan-2007 |
mjacob |
Another (minor) CAM_NEW_TRAN backport thingie, plus a slightly closer to __FreeBSD_version comparison for this.
|
165274 |
16-Dec-2006 |
mjacob |
Make some slight reorganization (bringing back in some non-CAM_NEW_TRAN code) to make diffs to previous FreeBSD versions more manageable.
|
165058 |
10-Dec-2006 |
mjacob |
Make mpt_pci depend on pci and mpt_cam depend on CAM.
PR: 106536 Suggested by: Norikatsu Shigemura MFC after: 3 days
|
164998 |
07-Dec-2006 |
mjacob |
PH! Forgot to do my cross-compile check. Also now rearranged things so the ENDIAN defines are consistent between mpt.h and mpt.c.
|
164990 |
07-Dec-2006 |
mjacob |
MFP4: principally to reapply tagged command support to FC and SAS cards.
|
164907 |
05-Dec-2006 |
mjacob |
use xpt_print function
|
164846 |
03-Dec-2006 |
mjacob |
Fix a massive couple of botches here: the NVRAM settings read wasn't flagging the SYNC mode was enabled. The temp values for offset and sync period were uint8_t, but were being assigned and shifted from a uint32_t value.
This didn't show up in testing because a random number of 1030 cards set a bit that says "honor BIOS negotiation", which means this whole code path was skipped.
This should clear up at least some of the negotation issues that have been seen.
|
164838 |
03-Dec-2006 |
mjacob |
Forced commit: previous revision just correctly reflected that the number of attached devices is 16 bits wide, not 8 bits wide.
|
164837 |
03-Dec-2006 |
mjacob |
Fix a debug message which didn't quite get it right about data direction.
Fix things to use the LSI-Logic Fusion Library mask and shift names for offset and sync, no matter how awkward they are, in preference to just plain numbers.
|
164417 |
19-Nov-2006 |
mjacob |
Pointy hat handed to me by Andrew: had msi_enable on as a default.
|
164416 |
19-Nov-2006 |
mjacob |
Play it safe and make MSI and MSI-X an option you have to turn on for MPT.
|
164415 |
19-Nov-2006 |
mjacob |
If a TMF request fails to start, make sure that we pull it off the pending list and set the state back to free prior to calling mpt_reset so we don't panic at a later point.
|
164349 |
17-Nov-2006 |
mjacob |
*smack* - forgot to do i386 compile, so last commit broke things.
|
164348 |
16-Nov-2006 |
mjacob |
Finally fix local command responses to set residual correctly. This allows us to play nicely on SANs when we have target mode enabled in f/w but have neither the scsi_targbh enabled or scsi_targ with a target enabled.
|
164326 |
16-Nov-2006 |
mjacob |
After tests on 2 different AMD platforms with several different cards (SAS, 4Gb FC), MSI seems to work with the cards.
This was of some concern because some PCI cards claim to work with MSI but don't.
|
164315 |
15-Nov-2006 |
jb |
Add big endian support.
Submitted by: scottl Reviewed by: mjacob
|
164314 |
15-Nov-2006 |
jb |
Get the parent dma tag if one exists. This is required on sun4v. Other arches will default to NULL if they have no parent.
Reviewed by: mjacob
|
164306 |
15-Nov-2006 |
mjacob |
Turn off MSI until some testing is done.
|
164305 |
15-Nov-2006 |
jhb |
Add MSI support to em(4), bce(4), and mpt(4). For now, we only support devices that support a maximum of 1 message, and we use that 1 message instead of the INTx rid 0 IRQ with the same interrupt handler, etc.
|
163925 |
02-Nov-2006 |
mjacob |
Fix some negotiation issues (like not being able to negotiate async)
|
163924 |
02-Nov-2006 |
mjacob |
add some missing MPT<>CAM and CAM<>MPT bogolocks
|
163896 |
02-Nov-2006 |
mjacob |
2nd and final commit that moves us to CAM_NEW_TRAN_CODE as the default.
Reviewed by multitudes.
|
163816 |
31-Oct-2006 |
mjacob |
The first of 3 major steps to move the CAM layer forward to using 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
|
162534 |
21-Sep-2006 |
mjacob |
Connect up a QUEUE FULL event with CAM and adjust openings.
Unfortunately, the QUEUE FULL event only tells you Bus && Target. It doesn't tell you lun. In order for the XPT_REL_SIMQ action to work, we have to have a real lun. But which one? For now, just iterate over MPT_MAX_LUNS.
Practically speaking, this is only going to be happening for lower quality SAS or SATA drives behind the SAS controller, which means only lun 0, so it's not so bad.
Helpful Reminder Nagging from: John Baldwin, Fred Whiteside
MFC after: 5 days
|
162140 |
08-Sep-2006 |
mjacob |
Support for PCI-Express 4Gb Cards.
|
162133 |
07-Sep-2006 |
mjacob |
Create a 'ready' handler for each personality. The purpose of this handler is to able to be called after *all* attach and enable events are done.
We establish a SYSINIT hook to call this handler. The current usage for it is to add scsi target resources *after* all enables are done. There seems to be some dependencies between different halves of a dual-port with respect to target mode.
Put in more meaningful event messages for some events- in particular QUEUE FULL events so we can see what the queue depth was when the IOC sent us this message.
MFC after: 1 week
|
162059 |
05-Sep-2006 |
mjacob |
The poison pill of death: adding a target mode reply handler and target resources to a non-FC card killed us dead. Sorry for the breakage since last July 12.
|
160650 |
25-Jul-2006 |
mjacob |
bus_alloc_resource_any is actually defined in the RELENG_4 branch, so there's no need to have a compilation difference here any more.
|
160649 |
25-Jul-2006 |
mjacob |
When probing to attach the CAM functionality, check against desired role configuration instead of existing role. This gets us out of the mess where we configured a role of NONE (or were LAN only, for example), but didn't continue to attach the CAM module (because we had neither initiator nor target role set). Unfortunately, the code that rewrites NVRAM to match actual to desired role only works if the CAM module attaches.
MFC after: 2 weeks
|
160397 |
16-Jul-2006 |
mjacob |
Add sysctl information about things like WWNN/WWPN.
MFC after: 2 weeks
|
160396 |
16-Jul-2006 |
mjacob |
If we're in mpt_wait_req and the command times out, mark it as timed out. Don't try and free the config request for read_cfg_header that times out because it's still active. Put in code for the config reply handler that will then free up timed out requests.
Fix the FC_PRIMITIVE_SEND completion to not try and free a command twice. Dunno how this possibly could have been working for awhile.
MFC after: 2 weeks
|
160395 |
16-Jul-2006 |
mjacob |
Define out unused and incomplete raid quiesce functions. The code never could be called, so we might as well not compile it for now.
|
160391 |
15-Jul-2006 |
mjacob |
If the card has target mode enabled, and we hang out ELS buffers but *don't* hang out commands, we hang folks on the SAN because the LSI-Logic f/w apparently sends back BUSY or QFULL or some darn thing.
If we add command buffers, we have to respond to them sensibly even if we don't have any upstream listeners (scsi_targ or scsi_targ_bh), so put in some local command reponse stuff.
MFC after: 2 weeks
|
160290 |
12-Jul-2006 |
mjacob |
Fix config page writes to not strip out the attributes when you actually go write the config page. This fixes the long standing problem about updating NVRAM on Fibre Channel cards and seems so far to not break SPI config page writes.
Put back role setting into mpt. That is, you can set a desired role for mpt as a hint. On the next reboot, it'll pick that up and redo the NVRAM settings appropriately and warn you that this won't take effect until the next reboot. This saves people the step of having to find a BIOS utilities disk to set target and/or initiator role for the MPT cards.
|
159943 |
26-Jun-2006 |
mjacob |
VMWare ESX reports > 16 targets for the LSI-Logic U320 model it emulates. Then it crashes and burns when you probe that high.
|
159919 |
25-Jun-2006 |
mjacob |
Major Fixes:
Don't enable/disable I/O space except for SAS adapters. This fixes a problem with VMware 4.5 Workstation.
Fix an egregious bug introduced to target mode so it actually will not panic when you first enable a lun.
Minor fixes:
Take more infor from port facts and configuration pages.
MFC after: 1 week
|
159494 |
10-Jun-2006 |
mjacob |
Add PCI ids for the FC919X
MFC after: 1 week
|
159471 |
09-Jun-2006 |
jkim |
Add ability to reset individual devices and fix SCSI speed negotiation.
Reviewed by: mjacob (initial version)
|
159312 |
05-Jun-2006 |
mjacob |
Do some source && comment cleanup.
Clean out the abortive start to homegrown, per-mpt, Domain Validation. This should really be done at a higher level.
Use the PIM_SEQSCAN flag for U320- this seems to correct cases of being unable to consistently negotiate U320 in the cases where I'd seen this before.
Between this and other recent checkins, this driver is pretty close to being ready for MFC.
Reviewed by: scottl, ken, scsi@ MFC after: 1 week
|
159179 |
02-Jun-2006 |
mjacob |
Make the code able to compile again in RELENG_4.
|
159178 |
02-Jun-2006 |
mjacob |
More checkpointing on the way toward really (finally) fixing speed negotiation.
Also fix the mpt_execute_req function to actually match mpt_execute_req_a64. This may explain why i386 users were having more grief.
|
159091 |
31-May-2006 |
mjacob |
Pick reasonable alignment constraints so that we don't ask too much of bus_dmamem_alloc/malloc.
Replace the device_printf calls in the memalloc function mpt_prt.
|
159052 |
29-May-2006 |
mjacob |
Add acknowledgements to LSI-Logic for support
|
159051 |
29-May-2006 |
mjacob |
+ Change some debug messages to MPT_PRT_NEGOTIATE level (so we can see the results of SPI negotiation w/o being overwhelmed with other crap).
+ For U320 devices, check against both Settings *and* DV flags before deciding whether we need to skip actual SPI settings for a device.
+ Go back to creating a 'physical disk' side of a raid/passthru bus that is limited to the number of maximum physical disks. Actually, this isn't probably *quite* right yet for one RAID volume, and if we ever end up with finding a device that supports more than one RAID volume (not likely), it probably won't quite be right either.
The problem here is that the creating of this 'physical' passthru sim is just a cheap way to leverage off the CAM midlayer to do our negotiation for us on the subentities that make up a RAID volume. It almost causes more trouble than it is worth because we have to remember which side we're talking to in terms of forming commands and which target ids are real and so on. Bleah.
+ Skip trying to actually do SPI settings for the RAID volumes on the real side of the raid/passthru bus pair- this just confuses the issue. The underlying real physical devices will have the negotiation performed and the Raid volume will inherit the resultant settings. At the sime time, non-RAID devices can be on the same real bus, so *do* perform negotiations with them.
+ At the end of doing all of the settings twiddling, *ahem*, remember to go update the settings on the card itself (dunno how this got nuked).
At this point, negotiations *seem* to be being done (again) correctly for both RAID volumes and their subentities. And they seem to be *mostly* now right for other non-RAID entities on the same bus (I ended up with 3 out of 8 other disks still at narror/async- haven't the slightest idea why yes).
Finally, negotiations on a normal bus seem to work (again).
There's still more work coming into this area, but we're in the final stretch.
|
159050 |
29-May-2006 |
mjacob |
Add a mpt_is_raid_volume function which will tell you whether the passed target id is one of the RAID VolumeID. This result is used to decide whether to try and do actual SPI negotiations on the real side of the raid/passthru bus pair. The reason we check this is that we can have both RAID volumes and real devices on the same bus.
|
159049 |
29-May-2006 |
mjacob |
Add a MPT_PRT_NEGOTIATION print level.
|
159041 |
29-May-2006 |
mjacob |
When setting verbose, *set* it, don't *add* it.
|
158982 |
27-May-2006 |
mjacob |
Work in progress toward fixing IM checked in after having lost one set to a peninsula power failure last night. After this, I can see both submembers and the raid volumes again, but speed negotiation is still broken.
Add a mpt_raid_free_mem function to centralize the resource reclaim and fixed a small memory leak.
Remove restriction on number of targets for systems with IM enabled- you can have setups that have both IM volumes as well as other devices.
Fix target id selection for passthru and nonpastrhu cases.
Move complete command dumpt to MPT_PRT_DEBUG1 level so that just setting debug level gets mostly informative albeit less verbose dumping.
|
158935 |
26-May-2006 |
mjacob |
Get most of the way back to having Integrated Mirroring work again- the addition of target mode support broke it massively.
|
158934 |
26-May-2006 |
mjacob |
gratuitous formatting changes
|
158933 |
26-May-2006 |
mjacob |
Fix spellings. Prototype mpt_dump_request. Add a 'raid_enabled' tag.
|
158932 |
26-May-2006 |
mjacob |
Remove handrolled raw dump of a request from mpt_send_cmd and replace with a new debug function.
|
158651 |
16-May-2006 |
phk |
Since DELAY() was moved, most <machine/clock.h> #includes have been unnecessary.
|
158279 |
04-May-2006 |
mjacob |
Add 4Gb Fibre Channel support. Work sponsored by LSI-Logic.
|
158278 |
04-May-2006 |
mjacob |
Remove MPT_PRT_INVARIANT- it was a silly idea.
|
157944 |
21-Apr-2006 |
mjacob |
Change some order of the way we do some target mode ops.
Found by Coverity.
|
157885 |
19-Apr-2006 |
mjacob |
Remove debounce code in mpt_intr. After some reflection and watching a debounce followed by a timeout, I think I'm forced to conclude that it was not a good idea.
|
157853 |
18-Apr-2006 |
mjacob |
In receiving a new ATIO, don't record the associated CCB in the target state structure. This field is only for CCBs that are associated with actions that are occurring on the HBA (i.e., XPT_CONT_IO actions).
This way we also don't get confused when the upstream listener stalls try and look at a CCB which has already been freed (by CAM).
|
157662 |
11-Apr-2006 |
mjacob |
A large set of changes:
+ Add boatloads of KASSERTs and *really* check out more locking issues (to catch recursions when we actually go to real locking in CAM soon). The KASSERTs also caught lots of other issues like using commands that were put back on free lists, etc.
+ Target mode: role setting is derived directly from port capabilities. There is no need to set a role any more. Some target mode resources are allocated early on (ELS), but target command buffer allocation is deferred until the first lun enable.
+ Fix some breakages I introduced with target mode in that some commands are *repeating* commands. That is, the reply shows up but the command isn't really done (we don't free it). We still need to take it off the pending list because when we resubmit it, bad things then happen.
+ Fix more of the way that timed out commands and bus reset is done. The actual TMF response code was being ignored.
+ For SPI, honor BIOS settings. This doesn't quite fix the problems we've seen where we can't seem to (re)negotiate U320 on all drives but avoids it instead by letting us honor the BIOS settings. I'm sure this is not quite right and will have to change again soon.
|
157382 |
01-Apr-2006 |
mjacob |
Fix fat-fingered version define.
|
157354 |
01-Apr-2006 |
mjacob |
Fix some of the previus changes 'better'.
There's something strange going on with async events. They seem to be be treated differently for different Fusion implementations. Some will really tell you when it's okay to free the request that started them. Some won't. Very disconcerting.
This is particularily bad when the chip (FC in this case) tells you in the reply that it's not a continuation reply, which means you can free the request that its associated with. However, if you do that, I've found that additional async event replies come back for that message context after you freed it. Very Bad Things Happen.
Put in a reply register debounce. Warn about out of range context indices. Use more MPILIB defines where possible. Replace bzero with memset. Add tons more KASSERTS. Do a *lot* more request free list auditting and serial number usages. Get rid of the warning about the short IOC Facts Reply. Go back to 16 bits of context index.
Do a lot more target state auditting as well. Make a tag out of not only the ioindex but the request index as well and worry less about keeping a full serial number.
|
157141 |
26-Mar-2006 |
mjacob |
Correct bad format args. Interesting- the lines that generated the error on sparc64 hadn't changed since the last checkin, pass LINT on other platforms and mpt doesn't work on sparc64 anyway and the tinderbox build didn't work for me in a cross build case on my main build machine (which runs RELENG_6). Sigh. Still need to try harder.
|
157117 |
25-Mar-2006 |
mjacob |
Some fairly major changes to this driver.
A) Fibre Channel Target Mode support mostly works (SAS/SPI won't be too far behind). I'd say that this probably works just about as well as isp(4) does right now. Still, it and isp(4) and the whole target mode stack need a bit of tightening.
B) The startup sequence has been changed so that after all attaches are done, a set of enable functions are called. The idea here is that the attaches do whatever needs to be done *prior* to a port being enabled and the enables do what need to be done for enabling stuff for a port after it's been enabled.
This means that we also have events handled by their proper handlers as we start up.
C) Conditional code that means that this driver goes back all the way to RELENG_4 in terms of support.
D) Quite a lot of little nitty bug fixes- some discovered by doing RELENG_4 support. We've been living under Giant *waaaayyyyy* too long and it's made some of us (me) sloppy.
E) Some shutdown hook stuff that makes sure we don't blow up during a reboot (like by the arrival of a new command from an initiator).
There's been some testing and LINT checking, but not as complete as would be liked. Regression testing with Fusion RAID instances has not been possible. Caveat Emptor.
Sponsored by: LSI-Logic.
|
156797 |
17-Mar-2006 |
mjacob |
If we actually succeed in the Task Management Function where we are aborting timed out commands, pull the request off the TAILQ.
|
156796 |
17-Mar-2006 |
mjacob |
In mpt_complete_request_chain don't depend on somebody else to remove the request from the TAILQ.
|
156400 |
07-Mar-2006 |
mjacob |
Add a serial number for requests so we don't just depend on a request pointer to try and do forensics on what has occurred.
|
156301 |
04-Mar-2006 |
mjacob |
turn some WARNs for unknown events into INFOs
|
156104 |
28-Feb-2006 |
mjacob |
Fix mpt_reset to try mpt_hard_reset more than once, and to try mpt_soft_reset more than once. And to wait for MPT_DB_STATE_READY twice. I mean, this is crucial- give the IOC a chance to get ready.
If mpt_reset is called to reinit things, and we succeed, make sure to re-enable interrupts. This is what has mostly led to system lockup after having to hard reset the chip. Also, if we think that interrupts aren't function in mpt_cam_timeout, for goodness sake, turn them on again.
In read_cfg_header, return distinguishing errnos so the caller can decide what's an error. It's *not* an error to fail to read a RAID page from a non-RAID capable device like the FC929X.
Some whitespace fixes (removing spaces from ends of lines).
|
156041 |
26-Feb-2006 |
mjacob |
Remove the ill-considered effect of using the type definitions as distributed by LSI-Logic. For FreeBSD, just use the posix defines instead of trying to figure out how wide an int is. Apologies to all.
|
156022 |
26-Feb-2006 |
mjacob |
Shorten the time for waiting for TMF commands to complete- let's not hang the system for 5 seconds. If a TMF doesn't complete within, oh, say 500ms, that's enough.
Put in a printout to catch mpt_recover_commands being activated with no commands.
|
156021 |
26-Feb-2006 |
mjacob |
a) Delay for port enable to succeed should be 30 seconds (at least) for *both* SAS and FC, not just SAS.
b) Don't tell the chip we want it to do FIFO signalling if we actually don't set up the address where the FIFO signal is supposed to be written (oops).
|
156000 |
25-Feb-2006 |
mjacob |
Role a microrev of the MPI Library in preparation for target mode work.
Make my portions of the license clearer.
Thank Chris Ellsworth for his support in getting a bunch of this done.
|
155895 |
22-Feb-2006 |
mjacob |
Remove commented out qualifier to dumping a message.
|
155521 |
11-Feb-2006 |
mjacob |
Do initial cut of SAS HBA support. These controllers (106X) seem to support automatically both SATA and SAS drives. The async SAS event handling we catch but ignore at present (so automagic attach/detach isn't hooked up yet).
Do 64 bit PCI support- we can now work on systems with > 4GB of memory.
Do large transfer support- we now can support up to reported chain depth, or the length of our request area. We simply allocate additional request elements when we would run out of room for chain lists.
Tested on Ultra320, FC and SAS controllers on AMD64 and i386 platforms. There were no RAID cards available for me to regression test.
The error recovery for this driver still is pretty bad.
|
155452 |
08-Feb-2006 |
mjacob |
Garbage collect a file that no longe is used (replaced by mpi_log_fc.h).
|
154603 |
21-Jan-2006 |
mjacob |
Rev MPI spec to 1.05.09 level in preparation for SAS support.
MFC after: 1 month
|
153072 |
04-Dec-2005 |
ru |
Fix -Wundef.
|
152444 |
15-Nov-2005 |
kan |
Keep track of volumes in non-optimal state and expose a simple count of volumes that might need administrator attention through device specific sysctl to simplify device monitoring.
Submitted by: Deomid Ryabkov <myself at rojer dot pp dot ru>
|
151075 |
08-Oct-2005 |
scottl |
Remove a couple of explicit memset(0) ops that were zeroing past the end of an allocation. This fixes the malloc 'use after free' panic on boot that many were seeing. It doesn't solve the problem of the allocations being cached and then written past their bounds later. That will take more work.
Submitted by: kan
|
150007 |
11-Sep-2005 |
mjacob |
Restore the 929X support that got nuked in merge
|
148679 |
03-Aug-2005 |
gibbs |
Correct attribution in clause three to address the correct copyright holders. The license that was approved for my changes to this driver originally came from LSI, but the changes to the driver core are not owned by LSI.
MFC: 1 day
|
147883 |
10-Jul-2005 |
scottl |
Massive overhaul of MPT Fusion driver:
o Add timeout error recovery (from a thread context to avoid the deferral of other critical interrupts). o Properly recover commands across controller reset events. o Update the driver to handle events and status codes that have been added to the MPI spec since the driver was originally written. o Make the driver more modular to improve maintainability and support dynamic "personality" registration (e.g. SCSI Initiator, RAID, SAS, FC, etc). o Shorten and simplify the common I/O path to improve driver performance. o Add RAID volume and RAID member state/settings reporting. o Add periodic volume resynchronization status reporting. o Add support for sysctl tunable resync rate, member write cache enable, and volume transaction queue depth.
Sponsored by ---------------- Avid Technologies Inc: SCSI error recovery, driver re-organization, update of MPI library headers, portions of dynamic personality registration, and misc bug fixes.
Wheel Open Technologies: RAID event notification, RAID member pass-thru support, firmware upload/download support, enhanced RAID resync speed, portions of dynamic personality registration, and misc bug fixes.
Detailed Changes ================ mpt.c mpt_cam.c mpt_raid.c mpt_pci.c: o Add support for personality modules. Each module exports load, and unload module scope methods as well as probe, attach, event, reset, shutdown, and detach per-device instance methods
mpt.c mpt.h mpt_pci.c: o The driver now associates a callback function (via an index) with every transaction submitted to the controller. This allows the main interrupt handler to absolve itself of any knowledge of individual transaction/response types by simply calling the callback function "registered" for the transaction. We use a callback index instead of a callback function pointer in each requests so we can properly handle responses (e.g. event notifications) that are not associated with a transaction. Personality modules dynamically register their callbacks with the driver core to receive the callback index to use for their handlers.
o Move the interrupt handler into mpt.c. The ISR algorithm is bus transport and OS independent and thus had no reason to be in mpt_pci.c.
o Simplify configuration message reply handling by copying reply frame data for the requester and storing completion status in the original request structure.
o Add the mpt_complete_request_chain() helper method and use it to implement reset handlers that must abort transactions.
o Keep track of all pending requests on the new requests_pending_list in the softc.
o Add default handlers to mpt.c to handle generic event notifications and controller reset activities. The event handler code is largely the same as in the original driver. The reset handler is new and terminates any pending transactions with a status code indicating the controller needs to be re-initialized.
o Add some endian support to the driver. A complete audit is still required for this driver to have any hope of operating in a big-endian environment.
o Use inttypes.h and __inline. Come closer to being style(9) compliant.
o Remove extraneous use of typedefs.
o Convert request state from a strict enumeration to a series of flags. This allows us to, for example, tag transactions that have timed-out while retaining the state that the transaction is still in-flight on the controller.
o Add mpt_wait_req() which allows a caller to poll or sleep for the completion of a request. Use this to simplify and factor code out from many initialization routines. We also use this to sleep for task management request completions in our CAM timeout handler.
mpt.c: o Correct a bug in the event handler where request structures were freed even if the request reply was marked as a continuation reply. Continuation replies indicate that the controller still owns the request and freeing these replies prematurely corrupted controller state.
o Implement firmware upload and download. On controllers that do not have dedicated NVRAM (as in the Sun v20/v40z), the firmware image is downloaded to the controller by the system BIOS. This image occupies precious controller RAM space until the host driver fetches the image, reducing the number of concurrent I/Os the controller can processes. The uploaded image is used to re-program the controller during hard reset events since the controller cannot fetch the firmware on its own. Implementing this feature allows much higher queue depths when RAID volumes are configured.
o Changed configuration page accessors to allow threads to sleep rather than busy wait for completion.
o Removed hard coded data transfer sizes from configuration page routines so that RAID configuration page processing is possible.
mpt_reg.h: o Move controller register definitions into a separate file.
mpt.h: o Re-arrange includes to allow inlined functions to be defined in mpt.h.
o Add reply, event, and reset handler definitions.
o Add softc fields for handling timeout and controller reset recovery.
mpt_cam.c: o Move mpt_freebsd.c to mpt_cam.c. Move all core functionality, such as event handling, into mpt.c leaving only CAM SCSI support here.
o Revamp completion handler to provide correct CAM status for all currently defined SCSI MPI message result codes.
o Register event and reset handlers with the MPT core. Modify the event handler to notify CAM of bus reset events. The controller reset handler will abort any transactions that have timed out. All other pending CAM transactions are correctly aborted by the core driver's reset handler.
o Allocate a single request up front to perform task management operations. This guarantees that we can always perform a TMF operation even when the controller is saturated with other operations. The single request also serves as a perfect mechanism of guaranteeing that only a single TMF is in flight at a time - something that is required according to the MPT Fusion documentation.
o Add a helper function for issuing task management requests to the controller. This is used to abort individual requests or perform a bus reset.
o Modify the CAM XPT_BUS_RESET ccb handler to wait for and properly handle the status of the bus reset task management frame used to reset the bus. The previous code assumed that the reset request would always succeed.
o Add timeout recovery support. When a timeout occurs, the timed-out request is added to a queue to be processed by our recovery thread and the thread is woken up. The recovery thread processes timed-out command serially, attempting first to abort them and then falling back to a bus reset if an abort fails.
o Add calls to mpt_reset() to reset the controller if any handshake command, bus reset attempt or abort attempt fails due to a timeout.
o Export a secondary "bus" to CAM that exposes all volume drive members as pass-thru devices, allowing CAM to perform proper speed negotiation to hidden devices.
o Add a CAM async event handler tracking the AC_FOUND_DEVICE event. Use this to trigger calls to set the per-volume queue depth once the volume is fully registered with CAM. This is required to avoid hitting firmware limits on volume queue depth. Exceeding the limit causes the firmware to hang.
mpt_cam.h: o Add several helper functions for interfacing to CAM and performing timeout recovery.
mpt_pci.c: o Disable interrupts on the controller before registering and enabling interrupt delivery to the OS. Otherwise we risk receiving interrupts before the driver is ready to receive them.
o Make use of compatibility macros that allow the driver to be compiled under 4.x and 5.x.
mpt_raid.c: o Add a per-controller instance RAID thread to perform settings changes and query status (minimizes CPU busy wait loops).
o Use a shutdown handler to disable "Member Write Cache Enable" (MWCE) setting for RAID arrays set to enable MWCE During Rebuild.
o Change reply handler function signature to allow handlers to defer the deletion of reply frames. Use this to allow the event reply handler to queue up events that need to be acked if no resources are available to immediately ack an event. Queued events are processed in mpt_free_request() where resources are freed. This avoids a panic on resource shortage.
o Parse and print out RAID controller capabilities during driver probe.
o Define, allocate, and maintain RAID data structures for volumes, hidden member physical disks and spare disks.
o Add dynamic sysctls for per-instance setting of the log level, array resync rate, array member cache enable, and volume queue depth.
mpt_debug.c: o Add mpt_lprt and mpt_lprtc for printing diagnostics conditioned on a particular log level to aid in tracking down driver issues.
o Add mpt_decode_value() which parses the bits in an integer value based on a parsing table (mask, value, name string, tuples).
mpilib/*: o Update mpi library header files to latest distribution from LSI.
Submitted by: gibbs Approved by: re
|
146734 |
29-May-2005 |
nyan |
Remove bus_{mem,p}io.h and related code for a micro-optimization on i386 and amd64. The optimization is a trivial on recent machines.
Reviewed by: -arch (imp, marcel, dfr)
|
143158 |
05-Mar-2005 |
imp |
Use BUS_PROBE_DEFAULT for pci probe return value
|
143063 |
02-Mar-2005 |
joerg |
netchild's mega-patch to isolate compiler dependencies into a central place.
This moves the dependency on GCC's and other compiler's features into the central sys/cdefs.h file, while the individual source files can then refer to #ifdef __COMPILER_FEATURE_FOO where they by now used to refer to #if __GNUC__ > 3.1415 && __BARC__ <= 42.
By now, GCC and ICC (the Intel compiler) have been actively tested on IA32 platforms by netchild. Extension to other compilers is supposed to be possible, of course.
Submitted by: netchild Reviewed by: various developers on arch@, some time ago
|
139749 |
06-Jan-2005 |
imp |
Start each of the license/copyright comments with /*-, minor shuffle of lines
|
139019 |
18-Dec-2004 |
sobomax |
Add support for FC929X, which apparently is just a PCI-X version of FC929.
MFC after: 3 days
|
134299 |
25-Aug-2004 |
obrien |
Correct style nit in rev 1.17.
|
134235 |
24-Aug-2004 |
dwhite |
Pick up changes in rev 1.8 of src/sys/dev/ic/mpt_netbsd.c from NetBSD. Set the DMA SGL length correctly if the DMA request must be chained because it is too large to fit in one SGL.
This should fix this driver for some Dell Precision systems. RELENG_5 candidate.
PR: kern/66479 Submitted by: HITOSHI Osada <qfh02545@nifty.com>
|
134123 |
21-Aug-2004 |
obrien |
Fix where my automated script blew the SCM ID format conversion.
|
132107 |
13-Jul-2004 |
stefanf |
Remove erroneous semicolons.
|
127135 |
17-Mar-2004 |
njl |
Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
|
126891 |
12-Mar-2004 |
trhodes |
These are changes to allow to use the Intel C/C++ compiler (lang/icc) to build the kernel. It doesn't affect the operation if gcc.
Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as icc v8 may define __GNUC__ some parts may look strange but are necessary.
Additional changes: - in_cksum.[ch]: * use a generic C version instead of the assembly version in the !gcc case (ASM code breaks with the optimizations icc does) -> no bad checksums with an icc compiled kernel Help from: andre, grehan, das Stolen from: alpha version via ppc version The entire checksum code should IMHO be replaced with the DragonFly version (because it isn't guaranteed future revisions of gcc will include similar optimizations) as in: ---snip--- Revision Changes Path 1.12 +1 -0 src/sys/conf/files.i386 1.4 +142 -558 src/sys/i386/i386/in_cksum.c 1.5 +33 -69 src/sys/i386/include/in_cksum.h 1.5 +2 -0 src/sys/netinet/igmp.c 1.6 +0 -1 src/sys/netinet/in.h 1.6 +2 -0 src/sys/netinet/ip_icmp.c
1.4 +3 -4 src/contrib/ipfilter/ip_compat.h 1.3 +1 -2 src/sbin/natd/icmp.c 1.4 +0 -1 src/sbin/natd/natd.c 1.48 +1 -0 src/sys/conf/files 1.2 +0 -1 src/sys/conf/files.amd64 1.13 +0 -1 src/sys/conf/files.i386 1.5 +0 -1 src/sys/conf/files.pc98 1.7 +1 -1 src/sys/contrib/ipfilter/netinet/fil.c 1.10 +2 -3 src/sys/contrib/ipfilter/netinet/ip_compat.h 1.10 +1 -1 src/sys/contrib/ipfilter/netinet/ip_fil.c 1.7 +1 -1 src/sys/dev/netif/txp/if_txp.c 1.7 +1 -1 src/sys/net/ip_mroute/ip_mroute.c 1.7 +1 -2 src/sys/net/ipfw/ip_fw2.c 1.6 +1 -2 src/sys/netinet/igmp.c 1.4 +158 -116 src/sys/netinet/in_cksum.c 1.6 +1 -1 src/sys/netinet/ip_gre.c 1.7 +1 -2 src/sys/netinet/ip_icmp.c 1.10 +1 -1 src/sys/netinet/ip_input.c 1.10 +1 -2 src/sys/netinet/ip_output.c 1.13 +1 -2 src/sys/netinet/tcp_input.c 1.9 +1 -2 src/sys/netinet/tcp_output.c 1.10 +1 -1 src/sys/netinet/tcp_subr.c 1.10 +1 -1 src/sys/netinet/tcp_syncache.c 1.9 +1 -2 src/sys/netinet/udp_usrreq.c
1.5 +1 -2 src/sys/netinet6/ipsec.c 1.5 +1 -2 src/sys/netproto/ipsec/ipsec.c 1.5 +1 -1 src/sys/netproto/ipsec/ipsec_input.c 1.4 +1 -2 src/sys/netproto/ipsec/ipsec_output.c
and finally remove sys/i386/i386 in_cksum.c sys/i386/include in_cksum.h ---snip--- - endian.h: * DTRT in C++ mode - quad.h: * we don't use gcc v1 anymore, remove support for it Suggested by: bde (long ago) - assym.h: * avoid zero-length arrays (remove dependency on a gcc specific feature) This change changes the contents of the object file, but as it's only used to generate some values for a header, and the generator knows how to handle this, there's no impact in the gcc case. Explained by: bde Submitted by: Marius Strobl <marius@alchemy.franken.de> - aicasm.c: * minor change to teach it about the way icc spells "-nostdinc" Not approved by: gibbs (no reply to my mail) - bump __FreeBSD_version (lang/icc needs to know about the changes)
Incarnations of this patch survive gcc compiles since a loooong time, I use it on my desktop. An icc compiled kernel works since Nov. 2003 (exceptions: snd_* if used as modules), it survives a build of the entire ports collection with icc.
Parts of this commit contains suggestions or submissions from Marius Strobl <marius@alchemy.franken.de>.
Reviewed by: -arch Submitted by: netchild
|
123740 |
23-Dec-2003 |
peter |
Catch a few places where NULL (pointer) was used where 0 (integer) was expected.
|
119690 |
02-Sep-2003 |
jhb |
Use PCIR_BAR(x) instead of PCIR_MAPS.
Glanced over by: imp, gibbs Tested by: i386 LINT
|
119418 |
24-Aug-2003 |
obrien |
Use __FBSDID(). Also some minor style cleanups.
|
119285 |
22-Aug-2003 |
imp |
Prefer new location of pci include files (which have only been in the tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
|
117126 |
01-Jul-2003 |
scottl |
Mega busdma API commit.
Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour.
sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen.
If anyone gets panics or warnings from dflt_lock() being called, please let me know right away.
Reviewed by: tmm, gibbs
|
116351 |
14-Jun-2003 |
njl |
Merge common XPT_CALC_GEOMETRY functions into a single convenience function. Devices below may experience a change in geometry.
* Due to a bug, aic(4) never used extended geometry. Changes all drives >1G to now use extended translation. * sbp(4) drives exactly 1 GB in size now no longer use extended geometry. * umass(4) drives exactly 1 GB in size now no longer use extended geometry.
For all other controllers in this commit, this should be a no-op.
Looked over by: scottl
|
116266 |
12-Jun-2003 |
mjacob |
Add change that allows PAE to work.
Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
|
115778 |
03-Jun-2003 |
mjacob |
Update MPILIB from code received from LSI. Make changes in the rest of the driver based upon some somewhat gratuitous name changes.
|
115350 |
27-May-2003 |
jhb |
Fix compile: the type is spelled bus_dmasync_op_t rather than bus_dmamap_sync_t.
With hat: re
|
115343 |
27-May-2003 |
scottl |
Bring back bus_dmasync_op_t. It is now a typedef to an int, though the BUS_DMASYNC_ definitions remain as before. The does not change the ABI, and reverts the API to be a bit more compatible and flexible. This has survived a full 'make universe'.
Approved by: re (bmah)
|
113350 |
10-Apr-2003 |
mux |
I deserve a big pointy hat for having missed all those references to bus_dmasync_op_t in my last commit.
|
111346 |
23-Feb-2003 |
obrien |
PAGE_SIZE is unsigned on all our platforms, and is a long on some. So cast to u_long before printing out and use a matching specifier.
Tested on: sparc64
|
111119 |
19-Feb-2003 |
imp |
Back out M_* changes, per decision of the TRB.
Approved by: trb
|
109623 |
21-Jan-2003 |
alfred |
Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
|
105215 |
16-Oct-2002 |
phk |
Be consistent about functions being static.
Spotted by: FlexeLint.
|
103914 |
24-Sep-2002 |
mjacob |
Code cleanup: use mpt_prt instead of device_printf.
|
103871 |
23-Sep-2002 |
mjacob |
Parameterize MPT_MAX_REQUESTS based upon device type (FC has Global Credits of 1024- Ultra4 256). Rename 'requests' tag to 'request_pool' for clarity. Make sure we do correct xpt_freeze_simq/CAM_RELEASE_SIMQ if we run out of chip resources.
MFC after: 6 days
|
103831 |
23-Sep-2002 |
mjacob |
Wads more cleanup...
In mpttimeout, call mpt_intr just on the offchance that we missed an interrupt. We can check to see whether or not the command that is timing out got completed.
When we *do* decide to timeout a command, set the command state to REQ_TIMEOUT and then invoke another timeout (hz/10)- mpttimeout2. This allows us to catch a couple cases we've seen where the command we timed out on in fact is ready to be completed by the firmware. In any case, it's only after mpttimeout2 is called that we actually take down the private state and free the request itself. CAM has been notified in mpttimeout anyway. This whole area should be redone, but that will take 105% of my available game time for this month.
Fix a couple of missing (and not useful, at presnet) CAMLOCK_2_MPTLOCK and MPTLOCK_2_CAMLOCK locations.
Split mpt_notify into mpt_ctlop, which handles all reply completions that have 0x800000000 or'd into the ContextID. This function can, in fact, call mpt_event_notify_reply, which handles the traditional async event notifications. While we're at it, put in the extremely important (but currently untested) code that send back an Ack to an Event Notification (if the Event Notification is marked with AckRequired). Note that an Ack also generates another ctlop completion, tra la.
Fix up mpt_done substantially to try and get how we plug into CAM correctly done. Remove bogus CAM_RELEASE_SIMQ settings.
Do some cleanups in mpt_action that are related to speed negotiation for Ultra4 cards. This is an area that is still quite fragile and worrisome as config data being read back often doesn't make sense or jibe with the documentation.
At any rate, after these changes were done, I was finally able to get Lars Eggert's dual 320M disk system to stay up under load all weekend- hopefully we're in good enough for now shape.
MFC after: 1 week
|
103829 |
23-Sep-2002 |
mjacob |
Recognize the single channel 2Gb card (FC919)- thanks to LSI Logic for pointing this out.
In mpt_intr, don't try and pop a reply queue element out *unless* the interrupt status says you might have one.
MFC after: 1 week
|
103828 |
23-Sep-2002 |
mjacob |
We do not need to expose mpt_notify outside of mpt_freebsd.c.
MFC after: 1 week
|
103827 |
23-Sep-2002 |
mjacob |
When freeing a request, zero out the sequence number.
Define the CFG_DAGA_OFF offset as 128 bytes instead of 40- gives us a more reasonable headroom.
When reading a config page, zero out the entire request area- not just the length of the request. This is because we cleverly (cheezily) return configuration data back into the allocated request area, so it's nice to make sure we start with a clean area to write on.
MFC after: 1 week
|
102882 |
03-Sep-2002 |
mjacob |
Don't do transition locking (i.e., CAM->MPT->CAM)- Peter claimed that ia64 chokes the chicken with this.
Submitted by: wemm@freebsd.org
|
102822 |
01-Sep-2002 |
mjacob |
Fix things so that:
a) we don't believe what the board tells us all the time (if the BIOS hasn't run, port page 2 and port page 0 tend to be garbage)
b) add the missing code to set parameters for the SPI cards.
MFC after: 0 days
|
102599 |
30-Aug-2002 |
mjacob |
Sigh. Ken Merry convinced me that my attempts to DTRT were wrong. Replace dual copyright with a plain BSD style copyright assigned to LSI Logic. This is still within the intents of express consent from LSI.
MFC after: 2 days
|
102596 |
30-Aug-2002 |
mjacob |
Add 909A PCI id.
MFC after: 2 days
|
102595 |
30-Aug-2002 |
mjacob |
Add an additional copyright (with the express consent of LSI Logic) that specifically allows for (via 'BSD Style' licensing) source && binary redistribution.
Pointy hat to: Matt, for not getting this done ahead of time.
MFC after: 2 days
|
102304 |
23-Aug-2002 |
mjacob |
Do some minor cleanups found during backport to RELENG_4.
|
102303 |
23-Aug-2002 |
mjacob |
Pick a cleaner method (and put in a separate function) for finding the peer device on a dual board.
|
102199 |
20-Aug-2002 |
mjacob |
A chunk of cleanup, both stylistic and substantive.
We now also read configuration information for the SCSI cards- this allows us to try and say what the speed settings now are.
Start, but not yet complete, the process of reorgs && #defines so that we can backport to RELENG_4 pretty soon.
|
101704 |
11-Aug-2002 |
mjacob |
Add support for the LSI-Logic Fusion/MP architecture.
This is an architecture that present a thing message passing interface to the OS. You can query as to how many ports and what kind are attached and enable them and so on.
A less grand view is that this is just another way to package SCSI (SPI or FC) and FC-IP into a one-driver interface set.
This driver support the following hardware:
LSI FC909: Single channel, 1Gbps, Fibre Channel (FC-SCSI only) LSI FC929: Dual Channel, 1-2Gbps, Fibre Channel (FC-SCSI only) LSI 53c1020: Single Channel, Ultra4 (320M) (Untested) LSI 53c1030: Dual Channel, Ultra4 (320M)
Currently it's in fair shape, but expect a lot of changes over the next few weeks as it stabilizes.
Credits:
The driver is mostly from some folks from Jeff Roberson's company- I've been slowly migrating it to broader support that I it came to me as.
The hardware used in developing support came from:
FC909: LSI-Logic, Advansys (now Connetix) FC929: LSI-Logic 53c1030: Antares Microsystems (they make a very fine board!)
MFC after: 3 weeks
|