From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB478392815 for ; Fri, 3 Apr 2026 14:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775227883; cv=none; b=lPRF3prb3udWblPC+7BzmeBog4ALWslf1vFahDtTtZoWCLpuYP2Wj+qdLVgBx4iyYLJqOYCCb/tEkSFuWuK98gRZphClrvvaVwI85B49/Y6/9R1diKtRc9h5YxhXngahtEeW5kZNvuPk7McBOJszd6Av56bXKCNJjzBNTjwpYhk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775227883; c=relaxed/simple; bh=lzi8vanqoY23RZvoxmfl6DfLoVT0+U5Of4Av0npR8KQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=nDoJZIpM8EMJAe48aptnJ0gA5JX5Erd8nyDlDIbi8yTqcv+D5GjBn+Zbu7SWQwIjzqaoQtenFB2sXg/ICXVHtkeJ2dzLkjx4McwXJ7UfZSAFOFyzCrvVaNubbszT9NUXk2Pqm2xDUbGtyidnkDX0CxoHppLb9PV/2y+1wG79YPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--joonwonkang.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=KFEIvQTc; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--joonwonkang.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="KFEIvQTc" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2b0b339b8dbso20410945ad.0 for ; Fri, 03 Apr 2026 07:51:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775227881; x=1775832681; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=UsueJAB8iWMZmH12hTqYKPYVxfUoBPtsPuD5qctzJns=; b=KFEIvQTcxayFA/382PfH+WayA5yJekNqxGLlSBajU76J27sEf46lei5Xn8zQp6OeUH KcZ9BhTcHPVTIclssmpgmbDtjcubOh9DafzEdXeOdKl7gHH0FeWYqI5NSm3cpOKbWEr9 g3dDWzcg4VmaapDUKTcDPLUr5KMiKBFnjnA6Ch7XDYdA3EUDl0gJvSYnjhkA83Ue/kYi 6T+U7b9OPCkDeff3OtbBCIpxETm7ZUxBlUeFEVKoKWg8ar4InveULdQjyVpD5zKBWJwu bIJDhSlOvohto8w6zSO9T1c2TlYp/Puc6DPLAscxTH5dNXTpCF2kErmxfqJoaPdroSJ+ kU4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775227881; x=1775832681; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=UsueJAB8iWMZmH12hTqYKPYVxfUoBPtsPuD5qctzJns=; b=WZx2BbqXZsWjI2kPXAT2ZcN5A7D+JvinXWlVSFN20He4PMA0mfjlh5j8Xi5VxSKXoF AcUEUV+f96sO3ExCNFoKGm0QpsgM4zwhOiOyX0fpSo3L9YSOpP5myhTt7ZSOsuED4zt7 SIjiYOoU9nnO3myE9Jmxfy511OWsC671LEdfZr/dDdCcml8g3zqTnEuEEiE0/5VkOyqe maDnX82CUU3dCM7z6po8H+l3KX6yysvXogsoG+TvJScwS0G1w7RX3e3A26j2E9Jl0kAw seNFEVrNRUoxBfq0ys5NmMMMLMDz5HN4/FSPIE6JjGnfeoQ8g358WodXJPMzclBmiouK u7HA== X-Forwarded-Encrypted: i=1; AJvYcCUprXA3stQPSHRvdihZeYZADqD01mQH9PBSIbqYPGRCmwtuqpiBG0+2EQFoEBx6YmTyJ19OTD9baV4BGQ==@vger.kernel.org X-Gm-Message-State: AOJu0YwHxvbN0hIkzrQmVe5v28YsODG5dCZ4KOoMh9CmOy2FC/2A7Bi+ rHYGEw5zdFCwpKPqvK5Rg4y2WfUxWZXkL4hskys2mz96kayLNZpI8MjBgpSA7DHtYUVnXFruFwN 9bMZUhPVCNYoTr9oPiwDwkChf6g== X-Received: from plblw8.prod.google.com ([2002:a17:903:2ac8:b0:2b0:af9b:aa3c]) (user=joonwonkang job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:2ac5:b0:2b2:42da:25cc with SMTP id d9443c01a7336-2b28163ad55mr35530115ad.1.1775227881118; Fri, 03 Apr 2026 07:51:21 -0700 (PDT) Date: Fri, 3 Apr 2026 14:51:18 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-tegra@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.53.0.1213.gd9a14994de-goog Message-ID: <20260403145119.2581034-1-joonwonkang@google.com> Subject: Re: [PATCH v3 1/2] mailbox: Use per-thread completion to fix wrong completion order From: Joonwon Kang To: jassisinghbrar@gmail.com Cc: angelogioacchino.delregno@collabora.com, jonathanh@nvidia.com, joonwonkang@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-tegra@vger.kernel.org, matthias.bgg@gmail.com, stable@vger.kernel.org, thierry.reding@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > On Thu, Apr 2, 2026 at 12:07=E2=80=AFPM Joonwon Kang wrote: > > > > Previously, a sender thread in mbox_send_message() could be woken up at > > a wrong time in blocking mode. It is because there was only a single > > completion for a channel whereas messages from multiple threads could b= e > > sent in any order; since the shared completion could be signalled in an= y > > order, it could wake up a wrong sender thread. > > > > This commit resolves the false wake-up issue with the following changes= : > > - Completions are created just as many as the number of concurrent send= er > > threads > > - A completion is created on a sender thread's stack > > - Each slot of the message queue, i.e. `msg_data`, contains a pointer t= o > > its target completion > > - tx_tick() signals the completion of the currently active slot of the > > message queue > > > I think I reviewed it already or is this happening on > one-channel-one-client usage? Because mailbox api does not support > channels shared among multiple clients. Yes, this patch is handling the one-channel-one-client usage but when that single channel is shared between multiple threads. From my understanding, t= he discussion back then ended with how to circumvent the issue rather than whe= ther we will eventually solve this in the mailbox framework or not, and if yes, = how we will, and if not, why. I think it should still be resolved in the framew= ork for the reasons in the cover letter. Could you help to give a second review with regards to those aspects? Thanks, Joonwon Kang