Date: Mon, 25 Aug 2003 19:25:42 +0200 From: Thomas Quinot <thomas@FreeBSD.ORG> To: Matt <matt@xtaz.co.uk> Cc: Thomas Quinot <thomas@FreeBSD.ORG> Subject: Re: HEADS UP! ATAng committed Message-ID: <20030825172542.GA23174@melusine.cuivre.fr.eu.org> In-Reply-To: <hk63ml.k5h2g3@webmail.xtaz.co.uk> References: <200308241328.h7ODSjwC067165@spider.deepcore.dk> <hk4n9l.hl0s3y@webmail.xtaz.co.uk> <20030825014824.GA6311@melusine.cuivre.fr.eu.org> <hk63ml.k5h2g3@webmail.xtaz.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
Le 2003-08-25, Matt écrivait : > db> trace > free_hcb(c40f1040,c03c7e40,101,c41d5800,c1528130) at free_hcb+0x2e > atapi_action(c40f1440,c41d5800,c0132b33,c41db000,c41d5800) at > atapi_action+ox56c OK, so that presumably means we're going through action_oom, and so you should have had one of the following messages on the console: printf("cannot allocate ATAPI/CAM hcb\n"); printf("cannot allocate ATAPI/CAM request\n"); printf("cannot allocate ATAPI/CAM buffer\n"); It would be interesting to know which, if any, of these messages you saw. Also, please try whether the following patch improves the situation: Index: atapi-cam.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/atapi-cam.c,v retrieving revision 1.20 diff -u -r1.20 atapi-cam.c --- atapi-cam.c 24 Aug 2003 17:48:05 -0000 1.20 +++ atapi-cam.c 25 Aug 2003 17:24:44 -0000 @@ -59,7 +59,7 @@ int lun; union ccb *ccb; int flags; -#define DOING_AUTOSENSE 1 +#define QUEUED 0x0001; char *dxfer_alloc; TAILQ_ENTRY(atapi_hcb) chain; @@ -394,7 +394,7 @@ /* scatter-gather not supported */ xpt_print_path(ccb_h->path); printf("ATAPI/CAM does not support scatter-gather yet!\n"); - break; + goto action_invalid; } if ((hcb = allocate_hcb(softc, unit, bus, ccb)) == NULL) { @@ -464,8 +464,8 @@ if ((ccb_h->flags & CAM_DIR_MASK) == CAM_DIR_IN && (len & 1)) { /* ATA always transfers an even number of bytes */ - if (!(buf = hcb->dxfer_alloc = malloc(++len, M_ATACAM, - M_NOWAIT | M_ZERO))) + if ((buf = hcb->dxfer_alloc = malloc(++len, M_ATACAM, + M_NOWAIT | M_ZERO)) == NULL) printf("cannot allocate ATAPI/CAM buffer\n"); goto action_oom; } @@ -494,6 +494,7 @@ } TAILQ_INSERT_TAIL(&softc->pending_hcbs, hcb, chain); + hcb->flags |= QUEUED; ata_queue_request(request); return; @@ -519,9 +520,13 @@ return; action_invalid: - ccb_h->status = CAM_REQ_INVALID; - xpt_done(ccb); - return; + if (request != NULL) + ata_free_request(request); + if (hcb != NULL) + free_hcb(hcb); + ccb_h->status = CAM_REQ_INVALID; + xpt_done(ccb); + return; } static void @@ -686,7 +691,8 @@ static void free_hcb(struct atapi_hcb *hcb) { - TAILQ_REMOVE(&hcb->softc->pending_hcbs, hcb, chain); + if ((hcb->flags & QUEUED) != 0) + TAILQ_REMOVE(&hcb->softc->pending_hcbs, hcb, chain); if (hcb->dxfer_alloc != NULL) free(hcb->dxfer_alloc, M_ATACAM); free(hcb, M_ATACAM); -- Thomas.Quinot@Cuivre.FR.EU.ORG
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030825172542.GA23174>