summaryrefslogtreecommitdiff
path: root/sys/dev/ata
AgeCommit message (Collapse)Author
12 daysata-serverworks: Fix incorrect port count for BCM5770 SATA controllerDmitry Borisov
The 1166:0241 PCI device has 8 ports instead of 4. Signed-off-by: Dmitry Borisov <di.sean@protonmail.com> Reviewed by: imp, jlduran Pull Request: https://github.com/freebsd/freebsd-src/pull/1883
2025-12-09bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHODJohn Baldwin
The wrapper functions such as bus_alloc_resource_any() still support passing the rid by value or pointer, but the underlying implementation now passes by value. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53402
2025-06-11machine/stdarg.h -> sys/stdarg.hBrooks Davis
Switch to using sys/stdarg.h for va_list type and va_* builtins. Make an attempt to insert the include in a sensible place. Where style(9) was followed this is easy, where it was ignored, aim for the first block of sys/*.h headers and don't get too fussy or try to fix other style bugs. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
2025-01-02Use bus_generic_detach instead of device_delete_children in detachJohn Baldwin
While here, check for errors from bus_generic_detach and move it to the start of detach if necessary. Differential Revision: https://reviews.freebsd.org/D47969
2024-12-06Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin
Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
2024-07-24newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh
Sponsored by: Netflix
2024-06-02ata: Use device_set_descf()Mark Johnston
No functional change intended. MFC after: 1 week
2024-03-13new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCEJohn Baldwin
The public bus_release_resource() API still accepts both forms, but the internal kobj method no longer passes the arguments. Implementations which need the rid or type now use rman_get_rid() or rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44131
2023-11-26sys: Automated cleanup of cdefs and other formattingWarner Losh
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
2023-11-24ata: Retire unused variable / externsWarner Losh
When looking for something else, I noticed these are no longer used anywhere. Sponsored by: Netflix
2023-10-30Add IDs for Intel BayTrail SATA.Dmitry Luhtionov
2023-10-26arm: prune imx5 support from the treeKyle Evans
The IMX5 configs were removed in advance of FreeBSD 14.0 in cdb0c2a73df ("arm: Remove IMX5 specific kernel configs"). This code isn't built with GENERIC and doesn't actually build today as-is, so let's remove it to avoid needless maintenance work to it that won't be tested. As usual, revival is welcome with a committed user and work to maintain it with upstream DTS and, ideally, in GENERIC. I note that vt_early_fb is now effectively orphaned as nothing else will use it, but I haven't yet removed it since I have not done anything to ascertain if it could be integrated easily enough for other SoC. It is among the files that doesn't actually build with today's clang, though. Reviewed by: imp, manu Differential Revision: https://reviews.freebsd.org/D41836
2023-08-16sys: Remove $FreeBSD$: one-line sh patternWarner Losh
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16sys: Remove $FreeBSD$: two-line .h patternWarner Losh
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-05-12spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
2022-07-03ata(4): Fix a typo in a source code commentGordon Bergling
- s/fuctions/functions/ MFC after: 3 days
2022-05-06Remove unused ata_pci_devclass.John Baldwin
2022-05-06ata: Remove ata_devclass from DRIVER_MODULE invocations.John Baldwin
Keep the global variable for its uses in ata-pci.c and chipsets/ata-fsl.c but initialize it in the existing ata_module_event_handler. Move the module event handler a bit earlier to ensure the variable is set before any devices are attached.
2022-04-13ata-fsl: Remove unused variable.John Baldwin
2021-12-14ata-promise: kill lenght, it's set but never usedWarner Losh
Sponsored by: Netflix
2021-08-08Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrightsEd Maste
These ones were unambiguous cases where the Foundation was the only listed copyright holder (in the associated license block). Sponsored by: The FreeBSD Foundation
2021-06-22newbus: Move from bus_child_{pnpinfo,location}_src to ↵Warner Losh
bus_child_{pnpinfo,location} with sbuf Now that the upper layers all go through a layer to tie into these information functions that translates an sbuf into char * and len. The current interface suffers issues of what to do in cases of truncation, etc. Instead, migrate all these functions to using struct sbuf and these issues go away. The caller is also in charge of any memory allocation and/or expansion that's needed during this process. Create a bus_generic_child_{pnpinfo,location} and make it default. It just returns success. This is for those busses that have no information for these items. Migrate the now-empty routines to using this as appropriate. Document these new interfaces with man pages, and oversight from before. Reviewed by: jhb, bcr Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29937
2021-01-07pccard: Remove ata(4) PC Card attachemntWarner Losh
Remove ata PC Card attachment. Relnotes: Yes
2020-11-28Make MAXPHYS tunable. Bump MAXPHYS to 1M.Konstantin Belousov
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
2020-11-24ata(4): Release the ioport resource if device initialization failsMark Johnston
PR: 251346 Submitted by: janm@transactionware.com MFC after: 1 week Notes: svn path=/head/; revision=367989
2020-09-01ata: clean up empty lines in .c and .h filesMateusz Guzik
Notes: svn path=/head/; revision=365115
2020-08-20Tag pccard drivers with gone in 13.Warner Losh
MFC After: 3 days Reviewed by: emaste, brooks, adrian (on twitter) Differential Revision: https://reviews.freebsd.org/D26095 Notes: svn path=/head/; revision=364430
2020-02-26Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki
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
2020-02-03Remove sparc64 kernel supportWarner Losh
Remove all sparc64 specific files Remove all sparc64 ifdefs Removee indireeect sparc64 ifdefs Notes: svn path=/head/; revision=357455
2019-12-17Avoid a tautological bitwise compare.Brooks Davis
This looks like a bit of debugging code that sliped into the initial import of the new ATA framework. This changes the behavior to omit a line of output that appears to have been intended for omission. Reviewed by: mav MFC after: 3 days Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22845 Notes: svn path=/head/; revision=355830
2019-12-05Use a void * argument to callout handlers instead of timeout_t casts.John Baldwin
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22684 Notes: svn path=/head/; revision=355426
2019-02-16GC ATA_REQUEST_TIMEOUT option remnantsAndriy Voskoboinyk
It was removed from code in r249083 and from sys/conf/options in r249213. PR: 222170 MFC after: 3 days Notes: svn path=/head/; revision=344198
2018-07-03Reset indentiation of ata_suspend() such that its clear we fall throughSean Bruno
this function and that we aren't supposed to be controlled by the first if() conditional. Found with gcc. No functional change is intended with this commit. Notes: svn path=/head/; revision=335896
2018-07-03Reset indentation of this flag. No functional change intended.Sean Bruno
Found with gcc. sys/dev/ata/chipsets/ata-siliconimage.c: In function 'ata_cmd_ch_attach': sys/dev/ata/chipsets/ata-siliconimage.c:187:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if (ctlr->chip->cfg2 & SII_INTR) ^~ sys/dev/ata/chipsets/ata-siliconimage.c:190:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' ch->flags |= ATA_NO_ATAPI_DMA; Notes: svn path=/head/; revision=335894
2018-05-23Add ready polling after PHY reset on VIA SATA controllers.Alexander Motin
According to PR there are cases of controller hang if soft reset is sent before device report ready status after the hard reset. I don't think this patch is perfect, but it was reported as working by the submitter, and I have neither the old hardware nor interest to test some improved version, so just done some style cleaning. PR: 183294 Submitted by: alexandre.martins@netasq.com MFC after: 1 month Notes: svn path=/head/; revision=334099
2018-01-29Add ISA PNP tables to ISA drivers. Fix a few incidental comments.Warner Losh
ACPI ISA PBP tables not tagged, there's bigger issues with them. Notes: svn path=/head/; revision=328524
2017-11-30Fix typoEitan Adler
Reported by: mjg, zrj@dragonflybsd.org Notes: svn path=/head/; revision=326387
2017-11-27sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni
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
2017-08-09Use "Ibex Peak" codename for "5 Series/3400 Series" chipsets.Alexander Motin
This is shorter and unifies naming with later chipsets. MFC after: 1 week Notes: svn path=/head/; revision=322309
2017-02-19Remove dead mentions of CAM target mode APIs from drivers.Alexander Motin
This makes grepping kernel for target mode implementation much easier. Notes: svn path=/head/; revision=313949
2017-01-28Remove pc98 support completely.Yoshihiro Takahashi
I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
2017-01-04Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)Alan Somers
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
2016-05-03sys/dev: minor spelling fixes.Pedro F. Giffuni
Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
2016-04-17Implement Auxiliary register. Add PIM_ATA_EXT flag to flag that a SIMWarner Losh
can handle it, and add the code to add it to the FIS that's sent to the drive. The mvs driver is the only other ATA driver in the system, and its hardware doesn't appear to support setting the Auxiliary register. Differential Revision: https://reviews.freebsd.org/D5598 Notes: svn path=/head/; revision=298143
2016-04-10Cleanup unnecessary semicolons from the kernel.Pedro F. Giffuni
Found with devel/coccinelle. Notes: svn path=/head/; revision=297793
2016-03-29Small typo.Pedro F. Giffuni
Notes: svn path=/head/; revision=297402
2016-02-27Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Justin Hibbits
Most calls to bus_alloc_resource() use "anywhere" as the range, with a given count. Migrate these to use the new bus_alloc_resource_anywhere() API. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370 Notes: svn path=/head/; revision=296137
2016-02-17Ternary operator has lower priority than OR.Gleb Smirnoff
Found by: PVS-Studio Notes: svn path=/head/; revision=295719
2016-02-16Convert a few more long -> rman_res_t.Justin Hibbits
Notes: svn path=/head/; revision=295664