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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8496FC7619A for ; Mon, 27 Mar 2023 12:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jrDBadc03KusQIW0LVCEAA1OBOIXL8pQiGZZFCSzB38=; b=aVfdILC+H8Pr2J wjkM1RVqBUbkhrHzcLJb5/xOq60NFSmbwj27EvCActej5B3XDhvbA0dmAHwufrt1giqIb7X9PvF8P pj95h1vNxnErANT2L+gjl73abk1RY16oRzEM79HWHOtQMK3HZXlsr0OLhtaw4XTOjahK2kyf5ASU3 tVzbtGE8EiuM4/HGCC4A2lHSpcVNTJd/iquksXRRbDn01J9gWJVCtpjPTR0/OZ3o9ycUnzmPjkuDj v8im+WVekC7VYhHsawl9kXrjvb6xVsirXpjexHjp6pkv7CfcDFz/1RlWRQ30rZFz7JXZNVXmFJ05o ioQ/wfe9T2LhxLydOWfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgliQ-00AqY6-0k; Mon, 27 Mar 2023 12:12:46 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pgliN-00AqXQ-0m for linux-arm-kernel@lists.infradead.org; Mon, 27 Mar 2023 12:12:44 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 77306B810DF; Mon, 27 Mar 2023 12:12:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 989DDC433EF; Mon, 27 Mar 2023 12:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679919160; bh=7QdCp6NY524MCCEFkRdbLdarMOZ/eBcsdu4Aw7O7eg0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZdElahpgOizw+0O6XFvCUaL8CAKAlDednrJD8YDDV851dHMZieMZYY0H/81nSBN+x Xvq6FmkXMubNN7WNEncy49/G86BWe/Mk4aLgghkJL487qYtnd04YgElgGmhPQDnqSr 1ncLNsmLZBUihlycBje/OGLEE8ct3DzP0hG1RC2M0P1yMvIauaktZ/PH/6vFMRnyMM WBLf7rsalxx5Id/o68bNjntDtddsTXHBTBueIMONi89zYD4Mxr1fbaPyLOKRQva5Lg SkNXTvyoUltzxrtAGvoxdwsku7zlMAy24Bf5VMl3jBDtUOH0fZj7S2DL0fp44bEiOQ 3YgS8wiRTpMaQ== Date: Mon, 27 Mar 2023 13:12:34 +0100 From: Will Deacon To: Tomas Krcka Cc: linux-arm-kernel@lists.infradead.org, Robin Murphy , Joerg Roedel , Lu Baolu , Shameer Kolothum , iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iommu/arm-smmu-v3: Fix event queue overflow acknowledgment Message-ID: <20230327121234.GA31342@willie-the-truck> References: <20230308092048.71390-1-krckatom@amazon.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230308092048.71390-1-krckatom@amazon.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230327_051243_430534_5A5380D3 X-CRM114-Status: GOOD ( 22.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Mar 08, 2023 at 09:20:47AM +0000, Tomas Krcka wrote: > When an overflow occurs in the event queue, the SMMU toggles overflow > flag OVFLG in the PROD register. > The evtq thread is supposed to acknowledge the overflow flag by toggling > flag OVACKFLG in the CONS register, otherwise the overflow condition is > still active (OVFLG != OVACKFLG). > > Currently the acknowledge register is toggled after clearing the event > queue but is never propagated to the hardware. It would be done next > time when executing evtq thread. > > The SMMU still adds elements to the queue when the overflow condition is > active but any subsequent overflow information after clearing the event > queue will be lost. > > This change keeps the SMMU in sync as it's expected by design. > > Signed-off-by: Tomas Krcka > Suggested-by: KarimAllah Ahmed > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > index f2425b0f0cd6..acc1ff5ff69b 100644 > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > @@ -1579,6 +1579,7 @@ static irqreturn_t arm_smmu_evtq_thread(int irq, void *dev) > /* Sync our overflow flag, as we believe we're up to speed */ > llq->cons = Q_OVF(llq->prod) | Q_WRP(llq, llq->cons) | > Q_IDX(llq, llq->cons); > + queue_sync_cons_out(q); > return IRQ_HANDLED; > } I think I probably did mean to have something like this, but can we only do the actual h/w update if overflow has occurred? Otherwise I think we're pointlessly writing back the same value most of the time. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel