KMDF resource allocation for PCI device

Hi

We have a PCI-x (1x) device for which we have written a KMDF driver.This implements a propritary protocol conversion with one side PCI and
another side USB.

The KMDF driver works fine for some machines but fails to install
for a particular HP machine dc7600.The error code we get is 12(Insufficient resources)

A debugging session shows that after evtadddevice gets called successfully
the evtpreparehardware does not get called.

We tried the following approaches to resolve this issue:

a)I attach a EvtDeviceFilterRemoveResourceRequirement (and a EvtDeviceFilterAddrResourceRequirements)and within the former
I remove the interrupt descriptor with WdfIoResourceListRemove(reslist,j).Intention is to add a new/fresh interrupt descriptor
with required IRQ values in the subsequent EvtDeviceFilterAddResourceRequirements.But this EvtDeviceFilterAddResourceRequirements never
gets called in this case, if I hack the resourcerequirements list.Otherwise in case if I dont try to manipulate any descriptor
then both EvtDeviceFilterRemoveResourceRequirements and EvtDeviceFilterAddrResourceRequirements is called one after the other.

b)Now I attach just a EvtDeviceFilterAddrResourceRequirements .It gets called and I insert (at index 0) a descriptor as per
my intention and it gets inserted successfully.(But note that I havent been able to remove the original interrupt resource
as I have NOT registered for EvtDeviceFilterRemoveResourceRequirements).
Still the prepare hardware callback does not get called.Also EvtDeviceRemoveAddedResources does not get called either.

c)I tried to use the concept of LogConfig in INF file with ConfigPriority set to NORMAL.I set the IRQ values only.
The device’s prepare hardware still dosent get called.and the result is still the same:Code 12.

d)We have already flashed the BIOS with the recent version of FW.So I feel that BIOS version can be ruled out as a culprit.

e)Finally I try to change the IRQ from BIOS , for this device.I insert the device, boot the PC and assign
IRQ 5 to the device.I allocate other IRQs (10,11 etc) to all the other devices .Now after restarting I find that resources
have been allocated(IRQ=5 and some memory resources as required).As an extension to this,after I see that an IRQ and memory addresses have been assigned then
while the OS is running I plugout and plug in the PCI device.The IRQ does not get assigned.This essentially means
that the BIOS is assigning the IRQ 5 very well but OS is not able to do any kind of assignment.The other free IRQs I have is
10 and 11.BIOS is unable to assigin any of these twos.Only IRQ 5 works.

My question is:

Is there any way we can avoid the resource clash programatically by forcing the device to take one particular IRQ??
I understand ,in PnP systems its not what is expected.But in that case our device is completely inoperable on this
model of HP machine.

Would be thankful for any pointers as to how to achieve this.

Rgds
Deb

Silly question, but have you checked to see that Verifier is NOT enabled and specifically that Low Resources in Verifier is NOT enabled?

Gary Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

On Sep 13, 2011, at 7:05 AM, xxxxx@csr.com wrote:

Hi

We have a PCI-x (1x) device for which we have written a KMDF driver.This implements a propritary protocol conversion with one side PCI and
another side USB.

The KMDF driver works fine for some machines but fails to install
for a particular HP machine dc7600.The error code we get is 12(Insufficient resources)

A debugging session shows that after evtadddevice gets called successfully
the evtpreparehardware does not get called.

We tried the following approaches to resolve this issue:

a)I attach a EvtDeviceFilterRemoveResourceRequirement (and a EvtDeviceFilterAddrResourceRequirements)and within the former
I remove the interrupt descriptor with WdfIoResourceListRemove(reslist,j).Intention is to add a new/fresh interrupt descriptor
with required IRQ values in the subsequent EvtDeviceFilterAddResourceRequirements.But this EvtDeviceFilterAddResourceRequirements never
gets called in this case, if I hack the resourcerequirements list.Otherwise in case if I dont try to manipulate any descriptor
then both EvtDeviceFilterRemoveResourceRequirements and EvtDeviceFilterAddrResourceRequirements is called one after the other.

b)Now I attach just a EvtDeviceFilterAddrResourceRequirements .It gets called and I insert (at index 0) a descriptor as per
my intention and it gets inserted successfully.(But note that I havent been able to remove the original interrupt resource
as I have NOT registered for EvtDeviceFilterRemoveResourceRequirements).
Still the prepare hardware callback does not get called.Also EvtDeviceRemoveAddedResources does not get called either.

c)I tried to use the concept of LogConfig in INF file with ConfigPriority set to NORMAL.I set the IRQ values only.
The device’s prepare hardware still dosent get called.and the result is still the same:Code 12.

d)We have already flashed the BIOS with the recent version of FW.So I feel that BIOS version can be ruled out as a culprit.

e)Finally I try to change the IRQ from BIOS , for this device.I insert the device, boot the PC and assign
IRQ 5 to the device.I allocate other IRQs (10,11 etc) to all the other devices .Now after restarting I find that resources
have been allocated(IRQ=5 and some memory resources as required).As an extension to this,after I see that an IRQ and memory addresses have been assigned then
while the OS is running I plugout and plug in the PCI device.The IRQ does not get assigned.This essentially means
that the BIOS is assigning the IRQ 5 very well but OS is not able to do any kind of assignment.The other free IRQs I have is
10 and 11.BIOS is unable to assigin any of these twos.Only IRQ 5 works.

My question is:

Is there any way we can avoid the resource clash programatically by forcing the device to take one particular IRQ??
I understand ,in PnP systems its not what is expected.But in that case our device is completely inoperable on this
model of HP machine.

Would be thankful for any pointers as to how to achieve this.

Rgds
Deb


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

No,verifier is not enabled.

On 13/09/2011 13:05, xxxxx@csr.com wrote:

The KMDF driver works fine for some machines but fails to install
for a particular HP machine dc7600.The error code we get is 12(Insufficient resources)

Are you trying to set interrupt affinity as well as priority? Does the
machine have more than 8 logical processors?


Bruce Cran

Bruce,

Are you trying to set interrupt affinity as well as priority…

No,I am not doing that atleast during registering the WDF_INTERRUPT_CONFIG structure.

I would try out your suggestion BTW.

Does the machine have more than 8 logical processors?
No it dosent.Its Dual-core only.

Rgds
Deb

There is no way to convince Windows that a PCI device does anything other
than assert the INTx# signal that’s described by the function’s IntPin
register. Nothing you do in filtering resource requirements nor an INF will
change that. Such a device is not PCI compliant.

There are built-in exceptions for devices which existed before the PCI spec,
IDE, VGA and PCMCIA.

Jake Oshins
Hyper-V I/O Architect (former interrupt guy, author of the code you’re
dealing with)
Windows Kernel Group

This post implies no warranties and confers no rights.


wrote in message news:xxxxx@ntdev…

Hi

We have a PCI-x (1x) device for which we have written a KMDF driver.This
implements a propritary protocol conversion with one side PCI and
another side USB.

The KMDF driver works fine for some machines but fails to install
for a particular HP machine dc7600.The error code we get is 12(Insufficient
resources)

A debugging session shows that after evtadddevice gets called successfully
the evtpreparehardware does not get called.

We tried the following approaches to resolve this issue:

a)I attach a EvtDeviceFilterRemoveResourceRequirement (and a
EvtDeviceFilterAddrResourceRequirements)and within the former
I remove the interrupt descriptor with
WdfIoResourceListRemove(reslist,j).Intention is to add a new/fresh interrupt
descriptor
with required IRQ values in the subsequent
EvtDeviceFilterAddResourceRequirements.But this
EvtDeviceFilterAddResourceRequirements never
gets called in this case, if I hack the resourcerequirements list.Otherwise
in case if I dont try to manipulate any descriptor
then both EvtDeviceFilterRemoveResourceRequirements and
EvtDeviceFilterAddrResourceRequirements is called one after the other.

b)Now I attach just a EvtDeviceFilterAddrResourceRequirements .It gets
called and I insert (at index 0) a descriptor as per
my intention and it gets inserted successfully.(But note that I havent been
able to remove the original interrupt resource
as I have NOT registered for EvtDeviceFilterRemoveResourceRequirements).
Still the prepare hardware callback does not get called.Also
EvtDeviceRemoveAddedResources does not get called either.

c)I tried to use the concept of LogConfig in INF file with ConfigPriority
set to NORMAL.I set the IRQ values only.
The device’s prepare hardware still dosent get called.and the result is
still the same:Code 12.

d)We have already flashed the BIOS with the recent version of FW.So I feel
that BIOS version can be ruled out as a culprit.

e)Finally I try to change the IRQ from BIOS , for this device.I insert the
device, boot the PC and assign
IRQ 5 to the device.I allocate other IRQs (10,11 etc) to all the other
devices .Now after restarting I find that resources
have been allocated(IRQ=5 and some memory resources as required).As an
extension to this,after I see that an IRQ and memory addresses have been
assigned then
while the OS is running I plugout and plug in the PCI device.The IRQ does
not get assigned.This essentially means
that the BIOS is assigning the IRQ 5 very well but OS is not able to do any
kind of assignment.The other free IRQs I have is
10 and 11.BIOS is unable to assigin any of these twos.Only IRQ 5 works.

My question is:

Is there any way we can avoid the resource clash programatically by forcing
the device to take one particular IRQ??
I understand ,in PnP systems its not what is expected.But in that case our
device is completely inoperable on this
model of HP machine.

Would be thankful for any pointers as to how to achieve this.

Rgds
Deb

xxxxx@csr.com wrote:

We have a PCI-x (1x) device for which we have written a KMDF driver.This implements a propritary protocol conversion with one side PCI and another side USB.

That makes it a USB host controller, doesn’t it? Or are you saying it
is a USB device on the other side, and not a host?

The KMDF driver works fine for some machines but fails to install
for a particular HP machine dc7600.The error code we get is 12(Insufficient resources)

A debugging session shows that after evtadddevice gets called successfully
the evtpreparehardware does not get called.

The other free IRQs I have is 10 and 11.BIOS is unable to assigin any of these twos.Only IRQ 5 works.

My question is:

Is there any way we can avoid the resource clash programatically by forcing the device to take one particular IRQ??
I understand ,in PnP systems its not what is expected.But in that case our device is completely inoperable on this model of HP machine.

I am confused as to the root cause of your problem. Your device doesn’t
know anything about IRQs. It just asserts one of its interrupt pins.
It’s up to the PCI bridge to map that to an IRQ number. Is the problem,
perhaps, that your device does not correctly share the interrupt lines?
In most cases, your board is sharing an interrupt with other PCI
devices. You are required to be able to handle that.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.