From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA54C35CB81 for ; Tue, 23 Dec 2025 10:08:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766484511; cv=none; b=htNeh6hKelMx32BQwmGV/C6xa5cIUY/6fGC8rxJ55iYSSDrsFtq+UgtOlOAD58BcIMQ08zqFFc5wE2Waxk1H2HS7fR0kFZ0Npxqe3OEK7E0Ns/geQR4qSX+Zevd+3TuHPsVE4rxRGiWbyCgZlcsUcm73q2BPit88eIoydCz3Zuo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766484511; c=relaxed/simple; bh=jFZVQfYQJNB18DWJ2VPo4uHlYMZ+qVcnwZ6BjUm/n4s=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=M8TxpUfA0FwL9rESBza3xXQWO9GcLOAKbT5MVXv+/XfWpkDls0qBcAn3++kKvAXg1/zhyfmsuX3K52sKni9ZG3P1mu8743VwiDX2UPaPGvS9mmBmw8FTzxv72upPNRjgufCRjXeg1Lfy/OWQ9wUhUE2uRXiUQUrNHpxAvZUIzfQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=laegVvlG; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=eBCk+Hsp; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="laegVvlG"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="eBCk+Hsp" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BN43hK81356381 for ; Tue, 23 Dec 2025 10:08:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=MUkkPvR0eBeCChriG2mbKz 77pF1eSKwmyVq/BXnNsCI=; b=laegVvlGNMeq7Im5Tlp6hRRiYsqSLtKR4ePulZ aqM/oTNIH6Rh+A5EAbbMPMLALp1zmX8nAUYbix0xToqjx4wzt0W+Yb3aGy+sXlvV u2ueLDkDe2HptIKjj9zZ9Qmsm7NydsPs9aFVopGwq+nsmzAUcNtt5wqXTARbBuDr x0q35ufdIdLUjcTyMhCZ/S1b4eY3y3Z3fUwxj/pZdc2gOqvZL3vkSo4oPVmAHDJB ICYDL1ptajyy0Jb2f3z8999QIpx/zSrLwIWBtjoArVHRXnMgFB/SSJU3/64wIjeP CFy2TOHG1Q5Fez5hQ8poSxf4SCBw7UztMHHsD9KgrZ9KrUxQ== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4b78xc2t6t-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 23 Dec 2025 10:08:28 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-4f4a92bf359so100008931cf.2 for ; Tue, 23 Dec 2025 02:08:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1766484508; x=1767089308; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=MUkkPvR0eBeCChriG2mbKz77pF1eSKwmyVq/BXnNsCI=; b=eBCk+HspCkVM0Ovu7RBtUzwdHUAxwjpCndGoLtaMwLdVJTb3fSxL1WsemoYLI8Y046 nbbxs50xfN2AyuxVQMwrOzSwY5H4gKNre4l4JmXGfN9jgwJQ0Amp9ixHRlb95WDekhhG 1Uj7fXwsvObr4wD9PfQ+MsLIdjJTi10nZ23VIuzgkWVVbuHTkoYEuSKgdkzitkT6uBb1 o8ButCmiWC57fnulJ3U7V7lsINeU6Axzt6jIDEdfWN5XYNAcDmTE1ekEuq0lgKqi3Ki0 KIpEX3YMw34s+Fg6Y6sN3hQf55bwsS5p+zvfbpVaVR7LRDRtx6Dp6hb5lNXxuSsYLC9/ co7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766484508; x=1767089308; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MUkkPvR0eBeCChriG2mbKz77pF1eSKwmyVq/BXnNsCI=; b=OlZe29W2/H5ceRRnd6+2fCCJz6fUpXdqt2oNDbydk9NGWPRM7wmegFMYka49N34eyc 4Jmxyk1W93R66+jLAmyU5kbz+zpEf34f4/GdegEmbpRaapvGD1Ubj91Xz1tSgk8Hz4BF ptYIKX30pDvRJpAabg30mOhtMDGvtEnNPfarS5T2Uj+GKmzi2a/PfQNSG9nedtbeLUdC aV/VMvQkAjACLd+GiWbSaaCcj8OALHw8wANRSHs/00SHe8sZ5VbOWTqsP07UTyIqrN6+ a4NltwA0BBQvSBYT73CPimjbehE9n/mYt5uWv1KhD+hQG8F0nZl8aCmKLCDc9bUnI5gM OfYw== X-Forwarded-Encrypted: i=1; AJvYcCXw2H3RtiirZr54KoE7Acaf3w4xOVdeeDw1iwv+B0FB6Qbb9+yI9Iq4YP+k3T44jWB1/tDo2yIHxCVP2t0=@vger.kernel.org X-Gm-Message-State: AOJu0YxECjqF8Fwi1dGcU7VTN3wykNL/5Mul/PK0TrrdNpqpIud+Y1Du 41WgEvFPIEwaeTfstYyB6e9ucNK4IZPhofEh856sQtlkL9fXxc4ILwK2vIvtCjXkVQkcZNO74pJ jbnTGVqWHcL3wMlN5MCmIUhRxrnRYuF4FHm2oTdJnPdEPKZXicOpdGTyrCfsEup8Q2z8= X-Gm-Gg: AY/fxX5FH0gf7F3SU0sR5aQKKQn8v/qHRVv1AqxGxMsUrDB5haJVcsPVf0LLqsgad/s Adbn6IjPwJnsz2aoIfQj7AEEuYDgT/XJ8N7h2jXGdFCb37Lz/T8ND7jbcts8wzcup1p/R/ERuqz 1dzhoFYMZZ5PNTybgeGptY2lhEoIiJ8RvCEwdDaqyjRmIGo8N+glbxVg2lBNjI3j8/8Wns+2bvi iCyHywnV7JR2X1w6alW7eaJLnzGULzr06kVFCHy6JcuMhunDGnHk+aHUAwgjoMeVyZ9qziaKbeB 9GAW2JhZ63EPVFikrXLVVMTmX30cJ6mzsSfKB/GAcWQyP8KiizJGuZh3MmkWIcNy1r0a0huzdsZ w9o9RSg56YhQiz4BO9N0sBg/rLx3Tx2CuZyU9lQ== X-Received: by 2002:ac8:584c:0:b0:4ee:2508:3934 with SMTP id d75a77b69052e-4f4abdc83c4mr184675701cf.67.1766484507920; Tue, 23 Dec 2025 02:08:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcdwTi+DBcNXQnjjYGf2fe44itAek2WrJv+uhC5Xgc7jdSERdoHcSRivvHymp98RDvkICRQA== X-Received: by 2002:ac8:584c:0:b0:4ee:2508:3934 with SMTP id d75a77b69052e-4f4abdc83c4mr184675431cf.67.1766484507449; Tue, 23 Dec 2025 02:08:27 -0800 (PST) Received: from brgl-qcom.local ([2a01:cb1d:dc:7e00:190a:1976:65e2:c61]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d1936d220sm249823015e9.8.2025.12.23.02.08.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Dec 2025 02:08:27 -0800 (PST) From: Bartosz Golaszewski Subject: [PATCH 0/6] i2c: provide and use i2c_adapter_dev() Date: Tue, 23 Dec 2025 11:08:17 +0100 Message-Id: <20251223-i2c-adapter-dev-wrapper-v1-0-bcf960a48fa9@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIABFqSmkC/x2MMQqAMAwAvyKZDbQBRf2KOIQ2ahYtqagg/t3id jfcPZDFVDIM1QMmp2bdtyK+riCsvC2CGosDOWo8EaFSQI6cDjGMcuJlnFLh0HXUts73jglKnUx mvf/zOL3vB1GNRwJpAAAA X-Change-ID: 20251222-i2c-adapter-dev-wrapper-c882660190a2 To: Wolfram Sang , Jean Delvare , Andi Shyti , Shyam Sundar S K , Nirujogi Pratap , Bin Du , Mika Westerberg , Andy Shevchenko , Jan Dabros , Gregory CLEMENT , Hans Hu Cc: Bartosz Golaszewski , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2349; i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id; bh=jFZVQfYQJNB18DWJ2VPo4uHlYMZ+qVcnwZ6BjUm/n4s=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBpSmoSRmEWGHoQvcHqy4uKCmMgkc8ExoIbV3+N6 puzuaVbgD+JAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCaUpqEgAKCRAFnS7L/zaE w2eRD/9HMTPZkb2sPtEscdyX4IqDCYqapytDee3mQ+a5ISJ5Z0x8rqZSUbm4NQZ8JhB4u7SJBVO Rzieh1hqyni1qn4aOP3ZVSAzZn4en3Pvz6mIRu922FGp8uKm4CqaDKiyaNNdDAAye3d+jXQOenu O3VwMfeNBc4wC+oZdN/aTjQUfQXtkpQFkLVaIZAcpMx3b8ho2sT6CwYEu5iHg156OQvrXDHFO16 BTQiby0p5nJI6soPP9vKHkw8YIBI2Z/uGrPnhbiZ0+cq1qSZpsxbNcNzJkGmCP1vULXk/Yc3kyW 11FYVPVLydOGohiDnzn8mbQtOcjST7wInsMdAuDNGzZycYhgW/fCNEOXbyTLPqa+VH5XIxBU8NR Nof+cb9aJlncFM1GACKQeKCgzlUSrZmAh00r5RGQyawVMOGkD+sPKWa5MCt9S8QEkmX3+coNmA4 mlWaMOQIbdrYEqF7HV7Q5rmwxJpUvpAYWK3TkntH/o223qP3Xp6wO4EoPLj3IK5cAZf56Oa7Oom uahcuSh/hLkodAY0jCTYTWkgGUT85mEVXkj6EXxbwFZWnrgT1xZZNuPQOPNhUtLlHigbY4frs1E 57whdUH8ZKUoyd8CHJgpYFVmV/7/vY6uJAeaQWvL1f85GF9KDbuZtNUBK2aM7Q6LubpCvQX7UXg QbVwllnSt7aAfUQ== X-Developer-Key: i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Proofpoint-GUID: IU8FlJS_0_X1N2-F8bHj9MbhxEdI_fxa X-Proofpoint-ORIG-GUID: IU8FlJS_0_X1N2-F8bHj9MbhxEdI_fxa X-Authority-Analysis: v=2.4 cv=cuKWUl4i c=1 sm=1 tr=0 ts=694a6a1c cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=lUC9hMLxrJuMSK10UuYA:9 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjIzMDA4MCBTYWx0ZWRfXxvaMmtHOIMrv 94oeCZCRTncIvbJyGY0aYD3A2hVCTmUMWL/rb4GF5CdUm4nCen8e6X88oistsDasttplHiUGLX6 rdDKMLZAkIR4+sQ0vyYyRFNPi47KF4miBGA/2q91dLLRm0l6QMp2WKRwi+qdg8cR6E72GEmMEgG Ve9GT9C+UP3f0cgmGkcdBb9GxEAjySWxN9ZURbtYm2lo/jgzOOV1oXnYBGrZ8O0DMCT89TcyXD6 9mtMFQSc8zywD5y8aGeUMkyDUvY7waqQk8Er31nV6ATTXa5Mpe0yyxlCLyQq8oCTGbxSLsGSTA6 oRDiqKT2ka6esZa/Z4Q510sjwwxMjJDPR/rOWNBO6s4j54/LRAVE+hg7lff/fpcKUuhsEfsCdXs R0eIJb8bUjn36lYXkROH1GB7zVXTTXMe3fcInbhtVMAfVVFAzRuadulwTE4fXQPAvbNupdc5YR5 9BHOCZ5caYkiENJLadg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-23_02,2025-12-22_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 clxscore=1015 malwarescore=0 impostorscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2512230080 It's been another year of discussing the object life-time problems at conferences. I2C is one of the offenders and its problems are more complex than those of some other subsystems. It seems the revocable[1] API may make its way into the kernel this year but even with it in place, I2C won't be able to use it as there's currently nothing to *revoke*. The struct device is embedded within the i2c_adapter struct whose lifetime is tied to the provider device being bound to its driver. Fixing this won't be fast and easy but nothing's going to happen if we don't start chipping away at it. The ultimate goal in order to be able to use an SRCU-based solution (revocable or otherwise) is to convert the embedded struct device in struct i2c_adapter into an __rcu pointer that can be *revoked*. To that end we need to hide all dereferences of adap->dev in drivers. Other series address more generic problems - like printk helpers and parent/of_node setting - but there are still some more specific use-cases of drivers dereferencing the internal struct device of i2c_adapters. We need to hide the fact that the device is embedded in i2c_adapter before we can move it out so provide a helper that provides the address of struct device without showing how it's stored and use it in some drivers. [1] https://lore.kernel.org/all/20251106152330.11733-1-tzungbi@kernel.org/ Signed-off-by: Bartosz Golaszewski --- Bartosz Golaszewski (6): i2c: provide i2c_adapter_dev() i2c: piix4: use i2c_adapter_dev() i2c: amd-asf-plat: use i2c_adapter_dev() i2c: designware-amdisp: use i2c_adapter_dev() i2c: mv64xxx: use i2c_adapter_dev() i2c: viai2c-zhaoxin: use i2c_adapter_dev() drivers/i2c/busses/i2c-amd-asf-plat.c | 4 ++-- drivers/i2c/busses/i2c-designware-amdisp.c | 2 +- drivers/i2c/busses/i2c-mv64xxx.c | 4 ++-- drivers/i2c/busses/i2c-piix4.c | 6 +++--- drivers/i2c/busses/i2c-viai2c-zhaoxin.c | 2 +- include/linux/i2c.h | 5 +++++ 6 files changed, 14 insertions(+), 9 deletions(-) --- base-commit: 9448598b22c50c8a5bb77a9103e2d49f134c9578 change-id: 20251222-i2c-adapter-dev-wrapper-c882660190a2 Best regards, -- Bartosz Golaszewski