Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91F70606A31A for ; Mon, 30 Nov 2026 21:55:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=nwSKw2Pi; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=hXcqh3X5 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xY9LR-00010W-2s; Mon, 30 Nov 2026 16:55:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xY9LH-0000Nv-A2 for qemu-devel@nongnu.org; Mon, 30 Nov 2026 16:55:26 -0500 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xY9LF-0002dZ-OB for qemu-devel@nongnu.org; Mon, 30 Nov 2026 16:55:23 -0500 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AUKQITV1826657 for ; Mon, 30 Nov 2026 21:55:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= gRtqEvOJxIKFCQ4JGbKABtQFMdEobtaWpwP/PnjZaoE=; b=nwSKw2PiOA0RaSCA +5zpM/IUVTUME6cESGS6Ul2oDdD/kCu3mZ8ZivEweLZgSeKLKbBmC2iECTrQM1w1 QOspF4+k0njhIPy0u4ZcF75Rn7kavTsAK0SdL4ETOt7ZrATmst4TUhAwt+Th445s vyR5DGRPDu8IpHEzohAisdfRtxLRRoFgsXNttbrLpZhFv864uiqE+wWCoqsc2SfM KROxWzI1rl0Bk25GYzwWjobJUHg0uAIBYP2Y7NLraRelQDRHnnz2A8U1CbRUJjGg msA5UyXlucSKB0tnDzRevA8lYogpUXsimERrPFQMSqDsjjKyN65u/ZdpFofsn56J i4ZP/w== Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j9cd3hbu4-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 30 Nov 2026 21:55:20 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-93f2c0e6653so874668585a.1 for ; Mon, 30 Nov 2026 13:55:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796075719; x=1796680519; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=gRtqEvOJxIKFCQ4JGbKABtQFMdEobtaWpwP/PnjZaoE=; b=hXcqh3X5aYopdx32dEYwl0MlcYOVzW7yIFIREsHeE0LItqKghOrhabvY0a6g6lfqaK 6Faf3Bbt0DF32ZR+lq2fTLJO0YfYOjOyxcELHoIIZ4mFo0EmKdfY9FFgDPtAzpJrAMcR ZRqQFPXgHRlXZN2AeH2wPQ9U9sXjRe6lIg9UCuLZ+BFEaLp2tv3sYK5QlJKw6D22xLce z8XGsCiYkk+NiD673GAvJ5Bo3hdqHBqL9FQJYAF3cNc1ugQvJm/ndM30P+h8Pp39QDR3 xh4Ldcau49lLF4Nixy/jUSDd+BLrHApy1uzz+BUSFpyUjx5aXQUowZ/r0YR/v56a7mBp 56Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796075719; x=1796680519; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=gRtqEvOJxIKFCQ4JGbKABtQFMdEobtaWpwP/PnjZaoE=; b=b9ngm/teWzdGN32wh++wACCj0BeTL6BVVC4GQVoRdun9HJYiH+NXIdbie8/0i4A3DS fabjM04r2ZIASc2lNwfgWLc+9wQ6Ki81ux1b3SUe7REgYQjgRSWGf6mgVMYZEC0PQ77z 2nyvV8L89Pr2EyLo38xJtUKrK2cnhMDgCzouY0//AuvDH6U4CIs6R/nFnoLuLoH+yfZf cv1Y5joy0j9n2Fxz0axC7YD245bOBS1yt2AgoOkmq0qdD0nbi0vxmeZJhoFLImDK+KEu sg2VoTHxS+lYk4SyiUbwZBbVRwjebtBH2pCmlayW0fyhJWYTk8abPrts6Tirqpy4Qzuh ZxVQ== X-Gm-Message-State: APuU4Z8Ku1zEMCUjnSKRIHqc9tljCQNfcH+1bqrXMYFhenBWNlKeRksk uX2XGZnYEu8CrQbvh7rHkYcLxwYIv13opoMWDWnNpPzBoMmQrNE8ykLvgDepEA31PUdClglq/Ym z2BfHJ17eaYkU3JSvJva9TWp3gcjBmj0o810cFJ/rq2eIjxTl6BC41i5VHTOu2LL4Zw== X-Gm-Gg: AZFdTZdX1OmwreYTWNE/jjmMHtOGO7Qgs5/kgM5PlWAanNivtHzFL02WTn25EmTQg4D 11dlWJTzPWZ9DlC72wfLsVkKhuGvcYegxazTKr6wioRLxQIMjsD6GOj/roNoovS0Jl+pUiomOzc 0te81OXPN0weCwKeSa1g2DYBD8VQLWUQtZsY79/kkTy9Zl3kCAnFy7cU/cK+svfM/PUyAX1ulLf 7F4t/PmkU+PjjEETxU7ETgDZ2PlZSZ8ZmfgVmpaq4hi88U4kxsVBvBgKMsQGGQoVNnidXL0eH5P 11euuwdokuIAkwe+MRCNE0zO5Nd1lRom9dEIcHCYAqCOAqqrYF+45XKJvIy6dSMWCppxYi1Dval 2e/N5n97OUAIIf/uSGi5NcwhSs1r8XnVwnWAq6ciKceeXH6SUreGSLqC7i5zn8qivnxEu7i9oVd jwkxwDzArzY4r9J8AzYxBNM1rfgnLZwzjbMxQtA6Yv X-Received: by 2002:a05:620a:a909:b0:94a:b4d:b073 with SMTP id af79cd13be357-94a0b4db989mr2545263685a.17.1796075719199; Mon, 30 Nov 2026 13:55:19 -0800 (PST) X-Received: by 2002:a05:620a:a909:b0:94a:b4d:b073 with SMTP id af79cd13be357-94a0b4db989mr2545260785a.17.1796075718597; Mon, 30 Nov 2026 13:55:18 -0800 (PST) Received: from localhost.localdomain (alyon-655-1-564-32.w80-9.abo.wanadoo.fr. [80.9.105.32]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6a68048esm70275346f8f.29.2026.11.30.13.55.17 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 30 Nov 2026 13:55:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 11/11] hw/net/can/ctucan: send a Ready TXT buffer that has priority 0 Date: Mon, 30 Nov 2026 22:54:00 +0100 Message-ID: <20261130215401.90201-12-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261130215401.90201-1-philmd@oss.qualcomm.com> References: <20261130215401.90201-1-philmd@oss.qualcomm.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: lW_bU0EmpYI1yUIgEFpvPyidTKJeF7bF X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTMwMDA4OCBTYWx0ZWRfXxE6rPyCNB/h0 Vy2FIkF3sV8x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-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-30_05,2026-11-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 phishscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611300088 Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 From: Yashaswin Sharma Puranik ctucan_send_ready_buffers() starts each round with tx_prio_max = 0 and takes a Ready buffer only when its priority is higher. A Ready buffer with priority 0 is never picked. It stays Ready and the frame is never sent. The CTU CAN FD datasheet (v2.7.0, section 2.9) has no such rule. The Ready buffer with the highest priority is sent, and of two buffers with equal priority the one with the lower index goes first. TX_PRIORITY resets to 0 for every buffer but the first. Linux does not hit this with four buffers, because it rotates the priorities 7 down to 4. Select the first Ready buffer regardless of its priority. Replace it only for a strictly higher priority, so that the lower index still goes first when priorities are equal. Fixes: aa406e8b7ecd ("hw/net/can: CTU CAN FD IP open hardware core emulation.") Suggested-by: Pavel Pisa Signed-off-by: Yashaswin Sharma Puranik Tested-by: Pavel Pisa Acked-by: Pavel Pisa Message-ID: <20261130143015.98626-2-puranikyashaswinsharma@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/net/can/ctucan_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/can/ctucan_core.c b/hw/net/can/ctucan_core.c index f6ff4ad2003d..380a3ee21d39 100644 --- a/hw/net/can/ctucan_core.c +++ b/hw/net/can/ctucan_core.c @@ -259,7 +259,7 @@ static void ctucan_send_ready_buffers(CtuCanCoreState *s) continue; } prio = (s->tx_priority.u32 >> (i * 4)) & 0x7; - if (tx_prio_max < prio) { + if (tx_prio_max < prio || buff2tx_idx == -1) { tx_prio_max = prio; buff2tx_idx = i; } -- 2.55.0