Date: Mon, 21 Dec 2009 06:40:03 GMT From: Wesha <freebsd-bugs2@wesha.name> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/123980: [ata] [patch] Implement ATA UDMA speed limit (hw.ata.ata_dma_limit) Message-ID: <200912210640.nBL6e3pW095764@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: Wesha <freebsd-bugs2@wesha.name> To: bug-followup@FreeBSD.org, martin@martinshouse.com Cc: Subject: Re: kern/123980: [ata] [patch] Implement ATA UDMA speed limit (hw.ata.ata_dma_limit) Date: Mon, 21 Dec 2009 00:21:50 -0600 Hello Bug-followup, Updated patch for 8.0-RELEASE: --------------------------------------------------------------- --- ata-all.c.orig 2009-12-20 19:15:15.000000000 -0600 +++ ata-all.c 2009-12-20 19:20:20.000000000 -0600 @@ -79,15 +79,19 @@ int ata_dma_check_80pin =3D 1; /* local vars */ static int ata_dma =3D 1; +static int ata_dma_limit =3D 6; static int atapi_dma =3D 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"); @@ -1001,19 +1005,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 >=3D 6) return ATA_UDMA6; - if (ap->udmamodes & 0x20) + if (ap->udmamodes & 0x20 && ata_dma_limit >=3D 5) return ATA_UDMA5; - if (ap->udmamodes & 0x10) + if (ap->udmamodes & 0x10 && ata_dma_limit >=3D 4) return ATA_UDMA4; - if (ap->udmamodes & 0x08) + if (ap->udmamodes & 0x08 && ata_dma_limit >=3D 3) return ATA_UDMA3; - if (ap->udmamodes & 0x04) + if (ap->udmamodes & 0x04 && ata_dma_limit >=3D 2) return ATA_UDMA2; - if (ap->udmamodes & 0x02) + if (ap->udmamodes & 0x02 && ata_dma_limit >=3D 1) return ATA_UDMA1; if (ap->udmamodes & 0x01) return ATA_UDMA0; } --------------------------------------------------------------- --=20 Best regards, Wesha mailto:wesha@wesha.name
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912210640.nBL6e3pW095764>