Commit Graph

813 Commits

Author SHA1 Message Date
sos
88121eed06 Only try to allocate and use the SATA resource if they are enabled
by the BIOS. It seems some BIOS's doesn't get this right, and that would
result in ATA panic'ing.
2005-04-25 07:50:51 +00:00
sos
4bf4c6aace Rehash the timeout code to make it more simple.
This also removes the warning timeout on the taskqueues stalling as
I'm tired of getting ATA error reports for problems in other parts ;)
Misc cosmetic and comment cleanups now we are here.
2005-04-21 11:13:39 +00:00
sos
511aaba338 When a rebuild is done, properly mark the arrays as functional again. 2005-04-20 14:14:08 +00:00
sos
40e8804581 Properly hook in devices found by SATA connect events.
This broke on the changes done to get atapicam happy earlier.
2005-04-20 12:51:54 +00:00
sos
8fa1fec4fe CFA (Compact Flash) devices has a special config ID that fails the
normal ATA device check in ata-disk.c. Add support for the CFA magic.
2005-04-19 12:33:26 +00:00
sos
3417d78744 Fix indentation problem in the last commit 2005-04-19 05:28:08 +00:00
phk
545b3eb115 Add a named reference-count KPI to hold off mounting of the root filesystem.
While we wait for holds to be released, print a list of who holds us
back once per second.

Use the new KPI from GEOM instead of vfs_mount.c calling g_waitidle().

Use the new KPI also from ata.

With ATAmkIII's newbusification, ata could narrowly miss the window
and ad0 would not exist when we tried to mount root.
2005-04-18 21:21:26 +00:00
sos
83dc9321ab Add uma zone for composite ops.
Submitted by:	des
2005-04-18 16:01:56 +00:00
sos
d14f8067dc Adjust the RAID type pickup code for the VIA, we dont actually care
if the array is bootable or not (yet).
2005-04-18 13:51:03 +00:00
sos
b9fbfc95b9 Add one more Promise SATAII/150 chip id. 2005-04-17 13:37:57 +00:00
sos
6d4ec686f8 Spell ATA_NFORCE4_S2 correctly. 2005-04-16 20:03:49 +00:00
sos
5a3ef42961 Make things compile again with ATA_STATIC_ID. 2005-04-15 14:19:41 +00:00
sos
60cbe4eb3c Move the creation of ata_channel child devices to the channel code.
This allows to attach to the children (ATA devices) even without a
driver being attached. This allows atapi-cam to do its work both
with and without the pure ATAPI driver being present.

ATA patches by /me
ATAPI-cam pathes by Thomas
2005-04-15 10:20:52 +00:00
sos
1886d7a2d6 Read back the real taskfile register values when in 48BIT mode. 2005-04-14 08:48:45 +00:00
sos
d1c5742ec0 Add a ata_setmode method so we dont panic on setmode.
Note that the mode is only set on the device, we (mostly) have
no knowledge on how to set mode on the controller if at all possible.
2005-04-13 07:14:17 +00:00
sos
46bb5e57f3 On amd64 int64_t != long long. 2005-04-12 15:24:00 +00:00
sos
820440e4f9 Better use the right name for the VIA software RAID. 2005-04-12 13:29:47 +00:00
sos
5df220acda Add support for VIA Tech metadata as used on thier SATA parts. 2005-04-12 12:25:27 +00:00
sos
c3214db193 Fix the same silly alloc mistake for nVidia and SiS as with VIA in
the previous commit.
2005-04-11 20:50:14 +00:00
sos
e52ce037e1 Fix the bug that caused SATA disks on VIA etc to fail attach. 2005-04-11 20:28:15 +00:00
sos
b860bd3d5e Use the ata_suspend/resume functions instaead of the bus_generic ones.
This should unbreak suspend/resume.

Contributed by:	Wiktor Niesiobedzki
2005-04-10 21:43:29 +00:00
sos
9f8f2baa63 Fix FreeBSD native SPAN arrays.
Prodded by: Ian Dowse
2005-04-10 21:39:25 +00:00
sos
236f74fbcb Refine the SATA PHY code so the time consumed during probe is reduced.
Add the older nVidia nForce2 SATA chip to supported HW.
2005-04-10 10:20:25 +00:00
scottl
cda6c264b0 Explicity make atapi-cam depend on CAM.
Submitted by: Michal Mertl
2005-04-08 22:51:50 +00:00
sos
f9fd7ba6d3 Add support for the PHY on nVidia, SiS and VIA chips
This code is done blindfolded as I dont have such HW here, so reports
of success/failure are most welcome.

More SATA PHY cleanups.
2005-04-08 15:33:04 +00:00
sos
29b8f3d11a Put the BUS_DMASYNC_PREWRITE in the rigth position. 2005-04-08 12:16:51 +00:00
sos
c4dba639d5 Generalise the SATA PHY handling code so it wont be duplicated for
each SATA chip.
Promise and Silicon Image are the current candidates for this.
2005-04-08 09:37:47 +00:00
sos
f70db1ea92 Add support for controllers that doesn't have the usual taskfile
layout.  No functional changes.
2005-04-06 10:22:56 +00:00
scottl
26c1343a03 Fix a use-after-free problem in atapi_cb(). Add some necessary synchronization
to the XPT_PATH_INQ op.  Don't leak locks on failure in XPT_SCSIIO.  Correctly
fix the CAMDEBUG message.
2005-04-05 15:08:19 +00:00
sos
1bf4515290 Add firstshot support for Acer Labs Inc SATA parts
Update ALi PATA support to handle ATA133 as well
2005-04-05 14:51:43 +00:00
phk
adb26ade35 Push some faulty debugging aside so LINT compiles. 2005-04-05 09:42:52 +00:00
scottl
038f72b006 Commit ATAPI-CAM for ATAmkIII. Improvements and changes:
- newbus plumbing.  Each atapicam bus is a child off of a parent ata channel
  bus.  This is somewhat of a hack, but allows the ata core to be completely
  free of atapicam knowledge.
- No more global lists of softc's and no more groping around in internal ata
  structures on each command.
- Giant-free operation of the completion handler.
- Per-bus mutex for protecting the busy list and synchronizing detach.
- Lots of streamlining and dead code elimination, better adherence to the
  CAM locking protocol.

This feature still requires that the appropriate atapi-* driver be present
for each atapi device that you want to talk to (i.e. atapi-cd for cdroms).
It does work both compiled into the kernel and as a loadable module.

Reviewed by: thomas, sos
2005-04-05 02:03:31 +00:00
sos
162c429ec5 Fix a buglet that caused slaves to be nondetected. 2005-04-03 13:03:53 +00:00
sos
64c093b18e Change the ata_* methods to use a channel device instead of a
controller device. This helps when there is no controller parent
to a channel (PPC port).
2005-03-31 15:05:40 +00:00
sos
2a911e58f6 Correct the PCI ID for the SiS 965, and add support for the SATA part
that was left our by accident.

Prodded by:	Patrik Backlund
2005-03-31 06:25:14 +00:00
sos
14cddd09fb Whoops, this got left out from the megacommit 2005-03-30 12:27:34 +00:00
sos
403f922d0f This is the much rumoured ATA mkIII update that I've been working on.
o       ATA is now fully newbus'd and split into modules.
        This means that on a modern system you just load "atapci and ata"
        to get the base support, and then one or more of the device
        subdrivers "atadisk atapicd atapifd atapist ataraid".
        All can be loaded/unloaded anytime, but for obvious reasons you
        dont want to unload atadisk when you have mounted filesystems.

o       The device identify part of the probe has been rewritten to fix
        the problems with odd devices the old had, and to try to remove
        so of the long delays some HW could provoke. Also probing is done
	without the need for interrupts, making earlier probing possible.

o       SATA devices can be hot inserted/removed and devices will be created/
        removed in /dev accordingly.
	NOTE: only supported on controllers that has this feature:
	Promise and Silicon Image for now.
	On other controllers the usual atacontrol detach/attach dance is
	still needed.

o	Support for "atomic" composite ATA requests used for RAID.

o       ATA RAID support has been rewritten and and now supports these
        metadata formats:
                 "Adaptec HostRAID"
                 "Highpoint V2 RocketRAID"
                 "Highpoint V3 RocketRAID"
                 "Intel MatrixRAID"
                 "Integrated Technology Express"
                 "LSILogic V2 MegaRAID"
                 "LSILogic V3 MegaRAID"
                 "Promise FastTrak"
                 "Silicon Image Medley"
		 "FreeBSD PseudoRAID"

o       Update the ioctl API to match new RAID levels etc.

o       Update atacontrol to know about the new RAID levels etc
        NOTE: you need to recompile atacontrol with the new sys/ata.h,
        make world will take care of that.
	NOTE2: that rebuild is done differently from the old system as
	the rebuild is now done piggybacked on read requests to the
	array, so atacontrol simply starts a background "dd" to rebuild
	the array.

o       The reinit code has been worked over to be much more robust.

o       The timeout code has been overhauled for races.

o	Support of new chipsets.

o       Lots of fixes for bugs found while doing the modulerization and
        reviewing the old code.

Missing or changed features from current ATA:

o       atapi-cd no longer has support for ATAPI changers. Todays its
        much cheaper and alot faster to copy those CD images to disk
        and serve them from there. Besides they dont seem to be made
        anymore, maybe for that exact reason.

o       ATA RAID can only read metadata from all the above metadata formats,
	not write all of them (Promise and Highpoint V2 so far). This means
	that arrays can be picked up from the BIOS, but they cannot be
	created from FreeBSD. There is more to it than just the missing
	write metadata support, those formats are not unique to a given
	controller like Promise and Highpoint formats, instead they exist
	for several types, and even worse, some controllers can have
	different formats and its impossible to tell which one.
	The outcome is that we cannot reliably create the metadata of those
	formats and be sure the controller BIOS will understand it.
	However write support is needed to update/fail/rebuild the arrays
	properly so it sits fairly high on the TODO list.

o       So far atapicam is not supported with these changes. When/if this
	will change is up to the maintainer of atapi-cam so go there for
	questions.

HW donated by:  Webveveriet AS
HW donated by:  Frode Nordahl
HW donated by:  Yahoo!
HW donated by:  Sentex
Patience by:	Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
njl
3525860172 Whitespace nit. Clarifies which body this line belongs to. 2005-03-06 10:17:30 +00:00
imp
a9dd23fdd6 Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:06:12 +00:00
mdodd
0f3a3d72e4 When resubmitting a timed out request, reset donecount.
Submitted by:	  Nate Lawson <nate AT root.org>
2005-03-02 04:01:37 +00:00
mdodd
084eb950f8 Handle PIO timeouts in ata_end_transaction() by immediately returning.
Failure to do this will result in following ata_pio_read() calls walking
off the end of the read buffer.

This resolves the "memory modified after free" panics common with Thinkpads
and CD/DVD drives.

Submitted by:	 Nate Lawson <nate AT root.org>
2005-03-02 03:59:28 +00:00
mdodd
27652247fc In ata_generic_reset() while waiting for both master & slave to become
idle the 'mask' variable could be set to 0, resulting in the timeout loop
running for the full 31 seconds.

Handling this case eliminates long hangs on resume on some systems.

Submitted by:		Nate Lawson <nate AT root.org>
2005-03-02 03:34:51 +00:00
phk
fc92356c53 Use dynamic major number allocation. 2005-02-27 22:19:35 +00:00
mdodd
a3005af0ee Avoid using tsleep() in the resume path as it may result in the
system hanging if timer interrupts aren't running yet.

This allows my Thinkpad to resume successfully with APM.

Approved by:	 sos
MFC after:	 2 weeks
2005-02-07 17:14:42 +00:00
sobomax
b08808643d Boot away another stackgap (one of the lest ones in linuxlator/i386) by
providing special version of CDIOCREADSUBCHANNEL ioctl(), which assumes that
result has to be placed into kernel space not user space. In the long run
more generic solution has to be designed WRT emulating various ioctl()s
that operate on userspace buffers, but right now there is only one such
ioctl() is emulated, so that it makes little sense.

MFC after:	2 weeks
2005-01-30 08:12:37 +00:00
imp
71137a24ad Catchup to the iodata renaming 2005-01-26 06:30:55 +00:00
sos
4ff0d05220 Further update to the Promise code.
Support should now cover all old and current products.
2005-01-01 19:24:25 +00:00
sos
1daded360f Loosen the probe a bit.
Try to get out of probing as early as possible on (hopefully) vacant
channels.
2004-12-24 13:38:25 +00:00
sos
3bec03aac7 Update the Promise support for combo (SATA+PATA) controllers. 2004-12-24 13:36:04 +00:00
phk
7f03fd0a1d Pass the file->flags down to geom ioctl handlers.
Reject certain ioctls if write permission is not indicated.

Bump geom API version.

Reported by:	Ruben de Groot <mail25@bzerk.org>
2004-12-12 10:09:05 +00:00