summaryrefslogtreecommitdiff
path: root/sys/dev/mlx
AgeCommit message (Collapse)Author
2025-01-02Use bus_generic_detach to detach and delete child devices during detachJohn Baldwin
This is simpler and more robust than individual calls to device_delete_child. Differential Revision: https://reviews.freebsd.org/D47972
2024-12-06Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin
Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
2024-09-03mlx(4): Stop checking for failures from malloc(M_WAITOK)Zhenlei Huang
MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852
2024-07-24newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh
Sponsored by: Netflix
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-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-06-05mlx(4): Fix a common typo in a source code commentGordon Bergling
- s/independant/independent/ MFC after: 3 days
2022-05-06mlx: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin
2022-04-21mlx: Use devclass_find to lookup the devclass for mlxd.John Baldwin
Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D34994
2021-12-09Create wrapper for Giant taken for newbusWarner Losh
Create a wrapper for newbus to take giant and for busses to take it too. bus_topo_lock() should be called before interacting with newbus routines and unlocked with bus_topo_unlock(). If you need the topology lock for some reason, bus_topo_mtx() will provide that. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D31831
2021-11-03sysbeep: Adjust interface to take a duration as a sbtWarner Losh
Change the 'period' argument to 'duration' and change its type to sbintime_t so we can more easily express different durations. Reviewed by: tsoome, glebius Differential Revision: https://reviews.freebsd.org/D32619
2020-02-07Ever since the block layer expanded its command syntax beyond justScott Long
BIO_READ and BIO_WRITE, we've handled this expanded syntax poorly in drivers when the driver doesn't support a particular command. Do a sweep and fix that. Reported by: imp Notes: svn path=/head/; revision=357647
2019-05-20Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer
This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
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-02-16Remove references to EISA support in mlx. The driver never supportedWarner Losh
the EISA cards and EISA bus support is being removed. Notes: svn path=/head/; revision=313827
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-26sys/dev: extend use of the howmany() macro when available.Pedro F. Giffuni
We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read. Notes: svn path=/head/; revision=298646
2016-04-19sys/dev: use our nitems() macro when it is avaliable through param.h.Pedro F. Giffuni
No functional change, only trivial cases are done in this sweep, Drivers that can get further enhancements will be done independently. Discussed in: freebsd-current Notes: svn path=/head/; revision=298307
2015-03-22Remove MAXBSIZE use from drivers where it has nothing to do.Alexander Motin
In some cases limits are just not needed, in others -- DFLTPHYS is the right constant to use instead. MFC after: 1 month Notes: svn path=/head/; revision=280347
2014-06-13Add missing calls to bus_dmamap_unload() when freeing static DMAJohn Baldwin
allocations. Reviewed by: scottl Notes: svn path=/head/; revision=267446
2012-09-26Remove FreeBSD 4.x compat shims. Verified by md5.John Baldwin
Notes: svn path=/head/; revision=240963
2012-09-17Add locking to mlx(4) to make it MPSAFE along with some other fixes:John Baldwin
- Use callout(9) rather than timeout(9). - Add a mutex as an I/O lock that protects the adapter and is used for the I/O path. - Add an sx lock as a configuration lock that protects the relationship of configured volumes. - Freeze the request queue when a DMA load is deferred with EINPROGRESS and unfreeze the queue when the DMA callback is invoked. - Explicitly poll the hardware while waiting to submit a command to allow completed commands to free up slots in the command ring. - Remove driver-wide 'initted' variable from mlx_*_fw_handshake() routines. That state should be per-controller instead. Add it as an argument since the first caller knows when it is the first caller. - Remove explicit bus_space tag/handle and use bus_*() rather than bus_space_*(). - Move duplicated PCI device ID probing into a mlx_pci_match() routine. - Don't check for PCIM_CMD_MEMEN (the PCI bus will enable that when allocating the resource) and use pci_enable_busmaster() rather than manipulating the register directly. Tested by: no one despite multiple requests (hope it works) Notes: svn path=/head/; revision=240608
2012-08-03Correct a typo.Xin LI
Reported by: Sascha Wildner <swildner dragonflybsd org> Reviewed by: scottl MFC after: 3 days Notes: svn path=/head/; revision=238997
2012-03-12Convert a number of drivers to obtaining their parent DMA tag from theirScott Long
PCI device attachment. Notes: svn path=/head/; revision=232854
2012-02-27Remove unused variable count.Kevin Lo
This variable is initialized but not used. Notes: svn path=/head/; revision=232219
2011-11-22- There's no need to overwrite the default device method with the defaultMarius Strobl
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. Notes: svn path=/head/; revision=227843
2009-08-20Temporarily revert the new-bus locking for 8.0 release. It will beJohn Baldwin
reintroduced after HEAD is reopened for commits by re@. Approved by: re (kib), attilio Notes: svn path=/head/; revision=196403
2009-08-02Make the newbus subsystem Giant free by adding the new newbus sxlock.Attilio Rao
The newbus lock is responsible for protecting newbus internIal structures, device states and devclass flags. It is necessary to hold it when all such datas are accessed. For the other operations, softc locking should ensure enough protection to avoid races. Newbus lock is automatically held when virtual operations on the device and bus are invoked when loading the driver or when the suspend/resume take place. For other 'spourious' operations trying to access/modify the newbus topology, newbus lock needs to be automatically acquired and dropped. For the moment Giant is also acquired in some key point (modules subsystem) in order to avoid problems before the 8.0 release as module handlers could make assumptions about it. This Giant locking should go just after the release happens. Please keep in mind that the public interface can be expanded in order to provide more support, if there are really necessities at some point and also some bugs could arise as long as the patch needs a bit of further testing. Bump __FreeBSD_version in order to reflect the newbus lock introduction. Reviewed by: ed, hps, jhb, imp, mav, scottl No answer by: ariff, thompsa, yongari Tested by: pho, G. Trematerra <giovanni dot trematerra at gmail dot com>, Brandon Gooch <jamesbrandongooch at gmail dot com> Sponsored by: Yahoo! Incorporated Approved by: re (ksmith) Notes: svn path=/head/; revision=196037
2009-07-10Separate the parallel scsi knowledge out of the core of the XPT, andScott Long
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 Notes: svn path=/head/; revision=195534
2009-04-18Convert mlx(4) and mly(4) to si_drv1 instead of dev2unit().Ed Schouten
Notes: svn path=/head/; revision=191242
2008-09-27Replace all calls to minor() with dev2unit().Ed Schouten
After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib Notes: svn path=/head/; revision=183397
2008-09-12Make mlxcontrol work with more than one system drive:Stephane E. Potvin
- When searching for the next system drive, return the next one instead of always returning the first one. - Plug fd lead and make sure that the MLX_NEXT_CHILD ioctl is called on the controller fd, not the disk's one. While there, fix a cut-n-pase error in a warning. Reviewed by: jhb Approved by: kan (mentor) MFC after: 1 month Notes: svn path=/head/; revision=182965
2007-02-23o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati
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@ Notes: svn path=/head/; revision=166901
2005-07-30Add missing parenthesis around error handling code upon attachingChristian S.J. Peron
mlx devices. This fixes an issue where mlx device drives fail to be detected at system boot. This is a RELENG_6 candidate. Submitted by: oliver PR: kern/84163 Notes: svn path=/head/; revision=148570
2005-05-29Remove bus_{mem,p}io.h and related code for a micro-optimization on i386Yoshihiro Takahashi
and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr) Notes: svn path=/head/; revision=146734
2005-03-31plug resource leakSam Leffler
Submitted by: mdodd Noticed by: Coverity Prevent analysis tool Notes: svn path=/head/; revision=144436
2005-03-31fix potential null ptr derefSam Leffler
Noticed by: Coverity Prevent analysis tool Notes: svn path=/head/; revision=144434
2005-03-31avoid null ptr derefSam Leffler
Noticed by: Coverity Prevent analysis tool Notes: svn path=/head/; revision=144433
2005-03-26Don't call mlx_free() i mlx_attach() in case of failure. Doing soPoul-Henning Kamp
in mlx_attach_pci() is much cleaner. Inspired by: Coverity Notes: svn path=/head/; revision=144161
2005-03-18If mlx_attach() returns an error, don't free sc again.David Schultz
Spotted by: Ted Unangst using the Coverity Prevent static analysis tool Reviewed by: scottl Notes: svn path=/head/; revision=143788
2005-03-05Use BUS_PROBE_DEFAULT for pci probe return valueWarner Losh
Notes: svn path=/head/; revision=143158
2004-11-25Don't use PAGE_SIZE to calculate controller-specific attributes.Scott Long
PR: kern/21220 Submitted by: Dennis Lindroos MFC After: 1 week Notes: svn path=/head/; revision=138090
2004-06-16Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp
Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
2004-05-30Add missing <sys/module.h> includesPoul-Henning Kamp
Notes: svn path=/head/; revision=129879
2004-03-17Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson
Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
2004-03-01Change another pointer name that was missed in the previous commit.Scott Long
Spotted by: njl Notes: svn path=/head/; revision=126463
2004-03-01Check and free the actual pointer the was used in a malloc instead ofScott Long
checking and freeing a different pointer that may or may not have been assigned the same value. This should fix panics under load that were recently reported. Notes: svn path=/head/; revision=126461
2004-02-22Don't free meo until we're finished using it.Colin Percival
Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor), scottl Notes: svn path=/head/; revision=126113