Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp651226rwb; Fri, 23 Sep 2022 02:10:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4VlJAYxgHYDt3wkoGVUWbRcZPlfr2tJX9REiTd2AtUfjK81ODwV+1p8yWWF6P9481gUiuC X-Received: by 2002:a17:907:a0c6:b0:780:bc37:2552 with SMTP id hw6-20020a170907a0c600b00780bc372552mr6039591ejc.314.1663924220463; Fri, 23 Sep 2022 02:10:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663924220; cv=none; d=google.com; s=arc-20160816; b=GWGskhY/0ABCcbJsHHcqBTPwT/uPkZjWHbLC+tmvAlgumpmXV1xaU+bTib0e7rP7Me wkhGaWJ1kIZDkSV8lrHBVBKg0Xqw1kwAtwsxCX4vWhNobmbcB+3c5QhzCsjCwzfJ48l5 Ryqg1ApdX+lwCAH1i2hlSUEUhx8CTCtddRD9nmCFXp/Ih8FqgL17JAFacR44T6gzXx7/ MY4CxrY+gI4Nchp0lbZUtOdz+lbz7lg2swoPIXED+gZGtwXfZEWAEEzYnhSAdIstGg+j QfoOURZna6Dhoscv3ZRoqXkC5p65GzVgw988RMekirJxMUChcPfRWSAg46YnLvQroHTr EpBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=hzACXGQVUXUlqzRxfF5DU+srPu0BVRboZgK6ovyGN7g=; b=RnxChE1/ZL6FWI39mT9pIRFp4ixjBnH94v5Rzu8t49FKu8BfuSvv4G7J7YKTJQ3yI5 C5XtKT0KSfWKY/3wZqscpovJ4EiR7QvLQ0KYwdfQOng0QO4DO8fJiM96rrGaBs0/M8J2 wCbtbnluK+YCOIRLiWCjdeXfCp45lPZvLcL/wFVVfiN66/dDQk6Wa9vtGTnGSz2Q2cN3 frAwybFtSsR7OGEP+eLBpPDUYz/vo9+W4NU+WjfE67kL6AX+rgEIvE2Y5WxBIQCYn8SZ XqGRMfbT1b00CAiFJDT4VO0pKz3gUlikv7i6O6eY7CN5ihJBwK6IIsYBTaLE9pN1I4uE DBAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=EtW+5zQZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n12-20020a17090695cc00b0077cdcd4ed23si5923575ejy.498.2022.09.23.02.09.54; Fri, 23 Sep 2022 02:10:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=EtW+5zQZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229603AbiIWIdo (ORCPT + 99 others); Fri, 23 Sep 2022 04:33:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230440AbiIWIdj (ORCPT ); Fri, 23 Sep 2022 04:33:39 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49180E173E for ; Fri, 23 Sep 2022 01:33:37 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id D9840E0008; Fri, 23 Sep 2022 08:33:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1663922015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hzACXGQVUXUlqzRxfF5DU+srPu0BVRboZgK6ovyGN7g=; b=EtW+5zQZYseGeB0HP2gGRuLbgGbb0iIvvMjOPecmSWPCecctBpynaL/Wrhfh36fOObUBvp wBQkW0Flgv+8NzH+Kxdzdcjj0byfq0RScXPA8aTqoZTbnLPKtYXmc8NFu8PR751QU+jEqc h+EH+yT4SWFkH3O4abtRCVIUWYll3YAphOZQ4Cf1dCgGBn5M+y+DN1TTRaX8RyNZQScxmp J0zakU+4SofaKJfaQcjmVSk9+M4xoCP3K0IkU1O5YmHiqwrD6dC2nrkHxLdqt42oPk47sb 06ketAPidO+yyam4f2131Vt/bfHQad8ydTletCJk81ZHeUKuYTpgo1jTzZCb3w== Date: Fri, 23 Sep 2022 10:33:33 +0200 From: Miquel Raynal To: Srinivas Kandagatla Cc: Robert Marko , Thomas Petazzoni , linux-kernel@vger.kernel.org Subject: Re: Exposing nvmem cells to userspace? Message-ID: <20220923103333.78c7a19b@xps-13> In-Reply-To: References: <20220922122347.1866f758@xps-13> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Srinivas, srinivas.kandagatla@linaro.org wrote on Thu, 22 Sep 2022 22:33:52 +0100: > On 22/09/2022 11:23, Miquel Raynal wrote: > > Hello Srinivas, > >=20 > > I am currently looking at the Open Compute Project ONIE Tlv tables in > > modern networking hardware. Thanks to the specification being available > > for many years and rather easy to implement, those tables are already > > present in many switches. Manufacturers just have to provide a small > > storage medium exposing factory-related information (manufacturer, date, > > serial#, mac addresses, etc) in Type-Length-Value fields, as well > > as their own extensions if they want. These tables are common, but > > there is currently no shared decoding logic, each provider maintaining > > its own internally. > >=20 > > I am currently looking for upstreaming an nvmem layout driver for > > exposing the standard nvmem cells. This way, Ethernet drivers might eg. > > take the base MAC address from there. But I feel like there is > > something missing, because the vendor name, the device version, the > > serial number or any other information available in these tables might > > also very well be used by the userspace rather than the kernel drivers > > only. =20 >=20 > Could you explain the userspace side use-case? Right now I don't have any TBH. But in general, having access to a serial number, a manufacturing date, a hardware batch or whatever other per-device factory information is always useful. > > Thus, I was wondering if there was some ongoing work to make these > > cells available to userspace (in /sys maybe?) or if this had already > > been discussed somewhere. Otherwise, would you be open to such a =20 >=20 > we had this discussed this in many instances and this is some thing we wo= uld desire to have but we never got it moving forward. Ok. > > contribution? I guess it would also be a useful debug tool anyway (and > > might very well be moved somewhere else than in /sys). =20 >=20 > getting sysfs working correctly in sync with userspace might be tricky in= this particular case as we will be creating cells after the provider drive= r is created. >=20 > debugfs on the other hand is more doable. Ok, I might try something with debugfs then. I'll keep this in mind. Thanks, Miqu=C3=A8l