Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1025314lql; Tue, 12 Mar 2024 05:32:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXtyREYqkTl2vLH2RKfC6kEeNUzrHX5MaUkHWhYgKC7V2ZnwSzWikCpQr6gpaMVNdyztgWFPGN4XKgxA+ZMXaZjBE8R/gMX4iDUVFMUqw== X-Google-Smtp-Source: AGHT+IFVtjdAldJ7wvu2EWSAsdT+hgytilYLQMybht+gn75tDDHNRei8OpsedNNUTjfZZ59Nlfyl X-Received: by 2002:a05:6a00:2ea2:b0:6e4:6484:1a36 with SMTP id fd34-20020a056a002ea200b006e464841a36mr1727192pfb.21.1710246743646; Tue, 12 Mar 2024 05:32:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710246743; cv=pass; d=google.com; s=arc-20160816; b=QqRPAkL34voAbLVMH+k0pNP+f3hFdlGCfgDOrHfmW+aIjFFVa3QECW/MB8UBRQ9tG9 7VN8Oga6X5jgh9N3YABqRRVj87756B99T6fu1ghRehIMY+b6EJOU0mtKg/s6Vy2mGCB4 x2AA+O7y3rFtYPVDcJ4rUWVHwuhMFn1myFG1osvso2+MNMjRw7saZjoJMdXicA74xugl XOp4ymb6kc+SA5kc57jzi/ieByp1yHXeSh2yHD16luNuLpWA4vQmN1BP7eiR0EFtTfiz fuFu10mOXc1kNUWpE+HllPmWXWSLPG4XUyKO4bu1htV6sSNSmC+zIPi5uqqsM9yvS2/M 1r+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=qjZk8e0DXnxZ7D8c82te4o3kYapYLIZySjx9Aa/vAjY=; fh=Yd0ihZj8nAryuin/OV6Dx0D4doLVu33/U1QiBrAh8ME=; b=JxNJIVXNcaL4gcB3Fy4OxQ6F1bUb4BbmCx4jnnj3XxJswyffaYVoewYNav8tQgEkTz ldsvo0GKI1nI8v9S4ltqWlabGqCXrSRP6uF74MgyapTGY6m+9aCrkKmXm9STMkJo4gf/ 0D6XDs1y8HbKB/muk/en6yc9Uw4cRgorSInAqYV5n99egZwtHtKxWp6NrxzHty3wpLnq Mf8uYzAk8J0Jow0csU9fGHuQK4yg9HDlVHkCvnFr32nintKIQfEEcXnvAAPq3hjjnkwt df+SnJx9UWx0skOna9vB7ETDV204kLA4SYnKjK2LZRIXeeYGRbb/t6q/B3oNDOuBpGPp vCmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VezBtpf6; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-100254-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100254-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s7-20020a635e07000000b005dc359d7e93si7128402pgb.806.2024.03.12.05.32.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 05:32:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100254-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VezBtpf6; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-100254-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100254-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9DE44B226D8 for ; Tue, 12 Mar 2024 12:23:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0536179DDD; Tue, 12 Mar 2024 12:23:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VezBtpf6" Received: from mail-yw1-f170.google.com (mail-yw1-f170.google.com [209.85.128.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8186779DD3 for ; Tue, 12 Mar 2024 12:23:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710246208; cv=none; b=re9TksHNQ87kdtTylHuQeNpyTg1bbaiWydWyd8TTlrF+e8YhwocaVRE+bmyESaYCtoOL/FRR42vC/KI6s/35imi7H9rPh1s/7tLnziIb5xvrngoYvEPcbyTv82Nzq9b5DfrqMtpPGqx9ygK+1P1El/dOAtRnvMHchyAPM8vFHI0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710246208; c=relaxed/simple; bh=qjZk8e0DXnxZ7D8c82te4o3kYapYLIZySjx9Aa/vAjY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=B8olUgRQea4CnZKh+rUcdqF+9+hiaUUuxyPd4mnqSHFitDU4G5Gf7ouogr6GSgv3PR9o0oemFyqy9DIg5VPloY3D+WptB9Ap2v+U7NwliJjI6rWb6g3o1NRBkuFCfdCbCG4OMpEXrL64WS3C8MQShm1pcy4NOuFDiyS3U+ppTG8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=VezBtpf6; arc=none smtp.client-ip=209.85.128.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-609f4155b76so50424497b3.1 for ; Tue, 12 Mar 2024 05:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710246205; x=1710851005; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=qjZk8e0DXnxZ7D8c82te4o3kYapYLIZySjx9Aa/vAjY=; b=VezBtpf6MbzmUquxNus+FxvG+Sd7Fvq4uQ3P1V7bQQtaST3ZQIW8DxiGN8MUa3diYW XDGo9QUzoAfXoVqtQpoTp1/zd0eioavkEjPS+4/nV44rt9MnHWTFJ/bpUAYPXmXvjApn Qe6tKe8hc7ZwoWbWJLm6touHZ66t6vbNA2f99QQqPQU7+/RQnQ+7fR9Swxr3N5BfNw09 vTGkn0O3H3pN+3qtEuhtd5XDEVQNC4YVgt/iidMW5X6kAWeDTuqSC2MpigezmZ6m6uQC jbzk3rJHAzwYO8ciWdgGTM6YvihpeWlAGleSSvlW7Cid7wf+o0j/EPgIc2mYXHhT0gmM BMOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710246205; x=1710851005; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qjZk8e0DXnxZ7D8c82te4o3kYapYLIZySjx9Aa/vAjY=; b=Y+77+DtSYbdESVIRYNMlIEFh1Rjzn4DLyfrYUV5rtGmJmx4ZI2hYTUJwLH+MrkKPe8 GfrdFAq/0A5o5ewA83/E2vCI6GDLj1xSAgpNfc7bWs2ejoMl5kHrxibGWpKRW1LkZNtD eM4G5VZSQiyTnzYCkhIHo3pGD1gD7l+lk7x1QN6v645TYM9WH+kDSZiFrmAiKo9MG+K4 CH3K5HlodefDunG+7ScnDZbiFyoXSrthDlfg6yi/5wDeWefaFp8RIGo+aOWbf6T3/FCl pEPmqq551V53YczbKTGinSg1ZuuflSp38T8BpI8HGwCCniDMNNWIdK2gIOkdlANGtv5B HcUg== X-Forwarded-Encrypted: i=1; AJvYcCUJDra2WQLf6bvA3PJQMxe9UIZNKB/8oGQwkB9CFfdz1AbZh0VaJ7fgewgthVSov1GAXFwQXEh7S1/alnFiY14c81Bg7ur2os4Aho76 X-Gm-Message-State: AOJu0YzpjhtnUWg7QqSIHQNS7L6NlmEJ64EfEhtoctYSxj0dxY4F+Iy2 VliRQTLu6CVhmaOXFXsWy21in+fd5RHCrtH3OT9x3lbTzE4fLP6pz795kXltEBnMXv0subo3KF2 ZzcNJQ+Q4GkEC2cssqOeAtlzyCjdOGMb6mbri8A== X-Received: by 2002:a25:6ed7:0:b0:dcb:38d3:3c6a with SMTP id j206-20020a256ed7000000b00dcb38d33c6amr1438229ybc.46.1710246205535; Tue, 12 Mar 2024 05:23:25 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Ulf Hansson Date: Tue, 12 Mar 2024 13:22:49 +0100 Message-ID: Subject: Re: [RFC PATCH v2 0/8] nvmem: add block device NVMEM provider To: Daniel Golle Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jens Axboe , Dave Chinner , Jan Kara , =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Christian Brauner , Li Lingfeng , Damien Le Moal , Min Li , Adrian Hunter , Hannes Reinecke , Christian Loehle , Avri Altman , Bean Huo , Yeqi Fu , Victor Shih , Christophe JAILLET , "Ricardo B. Marliere" , Greg Kroah-Hartman , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-block@vger.kernel.org, Diping Zhang , Jianhui Zhao , Jieying Zeng , Chad Monroe , Adam Fox , John Crispin Content-Type: text/plain; charset="UTF-8" On Tue, 5 Mar 2024 at 21:23, Daniel Golle wrote: > > On embedded devices using an eMMC it is common that one or more (hw/sw) > partitions on the eMMC are used to store MAC addresses and Wi-Fi > calibration EEPROM data. > > Implement an NVMEM provider backed by block devices as typically the > NVMEM framework is used to have kernel drivers read and use binary data > from EEPROMs, efuses, flash memory (MTD), ... > > In order to be able to reference hardware partitions on an eMMC, add code > to bind each hardware partition to a specific firmware subnode. > > This series is meant to open the discussion on how exactly the device > tree schema for block devices and partitions may look like, and even > if using the block layer to back the NVMEM device is at all the way to > go -- to me it seemed to be a good solution because it will be reuable > e.g. for (normal, software GPT or MBR) partitions of an NVMe SSD. > > This series has previously been submitted on July 19th 2023[1] and most of > the basic idea did not change since. > > However, the recent introduction of bdev_file_open_by_dev() allow to > get rid of most use of block layer internals which supposedly was the > main objection raised by Christoph Hellwig back then. > > Most of the other comments received for in the first RFC have also > been addressed, however, what remains is the use of class_interface > (lacking an alternative way to get notifications about addition or > removal of block devices from the system). As this has been criticized > in the past I'm specifically interested in suggestions on how to solve > this in another way -- ideally without having to implement a whole new > way for in-kernel notifications of appearing or disappearing block > devices... > > And, in a way just like in case of MTD and UBI, I believe acting as an > NVMEM provider *is* a functionality which belongs to the block layer > itself and, other than e.g. filesystems, is inconvenient to implement > elsewhere. I don't object to the above, however to keep things scalable at the block device driver level, such as the MMC subsystem, I think we should avoid having *any* knowledge about the binary format at these kinds of lower levels. Even if most of the NVMEM format is managed elsewhere, the support for NVMEM partitions seems to be dealt with from the MMC subsystem too. Why can't NVMEM partitions be managed the usual way via the MBR/GPT? [...] Kind regards Uffe