Rebalancing resources on Windows 7

Hello,

I have a PCIe device that has an FPGA that can be programmed through USB. I want to boot Windows 7 with the FPGA unprogrammed, program it though USB, then discover the PCIe device and load the driver for it. After programming the FPGA and rescanning the PCI bus, the device is found, but device manager states it cannot satisfy the resource requirements required for the device. After a soft restart of the system the device can be found normally. I’ve found documentation that says Windows 7 supports rebalancing PCI resources, but don’t understand what needs to be done to allow it to occur.

Is this possible? Or will a soft reboot always be required?

-Mark

Resource rebalancing is not infinite, and devices required for OS operation (like everything needed to access the system disk) can prevent things like bridges from getting rebalanced. I don’t believe you can dynamically add a new bus either, as currently assigned bus numbers on bridges will not get changed. There is also a difference if your bios assigns resources before boot and if initial resources are assigned by the OS. Resources assigned by the bios, like to bridges, I don’t believe can be changed by a rebalance.

Over the years, resource rebalancing has improved in every release, but there are some resource assignment that may never be able to dynamically change.

You might want to install the checked pci.sys driver and turn on tracing. It spits out lots of messages explaining what’s it doing.

What kind of resources does your device require?

So when you boot with an unprogrammed device, what does it respond to for config space reads?

Jan

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Tolonen, Mark E
Sent: Wednesday, June 19, 2013 12:31 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Rebalancing resources on Windows 7

Hello,

I have a PCIe device that has an FPGA that can be programmed through USB. I want to boot Windows 7 with the FPGA unprogrammed, program it though USB, then discover the PCIe device and load the driver for it. After programming the FPGA and rescanning the PCI bus, the device is found, but device manager states it cannot satisfy the resource requirements required for the device. After a soft restart of the system the device can be found normally. I’ve found documentation that says Windows 7 supports rebalancing PCI resources, but don’t understand what needs to be done to allow it to occur.

Is this possible? Or will a soft reboot always be required?

-Mark


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

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

I have not seen anything about the Win8 specs, so this is pure conjecture.

I would think that dynamic rebalancing requires a bus driver capable of
doing this. So unless the motherboard supports hot-plug PCI, I would
think that a more conventional PCI driver which only configures the bus a
boot time would be running. And this is where I am uncertain about Win8;
this may be the default driver. But, that said, you need to have it
recognize that there is a new device on the bus, and a reconfiguration is
necessary. Then all the PCI drivers have to be well-behaved and handle
the IRP_MJ_PNP:IRP_MN_STOP_DEVICE (if I’ve remembered the name correctly)
or the request cannot be honored. The fact that a reboot solves the
problem suggests that either configuration is only done at boot time, or
the magic signal that tells the bus driver to do the rebalancing is not
occurring.
joe

Resource rebalancing is not infinite, and devices required for OS
operation (like everything needed to access the system disk) can prevent
things like bridges from getting rebalanced. I don’t believe you can
dynamically add a new bus either, as currently assigned bus numbers on
bridges will not get changed. There is also a difference if your bios
assigns resources before boot and if initial resources are assigned by the
OS. Resources assigned by the bios, like to bridges, I don’t believe can
be changed by a rebalance.

Over the years, resource rebalancing has improved in every release, but
there are some resource assignment that may never be able to dynamically
change.

You might want to install the checked pci.sys driver and turn on tracing.
It spits out lots of messages explaining what’s it doing.

What kind of resources does your device require?

So when you boot with an unprogrammed device, what does it respond to for
config space reads?

Jan

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tolonen, Mark E
Sent: Wednesday, June 19, 2013 12:31 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Rebalancing resources on Windows 7

Hello,

I have a PCIe device that has an FPGA that can be programmed through USB.
I want to boot Windows 7 with the FPGA unprogrammed, program it though
USB, then discover the PCIe device and load the driver for it. After
programming the FPGA and rescanning the PCI bus, the device is found, but
device manager states it cannot satisfy the resource requirements required
for the device. After a soft restart of the system the device can be
found normally. I’ve found documentation that says Windows 7 supports
rebalancing PCI resources, but don’t understand what needs to be done to
allow it to occur.

Is this possible? Or will a soft reboot always be required?

-Mark


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

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


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

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