From owner-cvs-all Tue Apr 20 2:46: 4 1999 Delivered-To: cvs-all@freebsd.org Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (Postfix) with ESMTP id 7663815672; Tue, 20 Apr 1999 02:45:55 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from localhost (dfr@localhost) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id KAA95076; Tue, 20 Apr 1999 10:48:52 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Tue, 20 Apr 1999 10:48:52 +0100 (BST) From: Doug Rabson To: Peter Wemm Cc: cvs-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/i386/isa isa_compat.c In-Reply-To: <19990420092648.F07421F63@spinner.netplex.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk On Tue, 20 Apr 1999, Peter Wemm wrote: > Doug Rabson wrote: > > On Mon, 19 Apr 1999, Peter Wemm wrote: > > > > > peter 1999/04/19 13:31:55 PDT > > > > > > Modified files: > > > sys/i386/isa isa_compat.c > > > Log: > > > Always reset the isa hints after releasing the resources after probe, > > > because the act of doing the release kills the hints(!). A quirk of > > > the wrapper caused it to reset all the settings, except perhaps for the > > > memory address. I've tested this with a real SMC 8013EPC - which uses > > > shared memory addresses - it seems to work OK. > > > > I can't think why isa.c resets the hints on release. This should be > > removed (probably). > > I think it's just an overloading of the alloc/release storage. > > On allocation: > switch (type) { > case SYS_RES_IRQ: > if (isdefault && id->id_irq[0] >= 0) { > start = id->id_irq[0]; /* get hint */ > end = id->id_irq[0]; > count = 1; > } > if (id) > rvp = &id->id_irqres[*rid]; > break; > [..] > On release: > switch (type) { > case SYS_RES_IRQ: > id->id_irqres[rid] = 0; > id->id_irq[rid] = -1; /* <<< clear hint here */ > break; > So, on release, we're clearing the space used by the 'hints'. > > I think the following lines should probably go from the release section: > id->id_irq[rid] = -1; > id->id_drq[rid] = -1; > id->id_msize[rid] = 0; > id->id_maddr[rid] = 0; > id->id_port[rid] = 0; > id->id_portsize[rid] = 0; > > The other alternative is to store the 'defaults' in a seperate location to > the place we track the allocated resources. IMHO, that would be better > so that we can see if a programmable card has chosen something different > than what was hinted at. These lines should go from the release. I think if a driver tries to allocate its own range, it should be able to specify the values to bus_alloc_resource and have it overwrite the hints: bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0x300, 0x30f, 0x10, RF_ACTIVE); This seems nicer than calling isa_set_port(...) and isa_set_portsize(...). -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message