[nvmewin] good spot to write to registry?

Robles, Raymond C raymond.c.robles at intel.com
Tue May 15 21:02:53 PDT 2012


StorPortRegistryWrite must be called at PASSIVE IRQL. HwStorInitialize is called at DIRQL, which is why you are seeing a failure. HwStorFindAdapter is called at PASSIVE IRQL which is why we placed the registry access there. If you need to do additional registry reads/writes after HwStorFindAdapter you could put the call inside NVMePassiveInitialize since its called at PASSIVE IRQL.

Thanks,
Ray

On May 15, 2012, at 6:49 PM, "Freyensee, James P" <james.p.freyensee at intel.com<mailto:james.p.freyensee at intel.com>> wrote:

Is there a good spot in the NVMe driver to write to the registry via NVMeWriteRegistry() when all the initialization and internal variables are set?

It seems like all initialization can end in NVMeInitialize() at the code:

    if (pAE->ntldrDump == FALSE) {
        /* Enumerate granted MSI/MSI-X messages if there is any */
        if (NVMeEnumMsiMessages(pAE) == FALSE) {
            NVMeFreeBuffers(pAE);
            return (FALSE);
        }

        /* Call StorPortPassiveInitialization to enable passive init */
        StorPortEnablePassiveInitialization(pAE, NVMePassiveInitialize);
              return (TRUE);

and all the internal variables and tables are set in the driver at this point.  However, if you wanted to write a value out to the registry before the return(), it will fail here in NVMeInitialize().

BUT, NVMeWriteRegistry() will succeed if called within NVMeFindAdapter().  However, not all the important, internal variables are set yet in this function.  For example, pAE->ResMapTbl.NumMsiMsgGranted is not set by the system at this point, which is something I care about.

NVMeWriteRegistry() is using StorPortWriteRegistry(), and it seems to be finicky when you can actually successfully use it.  Unfortunately it only returns TRUE or FALSE and gives no further info what really failed and why, so I am not sure what is going on.

Maybe someone might know?  Thanks!
_______________________________________________
nvmewin mailing list
nvmewin at lists.openfabrics.org<mailto:nvmewin at lists.openfabrics.org>
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/nvmewin



More information about the nvmewin mailing list