Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2373579pxj; Mon, 10 May 2021 01:03:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/BOvQM8Whp6acWqx6CrXIDqbG+psxJuzbvL+YlYbF/N/D8vWPGInPZP9gfXj4h0QyGOMX X-Received: by 2002:a02:91c1:: with SMTP id s1mr20028973jag.61.1620633801008; Mon, 10 May 2021 01:03:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620633801; cv=none; d=google.com; s=arc-20160816; b=d/Yu0ypdgbkqkxhyhLNPXKF9K/sqbsKROs8tZeDJHHBlVa+USINyp8NnjOE14Tgb1d Aybbo9SwB3ho2wY1BeDaEqdejE2ttdMcsdcAJwy0Zx8gBY9yeTBtFK1Ag3sg/kadIEjU +j/UzmkjuSbdqD4stDxizmWXt92o7fKo+7MMs88lpFlilYUCxSf/vIiSBeVz5YUhYu9i jp4OWqLtJx3zis00B2wSXKyZjF0iKHvFaleCG3DSgJl+BVPylepQPaEG3y9ucxwjGjiM HtBsm3HMWyHzfWJIY2aumoXUZLSb0P05THPZlz5eq9HyXyUUpEKUoyY4IMlxbYOwTk9D HRJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=nj/vcEvCCIk1yKyzfaUV6QzG70q+rCypi+Lrq169A18=; b=qFWgdTZlQ0zURTrq/VRHrDotVxtxdMSExqLBgbMlyrkOqkM8rEvTmn7ia4X1lUCvQs QT7rICAH30ONI/BNo5FFThvnWHudPhaEdJStUCKgqfKY9AAqqaNr/Zt4ob5Q2IlN7XNo j8xwrRx9ZAs+iQOEwHZ+/Oq9fUffpQfJJiVJrwqFpXpchLPCr+GaCUdAtpV4cg9GJRRl 4IyfKYc6ymk0QKyraW2X+/LB9EbbjNBW8iY5bzCfJL78B+4Li5PytETibu2xOG7vvHQK cjzeasELSsrywxkYOSpCaREoSS7C3wpMIUGqnMwdxAu/JRG6dIraB20LTlojO8BBoOdd 031Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e5si14634295jaq.6.2021.05.10.01.03.08; Mon, 10 May 2021 01:03:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230156AbhEJIB6 (ORCPT + 99 others); Mon, 10 May 2021 04:01:58 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:55257 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230153AbhEJIBz (ORCPT ); Mon, 10 May 2021 04:01:55 -0400 X-Originating-IP: 90.65.108.55 Received: from localhost (lfbn-lyo-1-1676-55.w90-65.abo.wanadoo.fr [90.65.108.55]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 3890C240006; Mon, 10 May 2021 08:00:46 +0000 (UTC) Date: Mon, 10 May 2021 10:00:46 +0200 From: Alexandre Belloni To: Samuel Holland Cc: Maxime Ripard , Alessandro Zummo , 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: References: <20210419014549.26900-1-samuel@sholland.org> <20210430090206.lybmygrt636nysoc@gilmour> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/05/2021 22:39:30-0500, Samuel Holland wrote: > On 4/30/21 4:02 AM, Maxime Ripard wrote: > > Hi, > > > > 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 and > >> other drivers. > >> > >> Signed-off-by: Samuel Holland > > > > 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? > > 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. > > 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. > (which is deprecated in favor of nvmem) -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com