aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/isci
Commit message (Collapse)AuthorAgeFilesLines
* Make MAXPHYS tunable. Bump MAXPHYS to 1M.Konstantin Belousov2020-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys. Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value. Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work. Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav. Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225 Notes: svn path=/head/; revision=368124
* Remove support for FreeBSD 8 systems. These workarounds and ways of rescanningWarner Losh2020-03-013-25/+0
| | | | | | | devices are no longer done. Notes: svn path=/head/; revision=358487
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-13/+17
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Enforce a 4GB DMA boundary on isci(4)Warner Losh2019-07-103-4/+8
| | | | | | | | | | | | | This device cannot cross a 4GB boundary with DMA. Removing the boundary in r346386 resulted in low frequency memory corruption on machines with isci(4) controllers. Submitted by: gallatin@ Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20910 Notes: svn path=/head/; revision=349895
* isci(4): Use controller->lock for busdma tags.Konstantin Belousov2019-03-123-7/+13
| | | | | | | | | | | | | isci(4) uses deferred loading. Typically on amd64 and i386 non-PAE the tag does not create any restrictions, but on i386 PAE-tables but non-PAE configs callbacks might be used. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=345070
* Correct typo in ATA_WRITE_UNCORRECTABLE_PSEUDOEd Maste2018-02-232-4/+4
| | | | | | | | | | | Also correct a typo in the comment for these values, noted by jimharris. Reviewed by: jimharris Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3715 Notes: svn path=/head/; revision=329877
* kernel: Fix several typos and minor errorsEitan Adler2017-12-272-2/+2
| | | | | | | | | | | - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Notes: svn path=/head/; revision=327231
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-27254-0/+508
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Include opt files in the kernel with "" instead of <>.Warner Losh2017-07-101-1/+1
| | | | Notes: svn path=/head/; revision=320860
* scif_sas_controller: Fix inverted logic range checkConrad Meyer2017-03-131-1/+1
| | | | | | | | | PR: 217742 Submitted by: Svyatoslav <razmyslov at viva64.com> Sponsored by: Viva64 (PVS-Studio) Notes: svn path=/head/; revision=315205
* Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)Alan Somers2017-01-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Reviewed by: imp, sephe, slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9037 Differential Revision: https://reviews.freebsd.org/D9038 Notes: svn path=/head/; revision=311305
* Pass proper arguments (handles, not directly structure pointers) toAlexander Motin2016-12-281-2/+3
| | | | | | | | | | | | scif_cb_domain_device_removed(). This should fix NULL dereference on task management function timeout. Reviewed by: jimharris MFC after: 2 weeks Notes: svn path=/head/; revision=310703
* Fix improper use of "its".Bryan Drewery2016-11-082-2/+2
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=308457
* isci: fix ATA PASSTHROUGH fixed sense data formatJim Harris2016-07-062-4/+4
| | | | | | | | | | PR: kern/191717 Submitted by: martin@lispworks.com Approved by: re (gjb) MFC after: 3 days Notes: svn path=/head/; revision=302380
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-0347-100/+100
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* etc: minor spelling fixes.Pedro F. Giffuni2016-05-022-19/+19
| | | | | | | | | Mostly comments but also some user-visible strings. MFC after: 2 weeks Notes: svn path=/head/; revision=298931
* Storage Controller Interface driver - typo in unimplemented macro inRavi Pokala2016-04-061-1/+1
| | | | | | | | | | | | scic_sds_controller_registers.h s/contoller/controller/ PR: 207336 Submitted by: Tony Narlock <tony @ git-pull.com> Notes: svn path=/head/; revision=297609
* Make sure we check for CAM_CDB_POINTER for all drivers. Also, for theWarner Losh2016-03-152-11/+17
| | | | | | | | | drivers I've touched, filter out CAM_CDB_PHYS. Differential Revision: https://reviews.freebsd.org/D5585 Notes: svn path=/head/; revision=296891
* As <machine/pmap.h> is included from <vm/pmap.h>, there is no need toSvatopluk Kraus2016-02-221-1/+0
| | | | | | | | | | include it explicitly when <vm/pmap.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5373 Notes: svn path=/head/; revision=295880
* Replace several bus_alloc_resource() calls using default arguments with ↵Justin Hibbits2016-02-191-2/+2
| | | | | | | | | | | | bus_alloc_resource_any() Since these calls only use default arguments, bus_alloc_resource_any() is the right call. Differential Revision: https://reviews.freebsd.org/D5306 Notes: svn path=/head/; revision=295790
* Fix typo (s/harware/hardware/)Kevin Lo2015-12-251-1/+1
| | | | Notes: svn path=/head/; revision=292730
* isci: check return value of pci_alloc_msix()Jim Harris2015-09-081-2/+2
| | | | | | | | | | | | | | Certain VM guest types (VMware, Xen) do not support MSI, so pci_alloc_msix() always fails. isci(4) was not properly detecting the allocation failure, and would try to proceed with MSIx resource initialization rather than reverting to INTx. Reported and tested by: Bradley W. Dutton (brad-fbsd-stable@duttonbros.com) MFC after: 3 days Sponsored by: Intel Notes: svn path=/head/; revision=287564
* isci: explicitly enable/disable PCI busmasterJim Harris2015-09-081-0/+2
| | | | | | | | | | | | | BIOS always enables PCI busmaster on the isci device, which effectively worked around this omission. But when passing the isci device through to a guest VM, the hypervisor will disable busmaster and isci will not work without calling pci_enable_busmaster(). MFC after: 3 days Sponsored by: Intel Notes: svn path=/head/; revision=287563
* CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenJung-uk Kim2015-05-221-1/+1
| | | | | | | | | | | | | years for head. However, it is continuously misused as the mpsafe argument for callout_init(9). Deprecate the flag and clean up callout_init() calls to make them more consistent. Differential Revision: https://reviews.freebsd.org/D2613 Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=283291
* Fix tunable and sysctl handling of the fail_on_task_timeout knob.Scott Long2014-12-242-2/+5
| | | | | | | | | Reviewed by: emax Obtained from: Netflix, Inc. MFC after: 3 days Notes: svn path=/head/; revision=276174
* Prevent overflow issues in timeout processingSteven Hartland2014-11-212-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=274819
* In rare cases, a SATA drive can stop responding to commands and trigger aScott Long2014-06-304-3/+40
| | | | | | | | | | | | | | | | | | | reset device task request from the driver. If the drive fails to respond with a signature FIS, the driver would previously get into an endless retry loop, stalling all I/O to the drive and keeping user processes stranded. Instead, fail the i/o and invalidate the device if the task management command times out. This is controllable with the sysctl and tunable hw.isci.fail_on_task_timeout dev.isci.0.fail_on_task_timeout The default for these is 1. Reviewed by: jimharris Obtained from: Netflix, Inc. MFC after: 2 days Notes: svn path=/head/; revision=268025
* Fix a case in ndling ATA_PASSTHROUGH commands that have an unaligned buffer.Scott Long2014-06-301-0/+1
| | | | | | | | | | | This impacts some home-rolled SMART tools. Reviewed by: jimharris Obtained from: Netflix MFC after: 2 days Notes: svn path=/head/; revision=268024
* Base the max number of SG elements on MAXPHYS.Jim Harris2014-03-174-19/+14
| | | | | | | | | Sponsored by: Intel Discussed with: scottl, emax MFC after: 3 days Notes: svn path=/head/; revision=263276
* isci: Ensure ATA passthrough commands with RETURN_RESPONSE bit setJim Harris2014-03-171-2/+10
| | | | | | | | | | | translate their response. Sponsored by: Intel Discussed with: scottl MFC after: 3 days Notes: svn path=/head/; revision=263275
* Improve logging around some of the isci(4) reset and recovery paths.Jim Harris2013-10-093-4/+52
| | | | | | | | | | Sponsored by: Intel Discussed with: scottl Approved by: re (marius) MFC after: 1 week Notes: svn path=/head/; revision=256231
* Make isci(4) loadable.Konstantin Belousov2013-10-071-0/+1
| | | | | | | | | | Reviewed by: jimharris Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (gjb) Notes: svn path=/head/; revision=256125
* For ATA_PASSTHROUGH commands, pretend isci(4) supports multiword DMAJim Harris2013-06-261-4/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | by treating it as UDMA. This fixes a problem introduced in r249933/r249939, where CAM sends ATA_DSM_TRIM to SATA devices using ATA_PASSTHROUGH_16. scsi_ata_trim() sets protocol as DMA (not UDMA) which is for multi-word DMA, even though no such mode is selected for the device. isci(4) would fail these commands which is the correct behavior but not consistent with other HBAs, namely LSI's. smh@ did some further testing on an LSI controller, which rejected ATA_PASSTHROUGH_16 commands with mode=UDMA_OUT, even though only a UDMA mode was selected on the device. So this precludes adding any kind of mode detection in CAM to determine which mode to use on a per-device basis. Sponsored by: Intel Discussed with: scottl, smh Reported by: scottl Tested by: scottl MFC after: 3 days Notes: svn path=/head/; revision=252262
* Fxi a bunch of typos.Eitan Adler2013-05-101-2/+2
| | | | | | | | PR: misc/174625 Submitted by: Jeremy Chadwick <jdc@koitsu.org> Notes: svn path=/head/; revision=250460
* - Correct mispellings of word resourceGabor Kovesdan2013-04-173-3/+3
| | | | | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> Notes: svn path=/head/; revision=249586
* MFprojects/camlock r248982:Alexander Motin2013-04-143-5/+5
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=249468
* Panic should the SCI framework ever request a pointer into the ccb'sJim Harris2013-03-271-3/+24
| | | | | | | | | | | | | | data buffer for a ccb that is unmapped. This case is currently not possible, since the SCI framework only requests these pointers for doing SCSI/ATA translation of non- READ/WRITE commands. The panic is more to protect against the unlikely future scenario where additional commands could be unmapped. Sponsored by: Intel Notes: svn path=/head/; revision=248778
* Report support for unmapped I/O by adding PIM_UNMAPPED flag.Jim Harris2013-03-262-5/+2
| | | | | | | Submitted by: jhb, scottl Notes: svn path=/head/; revision=248775
* Reform the busdma API so that new types may be added without modifyingKonstantin Belousov2013-02-121-22/+13
| | | | | | | | | | | | | | | | | | | | | | | | 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>) Notes: svn path=/head/; revision=246713
* Don't call bus_dmamap_load in CAM_DIR_NONE case, since there is nothingJim Harris2012-12-051-13/+15
| | | | | | | | | | | | | | | | | | | | | to map, and technically this isn't allowed. Functionally, it works OK (at least on x86) to call bus_dmamap_load with a NULL data pointer and zero length, so this is primarily for correctness and consistency with other drivers. While here, remove check in isci_io_request_construct for nseg==0. Previously, bus_dmamap_load would pass nseg==1, even for case where buffer is NULL and length = 0, which allowed CAM_DIR_NONE CCBs to get processed. This check is not correct though, and needed to be removed both for the changes elsewhere in this patch, as well as jeff's preliminary bus_dmamap_load_ccb patch (which uncovered all of this in the first place). MFC after: 3 days Notes: svn path=/head/; revision=243904
* Add support for locate LED.Jim Harris2012-10-103-15/+42
| | | | | | | | | | | While here, change ISCI_LED to ISCI_PHY since conceptually the hardware ties the LEDs to a phy and the LEDs for a given phy cannot be controlled independently. Submitted by: Paul Maulberger <Paul.Maulberger at gmx.de> (with modifications) Notes: svn path=/head/; revision=241403
* Create led(4) device nodes mapped to isci(4) SGPIO locate LEDs.Jim Harris2012-09-263-1/+37
| | | | | | | | | | | Device nodes are in the format /dev/led/isci.busX.portY.locate. Sponsored by: Intel Requested by: Paul Maulberger <paul dot maulberger at gmx dot de> MFC after: 1 week Notes: svn path=/head/; revision=240965
* Fix typo: s/protocl/protocolKevin Lo2012-09-201-1/+1
| | | | Notes: svn path=/head/; revision=240743
* s/ is is / is /gEitan Adler2012-09-141-1/+1
| | | | | | | | | | s/ a a / a /g Approved by: cperciva MFC after: 3 days Notes: svn path=/head/; revision=240521
* s/teh/the/gEitan Adler2012-09-141-1/+1
| | | | | | | | Approved by: cperciva MFC after: 3 days Notes: svn path=/head/; revision=240520
* Correct double "the the"Eitan Adler2012-09-1412-16/+16
| | | | | | | | Approved by: cperciva MFC after: 3 days Notes: svn path=/head/; revision=240518
* isci(4): Fix SCSI/ATA translation for SCSI_WRITE_BUFFER w/ mode==0x7Jim Harris2012-09-142-7/+14
| | | | | | | | | | | | | | | | | (download microcode with offsets, save, and activate). SATI translation layer was incorrectly using allocation length instead of blocks, and was constructing the ATA command incorrectly. Also change #define to specify that the 512 block size here is specific for DOWNLOAD_MICROCODE, and does not relate to the device's logical block size. Submitted by: scottl (with small modifications) MFC after: 3 days Notes: svn path=/head/; revision=240514
* Do not call sati_check_data_io() for SATI_UNMAP sequences.Jim Harris2012-08-301-4/+0
| | | | | | | | | | | | | | | This routine is intended only for commands such as INQUIRY where the controller may fill out a smaller amount of data than allocated by the host. The end result of this bug was that isci(4) would report non-zero resid for successful SCSI_UNMAP commands. Sponsored by: Intel MFC after: 3 days Notes: svn path=/head/; revision=239889
* Clear freeze bit before calling xpt_release_devq.Jim Harris2012-08-241-1/+1
| | | | | | | | | | | This ensures that any ccbs which immediately start during the call to xpt_release_devq see an accurate picture of the frozen_lun_mask. Sponsored by: Intel MFC after: 3 days Notes: svn path=/head/; revision=239665
* Fix/add support for SCSI UNMAP to ATA DSM translation.Jim Harris2012-08-216-11/+56
| | | | | | | | | | | | | | | | | | | | | This addresses kernel panic observed when sending SCSI UNMAP commands to SATA disks attached to isci(4). 1) Flesh out callback routines to allocate/free buffers needed for translating SCSI UNMAP data to ATA DSM data. 2) Add controller-level pool for storing buffers previously allocated for UNMAP translation, to lessen chance of no buffer available under memory pressure. 3) Ensure driver properly handles case where buffer pool is empty and contigmalloc returns NULL. Sponsored by: Intel Reported by: Maksim Yevmenkin <max at netflix dot com> Discussed with: scottl MFC after: 3 days Notes: svn path=/head/; revision=239545