Commit Graph

469 Commits

Author SHA1 Message Date
riz 1ea801e91a Fix typo in comment from previous revision. 2005-09-05 22:55:31 +00:00
bouyer 9c2d1acf94 Use a pmatch(9) expression which should catch all present and future
seagate drives larger than 200GB for the WD_QUIRK_FORCE_LBA48 quirks.
Based on infos from
http://www.seagate.com/support/kb/disc/howto/interpret_model.html
2005-09-05 21:09:08 +00:00
bouyer f0a1379350 Add quirk for ST3200826A. From rudolf (netbsd at eq.cz) on tech-kern. 2005-09-05 20:42:37 +00:00
bouyer 02f20190a2 wd->atabus->ata_bio() should handle the multi-sector PIO transfers just fine,
and in a better way than what is done in wddump() (which also does it
for DMA transfers, limiting the dump speed significantly). So remove
code splitting transfers in wd->sc_multi chunks from wddump(), and call
wd->atabus->ata_bio() with the whole transfers.

Problem reported by Frank Kardel, and patch tested by him.
2005-08-29 19:05:54 +00:00
briggs 8826927f06 ST3300831A also needs WD_QUIRK_FORCE_LBA48. 2005-08-26 00:09:03 +00:00
drochner e6a178f21f kill a number of autoconf submatch functions which follow the
standard scheme:
if (<configured> != <wildcard> && <configured> != <real>)
	then fail
else
	ask device match function

This is handled by config_stdsubmatch() now.
2005-08-25 22:33:18 +00:00
bouyer 6f6f287c39 Add a comment explaining why we have WD_QUIRK_FORCE_LBA48, instead of always
using LBA48 for sector 0xffffff.
2005-08-25 19:06:35 +00:00
drochner fa3cb84d62 replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
2005-08-25 18:35:38 +00:00
drochner 2d0de57f09 remove unused (hopefully:-) softc fields for disk geometry 2005-07-25 12:52:44 +00:00
briggs 2622309630 Update array of software RAID names in ata_raid.c.
Change a boundary check to ensure that we won't accidentally read and use
uninitialized memory if ATA_RAID_TYPE_MAX is updated without updating the
array.
Update comment near ATA_RAID_TYPE_MAX to note that the array in ata_raid.c
should be updated if a new ATA_RAID_TYPE_* is added.
2005-07-18 15:21:48 +00:00
drochner a8dbed44ea tighten the autoconf constraints by passing the atapi/ata/ata_hl attribute
to config_found()
(after some cleanup we might be able to kill SCSIPI_BUSTYPE_*)
2005-07-07 17:51:31 +00:00
thorpej 527d62e0a2 - When starting an ATA or ATAPI transfer, handle the case where (*dma_init)()
returns EINVAL, indicating that DMA cannot be done for this transfer.
  Fall back to PIO in this case.
- Add a geodeide_dma_init() routine that checks to make sure that transfers
  start on a 16 byte boundary, returning EINVAL if not.  Works around a chip
  bug that causes a hard system hang.

Problem reported and patch tested by Erik Fair.
2005-07-06 01:46:52 +00:00
dsainty 867423adde Force LBA48 access to ST3160827AS drives. Without this change the entire
system hangs whenever a read or write request to sector 0xfffffff occurs.

The hang appears to happen when:

status = bus_space_read_1(wdr->cmd_iot, wdr->cmd_iohs[wd_status], 0);

is executed in __wdcwait(), and it is not possible to enter the debugger or
make the system respond at all after this point.

Whilst not necessarily the most prudent solution to handling the large number
of drives that exhibit this problem, it is currently the popular workaround.

[An alternative approach is to just always drop to LBA48 if the request
happens to pass by sector 0xfffffff and the drive reported as larger than
0xfffffff sectors.  My understanding is that the 32 bit addressing below
0x10000000 is purely there as a performance booster, not to resolve a
compatibility issue.]
2005-07-02 04:29:01 +00:00
briggs b0366b2ebd Basic support for RAID0 and RAID1 for the Adaptec HostRAID format as found
on the Intel 6300ESB on-board RAID.  Adapted from FreeBSD.
2005-06-20 02:11:57 +00:00
bouyer 19abf3be02 The ST3160023A* also need the LBA48 quirk. From Timo Schoeler. 2005-06-19 18:26:40 +00:00
bouyer 69baf4357d Use pmatch() metacharacters to match both SATA and PATA versions of seagate
drives in the quirk table.
2005-06-16 20:03:35 +00:00
martti ec63076a4b Added LBA48 quirk for Seagate ST3200822AS. Tested by Teemu Rinta-aho. 2005-06-16 05:47:17 +00:00
peter 130e3c23a2 Fix typos. 2005-06-07 13:45:11 +00:00
christos 9b1843d7c2 - remove casts [to avoid volatile]
- sprinkle const
- avoid shadowed variables
2005-05-29 22:11:28 +00:00
bouyer 633e533c5c Close a window where (disks) interrupts could be enabled while the
ATACH_TH_RUN flag is still set. Should fix panic reported by Jukka Salmi
on netbsd-users@.
2005-05-20 14:39:04 +00:00
bouyer eaa19a67b8 Add a ata_queue_idle() function, which freeze a queue and tsleep() until the
controller is idle.
Change the powerhook function to call ata_queue_idle() on standby/suspend,
and ata_reset_channel() on resume (to wake up the disks and start from a
clean state).
Fix PR kern/30194 by Lubomir Sedlacik.
2005-05-16 21:43:33 +00:00
bouyer 04f2acc1f3 Add another broken seagate device to the quirk list.
Problem reported by rudolf <netbsd at eq.cz> on netbsd-help@
2005-05-16 15:36:57 +00:00
drochner 10e5ded54b add definition for "security freeze" 2005-04-12 11:45:40 +00:00
matt 2d8931a849 Fix mode printing. (don't panic on unmatched devices) 2005-04-11 04:24:54 +00:00
yamt 99229e5d39 introduce a function to drain bufq and use it where appropriate. 2005-03-31 11:28:53 +00:00
tacha 357eb4e7e6 Disestablish powerhook while detaching atabus. 2005-03-04 11:00:54 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
jmcneill 3ab5a3900d Add powerhook for atabus. 2005-01-26 21:51:40 +00:00
bouyer c306ebdd4c Also call ata_dmaerr() on DMA errors (as reported by the underlying controller
driver). We want to downgrade to PIO mode if DMA isn't functionnal.
2005-01-16 20:17:37 +00:00
bouyer 937bfab712 Move ata_dmaerr() so that it's called only when there really has been an error
(ata_bio->r_error doesn't containt anything meaningfull if no error occured).
Fix kern/28255 by Izumi Tsutsui, but with a different patch.
2004-12-08 18:49:52 +00:00
bouyer 3d94454016 Some drives reports ATA version < 4, and still support (and need) the
WDCC_FLUSHCACHE command. So for drive < ATA4, test WDC_CMD2_FC in atap_cmd_set2
before returning ENODEV.
Problem reported and fix tested by Michael Gerhards on port-sparc64.
2004-11-18 22:14:53 +00:00
soren ba1f348292 s/using DMA data transfers/using DMA/ to make it fit in 80 columns.
DMA only applies to data transfers anyway..
2004-11-14 15:25:11 +00:00
bouyer c31b572a47 Allow polled commands to be queued, if ata_exec_xfer() is called in thread
context. For this introduce 3 new xfer tags:
- C_WAIT, equivalent of AT_WAIT
- C_WAITACT, when there is a thread waiting on this xfer to become the active
  one (that is, to be at the head of the queue)
- C_FREE, set by ata_free_xfer() when it can't free the xfer because it's
  still in use. The holder should then free the xfer ASAP.

If ata_exec_xfer() is called with (C_POLL | C_WAIT), and there is already
xfers to be processed, assert C_WAITACT and sleep.
atastart() checks for C_WAITACT, and wakeup the thread waiting for this xfer
to become active if set. atastart() won't process this xfer, it's the
responsability of the thread waked up to handle it.

Fix (the right way) kern/27421 by Martin Husemann.
2004-10-30 23:10:37 +00:00
bouyer 2bdbaab58f Call xfer->c_start() with the channel from the xfer, not the one from the
thread. They may be different if we have a shared queue.
2004-10-28 20:11:41 +00:00
yamt 05f25dcc2a move buffer queue related stuffs from buf.h to their own header, bufq.h. 2004-10-28 07:07:35 +00:00
thorpej 45bba4e135 Change config_attach_pseudo() to take a cfdata * that contains the
necessary information to create the pseudo-device instance.  Pseudo-device
device's will reference this cfdata, just as normal devices reference
their corresponding cfdata.

Welcome to 2.99.10.
2004-10-15 04:38:36 +00:00
bouyer b31a120195 Add a WD_QUIRK_FORCE_LBA48 quirck, which forces all access to use LBA48.
Use it for ST3200822A, which has a broken firmware and return an error
when accessing sector 0xfffffff with a LBA command.
Patch tested by David Brownlee.
2004-09-28 18:22:33 +00:00
thorpej cc79c7aeb0 Add support for wedges to the ATA disk driver. 2004-09-25 03:34:02 +00:00
enami 6d7958ac59 Minimal support for mirror component. The relation between original and
mirror component learned from FreeBSD driver.
2004-09-17 23:21:53 +00:00
bouyer cdc0918196 In case of error, reset the channel with AT_RST_NOCMD. We know the reset
won't abort any command at this point.
2004-09-16 20:52:43 +00:00
drochner 96b589fc18 a round of autoconf cleanup:
-convert submatch() style functions (passed to config_search() or
 config_found_sm()) to the locator passing variants
-pass interface attributes in some cases
-make submatch() functions look uniformly as far as possible
-avoid macros which just hide cfdata members, and reduce dependencies
 on "locators.h"
2004-09-13 12:55:47 +00:00
bouyer bf02dcb5ca If we're not going to handle a reset request because one if already pending,
decrease queue_freeze that we just increased (otherwise the queue stay
frozen after the reset).
Should fix kern/26873 and port-i386/26910.
2004-09-11 18:01:58 +00:00
drochner b4b2fd9326 make the software managed bad-sector list optional
(kernel option WD_SOFTBADSECT)
2004-08-30 09:34:41 +00:00
he 764115cc85 Put an #ifdef _KERNEL around inline functions using panic().
Fixes compile problem for the atactl program for the vax target.
2004-08-23 10:08:48 +00:00
thorpej 09662eaa73 Register description for SATA port multipliers. 2004-08-21 02:25:26 +00:00
thorpej 5373bdd103 - Move to48() to atareg.h and rename it atacmd_to48().
- Add an atacmd_tosataq() that converts a 32-bit command to a Native
  SATA Queued command.
2004-08-21 02:17:07 +00:00
thorpej 8eaae3f96b Eliminate some gratuitous spl frobbing in atabus_thread(). 2004-08-21 00:48:32 +00:00
thorpej 335b799580 atastart() (called only at splbio(), and from interrupts) can change
drive_flags, to make sure all drive_flags manipulations are done at
splbio().
2004-08-21 00:28:34 +00:00
thorpej 2aaf643e25 - atabus_detach(): Manipulate ch_flags at splbio().
- ata_reset_channel(): Assert that we're at splbio() when called.
- Sprinkle some comments about functions that must be called at splbio().
2004-08-20 23:50:13 +00:00
thorpej 4af8216045 WDC_DIAGNOSTIC -> ATA_DEBUG 2004-08-20 23:36:52 +00:00