From owner-freebsd-current Mon Apr 3 5: 0: 4 2000 Delivered-To: freebsd-current@freebsd.org Received: from storm.FreeBSD.org.uk (storm.freebsd.org.uk [194.242.139.170]) by hub.freebsd.org (Postfix) with ESMTP id 0BAD337B9D7 for ; Mon, 3 Apr 2000 04:59:56 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (hak.nat.Awfulhak.org [172.31.0.12]) by storm.FreeBSD.org.uk (8.9.3/8.9.3) with ESMTP id MAA34741; Mon, 3 Apr 2000 12:59:19 +0100 (BST) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.9.3/8.9.3) with ESMTP id MAA02751; Mon, 3 Apr 2000 12:59:15 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200004031159.MAA02751@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: Takahashi Yoshihiro Cc: current@FreeBSD.ORG, brian@hak.lan.Awfulhak.org Subject: Re: Please review newbus patch for amd and adv In-Reply-To: Message from Takahashi Yoshihiro of "Sun, 02 Apr 2000 23:05:32 +0900." <20000402230532V.nyan@dd.catv.ne.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 03 Apr 2000 12:59:14 +0100 From: Brian Somers Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I converted the amd and adv drivers to new-bus. But, as I am not > familiar with these drivers and new-bus, maybe I have mistaken. > > Will somebody please review these changes? > > For amd driver: > http://home.jp.FreeBSD.org/~nyan/patches/amd.diff.gz Hi, I'm afraid this code fails in bus_alloc_resource(...SYS_RES_IOPORT...). I know nothing about what that does, but notice that the old code didn't even call pci_map_port() (which makes the compat code call bus_alloc_resource)... I also added these patches - possibly worth leaving in the final version of this code ? Let me know if you need any more data here.... Cheers. -- Brian Don't _EVER_ lose your sense of humour ! --- amd.c.orig Mon Apr 3 12:20:52 2000 +++ amd.c Mon Apr 3 12:42:11 2000 @@ -2256,8 +2256,11 @@ iores = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); - if (iores == NULL) + if (iores == NULL) { + if (bootverbose) + printf("amd_init: bus_alloc_resource failure!\n"); return ENXIO; + } amd->tag = rman_get_bustag(iores); amd->bsh = rman_get_bushandle(iores); @@ -2271,6 +2274,8 @@ /*maxsegsz*/AMD_MAXTRANSFER_SIZE, /*flags*/BUS_DMA_ALLOCNOW, &amd->buffer_dmat) != 0) { + if (bootverbose) + printf("amd_init: bus_dma_tag_create failure!\n"); return ENXIO; } TAILQ_INIT(&amd->free_srbs); @@ -2355,8 +2360,11 @@ void *ih; struct resource *irqres; - if (amd_init(dev)) + if (amd_init(dev)) { + if (bootverbose) + printf("amd_attach: amd_init failure!\n"); return ENXIO; + } /* Reset Pending INT */ intstat = amd_read8(amd, INTSTATREG); @@ -2379,19 +2387,26 @@ * max_sim_transactions */ devq = cam_simq_alloc(MAX_START_JOB); - if (devq == NULL) + if (devq == NULL) { + if (bootverbose) + printf("amd_attach: cam_simq_alloc failure!\n"); return ENXIO; + } amd->psim = cam_sim_alloc(amd_action, amd_poll, "amd", amd, amd->unit, 1, MAX_TAGS_CMD_QUEUE, devq); if (amd->psim == NULL) { cam_simq_free(devq); + if (bootverbose) + printf("amd_attach: cam_sim_alloc failure!\n"); return ENXIO; } if (xpt_bus_register(amd->psim, 0) != CAM_SUCCESS) { cam_sim_free(amd->psim, /*free_devq*/TRUE); + if (bootverbose) + printf("amd_attach: xpt_bus_register failure!\n"); return ENXIO; } @@ -2400,6 +2415,8 @@ CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_bus_deregister(cam_sim_path(amd->psim)); cam_sim_free(amd->psim, /* free_simq */ TRUE); + if (bootverbose) + printf("amd_attach: xpt_create_path failure!\n"); return ENXIO; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message