From owner-freebsd-alpha@FreeBSD.ORG Mon Sep 8 14:25:34 2003 Return-Path: Delivered-To: freebsd-alpha@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E3F2316A4BF; Mon, 8 Sep 2003 14:25:34 -0700 (PDT) Received: from melusine.cuivre.fr.eu.org (melusine.cuivre.fr.eu.org [62.212.105.185]) by mx1.FreeBSD.org (Postfix) with ESMTP id D94E943F3F; Mon, 8 Sep 2003 14:25:31 -0700 (PDT) (envelope-from thomas@cuivre.fr.eu.org) Received: by melusine.cuivre.fr.eu.org (Postfix, from userid 1000) id CE84C2A42B; Mon, 8 Sep 2003 23:25:17 +0200 (CEST) Date: Mon, 8 Sep 2003 23:25:17 +0200 From: Thomas Quinot To: Andrew Gallatin Message-ID: <20030908212517.GA59827@melusine.cuivre.fr.eu.org> References: <3F568ED4.5095458F@performancedesign.no> <16215.32222.610240.127909@grasshopper.cs.duke.edu> <3F579927.1020601@performancedesign.no> <16215.39766.415180.759716@grasshopper.cs.duke.edu> <3F5A20ED.C5DE017E@performancedesign.no> <16220.34865.620913.836921@grasshopper.cs.duke.edu> <3F5CE880.E08ABB6D@performancedesign.no> <16220.61276.946194.736750@grasshopper.cs.duke.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <16220.61276.946194.736750@grasshopper.cs.duke.edu> User-Agent: Mutt/1.4i X-message-flag: WARNING! Using Outlook can damage your computer. cc: thomas@freebsd.org cc: freebsd-alpha@freebsd.org Subject: Re: atapicam causes fatal kernel trap X-BeenThere: freebsd-alpha@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Alpha List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2003 21:25:35 -0000 Le 2003-09-08, Andrew Gallatin écrivait : > Hmmm.. Thomas, how can ccb_h->target_id ever be less than 0 if > a target_id_t is typedef'ed to a u_int? Perhaps the test should be > if (softc->ata_ch && ccb_h->target_id != CAM_TARGET_WILDCARD) { Uh oh. Looks like a possible culprit indeed! Idar, please test the following patch: Index: atapi-cam.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/atapi-cam.c,v retrieving revision 1.10.2.5 diff -u -r1.10.2.5 atapi-cam.c --- atapi-cam.c 24 Aug 2003 03:26:38 -0000 1.10.2.5 +++ atapi-cam.c 8 Sep 2003 21:12:06 -0000 @@ -252,7 +252,11 @@ strncpy(cpi->dev_name, cam_sim_name(sim), sizeof cpi->dev_name); cpi->unit_number = cam_sim_unit(sim); cpi->bus_id = cam_sim_bus(sim); + printf ("softc->ata_ch = %p\n", softc->ata_ch); + printf ("softc->ata_ch->device = %p\n", softc->ata_ch->device); + printf ("ccb_h->target_id = %d\n", ccb_h->target_id); if (softc->ata_ch && ccb_h->target_id >= 0) { + if (ccb_h->target_id < 2) { switch (softc->ata_ch->device[ccb_h->target_id].mode) { case ATA_PIO1: cpi->base_transfer_speed = 5200; @@ -282,6 +286,7 @@ break; default: cpi->base_transfer_speed = 3300; } + } else cpi->base_transfer_speed = 3300; } ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); -- Thomas.Quinot@Cuivre.FR.EU.ORG