summaryrefslogtreecommitdiff
path: root/sys/dev/mlx/mlx_disk.c
Commit message (Collapse)AuthorAgeFilesLines
* Ever since the block layer expanded its command syntax beyond justScott Long2020-02-071-0/+5
| | | | | | | | | | | 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
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | 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
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-031-1/+1
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* Remove FreeBSD 4.x compat shims. Verified by md5.John Baldwin2012-09-261-15/+14
| | | | Notes: svn path=/head/; revision=240963
* Add locking to mlx(4) to make it MPSAFE along with some other fixes:John Baldwin2012-09-171-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Don't use PAGE_SIZE to calculate controller-specific attributes.Scott Long2004-11-251-2/+2
| | | | | | | | | PR: kern/21220 Submitted by: Dennis Lindroos MFC After: 1 week Notes: svn path=/head/; revision=138090
* Add missing <sys/module.h> includesPoul-Henning Kamp2004-05-301-0/+1
| | | | Notes: svn path=/head/; revision=129879
* Change the disk(9) API in order to make device removal more robust.Poul-Henning Kamp2004-02-181-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the "struct disk" were owned by the device driver and this gave us problems when the device disappared and the users of that device were not immediately disappearing. Now the struct disk is allocate with a new call, disk_alloc() and owned by geom_disk and just abandonned by the device driver when disk_create() is called. Unfortunately, this results in a ton of "s/\./->/" changes to device drivers. Since I'm doing the sweep anyway, a couple of other API improvements have been carried out at the same time: The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to DISKFLAG_NEEDSGIANT A version number have been added to disk_create() so that we can detect, report and ignore binary drivers with old ABI in the future. Manual page update to follow shortly. Notes: svn path=/head/; revision=125975
* Use __FBSDID().David E. O'Brien2003-08-241-1/+3
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* Use bioq_flush() to drain a bio queue with a specific error code.Poul-Henning Kamp2003-04-011-1/+2
| | | | | | | | | | | Retain the mistake of not updating the devstat API for now. Spell bioq_disksort() consistently with the remaining bioq_*(). #include <geom/geom_disk.h> where this is more appropriate. Notes: svn path=/head/; revision=112946
* Centralize the devstat handling for all GEOM disk device driversPoul-Henning Kamp2003-03-081-7/+0
| | | | | | | | | | | in geom_disk.c. As a side effect this makes a lot of #include <sys/devicestat.h> lines not needed and some biofinish() calls can be reduced to biodone() again. Notes: svn path=/head/; revision=111979
* Chase the musical variable names.John Baldwin2003-02-251-2/+2
| | | | | | | | Pointy hat to: jhb Reported by: des Notes: svn path=/head/; revision=111509
* Limit the maximum I/O size to 8 pages for version 2 controllers. ThisJohn Baldwin2003-02-251-4/+8
| | | | | | | | | fixes problems with some mlx(4) cards in Alpha machines. Reviewed by: msmith (ages ago) Notes: svn path=/head/; revision=111499
* Fix a small fat-finger: s/mlxd/mxld/.John Baldwin2003-02-251-1/+1
| | | | | | | Reported by: Bob Willcox <bob@immure.com> Notes: svn path=/head/; revision=111497
* NO_GEOM cleanup:Poul-Henning Kamp2003-02-251-40/+19
| | | | | | | | Move to "struct disk*" centric API. Retire major #131 (mlxd) Notes: svn path=/head/; revision=111469
* NO_GEOM cleanup:Poul-Henning Kamp2003-02-211-1/+1
| | | | | | | | | | | Change the argument to disk_destroy() to be the same struct disk * as disk_create() takes. This enables drivers to ignore the (now) bogus dev_t which disk_create() returns. Notes: svn path=/head/; revision=111216
* (This commit touches about 15 disk device drivers in a very consistentPoul-Henning Kamp2002-09-201-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and predictable way, and I apologize if I have gotten it wrong anywhere, getting prior review on a patch like this is not feasible, considering the number of people involved and hardware availability etc.) If struct disklabel is the messenger: kill the messenger. Inside struct disk we had a struct disklabel which disk drivers used to communicate certain metrics to the disklayer above (GEOM or the disk mini-layer). This commit changes this communication to use four explicit fields instead. Amongst the benefits is that the fields do not get overwritten by wrong or bogus on-disk disklabels. Once that is clear, <sys/disk.h> which is included in the drivers no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in, the few places that needs them, have gotten explicit #includes for them. The disklabel inside struct disk is now only for internal use in the disk mini-layer, so instead of embedding it, we malloc it as we need it. This concludes (modulus any mistakes) the series of disklabel related commits. I belive it all amounts to a NOP for all the rest of you :-) Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=103714
* KSE Milestone 2Julian Elischer2001-09-121-4/+4
| | | | | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha Notes: svn path=/head/; revision=83366
* Driver modifications consistent with my other drivers to facilitateMike Smith2001-06-251-17/+15
| | | | | | | | | the use of a single set of sources across 4.x and 5.x branches. No significant code changes. Notes: svn path=/head/; revision=78752
* Fix warning: 193: warning: label `done' defined but not usedPeter Wemm2001-06-151-1/+0
| | | | Notes: svn path=/head/; revision=78234
* Make the disk mini-layer check for and handle zero-length transfersPoul-Henning Kamp2001-05-061-4/+0
| | | | | | | instead of the underlying drivers. Notes: svn path=/head/; revision=76324
* Actually biofinish(struct bio *, struct devstat *, int error) is more generalPoul-Henning Kamp2001-05-061-2/+1
| | | | | | | | | than the bioerror(). Most of this patch is generated by scripts. Notes: svn path=/head/; revision=76322
* Send the remains (such as I have located) of "block major numbers" toPoul-Henning Kamp2001-03-261-2/+0
| | | | | | | the bit-bucket. Notes: svn path=/head/; revision=74810
* Remove unneeded #include <machine/clock.h>Poul-Henning Kamp2000-10-151-1/+0
| | | | Notes: svn path=/head/; revision=67164
* Change the way that scatter/gather list tables are allocated so that weMike Smith2000-05-061-2/+8
| | | | | | | | | | | | | | can use all of the s/g entries available on smaller cards. This is necessary if we want to be able to handle a non-page-aligned 64k transfer on 2.x and 3.x firmware. Fix a missing splx() that may have left us at splbio() for longer than desired. Reduce shadowing of controller-supplied parameters a little. Notes: svn path=/head/; revision=60074
* Separate the struct bio related stuff out of <sys/buf.h> intoPoul-Henning Kamp2000-05-051-1/+1
| | | | | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter Notes: svn path=/head/; revision=60041
* Remove ~25 unneeded #include <sys/conf.h>Poul-Henning Kamp2000-04-191-1/+0
| | | | | | | Remove ~60 unneeded #include <sys/malloc.h> Notes: svn path=/head/; revision=59391
* Complete the bio/buf divorce for all code below devfs::strategyPoul-Henning Kamp2000-04-151-13/+13
| | | | | | | | | | | | | Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case. CCD not converted yet, casts to struct buf (still safe) atapi-cd casts to struct buf to examine B_PHYS Notes: svn path=/head/; revision=59249
* Add features required for basic userland management utility:Mike Smith2000-04-111-7/+3
| | | | | | | | | | | | | | | | | - implement user-initiated background drive rebuild - implement user-initiated background consistency check - log controller-initiated background rebuild/check operations Try to fix the elusive "invalid log operation" bug, and panic if we do hit this one in the hopes of getting better information. Tidy up diagnostic messages. Try to use disk_create/disk_destroy correctly. This isn't working properly yet, but it's not clear whose fault that is. Notes: svn path=/head/; revision=59136
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.Poul-Henning Kamp2000-04-021-2/+2
| | | | | | | | | | | | | | | | (Much of this done by script) Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED. Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack. Add bio_queue field for struct bio aware disksort. Address a lot of stylistic issues brought up by bde. Notes: svn path=/head/; revision=58934
* Update to the latest development version of the Mylex driver. Changes inMike Smith2000-03-181-15/+9
| | | | | | | | | | | | | | | | | | | | | this version include: - Support for version 2.x firmware (2.42 or later recommended). This means we are the only open-source driver supporting these adapters. This code has only been tested on a Digital KZPCA adapter in an Alpha system, but is believed to be correct. NOTE: EISA adapters are not yet supported. - Support the BIOS/Firmware initialisation handshake protocol. This allows the driver to bring the card up to operational state even if the BIOS can't be run (eg. if it's an x86 BIOS in an Alpha system). - A working command pasthrough interface. This allows a user-space configuration tool (under development) to issue arbitrary commands to the controller or to devices in the system. Notes: svn path=/head/; revision=58188
* Updates resulting from new documentation from Mylex and some cleaning:Mike Smith1999-12-221-1/+1
| | | | | | | | | | | | | | | | | | | | | - Don't keep private copies of some of the data fields from the ENQUIRY and ENQUIRY2 commands. Instead, standardise on the ENQUIRY2 command for initial adapter information, and keep a copy of the entire structure. Refer to it where appropriate. - Move all of the controller description functionality into a new function. Print lots more controller data if bootverbose is set. Add knowledge of the DAC960 PR, PT, PTL0 and PRL controllers, rename the 960PTL -> PTL0 and 1100P -> 1100PVX. - Correctly terminate an error message. The controller interface procedures have been reviewed against the Mylex-supplied documentation; no changes appear necessary at this time. Notes: svn path=/head/; revision=54979
* Major update to the Mylex DAC960 driver adding new hardware supportMike Smith1999-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and fixing some major bugs. - Add support for the v5 firmware interface, used by the DAC1164P (tested) and AcceleRAID 352 (untested but should work). We now cover all of the Mylex family's protocols except for v2 (used by EISA and Alpha-compatible cards). - Fix an accounting bug which resulted in endless 'poll still busy' messages. In situations of high controller load the count of poll commands could be incremented without actually successfully launching a command. This totally removes the accounting for status poll commnads; it was its own worst enemy. - Add some simple reentry prevention locks to processing of the waiting and completed command queues to prevent races which could result in I/O being done or completed twice (both are fatal). This highlights a need for simple locking primitives in both the UP and SMP kernels. - Streamline the handling of command completion to reduce the amount of redundant work being done. Remove the code which tests for commands that have gone missing in action; nobody has ever seen one of these and it wouldn't have worked properly anyhow. - Handle disconnection of drives from the controller in the detach, not shutdown method. This avoids problems flushing the cache in a panic when a drive is mounted. - Don't call bus_generic_detach when disconnecting drives; it doesn't actually do anything useful. - Increment the log message index regardless of whether we actually retrieved one or not. If we run into a message that we can't fetch, we don't want to spin endlessly complaining about the fact. - Don't assume that interrupts will work when we're flushing the controller. We may think they are enabled, but in eg. a panic situation the controller may not be able to deliver an interrupt. Notes: svn path=/head/; revision=54419
* Revamp the devstat priority system. All disks now have the same priority.Kenneth D. Merry1999-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | The same goes for CD drivers and tape drivers. In systems with mixed IDE and SCSI, devices in the same priority class will be sorted in attach order. Also, the 'CCD' priority is now the 'ARRAY' priority, and a number of drivers have been modified to use that priority. This includes the necessary changes to all drivers, except the ATA drivers. Soren will modify those separately. This does not include and does not require any change in the devstat version number, since no known userland applications use the priority enumerations. Reviewed by: msmith, sos, phk, jlemon, mjacob, bde Notes: svn path=/head/; revision=54279
* Correctly compute the block count. In reality, it seems that theMike Smith1999-11-021-1/+1
| | | | | | | | | | controller will never return the command if it's not exactly a multiple of a block in size. Cosmetic formatting for RAID level output. Notes: svn path=/head/; revision=52785
* Move some hardware-related items to the hardware-related header.Mike Smith1999-10-261-3/+1
| | | | | | | | | Shift to using the same queueing strategy that the amr driver uses. Some simple tests indicate that we use about 2% of the CPU at around 500tps with the controller completely saturated with I/O. Notes: svn path=/head/; revision=52544
* Save the drive device_t correctly so we can print it later.Mike Smith1999-10-161-0/+1
| | | | | | | The drive number is 5 bits, not 4, in the read/write command. Notes: svn path=/head/; revision=52273
* Add support for the version 4 firmware interface and the DAC960 PG andMike Smith1999-10-141-20/+11
| | | | | | | | | | | | | | | | | | | | | PJ cards. This will probably also support the AcceleRAID and eXtremeRAID cards, but nobody has volunteered one for testing, so I haven't enabled their PCI device IDs. Slightly clean up communication between the disk devices and the controller device as per new practice, and move some more register- related items int mlxreg.h from mlxvar.h. Remove some unnecessary read-modify-write operations to the card control registers; they don't behave like that. Increase the status polling interval to 10 seconds. It's still possible to load the card up to the point where a status poll will find the previous poll still running, but this will reduce the incidence of complaints. Notes: svn path=/head/; revision=52225
* This is a driver for the Mylex DAC960 family of integrated RAIDMike Smith1999-10-071-0/+314
controllers. It currently supports the P, PL, PD and PU variants, with more to be supported shortly. Notes: svn path=/head/; revision=51973