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 8CC7A3D953B for ; Fri, 3 Jul 2026 13:45:21 +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=1783086324; cv=none; b=Gl7Hl8jm5s8JiOBh2q/ScsEcxsWz+BIvr0ch/+EzOoDohGlPyWRwBRDtQOFQzOgTORsiHyMMj6MyXduW2PDq32X/KECtrGYLOUiq9f26M+3m4mcXGZcZ//bFLk5v6t5Ok1pRRPbtv7YicYp1SORh0p+oPnmAeSwy6dM+Ner0Tvc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783086324; c=relaxed/simple; bh=7eReWioRb+Q+/KfAGRVYTSy1rse7P0q70/gtXocnlCo=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=oMEMUBS60W360DVBaIsKSnMfJHEUyZgNdpxXyBlZ0AyqDKppLyE/s0Kd7stalCqhTOlHs6ptyUbNtaOzlWtfcgUP0jWA9GXvBv2e0mUMyith+NmKnwte4WEoql8iEJXVFURXfFlDlMs8Coz0mVQYFx6czTnN+EtcMSLantezR2k= 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=gK54V1c4; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=a0wDD9nT; 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="gK54V1c4"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="a0wDD9nT" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 663Bq2rw3134767 for ; Fri, 3 Jul 2026 13:45:20 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=YZQ9i8ECl/iEEdcBdY078g 6tJYsRn3VFW0APH0rESAY=; b=gK54V1c4g+ZP7nyCcFy/pshCNy9BgG6htW+8fu v1V+om4aFOmwVa/nJTniffCMLFHpCU5q4rNM7Me1+7/9bQH3CwDw3tRqF5uu1A0I 1zC/mczKB9DS+2ezT8PvxD3kWSFNuUKmm+wjvsoNiufs/NAAh1HtGZM5nFMydVHU Zbtf1JUbtn4ddoBqhhFdduy/exsttKWpt+n24Q6OUHi84meCGo6yRGEaTCPKBgzA QX1H0bqT1XGkwXaf4pMTLS/pTVDluvKHJ5c6cDIj+fVmpVxCoGHVQA0NQiPZN32t HJby9+Vg8KP5Xym+yi57LlroU8bK6DC9iOnQGOGYuGKIX5ig== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f65qcjay9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 03 Jul 2026 13:45:20 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-915f6ff639aso106936085a.1 for ; Fri, 03 Jul 2026 06:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783086320; x=1783691120; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=YZQ9i8ECl/iEEdcBdY078g6tJYsRn3VFW0APH0rESAY=; b=a0wDD9nTcd6v0q0DxmUn3OVSh4PoGMgPimmMfYj0zgxuMFI0MjLMylhtgK7dsF7OMX pvcqKWUPE6Nf70fZvrjjcZWsbPihMmdrJ/qoEewG1ERsy//StUUfTzJ6XC62XYFBEY9Z ivx6plEQtJal/o/F1dAU/fWidH3Zyz1xYmQ94gEVWa4dCwIKCru3wMo4t0KSRLobJFwJ Wd6Xcmv6g8P9xq82L4QwkL57Br0RtrsL1xtxwPaeYNEeAm8zGDMyctq/wsYBLcZ/kbAS mK7gtRlN/4oBdQ8V9CuB0OBLoiEqr1rkLADqY8vgy/ajxjkUGdKEVxCRVpzPyTjIgZLr ZCdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783086320; x=1783691120; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=YZQ9i8ECl/iEEdcBdY078g6tJYsRn3VFW0APH0rESAY=; b=pye2D6zEtW48ppIyYI7oDul/CD2pIDM2j0z21qXfg6LrHAfvy13dfBIa5Zh7v7Tpe5 V4z2abs6v3L4GBktML2rqc2M9XPliGVxBJRQ+u5OailNrHOXfZg/ct5CCH1waqN+BN5X oXGKnnMa3kplk9rRr3KBvq/7cnEOPrqVKpLtQZWGIOSVlN8s46Yk1XpmLCZBGNa/L/kN 9GyvI060qAuYVVkBenKBl2KsUZ08XfmV4F2fA9QldVVPhT60YCT4l0Ged1Ob2JKzR0Fs EMoM8Oo2VCtNLED0pUAEk65g4dYqPRIrpYrZebmbPKxOHbRt+L2+OaF8dO1AjY6JGRm/ igww== X-Forwarded-Encrypted: i=1; AFNElJ8xB0q8BDtGXf5liq+D6rTztYKLF+saBgxz3jU6V45+UlP+vdzgjcfoD/dLoWMs9VmIhdD3ea/+7bAuQg4=@vger.kernel.org X-Gm-Message-State: AOJu0YxkZu/faEthrnodySQaMVGfSDcDYsqfDIx0MnEdKQPGsqpBO2qZ sMG0POLDsp6RZeEePLjws8c97vxJa2zXkw7NJWoYirEaar5cEH6UXdjWn+fwtMKtv83HqRmOMB/ vaU5ceqPAxRQzHG4AlndVyLRIc2ixaSJjoBcHzT2nYAU0qZuwTlUqKZRO2gfZXht/y/TjrunbX5 UbUw== X-Gm-Gg: AfdE7ckaaby0P2DvrYigH5idYkobgC38fuqCbcQ4aO0Xf4YQ8OlHmAvGQF+LkwqVA2a fGi2vem49JiJtgB1hzyFUlw3sLF2ZTP+ved034e8bC/ihMbsWBc4a9haeEsNqDEp3k2FU0t288p iDPNwyLO8s+9Qf4pPPElLvrHlp77R4P5jFC+EDfnikcbRs5MMcvsTmRQ8mEofHagc7IwH8HQHhq 9SjvU2vABvgGzqhtDirS1dIryfLhneIRi6GySUVO25fZWW6PjxBD2iuadQfMDUb+fCzUxgpNhhX zLsMIbpFsZ9YL0ALZKStsvhjl6TcFN+Ta8M21F0JnoP+78el5CiWhk7fKgcV7jLSHj6u5XD+NOT /nCHEiy55gpjc18HVP2+t++xD1hj9cexNUqPJotj81WCt/mBjulLdDyIiL05RH92u7IrFgwO+Zw pF0jW24TgV3u0c/5DmbfAkCUKEFcIhOz/nHrbTOlqClBiCV+vshAVODWGkYxaBjlo= X-Received: by 2002:a05:620a:4149:b0:925:eb05:d194 with SMTP id af79cd13be357-92e78500b33mr1373517285a.57.1783086318916; Fri, 03 Jul 2026 06:45:18 -0700 (PDT) X-Received: by 2002:a05:620a:4149:b0:925:eb05:d194 with SMTP id af79cd13be357-92e78500b33mr1373500085a.57.1783086318132; Fri, 03 Jul 2026 06:45:18 -0700 (PDT) Received: from QCOM-eG0v1AUPpu.na.qualcomm.com ([2a01:e0a:830:450:809d:5d56:19d9:ff8b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c12b6059e4csm286135466b.1.2026.07.03.06.45.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2026 06:45:17 -0700 (PDT) From: Loic Poulain Subject: [PATCH v8 0/9] Support for block device NVMEM providers Date: Fri, 03 Jul 2026 15:45:13 +0200 Message-Id: <20260703-block-as-nvmem-v8-0-98ae32bfc49a@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: 8bit X-B4-Tracking: v=1; b=H4sIAOm8R2oC/3XQz2rDMAwG8FcpPs9Flv+mp73H2MGJ5TWsSbZ4C xsl7z61lxS8XASfQD/EdxWF5p6KOB2uYqalL/00cghPB9Gd4/hGsk+cBQI6MBhke5m6dxmLHJe BBmlaDYFCm2ITBR99zJT7nzv48sr53Jevaf69+4u6bXepRUmQLibU5K1qID5PpRw/v+Olm4bhy EPcxAU3xYKvFGSlzcpTSlZpQzuK3hQH9S+alYAuqGwhRm13FPOoNJViWDHWKyTXInZuR7EPisJ Ksaw0loCrzjk3sKO4BwXrXxwrGZA7SV0yLu0oflM8qErxrOhMAcFShhj+UdZ1/QMEu6ZwVwIAA A== 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 , Christian Marangi 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 , Krzysztof Kozlowski , Piotr Kwapulinski , Konrad Dybcio X-Mailer: b4 0.14.2 X-Proofpoint-GUID: 9wJ6Qk8P8bTzJH-dt0kGlMccaU1FRc98 X-Authority-Analysis: v=2.4 cv=Bb7oFLt2 c=1 sm=1 tr=0 ts=6a47bcf0 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=VwQbUJbxAAAA:8 a=VT4XjZGOAAAA:8 a=EUspDBNiAAAA:8 a=0GYAYOgpis-UCnD6-MAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=PEH46H7Ffwr30OY-TuGO:22 a=6CpsfURP9XNmmWg3j1mJ:22 X-Proofpoint-ORIG-GUID: 9wJ6Qk8P8bTzJH-dt0kGlMccaU1FRc98 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzAzMDEzNSBTYWx0ZWRfX7JdKwGv09XPS KqIavezzgCYckHYLlNK98MuED8C5xa4g/cOE3kaqQbjh7FA14YAVUiND+cjPloPIVnGsGvIDjdF JktoMXo/DLa2dYnbvVi4xNbk7fHxsPx36S+nuZ+xE3q9ptGZazrK0eAc6uWLQczIeHSKIYvVIoR TNqGnoF1d22dlZZfnKzHG865zj2aS8U91j8zr7TuxPsFRf0ABc4jTQTD8kZyGWJUIzfntHuml68 9+iYNdRYLMj1uZYtpDRJetYTSbitk6WO4HuTa+Y0a1ot3e7kUGmMmu7xXVP5KDeON1r/bM+g348 opaegEaInjOabp+cVh+OcY65DeXVP1GeCBsHJMwhkuMDFDiPUMpjTBbg08qdkXzcxUr74lyDwR8 vSz8CMBRt/1AsVCkXJ/QkLYmFdmHMGKOI68pqkq84XgQriG9b0M1MQ+fJfaN+Xi5bRzHxBA7XvC uUhk81Z+Kdb4dCfechQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzAzMDEzNSBTYWx0ZWRfX7Xn6mh34eUao g5ef36RWJrjztf6qClDKjzAY/XMsUhId9ASjFsKQ/GHTYtzIj2Fs3ebpFAglW5sjp9qTFsiMMJK an86ec1pdeZ0eVAo5vLRJgfZ7TMioq4= 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-07-03_02,2026-06-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 clxscore=1015 impostorscore=0 suspectscore=0 phishscore=0 adultscore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607030135 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 v8: - block: Fix bdev->bd_nvmem on registering failure (sashiko) - net: of_net: of_get_nvmem_eui48() now also rejects all-ones cells (sashiko) - Bluetooth: mgmt: account for HCI_QUIRK_USE_BDADDR_NVMEM in is_configured() and get_missing_options() (sashiko) - Reword blk-nvmem KCONFIG help text to satisfy checkpatch - Link to v7: https://lore.kernel.org/r/20260701-block-as-nvmem-v7-0-3fe8205ef0a8@oss.qualcomm.com Changes in v7: - Rework bindings/dts so that the eMMC boot partition can be a nvmem fixed-layout and not a child of fixed-partition. (Rob) - Add Support for fixed-layout as the nvmem device node itself - Remove "block: partitions: of: Skip child nodes without reg property" This is no more required in this series and will be submitted separately (Rob) - Add missing linux/cleanup.h and linux/device.h includes (Bartosz) - simplify nvmem_register() error path using dev_err_probe() (Bartosz) - nvmem_device forward declaration to blk_types.h (Bartosz) - Add hci_dev_get_bd_addr_from_nvmem() kernel-doc for return value (Piotr) - Link to v6: https://lore.kernel.org/r/20260629-block-as-nvmem-v6-0-f02513dcd46d@oss.qualcomm.com Changes in v6: - blk_nvmem_add() returns int, error properly propagated (Bartosz) - Redundant if (bdev->bd_nvmem) guard removed in blk_nvmem_del() (Bartosz) - Size guard changed from UINT_MAX → INT_MAX to avoid signed overflow in config.size (sashiko) - BLK_OPEN_RESTRICT_WRITES removed from blk_nvmem_reg_read() (sashiko) - Link to v5: https://lore.kernel.org/r/20260612-block-as-nvmem-v5-0-95e0b30fff90@oss.qualcomm.com Changes in v5: - Fixed ath10k binding issue + extended commit message (Krzysztof) - Moved blk-nvmem handling to block core instead of a class_interface This allows correct/robust integration with block device life cycle (Bartosz). - block: partitions: of: Skip child nodes without reg property (sashiko) - Link to v4: https://lore.kernel.org/r/20260609-block-as-nvmem-v4-0-45712e6b22c6@oss.qualcomm.com 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 (8): dt-bindings: mmc: Document fixed-layout NVMEM provider support dt-bindings: net: wireless: qcom,ath10k: Document NVMEM cells dt-bindings: bluetooth: qcom: Add NVMEM BD address cell nvmem: layouts: Support fixed-layout as the nvmem device node itself 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 | 23 ++++- .../net/bluetooth/qcom,bluetooth-common.yaml | 9 ++ .../bindings/net/wireless/qcom,ath10k.yaml | 16 +++ arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts | 32 ++++++ block/Kconfig | 11 +++ block/Makefile | 1 + block/blk-nvmem.c | 110 +++++++++++++++++++++ block/blk.h | 8 ++ block/genhd.c | 4 + drivers/bluetooth/btqca.c | 5 +- drivers/nvmem/layouts.c | 13 ++- include/linux/blk_types.h | 4 + include/linux/of_net.h | 7 ++ include/net/bluetooth/hci.h | 18 ++++ net/bluetooth/hci_sync.c | 41 +++++++- net/bluetooth/mgmt.c | 6 +- net/core/of_net.c | 52 +++++++--- 17 files changed, 342 insertions(+), 18 deletions(-) --- base-commit: dffcfe75c722be66aa2669fb335528edb0590671 change-id: 20260428-block-as-nvmem-4b308e8bda9a Best regards, -- Loic Poulain