Re: [PATCH] iommu/amd: Fix loop timeout issue in iommu_ga_log_enable()

From: Joerg Roedel
Date: Fri Feb 04 2022 - 06:34:46 EST


On Mon, Jan 31, 2022 at 05:06:03PM +0000, John Garry wrote:
> > diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
> > index dc338acf3338..d2e09d53851f 100644
> > --- a/drivers/iommu/amd/init.c
> > +++ b/drivers/iommu/amd/init.c
> > @@ -834,6 +834,7 @@ static int iommu_ga_log_enable(struct amd_iommu *iommu)
> > status = readl(iommu->mmio_base + MMIO_STATUS_OFFSET);
> > if (status & (MMIO_STATUS_GALOG_RUN_MASK))
> > break;
> > + udelay(1);
>
> Maybe readl_relaxed_poll_timeout_atomic() could be used instead

I sent another version of this patch which uses
readl_poll_timeout_atomic(), but it didn't fix the issue. I take this
approach for now and leave using the helper as a future improvement.

Thanks,

Joerg