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 11D22349B0A for ; Tue, 23 Dec 2025 10:04:57 +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=1766484300; cv=none; b=U8R8EZO6/vlH78gJyeSMxhEzVJh7AFozl0TATHX58Th7ckOu0m7DqWHht6x5O2EhFmns+SXfPce4IdS4W6hSSU3qQfiBtJwDr2BovoeOg8xNlrn4Ouo5Shso7UxHVBWNoef/+8zaUwb+xBUnPMmhjdmT/9bMIf6Gps2oBi7aVX4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766484300; c=relaxed/simple; bh=Aessx24OljIFWC+mc2LsHK/66rMxd0lRq5JDSMHPZrs=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=Xlm6bxj1x8sfs2xo0ah/2/++l/zxod5/VPDqFvcnMD1FAduyUxwYhyI74ONL0GVowHoYSVaPZjqls3iBPHLX2ZMUiFKlfjNUF001h5140hDjr1s318IWSLJ07skp+VEoIwNVlYNFfeCPAx1perkRDt8Aqg3iB09DCF/JUZgC1Gk= 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=TAiODTnZ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=MbD4ZykC; 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="TAiODTnZ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="MbD4ZykC" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BNA0kG41895043 for ; Tue, 23 Dec 2025 10:04:57 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=Rpb4W73dFQhb2fFVWipjtD js1BBDNzb3ATpS6fi83mQ=; b=TAiODTnZbMj6PmIgx9AmPxt9azJHDmXkcd8QmU d2caYjG+9fRP3dpKbbCX/MqqOww+fHK8m4ygpbKLPRL+NQdtRHTDvANw+HiejMXZ +KZ0R2ENLChWcctaHwCkWZXCZHPNkiOEf6fxy8W/5G6ncv6HNjtGK81Sk21UeqEb uqeir517kr20DQfkuFHKJXaXVz5TqxqtqLxrQfyqOBgi0Jc4ZQbmGEwiCLGBawhn 6yV7zTd3clbDt+xqTydTPh04zn3+IZOG4drvZZZ6Zyvxl0Dhxec1AtrfcLBupWgC 0f+hb355KrFHSK76YEr+Bh1/X4sbZbtLvmUKUHT+Kt0j+Ysg== 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 4b74takesm-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 23 Dec 2025 10:04:57 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-4f183e4cc7bso87594131cf.0 for ; Tue, 23 Dec 2025 02:04:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1766484296; x=1767089096; 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=Rpb4W73dFQhb2fFVWipjtDjs1BBDNzb3ATpS6fi83mQ=; b=MbD4ZykCSYJ8V3vVyieD8BsNUm4G7Ng5F+ujqGDTtVdnOdlHai2+jsspfXmWEoT25b BgeIYxOHW4OCBzYlglXJVNt4oOjkalh8Gpsw8/VE1fRHvdhOp18Uu2xpdq/wpQeLv5uc /JAA8RZotAWBMFNWYPkVBtDEWO0l5nd3wTMjKFgaRZP/k7uo4/sPaF/t2WlWFETylBtU zFYRkPJjSlQtKoSvE4GvlLVC89UMJhabg44fKHc/JTIvvWxIZJDhkaxMgTrU8Z4o4bSo yA+yZSBohkgNWuH9Ru4wZRSmxh7tMoouPf8I+xni++tPRLdHq/0TQOK6AmRTjRl9VWuh fv/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766484296; x=1767089096; 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=Rpb4W73dFQhb2fFVWipjtDjs1BBDNzb3ATpS6fi83mQ=; b=UdLxWArDhmrgUdPW4nffeS/TWGWbnrEn+l+uz13MFTwhOe5tb5oyC/1ExFHo/4tgx9 sOe2aeK+OrTj8CmNx69ISii9pQngFk1iBpi1noGeAsBsrGeBgtYFb1g2ssxKPe8i13zp uV6Eb1X8/Ik2NUYfto83bkJ0Y6/9M7AeYUFmUGl4sbknxXOYGAj8XG4KsXeVMX22jtKo uGYjc0M2AMrIvz09QkG7jHXaXqsmUUF4kTB2mLb9avnnGpSK7kVmWUm4w772otIZg/gJ kqU3faK/u7nWDQA4W5dtbM+5jfvsdTAProI1DNDxn70kcXRFGZcV9iime0vh2BnUiNu9 eicA== X-Forwarded-Encrypted: i=1; AJvYcCWmPq/QjrhHEiUYNKsNne/ILXmixPrrX37sRmusfOuP0TWyIBdFWx+LA+I2CyjvGokxgJ3xM8b2OHBu9FI=@vger.kernel.org X-Gm-Message-State: AOJu0YxYRQs86tDALADNBzmHtIE0BNbVcZo1zcSW7lCF3NFiHquOsFUY 5RQ7aoQR0eGYwdMrAf99WL8F9C5OSZhGVYb84j3OB6K+7GnzwMNSCQAfR85Abknop/7mxUI4PPv iBzyajfQVW1qs1f8MZGPHHc1+6OdDb2mswbCXzTCKkq5Eq3oPrDYrEhZl1QuvSNPyEYs= X-Gm-Gg: AY/fxX70XecbJUexyRk3LzHmt160Mnm92suIehATPuWkh1CyCXTcw6XLq2mKXm4cC+f Z78ba+irVBCVyJzB3paBtScurNRo7ZmGfAyDJyCwU/GLH0a25HbkFogko5uVM9JQr8s3TDoc3Ws Sp/OJNW6WMpsss4niLbgB81W6Vwc6t8gS8klcjsOt1zKlaGX9jZJhOd9R4wRam00DFm70LW3Fn7 GqXwfv/5vSo5ov1kpFhuIa/Uzu8Clr0UgbC9LXw4V6ueNTEFr/wm16Km+SUJr+U7sl7gi+IO5Cc 8Awedb4p2FRI8dc7Q6ypaSYbOZfkO5tKBnNH+WsfM+CkD1mqL3GVHyvXzqrB3N3hWOrzQspT3eg ITrWkDj8jGnuny+YwyhzoDeDJbq87FWHUJxc1A8E= X-Received: by 2002:ac8:5cd2:0:b0:4f1:83e4:6f55 with SMTP id d75a77b69052e-4f4abcd06f8mr204815091cf.16.1766484296288; Tue, 23 Dec 2025 02:04:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiNHKqDKCrFlscF1e8nxZ5lfR1gZCs8573oK/BJMiXsdrVSl2/AbVhz7yPs2GYVwiIg03KGQ== X-Received: by 2002:ac8:5cd2:0:b0:4f1:83e4:6f55 with SMTP id d75a77b69052e-4f4abcd06f8mr204814511cf.16.1766484295661; Tue, 23 Dec 2025 02:04:55 -0800 (PST) Received: from brgl-qcom.local ([2a01:cb1d:dc:7e00:190a:1976:65e2:c61]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d193d4f09sm235035025e9.12.2025.12.23.02.04.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Dec 2025 02:04:55 -0800 (PST) From: Bartosz Golaszewski Subject: [PATCH 00/12] i2c: configure parent device and OF node through the adapter struct Date: Tue, 23 Dec 2025 11:04:38 +0100 Message-Id: <20251223-i2c-adap-dev-config-v1-0-4829b1cf0834@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=H4sIADZpSmkC/x3MQQqAIBBA0avErBvIqSi7SrQwnWo2JgoRiHdPW r7F/xkSR+EES5Mh8iNJbl+h2gbsZfzJKK4aqKNREfUoZNE4E9Dxg/b2h5yoh643+6zUpEeoZYh 8yPtf162UD/OF/y1lAAAA X-Change-ID: 20251223-i2c-adap-dev-config-9403ab811795 To: Wolfram Sang , Mukesh Kumar Savaliya , Viken Dadhaniya , Andi Shyti , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Andreas Kemnade , Kevin Hilman , Roger Quadros , Geert Uytterhoeven , Magnus Damm , Patrice Chotard , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Linus Walleij Cc: Bartosz Golaszewski , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3406; i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id; bh=Aessx24OljIFWC+mc2LsHK/66rMxd0lRq5JDSMHPZrs=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBpSmk6CFIKSo02FUVtncKxbJmpddSLBsdGwlGxk 3xgKHq5LdWJAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCaUppOgAKCRAFnS7L/zaE w9lvEAC6IPKCIFxQKEcT0e9etvsanf7pMOhUQltvitPug6OEIG0KYMeK/K84tQWkYK1rDNEM9+S VInnmCouxiX6wvyRpsmIWYdoTH3Hx0NwbMAtenLaYgj1HOqPC/2T4EfL2fhIHFks+HcwQJQtX/U 6IJHl2gOPKIqt/Nsdy7uhRu+dsZtrmTox0QcIWDnQ2u1AJHSOPrUWAP2bziaEPzvN7wMFnmMI0L yWjqOuw6piX/7Jv7xgdIphnmGvtOjVJY8CN7EzZPssJk52TGwSu4jbPZ+oh+VVPDc5ednw2LJcG GbY06fhDBfb2tk7U5drjc/kU27DZ7CjOZoBeGXE3FMBPIKQBarOf+PxOssqRC6+0y+CfpBs/DWW rk1QSObI9tMRBTzeqAMF8jCp6dqEm7lHH21J+CnG3Ed1AFcnI9zYtDqbK4FKGKA2z6wgf0gwQbZ 48KFlz+jGZHxm7KimHiLcfu5XZqlSW0GKFLwH++KbYffIP0VH8DrDBU4X42xbIZr/WaBfen+HLG tgpottRsMj2BslGnnqPwbYb70GrH0NM1WEm1Afevt9odAaChxpRNm0sHJHpnE7mukt8NUqfWiVO 19KRrejHoawa94lLIdae41mcZ60Yr/TOm8q9qNfStSjmOFamByZqVSisccC+ixsP/EnQD1TXsYA hicHpNR/3lUOyWA== X-Developer-Key: i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Authority-Analysis: v=2.4 cv=DPiCIiNb c=1 sm=1 tr=0 ts=694a6949 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=_sFN2lLQU9JdPEgOWvQA:9 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-GUID: KdDKHhEmHz6RqB0zuPAmMRxxjjtjsfEd X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjIzMDA4MCBTYWx0ZWRfXzbcaNegOQlNU FyOGFMaAsyeY8ElFeEXCM4v2fsMLtcnN2fr47ZXxy46bqnyBhJX3VJJcC73K5HokYcNSd/bSswf AcofUrEBfEKd+bMiQEO4ihvEizPn42Kxik2TPFBa0lu0ipbeO83LpjOKb5LHH2fo1w/jHX4ANv3 ePx2oAl7+FAQNeDuv9WlHzviaUfnyAZZMvd7RO2PCPAL5QFu5J2cvHhPZr6JjIurO3w6xRee7aX h+5PT+Y5SUuEvXmUZ/Vl+YvydPxnquCfqGDeyROL9KVpw8b+69vqJt4TDFf7hl3ypzWXzYMsqMp iogfrDirZZIpXooAkN0u3ntpRnHfJKjXIN8EYQfYTpdtmZ4oFjhIlJfL52DA0eDxgU3262Q6fKu s1Kzo2gwIodGxP4jTxMfCaGCq+7MgNXQ5CXj8bDMR4i9rznQVclGL4MGiXULxLZZ4Z9rClrvO4t bp8PbSlgOsTVFXNoukw== X-Proofpoint-ORIG-GUID: KdDKHhEmHz6RqB0zuPAmMRxxjjtjsfEd 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 phishscore=0 priorityscore=1501 malwarescore=0 spamscore=0 bulkscore=0 impostorscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 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. This series addresses the usage of adap->dev in probe() callbacks where drivers assign the parent device address and the associated OF-node directly to the struct device embedded in i2c_adapter. We extend the latter struct to accept the parent struct device and of_node directly and make it assign it to its internal struct device inside i2c_register_adapter(). For now just 12 patches but I'll keep on doing it if these get accepted. Once these get upstream for v6.20/7.0, we'll be able to also start converting i2c drivers outside of drivers/i2c/. [1] https://lore.kernel.org/all/20251106152330.11733-1-tzungbi@kernel.org/ Signed-off-by: Bartosz Golaszewski --- Bartosz Golaszewski (12): i2c: allow setting the parent device and OF node through the adapter struct i2c: qcom-geni: set device parent and of_node through the adapter struct i2c: bcm-kona: set device parent and of_node through the adapter struct i2c: keba: set device parent and of_node through the adapter struct i2c: omap: set device parent and of_node through the adapter struct i2c: rcar: set device parent and of_node through the adapter struct i2c: st: set device parent and of_node through the adapter struct i2c: mxs: set device parent and of_node through the adapter struct i2c: highlander: set device parent and of_node through the adapter struct i2c: gpio: set device parent and of_node through the adapter struct i2c: nomadik: set device parent and of_node through the adapter struct i2c: bcm2835: set device parent and of_node through the adapter struct drivers/i2c/busses/i2c-bcm-kona.c | 4 ++-- drivers/i2c/busses/i2c-bcm2835.c | 4 ++-- drivers/i2c/busses/i2c-gpio.c | 2 +- drivers/i2c/busses/i2c-highlander.c | 2 +- drivers/i2c/busses/i2c-keba.c | 2 +- drivers/i2c/busses/i2c-mxs.c | 4 ++-- drivers/i2c/busses/i2c-nomadik.c | 4 ++-- drivers/i2c/busses/i2c-omap.c | 4 ++-- drivers/i2c/busses/i2c-qcom-geni.c | 4 ++-- drivers/i2c/busses/i2c-rcar.c | 4 ++-- drivers/i2c/busses/i2c-st.c | 4 ++-- drivers/i2c/i2c-core-base.c | 5 +++++ include/linux/i2c.h | 4 ++++ 13 files changed, 28 insertions(+), 19 deletions(-) --- base-commit: 9448598b22c50c8a5bb77a9103e2d49f134c9578 change-id: 20251223-i2c-adap-dev-config-9403ab811795 Best regards, -- Bartosz Golaszewski