From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 779BBC2B9F8 for ; Tue, 25 May 2021 08:27:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 408D2611C9 for ; Tue, 25 May 2021 08:27:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 408D2611C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=F84c5QIlMkQL4weaw8ggg8hwecekep9dy8Xqcb3z0SE=; b=kVeeBnTwTD3oFZl9Kk+MdPkBZi f8abB8rBXCNSUhtJW0MFDp4aSSF+kwfUkZWHwEOyXpO2u+trIYIl2xUwrCzFFJcSbxPUibQrQCQd0 QZt/WxyluiWaAal+bXiJP0F5LjfNKKrQLfPxJDzpGGrq5KmGwcliK1JPgbeAYU2xd9a5Fhbr293wq mPIghvBDHJL2Xd+2qV+lCLrjqKRN4nhOL/MH4Vy1EMU4SVncWVnkkqI8y5fXsu6TQ7VddBY9mXCJI O+az5OldlHV67SrT3i6aGMuBiXCmsK8+5HlAPuqfiWqz6guuYu2ZH0mDcjkKIiShDJ/HdsFfSht0K O+KT4Okw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1llSMa-0044Nl-PJ; Tue, 25 May 2021 08:24:32 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1llSMW-0044LZ-HI for linux-arm-kernel@lists.infradead.org; Tue, 25 May 2021 08:24:30 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 20E84134E; Tue, 25 May 2021 04:24:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 25 May 2021 04:24:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=T/RJ8jiQp+vj5a/FxgpoVSB6RkM 3N/iycSA1uRI4V9Y=; b=E6LWyS/AL240aCpCg0oTZ0rCRNqvK1REKMqJETsp6so q8bfE9MS9h+VozUQoEM7hi/MhlIGzcU9L9B3d92VM2ZBSjkNvOYcNKPiH+GknLad n16W/ULfrI6TMp7ZbmIOZ1ZuakKGOWlJwh8u1tpuXtyiU6vby671YCqzpRGeOX4O iRBl7qXSg019Ix0yP//PuJq5u+OyVnMRa2UY9qZTPj2/BqoiiILzZCpZ8nfBgjps 6+lbg0z6EaZB6hidK1/INdMhQirD5KHhA1/VwHU65RretnDgMq8pWnmV35EjZEeA AaHtRvMEoLYJ/pU6afEVixqLqjKOV5jb0Fx5fB43LTg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=T/RJ8j iQp+vj5a/FxgpoVSB6RkM3N/iycSA1uRI4V9Y=; b=G7dCijkWcD6Lo0klqzMSxH ZxaL1q8SPZdGtIDYRuc1Og+3VIhFgLezP22O7J0VvY3isFt2CWnbADdWA0aWrF1m +W1/OKIC75NNW7Jjk9ll2uRKNs1Q2TeWpAheJC7Kjhb/NcU5YK3Lvdy/DxR1Wlqy k7hF5RmeOFosvr8irUzajWUz2Tkz9LNtpnEcEuwWRME0MwTJUsI+tcH7iAn6/Z3X bnB0+9NWFpwcqay0VZHUnZiU71fQeBdFxbMnopZ3ge8HgJejaKba1llJuNRiNNg/ O+d/bAs/9cHOWCaVGDRI61OuTJQJlGc/lu/JBm/HIRDxcxr6UfopSN6IEUslPMJw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdekuddgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 25 May 2021 04:24:18 -0400 (EDT) Date: Tue, 25 May 2021 10:24:16 +0200 From: Maxime Ripard To: Samuel Holland Cc: Alessandro Zummo , Alexandre Belloni , Chen-Yu Tsai , Jernej Skrabec , linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rtc: sun6i: Add NVMEM provider Message-ID: <20210525082416.jkqmlkbdx6nhrens@gilmour> References: <20210419014549.26900-1-samuel@sholland.org> <20210430090206.lybmygrt636nysoc@gilmour> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210525_012428_623672_CF513FB2 X-CRM114-Status: GOOD ( 29.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============3911031493942317770==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============3911031493942317770== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4ls3b5jytkdblw2f" Content-Disposition: inline --4ls3b5jytkdblw2f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 09, 2021 at 10:39:30PM -0500, Samuel Holland wrote: > On 4/30/21 4:02 AM, Maxime Ripard wrote: > > Hi, > >=20 > > On Sun, Apr 18, 2021 at 08:45:49PM -0500, Samuel Holland wrote: > >> The sun6i RTC provides 32 bytes of general-purpose data registers. > >> They can be used to save data in the always-on RTC power domain. > >> The registers are writable via 32-bit MMIO accesses only. > >> > >> Expose the region as a NVMEM provider so it can be used by userspace a= nd > >> other drivers. > >> > >> Signed-off-by: Samuel Holland > >=20 > > As far as I understood, you want to use those registers to implement > > super-standby? If so, while it makes sense for the kernel to be able to > > be able to write to those registers, I guess it would be a bit unwise to > > allow the userspace to access it? >=20 > I want the user to be able to pass information to the bootloader (to > select a boot device, e.g. reboot to FEL). I also want the user to be > able to read data stored to these registers by system firmware (e.g. > crust writes exception information there). It's not really related to > standby. What information do you want to provide? This looks like punching through the abstraction layer provided by the kernel. This is also an issue since it ties an ABI to the use of crust: if there's another user for those RTC registers at some point, the userspace would have no way to tell whether or not crust is being used and might get complete garbage (compared to what crust usually provides) instead. > I would want to stack a nvmem-reboot-mode on top to give friendlier > names to some of the numbers, but I don't see a problem with root having > direct access to the registers. It's no different from /dev/nvram > providing access to the PC CMOS RAM. And those solutions have issues too. efivarfs for example can totally brick the system it runs on if the user has an unfortunate rm -rf. Maxime --4ls3b5jytkdblw2f Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYKy0MAAKCRDj7w1vZxhR xR+VAP0ZpqtCK0cgTcMjk72tdAhvDqLefB0iokheh3dtgHzhfAEAv6UX65vsXn/P qCCHgsLdWfCH+BHEVtSEd+X1hNOuJwk= =TKw9 -----END PGP SIGNATURE----- --4ls3b5jytkdblw2f-- --===============3911031493942317770== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============3911031493942317770==--