From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2191714A4F0 for ; Wed, 5 Aug 2026 11:13:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785928435; cv=none; b=SmKyS/FhZ01gMZL2OH7vYz1t69DqExDh9GJ9XgFbEAY6ZyPowZcKHPmDkevMTXqsXJm0ENLc33Iprp631dKvsYe4EiQxRWCg3Q2iITg3cCEUJKVls4itylmt6tKd0gK9L8gqeqIsaCyrU6Ktz5FBVxDv3s43nWFecmmXf+zxfq8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785928435; c=relaxed/simple; bh=GIqHMkgakll8hKK1WGecVRxCql00RR3pvvaEZIOVtUU=; h=From:To:Cc:Subject:Date:Message-Id; b=rI684JOEPtadIYBR2UrEZvMOywZ9eJCkMR9BH+ft5vXcWxNIeUsdMJO4o1XttcpzTL9tST/y/PuwA1AHfr1QQlJ8ZJkLY0B+s1zb0rtz5HyPNE5rL5spngR0ximYIMds8ctBui9hBakGFMeu1sPwWxmMwi/cytQrFoe3Ql2rZC8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hwci9CF7; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hwci9CF7" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-6a0a4aa99bdso1241900a12.1 for ; Wed, 05 Aug 2026 04:13:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785928432; x=1786533232; darn=vger.kernel.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=VIX7wD1Bb7bsnz9/P3FGegg3ToDhGVzsDsJ0pRf8ulQ=; b=hwci9CF7z9zPLbtlDIyzARJZ31UZ4C837aaSUp7KwHdpNV+0FDKLOlBSJ49aKnuvCe x10ZJFN4El6q/X0e9Ki0xRtUaonyQEYMyQilyfyU3dH6jU+/UqzBcE+MDEl+LJ337qVK H0UEUoF1V8KNKVBpy8aYOlGFysYii8mC//+G+0PFKmoAEaVWwmH4qll5uwUhYoyz8v3s BECR9kgXE6DmS+yvwXlUNs4Fgk98/xCmPbT49A9hcVgjqqoNmHa2m70vYc8leUM7omgj KQUK3IyDEAgqvvfTaeIkuphGLsi8SP4X/3+7I21NLw3Z+zebGpQPXVMeIEFZs2ruUE1c pTXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785928432; x=1786533232; h=message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=VIX7wD1Bb7bsnz9/P3FGegg3ToDhGVzsDsJ0pRf8ulQ=; b=s1A4/1uUELgfSFMtWGLk8xJ3Apl6bG74CW3PQ7VnqwFt0SSn3u/zuezp9BLr9fVZWM wy09nARvbv71KfjUv2rigO3Bx6vRunJ4Ne7MAGz5iiVLFCtmln/d+02OFR1+0JSxp/rp hbrZp7D8Ak+9Qm1+T9Tr9OfOqf+cGVo78eSsgIqf20YfCQ+X+chAkMvbJkUeqtRY1cdA 4p1kkAgGM1KslW93C8onEqJJyB6c9guS9lkxeuVWyRR2tag96xRnJx287xxuiHl1C91W n6UCBMUCrfVboAoC7gJX9Mvfx53uYj/LjKID7K1P74X+jC4SBbgstXMZ8dxCgYbSNWnI J2zQ== X-Forwarded-Encrypted: i=1; AHgh+Rr58dOFxAS766s2hksMRh7PBmYPNPK5ii+gYT1FCcU9kGGc1zbRcOqdidRYsLmdMoHwdx04DKF82Q/1GaM=@vger.kernel.org X-Gm-Message-State: AOJu0YwfR1zLi5SerHqHAlgA3PbRmFQuCbfu6cRs1V9GOfK9sLEkTbUZ R/wcC/78CKC8Ab9eFyCVEPSgqZqGemBjRXeAKYURM08e5xLZqCoSBv+dHMLIfAnd X-Gm-Gg: AR+sD13ZUJvK0RnothORk0E3tlZn6nL+kbOZp6+qkqkFoMh+59kmdF0BR7LZWpCNR1/ l3kzTcgIH0Yf5T/gXo2e3UV3sN7kPYePapCyT4AotPqEWO+NzDu8BevsyAsASz9tjZP/AXF2qQ0 8U3IYrrJ9cL7Fv8chO83YHLryQEgdUzxOoZmUH/x2/8jOb36efovTjYtixEJuRfeTJoVWrCPsZz hjD8H9yb1FTzsF1LB+xdXJL3qLS9lVemZI5Q3t56WQDY4Bw2T7nIheZEkK95IOplee1nnN9vAVB nL/CulkGt8SPHfI/U0u7Na5XVvdcbRJzfQfWz1oyuqYInU18kz3DSDH3XyLcADu6XfQ9noN1kbX m5VmINP8zco8Yd+GXbIMuV+rY4cR99hsuPSTsbk2Y+T8UQ43kmx5Z4HRASRS+H7wkaJwcH1BxgE IxwZSbguNwSt+Y2kM4ctWPlVlduGy/BxWTEjpASAS/mTW2426bn6etc6zBTr4ZMjcnRMqrnsIPi CZg3MTiu42ojsih8yf5BznWfnI= X-Received: by 2002:a05:6402:2410:b0:698:e614:e4bf with SMTP id 4fb4d7f45d1cf-6a14f009f11mr2999685a12.0.1785928432194; Wed, 05 Aug 2026 04:13:52 -0700 (PDT) Received: from localhost (c-85-228-45-68.bbcust.telenor.se. [85.228.45.68]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6a18b26b488sm90863a12.25.2026.08.05.04.13.50 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Aug 2026 04:13:51 -0700 (PDT) From: Eli Billauer To: gregkh@linuxfoundation.org Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, corbet@lwn.net, Eli Billauer Subject: [PATCH v5 0/7] char: xillybus: Harden driver and improve code quality Date: Wed, 5 Aug 2026 13:13:30 +0200 Message-Id: <20260805111337.69178-1-eli.billauer@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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. This v4 submission is the response to some of Sashiko's remarks on the v3 submission: https://sashiko.dev/#/patchset/20260724094302.50761-1-eli.billauer@gmail.com 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 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 | 97 ++++++++++++++++++++++---- drivers/char/xillybus/xillybus_of.c | 3 + drivers/char/xillybus/xillyusb.c | 65 ++++++++++++----- 6 files changed, 159 insertions(+), 30 deletions(-) -- 2.34.1