From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 84698339375 for ; Wed, 22 Jul 2026 10:23:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784715835; cv=none; b=ZRXywCQAAN7p8994oqDo0K6eioN1e1V6vU+uXaEcuxGZlBkQ+7hcq75oxUdu/F84rhNlx6C/XZtLExMyhvIr8vHAuV5uJpevYJMLXKxzff8RtuRYt8neb3ssXlDrxXljA8NEHwhdD/BZ8ccGTbJrhRw5kql0yZ2H0V2Enyn6xd8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784715835; c=relaxed/simple; bh=AX8pQ/jVFC5xp4UCW2SyeTMOWhFSSZIb644vKi6xnsA=; h=From:To:Cc:Subject:Date:Message-Id; b=tIb6HWKrpHXFvjL6jRtRaq9VbOBLWu7i4A0EbOgjVqlFE7PyWk27kE6xSr/KggoXRhVpkMOG5Ib0K++EhHrx0I1avkzSpvlfo7WBvsPE53+/M0vxyBaUEF9so8kDez+rzOcI1ykVEnXygW8in9BHbEsV7W6fCmGLDNLaSqKVcLU= 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=MkmaVm2Q; arc=none smtp.client-ip=209.85.218.49 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="MkmaVm2Q" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-c16794450aeso927634266b.2 for ; Wed, 22 Jul 2026 03:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784715833; x=1785320633; darn=vger.kernel.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=bSQG+RvNpFbUTcGP1WjwLZ+vN15QOb+jwKACPZP39fQ=; b=MkmaVm2Qm3VbPMcytg6Pjr0Yn6k0v9rgKJdyzJpEhJyUzoYvTvwveCDjavHakCobW0 wExjrdpKOblIeolWioD1GN2D7Liy7CyIBQ1z818uTuXDSuRq6J1NP13OGLxTH2fwTiwX focrevZf9uKvyctsm9z66onbim4evwZI/K+C+e16iQntamgRPu/5LpzSE34MrDbAWk8L CVJtLANcPFVBHaChnxDkA5UFper0mrlYzVA021YNzP11C9dQ4U7iS+gyv/ziZ3yGEaea NOhIvlGaO8V6TEC3oLj1xzALnk1vr23Yr+N/Gcu35ebap1xhfPoJWV3JYS0RlEYpzraN cw1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784715833; x=1785320633; 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=bSQG+RvNpFbUTcGP1WjwLZ+vN15QOb+jwKACPZP39fQ=; b=kJx/XcCkfSCpoiOEpcsNr7+sUuv20OG71ujDLKdMn16ziibPSaw/jwZEYNskBhzweJ WavGFOgK75R6MFCZq3psjkNDlx6JQEWoZFZryDKV+p/z1FkyJYMREcXJ1/4f+nDL5W4V a8gZhi9MofOwyKiPu0NNMtb6P2GzXoUeH2g+oYMhjOyoPvs4GBGF+uKqig3YxKQq1TDR cw1t08JzcHzBCdG2HpMTfS1AfO+Qxu6VppTgKxShc/hn/KRqoE/3GKGggSHTKsjlX9yV K+WeWK1wqP7dvc/mHOQvTxsTZOLNFZSULVZrMA0EaMTrOzfv/a3lP7ac7QYc9Ih85xW0 dLUA== X-Forwarded-Encrypted: i=1; AHgh+RpbeuDWBLB6fMLk3fO4FW4PAcdcH3caBRfqcruZo9GIIqhSCyxrjxRUYBfuquELb/k7r9PIfDyPZQXX1Gc=@vger.kernel.org X-Gm-Message-State: AOJu0YyNRT8+7lGbvj3qnjhO7DAugkCz/ZSeTVAUUanOOmEwqo/HT68S //ChvUgPt2KvlpApqINFhrnnl3SBqeHI3ApEBdNA9UVITQTdRu+8crLE X-Gm-Gg: AR+sD13nytJB/l1L0VhttxuknBejPOZlwdZsUZYXCuIbVQg7ZJbSYU75T+R3AYNzrIQ J0JNRRdeYl+e37kcJFUwELLet62snrDx3qNVDznyr/y6ycxV4VIntKQu+KuGuG9ld4scvjHpgoN 3sFf9OQtRDVAkMD+u/9yglHLlBPwZcM2IZ7mfwXNoGVdbgA8aYSXnQOyKNJ7pFkhiZpnKXT6ncl 5nyKntNLKxqVWC4UuUrYdByj08/Ft2kOCE0sgudXAcCf/YGiTsEujV8Hvy6QkgF5i4C1gvuQuss Ld6oTFH/oFrByFR5ZC5QCx/uX3tx+D+vVMIfnqtRWNL7jK5VxZIXM5fDjB0mO/CZaSMrUbXp3if aRQNpy3nuEZpnIZ9CZV8XqmtZNe7O8ZH18vQcldZ0ANquFs1roMcl7tYzRErX5DLonajOvyIvB6 h0JlurFNmu6q0D2dLKbKnNVwFZmJjqIQexKswGWpqO X-Received: by 2002:a17:907:9445:b0:c15:d0b6:495c with SMTP id a640c23a62f3a-c16b4702c27mr963757566b.29.1784715832681; Wed, 22 Jul 2026 03:23: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 a640c23a62f3a-c1c32ac6ff3sm83611966b.19.2026.07.22.03.23.51 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Jul 2026 03:23:51 -0700 (PDT) From: Eli Billauer To: gregkh@linuxfoundation.org Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, Eli Billauer Subject: [PATCH v2 0/7] char: xillybus: Harden driver and improve code quality Date: Wed, 22 Jul 2026 12:23:00 +0200 Message-Id: <20260722102307.49090-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. 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. 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. 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 | 4 + drivers/char/xillybus/xillybus_core.c | 100 ++++++++++++++++++++++--- drivers/char/xillybus/xillybus_of.c | 3 + drivers/char/xillybus/xillyusb.c | 62 +++++++++++---- 6 files changed, 162 insertions(+), 28 deletions(-) -- 2.34.1