]> git.ipfire.org Git - thirdparty/linux.git/commit
mfd: qnap-mcu: Add proper error handling for command errors
authorHeiko Stuebner <heiko@sntech.de>
Thu, 13 Nov 2025 16:52:18 +0000 (17:52 +0100)
committerLee Jones <lee@kernel.org>
Thu, 20 Nov 2025 10:14:07 +0000 (10:14 +0000)
commit56c1245d51faab70bf68cc3a5cd3925768e6375b
treef404b6c45eb0507d9f891720ff53283ffaf5e408
parentc3223f562586307b1bcb014475d0b71913972145
mfd: qnap-mcu: Add proper error handling for command errors

Further investigation revealed that the MCU in QNAP devices may return
two error states. One "@8" for a checksum error in the submitted command
and one "@9" for any generic (and sadly unspecified) error.

These error codes with 2 data character can of course also be shorter
then the expected reply length for the submitted command, so we'll
need to check the received data for error codes and exit the receive
portion early in that case.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20251113165218.449616-5-heiko@sntech.de
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/qnap-mcu.c