Date: Sat, 7 Oct 2000 14:45:25 +0900 (JST) From: Junichi Satoh <junichi@junichi.org> To: FreeBSD-gnats-submit@freebsd.org Subject: kern/21810: SiS5571 ATA controller does not work on ATA mode. Message-ID: <200010070545.OAA00485@norn.pn.junichi.org>
next in thread | raw e-mail | index | archive | help
>Number: 21810
>Category: kern
>Synopsis: SiS5571 ATA controller does not work on ATA mode.
>Confidential: yes
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Oct 06 22:50:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Junichi Satoh
>Release: FreeBSD 4.1-STABLE i386 and FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
SiS5571 ATA controller with ATA hard drive.
>Description:
SiS5571 does not have ATA33 mode.
But, it is probed as SiS5591 ATA33 controller like below.
------
atapci0: <SiS 5591 ATA33 controller> port 0x4000-0x400f,0x374-0x377,0x170-0x177,0x3f4-0x3f7,0x1f0-0x1f7 irq 14 at device 1.1 on pci0
ata0: at 0x1f0 irq 14 on atapci0
------
It fallback to PIO mode. So it does not work on ATA mode.
>How-To-Repeat:
# mount /dev/ad0s1e /mnt
ad0: READ command timeout tag=0 serv=0 - resetting
ata0: resetting devices .. done
ad0: READ command timeout tag=0 serv=0 - resetting
ata0: resetting devices .. done
ad0: READ command timeout tag=0 serv=0 - resetting
ata0: resetting devices .. done
ad0: READ command timeout tag=0 serv=0 - resetting
ata0-master: WARNING: WAIT_READY active=ATA_ACTIVE_ATA
ad0: trying fallback to PIO mode
ata0: resetting devices .. done
>Fix:
*** ata-all.c.org Tue Sep 19 20:08:37 2000
--- ata-all.c Sat Oct 7 14:32:52 2000
***************
*** 233,238 ****
--- 233,263 ----
return 0;
}
+ int
+ ata_find_maindev(device_t dev, u_int32_t type, u_int32_t revid)
+ {
+ device_t *children, child;
+ int nchildren, i;
+
+ if (device_get_children(device_get_parent(dev), &children, &nchildren))
+ return 0;
+
+ for (i = 0; i < nchildren; i++) {
+ child = children[i];
+
+ /* check that it's on the same silicon and the device we want */
+ if (pci_get_slot(child) == 0 &&
+ pci_get_vendor(child) == (type & 0xffff) &&
+ pci_get_device(child) == ((type & 0xffff0000) >> 16) &&
+ pci_get_revid(child) >= revid) {
+ free(children, M_TEMP);
+ return 1;
+ }
+ }
+ free(children, M_TEMP);
+ return 0;
+ }
+
static const char *
ata_pci_match(device_t dev)
{
***************
*** 275,280 ****
--- 300,307 ----
return "VIA Apollo ATA controller";
case 0x55131039:
+ if (ata_find_maindev(dev, 0x55711039, 0))
+ return "SiS 5571 ATA controller";
return "SiS 5591 ATA33 controller";
case 0x06461095:
*** ata-all.h.org Tue Sep 19 20:08:37 2000
--- ata-all.h Sat Oct 7 14:10:48 2000
***************
*** 350,355 ****
--- 350,356 ----
int ata_umode(struct ata_params *);
#if NPCI > 0
int ata_find_dev(device_t, u_int32_t, u_int32_t);
+ int ata_find_maindev(device_t, u_int32_t, u_int32_t);
#endif
void *ata_dmaalloc(struct ata_softc *, int);
*** ata-dma.c.org Tue Sep 19 20:08:37 2000
--- ata-dma.c Sat Oct 7 14:33:02 2000
***************
*** 413,420 ****
/* we could set PIO mode timings, but we assume the BIOS did that */
break;
! case 0x55131039: /* SiS 5591 */
! if (udmamode >= 2) {
error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
--- 413,420 ----
/* we could set PIO mode timings, but we assume the BIOS did that */
break;
! case 0x55131039: /* SiS 5571, 5591 */
! if (!ata_find_maindev(parent, 0x55711039, 0) && udmamode >= 2) {
error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
>Release-Note:
>Audit-Trail:
>Unformatted:
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?200010070545.OAA00485>
