From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32C11C433EF for ; Fri, 4 Feb 2022 11:34:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358426AbiBDLep (ORCPT ); Fri, 4 Feb 2022 06:34:45 -0500 Received: from 8bytes.org ([81.169.241.247]:53978 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358414AbiBDLen (ORCPT ); Fri, 4 Feb 2022 06:34:43 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 83EDA491; Fri, 4 Feb 2022 12:34:41 +0100 (CET) Date: Fri, 4 Feb 2022 12:34:38 +0100 From: Joerg Roedel To: John Garry Cc: iommu@lists.linux-foundation.org, Joerg Roedel , linux-kernel@vger.kernel.org, Maxim Levitsky , Will Deacon Subject: Re: [PATCH] iommu/amd: Fix loop timeout issue in iommu_ga_log_enable() Message-ID: References: <20220131161749.4021-1-joro@8bytes.org> <48a674ae-f5cd-fc06-4505-6d863e6dad69@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48a674ae-f5cd-fc06-4505-6d863e6dad69@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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