summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c4c15b8)
This causes the device to forget about the request/completion rings.
We allocated said rings in EfiBootServicesData type memory, and code
executing after ExitBootServices() is permitted to overwrite it.
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Liran Alon <liran.alon@oracle.com>
Message-Id: <
20200328200100.60786-17-liran.alon@oracle.com>
Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
PvScsiRestorePciAttributes (Dev);\r
}\r
\r
PvScsiRestorePciAttributes (Dev);\r
}\r
\r
+/**\r
+ Event notification called by ExitBootServices()\r
+**/\r
+STATIC\r
+VOID\r
+EFIAPI\r
+PvScsiExitBoot (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ )\r
+{\r
+ PVSCSI_DEV *Dev;\r
+\r
+ Dev = Context;\r
+ DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));\r
+\r
+ //\r
+ // Reset the device to stop device usage of the rings.\r
+ //\r
+ // We allocated said rings in EfiBootServicesData type memory, and code\r
+ // executing after ExitBootServices() is permitted to overwrite it.\r
+ //\r
+ PvScsiResetAdapter (Dev);\r
+}\r
+\r
//\r
// Driver Binding\r
//\r
//\r
// Driver Binding\r
//\r
goto ClosePciIo;\r
}\r
\r
goto ClosePciIo;\r
}\r
\r
+ Status = gBS->CreateEvent (\r
+ EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
+ TPL_CALLBACK,\r
+ &PvScsiExitBoot,\r
+ Dev,\r
+ &Dev->ExitBoot\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ goto UninitDev;\r
+ }\r
+\r
//\r
// Setup complete, attempt to export the driver instance's PassThru interface\r
//\r
//\r
// Setup complete, attempt to export the driver instance's PassThru interface\r
//\r
&Dev->PassThru\r
);\r
if (EFI_ERROR (Status)) {\r
&Dev->PassThru\r
);\r
if (EFI_ERROR (Status)) {\r
}\r
\r
return EFI_SUCCESS;\r
\r
}\r
\r
return EFI_SUCCESS;\r
\r
+CloseExitBoot:\r
+ gBS->CloseEvent (Dev->ExitBoot);\r
+\r
UninitDev:\r
PvScsiUninit (Dev);\r
\r
UninitDev:\r
PvScsiUninit (Dev);\r
\r
+ gBS->CloseEvent (Dev->ExitBoot);\r
+\r
PvScsiUninit (Dev);\r
\r
gBS->CloseProtocol (\r
PvScsiUninit (Dev);\r
\r
gBS->CloseProtocol (\r
typedef struct {\r
UINT32 Signature;\r
EFI_PCI_IO_PROTOCOL *PciIo;\r
typedef struct {\r
UINT32 Signature;\r
EFI_PCI_IO_PROTOCOL *PciIo;\r
UINT64 OriginalPciAttributes;\r
PVSCSI_RING_DESC RingDesc;\r
PVSCSI_DMA_BUFFER *DmaBuf;\r
UINT64 OriginalPciAttributes;\r
PVSCSI_RING_DESC RingDesc;\r
PVSCSI_DMA_BUFFER *DmaBuf;\r