Skip to content

char: xillybus: Harden driver and improve code quality

Eli Billauer lkml 6 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest7 patches 0 repliesNew
  2. v57 patches 0 repliesSuperseded
  3. v47 patches 1 replySuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v37 patches2 repliesSuperseded
v27 patches3 repliesSuperseded
v17 patches1 replySuperseded

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7char: xillybus: Improve control of execution flow with mutexesdrivers/char/xillybus/xillyusb.c+12 -10 replies
2/7char: xillybus: Remove duplicate error path codedrivers/char/xillybus/xillyusb.c+1 -50 replies
3/7char: xillybus: Avoid possible bandwidth inefficiencydrivers/char/xillybus/xillyusb.c+2 -20 replies
4/7char: xillybus: Use unsigned arithmetic for jiffies differencesdrivers/char/xillybus/xillybus_core.c drivers/char/xillybus/xillyusb.c+13 -90 replies
5/7char: xillybus: Integer arithmetic improvementsdrivers/char/xillybus/xillybus_core.c+7 -70 replies
6/7char: xillybus: Add defensive sanity checksdrivers/char/xillybus/xillybus_class.c drivers/char/xillybus/xillybus_class.h drivers/char/xillybus/xillybus_core.c +2 more+77 -50 replies
7/7char: xillybus: Ignore and report unsolicited interruptsdrivers/char/xillybus/xillybus.h drivers/char/xillybus/xillybus_core.c+49 -10 replies

Reviews trailers per patch

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

Read the v6 thread

Cover letter [PATCH v6 0/7] char: xillybus: Harden driver and improve code quality

This patch set consists of several boundary and sanity checks, gaining better control of execution flow and fixing minor coding issues. No difference is expected in the driver's behavior under normal conditions, except for one change that might improve bandwidth performance marginally.

Why all of the sudden? These patches are the result of a comprehensive AI-assisted code review, using Deepseek, Kimi Thinking K2.6, ChatGPT, and Claude Sonnet 4.6 as plain prompt tools.

I've spent three weeks in what I call a "reverse rubber duck" session, asking these LLMs to find bugs in the code and following up on different leads, the vast majority of which turned out to be no more than quack. Occasionally the points made by AI were valid, and in others, the mere effort to explain why the remark is wrong to the rubber duck led to finding real issues.

Almost none of the fixes suggested by AI were even near the actual corrections in this patch set.

The v1 iteration of this series was rejected due to an error in the error path. Specifically, the @rc variable was not assigned a value before a goto statement following a failed allocation. This oversight was caught during compilation with LLVM=1, but was missed by GCC and the AI tools used during the review (and myself of course).

All patches are unchanged since v1, except for "Add defensive sanity checks", which fixes the said error and also makes a couple of minor adjustments.

The change from v2 to v3 merely consists of adding Assisted-by tags to the patches as required.

The v4 submission is the response to some of Sashiko's remarks on the v3 submission:

https://sashiko.dev/#/patchset/[email protected]

Three remarks relate to the patches in these patch set, and have been corrected accordingly, with Assisted-by tags duly added. Sashiko also had several other valid remarks which call for additional patches. These will be submitted once the processing of this patch set is done.

The v5 submission fixes one issue brought up by Sashiko's remarks on v4, adding a small fix to the "Integer arithmetic improvements" patch.

https://sashiko.dev/#/patchset/20260805093436.59740-1-eli.billauer%40gmail.com

The v6 submission is a rebase to the current kernel tree + a small fix (using SZ_1G instead of writing the number explicitly).

Thanks & regards,
Eli

Eli Billauer (7):
char: xillybus: Improve control of execution flow with mutexes
char: xillybus: Remove duplicate error path code
char: xillybus: Avoid possible bandwidth inefficiency
char: xillybus: Use unsigned arithmetic for jiffies differences
char: xillybus: Integer arithmetic improvements
char: xillybus: Add defensive sanity checks
char: xillybus: Ignore and report unsolicited interrupts

 drivers/char/xillybus/xillybus.h       |  3 +
 drivers/char/xillybus/xillybus_class.c | 18 ++++-
 drivers/char/xillybus/xillybus_class.h |  3 +
 drivers/char/xillybus/xillybus_core.c  | 98 ++++++++++++++++++++++----
 drivers/char/xillybus/xillybus_of.c    |  3 +
 drivers/char/xillybus/xillyusb.c       | 66 ++++++++++++-----
 6 files changed, 161 insertions(+), 30 deletions(-)
Signature · 1 line
2.34.1