From owner-freebsd-current@FreeBSD.ORG Wed Apr 16 13:06:33 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4BE5337B401; Wed, 16 Apr 2003 13:06:33 -0700 (PDT) Received: from mail.cruzio.com (mail.cruzio.com [63.249.95.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9FC843FE3; Wed, 16 Apr 2003 13:06:32 -0700 (PDT) (envelope-from brucem@cruzio.com) Received: from cruzio.com (dsl3-63-249-85-132.cruzio.com [63.249.85.132]) by mail.cruzio.com with ESMTP id h3GK8vjM085933; Wed, 16 Apr 2003 13:09:03 -0700 (PDT) Received: (from brucem@localhost) by cruzio.com (8.11.3/8.11.3) id h3GJYMJ00787; Wed, 16 Apr 2003 12:34:22 -0700 (PDT) (envelope-from brucem) Date: Wed, 16 Apr 2003 12:34:22 -0700 (PDT) From: "Bruce R. Montague" Message-Id: <200304161934.h3GJYMJ00787@cruzio.com> To: freebsd-current@FreeBSD.ORG, sos@FreeBSD.ORG cc: sos@spider.deepcore.dk Subject: Cyrix ATA driver boot panic/patch, need more help. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2003 20:06:33 -0000 Hi, I've hit a solid sys/dev/ata driver panic on boot due to unitinialized pointer in cyrix ATA driver init code (and also need advice on additional investigation). "FreeBSD 5.0-CURRENT #0: Thu Apr 10"; on a Geode GX1/5530 (Centaurus II). An earlier backup -Current works fine (5.0-CURRENT #3: Mon Jan 20), not sure about other -Current's in between. The installation was built from CVS and is completely vanilla, no local mods. Panic is due to null "ctrl->chip" value in "ata-pci.c/ata_pcisub_probe()" at final statement before final return ("ctrl" value is ok): ch->chiptype = ctrl->chip->chipid; Re-coding routine "ata-chipset.c/ata_cyrix_ident()" using the template provided by "ata_intel_ident()" causes the ata driver to successfully probe and attach. However, I'm not sure this is the only problem, there appears to be a timing-related problem, but I'm not sure it's even the driver. In the course of executing the vanilla rc/driver w/o debug printfs), the system completely hangs hard (precluding debugger break etc.). Inserting debug I/O and putting set -x in rc alters behavior, system has come up to prompt in this case). The following patch causes the probe/attach to work: ===== --- ata-chipset.c.old Wed Apr 16 10:18:56 2003 +++ ata-chipset.c Wed Apr 16 10:22:38 2003 @@ -465,13 +465,20 @@ ata_cyrix_ident(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ata_chip_id *idx; + static struct ata_chip_id ids[] = + {{ ATA_CYRIX_5530, 0, 0, 0x00, ATA_UDMA2, "Cyrix 5530" }, + { 0, 0, 0, 0, 0, 0, }}; + char buffer[64]; - if (pci_get_devid(dev) == ATA_CYRIX_5530) { - device_set_desc(dev, "Cyrix 5530 ATA33 controller"); - ctlr->chipinit = ata_cyrix_chipinit; - return 0; - } - return ENXIO; + if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev)))) + return ENXIO; + + sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma)); + device_set_desc_copy(dev, buffer); + ctlr->chip = idx; + ctlr->chipinit = ata_cyrix_chipinit; + return 0; } static int ======= Any advice on further debugging? Have I hit this in the middle of big ata changes in progress (appears somewhat from the CVS)? Are there other ata driver areas worth a debugging look, areas that likely haven't yet been conformed to new "chip version" support or other changes, etc.? Any info or help most appreciated, thanks! - bruce