From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 8061337B02A for ; Fri, 24 Jul 2026 09:44:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784886264; cv=none; b=n/QTSUASqHhuODNB1Mf7OTmbzQYNLHRspH5c5+J61xZMtSZ+Fr4blVrnG6lqsvLwVus+VXBJbQumkDwkPtG68DZUCobnVgvVKOdqY6nUtGhztEExAoxn6niqvS4va0ShZujYvLKI+AKigCQcTd0Nk1NnEAwqmesU9fc334c68zg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784886264; c=relaxed/simple; bh=yrISTsxAPeWT2K57vffRZP6ps+e/hIbhrXMWVB5Qfno=; h=From:To:Cc:Subject:Date:Message-Id; b=iPnfDX3Hg0Mqd4jQnznngtFHQLfOlMEb68yIIOWJVYZTtCW2NV80WAZ9mh8vOFuZwLGc+wHKs3nTxDN12ZunwLt38q51/EEuno66ejC0nVpngh5flmrXFFkwdwtI19ob02LgYlIVTeDOCuv2c4PAZ39c+cGD9iUMwYg5T3fkbDU= 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=Q2HKONQg; arc=none smtp.client-ip=209.85.218.54 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="Q2HKONQg" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-c166f1bbeaeso41691566b.0 for ; Fri, 24 Jul 2026 02:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784886261; x=1785491061; darn=vger.kernel.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=o7/TEanfHpxIy0e3XDOKFQF3ac34egp63Y0x1oLc94Q=; b=Q2HKONQgcxRWyeuYcuUFfvEFpXrdXP/5V9lzzUbIJmtC8qTcNs5vj0Hr+11Y/EVkZ7 Ea43dBMJfeXN/9S4LENqawZo9QDtcrRIXfKuwdIatdW+cIWlpvPJgvrj7vJvzXuq36Kp oU+pt3AVboc4QDN59NccbjPxOvJjE4SvLwlICCqLV9sCX2hPdNgynB9HI6mKMV7WNsl8 iLzb7qGg5kVMzyU9jaYg+rVteNhbswfl0OLCF3Y1ch80R+TOmqZQQlZdx3voGfAcbXYf RSZpr3/wuBYfQjKGTz7iqkN1SPqbdghLHC8Oh8ocxATqaZ0uIziu0AgeVHcRG9l97ZYx 9B2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784886261; x=1785491061; 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=o7/TEanfHpxIy0e3XDOKFQF3ac34egp63Y0x1oLc94Q=; b=cciEzdrgL+xy7w6jYYWAn+IHUG3xkdvFT2TgH0DGvOY1GjYZqPATNhamZZT9dtG0zj pGNZkDpHMIeMpUMHXNpeUdnBMo+hoDkP8llRsNjSki5fpaqaDPrXINF9TL2Jt1QrShk7 XS0NQNiRedX4Mh5Tpp7P1CMdLxaezSh4EWP2AhHBYwEKnyJcVCjIwk/K+JzfHnse1jSy /4Yc1qTmySDH+f3PHTmnRNzzEkL4wsYEZGutsxu6BfCBsjY2t8QCTEOqCxUhi873EC0H 9E3A7xGZ5cvr6K5sFjS27fhfoTpw2tK91LL9QGv4hjPy/GZzje3p2OCFuYoCPMKCv4ie Y2FA== X-Forwarded-Encrypted: i=1; AHgh+Ro/eMiQl6I/C/2xh77f8xcVIvZJUSdtmf0eOsKCzEJ/YLkOsLVoBcKaAPSSGn4M0GCeBFqdNlqucO4Ceec=@vger.kernel.org X-Gm-Message-State: AOJu0YwTbcRZppOlrK9SCQtLBFMNdC8uskqv9z2x1c8hvkw+v44jqi6i t7lfRZC6DwG3Yiu0Os5GNIXnvDbRX1hLWR8PfGEtuJBoa0JVrSFoRsvr X-Gm-Gg: AR+sD10Cg6aHORkxnBw6UgacvQfL+OA11IjU0TeWxU7CBwvR+3VhmpHKU6Z3fc3WhKs aNrBEUKBoBpJxUpzrJ0e+c5g+xkizE7LR2DNFy33EMcl0YRi1MJROR1VE8fR4tlznN4LzufSJmf IMrWLjMpkcHE42/eyPcX2FVXtB9RGtfTdTtdbxz3r2sSlDImagB1nzrWth5yTJjUFqoz85ZiGl5 zBGRuELrM6XNjib3QQuF9ZsFb4rZCybqygPp8v7cDwO3WLrJMVqSH+W45ixK68UoAr5DpkTyhTf RlRYLer9bua+8diJcgUf0xHre9vyLdKEr7+78V3DcWykV8n4KYtuqWzOSXvJqnVqk8hhAQj7fSk iUKcyL5xCcs4D672dwCzrjMd+cCkYHWqGWtixLzKyepLYaeOQAC8w8dn6V6UJ9MfhUgY+Ndicmc 5lGLVncV7niF9pFdy39z/t87eslHzZr7FoFsCpe2hu X-Received: by 2002:a17:907:1b06:b0:c16:55e0:ada5 with SMTP id a640c23a62f3a-c1c50d1d7e7mr299639066b.35.1784886260756; Fri, 24 Jul 2026 02:44:20 -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-c1c32c90b58sm325865366b.39.2026.07.24.02.44.20 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Jul 2026 02:44:20 -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 v3 0/7] char: xillybus: Harden driver and improve code quality Date: Fri, 24 Jul 2026 11:42:55 +0200 Message-Id: <20260724094302.50761-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. 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 | 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