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 ...
Update tw_cl_share.h to allow 255 LUNsTW_CL_MAX_NUM_LUNS should not be 16 but I presume 255. I have a 3warecontroller with more than 16 volumes (LUN's) and otherwise all LUN'sabove the 16'th are
Update tw_cl_share.h to allow 255 LUNsTW_CL_MAX_NUM_LUNS should not be 16 but I presume 255. I have a 3warecontroller with more than 16 volumes (LUN's) and otherwise all LUN'sabove the 16'th are not working.Submitted by: jcatrysse <[email protected]>Pull Request: https://github.com/freebsd/freebsd/pull/100
In the same vein as r311350, fix whitespace in handling of XPT_PATH_INQ inseveral more drivers.Sponsored by: Panasas
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
Replace several bus_alloc_resource() calls using default arguments with bus_alloc_resource_any()Since these calls only use default arguments, bus_alloc_resource_any() is theright call.Differenti
Replace several bus_alloc_resource() calls using default arguments with bus_alloc_resource_any()Since these calls only use default arguments, bus_alloc_resource_any() is theright call.Differential Revision: https://reviews.freebsd.org/D5306
CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenyears for head. However, it is continuously misused as the mpsafe argumentfor callout_init(9). Deprecate the flag and cle
CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenyears for head. However, it is continuously misused as the mpsafe argumentfor callout_init(9). Deprecate the flag and clean up callout_init() callsto make them more consistent.Differential Revision: https://reviews.freebsd.org/D2613Reviewed by: jhbMFC after: 2 weeks
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 highnumbered LUNs, also switch to printing them in hex as
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 highnumbered LUNs, also switch to printing them in hex as per SAM-5.MFC after: 2 weeks
Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIcommand register. The lazy BAR allocation code in FreeBSD sometimesdisables this bit when it detects a range conflict, and w
Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIcommand register. The lazy BAR allocation code in FreeBSD sometimesdisables this bit when it detects a range conflict, and will re-enableit on demand when a driver allocates the BAR. Thus, the bit is no longera reliable indication of capability, and should not be checked. Thisresults in the elimination of a lot of code from drivers, and also givesthe opportunity to simplify a lot of drivers to use a helper API to setthe busmaster enable bit.This changes fixes some recent reports of disk controllers and theirassociated drives/enclosures disappearing during boot.Submitted by: jhbReviewed by: jfv, marius, achadd, achimMFC after: 1 day
MFprojects/camlock r248982:Stop abusing xpt_periph in random plases that really have no periph relatedto CCB, for example, bus scanning. NULL value is fine in such cases and itis correctly logged
MFprojects/camlock r248982:Stop abusing xpt_periph in random plases that really have no periph relatedto CCB, for example, bus scanning. NULL value is fine in such cases and itis correctly logged in debug messages as "noperiph". If at some point weneed some real XPT periphs (alike to pmpX now), quite likely they will beper-bus, and not a single global instance as xpt_periph now.
Fix twa(4) after the r246713. The driver copies data around tosatisfy some alignment restrictions. Do not set TW_OSLI_REQ_FLAGS_CCBflag for mapped data, pass the csio->data_ptr in the req->data.
Fix twa(4) after the r246713. The driver copies data around tosatisfy some alignment restrictions. Do not set TW_OSLI_REQ_FLAGS_CCBflag for mapped data, pass the csio->data_ptr in the req->data.Do not put the ccb pointer into req->data ever, ccb is stored inreq->orig_req already.Submitted by: Shuichi KITAGUCHI <[email protected]>PR: kern/177020
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]>)
Give tw_osl_dbg_printf format string to pacify clang warning.
Return CAM_SEL_TIMEOUT and CAM_DEV_NOT_THERE instead of CAM_TID_INVALIDand CAM_LUN_INVALID for case of missing devices. In removes tons of errormessages from CAM during bus scans.Reported and tes
Return CAM_SEL_TIMEOUT and CAM_DEV_NOT_THERE instead of CAM_TID_INVALIDand CAM_LUN_INVALID for case of missing devices. In removes tons of errormessages from CAM during bus scans.Reported and tested by: Mike Tancsa <[email protected]>MFC after: 3 days
Use bus_get_dma_tag() to inherit the 4G boundary restriction from theparent PCI bus and remove the home-grown version in this driver.
s/timout/timeout
- There's no need to overwrite the default device method with the default one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_
- There's no need to overwrite the default device method with the default one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel- While at it, use DEVMETHOD_END. Discussed with: jhb- Also while at it, use __FBSDID.
Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.This means that their use is restricted to a single C file.
Fix a compile problem introduced with r212008 on 32bit:Both deadline and current_time are time_seconds (+ utc_offset())casted to unsigned long long. No need to cast to or print as pointers.MFC a
Fix a compile problem introduced with r212008 on 32bit:Both deadline and current_time are time_seconds (+ utc_offset())casted to unsigned long long. No need to cast to or print as pointers.MFC after: 4 days
Drain watchdog callouts before detaching. This prevents a panic whileunloading the kernel module.Submitted by: Tom Cough
Vendor update to version 3.80.06.003 to fix a panic with ZFS when underheavy I/O load.Many thanks to LSI for continuing to support FreeBSD.PR: kern/149968Submitted by: LSI (Tom Couch)Reported
Vendor update to version 3.80.06.003 to fix a panic with ZFS when underheavy I/O load.Many thanks to LSI for continuing to support FreeBSD.PR: kern/149968Submitted by: LSI (Tom Couch)Reported by: Kai Kockro <kkockro web de>Tested by: Kai Kockro, jpaetzelMFC after: 7 days
Don't use pack() for structures that is used purely for software state.Otherwise the resulting, unaligned mutex structure would trigger panic.Submitted by: Tom Cough <tom.couch lsi.com>Reported/
Don't use pack() for structures that is used purely for software state.Otherwise the resulting, unaligned mutex structure would trigger panic.Submitted by: Tom Cough <tom.couch lsi.com>Reported/Tested by: jhbMFC after: 3 days
Remove an unused comment.
Apply driver update from LSI. Many thanks to LSI for continuing tosupport FreeBSD. 1) Timeout ioctl command timeouts. Do not reset the controller if ioctl command completed success
Apply driver update from LSI. Many thanks to LSI for continuing tosupport FreeBSD. 1) Timeout ioctl command timeouts. Do not reset the controller if ioctl command completed successfully. 2) Remove G66_WORKAROUND code (this bug never shipped). 3) Remove unnecessary interrupt lock (intr_lock). 4) Timeout firmware handshake for PChip reset (don't wait forever). 5) Handle interrupts inline. 6) Unmask command interrupt ONLY when adding a command to the pending queue. 7) Mask command interrupt ONLY after removing the last command from the pending queue. 8) Remove TW_OSLI_DEFERRED_INTR_USED code. 9) Replace controller "state" with separate data fields to avoid races: TW_CLI_CTLR_STATE_ACTIVE ctlr->active TW_CLI_CTLR_STATE_INTR_ENABLED ctlr->interrupts_enabled TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY ctlr->internal_req_busy TW_CLI_CTLR_STATE_GET_MORE_AENS ctlr->get_more_aens TW_CLI_CTLR_STATE_RESET_IN_PROGRESS ctlr->reset_in_progress TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS ctlr->reset_phase1_in_progress 10) Fix "req" leak in twa_action() when simq is frozen and req is NOT null. 11) Replace softc "state" with separate data fields to avoid races: TW_OSLI_CTLR_STATE_OPEN sc->open TW_OSLI_CTLR_STATE_SIMQ_FROZEN sc->simq_frozen 12) Fix reference to TW_OSLI_REQ_FLAGS_IN_PROGRESS in tw_osl_complete_passthru() 13) Use correct CAM status values. Change CAM_REQ_CMP_ERR to CAM_REQ_INVALID. Remove use of CAM_RELEASE_SIMQ for physical data addresses. 14) Do not freeze/ release the simq with non I/O commands. When it is appropriate to temporarily freeze the simq with an I/O command use: xpt_freeze_simq(sim, 1); ccb->ccb_h.status |= CAM_RELEASE_SIMQ; otherwise use: xpt_freeze_simq(sim, 1); xpt_release_simq(sim, 1);Submitted by: Tom Couch <tom.couch lsi.com>PR: kern/147695MFC after: 3 days
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.
Change the command argument to ioctl routines to u_long to avoidtruncating the command to 32bit on 64bit archs where int is 32bit(ie. amd64).Approved by: scottlApproved by: ed (mentor, implicit)
123