none
Driver development for PCIe Gen3 End point device which does not support Power Management RRS feed

  • Question

  • Hi,

       I am developing a driver for PCIe Gen3 capable EndPoint device. The device does not support power management and does not advertise it in its capabilities.

        When I do a disable of the device from Device Manager, the driver gets unloaded but the PCI bus driver is trying to set it to D3 state. This is resulting in configuration read failures and ultimately system hang.

        Is there any way in which I can let the PCI bus driver know that my device does not support power management and it should not set it to D3 when I disable it? Is there any configurable parameter regarding the device power states?

        Thanks in advance for any help or suggestion.

    -- Ravi Shankar

    Thursday, August 7, 2014 2:01 PM

Answers

  • your HW is broken, end of story . Power management is a prerequisite

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, August 7, 2014 9:07 PM

All replies

  • Does the PCIe gen.3 standard allow devices that are not backward compatible to support D states?

    If not, your hardware is not PCIe so all bets are off....

    -- pa

    Thursday, August 7, 2014 4:48 PM
  • Hi Pavel,

        For the same device I was able to develop a pci driver in Linux and it works fine. Linux is not setting it to D3 after going through it's capabilities.

    --Ravi

    Thursday, August 7, 2014 5:06 PM
  • your HW is broken, end of story . Power management is a prerequisite

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, August 7, 2014 9:07 PM
  • Hi Doron,

    The PCI block is in FPGA. FPGA's do not support AUX power or bus power. According to SPEC D3 hot state is for devices which support bus power operation. Currently i am giving an external power supply to my board. Also, we have set D0 and D1 support in endpoint PM capabilities of hardware. Accordingly I have set the power capabilities in my driver as below

    WDF_DEVICE_POWER_CAPABILITIES_INIT(&powerCaps);

    powerCaps.DeviceD1 = WdfTrue;

    powerCaps.DeviceD2 = WdfFalse;

    powerCaps.WakeFromD0 = WdfTrue;

    powerCaps.WakeFromD1 = WdfTrue;
    powerCaps.WakeFromD2 = WdfFalse;
    powerCaps.WakeFromD3 = WdfFalse;
    powerCaps.DeviceWake = PowerDeviceD1;

    powerCaps.DeviceState[PowerSystemWorking] = PowerDeviceD0; powerCaps.DeviceState[PowerSystemSleeping1] = PowerDeviceD1; powerCaps.DeviceState[PowerSystemSleeping2] = PowerDeviceD1; powerCaps.DeviceState[PowerSystemSleeping3] = PowerDeviceD1; powerCaps.DeviceState[PowerSystemHibernate] = PowerDeviceD1; powerCaps.DeviceState[PowerSystemShutdown] = PowerDeviceD1;

    powerCaps.IdealDxStateForSx = PowerDeviceD1;

    WdfDeviceSetPowerCapabilities(device,&powerCaps);

    I am doing these settings in EvtDeviceAdd callback routine. The hang issue is seen after I return from my Add routine. Even with this setting, Root Complex driver tries to put the device into D3 state, (if i try to disable the device from device manage) by writing into it's config space. After writing to it's config space the Root Complex driver is trying to read some other configurations from the end points config space, but all of them have timed out. When i try to re enable the device the system is hanging.

    Any suggestion is most welcome.

    Thanks in advance.


    Ravi Shankar JV


    Tuesday, August 26, 2014 5:35 AM