Commit Graph

672 Commits

Author SHA1 Message Date
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Søren Schmidt
b47183d51a Update the SiS support to distinguish older southbridges better. 2004-03-16 16:23:28 +00:00
Søren Schmidt
498e55436a Add support for detaching PCI controllers.
This adds support for cardbus ATA/SATA controllers. I get roughly the
same transfer speeds as on true PCI controllers. Nice to be able to add
a couble of "real" disks to a laptop :)
2004-03-15 12:03:48 +00:00
Søren Schmidt
ba18e26520 Add yet another VIA pci id. 2004-03-11 14:08:11 +00:00
Søren Schmidt
c5df0d743e Only setup sii_reset on sii311[24]. 2004-03-04 16:39:59 +00:00
Thomas Quinot
71fe368a83 Use auto-sense data provided by the lowlevel ATA code. 2004-03-04 15:37:39 +00:00
Søren Schmidt
f0aafe7d84 If being verbose in the autosense code, print the original error. 2004-03-02 16:16:54 +00:00
Søren Schmidt
37baea5bd5 Report the original command on failures that causes auto sense.
Keep the ATA_R_QUIET flag if set during autosense.
2004-03-02 14:05:12 +00:00
Søren Schmidt
c4c0e4fc3b Fix getting progress data for some device in yet another way.
Take advantage of the new autosense logic.
2004-03-02 14:03:43 +00:00
Søren Schmidt
e7c9858a8f Remember to mtx_destroy mutexes. 2004-03-01 13:17:07 +00:00
Søren Schmidt
9a19089d86 Rearrange sense_key and sense_data to get alignment right.
Submitted by: Marcel
2004-02-29 09:35:29 +00:00
Søren Schmidt
dc7485d940 Issue a request sense command automagically when ATAPI commands fail
with a valid sense key.
2004-02-28 17:47:27 +00:00
Søren Schmidt
1c342d89ce Add support for the sii3512 SATA chip. 2004-02-25 09:55:49 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Søren Schmidt
056b9907de Dont alloc size 0 buffers. 2004-02-21 18:30:03 +00:00
Søren Schmidt
73f8099662 Check both PORTEN and MEMEN for enabled HW. 2004-02-21 18:21:13 +00:00
Søren Schmidt
0c7ab1146f Only register interrupt as seen if it was a real HW interrupt. 2004-02-21 16:55:10 +00:00
Poul-Henning Kamp
0b7ed341e1 Change the disk(9) API in order to make device removal more robust.
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.
2004-02-18 21:36:53 +00:00
Søren Schmidt
3b270fcfe8 Dont use the bio_taskqueue if we are in timeout.
Use taskqueue_thread rather than taskqueue_swi (maybe we should have
a taskqueue_ata).
2004-02-17 19:24:11 +00:00
Thomas Quinot
a0e1020523 (atapi_cb): Reenable automatic retrieve of sense data on error, making
it asynchronous to avoid incorrect use of ata_atapicmd within an
 ATAPI callback.

Tested by:	harti
2004-02-11 10:14:08 +00:00
Søren Schmidt
fb94df0e92 Commit simple workarounf for the "LiteOn" hang on boot problem.
This allows the system to boot so I can get the world out of
my mailbox and get some work done to figure out what this mess
is all about.
2004-02-06 11:36:50 +00:00
Søren Schmidt
b8f6dec455 Move the enabling of interrupt back to where it was some time ago.
This apparently was what broke the boot with some devices (liteon).
2004-02-02 15:49:01 +00:00
Søren Schmidt
6595b49405 Fix support for the Promise TX4 on amd64.
Somehow the bridge on there shows up with another PCI id than
it does on x86, no idea why...
2004-02-02 14:05:57 +00:00
Søren Schmidt
367d380b54 Be more robust in the probe. We dont want to get into a loop with
reinitting when we try to identify devices. If they dont interrupt
on identify we retry once. If this fails we simply ignore that device.
2004-01-30 19:16:08 +00:00
Søren Schmidt
f279a36c6e Cleanups/cosmetics. 2004-01-29 15:03:01 +00:00
Søren Schmidt
175352f07c Fix for those lost interrupts on probe on lots of controller types.
Note to self, just because an idea is good, it doesn't apply everywhere.
2004-01-28 21:54:40 +00:00
Søren Schmidt
816994ccc8 Use the biotask functionality in GEOM to put finished requests on
instead of taskqueue_swi. This shaves from 1 to 10% of the overhead.

Overhaul the locking once more, there was a few possible races that
are now closed.
2004-01-28 20:38:51 +00:00
Søren Schmidt
17cafb29a0 Fix breakage in PIO multisector support. 2004-01-23 10:38:56 +00:00
Søren Schmidt
8a1bddb753 Update the support for the VIA 8237 southbridge. 2004-01-20 16:51:02 +00:00
Søren Schmidt
cedc7194d5 Fix breakage on timeout/retries. The bug cause a sema to be leaked so
that the calling process would newer wakeup.
2004-01-19 15:20:00 +00:00
Ruslan Ermilov
bbc712e6ba Fixed a memory leak. 2004-01-18 17:21:15 +00:00
Søren Schmidt
61016883ad Fix botch in last commit. 2004-01-18 15:58:30 +00:00
Søren Schmidt
7c633af872 Add missing free's. 2004-01-18 10:50:40 +00:00
Søren Schmidt
74a1b9fccf Add support for the Silicon Image 3114 4 channel SATA controller. 2004-01-17 23:34:13 +00:00
Søren Schmidt
5df3ca789c Use UMA instead of plain malloc for getting ATA request storage.
This gives +10% performance on simple tests, so definitly worth it.
A few percent more could be had by not using M_ZERO'd alloc's, but
we then need to clear fields all over the place to be safe, and
that was deemed not worth the trouble (and it makes life dangerous).
2004-01-14 21:26:35 +00:00
Søren Schmidt
ee242ddc36 Fix potential cable detection problem on older CMD chips. 2004-01-14 14:24:36 +00:00
Søren Schmidt
6f595c71c2 Fix ata_getparam to accept the fact that some crappy devices can pose as
both master and slave at the same time confusing the probe code.
2004-01-13 21:35:39 +00:00
Søren Schmidt
45a0b23e06 Always return ENOMEM if ata_request_alloc fails so GEOM can dtrt. 2004-01-12 09:33:10 +00:00
Søren Schmidt
bd234a46da #include sema.h is now required. 2004-01-12 07:16:07 +00:00
Søren Schmidt
a7a120f649 Overhaul of the timeout/reinit framework. This should clear up most
of the leftovers from the old version that really doesn't work anymore.

Add a reset function for host-end of the ATA channel. This is needed
for the SiI3112 in order to whack it back to reality if a device
locks up the SATA interface (thereby preventing that we can reset the
device). The result is that ATA now recovers from the timeouts that
happens with the SiI3112A and more or less all disks based on old
PATA electronics with a Marvell PATA->SATA converter. This includes
lots of the popular SATA dongles and the WDC Raptor disks..
2004-01-11 22:08:34 +00:00
Søren Schmidt
986a964900 Use the saved params for LBA-CHS conversion. Fixes PC98 bug. 2004-01-08 19:17:16 +00:00
Søren Schmidt
608346656f Try to simplify the SiS probe. If SiS stays with the current schema for
new nothbridges we should even find the southbridge and be able to
use it (if its one we know that is).
2003-12-25 19:37:11 +00:00
Søren Schmidt
913bde73c9 Fix the register timings for AMD/VIA/nVidia chipsets. 2003-12-18 17:36:41 +00:00
Søren Schmidt
186939d1f5 Add support for the SiS 661 chipset (using SiS 963 south). 2003-12-18 08:07:05 +00:00
Søren Schmidt
14d7f69797 Fix compilation on 64bit archs. 2003-12-16 19:41:38 +00:00
Søren Schmidt
dd8fa07d07 Print the LBA on failing R/W commands. 2003-12-15 20:43:17 +00:00
Søren Schmidt
b9e240face Finetune last commit, we need to take care of empty channels. 2003-12-10 23:06:24 +00:00
Søren Schmidt
a5cd71ee7b Add back the national support, this was removed by accident earlier. 2003-12-09 19:13:50 +00:00
Søren Schmidt
49373540b9 More errata fixing for the SiI3112A disaster chip:
Serialize access to the SATA channels, the chip messes up if
both channels are used at the same time.

The SiI3112 hereby takes the price as the most crappy SATA chip in
existance by a significant amount.

My advise to our userbase is to avoid this chip like the plague...
2003-12-08 09:22:20 +00:00
Søren Schmidt
ea828b0636 Fix more problems with the Silicon Image 3112A:
Setup decent transfer mode defaults as some BIOS's seem to put in
things that it *knows* doesn't work.
(Note to BIOS writers: stop doing that nonsense, we will get things
working with your crappy HW anyways, and then recommend users to buy
someone else's products that "just works", thankyou.. )

Limit the device transfer mode to ATA100/UDMA5 on generic SATA.
 Since we dont know if the user is using a pure SATA device or an
old PATA drive with a SATA converter dongle, we need to limit the
speed used here to cover up the problems with Marvell ATA-SATA bridges
used in lots of SATA products.

This workaround is enabled for all detectable SATA controllers as they
seem to have semilar problems here. One notable exception is all the
Promise pdc2037x chips which just always work (cudos to Promise!).
2003-12-08 08:27:52 +00:00