From patchwork Fri Jan 5 15:43:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 760210 Delivered-To: patch@linaro.org Received: by 2002:a5d:678d:0:b0:336:6142:bf13 with SMTP id v13csp108549wru; Fri, 5 Jan 2024 07:55:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXDTr/IwW+YvS1oAJIY6EDH+MnGLNl8NJ0GjpUlmIe1U5v0eLSiohk2AKyAXs3hVe3d8Av X-Received: by 2002:a05:6808:2011:b0:3bc:3d2f:20b4 with SMTP id q17-20020a056808201100b003bc3d2f20b4mr75505oiw.20.1704470147984; Fri, 05 Jan 2024 07:55:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704470147; cv=none; d=google.com; s=arc-20160816; b=1DjEUfBpVCx6ahEsuryixWulsr4/UR9Wwx8Qd7b6WmHegGD22w31D6reOq3Ku6/Qor DhSN8r2wZGRoQMApU6ctJ8QqzfblA1zmGpM6jhl9Qwk2WVQa/RuceMpBKw9063PMfe23 GZyOUupaUzNY+v1PkWF1Z7jK7GVNRunlKN7Qn5+eFsAbx/S1etzmV6wxAKfyrkSU5tjF Vy9ZzGSzTHbMCpKSxvAOfZCej5yy3nnyBAJxqknjV6DZ2P6qQ2K0Sur+tyXN+Jg1Johl uIMcQagAAVirZnWsuXVbZ+xmGhl5L/YzgnByt/V3uiidjO7gFHMfsjMnNvqYbLzEl/Xx z/iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sJhN/WyzxWMOOPIeTap61yRQUoY0YL+ZGCT3kZkMZNQ=; fh=xTMPh2SmnK7LCN7tWD8/ixwXLwgQIG/YAKddxD8STHM=; b=eq9QcKaxefWzZmLk0cVcFDSvmsiKIqDrMf5hDH5TaRSg3gFwmE7g22f8dCXL7pLNde 5kjx3RnvH0lm+iSww4GFUIWPrUUxZ7i1CsUhGpjH1Ysh2rmjMwqvo04BkhsO2TsrygxU Tun7h0muFdHbVhP4/Re5U85U8zu9fIjDTo1k4gJbbAqzloOIgqU4x6sV/mw/Yrcu4IjH HQKjF4usw3QnKpQIk7KATemca4zjZ6RYGCdz709kUhdvJiEPsRW+Hei+5cecsW7MxxJp X4lTib6IBvL9GtHVRY3qIyaDdq1rVL16d6DZ69Jh9aRQQdoXd4FmzwjUlKB/L2YJYePL OvGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kbhIsb5G; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f18-20020a0caa92000000b0067f2120275dsi1979051qvb.542.2024.01.05.07.55.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jan 2024 07:55:47 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kbhIsb5G; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmU6-0004vY-L0; Fri, 05 Jan 2024 10:51:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rLmSm-0001n3-NF for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:50:33 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmSk-0001HA-L3 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:50:24 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3374eb61cbcso1485578f8f.0 for ; Fri, 05 Jan 2024 07:50:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469812; x=1705074612; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sJhN/WyzxWMOOPIeTap61yRQUoY0YL+ZGCT3kZkMZNQ=; b=kbhIsb5G5wAWcU8WA6XlQi/6lKGxmbGxrqPEcemqnUAJHAWx5hQHKlqoOe50A3ShTl 1VjKZw6HJZXRVq0Qkdp3/7TWZnZqz/0Zm6Hvitg5mfr38q44rrsFhW4TCZ2kdOVEZF4w RiGv8yqiwQJ0qh9gznbkrTMAXZuJ0/qlbqeG7B/SxZKotvHVMF19VFSsRvVTp+rYcejd k17URYeJuZmVmQklH/D1WUAfYQu2xiYwuf7NAfsNDt0yHchKrtVurmB1PKsfNg0CYRV9 zxWKlhmZVkFLu4szNRvLhGnHKIQL8emVwUpOXYMi0QeF9SBpw2psC7u0feUG1OcLX6jm hKHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469812; x=1705074612; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sJhN/WyzxWMOOPIeTap61yRQUoY0YL+ZGCT3kZkMZNQ=; b=byKGFfuaUTi4bmbo3eacBYl0VcEabCYJY8r0suLDJhtAKWAHrWzHQDM1BTDHRcRPpZ QlRGY7Ryaq3np7RYIqWPZLvI73lBK4uSZZ015OHw4e6+2f4/lfJU7R51tC1Ab2eheI0Y Vl1X1R0adJ4WWDQMIigsk0oFIdB9G9Cr5bRtXcp9ZpECKHNdx2tPHnetbK57rXuJeaIY o+D5jPZc9hVlZRvDDZVAmtt5zHbu5WjBsUv4guRVPF5OYvw092Qs/AFO9/yhu7tWwY1h 7CgEruM7qt3eeqU6tzsKKnvBJUjme2eGlyMcRnLTY5d4KClVg5wbLcJdLXuffB34Oonm Y4uA== X-Gm-Message-State: AOJu0Yzv08YkC3tX/BsfZ0x5+Kk2FuPzpbtFkhnww/SePgAZObl+6+e9 AhdarBEfHjQJ+GplK5Qso0PDlbAMnUvVV0v8jvinCQplXYk= X-Received: by 2002:a5d:6d50:0:b0:336:808d:95e5 with SMTP id k16-20020a5d6d50000000b00336808d95e5mr1497119wri.67.1704469812164; Fri, 05 Jan 2024 07:50:12 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id a22-20020a5d4576000000b0033671314440sm1629463wrc.3.2024.01.05.07.50.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:50:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Pavel Pisa , Grant Ramsay , Vikram Garhwal , Jason Wang Subject: [PULL 70/71] hw/net/can/sja1000: fix bug for single acceptance filter and standard frame Date: Fri, 5 Jan 2024 16:43:03 +0100 Message-ID: <20240105154307.21385-71-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pavel Pisa A CAN sja1000 standard frame filter mask has been computed and applied incorrectly for standard frames when single Acceptance Filter Mode (MOD_AFM = 1) has been selected. The problem has not been found by Linux kernel testing because it uses dual filter mode (MOD_AFM = 0) and leaves falters fully open. The problem has been noticed by Grant Ramsay when testing with Zephyr RTOS which uses single filter mode. Signed-off-by: Pavel Pisa Reported-by: Grant Ramsay Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2028 Fixes: 733210e754 ("hw/net/can: SJA1000 chip register level emulation") Message-ID: <20240103231426.5685-1-pisa@fel.cvut.cz> --- hw/net/can/can_sja1000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/can/can_sja1000.c b/hw/net/can/can_sja1000.c index 1165d59824..6694d7bfd8 100644 --- a/hw/net/can/can_sja1000.c +++ b/hw/net/can/can_sja1000.c @@ -108,7 +108,7 @@ void can_sja_single_filter(struct qemu_can_filter *filter, } filter->can_mask = (uint32_t)amr[0] << 3; - filter->can_mask |= (uint32_t)amr[1] << 5; + filter->can_mask |= (uint32_t)amr[1] >> 5; filter->can_mask = ~filter->can_mask & QEMU_CAN_SFF_MASK; if (!(amr[1] & 0x10)) { filter->can_mask |= QEMU_CAN_RTR_FLAG;