Re: A question about state machine function state_next()

From: Baoquan He
Date: Mon Jun 01 2015 - 10:02:05 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/