From owner-freebsd-hackers Tue Jun 12 4:27:39 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from serenity.mcc.ac.uk (serenity.mcc.ac.uk [130.88.200.93]) by hub.freebsd.org (Postfix) with ESMTP id 0486637B405; Tue, 12 Jun 2001 04:27:34 -0700 (PDT) (envelope-from jcm@freebsd-uk.eu.org) Received: from dogma.freebsd-uk.eu.org ([130.88.200.97] ident=root) by serenity.mcc.ac.uk with esmtp (Exim 2.05 #6) id 159mKa-000JqI-00; Tue, 12 Jun 2001 12:27:32 +0100 Received: (from jcm@localhost) by dogma.freebsd-uk.eu.org (8.11.3/8.11.1) id f5CBRWh81496; Tue, 12 Jun 2001 12:27:32 +0100 (BST) (envelope-from jcm) Date: Tue, 12 Jun 2001 12:27:32 +0100 From: j mckitrick To: freebsd-hackers@freebsd.org, freebsd-scsi@freebsd.org Subject: disconnecting from detached zip drive Message-ID: <20010612122731.A81226@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG hi all, i'm working on turning the zip driver and all the ppbus devices into modules. So far, i have the vpo (zip driver) detaching, but i have problems when i reattach. In the initial attach() call, we allocate a tiny bit of memory for a device controlling microsequence, and we call cam_sim_alloc(), xpt_bus_register(), and then rescan the bus. If we fail, we call cam_simq_free() if the xxx_alloc call failed, and we call cam_sim_free() if xxx_register() fails. In detach(), i am experimenting (!) and right now i free() the microsequence (unrelated to cam) and call cam_sim_free(). Here is the problem: when i detach, everything looks fine. I attach() when i reload the module, and the log message says it is now allocating device vpo0 and vpo1. There is only supposed to be vpo0, of course. It also assigns these as da1 and da2, instead of da0. Now, when i try to mount the drive, i get a page fault in cam and/or mount, depending on what i did in detach(). What needs to be done to completely disconnect the zip drive from cam, so that the new attachment looks like it is starting over from scratch? Jonathon -- Tech support: Try this. Arrange the parts in neat piles. Stand on your chair until you can see over your cubicle walls. Now shout "Does anybody know how to read a manual?" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message