StorPortGetMSIInfo Problem

Hi all,

When should be the right timing calling StorPortGetMSIInfo in Storport miniport driver ? In theory, I should call it in HwInitialize, but it never gets called, even though I return SP_RETURN_FOUND with all MSI related stuff set up in Port_Configuration_Info structure. Could anybody shed some light on why my HwInitialize routine never gets called ? By the way, I call StorPortGetMSIInfo in HwFindAdapter and get STOR_STATUS_INVALID_DEVICE_REQUEST.

Thanks alot,
Alex

What is your OS version? Have you updated your miniport’s inf to request
MSIs? ( http://msdn.microsoft.com/en-us/library/bb961247.aspx )

Regards,
T.V.Gokul.

On Wed, Mar 3, 2010 at 6:28 AM, wrote:

> Hi all,
>
> When should be the right timing calling StorPortGetMSIInfo in Storport
> miniport driver ? In theory, I should call it in HwInitialize, but it never
> gets called, even though I return SP_RETURN_FOUND with all MSI related stuff
> set up in Port_Configuration_Info structure. Could anybody shed some light
> on why my HwInitialize routine never gets called ? By the way, I call
> StorPortGetMSIInfo in HwFindAdapter and get
> STOR_STATUS_INVALID_DEVICE_REQUEST.
>
> Thanks alot,
> Alex
>
> —
> 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
>

I am running on Windows 7. All the MSI required hardware keys are set up correctly, too.

Thanks,
Alex

The documentation for StorPortGetMSIInfo says,
“STOR_STATUS_INVALID_DEVICE_REQUEST - The HBA does not support MSI.”. So
this could be either because of bad inf or the hardware itself. I assume
your hardware is capable to doing message signaled interrupts and connected
to a PCIe bus (and not behind any PCI bridges).

Also, its worth validating your inf once with chkinf, if not done already.

Regards,
T.V.Gokul.

On Wed, Mar 3, 2010 at 10:56 AM, wrote:

> I am running on Windows 7. All the MSI required hardware keys are set up
> correctly, too.
>
> Thanks,
> Alex
>
> —
> 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
>

Yes, I used chkinf and no error reported.
I think the real problem I have is why my HwInitialize routine never gets called. Is it related to any settings in Port_Configuration_Info structure that I deal with in HwFindAdapter routine? Could anybody help on this, please?

Thanks a lot,
Alex

You need to set up a checked build version of storport.sys and see what kind of debug messages storport generates after calling HwFindAdapter. The messages should start with word “STOR”.

Igor Sharovar

Sure - if you screw up in HwFindAdapter you won’t get called in
HwInitialize. If you want more help you are going to have to provide
more information.

Mark Roddy

On Wed, Mar 3, 2010 at 11:32 AM, wrote:
> Yes, I used chkinf and no error reported.
> I think the real problem I have is why my HwInitialize routine never gets called. Is it related to any settings in Port_Configuration_Info structure that I deal with in HwFindAdapter routine? Could anybody help on this, please?
>
> Thanks a lot,
> Alex
>
> —
> 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
>

Here are settings added in HW_INITIALIZATION_DATA:
hwInitData.AutoRequestSense = TRUE;
hwInitData.NeedPhysicalAddresses = TRUE;
hwInitData.NumberOfAccessRanges = 1;
hwInitData.AdapterInterfaceType = PCIBus;
hwInitData.MapBuffers = STOR_MAP_NON_READ_WRITE_BUFFERS;
hwInitData.TaggedQueuing = TRUE;
hwInitData.MultipleRequestPerLu = TRUE;
Here are settings added in PORT_CONFIGURATION_INFO:
pPCI->MaximumTransferLength = 256*1024;
pPCI->NumberOfPhysicalBreaks = 32;
pPCI->MaximumNumberOfTargets = 32;
pPCI->NumberOfBuses = 1;
pPCI->ScatterGather = TRUE;

// Support SRB_FUNCTION_RESET_DEVICE
pPCI->ResetTargetSupported = TRUE;
pPCI->MaximumNumberOfLogicalUnits = 32;
// Set driver to run in full duplex mode
pPCI->SynchronizationModel = StorSynchronizeFullDuplex;
// For 64-bit systems, controller supports 64-bit addressing,
if (pPCI->Dma64BitAddresses == SCSI_DMA64_SYSTEM_SUPPORTED) {
pPCI->Dma64BitAddresses = SCSI_DMA64_MINIPORT_SUPPORTED;
}
pPCI->InterruptSynchronizationMode = InterruptSynchronizePerMessage;
// Specify IDT’s MSI ISR here
pPCI->HwMSInterruptRoutine = IdtMSIISR;

return(SP_RETURN_FOUND);

If you are not doing this already, do

  1. *Initialize* the HW_INITIALIZATION_DATA & PORT_CONFIGURATION_INFO to ‘0’.

  2. Set the following handlers in HW_INITIALIZATION_DATA,

  • HwAdapterControl
  • HwBuildIo
  • HwStartIo
  • HwInterrupt
  • HwResetBus
  1. Set the following handlers in PORT_CONFIGURATION_INFO,
  • Master
  • CachesData
  • AlignmentMask

Finally, I’ve seen getting StartIo’s with SRB_PNP_xxx action before
HwInitialize called or completed. So you have to handle these cases
properly.

Regards,
T.V.Gokul.

On Thu, Mar 4, 2010 at 12:12 AM, wrote:

> Here are settings added in HW_INITIALIZATION_DATA:
> hwInitData.AutoRequestSense = TRUE;
> hwInitData.NeedPhysicalAddresses = TRUE;
> hwInitData.NumberOfAccessRanges = 1;
> hwInitData.AdapterInterfaceType = PCIBus;
> hwInitData.MapBuffers = STOR_MAP_NON_READ_WRITE_BUFFERS;
> hwInitData.TaggedQueuing = TRUE;
> hwInitData.MultipleRequestPerLu = TRUE;
> Here are settings added in PORT_CONFIGURATION_INFO:
> pPCI->MaximumTransferLength = 256*1024;
> pPCI->NumberOfPhysicalBreaks = 32;
> pPCI->MaximumNumberOfTargets = 32;
> pPCI->NumberOfBuses = 1;
> pPCI->ScatterGather = TRUE;
>
> // Support SRB_FUNCTION_RESET_DEVICE
> pPCI->ResetTargetSupported = TRUE;
> pPCI->MaximumNumberOfLogicalUnits = 32;
> // Set driver to run in full duplex mode
> pPCI->SynchronizationModel = StorSynchronizeFullDuplex;
> // For 64-bit systems, controller supports 64-bit addressing,
> if (pPCI->Dma64BitAddresses == SCSI_DMA64_SYSTEM_SUPPORTED) {
> pPCI->Dma64BitAddresses = SCSI_DMA64_MINIPORT_SUPPORTED;
> }
> pPCI->InterruptSynchronizationMode = InterruptSynchronizePerMessage;
> // Specify IDT’s MSI ISR here
> pPCI->HwMSInterruptRoutine = IdtMSIISR;
>
> return(SP_RETURN_FOUND);
>
> —
> 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
>

Many thanks to you.

I am not sure zeroing the PORT_CONFIGURATION_INFORMATION, which is passed in HwFindAdapter routine. I do receive SRB_FUNCTION_PNP, need to figure out how to handle that first.

Ouch… typo…

Donot touch PORT_CONFIGURATION_INFORMATION… Its already initialzied by
storport.

And regarding SRB_FUNCTION_PNP, just try completing that SRB with SUCCESS
irrespective of your DeviceExtension state.

Regards,
T.V.Gokul.

On Thu, Mar 4, 2010 at 10:51 AM, wrote:

> Many thanks to you.
>
> I am not sure zeroing the PORT_CONFIGURATION_INFORMATION, which is passed
> in HwFindAdapter routine. I do receive SRB_FUNCTION_PNP, need to figure out
> how to handle that first.
>
>
>
> —
> 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
>

Hi T.V.Gokul,

My HwInitialize never gets called still, instead, the SRB_FUNCTION_PNP I receive means to remove the device (PnPAction = StorRemoveDevice). I am sure where I configure wrong ??? Please let me know if you need more of my settings.

Thanks,
Alex

Surprising… I’ve never seen ‘PnPAction = StorRemoveDevice’, after
successfully completing the HwFindAdapter (SP_RETURN_FOUND).

To just confirm, your hardware is working fine, try to run the same
experiment in a new system. If possible, verify your hardware is properly
claiming its resources (Generally, I used to verify this in Linux machine,
by doing ‘lspci -vv’)

Regards,
T.V.Gokul.

On Fri, Mar 5, 2010 at 12:59 AM, wrote:

> Hi T.V.Gokul,
>
> My HwInitialize never gets called still, instead, the SRB_FUNCTION_PNP I
> receive means to remove the device (PnPAction = StorRemoveDevice). I am sure
> where I configure wrong ??? Please let me know if you need more of my
> settings.
>
> Thanks,
> Alex
>
> —
> 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
>

With lspci -vv:

Capabilities: [84] MSI-X: Enable- Mask- TabSize=32
Vector table: BAR=0 offset=00008000
PBA: BAR=0 offset=00010000

I notice that other devices supporting MSI-X on the same system, the enable bit is on (Enable+). Why ours is off? Who is responsible for enabling it?

Thanks,
Alex

May be your hardware/firmware guys can tell this! Its worth talking to ur
internal team also…

Regards,
T.V.Gokul.

On Fri, Mar 5, 2010 at 10:31 PM, wrote:

> With lspci -vv:
>
> Capabilities: [84] MSI-X: Enable- Mask- TabSize=32
> Vector table: BAR=0 offset=00008000
> PBA: BAR=0 offset=00010000
>
> I notice that other devices supporting MSI-X on the same system, the enable
> bit is on (Enable+). Why ours is off? Who is responsible for enabling it?
>
> Thanks,
> Alex
>
> —
> 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
>

Thanks.

>Surprising… I’ve never seen ‘PnPAction = StorRemoveDevice’, after successfully completing the >HwFindAdapter (SP_RETURN_FOUND).
It is possible. For example, if BusInterruptLevel of PORT_CONFIGURATION_INFORMATION is not assigned by a Port driver, a miniport driver would be unloaded. It would happened even
HwFindAdapter returns SP_RETURN_FOUND.

Igor Sharovar

It won’t be enabled until you driver is started.


Jake Oshins
Hyper-V I/O Architect
Windows Kernel Group

This post implies no warranties and confers no rights.


wrote in message news:xxxxx@ntdev…
> With lspci -vv:
>
> Capabilities: [84] MSI-X: Enable- Mask- TabSize=32
> Vector table: BAR=0 offset=00008000
> PBA: BAR=0 offset=00010000
>
> I notice that other devices supporting MSI-X on the same system, the
> enable bit is on (Enable+). Why ours is off? Who is responsible for
> enabling it?
>
> Thanks,
> Alex
>

Hi Jake,

The problem was caused by the our hardware bug and now it’s been fixed. Thanks a lot.
I am kind of bothered by a interesting sympton that my DriverEntry gets called twice when system boots. After first call, all initialization went thru properly. And then second DriverEntry call comes in. I believe it causes system to crash. Why it gets called twice?

Thanks,
Alex

Have you run ChkInf on your INF file?

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

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Monday, March 08, 2010 6:42 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] StorPortGetMSIInfo Problem

Hi Jake,

The problem was caused by the our hardware bug and now it’s been fixed.
Thanks a lot.
I am kind of bothered by a interesting sympton that my DriverEntry gets
called twice when system boots. After first call, all initialization went
thru properly. And then second DriverEntry call comes in. I believe it
causes system to crash. Why it gets called twice?

Thanks,
Alex


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

__________ Information from ESET Smart Security, version of virus signature
database 4926 (20100308) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature
database 4926 (20100308) __________

The message was checked by ESET Smart Security.

http://www.eset.com