Date: Fri, 25 Jul 2008 13:59:49 +0400 From: "Andrey V. Elsukov" <bu7cher@yandex.ru> To: Sean Bruno <sbruno@miralink.com> Cc: freebsd-drivers@freebsd.org, =?UTF-8?B?U8O4cmVuIFNjaG1pZHQ=?= <sos@FreeBSD.org> Subject: Re: ATA patch for RELENG_6 ... a patch looking for a good home Message-ID: <4889A415.1060309@yandex.ru> In-Reply-To: <4839F473.6070109@miralink.com> References: <4839F473.6070109@miralink.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------040205090903030903000307 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sean Bruno wrote: > I got this patch a while ago and I don't see it appearing in RELENG_6 > yet. Can someone "sheperd" this along or point out why it's not > acceptable? > > This patch was generated by a failure to boot correctly off of a compact > flash IDE module from Transcend. > > Index: dev/ata/ata-chipset.c > =================================================================== > --- dev/ata/ata-chipset.c (.../FreeBSD_RELENG_6_13APR07/src/sys) > (revision 5436) > +++ dev/ata/ata-chipset.c (.../miralink.FreeBSD.6/src/sys) > (revision 5436) > @@ -2059,7 +2059,8 @@ > atadev->mode = ATA_SA150; > } > else { > - mode = ata_limit_mode(dev, mode, ATA_UDMA5); > + /*mode = ata_limit_mode(dev, mode, ATA_UDMA5);*/ > + mode = ata_check_80pin(dev, ATA_UDMA5); > if (!ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode)) > atadev->mode = mode; > } Hi, Soren and Sean. What you think about attached patch? It can resolve your problem and shouldn't break anything. With this patch you can set mode in /boot/device.hints, for example: hint.ad.0.mode="UDMA33" hint.ad.1.mode="UDMA100" These limits work only on boot stage, after boot completed you can change mode via atacontrol. -- WBR, Andrey V. Elsukov --------------040205090903030903000307 Content-Type: text/plain; name="ata_limit_mode_from_device_hints.diff.txt" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="ata_limit_mode_from_device_hints.diff.txt" SW5kZXg6IHNyYy9zeXMvZGV2L2F0YS9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nN0cikgPT0gMCkg eworCSAgICBtID0gYXRhX3N0cjJtb2RlKHN0cik7CisJICAgIGlmIChtID49IEFUQV9QSU8p CisJCW1vZGUgPSBtOworCX0KKyAgICB9CisKICAgICBpZiAobW9kZSA+PSBBVEFfVURNQTAg JiYgYXRhX3Vtb2RlKCZhdGFkZXYtPnBhcmFtKSA+IDApCiAJcmV0dXJuIG1pbihtb2RlLCBh dGFfdW1vZGUoJmF0YWRldi0+cGFyYW0pKTsKIAo= --------------040205090903030903000307--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4889A415.1060309>