From nobody Mon Feb 9 02:51:07 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 48E742D6E66 for ; Fri, 16 Jan 2026 11:01:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768561308; cv=none; b=CwDQbAoel/Tr+9yHczyazi0e1dwwsw9i+8hq/dtYoF7pjong+tl3SDerSITiq9yv9YXkq9paQOXVurMjSr8eYC0MdmR2ZlXII7J7IEdx1Fjxw/+USfApkY8WnJMIHcWrKSrMJNkzrqEasDym8H9oIX92Lo6Z1hPVHSzWgpi9+kc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768561308; c=relaxed/simple; bh=cbd7AwwqnuTUkpz8+zWe0j58Sr2NVaIMo1YZHRMH8Xs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nE1x3DOP1YKIaR+uKFKLW7TyfW09LMK5zhWIkUg1zKYr7dofYR+uJGrocTN7xI1okD4e5eSvUmhyC7DoYsvXUR0mD7MF4qVeZEUU5V+rDideDVdS9GcFbbUbK1EB4izQFovChCBKXHR9J8RWXZJu7r1cCJZ8Mn8tuxePtK0t5RQ= 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=TUfvFCgO; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Q5yKgvTy; arc=none smtp.client-ip=205.220.168.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="TUfvFCgO"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Q5yKgvTy" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60G87M8A3596332 for ; Fri, 16 Jan 2026 11:01:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= q3+ApZVcjI+BZFgiz+bLack8nycUjHTjv0OpkEFL1Ks=; b=TUfvFCgOLfz8p9cX 4Hwc5MHB7Zsn3bBzqys3w2NDHm3T//z1MuvkJHZYJZOxO/RZAIfDE/QsggPcKM6P 4UISVOlYN4mMWzJKc8INSwfR3WgKIrkIWUuyFsyTaW/rlxVykBcY34eV/jjxE7pe a7BDDICGAuCroSiF+ejr+eJ3T0a/+IfZsnVJm0Kuk0m/zE5pKDOrHzwofMggrnZx 7koZdbTKcNEV55GHf2jo1iW7eYT3LqbpoDEPH9TzrtwRniyCqT/7224iajucA+QU zHnufo+DkokIItJYblVy/3Tbv9wzhi+CWvrJn116/lc6Z1JnMHzmNcBMCJBfftTO jDdh5A== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bq96rsvyj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 16 Jan 2026 11:01:34 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8b2194e266aso497507385a.3 for ; Fri, 16 Jan 2026 03:01:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768561294; x=1769166094; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=q3+ApZVcjI+BZFgiz+bLack8nycUjHTjv0OpkEFL1Ks=; b=Q5yKgvTyoCD2EVSgw0qwZLDyn8TEgReWJBVnBjNardij8W9WJ61EYnLdHX+2DVE3m3 CH0yi6tdE3zsXCQxOIJeEZDCvTfdz16zhjAqxthKm4M/5OYPaaN1hoCcLdFkHhHffol+ yM0suZIQiUg8dSwnTPxVi1uwKG7tOQBWW3Weu5qHd0a5mxNBeSpB9JY8bd94o3uJ6C1y xzQlkGnCLHbd7Hif+ZmUk2nJpSpnN7kQTksmLLmAPPiopEY8ZySv9CCuIYBtO5NilJdD wjaQoTVbdJt20aUXtjRCkke9BEg8VS6+6yjvPjT9qRm5VHpigf3q/meS8B9r6/ganCJN mEbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768561294; x=1769166094; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=q3+ApZVcjI+BZFgiz+bLack8nycUjHTjv0OpkEFL1Ks=; b=QRoB28hKZaXHc1jjnpS6wQH6DbC9SpWM//PDODzr93I/UG42M6898L4VyLFlX7xKWs rtjhZFzuSQvjLpOs0lgJUTMYhR4Y7KCl2nNcV6itl2mIGMuaMtx2lFE9MzAKvUQ86+At 1L8LUIuWX0LuuVb2xZpb9arnui62CkLGudTjHxWKO+PHHkT5FP9+ZIyD29jge7wkY8MR i6gP4jisnksAmyae1NWu3QysZPw/M9cnUiawS0+mYuINXJsIKNS3yDPkezigEhiXfh0D X04T92Pkt6Jp1YdBSBocIMdalnXq6fyHSMOo1t+NqvpsCbVTsS/k8GAef1/xYV//9hcd pkIg== X-Gm-Message-State: AOJu0Ywq16QNhs2mldB5tnYRU72cGDfFtRSbm7dan5puvEwEdv6lNM/5 WSLdBs4fUxzYtYBsytkS7r7+1OIvTdzZGn9/bCcy4j8K9Q31cxexPgZn+3TdjpdMWls88pb5LVC pn2R6KRUcieD2vlTI6nmcDBU0D/NU5BE063q7YTCERoS+aGrDziFXp3/m7zFeCQWlX1v74zhIIq g= X-Gm-Gg: AY/fxX4SSfhWAJZp8garA7sQQY3lKuT14GnCIDAGk2DtfhDhWcDJBPXArliXbb9VLSC XaG0wJjYKf6JtY+EIMdQcyZaY9R29vbaGazlQnsXleelBy5V//J7Wh6SP1Bvxm+3SvIM2kKWMUZ YxjDAjWD2tYtisgOIdf7sj8RBIdxkzM/JjQZvQKpUEvArSJFEpORJiGcHQdcMiRL72r+TtHxoyX /qFYsUqIO6x9vv6TvcPVDnnE3LhZFCzDOuloIYo4GfMC0YGYdTEJop32HqMhVwvsmQQsWytqFHd 5lT4+tBKSuLlkTr0nj2Hds6uprEjFU3HO2wz0LPhCLrTppjUoamsuL51Adzz44RFfNKyBsjL4FT zyzjizIC+Yk2Dewah30IaxwcsVH4jOYNhPwD3Fcs= X-Received: by 2002:a05:620a:472c:b0:8b3:c8ee:7240 with SMTP id af79cd13be357-8c6a66d21f0mr380989085a.5.1768561293182; Fri, 16 Jan 2026 03:01:33 -0800 (PST) X-Received: by 2002:a05:620a:472c:b0:8b3:c8ee:7240 with SMTP id af79cd13be357-8c6a66d21f0mr380982785a.5.1768561292589; Fri, 16 Jan 2026 03:01:32 -0800 (PST) Received: from brgl-qcom.local ([2a01:cb1d:dc:7e00:d1c:5bb0:db13:fc7d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47f4289b789sm93512975e9.1.2026.01.16.03.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 03:01:32 -0800 (PST) From: Bartosz Golaszewski Date: Fri, 16 Jan 2026 12:01:14 +0100 Subject: [PATCH 7/7] nvmem: synchronize nvmem device unregistering with SRCU 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: quoted-printable Message-Id: <20260116-nvmem-unbind-v1-7-7bb401ab19a8@oss.qualcomm.com> References: <20260116-nvmem-unbind-v1-0-7bb401ab19a8@oss.qualcomm.com> In-Reply-To: <20260116-nvmem-unbind-v1-0-7bb401ab19a8@oss.qualcomm.com> To: Srinivas Kandagatla , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=8594; i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id; bh=cbd7AwwqnuTUkpz8+zWe0j58Sr2NVaIMo1YZHRMH8Xs=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBpahqDXIcckAEtCkXWwYbEDY/7kNaps4/eRO/au JAwnqXSII+JAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCaWoagwAKCRAFnS7L/zaE ww9dEACYNDHYMymXKGJIAtDCZmiDhKNCcqJc7wthIOfKxlOUfMx+VstLmcx/sWFDJcNRff+M56b inmIH7AzddAXzU1dpZjRUoNAt6fAhXC9gXXgm4R682a+vdAH6skIIw3bH+/jzNYzqH9y+wHXE3R J3crQx7tRTJgTHZEBvRFvsHQUlsXIeZkLBHxLxZDFBVzXokRHea9TM0md62vWsh5Owe1wkaPYRU TMIgB1xJxgiDLAl+PRcKpqHYRv4DOL0JJus8ejMavB93IpmxW2Pd8x8azdpzsCqNahBmcpw3cgV iBgjBmZa5e/ft5oeTW69jqPh2+AkD9zG3YqsRTIuelLpgkMKTdRyjwQUrn2uUZNF/LnZXVsJScz 5LUhx6PThOUa1FBr11n+kcyhTimTPCqdTNcCoL4Z7L8NnfKg4gWQzuk5wB0/oXoHMDsgaMzpUnM ZQ23uCJbuu9B5lTIT19FsZgLUPfyqO3wu5TOzmSA7yjzbiE0g2M4cXjNIwIL0n3EGBPsPm5qRun nE/VC+zkBs6Hk/cdNjejPEPzB3WCfd/pwNKarbh0viO5i52YOd1GPTbDW6jPGxX61pW51O2YUq9 b5XDo71vnUcTKtm3Jf8RiHaur+G9sveeZQ98SbDQyZVmcVkSiApPuXa1XxyaCj4l6uhQ3d991Fx Z/BmoN+6Sb4EL/g== X-Developer-Key: i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE2MDA4MCBTYWx0ZWRfX7STwzn3/YgOb SJwA65lXqKNgmS5tqVbqICONZdjjFOx+TrBf+rDdd/bCNZLj7UrOpFKt7HdqqMKCJNEvL8g/KsH tEAZMC/YWQEojypQ840MUpZehwylJz8/IXn/sz5+hnG/Lrvg0c4Z5VfNR3v6YO1UFYxgpGKxBqn jccnHFt0M4ViyMFcIsvq8cashxSyUB7NSpYXRBg6PXze0ejerpXlJtTuD3W4dSnFaptIV6tEoq9 9mLSQua2RPhXgjzA2I8BUDnf3232+oDdOs6BIfw9UFAXMXD4dcEtUEfPN+3it4FXGaqEm5ycnXT Pc+Ylsz/6w+idGdjrneKAvw9LrBfa/nx72ndlvkdFpG2PZGSxUb0WQP1xsoBVwiVouZVVB2bTCa Ug81DfK02Xa9/uQRK2pB0C+8dCPUu3XUNBTNCT5dAHqo1YZ5JflWVAMGrckyHWQO8gwQdN82QB9 iIrr8Dr8wGsNBBbKMAg== X-Proofpoint-ORIG-GUID: EZIi7L9JDjeZRbTAQncAvbUxmipL8wsF X-Proofpoint-GUID: EZIi7L9JDjeZRbTAQncAvbUxmipL8wsF X-Authority-Analysis: v=2.4 cv=TsTrRTXh c=1 sm=1 tr=0 ts=696a1a8e cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=4mtZ5t8G80LWl5GVAOAA:9 a=QEXdDO2ut3YA:10 a=IoWCM6iH3mJn3m4BftBB:22 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=2026-01-16_03,2026-01-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 phishscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 adultscore=0 spamscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2601160080 With the provider-owned data split out into a separate structure, we can now protect it with SRCU. Protect all dereferences of nvmem->impl with an SRCU read lock. Synchronize SRCU in nvmem_unregister() after setting the implementation pointer to NULL. This has the effect of numbing down the device after nvmem_unregister() returns - it will no longer accept any consumer calls and return -ENODEV. The actual device will live on for as long as there are references to it but we will no longer reach into the consumer's memory which may be gone by this time. The change has the added benefit of dropping the - now redundant - reference counting with kref. We are left with a single release() function depending on the kobject reference counting provided by struct device. Nvmem cell entries are destroyed in .release() now as they may be still dereferenced via the nvmem_cell handles after nvmem_release(). The actual calls will still go through SRCU and fail with -ENODEV if the provider is gone. Signed-off-by: Bartosz Golaszewski --- drivers/nvmem/core.c | 115 +++++++++++++++++++++++++++---------------= ---- drivers/nvmem/internals.h | 5 +- 2 files changed, 72 insertions(+), 48 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index f6892af8ace52d033846f4052722289c2aa826df..1acc65026eb5094658e5523104c= 649a280bfc471 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -57,7 +56,12 @@ static BLOCKING_NOTIFIER_HEAD(nvmem_notifier); static int __nvmem_reg_read(struct nvmem_device *nvmem, unsigned int offse= t, void *val, size_t bytes) { - struct nvmem_impl *impl =3D nvmem->impl; + struct nvmem_impl *impl; + + guard(srcu)(&nvmem->srcu); + impl =3D rcu_dereference(nvmem->impl); + if (!impl) + return -ENODEV; =20 if (!impl->reg_read) return -EOPNOTSUPP; @@ -68,9 +72,14 @@ static int __nvmem_reg_read(struct nvmem_device *nvmem, = unsigned int offset, static int __nvmem_reg_write(struct nvmem_device *nvmem, unsigned int offs= et, void *val, size_t bytes) { - struct nvmem_impl *impl =3D nvmem->impl; + struct nvmem_impl *impl; int ret, written; =20 + guard(srcu)(&nvmem->srcu); + impl =3D rcu_dereference(nvmem->impl); + if (!impl) + return -ENODEV; + if (!impl->reg_write) return -EOPNOTSUPP; =20 @@ -289,10 +298,14 @@ static ssize_t bin_attr_nvmem_write(struct file *filp= , struct kobject *kobj, =20 static umode_t nvmem_bin_attr_get_umode(struct nvmem_device *nvmem) { - struct nvmem_impl *impl =3D nvmem->impl; - + struct nvmem_impl *impl; umode_t mode =3D 0400; =20 + guard(srcu)(&nvmem->srcu); + impl =3D rcu_dereference(nvmem->impl); + if (!impl) + return 0; + if (!nvmem->root_only) mode |=3D 0044; =20 @@ -333,7 +346,12 @@ static umode_t nvmem_attr_is_visible(struct kobject *k= obj, { struct device *dev =3D kobj_to_dev(kobj); struct nvmem_device *nvmem =3D to_nvmem_device(dev); - struct nvmem_impl *impl =3D nvmem->impl; + struct nvmem_impl *impl; + + guard(srcu)(&nvmem->srcu); + impl =3D rcu_dereference(nvmem->impl); + if (!impl) + return 0; =20 /* * If the device has no .reg_write operation, do not allow @@ -537,24 +555,6 @@ static void nvmem_sysfs_remove_compat(struct nvmem_dev= ice *nvmem, =20 #endif /* CONFIG_NVMEM_SYSFS */ =20 -static void nvmem_release(struct device *dev) -{ - struct nvmem_device *nvmem =3D to_nvmem_device(dev); - - ida_free(&nvmem_ida, nvmem->id); - gpiod_put(nvmem->wp_gpio); - kfree(nvmem->impl); - kfree(nvmem); -} - -static const struct device_type nvmem_provider_type =3D { - .release =3D nvmem_release, -}; - -static const struct bus_type nvmem_bus_type =3D { - .name =3D "nvmem", -}; - static void nvmem_cell_entry_drop(struct nvmem_cell_entry *cell) { blocking_notifier_call_chain(&nvmem_notifier, NVMEM_CELL_REMOVE, cell); @@ -573,6 +573,23 @@ static void nvmem_device_remove_all_cells(const struct= nvmem_device *nvmem) nvmem_cell_entry_drop(cell); } =20 +static void nvmem_release(struct device *dev) +{ + struct nvmem_device *nvmem =3D to_nvmem_device(dev); + + nvmem_device_remove_all_cells(nvmem); + ida_free(&nvmem_ida, nvmem->id); + kfree(nvmem); +} + +static const struct device_type nvmem_provider_type =3D { + .release =3D nvmem_release, +}; + +static const struct bus_type nvmem_bus_type =3D { + .name =3D "nvmem", +}; + static void nvmem_cell_entry_add(struct nvmem_cell_entry *cell) { scoped_guard(mutex, &nvmem_mutex) @@ -951,7 +968,6 @@ struct nvmem_device *nvmem_register(const struct nvmem_= config *config) goto err_put_device; } =20 - kref_init(&nvmem->refcnt); INIT_LIST_HEAD(&nvmem->cells); nvmem->fixup_dt_cell_info =3D config->fixup_dt_cell_info; =20 @@ -959,7 +975,12 @@ struct nvmem_device *nvmem_register(const struct nvmem= _config *config) impl->reg_read =3D config->reg_read; impl->reg_write =3D config->reg_write; =20 - nvmem->impl =3D impl; + rval =3D init_srcu_struct(&nvmem->srcu); + if (rval) + goto err_put_device; + + rcu_assign_pointer(nvmem->impl, impl); + nvmem->owner =3D config->owner; if (!nvmem->owner && config->dev->driver) nvmem->owner =3D config->dev->driver->owner; @@ -1064,32 +1085,28 @@ struct nvmem_device *nvmem_register(const struct nv= mem_config *config) } EXPORT_SYMBOL_GPL(nvmem_register); =20 -static void nvmem_device_release(struct kref *kref) +/** + * nvmem_unregister() - Unregister previously registered nvmem device + * + * @nvmem: Pointer to previously registered nvmem device. + */ +void nvmem_unregister(struct nvmem_device *nvmem) { - struct nvmem_device *nvmem; - - nvmem =3D container_of(kref, struct nvmem_device, refcnt); + struct nvmem_impl *impl; =20 blocking_notifier_call_chain(&nvmem_notifier, NVMEM_REMOVE, nvmem); =20 if (nvmem->flags & FLAG_COMPAT) device_remove_bin_file(nvmem->base_dev, &nvmem->eeprom); =20 - nvmem_device_remove_all_cells(nvmem); + impl =3D rcu_replace_pointer(nvmem->impl, NULL, true); + synchronize_srcu(&nvmem->srcu); + nvmem_destroy_layout(nvmem); + kfree(impl); + gpiod_put(nvmem->wp_gpio); device_unregister(&nvmem->dev); } - -/** - * nvmem_unregister() - Unregister previously registered nvmem device - * - * @nvmem: Pointer to previously registered nvmem device. - */ -void nvmem_unregister(struct nvmem_device *nvmem) -{ - if (nvmem) - kref_put(&nvmem->refcnt, nvmem_device_release); -} EXPORT_SYMBOL_GPL(nvmem_unregister); =20 static void devm_nvmem_unregister(void *nvmem) @@ -1149,8 +1166,6 @@ static struct nvmem_device *__nvmem_device_get(void *= data, return ERR_PTR(-EINVAL); } =20 - kref_get(&nvmem->refcnt); - return nvmem; } =20 @@ -1266,9 +1281,8 @@ EXPORT_SYMBOL_GPL(devm_nvmem_device_put); */ void nvmem_device_put(struct nvmem_device *nvmem) { - put_device(&nvmem->dev); module_put(nvmem->owner); - kref_put(&nvmem->refcnt, nvmem_device_release); + put_device(&nvmem->dev); } EXPORT_SYMBOL_GPL(nvmem_device_put); =20 @@ -1655,6 +1669,15 @@ static int __nvmem_cell_read(struct nvmem_device *nv= mem, { int rc; =20 + /* + * Take the SRCU read lock earlier. It will be taken again in + * nvmem_reg_read() but that's alright, they can be nested. If + * nvmem_reg_read() returns -ENODEV, we'll return right way. If it + * succeeds, we need to stay within the SRCU read-critical section + * until we're done calling cell->read_post_process(). + */ + guard(srcu)(&nvmem->srcu); + rc =3D nvmem_reg_read(nvmem, cell->offset, buf, cell->raw_len); =20 if (rc) diff --git a/drivers/nvmem/internals.h b/drivers/nvmem/internals.h index 05197074799ff3e2a6720f6552878a9e1354a5c3..5afb1297a93a38e399085391130= c4df99f64af16 100644 --- a/drivers/nvmem/internals.h +++ b/drivers/nvmem/internals.h @@ -6,6 +6,7 @@ #include #include #include +#include =20 /* * Holds data owned by the provider of the nvmem implementation. This goes @@ -20,11 +21,11 @@ struct nvmem_impl { struct nvmem_device { struct module *owner; struct device dev; - struct nvmem_impl *impl; + struct nvmem_impl __rcu *impl; + struct srcu_struct srcu; int stride; int word_size; int id; - struct kref refcnt; size_t size; bool read_only; bool root_only; --=20 2.47.3