From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 2807F366DA3 for ; Tue, 19 May 2026 20:48:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779223692; cv=none; b=m3VUhOV/zpkAFxHYNBPXg9ZnXLxtczi6zlIiv50tpov5QwfemK2w6TpQXgjcdvBk22IVuHP/f4dWW7jBYttzstT/7c1z0A38AjcOb8eOKkmk1ZVKo/4PrsPpxYbMnmonLCzFM6d+u8t0+TgUeFHbvoPHMYznTeBDGvHs5Kcww7A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779223692; c=relaxed/simple; bh=aN/jIKU8WwEj7tNWCy2Y/6waCIjstgh4Ig/sdNXpIWk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=h6dWlgi4kpmsdhsvaKRlshF0POEMy41nbMbkWB0ZEVC7V7hlbOBP3R4uV9b7SOv+AMIAL2fJQPXwjn0+hmnq5xokB+kpKu9dWwgESAlt5fryuf4rYRtBadmLhOtzokIpPXfQBiMSPdUadlcHomMQAt2ttVuA/Vtk3YuvsdA90S0= 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=oDhY4S+N; arc=none smtp.client-ip=209.85.221.47 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="oDhY4S+N" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-45b030a5696so426163f8f.0 for ; Tue, 19 May 2026 13:48:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779223689; x=1779828489; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=b9yu/QXPv7IRT169VYxzMPUPurNcWd0h458FPz0Rs4c=; b=oDhY4S+Necuuhim/+0xdvZnLITUqpQUwueXBdVX0fqelCKV3TjucddyqJ2c5nTt6BJ 4SJKRi4uYoB92VMGYCrbHimPnucFZqdtzQ75cwdjq3a4P9ttrB4pD6l4mMDWGmG0870W VbNx6GcznOQQMmXfjaur9Tod7Y65xwLDpoPxLEJ6x+oksfoOlCmU32S6YtGQrOiXOp0o sdveGQuiih+otWQw0NM+Dt4RgAb28FFnJ2DyyPKqPk65tPzoOG2+eQ5dBWTmKOpZcOs4 ygiDo3LvGfrddUuKCUms8Xy23DuulEw1cwVacOmYJgYukENMEPV5H4oraw0WkM7kRdAo 8caQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779223689; x=1779828489; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=b9yu/QXPv7IRT169VYxzMPUPurNcWd0h458FPz0Rs4c=; b=P02tyvwQtRnRBZ93JH0iwYvjjyVNCm222K9iZkFQQzP+6eB2anx7kEF4ZKm091FdGu 2raqe1V61Luz86mK2ZJlQ+pok+4d/xIz17EF1gk2vm0c942fHo4h5aX8jT9YT34CAueI IOuIn7ozWKfmrQtV59318VdGgqhmp++1xrQOTY0+KO9L4mqbKw7sbTpOgADtzmz9jMTL VzjhPqLXsi+lHISN64fkxzy8sTJ9HTvpb4mKi4l1V0Na9U89XRPQIBTEG9THiyS3pNol d1/6dn9mZveLnB0ACAeHGKYo5i4cTO+CCbDAmuQiCS6TDk/X3lb0x1h8kz/jBbLLTpak mjqg== X-Forwarded-Encrypted: i=1; AFNElJ9PXOaR0X9n51u4PuRtfuDyYCgbGqbv7thPBwZRJlbcOZVGtW1MDImqdWUJbLrGfDA8rdADvvp3C/ljFMk=@vger.kernel.org X-Gm-Message-State: AOJu0YzvUyeM3Dncw8IL3O17lcS+Qgmp2OXHma0PuIIsvS+Z9oBC3Fqq +VSZsopd1jIIHTOL9OE0/73hVdPhazdHKPySRziK4AsfQYMrqE8Wzl3/ X-Gm-Gg: Acq92OHSI+uITSj/usWJcCN1uiH7M15qcFEXan3ermfsUaZ6YisMBfGamdBCneus6IA zqV4fP8b7DPrS4bajzpzQmWR+dzdmyzMsZntEQE+GV3WleXzHA2tFMKStVdj0plKX9gyfwe25eU nNKiAq1V7h/7++9H+p6/cqyHUsA9q6IG+K6dNAAS6pqk0N13Mv7hAtyNGVbHAq72yquHZCGhuoE BcrCh8K56F2Mq3LptZVP6cbMeI5GbM9EFU5ysxoHSPvsRQc/68gI8mtLg+u8B5GEwwPkwhg2sSc /criY/EV3tq9VM0/rbg3p6vJQzXdTh9BHL8ENeX7aLQN1tWXd37QvVEnXGbje/Ui69HnvHfz3zU hj2tW3dFyIwLYtLeJZg8oGyvY9TXU5qtipToPpIJk1UmyVlOhuxpfd6b6ZEtbj9xyzJ8gyWHOw1 Zfm2NGYhJ6Uv59PbnGanaz9jkD7jJBYs9C3DcmtiSc5n9T2CtrcxeBdeLLmypaiq1aP2+hpkEGe IQUifdbEl/9 X-Received: by 2002:a05:600c:a48:b0:48f:c8d4:487a with SMTP id 5b1f17b1804b1-48fe63138d7mr141836725e9.8.1779223689381; Tue, 19 May 2026 13:48:09 -0700 (PDT) Received: from menon.v.cablecom.net (84-74-0-139.dclient.hispeed.ch. [84.74.0.139]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48fe4dac000sm356457755e9.0.2026.05.19.13.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 13:48:08 -0700 (PDT) From: Lothar Rubusch To: thorsten.blum@linux.dev, herbert@gondor.apana.org.au, davem@davemloft.net, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, l.rubusch@gmail.com Subject: [PATCH v2 00/12] crypto: atmel - introduce shared i2c core client management and capability-based selection framework Date: Tue, 19 May 2026 20:47:51 +0000 Message-Id: <20260519204803.17034-1-l.rubusch@gmail.com> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This patch series introduces a staged refactoring of the Atmel crypto I2C drivers in preparation for a shared core-based architecture. The goal is to consolidate I2C client management and selection logic into a common atmel-i2c core driver while keeping ECC (ECDH) and SHA204A client drivers functionally separate but interoperating through shared infrastructure. The series moves existing ECC-specific client tracking into a shared management structure, relocates allocation and selection logic, and introduces capability-based filtering for hardware selection. This allows individual crypto drivers to request hardware clients based on supported features while still benefiting from a unified least-loaded selection strategy. Subsequent patches extend this base by: - migrating client management fully into the core driver, - introducing explicit capability advertisement by each hardware client, - updating ECC and SHA204A drivers to participate in capability-aware allocation, - and cleaning up probe/remove paths to ensure consistent lifecycle handling. No functional behavioral changes are intended at this stage beyond internal refactoring and preparation for future feature expansion. The series is designed to preserve existing crypto functionality while gradually centralizing shared logic in the atmel-i2c core layer, reducing duplication and improving maintainability across all Atmel crypto drivers. Signed-off-by: Lothar Rubusch --- v1 -> v2: - going over Sashiko feedback[1] - rephrasing commit messages and titles - fix: introduce a ready/state flag to address the UAF risk - fix: add kpp lock and refcnt to impede overwriting global driver struct - fix: explicitely clearing rng cached buffer in return branch - unregistering ready state by dedicated function - reorder Atmel ECC related things and atmel I2C at beginning - reorder Atmel SHA204a related things behind introduction of cap - patches dropped: NULL checks in remove functions - changed to EXPORT_SYMBOL_GPL - additionally to alloc hw client also migrate freeing it to core driver [1] https://sashiko.dev/#/patchset/20260517180639.9657-1-l.rubusch%40gmail.com --- Lothar Rubusch (12): crypto: atmel-ecc - rename driver_data before moving it into atmel-i2c crypto: atmel-ecc - fix use after free situation crypto: atmel-ecc - fix multi-device kpp registration crypto: atmel - rename atmel_ecc_driver_data to atmel_i2c_client_mgmt crypto: atmel-i2c - move client management instance into core crypto: atmel-i2c - introduce shared teardown helpers and fix queue flush crypto: atmel-ecc - switch to module_i2c_driver crypto: atmel-i2c - move shared client allocation logic to core crypto: atmel-i2c - implement capability-based client selection crypto: atmel-sha204a - integrate into core management tracking crypto: atmel-sha204a - fix heap info leak on I2C transfer failure crypto: atmel-sha204a - switch to module_i2c_driver drivers/crypto/atmel-ecc.c | 137 +++++++++++---------------------- drivers/crypto/atmel-i2c.c | 78 +++++++++++++++++++ drivers/crypto/atmel-i2c.h | 17 +++- drivers/crypto/atmel-sha204a.c | 53 ++++++++----- 4 files changed, 173 insertions(+), 112 deletions(-) base-commit: 6c9dddeb582fde005360f4fe02c760d45ca05fb5 -- 2.39.5