How to manually enable PCI BusMaster ?

bridged with qdn.public.ddk.audio
Post Reply
Mike Gorchak

How to manually enable PCI BusMaster ?

Post by Mike Gorchak » Fri Jul 05, 2002 12:48 pm

Hello !

Would anybody tell me how to manually enable PCI BusMaster at specified
device (audio device) ? I read all QNX docs concerning PCI, but doesn't
found any helpful information about BusMaster enabling.

Suggestion: ado API lacks of this function. (linux has
pci_set_master(device); function for this purpose)

I have some thoughts about manual enabling BM, but no sure is that correct.
Just writing (set up one bit) to 'Command Register' of PCI config space on
specified device. Is that right ?

With best regards, Mike Gorchak.

Igor Kovalenko

Re: How to manually enable PCI BusMaster ?

Post by Igor Kovalenko » Mon Jul 08, 2002 4:22 pm

I believe that's what the mentioned Linux finction is doing. And afaik it is
unnesessary in QNX for some reason (maybe one of ado_xxx functions does it
silently).
-- igor

"Mike Gorchak" <mike@malva.ua.remove.this.for.no.spam> wrote in message
news:ag449d$lnj$1@inn.qnx.com...
Hello !

Would anybody tell me how to manually enable PCI BusMaster at specified
device (audio device) ? I read all QNX docs concerning PCI, but doesn't
found any helpful information about BusMaster enabling.

Suggestion: ado API lacks of this function. (linux has
pci_set_master(device); function for this purpose)

I have some thoughts about manual enabling BM, but no sure is that
correct.
Just writing (set up one bit) to 'Command Register' of PCI config space on
specified device. Is that right ?

With best regards, Mike Gorchak.

David Bacon

Re: How to manually enable PCI BusMaster ?

Post by David Bacon » Tue Jul 09, 2002 3:32 pm

My impression is likewise that setting the PCI_COMMAND_MASTER_ENABLE bit in
the Command field of the _pci_config_regs structure is the way to ensure
that PCI bus mastering is enabled. (Of course, "pci -vv" can be used to
tell if it's already enabled for your device.)

dB

"Igor Kovalenko" <Igor.Kovalenko@motorola.com> wrote in message
news:agce00$e7s$1@inn.qnx.com...
I believe that's what the mentioned Linux finction is doing. And afaik it
is
unnesessary in QNX for some reason (maybe one of ado_xxx functions does it
silently).
-- igor

"Mike Gorchak" <mike@malva.ua.remove.this.for.no.spam> wrote in message
news:ag449d$lnj$1@inn.qnx.com...
Hello !

Would anybody tell me how to manually enable PCI BusMaster at specified
device (audio device) ? I read all QNX docs concerning PCI, but doesn't
found any helpful information about BusMaster enabling.

Suggestion: ado API lacks of this function. (linux has
pci_set_master(device); function for this purpose)

I have some thoughts about manual enabling BM, but no sure is that
correct.
Just writing (set up one bit) to 'Command Register' of PCI config space
on
specified device. Is that right ?

With best regards, Mike Gorchak.



Mike Gorchak

Re: How to manually enable PCI BusMaster ?

Post by Mike Gorchak » Tue Jul 30, 2002 5:48 am

Hello, Igor!

IK> I believe that's what the mentioned Linux finction is doing. And afaik
IK> it is unnesessary in QNX for some reason (maybe one of ado_xxx
IK> functions does it silently).

No, ado_xxx functions doesn't sets bus master flag silently (I'm checked
this at last Friday), definitely I'm need to set it manually ...

With best regards, Mike Gorchak.

Mike Gorchak

Re: How to manually enable PCI BusMaster ?

Post by Mike Gorchak » Fri Aug 02, 2002 1:23 pm

Hello, David!


DB> My impression is likewise that setting the PCI_COMMAND_MASTER_ENABLE
DB> bit in the Command field of the _pci_config_regs structure is the way
DB> to ensure that PCI bus mastering is enabled. (Of course, "pci -vv" can
DB> be used to tell if it's already enabled for your device.)

I do that, but with no success. What I found in linux kernel code:

They do the same things as you described above, but after that they call
pcibios_set_master function, the function source from 2.4.2 kernel I listed
below:

void pcibios_set_master(struct pci_dev *dev)
{
u8 lat;
pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
if (lat < 16)
lat = (64 <= pcibios_max_latency) ? 64 : pcibios_max_latency;
else if (lat > pcibios_max_latency)
lat = pcibios_max_latency;
else
return;
printk("PCI: Setting latency timer of device %s to %d\n", dev->slot_name,
lat);
pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
}

This function is easy to port. Any comments ? Is that correct ?

BTW: It is good reason to expand pci_* function set with at least one
function: pci_set_master, the headache for developers can be smaller :-)

With best regards, Mike Gorchak. E-mail: mike@malva.ua

Post Reply

Return to “qdn.public.ddk.audio”