Date: Sun, 15 Mar 2009 20:20:04 GMT From: Martin Johnson <martin@martinshouse.com> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/123980: [ata] [patch] Implement ATA UDMA speed limit (hw.ata.ata_dma_limit) Message-ID: <200903152020.n2FKK403056038@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/123980; it has been noted by GNATS. From: Martin Johnson <martin@martinshouse.com> To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/123980: [ata] [patch] Implement ATA UDMA speed limit (hw.ata.ata_dma_limit) Date: Sun, 15 Mar 2009 19:50:49 +0000 The issue is still present in 7.1-RELEASE on the Soekris NET5501 i386 hardware, for PATA hard disk drives such as the TravelStar E7K100. The file ata-all.c has changed enough to break my patch, so I have re- made the patch to implement the ATA speed limit sysctl for 7.1- RELEASE. The updated patch is pasted below. -- Martin. --- ata-all.c.orig 2009-03-15 15:49:30.000000000 +0000 +++ ata-all.c 2009-03-15 15:55:33.000000000 +0000 @@ -78,15 +78,19 @@ int ata_dma_check_80pin = 1; /* local vars */ static int ata_dma = 1; +static int ata_dma_limit = 6; static int atapi_dma = 1; /* sysctl vars */ SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, "ATA driver parameters"); TUNABLE_INT("hw.ata.ata_dma", &ata_dma); SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma, CTLFLAG_RDTUN, &ata_dma, 0, "ATA disk DMA mode control"); +TUNABLE_INT("hw.ata.ata_dma_limit", &ata_dma_limit); +SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma_limit, CTLFLAG_RDTUN, &ata_dma_limit, 0, + "ATA disk DMA mode limit"); TUNABLE_INT("hw.ata.ata_dma_check_80pin", &ata_dma_check_80pin); SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma_check_80pin, CTLFLAG_RDTUN, &ata_dma_check_80pin, 1, "Check for 80pin cable before setting ATA DMA mode"); @@ -910,19 +914,19 @@ int ata_umode(struct ata_params *ap) { if (ap->atavalid & ATA_FLAG_88) { - if (ap->udmamodes & 0x40) + if (ap->udmamodes & 0x40 && ata_dma_limit >= 6) return ATA_UDMA6; - if (ap->udmamodes & 0x20) + if (ap->udmamodes & 0x20 && ata_dma_limit >= 5) return ATA_UDMA5; - if (ap->udmamodes & 0x10) + if (ap->udmamodes & 0x10 && ata_dma_limit >= 4) return ATA_UDMA4; - if (ap->udmamodes & 0x08) + if (ap->udmamodes & 0x08 && ata_dma_limit >= 3) return ATA_UDMA3; - if (ap->udmamodes & 0x04) + if (ap->udmamodes & 0x04 && ata_dma_limit >= 2) return ATA_UDMA2; - if (ap->udmamodes & 0x02) + if (ap->udmamodes & 0x02 && ata_dma_limit >= 1) return ATA_UDMA1; if (ap->udmamodes & 0x01) return ATA_UDMA0; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903152020.n2FKK403056038>