From nobody Mon Feb 9 03:52:46 2026 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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 B1B07132103 for ; Fri, 5 Jul 2024 07:49:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165748; cv=none; b=UQQubH/r0XVSgckgvS3LpgV2o1ICBnmJm2cp3wTG6c0s6YpYJO9rdCXWyBrVMGiAJh52GWsxZU+LdL7JS8SSW/3Icas00qkk7zQ/JdTQvD3XeOecJQ0EDMyNWz6Fflin6VO43Jlp1o2p3zrfzDJlnk4kPUCHGNRfiCzMshPlw0U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165748; c=relaxed/simple; bh=daq+S2dia4dvwaxxlF3p0Tm8Gbg6T+UWn0zRTunJAGo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=XnqOa6qSj3cac99iOmfp0gKRX25kQOmpWBQL19pDiyfpgR///vlJ5us9F+ZOB9heMOlZTZiEIGv9kyFxVABx8IM8CU6g/nhEZxXndMPEkmC7+gAlkIPpY10TnSLCVTgK7JNmx26bejJrDpkLlQ5TbJB8UJ6QGHSwZBHYhv2m0A8= 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=QHWCx0/T; arc=none smtp.client-ip=209.85.167.50 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QHWCx0/T" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-52ea5dc3c79so601275e87.1 for ; Fri, 05 Jul 2024 00:49:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165745; x=1720770545; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4hxM1M3BJm3U77Yss4ewZ2FyzicKkx3LrbIUqysOnDo=; b=QHWCx0/TszFe7rm92KMEsr7Xw+JreblhA1q/tP63Hh+cryM3XvoZjY2BaZNT6g5W/x EbpByYmlD1GuURLKSq1jQYkhENTScBatldibOJhK2fA3+/PlfOANGuOVmj33qHbNS68T YstsUXRSwOcyC4NMchWXuoBNgwa7D1anOg+6SSaBNy5C18mRC2AfMfekkkKJBgG2ZDyv KpJRlrkN5MLsLCHWAXi3anbF16q2aKDp1lV9KMgDf5Uo1toyAQ7pOsUXdEtK1/lLuSfV CSpk/BQY5VL2vy0Wp4IHGl6nTr1ZlJRD0w7ipbr99NnYgVYp2Ie/eV24b6ml1tHBnEKk 4Ybg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165745; x=1720770545; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4hxM1M3BJm3U77Yss4ewZ2FyzicKkx3LrbIUqysOnDo=; b=F0ptH9WLyZpebVBUCsrgPOO9v57T234z8w5/yzBKvc9yQJD/PPYVSsMFFNAbonbiDw Y/ggAdSbBxo+4hNGKSoPMAhtKFrJ7z4cXgtgVf5o/zx5dNAwgjoTSHVio/gD5+hYOkEz bz6MpDA/ttD6FY2Lpmgr+XpYa0rc+EJSgu9d33urlf7+942esHeMivL1NYflreswkj6f lEH8XYpH+ZNShouQ94Wb1R/WsUinz+/TyztUrGvZJ3c995eDq3yXZfpOvLS3ueheOU8e ecEGxcj9yq900Tg13hWi47BZDdabIKHfz+Lk6I4sFCRNMxssrMu+bKnEkm0bf3e9O/df v+2Q== X-Gm-Message-State: AOJu0YxDnP2Ksn0s/82y9sgSrs9bVshraLSt54ne0zy+m25l6U9BP/OE KZVi1Sy0hKDsrHTpKxvbSAfEwdFv+UHdRSYexDqjaaCoZWw5Tk/8mzpsJlqOxpc= X-Google-Smtp-Source: AGHT+IGFFsvtj4M3Le6TCSXOus3PbV3V5LQWtu+m/+/n2Gcfa1vJ5/K452PpGYyI8u+0c9NX5VtOvA== X-Received: by 2002:a05:6512:219:b0:52e:9d2c:1c86 with SMTP id 2adb3069b0e04-52ea0636ae0mr2575937e87.14.1720165744897; Fri, 05 Jul 2024 00:49:04 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:03 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Jeff Johnson , Srinivas Kandagatla Subject: [PATCH 01/15] nvmem: add missing MODULE_DESCRIPTION() macros Date: Fri, 5 Jul 2024 08:48:38 +0100 Message-Id: <20240705074852.423202-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> 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: quoted-printable From: Jeff Johnson make allmodconfig && make W=3D1 C=3D1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/nvmem/nvmem-apple= -efuses.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/nvmem/nvmem_brcm_= nvram.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/nvmem/nvmem_u-boo= t-env.o Add the missing invocations of the MODULE_DESCRIPTION() macro. Signed-off-by: Jeff Johnson Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/apple-efuses.c | 1 + drivers/nvmem/brcm_nvram.c | 1 + drivers/nvmem/u-boot-env.c | 1 + 3 files changed, 3 insertions(+) diff --git a/drivers/nvmem/apple-efuses.c b/drivers/nvmem/apple-efuses.c index d3d49d22338b..1d1bf84a099f 100644 --- a/drivers/nvmem/apple-efuses.c +++ b/drivers/nvmem/apple-efuses.c @@ -78,4 +78,5 @@ static struct platform_driver apple_efuses_driver =3D { module_platform_driver(apple_efuses_driver); =20 MODULE_AUTHOR("Sven Peter "); +MODULE_DESCRIPTION("Apple SoC eFuse driver"); MODULE_LICENSE("GPL"); diff --git a/drivers/nvmem/brcm_nvram.c b/drivers/nvmem/brcm_nvram.c index 5cdf339cfbec..3d8c87835f4d 100644 --- a/drivers/nvmem/brcm_nvram.c +++ b/drivers/nvmem/brcm_nvram.c @@ -253,5 +253,6 @@ static int __init brcm_nvram_init(void) subsys_initcall_sync(brcm_nvram_init); =20 MODULE_AUTHOR("Rafa=C5=82 Mi=C5=82ecki"); +MODULE_DESCRIPTION("Broadcom I/O-mapped NVRAM support driver"); MODULE_LICENSE("GPL"); MODULE_DEVICE_TABLE(of, brcm_nvram_of_match_table); diff --git a/drivers/nvmem/u-boot-env.c b/drivers/nvmem/u-boot-env.c index befbab156cda..936e39b20b38 100644 --- a/drivers/nvmem/u-boot-env.c +++ b/drivers/nvmem/u-boot-env.c @@ -249,5 +249,6 @@ static struct platform_driver u_boot_env_driver =3D { module_platform_driver(u_boot_env_driver); =20 MODULE_AUTHOR("Rafa=C5=82 Mi=C5=82ecki"); +MODULE_DESCRIPTION("U-Boot environment variables support module"); MODULE_LICENSE("GPL"); MODULE_DEVICE_TABLE(of, u_boot_env_of_match_table); --=20 2.25.1 From nobody Mon Feb 9 03:52:46 2026 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 EF0F1144D34 for ; Fri, 5 Jul 2024 07:49:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165749; cv=none; b=BFn8qFujrDYpZljS16MKoiP8cy2MBp2afIkYDdG07bedtMlufvIkLsm/aiH9vFfgjV4w4VBLITuOcEW7yAYVv8fT8FZ4WjHgj4BLPgcdltSBpjBCLSbwx2PRcldo7P08f+8upr0hj8FOfafkkg3n/T+Tm9eVW9gRxBHvpYJu+2I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165749; c=relaxed/simple; bh=S6d604IG2mTD5lZ+KcjBXZf8uuMI+0RjXIt2ej9rZ+E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=A9A+YrSiMLWYrgwPaJPG/bTLgP+8AOtmpjA0vQg/DvtkV71D1/u5eXP32OP/+VVm1ak0W5AiPZV6Bgv0wpgHYkV90VmKYovFNKQLffBsTUt9X25ga7QeYSd8VZ1ej38uj7ihdgqn4NrXjYxPbrgjeXn9TjKGkUmUMQCv4EwVSzA= 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=IUxLonHM; arc=none smtp.client-ip=209.85.221.42 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="IUxLonHM" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-367ab50a07aso200793f8f.0 for ; Fri, 05 Jul 2024 00:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165746; x=1720770546; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vj6UtouVx1MTU9jfUS4bHZt6H9ZKaI1C8AYps64ki9I=; b=IUxLonHMnR7kzWT1X26HBYaTzJD41H87OV4D5gey32jZmMe58zaQLwqFi5eObFMuCo esKu3p9Mp63o1+XgodxW7rKyuMk170ZoUCKvhojPA/fkKIEW46rfQAgwrTvA3u/IMt/0 uo6rH1AfAjDZ0mv7/GS7jj8i7/tWZZ47dAQkq5H+5CoqDtX2AnNTpBy1oDBgJvBLNDFd Jyr8VheeL1DHMU0BYrjIOLx0ZDnaMcUIg83y+3t0OnbkOpvUmBAv4F52WjrkypDDWazl lxdjspyIj9tqJ8fDZ0XT1ok5gZWH2ikVudGeBDUqeXCkojisiVg98rU00tKBTFb4ffQA tqsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165746; x=1720770546; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vj6UtouVx1MTU9jfUS4bHZt6H9ZKaI1C8AYps64ki9I=; b=CLiNuB5ORDlISwYTbpk8ZV0ABEqA0zKBC7pZahLiXqhYvoQSC7RwlmztrKhz7sz7ZP x5FN2oaKrqkg8AFTfjy/cySks0jznMfuy7OD/Cc8dkicpcSmS0MysJnzsf/ZI69kypb+ PUdOMluphu7p4/WtHxgHDbH0JYlEaCUxJxcNZQjaSEo1D58XDHu3b0v/tcLZQ/P6EqD9 5dHWeubcjuh+w+u1znlTYkcjjBkm0OFyR397iMzfmGREkqSz71BpNPEGIogdweb/V0c5 T2laetyiLnNk3DJ0Z2lar6TyOgBam5J6c+2Hk5Ma/fE12ze8Z5JPnr9vGE/NuMfpIzYw WP3w== X-Gm-Message-State: AOJu0YxPWFvFRD+od32nbSNqaXZpiehUgKl9/NEpEV17mGu4Zvw/auFR pNPFttV4gMgFXackuZ+FZpIhLz8CX3tTr+IZTNJbVnU/dgEd4ETIAlh9uJlXBuU= X-Google-Smtp-Source: AGHT+IHUfSHjIenPIsLmiZISgCUW10Zj1hDNIZLU1RNZdx4r4I0a7J4PQmUaYRuSWHrMyOuHkJRaHA== X-Received: by 2002:adf:e902:0:b0:367:8a00:fac3 with SMTP id ffacd0b85a97d-3679dd33660mr2648533f8f.30.1720165746263; Fri, 05 Jul 2024 00:49:06 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:05 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Krzysztof Kozlowski , AngeloGioacchino Del Regno , Srinivas Kandagatla Subject: [PATCH 02/15] dt-bindings: nvmem: mediatek: efuse: add support for MT7981 Date: Fri, 5 Jul 2024 08:48:39 +0100 Message-Id: <20240705074852.423202-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> 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: quoted-printable From: Rafa=C5=82 Mi=C5=82ecki Add compatible for MT7981 SoC. Signed-off-by: Rafa=C5=82 Mi=C5=82ecki Acked-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Srinivas Kandagatla --- Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml b/= Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml index cf5f9e22bb7e..a773101d8538 100644 --- a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml +++ b/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml @@ -28,6 +28,7 @@ properties: - enum: - mediatek,mt7622-efuse - mediatek,mt7623-efuse + - mediatek,mt7981-efuse - mediatek,mt7986-efuse - mediatek,mt8173-efuse - mediatek,mt8183-efuse --=20 2.25.1 From nobody Mon Feb 9 03:52:46 2026 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 588BA1459F8 for ; Fri, 5 Jul 2024 07:49:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165751; cv=none; b=Q3PGf5nYmOEBRyRMvAbiYf4i2sf1ZphiZZGl6LIbXdgelRVoc7b/Ak8qKSC0bNcbOUB0nrlr36+Vpqk9HZFGXb98+yw/bH2AKlbl9RUDBWZKp/q5Y/MHOvtym52ck0h2oa1jskFuGrEzF0nRSdmdQtkTjm1eb8VrAtBE//X51XE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165751; c=relaxed/simple; bh=ExHT2EX/ILbAEUasFM79Vj21uF35V67tuLKVC/Rcxoo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SOaRgkdEkqZpNY8k/jTVOYlgR8/8m6ij3o0+Yh9onnRQhP5bMlx1VcM2i8IHlzdICen8O2tjTTtIRCTeEnTGXlMhZjAPU26k4EVoXgY8Qq7BlEmr4m1mQyNTuRo9hdku3RpJzG3KTHkdAPiJoeGjG1sRcv7o7UHlqLqf3Z1M9XQ= 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=ICzW3IqH; arc=none smtp.client-ip=209.85.221.48 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ICzW3IqH" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-36798e62aeeso839625f8f.1 for ; Fri, 05 Jul 2024 00:49:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165748; x=1720770548; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=58Ieoh+8Dv9L+S664n+nMyrN6Z2PXH7+gflZGbfCUeo=; b=ICzW3IqH//yf+JpbXc6AM/rT4mpGxiTtRPKGALs2+Nl/uovWNyjwKoAtP3GrkSBUS8 VOJFlxC+a/giaFAL4ryMvWFmpvl5E7rFky6fjZQq61bqZYratxuzS1F6Bd+HNLVlsI6S FSRpPNm7YXGQcxGEpmco7e5KQ1PyCRkwiK6/k/Ys2mQzcEpqEzvB1LwcAB1xrlGSWk/A BxqiwOffcD5HT3IL4Desn7pGjlcotN/3KG52J1YKDCkMoMV9oL73zKXA5+of/Fk4qTQW 1fxs37gug1w5EQE7obsAe5Y0IYraubUerxYRM4MT99fZBnjoJw5f0gkeXE045gkCb/tu UCgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165748; x=1720770548; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=58Ieoh+8Dv9L+S664n+nMyrN6Z2PXH7+gflZGbfCUeo=; b=Ul0wLhzcYiuLxCS86+N5qXLc/hgiJB4dAJFgaQ33UNWqE1m/7jVZvrS1Y/oQBbIR44 FRVVuipsZMtrrHonUvG8gskz0B2CqwvluA33Icw6DGPtK9+ln3+QHZ0sPiVh8eZJeqKV 3zMMbSSOjatJ8V/lIJc1kEaEmSK05JRzKgZjhWFYddXKwuKMre9Wv6MajkBro3n5TPYM IPhJ999RW7/kOUf99c+1GdA0/5HRI/cupiAxeqSd6JGEMekZjBkTkPh2lQjursc3Ayew IZ2DPL84uk63cvZUGMAqpdAsDSMfzE2nCVURwTeUm+PnzLGKeVLQpgmUHpi9ufim4r+S bBew== X-Gm-Message-State: AOJu0YwR2Myoem9mbV+WMm8JK3Eof2SBGyl+xwTlD/NOzgPXMgii6/x1 Y3qbMt34M/ACk2Go2UwXkv8H9AeiSR7a69DPtpObqaYwQCMQ2WaBCI/mgHB+BYA= X-Google-Smtp-Source: AGHT+IHdfofxCv6MIs8n6sbnyJ/f8DPKxmjE68VHV+MP/9x3ZXWIdTSVWUixgECq40in8C8JUvLPLQ== X-Received: by 2002:a05:6000:b85:b0:367:880f:b8b0 with SMTP id ffacd0b85a97d-3679dd311a4mr2390143f8f.8.1720165747794; Fri, 05 Jul 2024 00:49:07 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:06 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, MarileneGarcia , Julia Lawall , Srinivas Kandagatla Subject: [PATCH 03/15] nvmem: meson-efuse: Replacing the use of of_node_put to __free Date: Fri, 5 Jul 2024 08:48:40 +0100 Message-Id: <20240705074852.423202-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: MarileneGarcia Use __free for device_node values, and thus drop calls to of_node_put. The goal is to reduce memory management issues by using this scope-based of_node_put() cleanup to simplify function exit handling. When using __free a resource is allocated within a block, it is automatically freed at the end of the block. Suggested-by: Julia Lawall Signed-off-by: MarileneGarcia Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/meson-efuse.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c index 33678d0af2c2..52ed9a62ca5b 100644 --- a/drivers/nvmem/meson-efuse.c +++ b/drivers/nvmem/meson-efuse.c @@ -42,20 +42,19 @@ static int meson_efuse_probe(struct platform_device *pd= ev) { struct device *dev =3D &pdev->dev; struct meson_sm_firmware *fw; - struct device_node *sm_np; struct nvmem_device *nvmem; struct nvmem_config *econfig; struct clk *clk; unsigned int size; + struct device_node *sm_np __free(device_node) =3D + of_parse_phandle(pdev->dev.of_node, "secure-monitor", 0); =20 - sm_np =3D of_parse_phandle(pdev->dev.of_node, "secure-monitor", 0); if (!sm_np) { dev_err(&pdev->dev, "no secure-monitor node\n"); return -ENODEV; } =20 fw =3D meson_sm_get(sm_np); - of_node_put(sm_np); if (!fw) return -EPROBE_DEFER; =20 --=20 2.25.1 From nobody Mon Feb 9 03:52:46 2026 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 017EC145B0B for ; Fri, 5 Jul 2024 07:49:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165752; cv=none; b=P8U3tvZlcfFcGp6YGSj8eay1SuVMXKBwmUxm9brTJGATqCRQsAPPqpeDDrPE4aUZbZg1aBFzqDJSMwStKpoJXnQheFCfKYCsr3AxuJrmuG1sAEipOAhuf7jzWiJSqHBSAViJCraB6TDGoEdBoziBSC/0Y4pSuRiE4u9PBWR3ZfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165752; c=relaxed/simple; bh=FyAYBlbrcTGqO5GM+LebuNnreF/NKOqfmmP7NPvHGxc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HYP64A5MPusA6H44z1AS48cJz5L4LTTZnhYoqoTut62kGUNIqtUCmzLEexngRlREVxXBQDqYAcTyjSdQaCewQALo96O986hYIYh0lCVnZEfwXt+vmo5rAwbxQLHEKBD34rOPaZ7jV4HzNuZZAM+F0PIKfneecX/7MAVpKdHkZJI= 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=RiOvX4CG; arc=none smtp.client-ip=209.85.221.47 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RiOvX4CG" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-367818349a0so760880f8f.1 for ; Fri, 05 Jul 2024 00:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165749; x=1720770549; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w76U7o697ndJNJeHAa6J4xQAFtjPJ8pMc99Og5Tk1f8=; b=RiOvX4CG7X/RjeXco1t6nr/dsqOVKXH+VnDtkTLJFDGgdsojcE7nn1J87QHJeRHflA Mq+R1pgJkehdQ5tCIyRUbb0cIKnafDz4qACeVhJ8sReIOCXMlTmqAAZShiYrZXH6ZFo4 hUUAQwQ6U7D0z3mFJ5amKCFUCOLeeRFEsQOx8OzMLNXwex8yV7F/vcScp+uiqU2t3I5a SfDnoOHRSDwFOWzHMjXXi3lXAO59zGyqCYcutnJ/ny6PBNnZP+Go6Lt6F92ejcb54AJg bpallbTkiOOlMmHiv7+qOjAHDl4Rnm5vuWE4WNeeaKD0ULxxrqQS4v60Inlax+zHC5my nwHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165749; x=1720770549; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w76U7o697ndJNJeHAa6J4xQAFtjPJ8pMc99Og5Tk1f8=; b=DPX2l0mMtCGyc5PzABpMw1ApTxhrLrEEJ5/jka8zku5cjbBhM6bVgTcsH+hhl+KAM2 cfXIzwLknNrl23M7xje5B1pyq/4XJM3CKW5SYhrTh36Hcazr0tBb2Y0bgRa4M1XdXJoa zvK+OvY+QsDwnExClpR3LHhn7Wd45Ck5tZW8fmV8YGFB20tr70YJQgU8dm3XQDiyCHCG 03nBNk6S9vqiB1JMW/xOqzPurKYuza4pgxJYst56PKiWJ3qkehxXsdI2uVbF+rTAIilE lOjVPQSCEwkeTVwxACbTX4WhnyRD7DFZbPb3109iUBYd0qDgrCK1PNWcWouKvBdrMKD5 Ay5g== X-Gm-Message-State: AOJu0YzoSdcFmAKhcvgKftLOe74yJgS9M8BSheL9xaZROLfB6dpU1a4l Z6fEskD/9FH+Z3HxrnXRhUpkEOlLJL6F7PQmcadO/J+KNe7mkKj4gdWKB05qGIo= X-Google-Smtp-Source: AGHT+IHFpDmsCaGV7oTrK00hOq09gb97uEwnhLljbf1OpeYYvzSbSUUwWbUzn3sobxqCk+h6AfxtcQ== X-Received: by 2002:a5d:5906:0:b0:367:96a1:3c97 with SMTP id ffacd0b85a97d-3679dd66e4cmr2331254f8f.48.1720165749410; Fri, 05 Jul 2024 00:49:09 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:08 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Heiko Stuebner , Srinivas Kandagatla Subject: [PATCH 04/15] nvmem: rockchip-otp: set add_legacy_fixed_of_cells config option Date: Fri, 5 Jul 2024 08:48:41 +0100 Message-Id: <20240705074852.423202-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Heiko Stuebner The Rockchip OTP describes its layout via devicetree subnodes, so set the appropriate property. Fixes: 2cc3b37f5b6d ("nvmem: add explicit config option to read old syntax = fixed OF cells") Signed-off-by: Heiko Stuebner Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/rockchip-otp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvmem/rockchip-otp.c b/drivers/nvmem/rockchip-otp.c index cb9aa5428350..7107d68a2f8c 100644 --- a/drivers/nvmem/rockchip-otp.c +++ b/drivers/nvmem/rockchip-otp.c @@ -255,6 +255,7 @@ static int rockchip_otp_read(void *context, unsigned in= t offset, static struct nvmem_config otp_config =3D { .name =3D "rockchip-otp", .owner =3D THIS_MODULE, + .add_legacy_fixed_of_cells =3D true, .read_only =3D true, .stride =3D 1, .word_size =3D 1, --=20 2.25.1 From nobody Mon Feb 9 03:52:46 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 4C8A4145B3F for ; Fri, 5 Jul 2024 07:49:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165753; cv=none; b=Gv0ZgCtCRWThhTcy/fvhZg9bYt+n6b1ULRElKOmt0bZgS3v+s5i6Qbanj3aknzif0WHDzQwtk1CNz3jftom+TnbcEUdExj8pAn/1XVcMg7flFPouXcV2Pob+PYbugBcVRkOdIi7si7du0boyQ0YRNBqBWwSRbTNkFGugE/hKaLI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165753; c=relaxed/simple; bh=OojRvM8EMQNuqwibWkSI63p3C5GhOxbuWf7j5BMLtKE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Bjy7krKUjUuXs8G7f8LaCGN8jFWhI/m5txV1wqdZN/1r9nh7pJwb2p4kANRVOi++vY7jjVQA9B9aqFlltwQ1gcWlnyFvKVnUcJvqFdASRjxnEmIkxRYEWjnNUGg016ti1mq3q3GMCtIeCpCEnf/+m+U3TTMxg/v44WgSOoTCEQI= 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=Oj6xmLJK; arc=none smtp.client-ip=209.85.128.49 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Oj6xmLJK" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4255fa23f7bso8982385e9.2 for ; Fri, 05 Jul 2024 00:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165750; x=1720770550; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7M5GNsoye/gXXLtZKuNcnq9qrQmnkX3G8AnYSQI/9n4=; b=Oj6xmLJKlHVYjBiFO4eejMAMFtw0YJPApu9uHpBSsya0iHmmakm2k/9FM2EMzaVGKD JT6gibhvWpt4vFmBldyeDsOuFn2oIM7663bnGkTZfLEJjifgfwXEuc5fWn0L++07Srma 7n9pve+8uDUcDf/Yk7lXPh3G1b9KoRLWjgRAsH+txwAjUMJWbApB2bgsU6N+puo2G51q W7zHmESssZ1i453wGimuD5V+4TZZp/qXt3S6AfKJFT1fOF/BqP34gmQ+5QiKaeu4Q0x2 jSbHcUiacDhXwskmCJYBP7cHfFmyBlJ2yk7IYae+ccvfUazrbIJgIxyM/+xf21hVLT4R xmFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165750; x=1720770550; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7M5GNsoye/gXXLtZKuNcnq9qrQmnkX3G8AnYSQI/9n4=; b=APAGHPhUTJajd3V/tMl6f7hpJxyRtNOhlvrjlIszO2P40yRDJEWVFExnd6LOpzjVe5 N31aoIu1aOVDIvCOyYmATM8vaIQNzf9KHaJIvvG+joi4rEpQ7Q/1+q0lY1wdNf4HssH/ 5zNCHLgnOkRMuFYHsLnwgm/c7/MFMA72WVYVNqzfbAZrlOCKaqnZ4NZF6/zwysFYoShL IBQJ0u+ylfcR+6sXDCZYSkCIqnMZDGqHvwJLDs3iJHT3mszEqMBy8AKhZhP+7UR2vCKI f/J9mOOazr01ySISiWWQwiGYeSiOsMuSbCTqPOXkkBdG/zui2k7+rTi92vkIla7IJhKp y88A== X-Gm-Message-State: AOJu0YzdwJGrp8zLQde/2JjWgNDP4AJ8FfCcSZ/kRzHHo4TLeAZecHdV JgAnOO2xIlDSC8Z+kB7IRPSswO5pi32z/x3GBDCfPymQ54ECcCiX9iPFBxaFZIw= X-Google-Smtp-Source: AGHT+IF/E2CnpMiUCpp5VolLY0hzQXNP9TLYiERkH8KQUP4XbubbeDiHz005MoFCqIsHEfsW1wqEvw== X-Received: by 2002:a05:600c:3286:b0:424:9bfe:6305 with SMTP id 5b1f17b1804b1-4264a3dc8c2mr25708515e9.24.1720165750715; Fri, 05 Jul 2024 00:49:10 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:09 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Heiko Stuebner , Srinivas Kandagatla Subject: [PATCH 05/15] nvmem: rockchip-otp: Set type to OTP Date: Fri, 5 Jul 2024 08:48:42 +0100 Message-Id: <20240705074852.423202-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Heiko Stuebner The Rockchip OTP is obviously an OTP memory, so document this fact. Signed-off-by: Heiko Stuebner Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/rockchip-otp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvmem/rockchip-otp.c b/drivers/nvmem/rockchip-otp.c index 7107d68a2f8c..ebc3f0b24166 100644 --- a/drivers/nvmem/rockchip-otp.c +++ b/drivers/nvmem/rockchip-otp.c @@ -256,6 +256,7 @@ static struct nvmem_config otp_config =3D { .name =3D "rockchip-otp", .owner =3D THIS_MODULE, .add_legacy_fixed_of_cells =3D true, + .type =3D NVMEM_TYPE_OTP, .read_only =3D true, .stride =3D 1, .word_size =3D 1, --=20 2.25.1 From nobody Mon Feb 9 03:52:46 2026 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 5C43814601D for ; Fri, 5 Jul 2024 07:49:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165755; cv=none; b=QCpcyKXVzAbNxT2zyD+vdtTrBqKN4CBfVClc00eWKsnDlpONMNFIVa0V3TEQHi4M1RIcvxgWG2kzehbzm/mZxlUsd5IcPGmd1DTpQHqnMfd0/Dk6BhkMmJK2srujURJn8PtszB+8B6TWbEZV1um1ac5flwFHDcrYhrNLOeSBDJU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165755; c=relaxed/simple; bh=8E0U797Ai02f/x43XQavOkgktbx2z3xrDzNJGWfgnhU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sdye4xvhqeTno9AQTm1VhWN8fxFnQ45ptK1kbL5Aj2mZYxSbBJBY/dvkiFSRqSVr3J0asN1ww1+gYegEk4IrmfejnDWQdeNWy39OeNiPEYS74ulucJFCM3DsZOeIb/bigI1VmZuvSk7DU3DvIadlexLh46uesibRPWULBRaQkhM= 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=BujD0VOn; arc=none smtp.client-ip=209.85.128.46 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BujD0VOn" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4265921b0f6so756785e9.2 for ; Fri, 05 Jul 2024 00:49:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165752; x=1720770552; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DePcDWsxo3qyzVu5W9YbWFSxi8awVgKAQK7WIV/XO+w=; b=BujD0VOnNM9IHEkiODNlUoLIXfN/MBBroCmpL1susDDJmhkPT+22XPWUtX9HRbksG0 cVGbDbd7NhSdDt5zU+qH/de9YWxcBH0Xhx3J0GJ58/rZnfAvPfblHsrb+f+vPHbFcVZc do+qrKZuUoBqAPrWV7T9skWT6GBhAmi5R2mSBkP+y3s3RmPe70FdN7mXUZr4AwVYXHV7 Z/8KsF01b8NXjmPavUL3oKNVVcFNEB394zy0kt6Fv7c7uKCnmuSLeFHgKIyImfq/2pdt GBtbHBn7Lb6TPkRreyy7aVyg6n8hxrmi3Yljic79PfmgqAPEwdcH2OKx8pm/p8RrKYN4 tbhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165752; x=1720770552; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DePcDWsxo3qyzVu5W9YbWFSxi8awVgKAQK7WIV/XO+w=; b=m8dC3UaIEAGLufhuS9xtoMwGcR8BjtgEPnxsVCZliD4/sqV8ImbPDSlCjYSaMPtCgC lQr3bkQO5pCwKke0bEueXrmBAyGvApZkcp9kmsMF08/y9Ly9RWWkpsOuFYNQC1RKH706 xexFojnCdEw6nSAeO9BPASxCWYn0iJZZREyPIJ6MWG38lx0n+CzlI9qsWuSOfmz0g1YC S3CwTDvOGtjiyyvH7+PkFHuFu9EbzOzJPIoILKFK2lF5JyVuI05oNL9XHbi5fld/f4+K aQmCDwaerrYv8mjw/LR+YpIAzcGr25/zKcW3CoTVcKfH+udH9yNjPAnPiK/vcnwf6Kij bdWA== X-Gm-Message-State: AOJu0YyUI4kwHkZj+JB0bNm6n0ik5BGv9XfmSs2haSmYJwy2F+Hf6F7S c1KQnFb6i0ptCXwso8xF02EzYIbDGCEfLOyh50riEdWdZRvAB2UUnqf5HKrAhFA= X-Google-Smtp-Source: AGHT+IHy/c96L8vwSh1xetryRpNzghKNSfpN8AfxeAEpaQEcstyxOfDoOyLf3NAKBGVdtC5M+lERAA== X-Received: by 2002:a05:600c:88a:b0:424:a4f1:8c3e with SMTP id 5b1f17b1804b1-4264a46cb5cmr26759355e9.34.1720165751904; Fri, 05 Jul 2024 00:49:11 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:11 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Heiko Stuebner , Srinivas Kandagatla Subject: [PATCH 06/15] nvmem: rockchip-efuse: set type to OTP Date: Fri, 5 Jul 2024 08:48:43 +0100 Message-Id: <20240705074852.423202-7-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Heiko Stuebner This device currently reports an "Unknown" type in sysfs. Since it is an eFuse hardware device, set its type to OTP. Signed-off-by: Heiko Stuebner Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/rockchip-efuse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c index 2b40978ddb18..013e67136f3b 100644 --- a/drivers/nvmem/rockchip-efuse.c +++ b/drivers/nvmem/rockchip-efuse.c @@ -206,6 +206,7 @@ static int rockchip_rk3399_efuse_read(void *context, un= signed int offset, static struct nvmem_config econfig =3D { .name =3D "rockchip-efuse", .add_legacy_fixed_of_cells =3D true, + .type =3D NVMEM_TYPE_OTP, .stride =3D 1, .word_size =3D 1, .read_only =3D true, --=20 2.25.1 From nobody Mon Feb 9 03:52:46 2026 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 BE0511465A0 for ; Fri, 5 Jul 2024 07:49:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165756; cv=none; b=lEaJUK8U1+EXwcpy0KSJOVRDhKd1MATebX/GOxSui24jKdK+f3WpS4fiXYhxbvEGvoQiyl9NdQS4g3eOWcrQWARHYXFSAjcvY4p86eqfT4WmWyWS6CFqBFV71ffGN/46no3/w6ZNmEQmGvZTCHtWE+HjQ27P8Y9dqT07cAM13AE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165756; c=relaxed/simple; bh=GxSXhbfQyJ+StvjIptXu26VU8MlnrccMSDjcQCPLuf0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Zsh76nfnLRT6SPB9O7ROEuvvIZPyO+pVsVJWf4HLM6vlCsxJ+l9PKsspcHdQd1Ml6bE7diR/FjHjK0jUJjvFEzVoZwNLkIud3A1soqdnfMRFWIkcZP8t01vCfpSU9Gw0ItSR92LWKVXdLk1rsmVkOaDJYRb+OPWNeClmmLv9KPo= 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=UNVkzE/j; arc=none smtp.client-ip=209.85.128.43 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UNVkzE/j" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-42565670e20so14957455e9.0 for ; Fri, 05 Jul 2024 00:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165753; x=1720770553; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JmzAVFFw5D08+uA91hfZb9Q9HqDSR2WAdM+Ft2fb7zk=; b=UNVkzE/jJ1BlYR+6LAmvO3XPRs5PAS7pbyilzPSxMmbn59k5dedMGY8nAaDIyxHGuB Le212IfSeleKe69dO+cha659HPMFEOjU/W8qqmPvzJ7IEfuim99s5tY3tXlZ892TSgl3 Hy178J2Hb2uOYqdNmYrBhys7uTCq8bSWnyMRo402grTJE2vCR+hPa63ZpNGXxiaeZ4Cl DZQHWgVBltF84lDmGpLPzfONVJPeKSSOedFlaRc5jKpXPQHCm/YO0ImLbO2sx9I/zuFI cKj/XVt7ApEDKVHzny7XnG9Hd4yos/CTSoLPRPkvtkw/HMQocmxx8jwd5IjGdWEj+CJ9 74vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165753; x=1720770553; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JmzAVFFw5D08+uA91hfZb9Q9HqDSR2WAdM+Ft2fb7zk=; b=YlWBYjNuBXrJkHPGrrcVzuSsZE0dWvhgtWeYFHfEIvQj3cL7NbHgP4Nc3sNZY77SSu twteq2Nc8R3vwqujGYLlPQrl8kdJWaJf7tZdy2KkAZh/UHxpSC1LGbHn/YOpDCgd4m3x MscAIjYjCye0cc74F3zROWum0zcBYz6Jiz7yZ9esoytA3Wjcg0PL/OaIL/Wds6v+pPFg yLQHMUANCDFXTyEVH9X8tGqrW32XuGWAQI4GjX+NMVu2PxIepF8YtOJIo5kw8l02XIpm Zk5AM4DHAwI1Cyv04/An/EaOVTvq6aPVvmV2+RwWPUbHqs812SkiG1yZ6e3byW4/qY2/ P7iQ== X-Gm-Message-State: AOJu0YwleP+Qo82lv9NLDBizo43wDDVilGRAOW6Y7AfgAk/W+yDGneNi T8auSZqlZbsz/oYrXo6I4amYAGTYbxrCBxSfEn50j/9urypyuGEMjSB7h1Fu3WU= X-Google-Smtp-Source: AGHT+IFAT58+8doNA/oVE013DnsB6VbLaRtBLbYPR+iJHMq4ISD/FC3kjCT76dKTj5KPWqWl5xiWmQ== X-Received: by 2002:a5d:4bc6:0:b0:367:940b:b662 with SMTP id ffacd0b85a97d-3679f7392a4mr3851936f8f.31.1720165753177; Fri, 05 Jul 2024 00:49:13 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:12 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Neil Armstrong , Rob Herring , Srinivas Kandagatla Subject: [PATCH 07/15] dt-bindings: nvmem: amlogic,meson-gx-efuse: add optional power-domains Date: Fri, 5 Jul 2024 08:48:44 +0100 Message-Id: <20240705074852.423202-8-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Neil Armstrong On newer SoCs, the eFuse hardware can require a power-domain to operate, add it as optional. Signed-off-by: Neil Armstrong Acked-by: Rob Herring (Arm) Signed-off-by: Srinivas Kandagatla --- .../devicetree/bindings/nvmem/amlogic,meson-gxbb-efuse.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/nvmem/amlogic,meson-gxbb-efu= se.yaml b/Documentation/devicetree/bindings/nvmem/amlogic,meson-gxbb-efuse.= yaml index 9801fe6f91b5..99ddc9a4af05 100644 --- a/Documentation/devicetree/bindings/nvmem/amlogic,meson-gxbb-efuse.yaml +++ b/Documentation/devicetree/bindings/nvmem/amlogic,meson-gxbb-efuse.yaml @@ -28,6 +28,9 @@ properties: description: phandle to the secure-monitor node $ref: /schemas/types.yaml#/definitions/phandle =20 + power-domains: + maxItems: 1 + required: - compatible - clocks --=20 2.25.1 From nobody Mon Feb 9 03:52:46 2026 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 CDA521465BF for ; Fri, 5 Jul 2024 07:49:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165757; cv=none; b=grJwIQ3iKaotyXr1/vYprEIdcjCRZktlNde/71EsiTQB5AqVpNQ+Du97170e+ORMGfB6+8ojv06/HRqURQrk7VQc/XWd55hy6sVefgUIVoYUymy4hpY7hH2HYaUoXycU2LhoNaNGf5/RHAz5mOfN84dF9CplF5Gcb+pnxX1KSbo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165757; c=relaxed/simple; bh=ApNgVEyefwonGtF2kg0CC6PZb0wdXDGqNokiDmHMekQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=K8HQbJosf+9QXpI309c/nS9/FpUJ2YuQyVI4M4AAoGQuuQv2NnSflnrZeNXr8SSpPnvJssHC3knmIlSwEeVTCIXoMR9R1pEb+IQyCfBvwyYOR9d+I0H+Dqx6Sk+BaMHj0Q4AewRNqD+ZcWYQbmqwCbxeyd5h0PNHWKYKwRWgKCA= 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=xfnyfHLR; arc=none smtp.client-ip=209.85.128.46 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xfnyfHLR" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-42565697036so14897435e9.1 for ; Fri, 05 Jul 2024 00:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165754; x=1720770554; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hgFHDePV9W2t1nLieQ6ukOgilmsjYBj+gzokwhFCmE0=; b=xfnyfHLRE2+l5JVYvw/HxIieRWa59q3lUxVxyeAdcyCnmYreRphfLgH/fNgYskrPaF EQSitkdA1jJjfWt1ZYcmPLXz/T5OqXHOUom6hsM2LHK55z3NGnGy/figyfc/HoSN6xsO YxTtVNSWToHBNVPD0X+4S9PjQE4rWL1tPRQybiSG+RvxGZClUOyB1o2V3S4SBhR4MicY VnB2x3Y0KJ0dZFj/xEjm65jMeX0ljWbF4ixoI4SZgVSAt2C8rA25rNeLaXthlNCVzvgm g9QCmCqXbpXTelmf0rry8CMRp3//15ghKUASdhFcXzN2Vo5ZPCcmjO2+vFrP317SZd9O fZCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165754; x=1720770554; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hgFHDePV9W2t1nLieQ6ukOgilmsjYBj+gzokwhFCmE0=; b=pt5kDmaBKqB/vsiW8aJNL8mlwVK2JyxIU7eZ/rnv+eKo6L96S7RfFbJ888rOn/6aWH CMn9zFJ0gZQDkBhmSZRwNwS1Y/a11hgK8a/ykm7pijNxUys2b9hL+FSnLYyPVuhTumji B+K64p5KCABV77wgpEJw2BRRk9uEvYTidaNreNs9Ac8nkQCzeO99CEF9wthkcyC2cdQL gFacOEJzR1dLhE0czj1wn7UcSVu9Nqtn3iOnaCQYtxgXf3OhmsJnKy93bI9cMFPbmtVb 1+TBpZ/0nhkLGeddJna1kitEmznlRC1koQXWCG1cLcYKQcui5P3Iy1C5i5BCFlvhZZT9 JYIg== X-Gm-Message-State: AOJu0YxuudDE/bK1MICLyNeNbIjnuY9GA5gipCksY6lceg7likB+9Xy9 ahdxJJSFjRb2aoPeaj7szbmkvt5h+7INDdOLEh0woSs7ljZWzQHI4q+njDXZr+Q= X-Google-Smtp-Source: AGHT+IGFRb9IDKV5phPE77Orp9M3S3Pni1bit2JH9rlAxTuR1q+tYzMrfJU3TZEbrjt5eP27+7sVbA== X-Received: by 2002:a05:600c:19cc:b0:421:b906:8088 with SMTP id 5b1f17b1804b1-4264aff9862mr30895905e9.0.1720165754418; Fri, 05 Jul 2024 00:49:14 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:13 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Krzysztof Kozlowski , Srinivas Kandagatla Subject: [PATCH 08/15] dt-bindings: nvmem: mediatek: efuse: add support for MT7988 Date: Fri, 5 Jul 2024 08:48:45 +0100 Message-Id: <20240705074852.423202-9-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> 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: quoted-printable From: Rafa=C5=82 Mi=C5=82ecki Add compatible for MT7988 SoC. Signed-off-by: Rafa=C5=82 Mi=C5=82ecki Acked-by: Krzysztof Kozlowski Signed-off-by: Srinivas Kandagatla --- Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml b/= Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml index a773101d8538..32b8c1eb4e80 100644 --- a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml +++ b/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml @@ -30,6 +30,7 @@ properties: - mediatek,mt7623-efuse - mediatek,mt7981-efuse - mediatek,mt7986-efuse + - mediatek,mt7988-efuse - mediatek,mt8173-efuse - mediatek,mt8183-efuse - mediatek,mt8186-efuse --=20 2.25.1 From nobody Mon Feb 9 03:52:46 2026 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 112F4146A89 for ; Fri, 5 Jul 2024 07:49:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165758; cv=none; b=EaTKoyoVZzFjCGCq+xeCRuZaxfYDGJ37WR6JRnn/XpLUumW3JsOGqkuGNDIPmKYJZ1N17fkcHT4j1vUBuEIiJAwZbOwFTAAIf9aEs1E1RQnX82nMyJzeFqx6M6UftNQtoXGPBZpAoNc8sjUhQ/+vRPEml74tpbgS98q8fRmeYQE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165758; c=relaxed/simple; bh=l/GxTqAD8seDDZ8vYnqY7iwINeLrU2wr+nQsZ3xxbR8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=WaLDJ/bxoOxbwKrplR6kQp4nyQphpdLf7my6HCQ73Q9IfpWrXoFYBZ1xoaGxMKj+RUrT1iWKE3B9JIpOvAdeiawpkMnjDS6Zp+2FYb2d1Jt9ww7lFQrLDQzZalMEQgaPRiocC0Dx39KKlyMRC12kCuKlHB2AbXcn1kStPG9GmcU= 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=mnx7+9Z5; arc=none smtp.client-ip=209.85.128.45 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mnx7+9Z5" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-425814992aeso9012675e9.1 for ; Fri, 05 Jul 2024 00:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165755; x=1720770555; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0o57SC4IYqYrnc2Cn5Q7DJYwc55Mhg5yPpsKF9dEPks=; b=mnx7+9Z5pqOfa9Pcy/0CyZGPAmAd4z82vzYIhIvFBYQ26X7jVtFLnazACF3IK/d/Go KevDKgOy+Mw/R5HpEC1wamz9UDl2EfLtUBIceOHDXZ7l0RGQWzPEn3Ol1YhTputgS6uD dDPiQKKwk9Rr1HvWT6ySpSKB56bqj5Hi9o7iX3HOThMf5Tszib2XeXzkUsMKXDdUFFF3 G3joUQW3IwJPxyV1jOrzptszmL8UA757WUtrXDLpnDxbiNzp39CTYCHiNl+q5PrW2sdQ CLkuX7DdRSpYagsKjP+2tSedq1T45hihkGO8eSGQHgWstw4b3ZMk2wxi7+6E+u5M8x8f F+bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165755; x=1720770555; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0o57SC4IYqYrnc2Cn5Q7DJYwc55Mhg5yPpsKF9dEPks=; b=LPPZOfd+TAW9xotUqlKFp3aBgfCN1QS6VylB2MgUECWE9chXwTA4ppagUsU8IrLLyf RqDZuz76XzN43iNqqoLOxxDIk8d4CAr6SZMVEM5PN3u+9/6H3NUcf53jwuWFh8Gozpce ZfTkK9B14jqkkVvzOKRTsCPUpy++gzeuwtmwEXZ6rMsTxlmP7My/gxdrn7kO2xsmFCab eAOXY+sFAzYRV3akk3B1cQYJsPsmHvh0XojUnH12ZRn4RokoJFo1Fz80QzlNl4st2cAW Ezwb+sLPoPywreyZ5/rm82QoQnxpfuF/5kwb2ZJUnII/r3UqVcuedMc1ddUzKd5jqVsE d9Kw== X-Gm-Message-State: AOJu0YxZoqRCEdOmWAF6Om9y82dv00NozTX5JC9+vooGEiVTm3F9DFFb mdClCK67oFn/rev6RuIMXtD9+seGq4KBbFexnPTd9+vwynB8kE14b2vBqD8rgNOyuzK1TtkCcBf RMig= X-Google-Smtp-Source: AGHT+IHcuyo1M2IjZX4Vx/+gzVUv8+/FrtO2jqQ983Kw/BI7ioW39feDy97kjAVcvTBtPCEh6DN0dw== X-Received: by 2002:a05:600c:4608:b0:426:5269:9827 with SMTP id 5b1f17b1804b1-4265269994amr5901905e9.0.1720165755554; Fri, 05 Jul 2024 00:49:15 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:14 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Srinivas Kandagatla Subject: [PATCH 09/15] nvmem: core: add single sysfs group Date: Fri, 5 Jul 2024 08:48:46 +0100 Message-Id: <20240705074852.423202-10-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> 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: quoted-printable From: Thomas Wei=C3=9Fschuh The sysfs core provides a function to easily register a single group. Use it and remove the now unnecessary nvmem_cells_groups array. Signed-off-by: Thomas Wei=C3=9Fschuh Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index e1ec3b7200d7..96e76d88204c 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -367,11 +367,6 @@ static const struct attribute_group *nvmem_dev_groups[= ] =3D { NULL, }; =20 -static const struct attribute_group *nvmem_cells_groups[] =3D { - &nvmem_cells_group, - NULL, -}; - static struct bin_attribute bin_attr_nvmem_eeprom_compat =3D { .attr =3D { .name =3D "eeprom", @@ -478,7 +473,7 @@ static int nvmem_populate_sysfs_cells(struct nvmem_devi= ce *nvmem) =20 nvmem_cells_group.bin_attrs =3D cells_attrs; =20 - ret =3D device_add_groups(&nvmem->dev, nvmem_cells_groups); + ret =3D device_add_group(&nvmem->dev, &nvmem_cells_group); if (ret) goto unlock_mutex; =20 --=20 2.25.1 From nobody Mon Feb 9 03:52:46 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 5AAB1146A70 for ; Fri, 5 Jul 2024 07:49:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165760; cv=none; b=r6RQbV9zqLuMOHGTLYs7injtIROIZUMJn7Q8rtZsPMn4fweChHvbUnWh8BabIYehEgUGFo6SEMwnSu5ev74SJsKuAz0Cl9pf+fktippbRKQiZ8ZP3nOhJI61+fPvXPFhA+aHct5gxO4oLi1/Kn2cim+PQP+QGcx2pTy9Kgp7SkI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165760; c=relaxed/simple; bh=kxUFx2Wg0lOziGZ8gs8uQqXjgNWaCXYxeGI3anasKfQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=WxmWAO7oV9Ngrw1BXMtpE3y7N9X1Sgslje1zJH9F6GEpkGnp01R1bnfY8OpvCHahyYVwKQK0vmiLZSQFlY0mNSj/2qA4r5AEQpYE9gQy7WecJ05F9cMZZsGLzoX4IDlHFL+JyG2vjy4Q89rihQJ9tyQ079sEtVN9Cz9oBgzjkX0= 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=tNp3kadu; arc=none smtp.client-ip=209.85.128.49 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="tNp3kadu" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4265921b0f6so757185e9.2 for ; Fri, 05 Jul 2024 00:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165757; x=1720770557; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3RE6L8u2/CCq/4WbIyqTEWOTaRPez1DDZwQksX4yhO4=; b=tNp3kaduy5uK9mUj5Tez+++5GbbYNNCAjBqjE+Z+pUBM0nreslcX5KBhnIF8Qnj7jo yI7Cta11IiODphF27b64jWYsyeEWtIyeCr5mWJr7DXaNJrRNSmTk9zQbv9W0sMV3QB3X CPYNvXWIDkxAt80p7vyVy6i13Q2v+jc+R6eizakAOwgOE3gmNVNiYx3zi1FVyibRyswY +k0N06KZF1he7KYByuU+UY832QO5CR6yC0UKyWHqzy5TNPnp6BfzbjlvpsYneBHeb92+ 1pAM9ztVjWWyaGU8LPm0uVGNUoudi/hWwwrZCXlSm7YLOOUU0Ma6om9wbzy2JHSqscLF apgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165757; x=1720770557; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3RE6L8u2/CCq/4WbIyqTEWOTaRPez1DDZwQksX4yhO4=; b=m3RYblBQwL52ielcHMVaoCnJ6SsAH3NGMsFZhaNUK9D0lPFhlReOmTB0ZMCCj212wu DjrEnMeFZaEueqtmHiWSg2LTXzSBvE64i40GUgCY6Ir9+tUndbkLPT3IaEQ7qYgYagTN ZriialgmE2Dx8QBntueIxT3uI0I10w5dFENw9McIprDbHbzPmvZMU+EdR0KFUD5ettYX PgdiIY4RVPoHgjz+9c887LbpwQRN7oOiildg9UfwuXXhJe/DxXXCIqmov8MJXv/MUJo9 i1eLrMO6142wCGySX58EpME/jTUQ6UtHOyxX9+P9lNJRmV3P7LKPO2nqPKpfQR/jfUUY ZL2Q== X-Gm-Message-State: AOJu0YwhLdUIwJgeErF2vUIM9qzaf7gqPzUqgdgkbziprWwVQDANaMz5 DwsKOxcldlMKtWZSWc6RLPw3loTzgDT/vGHNTTB6rxOnUhRwDJsUp+GPalJRqp5nA0ikWYGrOMY +yxY= X-Google-Smtp-Source: AGHT+IGm5C5VvdfepkDvB2LTv9P3biKt7tC7F1iN+qzIjSdkHN/IRSEDlolRAGsVfpFf0bH1WAsQsw== X-Received: by 2002:adf:fc49:0:b0:367:89d5:e440 with SMTP id ffacd0b85a97d-3679dd24f66mr2336507f8f.20.1720165756869; Fri, 05 Jul 2024 00:49:16 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:15 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Srinivas Kandagatla Subject: [PATCH 10/15] nvmem: core: remove global nvmem_cells_group Date: Fri, 5 Jul 2024 08:48:47 +0100 Message-Id: <20240705074852.423202-11-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> 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: quoted-printable From: Thomas Wei=C3=9Fschuh nvmem_cells_groups is a global variable that is also mutated. This is complicated and error-prone. Instead use a normal stack variable. Signed-off-by: Thomas Wei=C3=9Fschuh Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 96e76d88204c..015e6b9e0b60 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -357,11 +357,6 @@ static const struct attribute_group nvmem_bin_group = =3D { .is_bin_visible =3D nvmem_bin_attr_is_visible, }; =20 -/* Cell attributes will be dynamically allocated */ -static struct attribute_group nvmem_cells_group =3D { - .name =3D "cells", -}; - static const struct attribute_group *nvmem_dev_groups[] =3D { &nvmem_bin_group, NULL, @@ -424,23 +419,24 @@ static void nvmem_sysfs_remove_compat(struct nvmem_de= vice *nvmem, =20 static int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem) { - struct bin_attribute **cells_attrs, *attrs; + struct attribute_group group =3D { + .name =3D "cells", + }; struct nvmem_cell_entry *entry; + struct bin_attribute *attrs; unsigned int ncells =3D 0, i =3D 0; int ret =3D 0; =20 mutex_lock(&nvmem_mutex); =20 - if (list_empty(&nvmem->cells) || nvmem->sysfs_cells_populated) { - nvmem_cells_group.bin_attrs =3D NULL; + if (list_empty(&nvmem->cells) || nvmem->sysfs_cells_populated) goto unlock_mutex; - } =20 /* Allocate an array of attributes with a sentinel */ ncells =3D list_count_nodes(&nvmem->cells); - cells_attrs =3D devm_kcalloc(&nvmem->dev, ncells + 1, - sizeof(struct bin_attribute *), GFP_KERNEL); - if (!cells_attrs) { + group.bin_attrs =3D devm_kcalloc(&nvmem->dev, ncells + 1, + sizeof(struct bin_attribute *), GFP_KERNEL); + if (!group.bin_attrs) { ret =3D -ENOMEM; goto unlock_mutex; } @@ -467,13 +463,11 @@ static int nvmem_populate_sysfs_cells(struct nvmem_de= vice *nvmem) goto unlock_mutex; } =20 - cells_attrs[i] =3D &attrs[i]; + group.bin_attrs[i] =3D &attrs[i]; i++; } =20 - nvmem_cells_group.bin_attrs =3D cells_attrs; - - ret =3D device_add_group(&nvmem->dev, &nvmem_cells_group); + ret =3D device_add_group(&nvmem->dev, &group); if (ret) goto unlock_mutex; =20 --=20 2.25.1 From nobody Mon Feb 9 03:52:46 2026 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 C340F1474C9 for ; Fri, 5 Jul 2024 07:49:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165761; cv=none; b=Gqz0kl5dNG5rGtUQoTCZXtkUM98M266mFY/2HN+14oPudzMDn0A0TR8xRygSthLkkXScd51menQkNYKsQ7EO63OjTq5SzOW+UkGdWSZS6DUDWDfxRgJtdfRCi0YyN/dkWUIptAwS4wencB+i0ykJBiGdqMZgnp9C9yzGdg9+/gM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165761; c=relaxed/simple; bh=HvS834gnhs5PyAS4sXod0ksL1IUfM8w2goWQNFgtWj4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=iVU1HPkID4bCG+ckMZ3oNB6NxHmn3Adx1Sqde+1fDAKKj48nsqNiHIUwDLXzThGcsn6BljOit/T0uvE9tFQ/lhuRExfinG3DV35wi2mdRBk4V4z8cFb7MfXhZz9B38womxC0WIkQSe0ZfK9ULeO/66UAhNORR9m2Cg5z4g08DjQ= 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=AauD6eqr; arc=none smtp.client-ip=209.85.221.49 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="AauD6eqr" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-367339bd00aso996446f8f.3 for ; Fri, 05 Jul 2024 00:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165758; x=1720770558; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T8ptIZmYCIZH4/flhXIpF5GExhEPlVju099CxJvkDGw=; b=AauD6eqrcDgg7fgWhli/VR6A19tiZYu8XjSBIqRduSOy+gkpaw6JYphFGagc2N7UXF jXWO+GLp/dxyq2Rw4nZiaF8EcRBqOfK+tyW9doexm3WAyqXjMR/tvMCxkWYTLPGZ5OX5 cSpbea02iABULgneTYK6inhhwu3gMhHmRpw1RW0xljaV+YB0dCX4sfwcPWBUJXuLBiYM 389XdAJSHnJLpFEWzZ6Vp16H3V+/42+WBD9xJasLKanAGL7+LWR+pjIjSMYt8ffJzum1 tQ0DN7XrkEnEReaNGXrzoZxO8VndXm07MTZbtQCO4t80z7UtHxGbwKHlpggKw8N5jg+h Lp7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165758; x=1720770558; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T8ptIZmYCIZH4/flhXIpF5GExhEPlVju099CxJvkDGw=; b=CBgPkgDFPXFuY+G25xIHLriuHHXFyvNe2Gr7iNR2z6V1F9+YKldk9oQOVeWRNs2rDM e7pXa/Nq9pw8fvdDTuWN+8nqE158PuMopOreihhC1XtwZYFHswj4Ukse60jG4AhGpm6K 9gT2LJphBlgQkpPIvELa/C5VQuekbQhY+VqRWDrCqSDPWKAzBPbctHjeKWez7y3MbTii bYrkh8oK0b5kGmKkzKLIQ0rnHkdreDhp/6SpRoJH3DzbJp4PsTOGnd8MZZGtdCKDTFR8 ZiBrMbg63I5w5M0bZIhjyrL9eESs4WQmF96OpbJVEvDoY57YaDyh3POKiMMdd8bZVuVo 284Q== X-Gm-Message-State: AOJu0YzbGOsNKGflunMh+un6/LvHGuT20xYZtjINZ2j9398YUPJYCSFl LMThklQaBqGuLRZ6NcggT7Ub7BokDDxQNFauS0883bmsIWD53aFoba7mc2S5BKB5mhUVhiuh2py DpDs= X-Google-Smtp-Source: AGHT+IGVZdLJBGX7WTg8vWJs+eoOGk16/TWo89XOVk2DXqiTE/4+MU6/n5ssZZGF9O/Z25QQ1XRzeQ== X-Received: by 2002:adf:fe8d:0:b0:367:916e:4206 with SMTP id ffacd0b85a97d-3679dd67de8mr2629270f8f.46.1720165758314; Fri, 05 Jul 2024 00:49:18 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:17 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Srinivas Kandagatla Subject: [PATCH 11/15] nvmem: core: drop unnecessary range checks in sysfs callbacks Date: Fri, 5 Jul 2024 08:48:48 +0100 Message-Id: <20240705074852.423202-12-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> 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: quoted-printable From: Thomas Wei=C3=9Fschuh The same checks have already been done in sysfs_kf_bin_write() and sysfs_kf_bin_read() just before the callbacks are invoked. Signed-off-by: Thomas Wei=C3=9Fschuh Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 015e6b9e0b60..ec31c1fe9a99 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -203,19 +203,12 @@ static ssize_t bin_attr_nvmem_read(struct file *filp,= struct kobject *kobj, dev =3D kobj_to_dev(kobj); nvmem =3D to_nvmem_device(dev); =20 - /* Stop the user from reading */ - if (pos >=3D nvmem->size) - return 0; - if (!IS_ALIGNED(pos, nvmem->stride)) return -EINVAL; =20 if (count < nvmem->word_size) return -EINVAL; =20 - if (pos + count > nvmem->size) - count =3D nvmem->size - pos; - count =3D round_down(count, nvmem->word_size); =20 if (!nvmem->reg_read) @@ -243,19 +236,12 @@ static ssize_t bin_attr_nvmem_write(struct file *filp= , struct kobject *kobj, dev =3D kobj_to_dev(kobj); nvmem =3D to_nvmem_device(dev); =20 - /* Stop the user from writing */ - if (pos >=3D nvmem->size) - return -EFBIG; - if (!IS_ALIGNED(pos, nvmem->stride)) return -EINVAL; =20 if (count < nvmem->word_size) return -EINVAL; =20 - if (pos + count > nvmem->size) - count =3D nvmem->size - pos; - count =3D round_down(count, nvmem->word_size); =20 if (!nvmem->reg_write) --=20 2.25.1 From nobody Mon Feb 9 03:52:46 2026 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 10B631482E3 for ; Fri, 5 Jul 2024 07:49:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165762; cv=none; b=RVa+MwhIe6WPItWvD23w/MBES14An7dC/oLYRlC6pDWFpatZd1FZhF4OXHj0ewl2Mukl6ExeMhdb8VKhGEQeFWXtWmJ2AiuYhqp9wK2FONmzKPZ9gdFxt0JTBvz+Fzv5HnTNun8o5Ileh0sM3zg8TNBqNspkd6vVerMOdLHikAg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165762; c=relaxed/simple; bh=DMCdzn4lsRMoH1EDvKoludOa1bemgtjph7OKGjhUJvM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UcxRL7MJ49fC85vNDRc/HYf02CKlTa7hx3qKt0c00bOjM9SVikebWh3WaQFU7Epe3VW4o5jhhnIdk5bdEMId+Z43OpchG0FKOLVIiBhBEUf3yfRmz1a+Sv0CLS/tutpil+Ty4zCCBmBoFqP6PjnFMJegtmxnvTFjroT0bap4HyM= 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=DyFEI64W; arc=none smtp.client-ip=209.85.221.49 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DyFEI64W" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-356c4e926a3so741127f8f.1 for ; Fri, 05 Jul 2024 00:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165759; x=1720770559; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qzsIUUlH+MlPnhCm/A83/7nDy6Hh13MepVcPKiER9xQ=; b=DyFEI64WfWMTygA/JoCxU3tFjZ2sary5Vd5B6wd1kgN7u8SJziHGJcY8Mv/TZ5nhoH Mv0qgitJ1jtp84vdYFwMVLO4ZvWpRSoSL018eOLy/Zn+VFKnq2/2sGRIgcvEXmi4SikX MaPieLGHoTrK71D2M6cCcEv+/e1fP0ifkoWLhrMMdJeEaw9v9IbOnnohVkyOd4Vk/5dG 3gGx51Yhs3lh2qqBua/km+lFhvj79BhuABMrJAt8e99ruiHHD/pVyzKsqVJ+vr6275yl /4fLyxb8BDnZukEtQaGUHmgw8GwJxkzCOzUePkUiwVlk7ciwknGnFquMVpLVAhbHktmK Hf9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165759; x=1720770559; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qzsIUUlH+MlPnhCm/A83/7nDy6Hh13MepVcPKiER9xQ=; b=EQcTRt5WNbMayLkJYLNPutfnMKvFZXy/2XUDh4WupkexXWa2sS5hBTRRYWq98DXPo8 HDLfwxqItt1LmLKIZTcLXwgybDdeEqZkl4gY62kxOa4r0vEAJ/x4HmMGz0yFCeLRgsSi uj+sbfqgj+oOLSMF9t+PDpCjf96Z0eR5d8F2ArGNRtFlrdEa1wz6p3qvII8nHYgeezxJ eARP1aVaSN9KCKuJ+SLZv010Zh+DLmtsdpnZRz54yHuc4EOiFaCXLf/0fAnbeND3Sf3x ebl9IpVhjm3IApJvPxd30W3IYehXXlIMwRPv1Nc4O/KLqncWOjTS07GfHkx6Ywgf0zIw 0Dfg== X-Gm-Message-State: AOJu0YzZk3CtBi4W1oHkrVdX8kR2lk+/54AB4td8AT5xJaNYGWIb1SUn 7+1T0zki2aieVAPLWQVqSOskam9lXju9srrUTD8rjPm1r97f8nX/HCKyFV5v+YE= X-Google-Smtp-Source: AGHT+IGmGzU58oFlqtGm87XuCKdMR/Ds4+L94WKx5hOP20Ch+4R32B3NV91i7JobhrxL6bpR85gnbA== X-Received: by 2002:adf:f8c5:0:b0:367:4dc9:efcb with SMTP id ffacd0b85a97d-3679dd7bd10mr2523568f8f.70.1720165759616; Fri, 05 Jul 2024 00:49:19 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:18 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Marek Vasut , Srinivas Kandagatla Subject: [PATCH 12/15] nvmem: Replace spaces with tab in documentation Date: Fri, 5 Jul 2024 08:48:49 +0100 Message-Id: <20240705074852.423202-13-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Marek Vasut Replace two spaces with tab in the sysfs attribute documentation. No functional change. Signed-off-by: Marek Vasut Signed-off-by: Srinivas Kandagatla --- Documentation/ABI/stable/sysfs-bus-nvmem | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ABI/stable/sysfs-bus-nvmem b/Documentation/ABI/s= table/sysfs-bus-nvmem index c399323f37de..854bd11d72ac 100644 --- a/Documentation/ABI/stable/sysfs-bus-nvmem +++ b/Documentation/ABI/stable/sysfs-bus-nvmem @@ -1,6 +1,6 @@ What: /sys/bus/nvmem/devices/.../nvmem Date: July 2015 -KernelVersion: 4.2 +KernelVersion: 4.2 Contact: Srinivas Kandagatla Description: This file allows user to read/write the raw NVMEM contents. --=20 2.25.1 From nobody Mon Feb 9 03:52:46 2026 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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 E84E91487C6 for ; Fri, 5 Jul 2024 07:49:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165764; cv=none; b=NxXq0ockqRqAj2zed6hDht4NSSA4r+F488oH+YbP1ah1ARdFNZBSA4BIFzn4EcQXE8yJT3E57O8y1qIkOBLPA6HnpcGUtQCx9wXSH7u1/E/Utt/0Vh7nOE99eI7SgSPMBGk2QJuXumjCqXppB5THohqLKNnFFlopVtziBe6iBFU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165764; c=relaxed/simple; bh=ovbfKmCLQ8tQJku7TqJaIpcegQLVJ/qlt6pe+CLD2LA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jMDoQIkDvYkoWxyKL74UKjfP50B89Ix9E9P4pchbtTfZRLOnnlSd4aP5BxPg/XvqCAbeHpa9cq+gRkTKWJ6JwN4nMcD4WU65DQl/yGmJnRqWMuoy05F8E6qu8XLl9K3+UeCX97j5wIr4STwU3wGmHvizWxxTtIWS5hMGluk6KWM= 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=P+pXy+Pm; arc=none smtp.client-ip=209.85.167.47 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="P+pXy+Pm" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-52ea79e6979so174424e87.2 for ; Fri, 05 Jul 2024 00:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165761; x=1720770561; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VNhG8coS+s8cdVOrxBSzuNnMnI9yHdY2rEbzIVF31LY=; b=P+pXy+PmWX1j8QFBQa7G1inEjgF7kNXCOsILXG+1WJ67/YsjCzXYxysuwaCNVzgJYu Yslf0XEUO4uGdHUD7gupdZochRZ6KBb8/U0uHYnDknaAybIPigOJQSjV2LvfvICDYO1D B5bx4u4bqNsT5PLNPcTN8nH9gelywnYpGnGwaJ0P+GUXgoVDVXs7puxNJHWBp9JxKwY8 35Nf9ZkYXj7jCwr4uFEB3BppnGd/Hx5fYJBCun90tjVs0Cwho+LYRb+Z227CE6rJZSWr xh4jOfXDKEnKn892NO6zNwJSJ/WLlXi3SvJwNAmaBznDtk1kKQepXxSd7DdqXeZXeUID d4tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165761; x=1720770561; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VNhG8coS+s8cdVOrxBSzuNnMnI9yHdY2rEbzIVF31LY=; b=AjgmDmfDTm/TCuQedly+uHJKbtRDrQXRQQ/3AMUpmEGIOeZtwLwdvUUlUrsQ9IkGLV fOwoXXYg73yYNqH4dPhV3+mLVQ+L035xMk7CrKLJC1rHPifBYv86nZEQ+k6q2g8XYfAN Ab1h9dTfDlA2CkJ9/Yy/c4SBUl+ux9tjM4KfXdfkkmBtUCTiqxfza+9VheCe35iAq5Ny blslcHo+pFKpWInqwpHD+gnHnoiJmERrCdFAmjVyJdyUq5oz0OReR5LRukcD531iAQo3 4qex1nkArzO58VVchZ6GwH1FWi+kVpi7gwi7RmNTPLLaylUaiqHjZ0M0iQTHyUyOt3Ii uxlQ== X-Gm-Message-State: AOJu0Yx5iDKJlT9g8bIlvBrubNCjHxceKdWBdkD6rxdu3iuRGHrlNXU+ qB737i3b7LHTe0RsODAEOr2c9Y7mAGBwsHW0NmJ/8MBS/jQkasm+Hxm8wSMimpY= X-Google-Smtp-Source: AGHT+IHwqdZVL9KI2H+Vpv8rZZrjKcO3PVV8F4KUSuMpkLSOzHvWHI2Y0V9JCDC+UlWviaKXjRgvZg== X-Received: by 2002:ac2:5a50:0:b0:52c:dbc6:8eb0 with SMTP id 2adb3069b0e04-52ea0632ac0mr2966146e87.21.1720165761167; Fri, 05 Jul 2024 00:49:21 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:20 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Marek Vasut , Alexandre Belloni , Srinivas Kandagatla Subject: [PATCH 13/15] nvmem: Document type attribute Date: Fri, 5 Jul 2024 08:48:50 +0100 Message-Id: <20240705074852.423202-14-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Marek Vasut Document a type attribute used by userspace to discern different types of NVMEM devices. The implementation is already present, the ABI document is missing, add it. Reviewed-by: Alexandre Belloni Signed-off-by: Marek Vasut Signed-off-by: Srinivas Kandagatla --- Documentation/ABI/stable/sysfs-bus-nvmem | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/ABI/stable/sysfs-bus-nvmem b/Documentation/ABI/s= table/sysfs-bus-nvmem index 854bd11d72ac..3f0a95250aa8 100644 --- a/Documentation/ABI/stable/sysfs-bus-nvmem +++ b/Documentation/ABI/stable/sysfs-bus-nvmem @@ -20,3 +20,14 @@ Description: ... * 0001000 + +What: /sys/bus/nvmem/devices/.../type +Date: November 2018 +KernelVersion: 5.0 +Contact: Alexandre Belloni +Description: + This read-only attribute allows user to read the NVMEM + device type. Supported types are "Unknown", "EEPROM", + "OTP", "Battery backed", "FRAM". + Note: This file is only present if CONFIG_NVMEM_SYSFS + is enabled. --=20 2.25.1 From nobody Mon Feb 9 03:52:46 2026 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 174351487F7 for ; Fri, 5 Jul 2024 07:49:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165765; cv=none; b=j9gmU6epSfu48HW7yZmTLC6a1hSCjoqPfvk7qz4B7D8y8MfzF1Bk6Tjdt+Rsk8Y6MHX/AKj7Uwv3mTkfVUc9D+p5jJjy4DRGkjHB8Otoj2gOV8+fzyXsdqWqY+37IqepbKvSPSBHstHBZxdgCxYR0VT62D8IAknTEobUoV1AgRI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165765; c=relaxed/simple; bh=aGU0i+e8LTqfCA2uX3KKKSQbgfrowWpA0IV+8zTsXwI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=P510vfqMk3ISOkfo5rgwJfI73WqMnMtjDi5ENxubgdRPWUer+xUHhSXzyGBufYbVp42gXnXFSXW0gF7m4fw5L1jbyEIGje3Y+cGlcepFUUMt91ubWdJ/M1E1kdvz8pLUJy55K64APRpr9i+r2Q+VT1sxpTcrCAphHqIIjXkxlcE= 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=LYGVjNWf; arc=none smtp.client-ip=209.85.128.54 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LYGVjNWf" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-42565670e20so14958265e9.0 for ; Fri, 05 Jul 2024 00:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165762; x=1720770562; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UZ/gbUJARlOgZBmBHD5nmD6UTdrTLHcLtrsmFiCucHU=; b=LYGVjNWfSjalrrdq9mI0kAYHRaGXNBmW49BALVHNS0IXvizBxrJu0rfPnYDV1Agr/V Dl4dO2gTVyO5hypS/sMOtAUgpOeM4U5QrAWs9bkyc33ZmMCkzV/g4W797gAImrKUpdyD 96gtcyi/bf8Wq/Da7qKaOn2L6rq3bg0eA/6a78nIiS63YzkDeBZsJi0SneCbHsI0wFai FbWPlEVje7rolOupc9Mr848goU2tfJlc6aaptY+Dhs8+lP/SN29bAqxafJbj+Mxs3Mo5 Pcptr6kq54dTgo5OZpKFVTRHYP0ZvxLZ1KutSKYcmxnNo1aKopwuryKC9tJD+IqizPeg DprQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165762; x=1720770562; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UZ/gbUJARlOgZBmBHD5nmD6UTdrTLHcLtrsmFiCucHU=; b=I9J+6Qm67/kUOrQkR/u0RgH33FgVGzonVsyQ1HoD0faE4ldJx/yfxR7joZu5sAXqHv KZw+NEeQZ9lP4NIe7DnFCPchejPN++yDJzuB0UEsrrYqgaAUPE/06cqhIucj/0X2Y0B9 Lt+F2SvfMSohEQOW/p2EiZLzikZFOVii7946nW78LPwHTSDSaQ4PchdDc0jtD/qEtsQC CZToK5S5BeOnFUwYXWVz2uUYVwkn0OOjNeHC5r/qrMVLDTk62eM1a6k+0Mo4YIuvtm33 VG7PrwKVtYt0ZY+HUQbvTFHMhZR9Llvb5JxM09raBXALBT8yFTU8bEvbf99Ru9QIbtYD H7eA== X-Gm-Message-State: AOJu0YzGxZxp7Xat2k1kdy4MFBW6lqk1d7QicQRNfPc/A/QoRoCkPMbB j+8MtFwcHNhALcJDvbYNH31AYalmnWTaMYhH7SWVyq6l2GOR3PRLSsgF9QS3D3LwIrj7ApVbWpW fgpE= X-Google-Smtp-Source: AGHT+IEGAhv5ohzGYPfo+pCsNxpMjkhF9JPexhSmyyNt4LZC4RgrzBuHHQ1HNc781kuamE2pIivy1A== X-Received: by 2002:a05:6000:25c:b0:367:8f89:f7c9 with SMTP id ffacd0b85a97d-3679f739cfbmr2754860f8f.33.1720165762603; Fri, 05 Jul 2024 00:49:22 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:21 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Marek Vasut , Srinivas Kandagatla Subject: [PATCH 14/15] nvmem: Use sysfs_emit() for type attribute Date: Fri, 5 Jul 2024 08:48:51 +0100 Message-Id: <20240705074852.423202-15-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Marek Vasut Use sysfs_emit() instead of sprintf() to follow best practice per Documentation/filesystems/sysfs.rst " show() should only use sysfs_emit()... " Signed-off-by: Marek Vasut Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index ec31c1fe9a99..89f632f91768 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -179,7 +179,7 @@ static ssize_t type_show(struct device *dev, { struct nvmem_device *nvmem =3D to_nvmem_device(dev); =20 - return sprintf(buf, "%s\n", nvmem_type_str[nvmem->type]); + return sysfs_emit(buf, "%s\n", nvmem_type_str[nvmem->type]); } =20 static DEVICE_ATTR_RO(type); --=20 2.25.1 From nobody Mon Feb 9 03:52:46 2026 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 53C18148851 for ; Fri, 5 Jul 2024 07:49:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165767; cv=none; b=ENTOkDeOLIwa8MgHNLlyUgRcZNyYbrs7+Kt/D3uqUEeDgjJYo01NZ2KzTzfW66JgBvoQ4Q2y6vG4DNl/R1l/o+pNEQVUfSpCJ4bDIOkQFhGFikA3uCllocORuGvE1Xc8bCHZreB+zUVhUdRMd+HbSzl/hIft8Bd68l3wNZOpmvQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720165767; c=relaxed/simple; bh=4SVfiTT14IOGOJAh8Mvi9GxV+p3w36AIjeJIp5TDoyA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=D3OXkVLUnWIYoTf8FvKnn9+Ero58pV159yA2LmZrMcVZ61KEx2L4JCeFP37twEWKAZeOLGvaetW82hd7J0NV1ZJJfYzoYj4hyjSr35CdwXrUhmAhD5YxQBcemGXeBILVvPPLSW+4P0Kl3mlKXi1Kl/bQu05BfHDnug4q0yK6ibo= 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=U9ie3WvA; arc=none smtp.client-ip=209.85.221.44 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="U9ie3WvA" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-36799fb93baso917303f8f.0 for ; Fri, 05 Jul 2024 00:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720165764; x=1720770564; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3aEiM8GfYg6AtJ01v2ahAsrUKMYrAlMvvkF2JxRpick=; b=U9ie3WvA8D9i+ZtX+SP/C1O75enysY2f8hnLS5hf5ecA4EuUVY3O1qNAPRYFVKYS3b HiPcbN5ty3vWhAaP2Dnvk5GU/kBbqdr0em1Xm17LZTKFMHQ2N/jUM5FBuWBUQcTWyDm5 yH5+2/zWUiItSGDxlXfxYDtQGfISlzQYj6Bkq6qcttYBo/DotpTaixoqRmML/QMQl0U0 2jn8YMMzLJyxdzkJTLyEx4sT4KDvf3basrD+llwDkqDx0rz5wpVEZKH+5kcbdFAqLLGq l+QLJks6oB7izEhAKXRPd8jIAoUz3+hJN6rtXBAWHkZW1zbhXJpFnmIcLAKhFBHs4+Lg r1pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720165764; x=1720770564; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3aEiM8GfYg6AtJ01v2ahAsrUKMYrAlMvvkF2JxRpick=; b=I98rCOZf3VHtX69SZtyz9pUy+XnEdXIQ3WvDMhf5M5xIfs7yJ2xg8oapTrXVEyWqHG fgwYvn9CVGB/rMctw7OSuP7dVkyiw2t1EmB5nZfPyuCHQdmNhtBXFGpWHyYIBBWbe5PZ zP/bTUfS8SnniObDv3uEwpbb2goAhCYpApYGbIKe9LeyyAHGxviCwLS67WpdU+xQaOCM FOQ7eEjSMOOhTAwOWhKZA3g2t8/k08u5G9s2hZlPYQnixHYny8xNp+YN7GlrWR4ltb/S uQywiT0neMruI+Lryc6ZQFGoPopBY2EK5L/jdgke6/zIPsuEuSLLUTWN/I8btQ6I1bct 1N6A== X-Gm-Message-State: AOJu0YxYTa2EgfoJjervM2BG4HtZZLNioiklxLxxMJZPR1323bE1b5zl tXQNCITNIGoH2Az9dJ0G6bvYO5yQ6PhpJ/aWdbT1YIDlXv/UqFCmArpWRtsKd0vXu6nsuBeqApB jivQ= X-Google-Smtp-Source: AGHT+IGopdLfGMm9uiNVdeVOpm8IKahWTLm2cGh7cyoXTR2UBAcZSt4pwuFufMVM+W4nm2jr8hJCRQ== X-Received: by 2002:a5d:4146:0:b0:367:958e:9821 with SMTP id ffacd0b85a97d-3679dd53cb3mr2598197f8f.29.1720165763842; Fri, 05 Jul 2024 00:49:23 -0700 (PDT) Received: from srini-hackbase.lan ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d8ed0sm20183521f8f.28.2024.07.05.00.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:49:22 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Marek Vasut , Srinivas Kandagatla Subject: [PATCH 15/15] nvmem: core: Implement force_ro sysfs attribute Date: Fri, 5 Jul 2024 08:48:52 +0100 Message-Id: <20240705074852.423202-16-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> References: <20240705074852.423202-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Marek Vasut Implement "force_ro" sysfs attribute to allow users to set read-write devices as read-only and back to read-write from userspace. The choice of the name is based on MMC core 'force_ro' attribute. This solves a situation where an AT24 I2C EEPROM with GPIO based nWP signal may have to be occasionally updated. Such I2C EEPROM device is usually set as read-only during most of the regular system operation, but in case it has to be updated in a controlled manner, it could be unlocked using this new "force_ro" sysfs attribute and then re-locked again. The "read-only" DT property and config->read_only configuration is respected and is used to set default state of the device, read-only or read-write, for devices which do implement .reg_write function. For devices which do not implement .reg_write function, the device is unconditionally read-only and the "force_ro" attribute is not visible. Signed-off-by: Marek Vasut Signed-off-by: Srinivas Kandagatla --- Documentation/ABI/stable/sysfs-bus-nvmem | 17 ++++++++++ drivers/nvmem/core.c | 43 ++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/Documentation/ABI/stable/sysfs-bus-nvmem b/Documentation/ABI/s= table/sysfs-bus-nvmem index 3f0a95250aa8..aa89adf18bc5 100644 --- a/Documentation/ABI/stable/sysfs-bus-nvmem +++ b/Documentation/ABI/stable/sysfs-bus-nvmem @@ -1,3 +1,20 @@ +What: /sys/bus/nvmem/devices/.../force_ro +Date: June 2024 +KernelVersion: 6.11 +Contact: Marek Vasut +Description: + This read/write attribute allows users to set read-write + devices as read-only and back to read-write from userspace. + This can be used to unlock and relock write-protection of + devices which are generally locked, except during sporadic + programming operation. + Read returns '0' or '1' for read-write or read-only modes + respectively. + Write parses one of 'YyTt1NnFf0', or [oO][NnFf] for "on" + and "off", i.e. what kstrbool() supports. + Note: This file is only present if CONFIG_NVMEM_SYSFS + is enabled. + What: /sys/bus/nvmem/devices/.../nvmem Date: July 2015 KernelVersion: 4.2 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 89f632f91768..12df7d037d37 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -184,7 +184,30 @@ static ssize_t type_show(struct device *dev, =20 static DEVICE_ATTR_RO(type); =20 +static ssize_t force_ro_show(struct device *dev, struct device_attribute *= attr, + char *buf) +{ + struct nvmem_device *nvmem =3D to_nvmem_device(dev); + + return sysfs_emit(buf, "%d\n", nvmem->read_only); +} + +static ssize_t force_ro_store(struct device *dev, struct device_attribute = *attr, + const char *buf, size_t count) +{ + struct nvmem_device *nvmem =3D to_nvmem_device(dev); + int ret =3D kstrtobool(buf, &nvmem->read_only); + + if (ret < 0) + return ret; + + return count; +} + +static DEVICE_ATTR_RW(force_ro); + static struct attribute *nvmem_attrs[] =3D { + &dev_attr_force_ro.attr, &dev_attr_type.attr, NULL, }; @@ -285,6 +308,25 @@ static umode_t nvmem_bin_attr_is_visible(struct kobjec= t *kobj, return nvmem_bin_attr_get_umode(nvmem); } =20 +static umode_t nvmem_attr_is_visible(struct kobject *kobj, + struct attribute *attr, int i) +{ + struct device *dev =3D kobj_to_dev(kobj); + struct nvmem_device *nvmem =3D to_nvmem_device(dev); + + /* + * If the device has no .reg_write operation, do not allow + * configuration as read-write. + * If the device is set as read-only by configuration, it + * can be forced into read-write mode using the 'force_ro' + * attribute. + */ + if (attr =3D=3D &dev_attr_force_ro.attr && !nvmem->reg_write) + return 0; /* Attribute not visible */ + + return attr->mode; +} + static struct nvmem_cell *nvmem_create_cell(struct nvmem_cell_entry *entry, const char *id, int index); =20 @@ -341,6 +383,7 @@ static const struct attribute_group nvmem_bin_group =3D= { .bin_attrs =3D nvmem_bin_attributes, .attrs =3D nvmem_attrs, .is_bin_visible =3D nvmem_bin_attr_is_visible, + .is_visible =3D nvmem_attr_is_visible, }; =20 static const struct attribute_group *nvmem_dev_groups[] =3D { --=20 2.25.1