Skip to content

Improve error handling for qnap-mcu transfers

Heiko Stuebner lkml 3 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 1 replyApplied
  2. v24 patches 2 repliesApplied
  3. v14 patches 2 repliesSuperseded

Changes in v3 from the cover letter

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

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/4mfd: qnap-mcu: Calculate the checksum on the actual number of bytes receiveddrivers/mfd/qnap-mcu.c+2 -20 replies
2/4mfd: qnap-mcu: Use EPROTO in stead of EIO on checksum errorsdrivers/mfd/qnap-mcu.c+1 -10 replies
3/4mfd: qnap-mcu: Move checksum verification to its own functiondrivers/mfd/qnap-mcu.c+8 -30 replies
4/4mfd: qnap-mcu: Add proper error handling for command errorsdrivers/mfd/qnap-mcu.c+65 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

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

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(-)
Signature · 1 line
2.47.2