Repository navigation
Conversation
b475d02 to
70067f0
Compare
13c33b2 to
8463d7f
Compare
|
@plbossart Yes, and I update my PR according to your suggestion. However, I have a question regardingHDA_DSP_REG_ADSPIS2. Please see #1412 (comment). Currently, I call |
8463d7f to
f65f021
Compare
|
@plbossart I updated my PR. The main difference is that I check interrupt and set irq_event flag at hda_dsp_ipc_irq_handler(). So we will need to check interrupt only if the irq_event flag is not set. And we will only call |
17363cf to
5d0e8ef
Compare
|
I checked windows driver which does the same job. |
60c0523 to
f89e07c
Compare
5d0e8ef to
a575044
Compare
plbossart
left a comment
There was a problem hiding this comment.
@bardliao good work, but before we start changing the SoundWire handing of interrupts, we should first merge the IPC and stream interrupts on top of topic/sof-dev. If the end-goal is to merge all interrupt handlers as a single one, the first order of business is to merge the two non-SoundWire ones and have a full-cycle of validation on that topic alone.
See also additional comments below
|
|
||
| return false; | ||
| } | ||
|
|
There was a problem hiding this comment.
because SoundWire and ASoC are handled as separate subsystems, we need a patch that will modify the soundwire interfaces, and a separate on that will modify the ASoC parts.
| u32 irq_status; | ||
|
|
||
| spin_lock(&sdev->hw_lock); | ||
| spin_lock_irq(&sdev->hw_lock); |
There was a problem hiding this comment.
why do we need a change here? is this is because we use this routine both from handler and interrupt threads, than you need to add a comment.
There was a problem hiding this comment.
Yes, is_ipc_irq() will be called on interrupt thread and handler, and we don't want another interrupt to lock it while it is locked.
| struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; | ||
| int ret = IRQ_NONE; | ||
|
|
||
| sdev->irq_event = 0; |
There was a problem hiding this comment.
we can't do this, the irq_event may be reset before it's used in a thread. I think we have no choice but to re-read the hardware registers in the thread.
There was a problem hiding this comment.
Thanks. @plbossart I didn't notice that. Maybe we can clear each bit in the irq thread the interrupt is handled.
|
|
||
| /* IPC message ? */ | ||
| if (is_ipc_irq(sdev)) { | ||
| /* disable IPC interrupt at is_ipc_irq() */ |
There was a problem hiding this comment.
it's quite ugly, we will use is_ipc_irq() multiple times (in the handler and in the thread), so we should only disable the interrupt once.
There was a problem hiding this comment.
That's why we have irq_event :) Ideally, we won't call is_ipc_irq() if SOF_IRQ_IPC is set. Also, I think we need to disable irq, too if we get an interrupt on irq thread.
| sdw_intel_thread(irq, hdev->sdw); | ||
| else if (hdev->sdw && is_sdw_intel_irq(hdev->sdw)) { | ||
| hda_sdw_int_enable(sdev, false); | ||
| sdw_intel_thread(irq, hdev->sdw); |
There was a problem hiding this comment.
sorry. I don't understand the last two cases here. Aren't they exactly the same thing?
Also what's the point of using the irq_events since we will also test for is_ipc_irq and is_sdw_intel_irq() in the thread?
There was a problem hiding this comment.
sorry. I don't understand the last two cases here. Aren't they exactly the same thing?
if (sdev->irq_event & SOF_IRQ_SDW) means is_sdw_intel_irq() return true in the handler, and we already disable interrupt there. So we don't need to disable interrupt there. else means is_sdw_intel_irq() return false. So we test is_sdw_intel_irq() here again to make sure we will handle sdw interrupt if there is any. And we need to disable sdw interrupt here since we didn't disable it in the handler.
Also what's the point of using the irq_events since we will also test for is_ipc_irq and is_sdw_intel_irq() in the thread?
We don't have to test is irq again in the thread If irq_event is set. i.e. We will only test is irq when the test result is false on irq handler.
7b348fd to
85aa830
Compare
a575044 to
614fc7c
Compare
@plbossart Agree, let's focus on merging IPC and stream interrupts first. |
989e38e to
ac926ce
Compare
|
So this will depend on merging IPC and stream interrupts, RFC in #1483 |
So we can use single irq to handle both ipc and sdw interrupts. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
614fc7c to
0ccfdb4
Compare
@plbossart Yes, let's close this one. |
So we can use single irq to handle both ipc and sdw interrupts.
Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com