Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Aug 1997 10:02:55 +0200
From:      Stefan Esser <se@FreeBSD.ORG>
To:        Amancio Hasty <hasty@rah.star-gate.com>
Cc:        multimedia@FreeBSD.ORG, current@FreeBSD.ORG
Subject:   Re: YES!, bktr now works 8)
Message-ID:  <19970814100255.42018@mi.uni-koeln.de>
In-Reply-To: <199708140332.UAA00314@rah.star-gate.com>; from Amancio Hasty on Wed, Aug 13, 1997 at 08:32:40PM -0700
References:  <199708140332.UAA00314@rah.star-gate.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 13, Amancio Hasty <hasty@rah.star-gate.com> wrote:
> 
> 
> Add the following line in btkr_attach:
> 
> 	fun = pci_conf_read(tag, PCI_COMMAND_STATUS_REG);
> 	pci_conf_write(tag, PCI_COMMAND_STATUS_REG, fun | 4); 
>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ add this ^^^^^^^^^^^^^^^^^^^
> 
> That sets the bt848 to be able to act as a dma initiator. 

The Bus-Master enable bit ...
It is typically set by the card BIOS, or else by the driver.

The PCI bus code should **not** automatically enable this bit,
since it may crash the system, depending on the state of the
PCI device.

> Most likely the new pci interface cleared that bit cause I have never
> set it and the driver has worked in the past;additionally, the may 22
> release of current seems to work on my other PC.

No, the PCI driver does NOT clear it. The previous version of
the PCI code bogously set the bus-master enable bit. I'm not 
sure how to deal with this correctly. I do not want the drivers
to fiddle with configuration space registers, unless absolutely
necessary. I could provide a "pci_enable_busmaster()" function,
which hides the details ... 

The enable bits (memory, port and bus-master) in the PCI command
register are meant to isolate the device from the PCI bus, if not
set. It is bad to set at least the bus-master enable before the
device has been initialised. It may be too late to set the bus-master 
enable after the device has initialised, because it may need that
feature enabled for the initialisation ...

(The PCI code set the bus-master DMA enable bit whenever the 
driver called pci_map_mem() or pci_map_port(). But since the
PCI device can only be configured *after* some port or memory
window has been mapped, this was definitely too early!)

I had an interesting mail exchange with Tony Overfield on that
topic, and I think the -current behaviour of the PCI code (to 
leave the bus-master enable bit alone) is correct ...

> I just supped a new kernel yesterday .
> 
> Before this weekend I will make sure that the latest bktr driver gets
> checked in.

I'm sorry this caused you trouble, but the previous behaviour of
the PCI code was not correct. It may cause warm boots to fail, 
for example. (Cold boots will generally work, since the device
is expected to be in a reset state.)

Regards, STefan



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