Commit Graph

657 Commits

Author SHA1 Message Date
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
Søren Schmidt
85dd785ec8 Try a little harder to catch when fixate finishes.
On the <QSI CD-RW/DVD-ROM SBW-242> that failed causing burncd to
wait forever...
2003-12-07 23:15:22 +00:00
Scott Long
21cbd69b19 Fix a potential problem with atapi-cam where an incorrect flag is passed
into the ata queueing layer.

Approved by:	re
2003-12-05 01:02:46 +00:00
Søren Schmidt
b4485f7a3c Fix for the missing slave problem.
Approved by: re@
2003-12-03 15:32:53 +00:00
Søren Schmidt
019446db3a Fix modesetting on ISA only systems.
Approved by: re@
2003-12-03 13:40:26 +00:00
Søren Schmidt
ccd50c4818 Fix ata-card.
The altio resource magic no longer worked probably due to other changes
in the kernel. Redo that part so it also fits better into ATAng.
Fix detach so it doesn't panic the system when a pccard device is
yanked.

Approved by: re@
2003-11-30 16:27:59 +00:00
Søren Schmidt
b437f21e88 Workaround for errata on early versions of the sii3112.
Approved by: re@
2003-11-28 19:01:28 +00:00
Søren Schmidt
bf0d5626ce Correct the former patch, I accidently committed the wrong version.
Approved by: re@
2003-11-24 14:54:41 +00:00
Søren Schmidt
61058204d5 Fix panic on certain failed configs.
Approved by: re@
2003-11-24 14:22:30 +00:00
Søren Schmidt
62104e9446 Be less noisy when GEOM probes around during boot if drive contains
invalid media (ie empty CD/DVD)

Approved by: re@
2003-11-24 14:20:19 +00:00
Søren Schmidt
c08809df49 Fix support for the cmd646 chip.
Spotted by: tmm
reviewed by: re@
2003-11-21 22:58:56 +00:00
Søren Schmidt
f584b21960 Add support for the SiS964 ATA/SATA southbridge.
This could not have been done without the support from kuriyama.

Approved by: re@
2003-11-18 15:27:28 +00:00
Søren Schmidt
d7536ac93e Work around the problem that some CDROM drives might return different
TOC's for the same media!! that borks up GEOM.
Although this looks like bad HW the following patch removes the
chance for GEOM panic'ing.

Approved by: re@
2003-11-18 15:23:37 +00:00
Søren Schmidt
1bebf0fbc9 Centralise mode setting. Instead of doing it in all subdrivers, do
it in ata-all.c where it belongs.

Prime controller HW by always setting PIO mode first in attach.
2003-11-11 14:55:36 +00:00
Søren Schmidt
b25f2bc835 Update the dump code to flush buffers at the end of the dump
to avoid loosing evt cached data.
2003-11-11 07:49:45 +00:00
Scott Long
65b5d09597 Free the ata_request struct after we are done using it. This should stop
the memory leak seen when using ATAPICAM.
2003-11-09 20:46:08 +00:00