diff options
author | Uwe Stuehler <uwe@cvs.openbsd.org> | 2005-09-01 02:16:57 +0000 |
---|---|---|
committer | Uwe Stuehler <uwe@cvs.openbsd.org> | 2005-09-01 02:16:57 +0000 |
commit | 88e7fbe458d41941c24fdcbb10d4205a1e73fa2f (patch) | |
tree | 23dd24136898f24ef340a8305d68dc1621f057a7 | |
parent | 597681c70c5ccbad5db8df77c1dd4029a632af4a (diff) |
On zaurus, don't fall back to fake geometry if ata_get_params() fails,
which can happen if the integrated microdrive's DRQ is not clear. This
fixes the drive geometry in the default disklabel.
Help from weingart@ and grange@; "mention `grange and i will fix this
better after 3.8 or we will be flailed'" deraadt@
-rw-r--r-- | sys/dev/ata/wd.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c index d29a9bb9b9c..41e2a51068a 100644 --- a/sys/dev/ata/wd.c +++ b/sys/dev/ata/wd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wd.c,v 1.43 2005/08/27 14:14:48 jsg Exp $ */ +/* $OpenBSD: wd.c,v 1.44 2005/09/01 02:16:56 uwe Exp $ */ /* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */ /* @@ -1258,10 +1258,24 @@ bad144intern(struct wd_softc *wd) int wd_get_params(struct wd_softc *wd, u_int8_t flags, struct ataparams *params) { +#ifdef __zaurus__ + /* XXX fix after 3.8 release */ + /* We already have the drive parameters; just return them. */ + if (params == &wd->sc_params && wd->sc_params.atap_cylinders != 0) + return 0; +#endif /* __zaurus__ */ switch (ata_get_params(wd->drvp, flags, params)) { case CMD_AGAIN: return 1; case CMD_ERR: +#ifdef __zaurus__ + /* XXX fix after 3.8 release */ + /* We already have the drive parameters; reuse them. */ + if (wd->sc_params.atap_cylinders != 0) { + *params = wd->sc_params; + return 0; + } +#endif /* __zaurus__ */ /* * We `know' there's a drive here; just assume it's old. * This geometry is only used to read the MBR and print a |