sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
show more ...
Remove dead mentions of CAM target mode APIs from drivers.This makes grepping kernel for target mode implementation much easier.
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq arefixed-length strings. AFAICT the only place they're read is insbin/c
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq arefixed-length strings. AFAICT the only place they're read is insbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.However, the kernel doesn't null-terminate them. A bunch of copy-pasted codeuses strncpy to write them, and doesn't guarantee null-termination. For atleast 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actuallyoverflows. You can see the result by doing "camcontrol negotiate da0 -v".This change null-terminates those fields everywhere they're set in thekernel. It also shortens a few strings to ensure they'll fit within the16-character field.PR: 215474Reported by: CoverityCID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187CID: 1010035 1010036 1010042 1010041 1010040 1010039Reviewed by: imp, sephe, slmMFC after: 4 weeksSponsored by: Spectra Logic CorpDifferential Revision: https://reviews.freebsd.org/D9037Differential Revision: https://reviews.freebsd.org/D9038
sys/dev: minor spelling fixes.Most affect comments, very few have user-visible effects.
Remove MAXBSIZE use from drivers where it has nothing to do.In some cases limits are just not needed, in others -- DFLTPHYS is theright constant to use instead.MFC after: 1 month
Prevent overflow issues in timeout processingPreviously, any timeout value for which (timeout * hz) will overflow thesigned integer, will give weird results, since callout(9) routines willconvert
Prevent overflow issues in timeout processingPreviously, any timeout value for which (timeout * hz) will overflow thesigned integer, will give weird results, since callout(9) routines willconvert negative values of ticks to '1'. For unsigned integer overflow wewill get sufficiently smaller timeout values than expected.Switch from callout_reset, which requires conversion to int based ticksto 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<[email protected]> back in 5 Aug 2011 which used a macro to help avoidthe overlow.Differential Revision: https://reviews.freebsd.org/D1157Reviewed by: mav, davideMFC after: 1 monthSponsored by: Multiplay
Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,don't create a map before calling bus_dmamem_alloc() (such maps wereleaked). It is believed that the extra destroy of the m
Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,don't create a map before calling bus_dmamem_alloc() (such maps wereleaked). It is believed that the extra destroy of the map was generallyharmless since bus_dmamem_alloc() often uses special maps for whichbus_dmamap_destroy() is a no-op (e.g. on x86).Reviewed by: scottl
Reform the busdma API so that new types may be added without modifyingevery architecture's busdma_machdep.c. It is done by unifying thebus_dmamap_load_buffer() routines so that they may be called
Reform the busdma API so that new types may be added without modifyingevery architecture's busdma_machdep.c. It is done by unifying thebus_dmamap_load_buffer() routines so that they may be called from MIcode. The MD busdma is then given a chance to do any final processingin the complete() callback.The cam changes unify the bus_dmamap_load* handling in cam drivers.The arm and mips implementations are updated to track virtualaddresses for sync(). Previously this was done in a type specificway. Now it is done in a generic way by recording the list ofvirtuals 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 <[email protected]>)
More conversions of drivers to use the PCI parent DMA tag.
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 duplicatecode from many
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 duplicatecode 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 thatare 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 ofrequests priorities was extended. Priorities now split between several"run levels". Device can be freezed at specified level, allowing higherpriority 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 occupyingslots, required by higher levels to manage theit execution.- Two last changes were holding proper ATA reinitialization and errorrecovery implementation. Now it is done: SATA controllers and PortMultipliers now implement automatic hot-plug and should correctlyrecover from timeouts and bus resets.- Improve SCSI error recovery for devices on buses without automatic sensereporting, such as ATAPI or USB. For example, it allows CAM to wait, whileCD 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.
Remove extraneous semicolons, no functional changes.Submitted by: Marc Balmer <[email protected]>MFC after: 1 week
Separate the parallel scsi knowledge out of the core of the XPT, andmodularize it so that new transports can be created.Add a transport for SATAAdd a periph+protocol layer for ATAAdd a driver
Separate the parallel scsi knowledge out of the core of the XPT, andmodularize it so that new transports can be created.Add a transport for SATAAdd a periph+protocol layer for ATAAdd a driver for AHCI-compliant hardware.Add a maxio field to CAM so that drivers can advertise their maxI/O capability. Modify various drivers so that they are insulatedfrom the value of MAXPHYS.The new ATA/SATA code supports AHCI-compliant hardware, and will overridethe classic ATA driver if it is loaded as a module at boot time or compiledinto the kernel. The stack now support NCQ (tagged queueing) for increasedperformance on modern SATA drives. It also supports port multipliers.ATA drives are accessed via 'ada' device nodes. ATAPI drives areaccessed via 'cd' device nodes. They can all be enumerated and manipulatedvia camcontrol, just like SCSI drives. SCSI commands are not translated totheir ATA equivalents; ATA native commands are used throughout the entirestack, including camcontrol. See the camcontrol manpage for furtherdetails. Testing this code may require that you update your fstab, andpossibly modify your BIOS to enable AHCI functionality, if available.This code is very experimental at the moment. The userland ABI/API haschanged, so applications will need to be recompiled. It may changefurther in the near future. The 'ada' device name may also change asmore infrastructure is completed in this project. The goal is toeventually put all CAM busses and devices until newbus, allowing forinteresting 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, transportsspecific modules for SAS and FC may appear in order to better supportthe topologies and capabilities of these technologies.The modularization of CAM and the addition of the ATA/SATA modules ismeant to break CAM out of the mold of being specific to SCSI, letting itgrow to be a framework for arbitrary transports and protocols. It alsoallows drivers to be written to support discrete hardware withoutjeopardizing the stability of non-related hardware. While only an AHCIdriver is provided now, a Silicon Image driver is also in the works.Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardwareis possible and encouraged. Help with new transports is also encouraged.Submitted by: scottl, mavApproved by: re
Prepare for future integration between CAM and newbus. xpt_bus_registernow takes a device_t to be the parent of the bus that is being created.Most SIMs have been updated with a reasonable argument
Prepare for future integration between CAM and newbus. xpt_bus_registernow 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 exceptionsjust pass NULL for now. This argument isn't used yet and the newbusintegration likely won't be ready until after 7.0-RELEASE.
Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM willuse to synchornize and protect all data objects that are used for thatSIM. Drivers that are not yet MPSAFE register Giant a
Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM willuse to synchornize and protect all data objects that are used for thatSIM. Drivers that are not yet MPSAFE register Giant and operate asusual. RIght now, no drivers are MPSAFE, though a few will be changedin 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 tobe recompiled.
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 handlerso retire INTR_FAST/IH_FASTFor more info: http://docs.freebsd.org
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 handlerso retire INTR_FAST/IH_FASTFor more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-currentReviewed by: manyApproved by: re@
Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed.PR: 106543MFC after: 3 days
2nd and final commit that moves us to CAM_NEW_TRAN_CODEas the default.Reviewed by multitudes.
The first of 3 major steps to move the CAM layer forward to usingthe CAM_NEW_TRAN_CODE that has been in the tree for some years now.This first step consists solely of adding to or correctingCAM_N
The first of 3 major steps to move the CAM layer forward to usingthe CAM_NEW_TRAN_CODE that has been in the tree for some years now.This first step consists solely of adding to or correctingCAM_NEW_TRAN_CODE pieces in the kernel source tree suchthat a both a GENERIC (at least on i386) and a LINT buildwith CAM_NEW_TRAN_CODE as an option will compile correctlyand run (at least with some the h/w I have).After a short settle time, the other pieces (makingCAM_NEW_TRAN_CODE the default and updating libcamand camcontrol) will be brought in.This will be an incompatible change in that the size of structuresrelated to XPT_PATH_INQ and XPT_{GET,SET}_TRAN_SETTINGS changein both size and content. However, basic system operation andbasic system utilities work well enough with this change.Reviewed by: freebsd-scsi and specific stakeholders
Since DELAY() was moved, most <machine/clock.h> #includes have beenunnecessary.
Remove bus_{mem,p}io.h and related code for a micro-optimization on i386and amd64. The optimization is a trivial on recent machines.Reviewed by: -arch (imp, marcel, dfr)
Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, returnBUS_PROBE_LOW_PRIORITY in stead of ifdef for devices that xl and vxboth support so that xl will snarf them on up.
Start each of the license/copyright comments with /*-, minor shuffle of lines
Add missing <sys/module.h> includes
Call trm_Interrupt() in trm_poll(). This fixes the lock at reboot time somepeople reported.PR: kern/62864Tested by: Putinas Piliponis <putinas.piliponis at icnspot.net>
Convert callers to the new bus_alloc_resource_any(9) API.Submitted by: Mark Santcroos <[email protected]>Reviewed by: imp, dfr, bde
12