[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c1c10203-ffd3-25f9-f2c6-9cee3458aac9@huawei.com>
Date: Tue, 21 Sep 2021 17:22:48 +0100
From: John Garry <john.garry@...wei.com>
To: Fernand Sieber <sieberf@...zon.com>, <will@...nel.org>,
<robin.murphy@....com>
CC: <linux-arm-kernel@...ts.infradead.org>,
<iommu@...ts.linux-foundation.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] iommu/arm-smmu-v3: poll cmdq until it has space
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
Powered by blists - more mailing lists