From mboxrd@z Thu Jan 1 00:00:00 1970 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 AD0A03E7BA6 for ; Tue, 9 Jun 2026 07:53:15 +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=1780991597; cv=none; b=Zu8aHNto+INH19i3PJxB/VZMkZaZKBZsddXoZSIu2aBrrEqs/cQ/gONuLBr/oMO3DdQ2u6bRDO2+U68Bpecv5bwvsohHQ8TEfvzDptapwRnw4ifJ/t0Lie6wZn8qnq20CVoRnXu8hii1YlaXNDzJHrkFMoLIfBgnKVm2+k2WXOA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780991597; c=relaxed/simple; bh=53MOC5eqOHfTcv+JZmgCH0zadWL/SAMKYW9OpqKopEo=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=FHHbpaJ/Y2CxgDH6OyIJhcPP6QwrQ3+CjMTnzj5XiNjjoxr6e3fNx91u7CXGCkn9s7p6F0lF1Yjo9fJU2w4YHAbDcWVrUvrNeePqSUejHQHpGQO3s8pgmQ9GExL5LSqe8InvSbYv2OIjeFyDqyWbTSLpGpG5tLuOMlm+rvDvxeU= 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=WR2QPOXw; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=baW9WMIH; 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="WR2QPOXw"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="baW9WMIH" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6597j88E1566638 for ; Tue, 9 Jun 2026 07:53:15 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=Bc3f7a+PYfloRmVgEBrBcp B0oTfwi5E+mma25qPWbOk=; b=WR2QPOXwAlDHo4kjWwPXq3+xqjQzqWZz/pOcCn u1uCdF685AbfbOlFdnPrcH/j6V7rO8USss5dSXfwz89jmNigTZUeMK3NonHngtfK G/8yYKsOkYlsr4g3ARnOMmaF5EHU5PzGgc8apKsYdw1r7iq4ZIsWfK54nJGNKH9k 8vxKIh55tLswEYjd1yGZVHvYGYYJWlji4dYKCdbjd9z8DR8G7Ws0zLD8v4d2/Tnj /WxErNGnw/JruqCd1kh1DdW3HZMMiwE5IlWw2ltxTM4Sg+dzaIbRstne4GFjzOAZ 9owjpFeQyLPNhq/p2duVdx940wVJp6iLnCh6O4NCeXflyThg== Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4epeqgg14e-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 09 Jun 2026 07:53:14 +0000 (GMT) Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-51787404d3eso93325491cf.1 for ; Tue, 09 Jun 2026 00:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780991594; x=1781596394; 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=Bc3f7a+PYfloRmVgEBrBcpB0oTfwi5E+mma25qPWbOk=; b=baW9WMIHSUnREDgNc+MVXeEfoL40sOQjk4QsFU6UcdoIFjOnz7eAk0eh97KXbnmYnL ohvmj7I5427qqJROSPGI+/+Q47djQZeVYHux5Ey7JGY8UN0kgr5DsY3/pYT+YvYTmSNB yqgCu+0ocWOO9w6tr0Oz7OdydOdUEhlUig0j0xN5lTsoKBbNR3TXJgpv+2Yv1EJORz9v 2Ab2+CV8xfvtQa327ZTZKn9J/avfsZD+0Bb2IQIqGfnmVW6SUwTIV8xmzITM8zIhm4o7 5eQ5fT4h62q5IRlH6hiASLRnjipXlwNrl6fz9T1RP3YjLsVJCHQe2x7XpEvUPsay6gUG KNmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780991594; x=1781596394; 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=Bc3f7a+PYfloRmVgEBrBcpB0oTfwi5E+mma25qPWbOk=; b=CrvIxBGMj4cev1CmjkiqaKxeGFfBsTlb+phY8A4EyK7c8+2Szp0cnCJBFFAzrAhVsU ijqXs4ccgXDF562S+DGDwcVn9sePX/+bP9fU1K7paWyuHurZcaa4/A1LD7rB/r6phQP9 o1v/4p4g1nA+LPOFbU6o2nUpdJo2AMkyfZF0rJyZfi6uLUHij1bojlEl2te4nMufDsj7 CEqLqFTD74Wxz8SEcbrK0FjtMXaQza/XGy/3JxzEAM3h3lU66mJ8uHtw3jAjxJJvYrM1 lySPyVdP0xPhxS9SAHfQce0tjFzE9LEwjcYGdUIJgrzjzwxO7NnSHjBG1ShmcpF7pMWn gB4w== X-Forwarded-Encrypted: i=1; AFNElJ9kHXjJJgfR8TrLwE0CMiH78ETxbTBRAthYzdQe9xN4lTHhYfppv4JeJa/2M6SKCH98vZOkZJxPtRZV8mk=@vger.kernel.org X-Gm-Message-State: AOJu0Yz6HBS0uwMv5lDNvNP7yldJ22tLIz9YENdnIfb1xbTOEmoT5co0 Rj1QyMudOUIvFNf9VPp3JyONg31s1mKbT58kU7ONH7ZOqXtOZ380fC005EKOOu/uxFON6Hpgcxi a/Qf6i7YObAgL2OuUAG+iClQ5TxGdgQUuHcrx73W1yYZN/DIuM83v27jxGNQvjyE0PCs= X-Gm-Gg: Acq92OFLd3ke4cynBFIj8Ofsk2JTlE8eLJaFynBvHSvVgE/dBGcpFPIlTb3+YIZRgKE reTgccikd/vgz03yAXy2U/VuMCqpbwrlxz4FyEWnk5jy0CgxHKpnYz9BLQhyBaR3LQ9s9cPsnxA 04/vBVxlPJ7yCnsLd+J7SYr6bsfcWvDLhDjrxt/hQSEtKDVUw8q0PfLcdWfIOt1HPATVZnCD7au Ggctooc9c943hozODcoOI28SUQmZwvzHUO4NVaZToKYCkx1jgkaAK8eNc7uccNZZiUZOtgdH3zp jckahPUvCd79nsTcYNmDelRp3CUR1itW9COi2Zcu0YtvZZWRus+uJFl8Z9w2lu0aRlPmtMs2XY2 wMcxY/PazQw30KzAX7BBUMHMCoHYwSoMu7wLs35SboRCZy4iblFNPLlfoaKWJ3tGptvGMn5NhMX OEKG18t8Xmsdm1QpVH3zKs7RN7aM58VfaeRPmvsoyFVrGRYbkYibm6tnyXh5oqccOTEDrigNMD0 Eg02/xue71r X-Received: by 2002:a05:622a:120b:b0:516:d73d:2a34 with SMTP id d75a77b69052e-517959d300emr266975621cf.5.1780991593757; Tue, 09 Jun 2026 00:53:13 -0700 (PDT) X-Received: by 2002:a05:622a:120b:b0:516:d73d:2a34 with SMTP id d75a77b69052e-517959d300emr266975221cf.5.1780991593301; Tue, 09 Jun 2026 00:53:13 -0700 (PDT) Received: from QCOM-eG0v1AUPpu.na.qualcomm.com ([2a01:e0a:830:450:cc96:22ae:323b:9eff]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-68e64303892sm8121631a12.0.2026.06.09.00.53.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 00:53:12 -0700 (PDT) From: Loic Poulain Subject: [PATCH v4 0/8] Support for block device NVMEM providers Date: Tue, 09 Jun 2026 09:52:25 +0200 Message-Id: <20260609-block-as-nvmem-v4-0-45712e6b22c6@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=H4sIADnGJ2oC/3XOSw6CMBCA4auYri3pg0Jx5T2Mi4EO0ghUqTYaw t0tbFggm0n+SebLjMTjYNGT02EkAwbrretjpMcDqRrob0itiU0EExlLhaZl66o7BU/70GFH01I yjbo0UACJR48Ba/tZwMs1dmP9yw3fxQ983u5SgVNGMzBCYq54weDsvE+eb2gr13VJHGQWg1gVx fKNIqJS1jxHYxSXKe4oclUytv1FRkWLTPNaMQCp/ijTNP0AkmAc1D8BAAA= X-Change-ID: 20260428-block-as-nvmem-4b308e8bda9a To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Jens Axboe , Johannes Berg , Jeff Johnson , Bartosz Golaszewski , Marcel Holtmann , Luiz Augusto von Dentz , Balakrishna Godavarthi , Rocky Liao , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Srinivas Kandagatla , Andrew Lunn , Heiner Kallweit , Russell King , Saravana Kannan Cc: linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-block@vger.kernel.org, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, daniel@makrotopia.org, Loic Poulain , Bartosz Golaszewski , Konrad Dybcio X-Mailer: b4 0.14.2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjA5MDA3MyBTYWx0ZWRfX5J0uvRcfSKdi RZKpLRtG11UDJXK5NHfCf3ikkXmPVnIPrujWxDlxg7cBPbTKVyjHz0jdrRHb8ddQGSSeE7OKj53 +0rZ+d0Gf5HOYI5T9IlURruwkeDllkrP5Kwv58Xf8sC67kt/fqy8rSoN9DuCRCu5BRC/M7a2ESQ qDhLz/h02mjLdvxxXAlXdUygCYhWx4HyfLimFYhVqKyeynJYnd5/cJsNHYcYVcJCeEoyVh2P/P1 nJOuvmBMU81aoF56QVd/sclkdaoZXGoBKIa33xa7jNMYgYLBbjLQGS3e5l1f1KXKe7J2sVMQlLK BQvOwzOWrADmuhKO5Gnj74wgQtvBZEpZNpaT6e5W5LvPPvE0Fv0+XGFNFJWdJEwO7BdE5xub92A nRAS/GrVLmyFYZzxpFBQotYKLXsekVmnPAquC+J818ap/l7FWE/8vqEUroyE09GSRabanm5F7ih 1uPDrTg4G14Ce80WaXg== X-Proofpoint-ORIG-GUID: ZYfuyrG0ZAWQFNdhIRSashcggxR7bYmY X-Authority-Analysis: v=2.4 cv=KdHidwYD c=1 sm=1 tr=0 ts=6a27c66a cx=c_pps a=mPf7EqFMSY9/WdsSgAYMbA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=VwQbUJbxAAAA:8 a=VT4XjZGOAAAA:8 a=EUspDBNiAAAA:8 a=4dfaE-bLb2wR0_rHmkcA:9 a=QEXdDO2ut3YA:10 a=dawVfQjAaf238kedN5IG:22 a=6CpsfURP9XNmmWg3j1mJ:22 X-Proofpoint-GUID: ZYfuyrG0ZAWQFNdhIRSashcggxR7bYmY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-09_01,2026-06-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 spamscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 bulkscore=0 clxscore=1015 adultscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606090073 On embedded devices, it is common for factory provisioning to store device-specific information, such as Ethernet or WiFi MAC addresses, in a dedicated area of an eMMC partition. This avoids the need for and additional EEPROM/OTP and leverages the persistence of eMMC. One example is the Arduino UNO-Q, where the WiFi MAC address and the Bluetooth Device address are stored in the eMMC Boot1 partition. Until now, accessing this information required a custom bootloader to read the data and inject it into the Device Tree before handing control over to the kernel. This approach is fragile and leads to device-specific workarounds. Rather than adding a new NVMEM provider specifically to the eMMC subsystem, the new support operates at the block layer, allowing any block device to behave like other non-volatile memories such as EEPROM or OTP. This series builds on earlier work by Daniel Golle that enables block devices to act as NVMEM providers: https://lore.kernel.org/all/6061aa4201030b9bb2f8d03ef32a564fdb786ed1.1709667858.git.daniel@makrotopia.org/ It also introduces an NVMEM layout description for the Arduino UNO-Q, allowing device-specific data stored in the eMMC Boot1 partition to be accessed in a standard way. WiFi and Ethernet already support retrieving MAC addresses from NVMEM. Bluetooth requires similar support, which is also addressed. Note that this is currently limited to MMC-backed block devices, as only the MMC core associates a firmware node with the block device (add_disk_fwnode). This can be easily extended in the future to support additional block drivers. Signed-off-by: Loic Poulain --- Changes in v4: - Fix squash issue (dts commit incorrectly squashed) (Konrad) - Use devres for nvmem resources (Bartosz) - use __free() destructor helper when possible (Bartosz) - Fix value return checking for bdev_file_open_by_dev - Link to v3: https://lore.kernel.org/r/20260608-block-as-nvmem-v3-0-82681f50aa35@oss.qualcomm.com Changes in v3: - Fixed missing 'fixed-partitions' compatible in partition (Rob) - Fixed clashing nvmem cells, document calibration along mac (Sashiko) - Remove workaround to handle dangling nvmem references after unregistering, this is a generic nvmem framework issue handled in Bartosz's series: https://lore.kernel.org/all/20260429-nvmem-unbind-v3-0-2a694f95395b@oss.qualcomm.com/ - Validate mac (is_valid_ether_addr) before copying to output buffer - Link to v2: https://lore.kernel.org/r/20260507-block-as-nvmem-v2-0-bf17edd5134e@oss.qualcomm.com Changes in v2: - Fix example nvmem-layout cells to use compatible = "mac-base" - Squash WiFi MAC and Bluetooth BD address consumer patches into the nvmem layout patch - Fix possible use-after-free in blk-nvmem: bnv (nvmem priv) linked to nvmem lifetime - Simplify nvmem-cell-names from items: - const: to plain const: - Factor out common NVMEM EUI-48 retrieval logic - Reorder changes - Link to v1: https://lore.kernel.org/r/20260428-block-as-nvmem-v1-0-6ad23e75190a@oss.qualcomm.com --- Daniel Golle (1): block: implement NVMEM provider Loic Poulain (7): dt-bindings: mmc: Document support for nvmem-layout dt-bindings: net: wireless: qcom,ath10k: Document NVMEM cells dt-bindings: bluetooth: qcom: Add NVMEM BD address cell net: of_net: Add of_get_nvmem_eui48() helper for EUI-48 lookup Bluetooth: hci_sync: Add NVMEM-backed BD address retrieval Bluetooth: qca: Set NVMEM BD address quirks when address is invalid arm64: dts: qcom: arduino-imola: Describe NVMEM layout for WiFi/BT addresses .../devicetree/bindings/mmc/mmc-card.yaml | 29 ++++++ .../net/bluetooth/qcom,bluetooth-common.yaml | 9 ++ .../bindings/net/wireless/qcom,ath10k.yaml | 16 +++ arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts | 39 +++++++ block/Kconfig | 9 ++ block/Makefile | 1 + block/blk-nvmem.c | 114 +++++++++++++++++++++ drivers/bluetooth/btqca.c | 5 +- include/linux/of_net.h | 7 ++ include/net/bluetooth/hci.h | 18 ++++ net/bluetooth/hci_sync.c | 39 ++++++- net/core/of_net.c | 49 ++++++--- 12 files changed, 321 insertions(+), 14 deletions(-) --- base-commit: 47c4835fc0fed583d01d90387b67633950eba2b2 change-id: 20260428-block-as-nvmem-4b308e8bda9a Best regards, -- Loic Poulain