<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 26, 2016 at 4:33 PM, Frediano Ziglio <span dir="ltr"><<a href="mailto:fziglio@redhat.com" target="_blank">fziglio@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">><br>
> Interrupts seem to arrive to the driver before the initialization phase<br>
> is over (m_pHWDevice = NULL), in that case we can't handle interrupts yet.<br>
<br>
</span>I would remove the "seem"<br>
<span class=""><br>
> Even<br>
> when m_pHWDevice isn't NULL, other fields aren't necessarly fully intialized<br>
> till<br>
> the StartDevice function has finished initialization, thus the flag<br>
> DriverStarted should be checked upon interrupts.<br>
><br>
> Note: There is no way provided by microsoft to disable interrupts in WDDM<br>
> drivers.<br>
><br>
> Signed-off-by: Sameeh Jubran <<a href="mailto:sameeh@daynix.com">sameeh@daynix.com</a>><br>
> ---<br>
> qxldod/QxlDod.cpp | 6 +++++-<br>
> 1 file changed, 5 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp<br>
> index 3fb30ce..7de64e9 100755<br>
> --- a/qxldod/QxlDod.cpp<br>
> +++ b/qxldod/QxlDod.cpp<br>
> @@ -62,6 +62,7 @@ QxlDod::QxlDod(_In_ DEVICE_OBJECT* pPhysicalDeviceObject) :<br>
> m_pPhysicalDevice(pP<br>
> PAGED_CODE();<br>
> DbgPrint(TRACE_LEVEL_<wbr>INFORMATION, ("---> %s\n", __FUNCTION__));<br>
> *((UINT*)&m_Flags) = 0;<br>
> + m_Flags.DriverStarted = FALSE;<br>
> RtlZeroMemory(&m_<wbr>DxgkInterface, sizeof(m_DxgkInterface));<br>
> RtlZeroMemory(&m_DeviceInfo, sizeof(m_DeviceInfo));<br>
> RtlZeroMemory(m_CurrentModes, sizeof(m_CurrentModes));<br>
<br>
</span>This should be no-op but better to explicit.<br>
<span class=""><br>
> @@ -1684,7 +1685,10 @@ VOID QxlDod::DpcRoutine(VOID)<br>
> BOOLEAN QxlDod::InterruptRoutine(_In_ ULONG MessageNumber)<br>
> {<br>
> DbgPrint(TRACE_LEVEL_<wbr>INFORMATION, ("<--> 0 %s\n", __FUNCTION__));<br>
> - return m_pHWDevice->InterruptRoutine(<wbr>&m_DxgkInterface, MessageNumber);<br>
> + if (m_Flags.DriverStarted) {<br>
> + return m_pHWDevice ? m_pHWDevice->InterruptRoutine(<wbr>&m_DxgkInterface,<br>
> MessageNumber) : FALSE;<br>
> + }<br>
> + return FALSE;<br>
> }<br>
><br>
> VOID QxlDod::ResetDevice(VOID)<br>
<br>
</span>What about<br>
<br>
if (m_Flags.DriverStarted && m_pHWDevice) {<br>
return m_pHWDevice->InterruptRoutine(<wbr>&m_DxgkInterface, MessageNumber);<br>
}<br>
return FALSE;<br>
<br>
Rest is fine, I can do the change by myself if you agree or I'll merge as it otherwise.<br></blockquote><div>I agree, go ahead :) </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Acked-by: Frediano Ziglio <<a href="mailto:fziglio@redhat.com">fziglio@redhat.com</a>><br>
<span class="HOEnZb"><font color="#888888"><br>
Frediano<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font size="4" color="#0b5394" face="times new roman, serif">Respectfully,<br></font><div style="font-size:12.8px;color:rgb(136,136,136)"><font size="4" color="#0b5394" face="times new roman, serif"><b><i>Sameeh Jubran</i></b></font></div><div style="font-size:12.8px;color:rgb(136,136,136)"><i style="color:rgb(7,55,99);font-family:"times new roman",serif;font-size:large"><span style="line-height:15px"><a href="https://il.linkedin.com/pub/sameeh-jubran/87/747/a8a" title="View public profile" name="UNIQUE_ID_SafeHtmlFilter_UNIQUE_ID_SafeHtmlFilter_UNIQUE_ID_SafeHtmlFilter_UNIQUE_ID_SafeHtmlFilter_14e2c1de96f8c195_UNIQUE_ID_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_webProfileURL" style="color:rgb(17,85,204);margin:0px;padding:0px;border-width:0px;outline:none;vertical-align:baseline;text-decoration:none" target="_blank">Linkedin</a></span></i><br></div><div style="font-size:12.8px;color:rgb(136,136,136)"><font size="4" face="times new roman, serif" color="#073763"><i>Junior Software Engineer @ <a href="http://www.daynix.com" target="_blank">Daynix</a>.</i></font></div></div></div></div></div></div></div>
</div></div>