Messages in this thread | | | Date | Mon, 1 Jun 2015 22:01:51 +0800 | From | Baoquan He <> | Subject | Re: A question about state machine function state_next() |
| |
On 06/01/15 at 02:01pm, Joerg Roedel wrote: > On Mon, Jun 01, 2015 at 07:18:02PM +0800, Baoquan He wrote: > > Checked the code again, it may be a code bug if this is done in > > device_dma_ops_init(). Since this is called in > > amd_iommu_init_dma_ops()<-amd_iommu_init_dma(). And amd_iommu_init_dma() > > is only called in case IOMMU_INTERRUPTS_EN code block. According to the > > code flow if I understand correctly, it can't be here at boot stage. > > state_next() will change the state according to the calling times. And > > in amd iommu only four times to call iommu_go_to_state, it can't go to > > IOMMU_PCI_INIT and the after cases. > > > > I am not sure if my understanding is correct, or I missed something. > > You probably missed the loop in iommu_go_to_state() which will call > state_next() until it reaches either the requested state or an error > state.
Ah, right. IOMMU_INITIALIZED can cover all left cases until IOMMU_ENABLED. Many thanks.
Thanks Baoquan
| |