Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 1999 10:48:52 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Peter Wemm <peter@netplex.com.au>
Cc:        cvs-committers@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/i386/isa isa_compat.c 
Message-ID:  <Pine.BSF.4.05.9904201045510.85882-100000@herring.nlsystems.com>
In-Reply-To: <19990420092648.F07421F63@spinner.netplex.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9904201045510.85882-100000>