atapicam causes fatal kernel trap
Thomas Quinot
thomas at cuivre.fr.eu.org
Mon Sep 8 14:25:35 PDT 2003
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 at Cuivre.FR.EU.ORG
More information about the freebsd-alpha
mailing list