From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385971; b=OILiEQxPUB2OOp71KFFjIyWCAfkBjFuPDXIt/tw0pbgk5ujVbHIQTwF0yobXcQtbzDND aVVwxkgaLNXghZrhznNl9m9QdpzHmQd84z+jZSL6v6hCIiCzx2ZuO08/Z1EXlG5CgA2Lh XY3ilZQRJoU94GELcFWIQZipUeVZRW7GszUyjfrX/ltyGc+fNCyAOTXGFpllOvLxcNV9n xUjKOk2l/9VTTvCatxPZx9f6GCVRXwfmf7VYVYyFT+oRUh2K/dlre+MbRlwj1QCe2l+mM lg86b1aYyrXI4xT4Lzp0ulk9BIjtyAvozY+4IJK20mq6NwqmJ7dtnJbR9rXjOLqIAEg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385971; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=xRs4+WXEkx/iR4bZbQfSQ7wFMquKHQ8yILGrLFkcdPo=; b=W1I2AiRg/y1TKlcnkhYbfCzd/Y6cssiFK6sskg0XXj1YqS2PWOVholclNHChVL88T6hQ Oit48bEEoR0+ODQbg4xqatSwXCh9MPwR51qhjJ34KAPfx2IXOcSsgNn75ThVor3l8AitP tsc/Pasy4GZtv9KKaa3UDszmbcS7v4TurEko2glma/qcqBFmYe6UcTwD0flaGU9vM/6cv IJIDeW4MrW3B4DqBQlpCJhE2FcojI2nV8ld8j/Ty2hb26xWmNiP08L19YJQKnU5vy9N4M MTYhxEpFvJbE3B4D6dybzH11XIIAPOV0SnMPyYcs6pgVUgN28o3Plry/se8Hu6VqvnQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=d2Ri1Vy+; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF510606A322 for ; Fri, 4 Dec 2026 12:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=d2Ri1Vy+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B16A1F000C2; Fri, 4 Dec 2026 12:06:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796385971; bh=xRs4+WXEkx/iR4bZbQfSQ7wFMquKHQ8yILGrLFkcdPo=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=d2Ri1Vy+zGurWA91m/eM06qQNqDx7xzc/PgsoxywDvkXuaXoYYn2r8NF7PSc9UQqg avsypos7kGa7p60UFNQu+vYJ9FrqNdXFdMlUtPHRoMoeVGlSXt7R8mOk1Nkz2kfsjr MS3r8Q+Jk3U8QZVbyIizp6wNqjiFo7Lx7rBKvtBpTarkaFyGYkxMo62OMTAbStg63O I0GzIM9oHfz2afm3lSX79XSa450hNs070lpn9OGVzA1UvHMfjxWksMYpZMuRS2GcNA y0TiGPs2WE1tTsEMvl2bz60myIpw3KLzc+i6U59n9u79S5yRaSszZrCims8JfV9cso Kk8FEznHBeSCw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 2/5] RISC-V: Prevent interrupt when accessing MPXY shared memory Reply-To: sashiko-reviews@lists.linux.dev To: "Anup Patel" Cc: linux-clk@vger.kernel.org In-Reply-To: <20261204111504.3362889-3-anup.patel@oss.qualcomm.com> References: <20261204111504.3362889-1-anup.patel@oss.qualcomm.com> <20261204111504.3362889-3-anup.patel@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 12:06:11 +0000 X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] riscv: wrong -ENOSPC errno in sbi_mpxy_send_message_*() when inactive -- commit 364fd80b5b3da8f11006110b87538af023c33875 Author: Anup Patel RISC-V: Prevent interrupt when accessing MPXY shared memory This commit replaces get_cpu()/put_cpu() with guard(irqsave)() in the SBI MPXY helpers so local interrupts cannot re-enter and clobber the per-CPU shared memory buffer during an SBI call. > diff --git a/arch/riscv/kernel/sbi_mpxy.c b/arch/riscv/kernel/sbi_mpxy.c > index c1c5058d32525..4b25e5dc7fd62 100644 > --- a/arch/riscv/kernel/sbi_mpxy.c > +++ b/arch/riscv/kernel/sbi_mpxy.c [ ... ] > @@ -166,18 +171,19 @@ int sbi_mpxy_send_message_with_resp(u32 channel_id,= u32 msg_id, > void *rx, unsigned long max_rx_len, > unsigned long *rx_len) > { > - struct mpxy_local *mpxy =3D this_cpu_ptr(&mpxy_local); > + struct mpxy_local *mpxy; > unsigned long rx_bytes; > struct sbiret sret; > =20 > - if (!mpxy->shmem_active) > - return -ENODEV; > if (!tx && tx_len) > return -EINVAL; > if (mpxy_shmem_size < tx_len) > return -ENOSPC; > =20 > - get_cpu(); > + guard(irqsave)(); > + mpxy =3D this_cpu_ptr(&mpxy_local); > + if (!mpxy->shmem_active) > + return -ENODEV; [Severity: Low] Does moving the mpxy->shmem_active check after mpxy_shmem_size < tx_len cause sbi_mpxy_send_message_with_resp() to return -ENOSPC instead of -ENODEV when MPXY is inactive? When SBI MPXY is unavailable or uninitialized, mpxy_shmem_size is 0 and mpxy->shmem_active is false. A call with a non-zero tx_len now hits mpxy_shmem_size < tx_len first and returns -ENOSPC, inconsistent with the tx_len =3D=3D 0 path and the other sbi_mpxy_*() helpers. sbi_mpxy_send_message_without_resp() has the same regression. Moving the mpxy_shmem_size < tx_len check after !mpxy->shmem_active in both functions restores consistent -ENODEV reporting. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204111504.3362= 889-1-anup.patel@oss.qualcomm.com?part=3D2