Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp971137rdb; Fri, 16 Feb 2024 00:54:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVOJs1n5zY0LyV+NcZTgSAgO2+ik0wFUU1AgTnoXsh0VqwSoW1Pb010mQ0QMoHcTentw6G9O4In75ACJdpDgyt4/o/iIzGEb/3PFdGUHg== X-Google-Smtp-Source: AGHT+IG4gcURXtyj0sGLP/jsKi5Ec4Sjutz+PV9zTHiTwZ2iBL1yVz/TNJ+5kbg9aENZMas9MKix X-Received: by 2002:a17:906:b898:b0:a3d:6aa9:93f3 with SMTP id hb24-20020a170906b89800b00a3d6aa993f3mr3685864ejb.6.1708073674931; Fri, 16 Feb 2024 00:54:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708073674; cv=pass; d=google.com; s=arc-20160816; b=JFqatE6vkR4/kmP2EndI3xKOai6aAMXxoV2AKvPHSsFE01KUUF4h2XnpnXiuN0SVud mcFFLrksizkAUjshM52ZTrRMJObzA6t5DIN+VwUTcLkp1PFJDikbCjevWQIkDXjbfrDL zEA7hxmjXiT1UVKVDUbfLqE1U3hMtwaihvx169i7Yz+JOtKjPcagW2DOVdhDIFL0n9m1 WwKo3NJEEZQlaTNHei8JYQBhfQsfrkd7p/tEhUqsWxhWt9TQuiuhHD+jyeY5Bk5lTjj2 QrU8kO9Hdzby3R/jBwCZ8TGZlL0F6v9L++UqihpLaUDb02gvvcFXgR851ll+mQc2AnEX 213A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to :references:subject:to:from:cc:message-id:date:dkim-signature; bh=fR39o00YViWIydM7bubGunhhqgptLPWAjHHTwJdFOds=; fh=gLlkDkDeTGVd4BZ7QNd2qTSP+SMYK9V2Nup64FeuKBk=; b=DC7thiA3CsdF56thHfOdO7/XgfDB9/ngsw28itvLcKK379g+xjK8v+4SZzWeSMJkqJ NMPsT5LNplxBNIzWRxp/Ju+kBzWjJlF0npQLj7ymgeHC70MGL7IoUTL17mpBHe2LcR2Q Cgud8UmCZYEaPBWpdeDYdoacc6ZKBahDH4toXDwcofsnJaeTAbIxM2YluZpip3OBEaxV r2Skj0nnPNXF251QhbdfWnVlPmvO3C/odlTempNnKf9S8mQDsO9JqFE5XDQJr2kFptKl 774J7VjzLzw5h7SkY5YHc1yaqfgd6YVFybmiIEiJIpCkeK9gjaILwa9PHa5dBudA/y2d BMEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=VSUNIuQt; arc=pass (i=1 spf=pass spfdomain=walle.cc dkim=pass dkdomain=walle.cc dmarc=pass fromdomain=walle.cc); spf=pass (google.com: domain of linux-kernel+bounces-68276-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68276-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f10-20020a17090624ca00b00a3d496b7c2esi1453956ejb.35.2024.02.16.00.54.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 00:54:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68276-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=VSUNIuQt; arc=pass (i=1 spf=pass spfdomain=walle.cc dkim=pass dkdomain=walle.cc dmarc=pass fromdomain=walle.cc); spf=pass (google.com: domain of linux-kernel+bounces-68276-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68276-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 709071F222E3 for ; Fri, 16 Feb 2024 08:54:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA957182B3; Fri, 16 Feb 2024 08:53:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=walle.cc header.i=@walle.cc header.b="VSUNIuQt" Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) (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 CFA5B18645 for ; Fri, 16 Feb 2024 08:53:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.201.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708073604; cv=none; b=L07XyXUEJZMgicK7Ky+Ag3ugnCR0564+Ts+eN96hvuYT58oGLpiriBqnA/7WjdZS4kdckpPw9kbkt5SCu+Ly2Fxki5TVGYorJTKqSyJCi/MFGy6Xq34ZqxKLuEZuX8cnJC80VcNopB+8WFTpY79uBAHDlKBnma3RaHN/PBkevVI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708073604; c=relaxed/simple; bh=WE3KdkX5VByr254yAyjqsfNttYARg0lCDLNK9YrlFKs=; h=Content-Type:Date:Message-Id:Cc:From:To:Subject:References: In-Reply-To; b=NBKTpmSQm6ayrFpU/H0h7y0hRo6Kb8P11hsIt6qAppD27Hy36O/zYSLeQVzPgQMYLy0j4HvdHHeDm4CU9/OFbDrAMkqxB7eG5r2pJKlakXFCyoaYrX4jZWHUX8oybtBOXqphYVJEY4lX9yBA9UzNaXYZj8pbn08z59DPAJn69As= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=walle.cc; spf=pass smtp.mailfrom=walle.cc; dkim=pass (2048-bit key) header.d=walle.cc header.i=@walle.cc header.b=VSUNIuQt; arc=none smtp.client-ip=159.69.201.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=walle.cc Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=walle.cc Received: from localhost (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 4C017A4D; Fri, 16 Feb 2024 09:47:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1708073254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=fR39o00YViWIydM7bubGunhhqgptLPWAjHHTwJdFOds=; b=VSUNIuQtKG5mBOy/qRCA0dUIHc+yENa/6AhSz6KczbjA+IAIr8wxm9EtcnDg61uHqiw3Uv HUNCPceY7/LpoSipR8VrFuXRWvpO63c8qVvyzOfpdOzSylOe689CU7zv7Hu4kVjZUFUys7 +BrIhjVj0i1PmKpA2dOJZnJDEBbWwzEpsjH/02+kjsSDAukuUVKosJz++HBgC1Tx1heiWa tNSgrhyROhCR2VPj8/OtWgurmRB8IgsXI3EPVsi0utRjmoH+tkTT0suyJYuc37RvFGeJuU KrwWfXOtim4QYzTqP9eDT5t/mkIqnSMFyqXuDIVBIbjVfmCsQGzqPjYGf3COMA== Content-Type: multipart/signed; boundary=52ba317e8c7c5ca537a8d63e6ea42f83f0a58640d2bb4d9412e895a495f2; micalg=pgp-sha256; protocol="application/pgp-signature" Date: Fri, 16 Feb 2024 09:47:27 +0100 Message-Id: Cc: , From: "Michael Walle" To: "Marco Felsch" , , , , Subject: Re: [RFC PATCH] nvmem: core: add sysfs cell write support X-Mailer: aerc 0.16.0 References: <20240215211401.1201004-1-m.felsch@pengutronix.de> In-Reply-To: <20240215211401.1201004-1-m.felsch@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: --52ba317e8c7c5ca537a8d63e6ea42f83f0a58640d2bb4d9412e895a495f2 Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Hi, On Thu Feb 15, 2024 at 10:14 PM CET, Marco Felsch wrote: > @@ -432,6 +466,7 @@ static int nvmem_populate_sysfs_cells(struct nvmem_de= vice *nvmem) > struct bin_attribute **cells_attrs, *attrs; > struct nvmem_cell_entry *entry; > unsigned int ncells =3D 0, i =3D 0; > + umode_t mode; > int ret =3D 0; > =20 > mutex_lock(&nvmem_mutex); > @@ -456,15 +491,18 @@ static int nvmem_populate_sysfs_cells(struct nvmem_= device *nvmem) > goto unlock_mutex; > } > =20 > + mode =3D nvmem_bin_attr_get_umode(nvmem); > + > /* Initialize each attribute to take the name and size of the cell */ > list_for_each_entry(entry, &nvmem->cells, node) { > sysfs_bin_attr_init(&attrs[i]); > attrs[i].attr.name =3D devm_kasprintf(&nvmem->dev, GFP_KERNEL, > "%s@%x", entry->name, > entry->offset); > - attrs[i].attr.mode =3D 0444; cells are not writable if there is a read post process hook, see __nvmem_cell_entry_write(). if (entry->read_post_processing) mode &=3D ~0222; -michael --52ba317e8c7c5ca537a8d63e6ea42f83f0a58640d2bb4d9412e895a495f2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIcEABYIAC8WIQQCnWSOYTtih6UXaxvNyh2jtWxG+wUCZc8hHxEcbWljaGFlbEB3 YWxsZS5jYwAKCRDNyh2jtWxG+8eBAQDGYo2DtOKLuL0CsiuJCDK03JOD16/qs+uF gwFEDQ6wUQEA3o3jofN51UHHDYz/EMyPvP6IRxGvCx7djrUXzzdHGgk= =dSaw -----END PGP SIGNATURE----- --52ba317e8c7c5ca537a8d63e6ea42f83f0a58640d2bb4d9412e895a495f2--