[PATCH v3 0/4] Improve error handling for qnap-mcu transfers

Heiko Stuebner posted 4 patches 1 month ago
drivers/mfd/qnap-mcu.c | 79 +++++++++++++++++++++++++++++++++++++++---
1 file changed, 74 insertions(+), 5 deletions(-)
[PATCH v3 0/4] Improve error handling for qnap-mcu transfers
Posted by Heiko Stuebner 1 month ago
Digging deeper into how that MCU behaves, I found out it can return
more status codes than the "@0" for "ok".

The additional codes can report a failed checksum verification and
some "general" error for the command execution.

This also explains sporadic command timeout messages, I have seen
over time, when the controller sends an error code while we expect
a longer reply from it.

So while I'm not sure yet why it reports an error, with these changes
we at least handle the error return code in a meaningful way.

changes in v3:
- fix stupid mistake of not running checkpatch after reorganizing
  the error handling code and having the function opening { not
  on the next line

changes in v2:
- rebase on top of 6.18-rc1
- include improvement suggestions from Lee

Heiko Stuebner (4):
  mfd: qnap-mcu: Calculate the checksum on the actual number of bytes
    received
  mfd: qnap-mcu: Use EPROTO in stead of EIO on checksum errors
  mfd: qnap-mcu: Move checksum verification to its own function
  mfd: qnap-mcu: Add proper error handling for command errors

 drivers/mfd/qnap-mcu.c | 79 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 74 insertions(+), 5 deletions(-)

-- 
2.47.2
Re: [PATCH v3 0/4] Improve error handling for qnap-mcu transfers
Posted by Lee Jones 3 weeks, 6 days ago
On Thu, 13 Nov 2025 17:52:14 +0100, Heiko Stuebner wrote:
> Digging deeper into how that MCU behaves, I found out it can return
> more status codes than the "@0" for "ok".
> 
> The additional codes can report a failed checksum verification and
> some "general" error for the command execution.
> 
> This also explains sporadic command timeout messages, I have seen
> over time, when the controller sends an error code while we expect
> a longer reply from it.
> 
> [...]

Applied, thanks!

[1/4] mfd: qnap-mcu: Calculate the checksum on the actual number of bytes received
      commit: b4881070a02b017aea84592c424d5a980ed261c4
[2/4] mfd: qnap-mcu: Use EPROTO in stead of EIO on checksum errors
      commit: c94fce30e190555d74e2769b5fe4a932d0ad432e
[3/4] mfd: qnap-mcu: Move checksum verification to its own function
      commit: c3223f562586307b1bcb014475d0b71913972145
[4/4] mfd: qnap-mcu: Add proper error handling for command errors
      commit: 56c1245d51faab70bf68cc3a5cd3925768e6375b

--
Lee Jones [李琼斯]