<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div class="moz-cite-prefix">On 1/19/2021 4:29 PM, Grodzovsky, Andrey wrote:<br>
</div>
<blockquote type="cite" cite="mid:0c78acd2-536d-4abd-4758-8e84a197171e@amd.com"><br>
On 1/15/21 2:21 AM, Chen, Xiaogang wrote: <br>
<blockquote type="cite">On 1/14/2021 1:24 AM, Grodzovsky, Andrey wrote: <br>
<blockquote type="cite"><br>
On 1/14/21 12:11 AM, Chen, Xiaogang wrote: <br>
<blockquote type="cite">On 1/12/2021 10:54 PM, Grodzovsky, Andrey wrote: <br>
<blockquote type="cite">On 1/4/21 1:01 AM, Xiaogang.Chen wrote: <br>
<blockquote type="cite">From: Xiaogang Chen <a class="moz-txt-link-rfc2396E" href="mailto:xiaogang.chen@amd.com">
<xiaogang.chen@amd.com></a> <br>
<br>
amdgpu DM handles INTERRUPT_LOW_IRQ_CONTEXT interrupt(hpd, hpd_rx) by <br>
using work queue and uses single work_struct. If previous interrupt <br>
has not been handled new interrupts(same type) will be discarded and <br>
driver just sends "amdgpu_dm_irq_schedule_work FAILED" message out. <br>
If some important hpd, hpd_rx related interrupts are missed by driver <br>
the hot (un)plug devices may cause system hang or unstable, such as <br>
system resumes from S3 sleep with mst device connected. <br>
<br>
This patch dynamically allocates new amdgpu_dm_irq_handler_data for <br>
new interrupts if previous INTERRUPT_LOW_IRQ_CONTEXT interrupt work <br>
has not been handled. So the new interrupt works can be queued to the <br>
same workqueue_struct, instead discard the new interrupts. <br>
All allocated amdgpu_dm_irq_handler_data are put into a single linked <br>
list and will be reused after. <br>
</blockquote>
<br>
I believe this creates a possible concurrency between already <br>
executing work item <br>
and the new incoming one for which you allocate a new work item on <br>
the fly. While <br>
handle_hpd_irq is serialized with aconnector->hpd_lock I am seeing <br>
that for handle_hpd_rx_irq <br>
it's not locked for MST use case (which is the most frequently used <br>
with this interrupt). Did you <br>
verified that handle_hpd_rx_irq is reentrant ? <br>
<br>
</blockquote>
handle_hpd_rx_irq is put at a work queue. Its execution is serialized <br>
by the work queue. So there is no reentrant. <br>
<br>
</blockquote>
You are using system_highpri_wq which has the property that it has <br>
multiple workers thread pool spread across all the <br>
active CPUs, see all work queue definitions here <br>
<a class="moz-txt-link-freetext" href="https://elixir.bootlin.com/linux/v5.11-rc3/source/include/linux/workqueue.h#L358">https://elixir.bootlin.com/linux/v5.11-rc3/source/include/linux/workqueue.h#L358</a>
<br>
I beleieve that what you saying about no chance of reentrnacy would be <br>
correct if it would be same work item dequeued for execution <br>
while previous instance is still running, see the explanation here - <br>
<a class="moz-txt-link-freetext" href="https://elixir.bootlin.com/linux/v5.11-rc3/source/kernel/workqueue.c#L1435">https://elixir.bootlin.com/linux/v5.11-rc3/source/kernel/workqueue.c#L1435</a>.
<br>
Non reentrancy is guaranteed only for the same work item. If you want <br>
non reentrancy (full serializtion) for different work items you should <br>
create <br>
you own single threaded work-queue using create_singlethread_workqueue <br>
<br>
<br>
</blockquote>
Thank you. I think the easiest way is using aconnector->hpd_lock at <br>
handle_hpd_rx_irq to lock for dc_link->type == dc_connection_mst_branch <br>
case, right? I will do that at next version if you think it is ok. <br>
</blockquote>
<br>
<br>
I am not sure what are the consequences of of using hpd lock there with <br>
regard to other locks acquired in DRM MST code during MST related HPD transactions since
<br>
i haven't dealt with this for a very long time. Maybe Harry or Nick can advise on this ?
<br>
<br>
Andrey <br>
<br>
</blockquote>
<p class="MsoPlainText">Hi Harry, Nick: would you or someone give review on this patch?</p>
<p>Thanks<br>
</p>
<p class="MsoPlainText">Xiaogang</p>
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<w:DoNotOptimizeForBrowser/>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="false"
DefSemiHidden="false" DefQFormat="false" DefPriority="99"
LatentStyleCount="376">
<w:LsdException Locked="false" Priority="0" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 6"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 7"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 8"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 9"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 9"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Normal Indent"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="footnote text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="annotation text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="header"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="footer"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index heading"/>
<w:LsdException Locked="false" Priority="35" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="table of figures"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="envelope address"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="envelope return"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="footnote reference"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="annotation reference"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="line number"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="page number"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="endnote reference"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="endnote text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="table of authorities"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="macro"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="toa heading"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 5"/>
<w:LsdException Locked="false" Priority="10" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Closing"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Signature"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="true"
UnhideWhenUsed="true" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text Indent"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Message Header"/>
<w:LsdException Locked="false" Priority="11" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Salutation"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Date"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text First Indent"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text First Indent 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Note Heading"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text Indent 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text Indent 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Block Text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Hyperlink"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="FollowedHyperlink"/>
<w:LsdException Locked="false" Priority="22" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Document Map"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Plain Text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="E-mail Signature"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Top of Form"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Bottom of Form"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Normal (Web)"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Acronym"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Address"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Cite"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Code"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Definition"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Keyboard"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Preformatted"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Sample"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Typewriter"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Variable"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Normal Table"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="annotation subject"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="No List"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Outline List 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Outline List 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Outline List 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Simple 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Simple 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Simple 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Colorful 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Colorful 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Colorful 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 6"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 7"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 8"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 6"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 7"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 8"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table 3D effects 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table 3D effects 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table 3D effects 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Contemporary"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Elegant"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Professional"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Subtle 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Subtle 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Web 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Web 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Web 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Balloon Text"/>
<w:LsdException Locked="false" Priority="39" Name="Table Grid"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Theme"/>
<w:LsdException Locked="false" SemiHidden="true" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" SemiHidden="true" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" QFormat="true"
Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" QFormat="true"
Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" QFormat="true"
Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" QFormat="true"
Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" QFormat="true"
Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" QFormat="true"
Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" SemiHidden="true"
UnhideWhenUsed="true" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="TOC Heading"/>
<w:LsdException Locked="false" Priority="41" Name="Plain Table 1"/>
<w:LsdException Locked="false" Priority="42" Name="Plain Table 2"/>
<w:LsdException Locked="false" Priority="43" Name="Plain Table 3"/>
<w:LsdException Locked="false" Priority="44" Name="Plain Table 4"/>
<w:LsdException Locked="false" Priority="45" Name="Plain Table 5"/>
<w:LsdException Locked="false" Priority="40" Name="Grid Table Light"/>
<w:LsdException Locked="false" Priority="46" Name="Grid Table 1 Light"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark"/>
<w:LsdException Locked="false" Priority="51" Name="Grid Table 6 Colorful"/>
<w:LsdException Locked="false" Priority="52" Name="Grid Table 7 Colorful"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 1"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 1"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 1"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 1"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 1"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 2"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 2"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 2"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 2"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 2"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 3"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 3"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 3"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 3"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 3"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 4"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 4"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 4"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 4"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 4"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 5"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 5"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 5"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 5"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 5"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 6"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 6"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 6"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 6"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 6"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 6"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 6"/>
<w:LsdException Locked="false" Priority="46" Name="List Table 1 Light"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark"/>
<w:LsdException Locked="false" Priority="51" Name="List Table 6 Colorful"/>
<w:LsdException Locked="false" Priority="52" Name="List Table 7 Colorful"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 1"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 1"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 1"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 1"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 1"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 2"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 2"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 2"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 2"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 2"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 3"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 3"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 3"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 3"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 3"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 4"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 4"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 4"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 4"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 4"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 5"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 5"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 5"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 5"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 5"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 6"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 6"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 6"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 6"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 6"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 6"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 6"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Mention"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Smart Hyperlink"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Hashtag"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Unresolved Mention"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Smart Link"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]-->
<blockquote type="cite" cite="mid:0c78acd2-536d-4abd-4758-8e84a197171e@amd.com">
<blockquote type="cite"><br>
<blockquote type="cite">
<blockquote type="cite">amdgpu_dm_irq_schedule_work does queuing of work(put <br>
handle_hpd_rx_irq into work queue). The first call is <br>
dm_irq_work_func, then call handle_hpd_rx_irq. <br>
<blockquote type="cite">
<blockquote type="cite">Signed-off-by: Xiaogang Chen <a class="moz-txt-link-rfc2396E" href="mailto:xiaogang.chen@amd.com">
<xiaogang.chen@amd.com></a> <br>
--- <br>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 14 +-- <br>
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 114 <br>
++++++++++++++------- <br>
2 files changed, 80 insertions(+), 48 deletions(-) <br>
<br>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h <br>
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h <br>
index c9d82b9..730e540 100644 <br>
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h <br>
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h <br>
@@ -69,18 +69,6 @@ struct common_irq_params { <br>
}; <br>
/** <br>
- * struct irq_list_head - Linked-list for low context IRQ handlers. <br>
- * <br>
- * @head: The list_head within &struct handler_data <br>
- * @work: A work_struct containing the deferred handler work <br>
- */ <br>
-struct irq_list_head { <br>
- struct list_head head; <br>
- /* In case this interrupt needs post-processing, 'work' will <br>
be queued*/ <br>
- struct work_struct work; <br>
-}; <br>
- <br>
-/** <br>
* struct dm_compressor_info - Buffer info used by frame buffer <br>
compression <br>
* @cpu_addr: MMIO cpu addr <br>
* @bo_ptr: Pointer to the buffer object <br>
@@ -270,7 +258,7 @@ struct amdgpu_display_manager { <br>
* Note that handlers are called in the same order as they were <br>
* registered (FIFO). <br>
*/ <br>
- struct irq_list_head <br>
irq_handler_list_low_tab[DAL_IRQ_SOURCES_NUMBER]; <br>
+ struct list_head <br>
irq_handler_list_low_tab[DAL_IRQ_SOURCES_NUMBER]; <br>
/** <br>
* @irq_handler_list_high_tab: <br>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c <br>
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c <br>
index 3577785..ada344a 100644 <br>
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c <br>
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c <br>
@@ -82,6 +82,7 @@ struct amdgpu_dm_irq_handler_data { <br>
struct amdgpu_display_manager *dm; <br>
/* DAL irq source which registered for this interrupt. */ <br>
enum dc_irq_source irq_source; <br>
+ struct work_struct work; <br>
}; <br>
#define DM_IRQ_TABLE_LOCK(adev, flags) \ <br>
@@ -111,20 +112,10 @@ static void init_handler_common_data(struct <br>
amdgpu_dm_irq_handler_data *hcd, <br>
*/ <br>
static void dm_irq_work_func(struct work_struct *work) <br>
{ <br>
- struct irq_list_head *irq_list_head = <br>
- container_of(work, struct irq_list_head, work); <br>
- struct list_head *handler_list = &irq_list_head->head; <br>
- struct amdgpu_dm_irq_handler_data *handler_data; <br>
- <br>
- list_for_each_entry(handler_data, handler_list, list) { <br>
- DRM_DEBUG_KMS("DM_IRQ: work_func: for dal_src=%d\n", <br>
- handler_data->irq_source); <br>
+ struct amdgpu_dm_irq_handler_data *handler_data = <br>
+ container_of(work, struct amdgpu_dm_irq_handler_data, work); <br>
- DRM_DEBUG_KMS("DM_IRQ: schedule_work: for dal_src=%d\n", <br>
- handler_data->irq_source); <br>
- <br>
- handler_data->handler(handler_data->handler_arg); <br>
- } <br>
+ handler_data->handler(handler_data->handler_arg); <br>
/* Call a DAL subcomponent which registered for interrupt <br>
notification <br>
* at INTERRUPT_LOW_IRQ_CONTEXT. <br>
@@ -156,7 +147,7 @@ static struct list_head <br>
*remove_irq_handler(struct amdgpu_device *adev, <br>
break; <br>
case INTERRUPT_LOW_IRQ_CONTEXT: <br>
default: <br>
- hnd_list = <br>
&adev->dm.irq_handler_list_low_tab[irq_source].head; <br>
+ hnd_list = &adev->dm.irq_handler_list_low_tab[irq_source]; <br>
break; <br>
} <br>
@@ -287,7 +278,8 @@ void *amdgpu_dm_irq_register_interrupt(struct <br>
amdgpu_device *adev, <br>
break; <br>
case INTERRUPT_LOW_IRQ_CONTEXT: <br>
default: <br>
- hnd_list = <br>
&adev->dm.irq_handler_list_low_tab[irq_source].head; <br>
+ hnd_list = &adev->dm.irq_handler_list_low_tab[irq_source]; <br>
+ INIT_WORK(&handler_data->work, dm_irq_work_func); <br>
break; <br>
} <br>
@@ -369,7 +361,7 @@ void <br>
amdgpu_dm_irq_unregister_interrupt(struct amdgpu_device *adev, <br>
int amdgpu_dm_irq_init(struct amdgpu_device *adev) <br>
{ <br>
int src; <br>
- struct irq_list_head *lh; <br>
+ struct list_head *lh; <br>
DRM_DEBUG_KMS("DM_IRQ\n"); <br>
@@ -378,9 +370,7 @@ int amdgpu_dm_irq_init(struct amdgpu_device <br>
*adev) <br>
for (src = 0; src < DAL_IRQ_SOURCES_NUMBER; src++) { <br>
/* low context handler list init */ <br>
lh = &adev->dm.irq_handler_list_low_tab[src]; <br>
- INIT_LIST_HEAD(&lh->head); <br>
- INIT_WORK(&lh->work, dm_irq_work_func); <br>
- <br>
+ INIT_LIST_HEAD(lh); <br>
/* high context handler init */ <br>
INIT_LIST_HEAD(&adev->dm.irq_handler_list_high_tab[src]); <br>
} <br>
@@ -397,8 +387,11 @@ int amdgpu_dm_irq_init(struct amdgpu_device <br>
*adev) <br>
void amdgpu_dm_irq_fini(struct amdgpu_device *adev) <br>
{ <br>
int src; <br>
- struct irq_list_head *lh; <br>
+ struct list_head *lh; <br>
+ struct list_head *entry, *tmp; <br>
+ struct amdgpu_dm_irq_handler_data *handler; <br>
unsigned long irq_table_flags; <br>
+ <br>
DRM_DEBUG_KMS("DM_IRQ: releasing resources.\n"); <br>
for (src = 0; src < DAL_IRQ_SOURCES_NUMBER; src++) { <br>
DM_IRQ_TABLE_LOCK(adev, irq_table_flags); <br>
@@ -407,7 +400,15 @@ void amdgpu_dm_irq_fini(struct amdgpu_device <br>
*adev) <br>
* (because no code can schedule a new one). */ <br>
lh = &adev->dm.irq_handler_list_low_tab[src]; <br>
DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags); <br>
- flush_work(&lh->work); <br>
+ <br>
+ if (!list_empty(lh)) { <br>
+ list_for_each_safe(entry, tmp, lh) { <br>
+ <br>
+ handler = list_entry(entry, struct <br>
amdgpu_dm_irq_handler_data, <br>
+ list); <br>
+ flush_work(&handler->work); <br>
+ } <br>
+ } <br>
} <br>
} <br>
@@ -417,6 +418,8 @@ int amdgpu_dm_irq_suspend(struct <br>
amdgpu_device *adev) <br>
struct list_head *hnd_list_h; <br>
struct list_head *hnd_list_l; <br>
unsigned long irq_table_flags; <br>
+ struct list_head *entry, *tmp; <br>
+ struct amdgpu_dm_irq_handler_data *handler; <br>
DM_IRQ_TABLE_LOCK(adev, irq_table_flags); <br>
@@ -427,14 +430,22 @@ int amdgpu_dm_irq_suspend(struct <br>
amdgpu_device *adev) <br>
* will be disabled from manage_dm_interrupts on disable CRTC. <br>
*/ <br>
for (src = DC_IRQ_SOURCE_HPD1; src <= DC_IRQ_SOURCE_HPD6RX; <br>
src++) { <br>
- hnd_list_l = &adev->dm.irq_handler_list_low_tab[src].head; <br>
+ hnd_list_l = &adev->dm.irq_handler_list_low_tab[src]; <br>
hnd_list_h = &adev->dm.irq_handler_list_high_tab[src]; <br>
if (!list_empty(hnd_list_l) || !list_empty(hnd_list_h)) <br>
dc_interrupt_set(adev->dm.dc, src, false); <br>
DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags); <br>
- flush_work(&adev->dm.irq_handler_list_low_tab[src].work); <br>
+ if (!list_empty(hnd_list_l)) { <br>
+ <br>
+ list_for_each_safe(entry, tmp, hnd_list_l) { <br>
+ <br>
+ handler = list_entry(entry, struct <br>
amdgpu_dm_irq_handler_data, <br>
+ list); <br>
+ flush_work(&handler->work); <br>
+ } <br>
+ } <br>
DM_IRQ_TABLE_LOCK(adev, irq_table_flags); <br>
} <br>
@@ -454,7 +465,7 @@ int amdgpu_dm_irq_resume_early(struct <br>
amdgpu_device *adev) <br>
/* re-enable short pulse interrupts HW interrupt */ <br>
for (src = DC_IRQ_SOURCE_HPD1RX; src <= DC_IRQ_SOURCE_HPD6RX; <br>
src++) { <br>
- hnd_list_l = &adev->dm.irq_handler_list_low_tab[src].head; <br>
+ hnd_list_l = &adev->dm.irq_handler_list_low_tab[src]; <br>
hnd_list_h = &adev->dm.irq_handler_list_high_tab[src]; <br>
if (!list_empty(hnd_list_l) || !list_empty(hnd_list_h)) <br>
dc_interrupt_set(adev->dm.dc, src, true); <br>
@@ -480,7 +491,7 @@ int amdgpu_dm_irq_resume_late(struct <br>
amdgpu_device *adev) <br>
* will be enabled from manage_dm_interrupts on enable CRTC. <br>
*/ <br>
for (src = DC_IRQ_SOURCE_HPD1; src <= DC_IRQ_SOURCE_HPD6; <br>
src++) { <br>
- hnd_list_l = &adev->dm.irq_handler_list_low_tab[src].head; <br>
+ hnd_list_l = &adev->dm.irq_handler_list_low_tab[src]; <br>
hnd_list_h = &adev->dm.irq_handler_list_high_tab[src]; <br>
if (!list_empty(hnd_list_l) || !list_empty(hnd_list_h)) <br>
dc_interrupt_set(adev->dm.dc, src, true); <br>
@@ -497,20 +508,53 @@ int amdgpu_dm_irq_resume_late(struct <br>
amdgpu_device *adev) <br>
static void amdgpu_dm_irq_schedule_work(struct amdgpu_device *adev, <br>
enum dc_irq_source irq_source) <br>
{ <br>
- unsigned long irq_table_flags; <br>
- struct work_struct *work = NULL; <br>
- DM_IRQ_TABLE_LOCK(adev, irq_table_flags); <br>
+ struct list_head *handler_list = <br>
&adev->dm.irq_handler_list_low_tab[irq_source]; <br>
+ struct amdgpu_dm_irq_handler_data *handler_data; <br>
+ bool work_queued = false; <br>
- if <br>
(!list_empty(&adev->dm.irq_handler_list_low_tab[irq_source].head)) <br>
- work = &adev->dm.irq_handler_list_low_tab[irq_source].work; <br>
+ if (list_empty(handler_list)) <br>
+ return; <br>
- DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags); <br>
+ list_for_each_entry(handler_data, handler_list, list) { <br>
+ <br>
+ if (!queue_work(system_highpri_wq, &handler_data->work)) { <br>
+ continue; <br>
+ } else { <br>
+ work_queued = true; <br>
+ break; <br>
+ } <br>
+ } <br>
+ <br>
+ if (!work_queued) { <br>
+ <br>
+ struct amdgpu_dm_irq_handler_data *handler_data_add; <br>
+ /*get the amdgpu_dm_irq_handler_data of first item pointed <br>
by handler_list*/ <br>
+ handler_data = container_of(handler_list->next, struct <br>
amdgpu_dm_irq_handler_data, list); <br>
+ <br>
+ /*allocate a new amdgpu_dm_irq_handler_data*/ <br>
+ handler_data_add = kzalloc(sizeof(*handler_data), <br>
GFP_KERNEL); <br>
+ if (!handler_data_add) { <br>
+ DRM_ERROR("DM_IRQ: failed to allocate irq handler!\n"); <br>
+ return; <br>
+ } <br>
+ <br>
+ /*copy new amdgpu_dm_irq_handler_data members from <br>
handler_data*/ <br>
+ handler_data_add->handler = handler_data->handler; <br>
+ handler_data_add->handler_arg = handler_data->handler_arg; <br>
+ handler_data_add->dm = handler_data->dm; <br>
+ handler_data_add->irq_source = irq_source; <br>
+ <br>
+ list_add_tail(&handler_data_add->list, handler_list); <br>
</blockquote>
<br>
At what place are you deleting completed work items from the <br>
handler_list ? <br>
<br>
Andrey <br>
<br>
</blockquote>
The new allocated work item handler_data_add is put at end of single <br>
list handler_list. It is not deleted, but put into this list. In the <br>
future for same interrupt source handling the previous allocated work <br>
items can be reused. So we do not have to reallocate new work items <br>
if previous interrupts have not been handled by cpu. On other side <br>
system will keep all the allocated work items at run time. Note, the <br>
new work item allocation only happens when cpu has not handled <br>
previous interrupts yet, and new same type interrupts have came. <br>
<br>
Thanks <br>
<br>
Xiaogang <br>
<br>
</blockquote>
I am still confused, how you avoid executing a second time a handler <br>
you previously allocated because first queue_work failed, <br>
you always start iteration from beginning of the list and you never <br>
remove already successfully executed handlers. <br>
<br>
Andrey <br>
<br>
<br>
</blockquote>
Not sure if understand your question. If the first time queuing work <br>
item success there is no second time queuing the same work item. The <br>
second work item is a different one although they use same <br>
handle_hpd_rx_irq. The queued work items are managed by work <br>
queue(queue_work). Work queue knows each queued work item status: still <br>
on queue, running, or exist. I look from already allocated work items to <br>
see if work queue allows me to queue, until find one. If all allocated <br>
work items cannot be queued, allocate a new work item and put it at the <br>
list of allocated work items. <br>
<br>
Thanks <br>
<br>
Xiaogang <br>
<br>
<br>
<br>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">+ <br>
+ INIT_WORK(&handler_data_add->work, dm_irq_work_func); <br>
- if (work) { <br>
- if (!schedule_work(work)) <br>
- DRM_INFO("amdgpu_dm_irq_schedule_work FAILED src %d\n", <br>
- irq_source); <br>
+ if (queue_work(system_highpri_wq, &handler_data_add->work)) <br>
+ DRM_DEBUG("__func__: a work_struct is allocated and <br>
queued, " <br>
+ "src %d\n", irq_source); <br>
+ else <br>
+ DRM_ERROR("__func__: a new work_struct cannot be <br>
queued, " <br>
+ "something is wrong, src %d\n", irq_source); <br>
} <br>
} <br>
</blockquote>
</blockquote>
<br>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<p><br>
</p>
</body>
</html>