[PATCH 0/9] FlexCAN fixes for-11.1

Bernhard Beschow posted 9 patches 1 day, 23 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260723070059.6332-1-shentey@gmail.com
Maintainers: Matyas Bobek <matyas.bobek@gmail.com>, Pavel Pisa <pisa@cmp.felk.cvut.cz>, Francisco Iglesias <francisco.iglesias@amd.com>, Vikram Garhwal <vikram.garhwal@bytedance.com>, Jason Wang <jasowangio@gmail.com>
include/hw/net/flexcan.h | 22 +++----------------
hw/net/can/flexcan.c     | 47 ++++++++++++++++++++++++----------------
2 files changed, 31 insertions(+), 38 deletions(-)
[PATCH 0/9] FlexCAN fixes for-11.1
Posted by Bernhard Beschow 1 day, 23 hours ago
This series attempts to fix the Coveriy issues pointed out by Peter in the
FlexCAN emulation [1]. In addition, it fixes some reset masks to preserve
register contents across resets as intended. It also fixes some register
offsets due to a union being inadvertantly too large; this would affect
migration if addressed after the release. Last but not least it eliminates an
unneeded union.

Testing done:
* `make check`
* Run `cangen` and `candump` on the host and guest in both directions

[1] https://lore.kernel.org/qemu-devel/CAFEAcA-QBiPfgN4YJXD9FQULobpBVNgeJHSqG7Eqg1CzyKTfaA@mail.gmail.com/

Bernhard Beschow (9):
  hw/net/can/flexcan: Use mbs[] array for FIFO pop
  hw/net/flexcan: Drop unused RX FIFO register overlay
  hw/net/can/flexcan: Fix out-of-bounds access in flexcan_mx_rx()
  hw/net/can/flexcan: Fix mailbox index calculation in
    flexcan_mem_write()
  hw/net/can/flexcan: Fix mailbox index calculation in
    flexcan_mem_read()
  hw/net/can/flexcan: Fix mailbox reset mask initialization
  hw/net/flexcan: Drop oversized 'mb[]' mailbox view
  hw/net/can/flexcan: Fix RXIMR reset mask
  hw/net/can/flexcan: Remove RX SMB raw view

 include/hw/net/flexcan.h | 22 +++----------------
 hw/net/can/flexcan.c     | 47 ++++++++++++++++++++++++----------------
 2 files changed, 31 insertions(+), 38 deletions(-)

-- 
2.55.0
Re: [PATCH 0/9] FlexCAN fixes for-11.1
Posted by Pavel Pisa 1 day, 20 hours ago
Hello Bernhard and others,

On Thursday 23 of July 2026 09:00:50 Bernhard Beschow wrote:
> This series attempts to fix the Coveriy issues pointed out by Peter in the
> FlexCAN emulation [1]. In addition, it fixes some reset masks to preserve
> register contents across resets as intended. It also fixes some register
> offsets due to a union being inadvertantly too large; this would affect
> migration if addressed after the release. Last but not least it eliminates
> an unneeded union.
>
> Testing done:
> * `make check`
> * Run `cangen` and `candump` on the host and guest in both directions
>
> [1]
> https://lore.kernel.org/qemu-devel/CAFEAcA-QBiPfgN4YJXD9FQULobpBVNgeJHSqG7E
>qg1CzyKTfaA@mail.gmail.com/
>
> Bernhard Beschow (9):
>   hw/net/can/flexcan: Use mbs[] array for FIFO pop
>   hw/net/flexcan: Drop unused RX FIFO register overlay
>   hw/net/can/flexcan: Fix out-of-bounds access in flexcan_mx_rx()
>   hw/net/can/flexcan: Fix mailbox index calculation in
>     flexcan_mem_write()
>   hw/net/can/flexcan: Fix mailbox index calculation in
>     flexcan_mem_read()
>   hw/net/can/flexcan: Fix mailbox reset mask initialization
>   hw/net/flexcan: Drop oversized 'mb[]' mailbox view
>   hw/net/can/flexcan: Fix RXIMR reset mask
>   hw/net/can/flexcan: Remove RX SMB raw view
>
>  include/hw/net/flexcan.h | 22 +++----------------
>  hw/net/can/flexcan.c     | 47 ++++++++++++++++++++++++----------------
>  2 files changed, 31 insertions(+), 38 deletions(-)

Tested-by: Pavel Pisa <pisa@fel.cvut.cz>

I have tested QEMU mainline with your patches applied
to behave correctly with SableLitte machine emulation
and sending of CAN frames from it and to it from the host
system. You can add my confirmation individual patches
as well if you want.

best wishes,

                Pavel Pisa
    phone:      +420 603531357
    e-mail:     pisa@cmp.felk.cvut.cz
    Department of Control Engineering FEE CVUT
    Karlovo namesti 13, 121 35, Prague 2
    university: http://control.fel.cvut.cz/
    personal:   http://cmp.felk.cvut.cz/~pisa
    social:     https://social.kernel.org/ppisa
    projects:   https://www.openhub.net/accounts/ppisa
    CAN related:http://canbus.pages.fel.cvut.cz/
    RISC-V education: https://comparch.edu.cvut.cz/
    Open Technologies Research Education and Exchange Services
    https://gitlab.fel.cvut.cz/otrees/org/-/wikis/home