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=1796400700; b=Ltw5tHXSay7PnyUamhyM0faKbOspsCetoI7KoVmn6AKtA0YZZG7F6wL1sAMA4yd4FjRG Y32/o/vvitDjuqyz5VHEfELEth3diguzmTmPSUlGS4EXH/XYS0whSJx3HkUQKJBNSkLmS 0sQ8WSxBceFsx8G4pAAz0fMT1EhqyNC5hu8GWDSH7J/+1Hgq+T/n22oONZZf7fz2x+NrH hgHoNQxSytwMSZ9es2E59bjgD7IbwfkrXY4gY41mLaw/YMuHk+F/6lfbhSEu7JW890528 kXh5gVZNCU/RzVGwd5OJJ9HlGGsdEQqhqxbRobgatXgcTdnvwlPpqRVfazP6IV1tf2g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796400700; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=bZOGSKrwl9zu8J517C10zkBNWBSndKtGe9AZF0FSyKc=; b=KL6HOZBc3YiNFSO3jQ7m/nPK+4ViWR38GD4hHCk5gwt01GSfnZr+wpTk70Fp1DJzxmbY eJfFFrqnQbYit3LwGCCNzqEp4bJwPiZS8impSyQ6uxsRXYvYiqo56qmyan3WjLq8MaQlI OVSZQCwTp/tBF3CPFst4mEiZbFGozk1OIEHwdPd7nMDDOa6HJUh7rHVnkZpuN0x8kspxO 6CIbcI+krNXG5kv/FfvRQnszoZD6rig/Q3J42R05xz0k7Ms4oa0k19ICUSWX5GBoPpDSG h2wHrs5uuYmQG3REh3e4hn6x9C8QCCbe0OhT01P2XXF5lrWkwdSqNZ+sVHxUbKVC/sg== 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=XetR6+se; 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 C8FD5606A332 for ; Fri, 4 Dec 2026 16:11:40 +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=XetR6+se Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AD141F00897; Fri, 4 Dec 2026 16:11:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796400700; bh=bZOGSKrwl9zu8J517C10zkBNWBSndKtGe9AZF0FSyKc=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=XetR6+seXzrdj9qNmHBUeMr2sfviNjwL97uO3FumYpbqjBzZMUzB4YNMlNzM6uupm wxcAQ+abUDdm65aN9z9Ed5r6gGEy/ZkPjW0MOjwewnLN2I7QQ2+phHcEdt+CvS+b1o olhF8YRH4HIZ/fAWucNpKNYt43x2Rdrj7+DUsfwPNrYxlS+N9wZyRkodeXnk4m7HOm 9+9kmpQSy9yFGZbtcLaf3XsxFZw7TyGn2ghwEfGwRc/qO9iBP7s57YESLHXUtbmFxJ 5vuC8KSnhpbP96KMbvnPknXnoysYVuAEf0NUlvXWYhqiHgcqM7Rmiw4nVN+fSKC+65 tgArT6ywtciQw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net-next 3/3] net: wwan: qcom_bam_dmux: enable QMAP if supported by the modem Reply-To: sashiko-reviews@lists.linux.dev To: "Vishnu Santhosh" Cc: dmaengine@vger.kernel.org, vkoul@kernel.org, Frank.Li@kernel.org In-Reply-To: <20261203-qcom-bam-dmux-qmap-v1-3-abc2e80a03af@oss.qualcomm.com> References: <20261203-qcom-bam-dmux-qmap-v1-0-abc2e80a03af@oss.qualcomm.com> <20261203-qcom-bam-dmux-qmap-v1-3-abc2e80a03af@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 16:11:40 +0000 X-Mailing-List: dmaengine@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 2 potential issues to consider: - [Medium] wwan: qcom_bam_dmux: remote_channels published before remote_qmap - [Medium] wwan: qcom_bam_dmux: unconditional QMAP OPEN may break Raw-IP userspace -- commit 062c491a01057c87d44c5e0253e74c1080c4ce69 Author: Vishnu Santhosh net: wwan: qcom_bam_dmux: enable QMAP if supported by the modem This commit records whether the modem sets BAM_DMUX_OPEN_QMAP in each channel's OPEN command and sets that bit in outgoing OPEN commands for those channels. > diff --git a/drivers/net/wwan/qcom_bam_dmux.c b/drivers/net/wwan/qcom_bam= _dmux.c > index a7d05b1b8b123..9e82a30b16a68 100644 > --- a/drivers/net/wwan/qcom_bam_dmux.c > +++ b/drivers/net/wwan/qcom_bam_dmux.c [ ... ] > @@ -247,6 +251,8 @@ static int bam_dmux_send_cmd(struct bam_dmux_netdev *= bndev, u8 cmd) > hdr->magic =3D BAM_DMUX_HDR_MAGIC; > hdr->cmd =3D cmd; > hdr->ch =3D bndev->ch; > + if (cmd =3D=3D BAM_DMUX_CMD_OPEN && test_bit(bndev->ch, dmux->remote_qm= ap)) > + hdr->signal =3D BAM_DMUX_OPEN_QMAP; [Severity: Medium] Can unconditionally setting BAM_DMUX_OPEN_QMAP break existing userspace that uses plain Raw-IP directly on wwanX without attaching rmnet? If QMAP-capable firmware starts QMAP framing as soon as it receives BAM_DMUX_OPEN_QMAP rather than waiting for QMI WDA configuration, bam_dmux_cmd_data() will tag incoming frames as ETH_P_MAP and drop them without an rmnet rx_handler, while TX still sends unframed Raw-IP. If firmware keeps Raw-IP active until QMI WDA enables QMAP, documenting that in the commit message would clarify compatibility; otherwise this may need to be gated on rmnet attachment or an opt-in control. [ ... ] > @@ -548,13 +554,17 @@ static void bam_dmux_cmd_open(struct bam_dmux *dmux= , struct bam_dmux_hdr *hdr) > { > struct net_device *netdev =3D dmux->netdevs[hdr->ch]; > =20 > - dev_dbg(dmux->dev, "open channel: %u\n", hdr->ch); > + dev_dbg(dmux->dev, "open channel: %u (signal %#x)\n", hdr->ch, > + hdr->signal); > =20 > if (__test_and_set_bit(hdr->ch, dmux->remote_channels)) { > dev_warn(dmux->dev, "Channel already open: %u\n", hdr->ch); > return; > } > =20 > + /* Use QMAP on our side of the channel only if the remote supports it */ > + assign_bit(hdr->ch, dmux->remote_qmap, hdr->signal & BAM_DMUX_OPEN_QMAP= ); [Severity: Medium] Can bam_dmux_send_cmd() miss BAM_DMUX_OPEN_QMAP because remote_channels is published before remote_qmap is updated? When the modem opens multiple channels at startup, an already-running bam_dmux_register_netdev_work() scans dmux->remote_channels with for_each_set_bit() without locking or acquire ordering: CPU0 (RX DMA callback) CPU1 (kworker) bam_dmux_cmd_open() bam_dmux_register_netdev_work() __test_and_set_bit(ch, dmux->remote_channels) for_each_set_bit(ch, dmux->remote_channels, ...) register_netdev(netdev) ... bam_dmux_netdev_open() bam_dmux_send_cmd() test_bit(ch, remote_qmap) =3D=3D 0 <-- omits BAM_DMUX_OPEN_QMAP assign_bit(ch, dmux->remote_qmap, ...) The same reorder can happen on weakly ordered ARM/ARM64 systems because neither bitmap update nor for_each_set_bit() provides release/acquire ordering. This leaves QMAP disabled on the channel despite modem support. Testing remote_channels first, updating remote_qmap before setting remote_channels, and pairing smp_mb__before_atomic() with smp_rmb() in bam_dmux_register_netdev_work() would ensure remote_qmap is visible before netdev registration. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-qcom-bam-d= mux-qmap-v1-0-abc2e80a03af@oss.qualcomm.com?part=3D3