Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 660307 Details for
Bug 882795
[virtio-win][serial]BSOD occurs during transferring data from guest to host during s4
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Fix for the bug based on private repository from git.engineering
0001-Bug-882795-Partially-fixed-virtio-win-serial-BSOD-oc.patch (text/plain), 5.14 KB, created by
Dmitry Fleytman
on 2012-12-09 15:40:49 UTC
(
hide
)
Description:
Fix for the bug based on private repository from git.engineering
Filename:
MIME Type:
Creator:
Dmitry Fleytman
Created:
2012-12-09 15:40:49 UTC
Size:
5.14 KB
patch
obsolete
>From efa0f0b0c4683019d82fcdef5cd2579094a95dbd Mon Sep 17 00:00:00 2001 >From: Dmitry Fleytman <dmitry@daynix.com> >Date: Sun, 9 Dec 2012 17:18:24 +0200 >Subject: [PATCH] Bug 882795 - Partially fixed: [virtio-win][serial]BSOD > occurs during transferring data from guest to host during > s4 > >This patch fixes this specific phenomena but more changes required >to deal with the root cause of this and problems. > >The root cause of this and similar problems (crashes during >sleep/shutdown/hibernate under traffic via serial interface) >is improper locking scheme of the driver. Following tasks to be >performed: > > 1. Purge WDF queues synchronously or wait for asynchronous purge operation > to complete in "shutdown all ports" and "remove port" callbacks > 2. Learn read/write callbacks code and decide on whether they require > locking as well >--- > vioserial/sys/Device.c | 17 +++++++++++++---- > vioserial/sys/Port.c | 34 +++++++++++++++++++++------------- > 2 files changed, 34 insertions(+), 17 deletions(-) > >diff --git a/vioserial/sys/Device.c b/vioserial/sys/Device.c >index a024e8b..82f0f45 100644 >--- a/vioserial/sys/Device.c >+++ b/vioserial/sys/Device.c >@@ -612,6 +612,7 @@ VIOSerialEvtDeviceD0ExitPreInterruptsDisabled( > WDF_CHILD_RETRIEVE_INFO childInfo; > WDFDEVICE hChild; > VIOSERIAL_PORT port; >+ PRAWPDO_VIOSERIAL_PORT pdoData; > > WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_INIT( > &port.Header, sizeof(port)); >@@ -625,13 +626,21 @@ VIOSerialEvtDeviceD0ExitPreInterruptsDisabled( > } > ASSERT(childInfo.Status == WdfChildListRetrieveDeviceSuccess); > >- if (port.GuestConnected && !port.Removed) >+ pdoData = RawPdoSerialPortGetData(hChild); >+ >+ WdfSpinLockAcquire(pdoData->port->InBufLock); >+ WdfSpinLockAcquire(pdoData->port->OutVqLock); >+ >+ if (pdoData->port->GuestConnected && !pdoData->port->Removed) > { >- VIOSerialSendCtrlMsg(port.BusDevice, port.PortId, >+ VIOSerialSendCtrlMsg(pdoData->port->BusDevice, pdoData->port->PortId, > VIRTIO_CONSOLE_PORT_OPEN, 0); >- port.GuestConnected = FALSE; >+ pdoData->port->GuestConnected = FALSE; > } >- port.Removed = TRUE; >+ pdoData->port->Removed = TRUE; >+ >+ WdfSpinLockRelease(pdoData->port->OutVqLock); >+ WdfSpinLockRelease(pdoData->port->InBufLock); > } > > WdfChildListEndIteration(portList, &portIterator); >diff --git a/vioserial/sys/Port.c b/vioserial/sys/Port.c >index aeca88b..8bfdeac 100644 >--- a/vioserial/sys/Port.c >+++ b/vioserial/sys/Port.c >@@ -1124,23 +1124,30 @@ VIOSerialPortCreate( > TraceEvents(TRACE_LEVEL_INFORMATION, DBG_CREATE_CLOSE,"%s Port id = %d\n", __FUNCTION__, pdoData->port->PortId); > > WdfSpinLockAcquire(pdoData->port->InBufLock); >- if (pdoData->port->GuestConnected == TRUE) >+ WdfSpinLockAcquire(pdoData->port->OutVqLock); >+ >+ if (pdoData->port->Removed) >+ { >+ TraceEvents(TRACE_LEVEL_INFORMATION, DBG_CREATE_CLOSE,"Connect request on removed port id = %d\n", pdoData->port->PortId); >+ status = STATUS_OBJECT_NO_LONGER_EXISTS; >+ } >+ else if (pdoData->port->GuestConnected == TRUE) > { >- WdfSpinLockRelease(pdoData->port->InBufLock); > TraceEvents(TRACE_LEVEL_INFORMATION, DBG_CREATE_CLOSE,"Guest already connected Port id = %d\n", pdoData->port->PortId); > status = STATUS_OBJECT_NAME_EXISTS; > } > else > { > pdoData->port->GuestConnected = TRUE; >- WdfSpinLockRelease(pdoData->port->InBufLock); > >- WdfSpinLockAcquire(pdoData->port->OutVqLock); > VIOSerialReclaimConsumedBuffers(pdoData->port); >- WdfSpinLockRelease(pdoData->port->OutVqLock); > > VIOSerialSendCtrlMsg(pdoData->port->BusDevice, pdoData->port->PortId, VIRTIO_CONSOLE_PORT_OPEN, 1); > } >+ >+ WdfSpinLockRelease(pdoData->port->OutVqLock); >+ WdfSpinLockRelease(pdoData->port->InBufLock); >+ > WdfRequestComplete(Request, status); > > TraceEvents(TRACE_LEVEL_INFORMATION, DBG_CREATE_CLOSE, "<-- %s\n", __FUNCTION__); >@@ -1156,19 +1163,20 @@ VIOSerialPortClose( > > TraceEvents(TRACE_LEVEL_INFORMATION, DBG_CREATE_CLOSE, "--> %s\n", __FUNCTION__); > >- if (!pdoData->port->Removed && pdoData->port->GuestConnected) >- { >- VIOSerialSendCtrlMsg(pdoData->port->BusDevice, pdoData->port->PortId, VIRTIO_CONSOLE_PORT_OPEN, 0); >- } >+ WdfSpinLockAcquire(pdoData->port->InBufLock); >+ WdfSpinLockAcquire(pdoData->port->OutVqLock); >+ >+ if (!pdoData->port->Removed && pdoData->port->GuestConnected) >+ { >+ VIOSerialSendCtrlMsg(pdoData->port->BusDevice, pdoData->port->PortId, VIRTIO_CONSOLE_PORT_OPEN, 0); >+ } > pdoData->port->GuestConnected = FALSE; > >- WdfSpinLockAcquire(pdoData->port->InBufLock); > VIOSerialDiscardPortDataLocked(pdoData->port); >- WdfSpinLockRelease(pdoData->port->InBufLock); >- >- WdfSpinLockAcquire(pdoData->port->OutVqLock); > VIOSerialReclaimConsumedBuffers(pdoData->port); >+ > WdfSpinLockRelease(pdoData->port->OutVqLock); >+ WdfSpinLockRelease(pdoData->port->InBufLock); > > TraceEvents(TRACE_LEVEL_INFORMATION, DBG_CREATE_CLOSE, "<-- %s\n", __FUNCTION__); > return; >-- >1.7.11.msysgit.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 882795
: 660307