Commit Graph

603 Commits

Author SHA1 Message Date
Dag-Erling Smørgrav
9e4826180a Move sysctl declarations next to the corresponding tunable declarations.
Add a sysctl declaration for hw.ata.atapi_dma, which had gone MIA (though
setting it in loader.conf still worked, it was not visible at runtime)

Approved by:	sos
2003-11-03 09:25:02 +00:00
Søren Schmidt
12146c454b Fix burning of CD's that got broken by the GEOM'ification.
GEOM was not designed to handle media that does not have
a size. Blank CD's are of that type, so cheat and set the
media size to -1. This allows burning to work, but makes
GEOM issue outofrange reads that makes the ATAPI subsystem
spew out a few warnings. GEOM should be tought about this.

GEOM was not designed to handle changing the sectorsize
between opens. Writing multitack CD's with both audio and
data tracks needs to change sector size on the fly. We
cheat here and stuff the current sectorsize into GEOM
private internals. GEOM should grow some clean way for this.
2003-11-02 22:24:47 +00:00
Søren Schmidt
375e076b12 On ATA control commands return the registers in the request. 2003-11-02 22:04:53 +00:00
Søren Schmidt
908e9ae3ec GEOM'ify atapi-cd. Original patch by phk, subtle changes by me. 2003-11-01 09:44:33 +00:00
Søren Schmidt
db6c46469e Fix cable detection on AMD chips. 2003-11-01 09:30:15 +00:00
Søren Schmidt
f969ea6912 Add support for the VIA 8237 (both PATA and SATA part).
Cleanup the SATA support a bit now we are here anyways.
2003-10-30 13:16:21 +00:00
Søren Schmidt
60279a3808 Cleanup the interrupt code that deals with the busmaster bits. 2003-10-28 21:08:14 +00:00
Søren Schmidt
45f13b849c This should allow us to boot with DMA enabled on unknown PCI ATA
chipsets, well at least newer ones...
2003-10-28 19:01:48 +00:00
Søren Schmidt
4788059c5e Properly unload the DMA SG list on errors. 2003-10-21 19:25:20 +00:00
Søren Schmidt
80344be509 Fix the DMA problem that most severely hit on the DS3112a SATA chip
in connection with Marvell based SATA->PATA dongles.

The problem was caused by a combination of things working
together to make it hard to spot...

The ATA driver has always started the ATA command, then build
the SG list for DMA and then finally started the DMA engine.
While this is according to specs, it poses a potential
problem as some controllers apparently do not allow for unlimitted
time between starting the ATA command and starting the DMA engine.

At about the same time as ATAng was committed there were lots
of other changes applied, some of which was locking in parts
that causes the busdma load functions to take significantly
longer to load the SG list.

This pushed the time spent between starting the ATA command and
starting the DMA engine over the hill for some controllers
(especially the Silicon Image DS3112a) and caused what looked
like lost interrupts.

The solution is to get all the SG list work or rather all
busdma related stuff done before we even try to start anything.

This has the nice side effect of seperating busdma out the
way it should be, so the working of the ATA machinery is not
cluttered up with busdma droppings, making the code easier
to read and understand.
2003-10-21 19:20:37 +00:00
Mike Silbersack
184dcdc7c8 Change all SYSCTLS which are readonly and have a related TUNABLE
from CTLFLAG_RD to CTLFLAG_RDTUN so that sysctl(8) can provide
more useful error messages.
2003-10-21 18:28:36 +00:00
Søren Schmidt
c3093074c4 Up the alignment requirement of the SC1100 to 16 bytes, it has all the bugs and then some of its Cyrix inheritance.
Set the max_iosize for the Cyrix to 63K as the SC1100.
2003-10-21 08:53:29 +00:00
Søren Schmidt
a89ec7140f If just gcc could make up its mind... 2003-10-20 14:28:37 +00:00
Søren Schmidt
2e7deb2b86 Only return valid DMA error bits. 2003-10-20 13:45:11 +00:00
Søren Schmidt
5b2b2eba16 Up delay from 10 to 100ms after reset, this helps some slow devices
get their act together before we start probing.
2003-10-20 13:44:33 +00:00
Søren Schmidt
87efd6d017 Only announce ECC errors when its only that. 2003-10-20 13:32:42 +00:00
Poul-Henning Kamp
3a71ca7daa No need to initialize bio_pblkno from bio_blkno, disksort uses bio_offset. 2003-10-18 17:24:51 +00:00
Søren Schmidt
a827a5ff6a Reintroduce the "recovered from lost interrupt" code, but in a new
(hopefully) panic safe way.

Why the interrupts are lost is still a mystery, to me at least.
2003-10-14 16:53:13 +00:00
Søren Schmidt
ffd08d59ae Redo the code that handles eject/close. 2003-10-12 13:11:57 +00:00
Søren Schmidt
15749e8d06 Avoid potential race on ATA_R_DONE. 2003-10-12 12:38:03 +00:00
Søren Schmidt
c4c8a3e041 Put devices into sleep mode (ie spin down) on detach. 2003-10-12 12:37:11 +00:00
Søren Schmidt
f27b8b8ad4 Up timeout to 10s (from 5) in r/w commands. 2003-10-12 12:35:44 +00:00
Søren Schmidt
61dbcc0d05 Use isprint instead of isalpha in determining valid ident string. 2003-10-12 11:10:41 +00:00
Søren Schmidt
82681884cf Restore transfermode on devices after reinit. 2003-10-10 11:03:27 +00:00
Søren Schmidt
6235c1f6ae Dont store ata_params for devices that return a bogus ident string. 2003-10-10 11:00:06 +00:00
Søren Schmidt
fa9dc8d090 Fix the bug that prevented DMA from working on old Acer chips.
Found by: Andrew Gallatin <gallatin@cs.duke.edu>
Pointy hat to: sos
2003-10-09 14:33:06 +00:00
Søren Schmidt
ebac4a7b77 Give more correct params to busdma_* 2003-10-07 13:48:55 +00:00
Søren Schmidt
b0f747d57e Improve timeout handling and reporting. 2003-10-07 13:47:40 +00:00
Søren Schmidt
f313fea97d Properly get out of transaction() if setting up the transfer fails. 2003-10-07 13:45:56 +00:00
Søren Schmidt
e203a01fad In case we loose a device during reset in reinit() finish off
the request with error instead of loosing it.
2003-10-07 13:44:15 +00:00
Warner Losh
d25d7d01be Include pccard/pccard_cis.h here too 2003-10-07 04:26:14 +00:00
Søren Schmidt
6d92de35c9 Fix the problem with accessing certain FLASH devices. The problem
was that accessing the status reg could occour too fast, confusing
the logic in the flash part. Could not have been located without:

HW donated by: Jonas Bülow <jonas@servicefactory.se>
2003-10-01 09:58:19 +00:00
Poul-Henning Kamp
70cd771337 The present defaults for the open and close for device drivers which
provide no methods does not make any sense, and is not used by any
driver.

It is a pretty hard to come up with even a theoretical concept of
a device driver which would always fail open and close with ENODEV.

Change the defaults to be nullopen() and nullclose() which simply
does nothing.

Remove explicit initializations to these from the drivers which
already used them.
2003-09-27 12:01:01 +00:00
Thomas Quinot
3fbbaabe4a Enable DMA for ATAPI/CAM input/output operations.
Reviewed by:	scottl
2003-09-24 18:40:10 +00:00
Thomas Moestl
a65aa77700 Fix inverted BURN_BRIDGES and GONE_IN_5 #ifdefs. 2003-09-22 17:58:40 +00:00
Poul-Henning Kamp
fb4d4b60b3 Make the clone handler BURN_BRIDGES but the actual 'a' and 'c' partition
check GONE_IN_5:  We need the clone handler for root filesystem case.

Once under GEOM, we can remove the clone handler as GEOM provides one.
2003-09-21 18:57:12 +00:00
Thomas Quinot
505d8ea4f1 (atapi_cb): Reorganize error handling circuitry.
Fix to the messages output under CAM_DEBUG_CCB: the summary sense
 information (error bits and sense key) is in the error field, not
 in the result field, of struct ata_request. No other functional change.
2003-09-21 16:49:53 +00:00
Thomas Quinot
1a2ede86a0 (atapi_cb): Disable autosense for now as it causes a missed ATA interrupt.
Minor reformatting.
2003-09-21 08:53:05 +00:00
Søren Schmidt
bcf5e4d6b1 Dont reject a master device if it said slave failed. 2003-09-20 08:38:33 +00:00
Thomas Quinot
6ff17a79aa (atapi_action): avoid memory leak in a marginal invalid ccb case.
(free_hcb): defend against calling TAILQ_REMOVE on an hcb that was
 not inserted on pending_hcbs.
2003-09-19 16:25:44 +00:00
Søren Schmidt
4cb5b1f936 Always check the sensekey field on ATAPI returns
Add INQUIRY to cmd2str.
2003-09-19 12:46:12 +00:00
Søren Schmidt
015aa7376b Cosmetics 2003-09-18 16:44:54 +00:00
Søren Schmidt
228800a5a7 Be a bit more restrictive in the probe so we dont hang around
on empty channels in most cases.
2003-09-18 16:43:08 +00:00
Søren Schmidt
52725a453f Properly handle error code returns from the lower levels ATAPI code. 2003-09-18 09:22:14 +00:00
Søren Schmidt
855deec44c When ignoring interrupts (due to no running request set) then try
to grap the channel so we can read status (and clear an evt pending
interrupt).
2003-09-16 15:21:37 +00:00
Søren Schmidt
853c84ddf6 Rearrange the probe a bit first try ATAPI signatures then ATA. 2003-09-16 15:16:36 +00:00
Søren Schmidt
77de5988d6 Properly cast longs to off_t so we dont loose precision. 2003-09-16 14:41:44 +00:00
Poul-Henning Kamp
0c7721e8f9 Disable the use of cloning use in floppy and CD drivers.
This commit puts the relevant code snippets under #ifdef GONE_IN_5
(rather than #ifndef BURN_BRIDGES) thereby disabling the code now.

The code wil be entirely removed before 5.2 unless we find reasons
why this would be a bad idea.

Approach suggested by:	imp
2003-09-11 19:27:24 +00:00
Thomas Quinot
cc9ed6619f (atapi_action, case XPT_PATH_INQ): Handle properly the case of
CAM_TARGET_WILDCARD (target_id_t is an unsigned integer type).
Fixes boot-time crash on Alpha.

Reviewed by:	roberto
Approved by:	re (murray)
MFC after:	1 week
2003-09-11 17:34:47 +00:00
Søren Schmidt
fe78f9d47c Add support of the DIOCGSECTORSIZE & DIOCGMEDIASIZE ioctl's
so that newfs works on dvd-rw/dvd-ram again..
2003-09-11 15:59:16 +00:00