Date: Wed, 13 Jan 1999 18:50:02 -0800 (PST) From: Andrew Sherrod <yaldabaoth@geocities.com> To: freebsd-bugs@FreeBSD.ORG Subject: Re: i386/9431: wd.c Does nto recognize certain LBA disks [patch attached] Message-ID: <199901140250.SAA19076@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR i386/9431; it has been noted by GNATS. From: Andrew Sherrod <yaldabaoth@geocities.com> To: freebsd-gnats-submit@FreeBSD.ORG, ixkatl@yahoo.com Cc: Subject: Re: i386/9431: wd.c Does nto recognize certain LBA disks [patch attached] Date: Wed, 13 Jan 1999 21:33:10 -0500 This is a multi-part message in MIME format. --------------2FF1204F491A06667FA6982B Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Okay. My last set of patches may have been a bit premature. As advertised, the 2.2.8 patch did not force LBA mode (since 2.2.8 doesn't use LBA), but it had the unfortunate side effect of forcing DMA on if supported by the drive, regardless of the user's config settings.And, of course, the 3.0 patch, despite my claims, DID force LBA mode. And, to be honest, they both were a bit over-programmed. So, here are two slimmed down patches. One for 2.2.8 and one for 3.0. Neither changes the user's flags, nor does the 3.0 force the use of LBA mode. They both simply check if LBA is supported according to the BIOS flags, and uses the LBA size if it is larger than the CHS size. (As stated previously, this fixes some of the problems with determining disk geometry. And, in case anyone doubts that this problem exists or that this patch fixes them, I have included 2 dmesg outputs, the first before the 2.2.8 patch and the second after.) If anyone can find a problem (before I do) let me know. Thanks again. Andrew Sherrod --------------2FF1204F491A06667FA6982B Content-Type: text/plain; charset=us-ascii; name="diffc2a.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffc2a.txt" *** wd.c.2_2_8 Wed Jan 13 21:07:30 1999 --- wd.c.original.2_2_8 Wed Jan 13 21:08:24 1999 *************** *** 113,122 **** #define WDOPT_FORCEHD(x) (((x)&0x0f00)>>8) #define WDOPT_MULTIMASK 0x00ff - /* This bit mask is used to determine if the drive supports LBA addressing. */ - - #define WDCAP_LBA 0x02 - /* * This biotab field doubles as a field for the physical unit number on * the controller. --- 113,118 ---- *************** *** 1731,1745 **** du->dk_dd.d_nsectors = wp->wdp_sectors; du->dk_dd.d_secpercyl = du->dk_dd.d_ntracks * du->dk_dd.d_nsectors; du->dk_dd.d_secperunit = du->dk_dd.d_secpercyl * du->dk_dd.d_ncylinders; ! ! /* Check for BIOS LBA flag. This should allow kernel to determine ! actual disk geometry for diffiuclt BIOSes. ! This will likely only be of use during initial installation, or ! perhaps when configuring a new drive. Otherwise, the disk geometry ! should already be known. -A. Sherrod 01/13/1999*/ ! ! if ( ( (wp->wdp_capability&WDCAP_LBA) || ! (wp->wdp_cylinders == 16383 ) ) && du->dk_dd.d_secperunit < wp->wdp_lbasize) { du->dk_dd.d_secperunit = wp->wdp_lbasize; du->dk_dd.d_ncylinders = --- 1727,1733 ---- du->dk_dd.d_nsectors = wp->wdp_sectors; du->dk_dd.d_secpercyl = du->dk_dd.d_ntracks * du->dk_dd.d_nsectors; du->dk_dd.d_secperunit = du->dk_dd.d_secpercyl * du->dk_dd.d_ncylinders; ! if (wp->wdp_cylinders == 16383 && du->dk_dd.d_secperunit < wp->wdp_lbasize) { du->dk_dd.d_secperunit = wp->wdp_lbasize; du->dk_dd.d_ncylinders = --------------2FF1204F491A06667FA6982B Content-Type: text/plain; charset=us-ascii; name="diffc3a.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffc3a.txt" *** wd.c.3_0 Wed Jan 13 21:05:38 1999 --- wd.c.original.3_0 Wed Jan 13 21:06:11 1999 *************** *** 201,208 **** struct devstat dk_stats; /* devstat entry */ }; - #define WDCAP_LBA 0x02 - #define WD_COUNT_RETRIES static int wdtest = 0; --- 201,206 ---- *************** *** 1916,1933 **** wp->wdp_buffersize, wp->wdp_model); #endif - /* If no cfg_flags are set, check for BIOS LBA flag, but don't force - use of LBA. This should allow kernel to determine actual disk - geometry for diffiuclt BIOSes without forcing user to enter LBA - mode. - This will likely only be of use during initial installation, or - perhaps when configuring a new drive. Otherwise, the disk geometry - should already be known. -A. Sherrod 01/13/1999*/ - /* update disklabel given drive information */ du->dk_dd.d_secsize = DEV_BSIZE; ! if ( ( (wp->wdp_capability&WDCAP_LBA) || ! (du->cfg_flags & WDOPT_LBA) ) && wp->wdp_lbasize) { du->dk_dd.d_nsectors = 63; if (wp->wdp_lbasize < 16*63*1024) { /* <=528.4 MB */ du->dk_dd.d_ntracks = 16; --- 1914,1922 ---- wp->wdp_buffersize, wp->wdp_model); #endif /* update disklabel given drive information */ du->dk_dd.d_secsize = DEV_BSIZE; ! if ((du->cfg_flags & WDOPT_LBA) && wp->wdp_lbasize) { du->dk_dd.d_nsectors = 63; if (wp->wdp_lbasize < 16*63*1024) { /* <=528.4 MB */ du->dk_dd.d_ntracks = 16; *************** *** 1950,1961 **** du->dk_dd.d_secpercyl= du->dk_dd.d_ntracks*du->dk_dd.d_nsectors; du->dk_dd.d_ncylinders = wp->wdp_lbasize/du->dk_dd.d_secpercyl; du->dk_dd.d_secperunit = wp->wdp_lbasize; ! ! /* Do not force LBA if only specified in BIOS -A. Sherrod 01/13/1999 */ ! ! if(du->cfg_flags & WDOPT_LBA) { ! du->dk_flags |= DKFL_LBA; ! } } else { du->dk_dd.d_ncylinders = wp->wdp_cylinders; /* +- 1 */ --- 1939,1945 ---- du->dk_dd.d_secpercyl= du->dk_dd.d_ntracks*du->dk_dd.d_nsectors; du->dk_dd.d_ncylinders = wp->wdp_lbasize/du->dk_dd.d_secpercyl; du->dk_dd.d_secperunit = wp->wdp_lbasize; ! du->dk_flags |= DKFL_LBA; } else { du->dk_dd.d_ncylinders = wp->wdp_cylinders; /* +- 1 */ --------------2FF1204F491A06667FA6982B Content-Type: text/plain; charset=us-ascii; name="dmesg1.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dmesg1.txt" Copyright (c) 1992-1998 FreeBSD Inc. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. FreeBSD 2.2.8-RELEASE #6: Wed Jan 13 21:11:20 EST 1999 root@HAL9000.yaldabaoth.com:/usr/src/sys/compile/HAL CPU: AMD-K6(tm) 3D processor (350.80-MHz 586-class CPU) Origin = "AuthenticAMD" Id = 0x580 Stepping=0 Features=0x8001bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,MMX> real memory = 201326592 (196608K bytes) avail memory = 194924544 (190356K bytes) Probing for devices on PCI bus 0: chip0 <generic PCI bridge (vendor=1106 device=0597 subclass=0)> rev 4 on pci0:0:0 chip1 <generic PCI bridge (vendor=1106 device=8598 subclass=4)> rev 0 on pci0:1:0 chip2 <generic PCI bridge (vendor=1106 device=0586 subclass=1)> rev 65 on pci0:7:0 pci0:7:1: VIA Technologies, device=0x0571, class=storage (ide) [no driver assigned] chip3 <generic PCI bridge (vendor=1106 device=3040 subclass=0)> rev 16 on pci0:7:3 xl0 <3Com 3c905B Fast Etherlink XL 10/100BaseTX> rev 48 int a irq 11 on pci0:10:0 xl0: Ethernet address: 00:10:5a:20:9b:68 xl0: autoneg not complete, no carrier (forcing half-duplex, 10Mbps) Probing for devices on PCI bus 1: Probing for devices on the ISA bus: sc0 at 0x60-0x6f irq 1 on motherboard sc0: VGA color <16 virtual consoles, flags=0x0> sio0: configured irq 4 not in bitmap of probed irqs 0 sio0 at 0x3f8-0x3ff irq 4 on isa sio0: type 8250 sio1 at 0x2f8-0x2ff irq 3 on isa sio1: type 16550A lpt0 at 0x378-0x37f irq 7 on isa lpt0: Interrupt-driven port lp0: TCP/IP capable interface psm0 at 0x60-0x64 irq 12 on motherboard psm0: model Generic PS/2 mouse, device ID 0 fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa fdc0: FIFO enabled, 8 bytes threshold fd0: 1.44MB 3.5in wdc0 at 0x1f0-0x1f7 irq 14 on isa wdc0: unit 0 (wd0): <QUANTUM FIREBALL SE8.4A> wd0: 8063MB (16514064 sectors), 16383 cyls, 16 heads, 63 S/T, 512 B/S wdc0: unit 1 (wd1): <WDC AC33100H> wd1: 2014MB (4124736 sectors), 4092 cyls, 16 heads, 63 S/T, 512 B/S wdc1 at 0x170-0x177 irq 15 on isa wdc1: unit 0 (wd2): <Maxtor 84320D4> wd2: 1888MB (3866940 sectors), 4092 cyls, 15 heads, 63 S/T, 512 B/S wdc1: unit 1 (atapi): <FX322M/w03>, removable, intr, dma, iordis wcd0: 5512KB/sec, 256KB cache, audio play, 255 volume levels, ejectable tray wcd0: no disc inside, unlocked mcd0 not found at 0x300 npx0 flags 0x1 on motherboard npx0: INT 16 interface --------------2FF1204F491A06667FA6982B Content-Type: text/plain; charset=us-ascii; name="dmesg2.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dmesg2.txt" Copyright (c) 1992-1998 FreeBSD Inc. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. FreeBSD 2.2.8-RELEASE #7: Wed Jan 13 21:26:09 EST 1999 root@HAL9000.yaldabaoth.com:/usr/src/sys/compile/HAL CPU: AMD-K6(tm) 3D processor (350.80-MHz 586-class CPU) Origin = "AuthenticAMD" Id = 0x580 Stepping=0 Features=0x8001bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,MMX> real memory = 201326592 (196608K bytes) avail memory = 194924544 (190356K bytes) Probing for devices on PCI bus 0: chip0 <generic PCI bridge (vendor=1106 device=0597 subclass=0)> rev 4 on pci0:0:0 chip1 <generic PCI bridge (vendor=1106 device=8598 subclass=4)> rev 0 on pci0:1:0 chip2 <generic PCI bridge (vendor=1106 device=0586 subclass=1)> rev 65 on pci0:7:0 pci0:7:1: VIA Technologies, device=0x0571, class=storage (ide) [no driver assigned] chip3 <generic PCI bridge (vendor=1106 device=3040 subclass=0)> rev 16 on pci0:7:3 xl0 <3Com 3c905B Fast Etherlink XL 10/100BaseTX> rev 48 int a irq 11 on pci0:10:0 xl0: Ethernet address: 00:10:5a:20:9b:68 xl0: autoneg not complete, no carrier (forcing half-duplex, 10Mbps) Probing for devices on PCI bus 1: Probing for devices on the ISA bus: sc0 at 0x60-0x6f irq 1 on motherboard sc0: VGA color <16 virtual consoles, flags=0x0> sio0: configured irq 4 not in bitmap of probed irqs 0 sio0 at 0x3f8-0x3ff irq 4 on isa sio0: type 8250 sio1 at 0x2f8-0x2ff irq 3 on isa sio1: type 16550A lpt0 at 0x378-0x37f irq 7 on isa lpt0: Interrupt-driven port lp0: TCP/IP capable interface psm0 at 0x60-0x64 irq 12 on motherboard psm0: model Generic PS/2 mouse, device ID 0 fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa fdc0: FIFO enabled, 8 bytes threshold fd0: 1.44MB 3.5in wdc0 at 0x1f0-0x1f7 irq 14 on isa wdc0: unit 0 (wd0): <QUANTUM FIREBALL SE8.4A> wd0: 8063MB (16514064 sectors), 16383 cyls, 16 heads, 63 S/T, 512 B/S wdc0: unit 1 (wd1): <WDC AC33100H> wd1: 3020MB (6185088 sectors), 6136 cyls, 16 heads, 63 S/T, 512 B/S wdc1 at 0x170-0x177 irq 15 on isa wdc1: unit 0 (wd2): <Maxtor 84320D4> wd2: 4120MB (8439184 sectors), 8930 cyls, 15 heads, 63 S/T, 512 B/S wdc1: unit 1 (atapi): <FX322M/w03>, removable, intr, dma, iordis wcd0: 5512KB/sec, 256KB cache, audio play, 255 volume levels, ejectable tray wcd0: no disc inside, unlocked mcd0 not found at 0x300 npx0 flags 0x1 on motherboard npx0: INT 16 interface --------------2FF1204F491A06667FA6982B-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901140250.SAA19076>