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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A24E7C433F5 for ; Tue, 21 Sep 2021 17:12:41 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3494C61166 for ; Tue, 21 Sep 2021 17:12:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3494C61166 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lists.linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id E1D7E403FF; Tue, 21 Sep 2021 17:12:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GNCSGinf1-5s; Tue, 21 Sep 2021 17:12:39 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 8CE274020E; Tue, 21 Sep 2021 17:12:39 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 65CCAC000F; Tue, 21 Sep 2021 17:12:39 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1B81AC000D for ; Tue, 21 Sep 2021 17:12:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1806760C06 for ; Tue, 21 Sep 2021 17:12:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=amazon.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cuKMJ6r1UyYD for ; Tue, 21 Sep 2021 17:12:37 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from smtp-fw-6001.amazon.com (smtp-fw-6001.amazon.com [52.95.48.154]) by smtp3.osuosl.org (Postfix) with ESMTPS id 57C766080D for ; Tue, 21 Sep 2021 17:12:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1632244357; x=1663780357; h=from:to:cc:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:subject; bh=16YU7KkjpiOEAKPRsxoOGSp6GaxRIbNZG8DW2Dc8Nxc=; b=Jyjo6k/LTyjXmUSUThCLMCe+36gC6HfzJ/Uc/z2iuIEP/Lk/HO6sRkti Rr4OFuDgxJyIrUNai9VQueFt1tlVnS8Eg1mEgKlWaICQJRl6P7bo/0vN3 B2Nf62YwG5V+ont55l2GJhT9h1x7pW/aj4TcenD/GNTmwilLl1iVgySc9 g=; X-IronPort-AV: E=Sophos;i="5.85,311,1624320000"; d="scan'208";a="143494894" Subject: Re: [PATCH] iommu/arm-smmu-v3: poll cmdq until it has space Thread-Topic: [PATCH] iommu/arm-smmu-v3: poll cmdq until it has space Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-iad-1d-1c3c2014.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-6001.iad6.amazon.com with ESMTP; 21 Sep 2021 17:12:29 +0000 Received: from EX13D03EUA004.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-iad-1d-1c3c2014.us-east-1.amazon.com (Postfix) with ESMTPS id 947D5CB307; Tue, 21 Sep 2021 17:12:27 +0000 (UTC) Received: from EX13D03EUA004.ant.amazon.com (10.43.165.93) by EX13D03EUA004.ant.amazon.com (10.43.165.93) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 21 Sep 2021 17:12:26 +0000 Received: from EX13D03EUA004.ant.amazon.com ([10.43.165.93]) by EX13D03EUA004.ant.amazon.com ([10.43.165.93]) with mapi id 15.00.1497.023; Tue, 21 Sep 2021 17:12:26 +0000 To: John Garry , "will@kernel.org" , "robin.murphy@arm.com" Thread-Index: AQHXrt3+ZWYnaFhO3kmkBSrWrVwBSauurBkAgAAMX78= Date: Tue, 21 Sep 2021 17:12:25 +0000 Message-ID: <1632244345526.44611@amazon.com> References: <20210921114338.1144521-1-sieberf@amazon.com>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.43.160.90] MIME-Version: 1.0 Cc: "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: "Sieber, Fernand via iommu" Reply-To: "Sieber, Fernand" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" Hi John, > But is the polarity really correct? That is, if we don't have space, > then exit with success (the function to check for space). You are absolutely correct, this is a mistake that I made as I was resolving conflicts while porting this patch to iommu/next from 5.4 where I implemented and tested it. It should be: > - if (!queue_full(llq)) > + if (queue_has_space(llq, n)) > what is llq->state->val? This is an other oversight for the same reason, llq->state->val has since then been renamed llq->val Will fix both of these in the next revision. Thanks and kind regards, --Fernand ________________________________________ From: John Garry Sent: Tuesday, September 21, 2021 18:22 To: Sieber, Fernand; will@kernel.org; robin.murphy@arm.com Cc: linux-arm-kernel@lists.infradead.org; iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org Subject: RE: [EXTERNAL] [PATCH] iommu/arm-smmu-v3: poll cmdq until it has space CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. On 21/09/2021 12:43, Fernand Sieber wrote: > do { I didn't follow the full logic of this change yet ... > llq->val = READ_ONCE(cmdq->q.llq.val); > - if (!queue_full(llq)) > + if (!queue_has_space(llq, n)) But is the polarity really correct? That is, if we don't have space, then exit with success (the function to check for space). > break; > > + /* > + * We must return here even if there's no space, because the producer > + * having moved forward could mean that the last thread observing the > + * SMMU progress has allocated space in the cmdq and moved on, leaving > + * us in this waiting loop with no other thread updating > + * llq->state->val. what is llq->state->val? > + */ > + if (llq->prod != prod) > + return -EAGAIN; > + > ret = queue_poll(&qp); Thanks, John _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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 X-Spam-Level: X-Spam-Status: No, score=-4.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_ALL,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1053C433F5 for ; Tue, 21 Sep 2021 17:14:54 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B4BA661002 for ; Tue, 21 Sep 2021 17:14:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B4BA661002 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:In-Reply-To:References: Message-ID:Date:CC:To:From:Subject:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Fc2zwnCyzhuwRIPWJNl0J8e/8SntRHFhULseILCakFg=; b=fAU5Mz9fNQNsBL raYskvpiSevBC9LDFv6uPW/H/cM0rRwGNfX1bOTPLw++FwI71B6B0AG1+IalZsx5u8YEtA2gzHEP/ duljFyCuMR5pXumBQS8lmV7n284+e+SJs9vWUJ2haEKFKN6xEHiCH/E1DZK3jhoIwRUgEzG242dW5 iAT4BkOonfMgPAgpexx5VfRvNdChvH2gLVBdRxXzmLkt27pAdvt+YAthfJPDjF2ixrQZcHaLXoQyX caaDdmw3ukFtwbeJjZuRJhedw+dk//x79CKpB83moXafuWToKhxLoatLTquVArzUhMcHMLjJ6ctYE p4D8JsuPkzLhpMAmyGOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSjK7-005Iqz-J2; Tue, 21 Sep 2021 17:12:51 +0000 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSjK3-005Ioc-Gj for linux-arm-kernel@lists.infradead.org; Tue, 21 Sep 2021 17:12:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1632244368; x=1663780368; h=from:to:cc:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:subject; bh=16YU7KkjpiOEAKPRsxoOGSp6GaxRIbNZG8DW2Dc8Nxc=; b=Gztj9Hsmff3oiH1T4Q1emTxbGVa2D8Xo97KtgUTsbu5sodm2GTynrbOx Hs0yyxK2Azhe19RKPDofWTHeaSEWN/CNuFMpt87giX6ayQOqJWz7qEeJg k02K8AMqvV2MB2MY4dsxoovCkjc9GAaszQ5W3k1kLvplPcl9H1XZ0//uU o=; X-IronPort-AV: E=Sophos;i="5.85,311,1624320000"; d="scan'208";a="143494894" Subject: Re: [PATCH] iommu/arm-smmu-v3: poll cmdq until it has space Thread-Topic: [PATCH] iommu/arm-smmu-v3: poll cmdq until it has space Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-iad-1d-1c3c2014.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-6001.iad6.amazon.com with ESMTP; 21 Sep 2021 17:12:29 +0000 Received: from EX13D03EUA004.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-iad-1d-1c3c2014.us-east-1.amazon.com (Postfix) with ESMTPS id 947D5CB307; Tue, 21 Sep 2021 17:12:27 +0000 (UTC) Received: from EX13D03EUA004.ant.amazon.com (10.43.165.93) by EX13D03EUA004.ant.amazon.com (10.43.165.93) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 21 Sep 2021 17:12:26 +0000 Received: from EX13D03EUA004.ant.amazon.com ([10.43.165.93]) by EX13D03EUA004.ant.amazon.com ([10.43.165.93]) with mapi id 15.00.1497.023; Tue, 21 Sep 2021 17:12:26 +0000 From: "Sieber, Fernand" To: John Garry , "will@kernel.org" , "robin.murphy@arm.com" CC: "linux-arm-kernel@lists.infradead.org" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" Thread-Index: AQHXrt3+ZWYnaFhO3kmkBSrWrVwBSauurBkAgAAMX78= Date: Tue, 21 Sep 2021 17:12:25 +0000 Message-ID: <1632244345526.44611@amazon.com> References: <20210921114338.1144521-1-sieberf@amazon.com>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.43.160.90] MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210921_101247_731522_BB9296E9 X-CRM114-Status: GOOD ( 16.31 ) 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 Hi John, > But is the polarity really correct? That is, if we don't have space, > then exit with success (the function to check for space). You are absolutely correct, this is a mistake that I made as I was resolving conflicts while porting this patch to iommu/next from 5.4 where I implemented and tested it. It should be: > - if (!queue_full(llq)) > + if (queue_has_space(llq, n)) > what is llq->state->val? This is an other oversight for the same reason, llq->state->val has since then been renamed llq->val Will fix both of these in the next revision. Thanks and kind regards, --Fernand ________________________________________ From: John Garry Sent: Tuesday, September 21, 2021 18:22 To: Sieber, Fernand; will@kernel.org; robin.murphy@arm.com Cc: linux-arm-kernel@lists.infradead.org; iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org Subject: RE: [EXTERNAL] [PATCH] iommu/arm-smmu-v3: poll cmdq until it has space CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. On 21/09/2021 12:43, Fernand Sieber wrote: > do { I didn't follow the full logic of this change yet ... > llq->val = READ_ONCE(cmdq->q.llq.val); > - if (!queue_full(llq)) > + if (!queue_has_space(llq, n)) But is the polarity really correct? That is, if we don't have space, then exit with success (the function to check for space). > break; > > + /* > + * We must return here even if there's no space, because the producer > + * having moved forward could mean that the last thread observing the > + * SMMU progress has allocated space in the cmdq and moved on, leaving > + * us in this waiting loop with no other thread updating > + * llq->state->val. what is llq->state->val? > + */ > + if (llq->prod != prod) > + return -EAGAIN; > + > ret = queue_poll(&qp); Thanks, John _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B46BCC433EF for ; Tue, 21 Sep 2021 17:12:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94BDA61002 for ; Tue, 21 Sep 2021 17:12:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230079AbhIUROH (ORCPT ); Tue, 21 Sep 2021 13:14:07 -0400 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]:48535 "EHLO smtp-fw-6001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229622AbhIUROF (ORCPT ); Tue, 21 Sep 2021 13:14:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1632244357; x=1663780357; h=from:to:cc:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:subject; bh=16YU7KkjpiOEAKPRsxoOGSp6GaxRIbNZG8DW2Dc8Nxc=; b=Jyjo6k/LTyjXmUSUThCLMCe+36gC6HfzJ/Uc/z2iuIEP/Lk/HO6sRkti Rr4OFuDgxJyIrUNai9VQueFt1tlVnS8Eg1mEgKlWaICQJRl6P7bo/0vN3 B2Nf62YwG5V+ont55l2GJhT9h1x7pW/aj4TcenD/GNTmwilLl1iVgySc9 g=; X-IronPort-AV: E=Sophos;i="5.85,311,1624320000"; d="scan'208";a="143494894" Subject: Re: [PATCH] iommu/arm-smmu-v3: poll cmdq until it has space Thread-Topic: [PATCH] iommu/arm-smmu-v3: poll cmdq until it has space Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-iad-1d-1c3c2014.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-6001.iad6.amazon.com with ESMTP; 21 Sep 2021 17:12:29 +0000 Received: from EX13D03EUA004.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-iad-1d-1c3c2014.us-east-1.amazon.com (Postfix) with ESMTPS id 947D5CB307; Tue, 21 Sep 2021 17:12:27 +0000 (UTC) Received: from EX13D03EUA004.ant.amazon.com (10.43.165.93) by EX13D03EUA004.ant.amazon.com (10.43.165.93) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 21 Sep 2021 17:12:26 +0000 Received: from EX13D03EUA004.ant.amazon.com ([10.43.165.93]) by EX13D03EUA004.ant.amazon.com ([10.43.165.93]) with mapi id 15.00.1497.023; Tue, 21 Sep 2021 17:12:26 +0000 From: "Sieber, Fernand" To: John Garry , "will@kernel.org" , "robin.murphy@arm.com" CC: "linux-arm-kernel@lists.infradead.org" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" Thread-Index: AQHXrt3+ZWYnaFhO3kmkBSrWrVwBSauurBkAgAAMX78= Date: Tue, 21 Sep 2021 17:12:25 +0000 Message-ID: <1632244345526.44611@amazon.com> References: <20210921114338.1144521-1-sieberf@amazon.com>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.43.160.90] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi John,=0A= =0A= > But is the polarity really correct? That is, if we don't have space,=0A= > then exit with success (the function to check for space).=0A= =0A= You are absolutely correct, this is a mistake that I made as I was resolvin= g conflicts while porting this patch to iommu/next from 5.4 where I impleme= nted and tested it.=0A= It should be:=0A= =0A= > - if (!queue_full(llq))=0A= > + if (queue_has_space(llq, n))=0A= =0A= =0A= > what is llq->state->val?=0A= =0A= This is an other oversight for the same reason, llq->state->val has since t= hen been renamed llq->val=0A= =0A= Will fix both of these in the next revision.=0A= Thanks and kind regards,=0A= =0A= --Fernand=0A= =0A= ________________________________________=0A= From: John Garry =0A= Sent: Tuesday, September 21, 2021 18:22=0A= To: Sieber, Fernand; will@kernel.org; robin.murphy@arm.com=0A= Cc: linux-arm-kernel@lists.infradead.org; iommu@lists.linux-foundation.org;= linux-kernel@vger.kernel.org=0A= Subject: RE: [EXTERNAL] [PATCH] iommu/arm-smmu-v3: poll cmdq until it has s= pace=0A= =0A= CAUTION: This email originated from outside of the organization. Do not cli= ck links or open attachments unless you can confirm the sender and know the= content is safe.=0A= =0A= =0A= =0A= On 21/09/2021 12:43, Fernand Sieber wrote:=0A= > do {=0A= =0A= I didn't follow the full logic of this change yet ...=0A= =0A= > llq->val =3D READ_ONCE(cmdq->q.llq.val);=0A= > - if (!queue_full(llq))=0A= > + if (!queue_has_space(llq, n))=0A= =0A= But is the polarity really correct? That is, if we don't have space,=0A= then exit with success (the function to check for space).=0A= =0A= > break;=0A= >=0A= > + /*=0A= > + * We must return here even if there's no space, because th= e producer=0A= > + * having moved forward could mean that the last thread obs= erving the=0A= > + * SMMU progress has allocated space in the cmdq and moved = on, leaving=0A= > + * us in this waiting loop with no other thread updating=0A= > + * llq->state->val.=0A= =0A= what is llq->state->val?=0A= =0A= > + */=0A= > + if (llq->prod !=3D prod)=0A= > + return -EAGAIN;=0A= > +=0A= > ret =3D queue_poll(&qp);=0A= =0A= Thanks,=0A= John=0A=